Chapter 4 IP Routing Professor Rick Han University

  • Slides: 43
Download presentation
Chapter 4 IP Routing Professor Rick Han University of Colorado at Boulder rhan@cs. colorado.

Chapter 4 IP Routing Professor Rick Han University of Colorado at Boulder rhan@cs. colorado. edu Prof. Rick Han, University of Colorado at Boulder

Announcements • Reminder: Programming assignment #1 is due Feb. 19 • Part of Homework

Announcements • Reminder: Programming assignment #1 is due Feb. 19 • Part of Homework #2 available on Web site, due Feb. 26 • Last week’s lecture are now on Web site • Next, IP routing, … Prof. Rick Han, University of Colorado at Boulder

Recap of Previous Lecture • Routing to connect remote LANs • Encapsulation • •

Recap of Previous Lecture • Routing to connect remote LANs • Encapsulation • • • Connects Networks of Networks “Best-Effort” Service IP Packet Header – 20 bytes • TTL IP Addressing – 32 bit, heirarchy, 128. 72. 191. 4 IP Fragmentation and Reassembly Address Resolution Protocol (ARP) • Internet Protocol (IPv 4) • • • Prof. Rick Han, University of Colorado at Boulder

Address Resolution Protocol (ARP) • Given a known IP address, ARP returns the desired

Address Resolution Protocol (ARP) • Given a known IP address, ARP returns the desired Ethernet MAC address • If sending to a host on the same Ethernet, • • First, check cache if address already present If not, send an Ethernet’s broadcast query (all 1’s in 48 -bit address) with “target IP” address • Target host responds with its IP address • ARP updates its cache Destination Node Eth. Header IP Hdr has dest. MAC ARP query ARP response Requesting Node Prof. Rick Han, University of Colorado at Boulder

ARP (2) • What if destination host is on a remote LAN? • No

ARP (2) • What if destination host is on a remote LAN? • No local host will respond to broadcast ARP query • IP end host sends to IP network, which routes packet to destination IP host ARP is performed separately on LAN 1 and LAN 2 • Solution: • IP Router LAN 1 LAN 2 Requesting Destination Node Prof. Rick Han, University of. Node Colorado at Boulder

 • On LAN 1: • • • ARP (3) IP routers broadcast ICMP

• On LAN 1: • • • ARP (3) IP routers broadcast ICMP “router advertisements” on local LAN or impatient end host broadcasts “solicitations” When IP end host wants to send outside of LAN, it does ARP request to find MAC address of router’s IP interface address to LAN, if not already cached Sends a packet containing <src IP, dest. IP> encapsulated by Eth. Header containing dest. MAC address of IP router IP Router LAN 1 LAN 2 Requesting Destination Node Prof. Rick Han, University of. Node Colorado at Boulder

 • On LAN 2: • • • ARP (4) IP packet with <src

• On LAN 2: • • • ARP (4) IP packet with <src IP, dest IP> arrives at IP router on LAN 2 IP router does an ARP request to find MAC address of dest IP end host, if not already cached Sends a packet containing <src IP, dest. IP> encapsulated by Eth. Header containing dest. MAC address of dest IP end host • Proxy ARP when only one router between two LANs IP Router LAN 1 LAN 2 Requesting Destination Node Prof. Rick Han, University of. Node Colorado at Boulder

Forwarding Datagrams Routing Table at Router B Destination Host 1 Host 2 Host 3

Forwarding Datagrams Routing Table at Router B Destination Host 1 Host 2 Host 3 Output Port X-B link E-B link D-B link Host 4 C-B link Router X Router B Router C Host 1 Router D Host 3 Prof. Rick Han, University of Colorado at Boulder Host 4 Router Y Router E Host 2

Forwarding Datagrams (2) Routing Table at Router E Destination Host 1 Host 2 Host

Forwarding Datagrams (2) Routing Table at Router E Destination Host 1 Host 2 Host 3 Output Port B-E link Y-E link D-E link Host 4 C-E link Router X Router B Router C Host 1 Router D Host 3 Prof. Rick Han, University of Colorado at Boulder Host 4 Router Y Router E Host 2

