Title: CS 352 Internet Technology Routing
1CS 352Internet TechnologyRouting
- Richard Martin
- Dept. of Computer Science
- Rutgers University
2Forwarding vs Routing
- Routing is the decision which path to take
- E.g. From Rutgers to Manhattan
- Route 1 Hoes ln, Centennial Ave, 287, GSP, 78,
Route 1/9, Holland tunnel - Route 2 Rt. 18, Turnpike, Lincoln tunnel
- Factors Length, cost, congestion
- Forwarding is the lookup once the decision has
been made - Youre at the intersection of Rt. 18 the
Turnpike. Which ramp to take? - These functions are typically decoupled in real
systems
3Routing Algorithms
- A routing algorithm decides which output link an
incoming packet should be transmitted on - A routing table contains the mappings from the
networks and host addresses to output ports on
the router - The routing algorithm builds this table
- Typically a more advanced data structure is used,
but conceptually its a table
4 Forwarding
- A forwarding algorithm performs the lookup of
address to output port - In connection-oriented service, the forwarding
algorithm is performed by switches and only
during connection setup - In connectionless service, the forwarding
algorithm is performed by routers every time a
packet arrives
5Example Routing Table
- remus/ug/u1/rmartinnetstat -rn
- Routing Table
- Destination Gateway Flags
Ref Use Interface - -------------------- -------------------- -----
----- ------ -------- - 128.6.13.0 128.6.13.3 U
3 4259 hme0 - 224.0.0.0 128.6.13.3 U
3 0 hme0 - default 128.6.13.21 UG
02184931 - 127.0.0.1 127.0.0.1 UH
0 346400 lo0
6 Shortest Path Routing
- For a pair of communicating hosts, there is a
shortest path between them - Shortness may be defined by
- Number of router/switch hops
- Geographic distance
- Link delay
7Shortest Path
What is the shortest path between A and F?
2
B
3
4
D
F
1
A
2
2
1
C
E
3
Edge Weight (Distance)
8Shortest Path Intuition
- To find the shortest path from X to Y
- Start with node X
- Select the next shortest path from X to a node we
have not yet found a shortest path to - Eventually well select node Y
- We must keep selecting shortest paths from other
nodes because some path to Y through a node Z
might be shorter
9Computing the Shortest Path
- Dijkstras Shortest Path Algorithm
- Step 1 Draw nodes as circles. Fill in a circle
to mark it as a permanent node. - Step 2 Set the current node equal to the source
node - Step 3 For the current node
- Mark the cumulative distance from the current
node to each non-permanent adjacent node. Also
mark the name of the current node. Erase this
marking if the adjacent node already has a
shorter cumulative distance marked - Mark the non-permanent node with the shortest
listed cumulative distance as permanent and set
the current node equal to it. Repeat step 3
until all nodes are marked permanent.
10Dijskstras Shortest Path AlgorithmExample
7
B
C
2
3
2
3
2
A
E
F
D
1
2
2
6
4
G
H
11Dijskstras Shortest Path AlgorithmExample
7
B
C
2
3
2
3
2
A
E
F
D
1
2
2
6
4
G
H
12Dijskstras Shortest Path AlgorithmExample
7
B
C
2
3
2
3
2
A
E
F
D
1
2
2
6
4
G
H
Selected edge
Candidate edge
Not visited
13Dijskstras Shortest Path AlgorithmExample
7
B
C
2
3
2
3
2
A
E
F
D
1
2
2
6
4
G
H
14Example
Confirmed Edge List
Candidate Edge List
Step
(neighbor,cost,nexthop)
(A,0,-)
1
(A,2,B)
(A,0,-)
Add candidates
2
(A,6,G)
(A,0,-)
Select Edge
(G,6,G)
3
(A,2,B)
(A,0,-)
(G,6,G)
Add candidates
(A,2,B)
(B,9,C)
4
(B,4,E)
(A,0,-)
(G,6,G)
Select Edge
5
(A,2,B)
(B,9,C)
(B,4,E)
15Shortest Path Routing (contd)
- Non adaptive to congestion, if
- geographical distances are used as edge weights
- maximum link throughputs are used as edge weights
- Number of hops are used as edge weights
16Problems with Centralized Approaches
- Reliability
- If the control center goes down, no more routing
- Scalability
- The control center must handle a great deal of
routing information, especially for larger
networks - How many routers does a given system support?
10s, 100s?, 1000s, 1000000s? - Decentralized control
- Why should one organization depend on another for
internal routing?
17Distributed Routing Algorithms
- Hot Potato
- Exchange based
- Each router periodically exchanges routing
information (e.g., estimated time delay, queue
length, etc.) with its neighbors - Examples
- Distance Vector Routing
- Link State Routing
18Hot Potato Routing
- When a packet arrives, the router tries to get
rid of it as fast as it can by putting it on the
output line that has the shortest queue - Hot potato does not care where the output line
leads - Not useable for large networks
- Can work in small networks
19Distance Vectors
- Each router maintains lists of best-known
distances to all other known routers. These
lists are called vectors. - Each router is assumed to know the exact distance
(in delay, hop count, etc.) to other routers
directly connected to it. - Periodically, vectors are exchanged between
adjacent routers, and each router updates its
vectors.
20Distance Vectors (contd)
21Convergence Speed
- Supposed all routers know the current state of
the network - Next, a change in link-status happens
- How fast the routers learn new state of the
network is the convergence speed
22Problem Count-to-Infinity
- With distance vector routing, links coming on
line converge quickly but link failures converge
slowly - This problem for DV routing algorithms is call
count-to-infinity
23Count-to-Infinity
A
B
C
D
E
1
2
3
4
Initially
3
2
3
4
After 1 exchange
3
4
3
4
After 2 exchanges
5
4
5
4
After 3 exchanges
5
6
5
6
After 4 exchanges
7
6
7
6
After 5 exchanges
etc to infinity
24Split Horizon
- Insight Its not useful to claim reachablity for
a destination to the neighbor from which the
route was learned - Dont report routes back to node from which the
route was learned - E.g. If I hear from X has the shortest route to
Y, dont report to X I have a route to Y
25Poison Reverse
- Not reporting a route means having to wait for a
timeout - Report split-horizon routes as infinity to
break loops on the first routing exchange.
26Split Horizon with Poisoned Reverse
A
B
C
D
E
inf.
2
3
4
B learns A is dead
C reports to B that As metric is inf.
inf.
inf.
2
3
4
inf.
inf.
3
4
After 1 exchange
inf.
inf.
inf.
4
After 2 exchanges
inf.
inf.
inf.
inf.
After 3 exchanges
27Split Horizon Failure
B
A
If D goes down, A and B will still count to
infinity. Split-Horizon infinity messages are
sent from A-C and B-C, not AB
C
D
28Link State Routing
- Each router measures the distance (in delay, hop
count, etc.) between itself and its adjacent
routers - The router builds a packet containing all these
distances. The packet also contains a sequence
number and an age field. - Each router distributes these packets using
flooding - Each router builds map of the entire network,
uses a shortest-path algorithm
29Link State Routing (contd)
- To control flooding, the sequence numbers are
used by routers to discard flood packets they
have already seen from a given router - The age field in the packet is an expiration
date. It specifies how long the information in
the packet is good for. - Once a router receives all the link state packets
from the network, it can reconstruct the complete
topology and compute a shortest path between
itself and any other node using Dijsktras
algorithm.
30Hierarchical Routing
- All routing algorithms have difficulties as the
network becomes large - For large networks, the routing tables grow very
quickly, and so does the number of flood packets - How can this be reduced? Hierarchical routing
31Hierarchical Routing (contd)
- Segment the network into regions
- Called autonomous systems, (AS) typically a
single organizational entity - Routers in a single AS know all the details about
other routers in that region, but none of the
details about routers in other regions - Analogy Telephone area codes
32Hierarchical Routing (contd)
33RIP
- Route Information Protocol
- One of the routing algorithms used by the
Internet - Based on distance vector routing
- Did not scale well
- suffered the count-to-infinity problem
- weak security
- RIP is phased out for large backbones
- but still widely used for smaller networks
34OSPF
- Open Shortest Path First
- Routing algorithm now used in the Internet
- OSPF uses the Link State Routing algorithm with
modifications to support - Multiple distance metrics (geographical distance,
delay, throughput) - Support for real-time traffic
- Hierarchical routing
- Security
35OSPF (contd)
- OSPF divides the network into several
hierarchies - Autonomous Systems (ASs)
- groups of subnets
- Areas
- Groups of routers within an AS
- Backbone Areas
- Groups of routers that connect other areas
together
36OSPF Model (contd)
Autonomous System
Backbone Area
Area
Area
Autonomous System
Area
Backbone Area
Area
Area
37OSPF (contd)
- Routers are distinguished by the functions they
perform - Internal routers
- Only route packets within one area
- Area border routers
- Connect to areas together
- Backbone routers
- Reside only in the backbone area
- AS boundary routers
- Routers that connect to a router outside the AS
38OSPF Modified Link State Routing
- Recall
- In link state routing, routers flood their
routing information to all other routers in the
network - In OSPF, routers only send their information to
adjacent routers, not to all routers. - Adjacent does NOT mean nearest-neighbor in OSPF
- One router in each area is marked as the
designated router - Designated routers are considered adjacent to all
other routers in the area - OSPF combines link state routing with centralized
adaptive routing
39OSPF Adjacency
Designated Router
To backbone area
F
B
D
A
Area
E
C
Example C is adjacent to B but not to A or E B
is adjacent to all routers in the area