CS 457 – Lecture 12 Routing

CS 457 – Lecture 12
Routing
Fall 2011
IP Address and 24-bit Subnet Mask
Address!
12
34
158
5
00001100 00100010 10011110 00000101
11111111 11111111 11111111 00000000
Mask!
255
255
255
0
Scalability Improved
•  Number related hosts from a common subnet
–  1.2.3.0/24 on the left LAN
–  5.6.7.0/24 on the right LAN
1.2.3.4
1.2.3.7 1.2.3.156
host! ...!
host!
5.6.7.8 5.6.7.9
host!
host!
host! ...!
5.6.7.212
host!
LAN 2!
LAN 1!
router!
WAN!
1.2.3.0/24
5.6.7.0/24
• forwarding table!
router!
WAN!
router!
How Do the Routers Know
Where to Send Data?
•  Forwarding tables at each router
populated by routing protocols.
•  Original Internet: manually updated.
•  Routing protocols update tables based
on “cost.”
–  Exchange tables with neighbors or
everyone.
–  Use neighbor leading to shortest path.
What is Routing?
•  A famous quotation from RFC 791
“A name indicates what we seek.
An address indicates where it is.
A route indicates how we get there.”
-- Jon Postel
Forwarding vs. Routing
•  Forwarding: at the data plane
– Directing a packet to an outgoing link
– Individual router using a forwarding table
•  Routing: at the control plane
– Computing paths the packets will follow
– Involves routers talking amongst themselves
– Individual router creating a forwarding table
Why Does Routing Matter?
•  End-to-end performance
–  Quality of the path affects user performance
–  Propagation delay, throughput, and packet loss
•  Use of network resources
–  Balance of the traffic over routers and links
–  Avoid congestion by directing traffic to lightlyloaded links
•  Transient disruptions during changes
–  Failures, maintenance, and load balancing
–  Limiting packet loss and delay during changes
Shortest-Path Routing
• Path-selection model
– Destination-based
– Load-insensitive (e.g., static link weights)
– Minimum hop count or sum of link weights
2
3
2
1
1
1
4
4
5
3
Shortest-Path Problem
•  Given: network topology with link costs
–  c(x,y): link cost from node x to node y
–  Infinity if x and y are not direct neighbors
•  Compute: least-cost paths to all nodes
–  From a given source u to all other nodes
–  p(v): predecessor node along path from source to v
2
3
u!
2
p(v)!
1
1
4
1
5
4
3
v!
Dijkstra’s Shortest-Path
Algorithm
•  Iterative algorithm
–  After k iterations, know least-cost path to k nodes
•  S: nodes whose least-cost path definitively known
–  Initially, S = {u} where u is the source node
–  Add one node to S in each iteration
•  D(v): current cost of path from source to node v
–  Initially, D(v) = c(u,v) for all nodes v adjacent to u
–  … and D(v) = ∞ for all other nodes v
–  Continually update D(v) as shorter paths are learned
Dijsktra’s Algorithm
Initialization:
S = {u}
for all nodes v
if v adjacent to u {
D(v) = c(u,v)
else D(v) = ∞
Loop
find w not in S with the smallest D(w)
add w to S
update D(v) for all v adjacent to w and not in S:
D(v) = min{D(v), D(w) + c(w,v)}
until all nodes in S
Dijkstra’s Algorithm Example
2
3
2
1
1
4
1
4
4
5
3
• 1
1
4
1
5
4
1
1
1
2
3
2
2
3
5
4
3
2
3
2
3
2
1
1
1
4
4
5
3
Dijkstra’s Algorithm Example
2
3
2
1
1
4
1
4
4
5
3
1
1
4
1
5
4
1
1
1
2
3
2
2
3
5
4
3
2
3
2
3
2
1
1
1
4
4
5
3
Shortest-Path Tree
•  Shortest-path tree
from u
• 2
• 1
• v!
• 3
• u!
• y!
• x!
• 2
• 1
• w!• 4
• s!
• 1
• 4
• 5
• z!
• t!
• 3
•  Forwarding
table at u
• v
• w
• x
• y
• z
• s
• t
• link
• (u,v)
• (u,w)
• (u,w)
• (u,v)
• (u,v)
• (u,w)
• (u,w)
Link-State Routing
•  Each router keeps track of its incident links
–  Whether the link is up or down
–  The cost on the link
•  Each router broadcasts the link state
–  To give every router a complete view of the graph
•  Each router runs Dijkstra’s algorithm
–  To compute the shortest paths
–  … and construct the forwarding table
•  Example protocols
–  Open Shortest Path First (OSPF)
–  Intermediate System – Intermediate System (IS-IS)
Detecting Topology Changes
•  Beaconing
–  Periodic “hello” messages in both
directions
–  Detect a failure after a few missed “hellos”
• “hello”!
•  Performance trade-offs
–  Detection speed
–  Overhead on link bandwidth and CPU
–  Likelihood of false detection
Broadcasting the Link State
•  Flooding
–  Node sends link-state information out its links
–  And then the next node sends out all of its links
–  … except the one where the information arrived
• X
• A
• C
• B
• D
• X
• A
• C
• B
• (a)
• X
• A
• C
• B
• (c)
• D
• (b)
• D
• X
• A
• C
• B
• (d)
• D
Broadcasting the Link State
•  Reliable flooding
–  Ensure all nodes receive link-state
information
–  … and that they use the latest version
•  Challenges
–  Packet loss
–  Out-of-order arrival
•  Solutions
–  Acknowledgments and retransmissions
–  Sequence numbers
–  Time-to-live for each packet
When to Initiate Flooding
•  Topology change
–  Link or node failure
–  Link or node recovery
•  Configuration change
–  Link cost change
•  Periodically
–  Refresh the link-state information
–  Typically (say) 30 minutes
–  Corrects for possible corruption of the data
What’s Next
•  Read Chapter 1, 2, 3, and 4.1-4.3
•  Next Lecture Topics from Chapter 4.2 and 4.3
–  Routing
•  Homework
–  Due Thursday in recitation
•  Project 2
–  You should be working on Project 2!
Download PDF
Similar pages