NetworkLayer Routing
NetworkLayer Routing
Routing
Routing
Routing algorithm
Network Layer responsible for deciding on which output
line to transmit an incoming packet.
Remember:
For virtual circuit subnets the routing decision is made
ONLY at set up.
Routing Algorithms
Goal: determine good path (sequence of routers)
through network from source to destination
Routing algorithms for both datagrams and virtual
circuits should satisfy:
- Correctness
- Simplicity
- Stability
- Optimality
- Simplicity
- Robustness
- Fairness
good path:
minimum cost path
switching
fabric
routing
processor
line
termination
link
layer
protocol
(receive)
lookup,
forwarding
queueing
physical layer:
bit-level reception
data link layer:
e.g., Ethernet
decentralized switching:
given datagram destination, lookup output port
using forwarding table in input port memory
goal: complete input port processing at line
speed
queuing: if datagrams arrive faster than
forwarding rate into switch fabric
7
Switching Fabrics
Transfer packet from input buffer to appropriate output buffer
Switching rate: rate at which packets can be transfer from inputs
to outputs
Often measured as multiple of input/output line rate
N inputs: switching rate N times line rate desirable
memory
bus
crossbar
Routing Classification
Static vs Dynamic
Adaptive vs Non-Adaptive
Single path vs Multi path
Flat vs Hierarchical
Inter-Domain vs Intra-Domain
Link-state vs Distance-vector
Host intelligent vs Router intelligent
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
Dijsktras Algorithm
1 Initialization:
2 S = {u}
3 for all nodes v
4 if v adjacent to u {
5
D(v) = c(u,v)
6 else D(v) =
7
8 Loop
9 find w not in S with the smallest D(w)
10 add w to S
11 update D(v) for all v adjacent to w and not in S:
12
D(v) = min{D(v), D(w) + c(w,v)}
13 until all nodes in S
15
16
17
18
19
20
21
22
23
24
25
Link-State Routing
Dijkstras algorithm nice and well
But how to obtain centralized view of the entire
network to be able to apply Dijkstras algorithm?
Assumption: only direct neighbors know the (current)
cost of a link or know whether a link has failed/been
restored/upgraded/...
Link-State Routing
Each router keeps track of its incident links
Whether the link is up or down
The cost on the link
Example protocols
Open Shortest Path First (OSPF)
Intermediate System Intermediate System (IS-IS)
28
29
Route Calculation
Dijkstras shortest path algorithm
34
Network Link
Router Link
External Link
Summary
Why OSPF is needed in the Internet?
The basics of the protocol
The Link state Advertisements
Neighbor Discovery (Hello Protocol)
Database Synchronization and reliable flooding
Basic Approaches
Static
Type in the right answers and hope they are always true
...So far
Link state
Tell everyone what you know about your neighbors
Distance vector
Tell your neighbors when you know about everyone
Each router knows its own address and the cost to reach
each of its directly connected neighbors
Bellman-Ford algorithm
Mitigating loops
Bellman-Ford Algorithm
Define distances at each node X
dx(y) = cost of least-cost path from X to Y
Distributed
Each node notifies neighbors only when its DV changes
Neighbors then notify their neighbors if necessary
48
50
Sharing
Sharing table with neighbors.
Updating
Update the routing table: calculate the distance, add new
node, modify the existing record if needed.
Network Discovery
Router initial start up (Cold Starts)
Initial network discovery
Directly connected networks are initially placed in the routing
table
Routing Loops
Routing loops are
A condition in which a packet is continuously
transmitted within a series of routers without ever
reaching its destination.
Two-node instability
Three-node Instability
Count-to-Infinity
The reason for the count-to-infinity problem is that
each node only has a next-hop-view
For example, in the first step, B did not realize that
its route (with cost 6) to X went through node A
How can the Count-to-Infinity problem be solved?
59
Solution: Count-to-Infinity
Solution 1: Loop avoidance:
Always advertise the entire path in an update message
(Path vectors)
If routing tables are large, the routing messages require
substantial bandwidth
BGP uses this solution
60
Solution: Count-to-Infinity
Solution 2: Split Horizon
Split Horizon: A router should not advertise a network
through the interface from which the update came.
Example: A would not send the first routing update to B, since
B is the next hop on As current route to C
Split Horizon does not solve count-to-infinity in all cases!
61
In practice
RIP: Routing Information Protocol
DV protocol with hop count as metric
Infinity value is 16 hops; limits network size
Includes split horizon with poison reverse
Summary
Distance Vector shortest-path routing
Each node sends list of its shortest distance to each
destination to its neighbors
Neighbors update their lists; iterate
Speed of Convergence
LS: relatively fast
DV: convergence time varies
May be routing loops
Count-to-infinity problem
DV:
Node can advertise incorrect
path cost
Each nodes table used by
others (error propagates)