Forwarding Datagrams (3) Routing Table at Router E Destination Host 1 Host 2 Host

Forwarding Datagrams (3) Routing Table at Router E Destination Host 1 Host 2 Host 3 Output Port B-E link Y-E link D-E link Host 4 C-E link • Only need to know the destination address to route the datagram to output port. Compare to: • • VC routing tables had 4 columns: input VC, input port, output VC, output port Ethernet Bridge tables store the source address and source port/LAN, but forwards using destination address Prof. Rick Han, University of Colorado at Boulder

Forwarding Datagrams (4) Routing Table at Router E Destination Host 1 Host 2 Host

Forwarding Datagrams (4) Routing Table at Router E Destination Host 1 Host 2 Host 3 Output Port B-E link Y-E link D-E link Host 4 C-E link • Each datagram travels its own independent path: There is no connection unlike VCs • • “Connectionless” datagram networks “Connection-oriented” virtual circuits Prof. Rick Han, University of Colorado at Boulder

Forwarding Datagrams (5) Routing Table at Router E Destination Host 1 Host 2 Host

Forwarding Datagrams (5) Routing Table at Router E Destination Host 1 Host 2 Host 3 Output Port B-E link Y-E link D-E link Host 4 C-E link • Each routing table has to contain a complete list of all of the hosts on the net and how to get to them (next hop output port) • • Implications on scalability Compare to VC’s, where each switch only needed to keep in its table the virtual circuits that ran through the switch Prof. Rick Han, University of Colorado at Boulder

Internet Routing • “Routing” helps to fill in the IP forwarding tables • IP

Internet Routing • “Routing” helps to fill in the IP forwarding tables • IP routing employs a distributed algorithm to calculated the shortest path through a graph • Many challenges to make distributed algorithms work well Homogeneous IP routing fabric Router X Host 1 Router B Router C Router D Prof. Rick Han, University of Colorado at Boulder Router Y Router E Host 2

Internet Routing (2) • • • Routing algorithms view the network as a graph

Internet Routing (2) • • • Routing algorithms view the network as a graph Problem: find lowest cost path between two nodes. What info is required for solution? • • Need complete topology info Need link costs • Distance vector (RIP) Link state (OSPF) Two types of distributed algorithms: • Prof. Rick Han, University of Colorado at Boulder

Distance Vector (RIP) Employed in the early Arpanet • RIP = Routing Information Protocol

Distance Vector (RIP) Employed in the early Arpanet • RIP = Routing Information Protocol • • A specific implementation of distance-vector routing Distributed next hop computation • Unit of information exchange • • • Vector of distances to destinations Distributed Bellman-Ford Algorithm Prof. Rick Han, University of Colorado at Boulder

Distance Vector (2) • Start Conditions: • Each router starts with a vector of

Distance Vector (2) • Start Conditions: • Each router starts with a vector of distances to all directly attached networks • Send step: • Each router advertises its current vector to all neighboring routers • Receive step: • • Upon receiving vectors from each of its neighbors, router computes its own distance to each neighbor Then, for every network X, router finds that neighbor who is closer to X than any other neighbor Router updates its cost to X After doing this for all X, router goes to send step Prof. Rick Han, University of Colorado at Boulder

Distance Vector (3) • Example courtesy of Prof. Srini Seshan at CMU 1 B

Distance Vector (3) • Example courtesy of Prof. Srini Seshan at CMU 1 B C 7 8 A 1 2 2 E D Distance to Node Info at Node A B C D E A 0 7 ~ ~ 1 B C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 ~ 2 0 Global minimum distance table, each row is a condensed forwarding Prof. Rick Han, University of table for node i Colorado at Boulder

Distance Vector (4) Format of Distance Table in A Dest. Node 7 A 1

Distance Vector (4) Format of Distance Table in A Dest. Node 7 A 1 Distance via Neighbor B C B E A -- -- B -- 8 -- 1 D E C Format of Routing/Forwarding Table in A Dest. at Node Distance Via Neighbor A -- B --- B C --- E B -- -- D -- B E-- -- E Prof. Rick Han, University of Colorado at Boulder

