790 likes | 805 Views
Roadmap. Routing in the Internet Routing algorithms Routing Protocols Intra-AS routing: RIP and OSPF Inter-AS routing: BGP. Routing in the Internet. The Global Internet consists of Autonomous Systems (AS) interconnected with each other:
E N D
Roadmap • Routing in the Internet • Routing algorithms • Routing Protocols • Intra-AS routing: RIP and OSPF • Inter-AS routing: BGP Xin Liu
Routing in the Internet • The Global Internet consists of Autonomous Systems (AS) interconnected with each other: • Stub AS: small corporation: one connection to other AS’s • Multihomed AS: large corporation (no transit): multiple connections to other AS’s • Transit AS: provider, hooking many AS’s together • Two-level routing: • Intra-AS: administrator responsible for choice of routing algorithm within network • Inter-AS: unique standard for inter-AS routing: BGP Xin Liu
Internet AS Hierarchy Inter-AS border (exterior gateway) routers Intra-ASinterior routers Xin Liu
Intra-AS Routing • Also known as Interior Gateway Protocols (IGP) • Most common Intra-AS routing protocols: • RIP: Routing Information Protocol • OSPF: Open Shortest Path First • IGRP: Interior Gateway Routing Protocol (Cisco proprietary) Xin Liu
RIP ( Routing Information Protocol) • Distance vector algorithm • Included in BSD-UNIX Distribution in 1982 • Distance metric: # of hops (max = 15 hops) • Can you guess why? • Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) • Each advertisement: list of up to 25 destination nets within AS Xin Liu
RIP: Example z w x y A D B C Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1 …. …. .... Routing table in D Xin Liu
RIP: Example z w x y A D B C Dest Next hops w - - x - - z C 4 …. … ... Advertisement from A to D Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B A 7 5 x -- 1 …. …. .... Routing table in D Xin Liu
RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead • routes via neighbor invalidated • new advertisements sent to neighbors • neighbors in turn send out new advertisements (if tables changed) • link failure info quickly propagates to entire net • poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) Xin Liu
RIP Table processing routed routed • RIP routing tables managed by application-level process called route-d (daemon) • advertisements sent in UDP packets, periodically repeated Transprt (UDP) Transprt (UDP) network forwarding (IP) table network (IP) forwarding table link link physical physical Xin Liu
RIP Table example (continued) Router: giroflee.eurocom.fr Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 127.0.0.1 127.0.0.1 UH 0 26492 lo0 192.168.2. 192.168.2.5 U 2 13 fa0 193.55.114. 193.55.114.6 U 3 58503 le0 192.168.3. 192.168.3.5 U 2 25 qaa0 224.0.0.0 193.55.114.6 U 3 0 le0 default 193.55.114.129 UG 0 143454 • Three attached networks (LANs) • Router only knows routes to attached LANs • Default router used to “go up” • Route multicast address: 224.0.0.0 • Loopback interface (for debugging) Xin Liu
OSPF (Open Shortest Path First) • “open”: publicly available • Uses Link State algorithm • LS packet dissemination • Topology map at each node • Route computation using Dijkstra’s algorithm • OSPF advertisement carries one entry per neighbor router • Advertisements disseminated to entire AS (via flooding) • Carried in OSPF messages directly over IP (rather than TCP or UDP Xin Liu
OSPF “advanced” features (not in RIP) • Security: all OSPF messages authenticated (to prevent malicious intrusion) • Multiple same-cost paths allowed (only one path in RIP) • For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) • Integrated uni- and multicast support: • Multicast OSPF (MOSPF) uses same topology data base as OSPF • Hierarchical OSPF in large domains. Xin Liu
Hierarchical OSPF Xin Liu
Hierarchical OSPF • Two-level hierarchy: local area, backbone. • Link-state advertisements only in area • each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. • Area border routers:“summarize” distances to nets in own area, advertise to other Area Border routers. • Backbone routers: run OSPF routing limited to backbone. • Boundary routers: connect to other AS’s. Xin Liu
Internet inter-AS routing: BGP • BGP (Border Gateway Protocol):the de facto standard • Path Vector protocol: • similar to Distance Vector protocol • each Border Gateway broadcast to neighbors (peers) entire path (i.e., sequence of AS’s) to destination • BGP routes to networks (ASs), not individual hosts • E.g., Gateway X may send its path to dest. Z: Path (X,Z) = X,Y1,Y2,Y3,…,Z Xin Liu
Internet inter-AS routing: BGP Suppose: gateway X send its path to peer gateway W • W may or may not select path offered by X • cost, policy (don’t route via competitors AS), loop prevention reasons. • If W selects path advertised by X, then: Path (W,Z) = w, Path (X,Z) • Note: X can control incoming traffic by controlling it route advertisements to peers: • e.g., don’t want to route traffic to Z -> don’t advertise any routes to Z Xin Liu
BGP: controlling who routes to you • A,B,C are provider networks • X,W,Y are customer (of provider networks) • X is dual-homed: attached to two networks • X does not want to route from B via X to C • .. so X will not advertise to B a route to C Xin Liu
BGP: controlling who routes to you • A advertises to B the path AW • B advertises to X the path BAW • Should B advertise to C the path BAW? • No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers • B wants to force C to route to w via A • B wants to route only to/from its customers! Xin Liu
BGP operation Q: What does a BGP router do? • Receiving and filtering route advertisements from directly attached neighbor(s). • Route selection. • To route to destination X, which path (of several advertised) will be taken? • Sending route advertisements to neighbors. Xin Liu
BGP messages • BGP messages exchanged using TCP. • BGP messages: • OPEN: opens TCP connection to peer and authenticates sender • UPDATE: advertises new path (or withdraws old) • KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request • NOTIFICATION: reports errors in previous msg; also used to close connection Xin Liu
Why different Intra- and Inter-AS routing ? Policy: • Inter-AS: admin wants control over how its traffic routed, who routes through its net. • Intra-AS: single admin, so no policy decisions needed Scale: • hierarchical routing saves table size, reduced update traffic Performance: • Intra-AS: can focus on performance • Inter-AS: policy may dominate over performance Xin Liu
used by hosts, routers, gateways to communication network-level information network-layer “above” IP: ICMP msgs carried in IP datagrams Two types: error reporting unreachable host, network, port, protocol, fragment needed by DF bit set Time exceeded (TTL) etc. Query/response Echo request/reply Timestamp request/reply Address mask request/reply ICMP: Internet Control Message Protocol Xin Liu
ICMP TypeCode description Query Error 0 0 echo reply (ping) x 3 0 dest. network unreachable x 3 1 dest host unreachable x 3 2 dest protocol unreachable x 3 3 dest port unreachable x 3 6 dest network unknown x 3 7 dest host unknown x 4 0 source quench (congestion x control - not used) 8 0 echo request (ping) x 9 0 route advertisement x 10 0 router discovery x 11 0 TTL expired x 12 0 bad IP header x Xin Liu
ICMP 8-bit code 16-bit checksum 8-bit type Contents depends on type and code IP datagram IP header ICMP message Xin Liu
Error message • ICMP error message: • ICMP header: • type, code, checksum, • ICMP message • IP header plus first 8 bytes of IP datagram causing error • To prevent broadcast storm: NOT generate ICMP in response to • ICMP error message • Dest=IP broadcast address • Link layer broadcast • A fragment other than the first • Source address not defined as a single host Xin Liu
Ping • Basic connectivity test • uses ICMP eco request/reply messages instead of UDP/TCP. • Client/server paradigm • Usually implemented in the kernel. • “man ping” Xin Liu
Format code(0) 16-bit checksum type (0) Optional data sequence no. identifier Xin Liu
Ping bread% ping -s shannon.cs.ucdavis.edu PING shannon.cs.ucdavis.edu: 56 data bytes 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=0. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=1. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=2. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=3. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=4. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=5. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=6. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=7. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=8. time=0. ms 64 bytes from shannon.cs.ucdavis.edu (169.237.6.199): icmp_seq=9. time=0. ms … ----shannon.cs.ucdavis.edu PING Statistics---- 30 packets transmitted, 30 packets received, 0% packet loss round-trip (ms) min/avg/max = 0/0/0 Xin Liu
Ping bread% ping -s mark.ecn.purdue.edu PING mark.ecn.purdue.edu: 56 data bytes 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=0. time=66. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=1. time=64. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=3. time=64. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=4. time=65. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=5. time=64. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=8. time=65. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=10. time=65. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=11. time=65. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=12. time=65. ms 64 bytes from mark.ecn.purdue.edu (128.46.209.167): icmp_seq=15. time=64. ms ^C ----mark.ecn.purdue.edu PING Statistics---- 18 packets transmitted, 10 packets received, 44% packet loss round-trip (ms) min/avg/max = 64/65/66 Xin Liu
Traceroute • By Van Jacobson • See route that IP datagram follow • Use ICMP and TTL • A router gets an IP datagram with TTL 0/1, discards the packet and sends back an ICMP to the source “time exceeded”. • Source sends UDP fragment with 1,2,3, TTL values • IP packet contains an UDP with unused post #. dest. Replies “port unreachable” ICMP message. Xin Liu
Traceroute bread% traceroute ector.cs.purdue.edu traceroute: Warning: Multiple interfaces found; using 169.237.6.16 @ qfe0 traceroute to ector.cs.purdue.edu (128.10.2.10), 30 hops max, 40 byte packets 1 169.237.5.254 (169.237.5.254) 0.594 ms 0.337 ms 0.298 ms 2 169.237.246.238 (169.237.246.238) 0.533 ms 0.479 ms 0.474 ms 3 128.120.2.49 (128.120.2.49) 0.547 ms 0.475 ms 0.475 ms 4 core0.ucdavis.edu (128.120.0.30) 0.616 ms 0.671 ms 0.642 ms 5 area0-area14p.ucdavis.edu (128.120.0.222) 0.570 ms 0.468 ms 0.821 ms 6 area14p-border20.ucdavis.edu (128.120.0.250) 1.149 ms 0.691 ms 3.132 ms 7 dc-oak-dc2--ucd-ge.cenic.net (137.164.24.225) 4.751 ms 2.434 ms 4.521 ms 8 dc-oak-dc1--oak-dc2-ge.cenic.net (137.164.22.36) 2.394 ms 4.217 ms 2.452 ms 9 dc-svl-dc1--oak-dc1-10ge.cenic.net (137.164.22.30) 201.245 ms 5.091 ms 183.393 ms 10 dc-sol-dc1--svl-dc1-pos.cenic.net (137.164.22.28) 13.421 ms 11.258 ms 11.155 ms 11 hpr-lax-hrp1--dc-lax-dc1-ge.cenic.net (137.164.22.13) 11.571 ms 14.390 ms 11.809 ms 12 abilene-LA--hpr-lax-gsr1-10ge.cenic.net (137.164.25.3) 13.431 ms 11.417 ms 11.289 ms 13 snvang-losang.abilene.ucaid.edu (198.32.8.95) 19.141 ms 20.516 ms 19.117 ms 14 kscyng-snvang.abilene.ucaid.edu (198.32.8.103) 54.300 ms 53.943 ms 53.998 ms 15 iplsng-kscyng.abilene.ucaid.edu (198.32.8.80) 64.783 ms 68.220 ms 63.659 ms 16 ul-abilene.indiana.gigapop.net (192.12.206.250) 63.567 ms 63.381 ms 63.025 ms 17 tel-210-m10-01-gp.tcom.purdue.edu (192.5.40.9) 65.017 ms * 64.982 ms 18 cs-2u01-c3550-01-242.tcom.purdue.edu (128.210.242.51) 65.527 ms 65.282 ms 65.083 ms 19 * ector.cs.purdue.edu (128.10.2.10) 65.528 ms * Xin Liu
DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on” Support for mobile users who want to join network (more shortly) DHCP overview: • host broadcasts “DHCP discover” msg • DHCP server responds with “DHCP offer” msg • host requests IP address: “DHCP request” msg • DHCP server sends address: “DHCP ack” msg Xin Liu
DHCP client-server scenario E B A 223.1.2.1 DHCP 223.1.1.1 server 223.1.1.2 223.1.2.9 223.1.1.4 223.1.2.2 arriving DHCP client needs address in this network 223.1.1.3 223.1.3.27 223.1.3.2 223.1.3.1 Xin Liu
DHCP client-server scenario DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 arriving client DHCP server: 223.1.2.5 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 Lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs time DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs Xin Liu
NAT: Network Address Translation rest of Internet local network (e.g., home network) 10.0.0/24 10.0.0.1 10.0.0.4 10.0.0.2 138.76.29.7 10.0.0.3 Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers Xin Liu
NAT: Network Address Translation • Motivation: local network uses just one IP address as far as outside word is concerned: • no need to be allocated range of addresses from ISP: - just one IP address is used for all devices • can change addresses of devices in local network without notifying outside world • can change ISP without changing addresses of devices in local network • devices inside local net not explicitly addressable, visible by outside world (a security plus). Xin Liu
NAT: Network Address Translation Implementation: NAT router must: • outgoing datagrams:replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. • remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair • incoming datagrams:replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Xin Liu
NAT: Network Address Translation 2 4 1 3 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1: host 10.0.0.1 sends datagram to 128.119.40, 80 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table S: 128.119.40.186, 80 D: 10.0.0.1, 3345 S: 128.119.40.186, 80 D: 138.76.29.7, 5001 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… …… 10.0.0.1 10.0.0.4 10.0.0.2 138.76.29.7 10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345 3: Reply arrives dest. address: 138.76.29.7, 5001 Xin Liu
NAT: Network Address Translation • 16-bit port-number field: • 60,000 simultaneous connections with a single LAN-side address! • NAT is controversial: • routers should only process up to layer 3 • violates end-to-end argument • NAT possibility must be taken into account by app designers, eg, P2P applications • address shortage should instead be solved by IPv6 Xin Liu
IPv6 • Initial motivation:32-bit address space completely allocated by 2008. • Additional motivation: • header format helps speed processing/forwarding • header changes to facilitate QoS • new “anycast” address: route to “best” of several replicated servers • IPv6 datagram format: • fixed-length 40 byte header • no fragmentation allowed Xin Liu
IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data Xin Liu
Other Changes from IPv4 • Checksum:removed entirely to reduce processing time at each hop • Options: allowed, but outside of header, indicated by “Next Header” field • ICMPv6: new version of ICMP • additional message types, e.g. “Packet Too Big” • multicast group management functions Xin Liu
Transition From IPv4 To IPv6 • Not all routers can be upgraded simultaneous • no “flag days” • How will the network operate with mixed IPv4 and IPv6 routers? • Two proposed approaches: • Dual Stack: some routers with dual stack (v6, v4) can “translate” between formats • Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Xin Liu
Dual Stack Approach Flow: ?? Src: A Dest: F data Flow: X Src: A Dest: F data C A B E F D Src:A Dest: F data Src:A Dest: F data IPv6 IPv6 IPv6 IPv6 IPv4 IPv4 A-to-B: IPv6 B-to-C: IPv4 B-to-C: IPv6 B-to-C: IPv4 Xin Liu
Tunneling Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data A B E F F B E C D A Src:B Dest: E Src:B Dest: E tunnel Logical view: IPv6 IPv6 IPv6 IPv6 Physical view: IPv6 IPv6 IPv6 IPv6 IPv4 IPv4 A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 Xin Liu
What is mobility? no mobility high mobility • spectrum of mobility, from thenetwork perspective: mobile user, using same access point mobile user, passing through multiple access point while maintaining ongoing connections (like cell phone) mobile user, connecting/ disconnecting from network using DHCP. Xin Liu
Mobility: Vocabulary home network: permanent “home” of mobile (e.g., 128.119.40/24) home agent: entity that will perform mobility functions on behalf of mobile, when mobile is remote wide area network Permanent address: address in home network, can always be used to reach mobile e.g., 128.119.40.186 correspondent Xin Liu
Mobility: more vocabulary visited network: network in which mobile currently resides (e.g., 79.129.13/24) Permanent address: remains constant (e.g., 128.119.40.186) Care-of-address: address in visited network. (e.g., 79,129.13.2) wide area network Foreign agent: entity in visited network that performs mobility functions on behalf of mobile. correspondent: wants to communicate with mobile Xin Liu
How do you contact a mobile friend: • search all phone books? • call her parents? • expect her to let you know where he/she is? I wonder where Alice moved to? Consider friend frequently changing addresses, how do you find her? Xin Liu