Title: Chapter 4 IP Routing
1Chapter 4IP Routing
- Professor Rick Han
- University of Colorado at Boulder
- rhan_at_cs.colorado.edu
2Announcements
- Reminder Programming assignment 1 is due Feb.
19 - Part of Homework 2 available on Web site, due
Feb. 26 - Last weeks lecture are now on Web site
- Next, IP routing,
3Recap of Previous Lecture
- Routing to connect remote LANs
- Encapsulation
- Internet Protocol (IPv4)
- 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)
4Address 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 Ethernets broadcast query (all
1s in 48-bit address) with target IP address - Target host responds with its IP address
- ARP updates its cache
Destination Node
Requesting Node
5ARP (2)
- What if destination host is on a remote LAN?
- No local host will respond to broadcast ARP query
- Solution
- IP end host sends to IP network, which routes
packet to destination IP host - ARP is performed separately on LAN 1 and LAN 2
IP Router
LAN1
LAN2
Destination Node
Requesting Node
6ARP (3)
- On LAN 1
- 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 routers
IP interface address to LAN, if not already
cached - Sends a packet containing ltsrc IP, dest. IPgt
encapsulated by Eth. Header containing dest. MAC
address of IP router
IP Router
LAN1
LAN2
Destination Node
Requesting Node
7ARP (4)
- On LAN 2
- IP packet with ltsrc IP, dest IPgt 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 ltsrc IP, dest. IPgt
encapsulated by Eth. Header containing dest. MAC
address of dest IP end host - Proxy ARP when only one router between two LANs
IP Router
LAN1
LAN2
Destination Node
Requesting Node
8Forwarding Datagrams
Routing Table at Router B
Host 4
Router C
Router X
Router B
Router Y
Host 1
Router E
Router D
Host 2
Host 3
9Forwarding Datagrams (2)
Routing Table at Router E
Host 4
Router C
Router X
Router B
Router Y
Host 1
Router E
Router D
Host 2
Host 3
10Forwarding Datagrams (3)
Routing Table at Router E
- 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
11Forwarding Datagrams (4)
Routing Table at Router E
- Each datagram travels its own independent path
There is no connection unlike VCs - Connectionless datagram networks
- Connection-oriented virtual circuits
12Forwarding Datagrams (5)
Routing Table at Router E
- 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 VCs, where each switch only needed to
keep in its table the virtual circuits that ran
through the switch
13Internet 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 C
Router X
Router B
Router Y
Host 1
Router E
Router D
Host 2
14Internet 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
- Two types of distributed algorithms
- Distance vector (RIP)
- Link state (OSPF)
15Distance 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
16Distance 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
17Distance Vector (3)
- Example courtesy of Prof. Srini Seshan at CMU
1
Distance to Node
B
C
Info at Node
A
B
C
D
E
7
0
7
1
A
B
2
8
A
7
0
1
8
C
1
0
2
D
2
1
2
0
2
E
D
E
1
8
2
0
Global minimum distance table, each row is a
condensed forwarding table for node i
18Distance Vector (4)
Format of Routing/Forwarding Table in A
Format of Distance Table in A
1
Distance via Neighbor
B
C
Dest. Node
Dest. at Node
B
E
Distance
Via Neighbor
7
--
--
--
B
A
A
B
B
8
A
--
--
--
E
C
--
--
C
--
B
D
--
--
D
--
B
1
E
E
--
--
E
--
E
19E Receives Ds Routes Updates Cost
Global minimum distance table, Node i only sees
info on its row, not entire global view
1
Distance to Node
B
C
Info at Node
A
B
C
D
E
7
0
7
1
A
B
2
8
A
7
0
1
8
C
1
0
2
D
2
0
2
1
2
D
E
E
1
8
4
2
0
20A receives Bs Updates Cost
1
Distance to Node
B
C
Info at Node
A
B
C
D
E
7
0
7
8
1
A
B
2
8
A
7
0
1
8
C
1
0
2
D
2
0
2
1
2
D
E
E
1
8
4
2
0
21A receives Es 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
Distance to Node
B
C
Info at Node
A
B
C
D
E
7
0
7
5
3
1
A
B
2
8
A
7
0
1
8
C
1
0
2
D
2
0
2
1
2
D
E
E
1
8
4
2
0
22Final Distances
- Topology/distance info ripples outward from each
node from every other node
1
Distance to Node
B
C
Info at Node
A
B
C
D
E
7
0
6
5
3
1
A
B
2
8
A
6
0
1
3
5
C
5
1
0
2
4
D
3
3
2
0
2
1
2
D
E
E
1
5
4
2
0
23Link Failure Causes Bouncing Effect
dest
cost
dest
cost
via
via
1
X
A
B
B
A
1
1
B
A
C
2
C
1
B
C
1
25
C
dest
cost
via
A
2
B
B
1
B
24B Notices A-B Link Failure
dest
cost
dest
cost
via
via
A
B
B
A
26
1
B
C
C
2
C
1
B
C
1
25
C
dest
cost
via
A
2
B
B
1
B
25C Sends Dist. Vector to B
dest
cost
dest
cost
via
via
A
B
B
A
3
1
B
C
C
2
C
1
B
C
1
25
C
dest
cost
via
A
2
B
B
1
B
26B Updates Distance to A
dest
cost
dest
cost
via
via
A
B
B
A
3
C
1
B
C
2
C
1
B
C
Packet sent from C to A bounces between C and
B until TTL0!
1
25
C
dest
cost
via
A
2
B
B
1
B
27B Sends Dist. Vector to C
dest
cost
dest
cost
via
via
A
B
B
A
3
C
1
B
C
2
C
1
B
C
C adds one to Bs advertised distance to A. (Why
does C override its stored distance of 2 to A
with 4, larger value?)
1
25
C
dest
cost
via
A
4
B
B
1
B
28C Sends Dist. Vector to B
dest
cost
dest
cost
via
via
A
B
B
A
5
C
1
B
C
2
C
1
B
C
B adds one to Cs advertised distance to A.
(overrides its stored distance of 3 to A with
5, larger value)
1
25
C
dest
cost
via
A
4
B
B
1
B
29Link Failure Bad News Travels Slowly
dest
cost
dest
cost
via
via
A
B
B
A
25
C
26
C
C
25
C
1
C
C
After 20 exchanges, routing tables look like
this
1
25
Assume A has advertised its link cost of 25 to C
during Blt-gtC exchanges. C stores this cost in
its distance table (not shown)
C
dest
cost
via
A
24
B
B
1
B
30Bad News Travels Slowly (2)
dest
cost
dest
cost
via
via
A
B
B
A
25
C
26
C
C
25
C
1
C
C
C increments Bs update by 1, and chooses 25 via
A to A, instead of 26 Via B to A
1
25
C
dest
cost
via
A
25
A
B
1
B
31Bad News Travels Slowly (3)
dest
cost
dest
cost
via
via
A
B
B
A
26
C
26
C
C
25
C
1
C
C
After 25 B-C exchanges, finally converge
to stable routing
1
25
C
dest
cost
via
A
25
A
B
1
B
32Link Failure Causes Counting to Infinity Effect
dest
cost
dest
cost
via
via
1
X
A
B
B
A
1
1
B
A
C
2
C
1
B
C
1
25
C
dest
cost
via
A
2
B
B
1
B
33B Notices A-B Link Failure
dest
cost
dest
cost
via
via
A
B
B
A
26
1
B
C
C
2
C
1
B
C
1
25
C
dest
cost
via
A
2
B
B
1
B
34C Sends Dist. Vector to B
dest
cost
dest
cost
via
via
A
B
B
A
3
C
1
B
C
2
C
1
B
C
1
25
C
dest
cost
via
A
2
B
B
1
B
35A-C Link Fails
dest
cost
via
A
B
A
3
C
C
1
C
1
C detects link to A has failed, but no change in
Cs routing table (why?)
C
dest
cost
via
A
2
B
B
1
B
36Now, B and C Count to Infinity
dest
cost
via
A
B
A
3
C
C
1
C
1
C
dest
cost
via
A
4
B
B
1
B
37How are These Loops Caused?
- Observation 1
- Bs metric increases
- Observation 2
- C picks B as next hop to A
- But, the implicit path from C to A includes
itself (C ) !
38Solution 1 Holddowns
- If metric increases, delay propagating
information - In our example, B delays advertising route
- C eventually thinks Bs route is gone, picks its
own route - B then selects C as next hop
- Adversely affects convergence from failures
39Other 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
40Avoiding 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
41Loop 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
42Distance Vector in Practice
- RIP and RIP2
- Uses split-horizon/poison reverse
- BGP
- Propagates entire path
- Path also used for effecting policies
43Example Where Split Horizon Fails
- 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
cost3 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...
1
A
B
1
1
C
X
1
D