E Receives D’s Routes; Updates Cost Global minimum distance table, Node i only sees

E Receives D’s Routes; Updates Cost Global minimum distance table, Node i only sees info on its row, not entire global view 1 B C 7 8 A 1 2 2 E D Distance to Node Info at Node A B C D E A 0 7 ~ ~ 1 B C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 Prof. Rick Han, University of Colorado at Boulder

A receives B’s; Updates Cost 1 B C 7 8 A 1 2 2

A receives B’s; Updates Cost 1 B C 7 8 A 1 2 2 E D Distance to Node Info at Node A B C D E A 0 7 8 ~ 1 B C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 Prof. Rick Han, University of Colorado at Boulder

A receives E’s routes; Updates Costs For every dest. node X, router finds that

A receives E’s routes; Updates Costs For every dest. node X, router finds that neighbor who is closer to X than any other neighbor & updates its cost to X 1 B C 7 8 A 1 2 2 E D Distance to Node Info at Node A B C D E A 0 7 5 3 1 B C 7 ~ 0 1 1 0 ~ 2 8 ~ D ~ ~ 2 0 2 E 1 8 4 2 0 Prof. Rick Han, University of Colorado at Boulder

Final Distances • Topology/distance info ripples outward from each node from every other node

Final Distances • Topology/distance info ripples outward from each node from every other node 1 B C 7 8 A 1 2 2 E D Distance to Node Info at Node A B C D E A 0 6 5 3 1 B C 6 5 0 1 1 0 3 2 5 4 D 3 3 2 0 2 E 1 5 4 2 0 Prof. Rick Han, University of Colorado at Boulder

Link Failure Causes “Bouncing” Effect dest B C cost via 1 2 B B

Link Failure Causes “Bouncing” Effect dest B C cost via 1 2 B B dest 1 X A A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 2 1 B B cost via 1 1 A C

B Notices A-B Link Failure dest B C B notices failure, resets cost via

B Notices A-B Link Failure dest B C B notices failure, resets cost via A to infinity in distance table (not shown), & knows cost via C is 26 cost via 1 2 B B dest A A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 2 1 B B cost via 26 1 C C

C Sends Dist. Vector to B dest B C cost via 1 2 B

C Sends Dist. Vector to B dest B C cost via 1 2 B B dest A A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 3 1 C sends routing update to B cost via 2 1 B B C C

B Updates Distance to A dest B C cost via 1 2 B B

B Updates Distance to A dest B C cost via 1 2 B B dest A A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 3 C 1 C Packet sent from C to A bounces between C and B cost via until TTL=0! 2 1 B B

B Sends Dist. Vector to C dest B C cost via 1 2 B

B Sends Dist. Vector to C dest B C cost via 1 2 B B dest A B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder A C cost via 3 C 1 C C adds one to B’s advertised distance to A. (Why does C cost via override 4 B its stored 1 B distance of 2 to A with 4, larger value? )

C Sends Dist. Vector to B dest B C cost via 1 2 B

C Sends Dist. Vector to B dest B C cost via 1 2 B B dest A B 25 C A C cost via 5 C 1 C B adds one to C’s 1 advertised distance to A. (overrides its stored dest cost via distance of 3 A 4 to A with 5, B B 1 B larger value) Prof. Rick Han, University of Colorado at Boulder

Link Failure: Bad News Travels Slowly dest B C cost via 26 25 C

Link Failure: Bad News Travels Slowly dest B C cost via 26 25 C C dest A A C B Assume A has advertised C its link cost of 25 to C during B<->C exchanges. C stores this cost in its distance table (not shown) dest A B Prof. Rick Han, University of Colorado at Boulder 25 C 1 C After 20+ exchanges, routing tables look like this: 1 25 cost via 24 1 B B

Bad News Travels Slowly (2) dest B C cost via 26 25 C C

Bad News Travels Slowly (2) dest B C cost via 26 25 C C dest A A C B 25 C cost via 25 C 1 C C increments B’s 1 update by 1, and chooses 25 via A to A, instead of 26 dest cost via Via B to A A B Prof. Rick Han, University of Colorado at Boulder 25 A 1 B

Bad News Travels Slowly (3) dest B C cost via 26 25 C C

Bad News Travels Slowly (3) dest B C cost via 26 25 C C dest A A C B C dest A B Prof. Rick Han, University of Colorado at Boulder 26 C 1 C After 25 B-C exchanges, finally converge to stable routing 1 25 cost via 25 A 1 B

Link Failure Causes “Counting to Infinity” Effect dest B C cost via 1 2

Link Failure Causes “Counting to Infinity” Effect dest B C cost via 1 2 B B dest 1 X A A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 2 1 B B cost via 1 1 A C

B Notices A-B Link Failure dest B C B notices failure, resets cost to

B Notices A-B Link Failure dest B C B notices failure, resets cost to 26 cost via 1 2 B B A dest A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 2 1 B B cost via 26 1 C C

C Sends Dist. Vector to B dest B C cost via 1 2 B

C Sends Dist. Vector to B dest B C cost via 1 2 B B dest A A C B 1 25 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 3 C 1 C C sends routing update to B cost via 2 1 B B

A-C Link Fails dest A A C B C detects link to A has

A-C Link Fails dest A A C B C detects link to A has failed, but no change in C’s routing table (why? ) 1 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 2 1 B B cost via 3 C 1 C

Now, B and C Count to Infinity dest A A C B 1 C

Now, B and C Count to Infinity dest A A C B 1 C dest A B Prof. Rick Han, University of Colorado at Boulder cost via 4 1 B B cost via 3 C 1 C

How are These Loops Caused? • Observation 1: – B’s metric increases • Observation

How are These Loops Caused? • Observation 1: – B’s metric increases • Observation 2: – C picks B as next hop to A – But, the implicit path from C to A includes itself (C ) ! Prof. Rick Han, University of Colorado at Boulder

Solution 1: Holddowns • If metric increases, delay propagating information – In our example,

Solution 1: Holddowns • If metric increases, delay propagating information – In our example, B delays advertising route – C eventually thinks B’s route is gone, picks its own route – B then selects C as next hop • Adversely affects convergence from failures Prof. Rick Han, University of Colorado at Boulder

Other “Solutions” • Split horizon – C does not advertise route to B when

Other “Solutions” • Split horizon – C does not advertise route to B when it sends its distance vector • Poisoned reverse – C advertises route to B with infinite distance in its distance vector • Works for two node loops – Does not work for loops with more nodes Prof. Rick Han, University of Colorado at Boulder

Avoiding the Counting to Infinity Effect • Select loop-free paths • One way of

Avoiding the Counting to Infinity Effect • Select loop-free paths • One way of doing this: – Each route advertisement carries entire path – If a router sees itself in path, it rejects the route • BGP does it this way • Space proportional to diameter Prof. Rick Han, University of Colorado at Boulder

Loop Freedom at Every Instant? • Does bouncing effect avoid loops? – No! Transient

Loop Freedom at Every Instant? • Does bouncing effect avoid loops? – No! Transient loops are still possible – Why? Because implicit path information may be stale – See this in BGP convergence • Only way to fix this – Ensure that you have up-to-date information by explicitly querying Prof. Rick Han, University of Colorado at Boulder

Distance Vector in Practice • RIP and RIP 2 – Uses split-horizon/poison reverse •

Distance Vector in Practice • RIP and RIP 2 – Uses split-horizon/poison reverse • BGP – Propagates entire path – Path also used for effecting policies Prof. Rick Han, University of Colorado at Boulder

Example Where Split Horizon Fails 1 A 1 1 C X 1 D B

Example Where Split Horizon Fails 1 A 1 1 C X 1 D B • When link breaks, C marks D as unreachable and reports that to A and B • Suppose A learns it first – A now thinks best path to D is through B – A reports D unreachable to B and a route of cost=3 to C • C thinks D is reachable through A at cost 4 and reports that to B • B reports a cost 5 to A who reports new cost to C • etc. . . Prof. Rick Han, University of Colorado at Boulder