Title: Module 7, SMD123
1- Module 7, SMD123
- Routing Part 1
2Outline
- Quick flashback
- What is routing?
- Graph theory
- Routing algorithms
- Hierarchical routing
3The Fellowship of the Routers
router
workstation
server
mobile
4Forwarding vs. Routing
- Forwarding Looking at address and sending packet
to correct place (either next-hop or direct) - Uses forwarding tables
- Routing The process by which forwarding tables
are built
5What is Routing? - a human(e) network example
- Demonstrate 3 things
- Routers do not need to have global knowledge!
- Networks can repair themselves!
- Incorrect information can lead to serious errors!
6A Human(e) Network cont.
(Rules for Routers)
Forwarding Tables
C
A
H2
S
B
H1
Routers
Point-to-Point links
7A Human(e) Network Handling Failures
Forwarding Tables
C
A
H2
S
A
B
B
1
Right
1
Right
2
Left
2
-
Right
Left
H1
Routers
Point-to-Point links
8A Human(e) Network Loops
D
Forwarding Tables
C
A
H2
S
A
B
B
1
Right
1
Right
Left
Right
2
Left
2
-
H1
Routers
Point-to-Point links
9Types of routing
- Routing
- Can be Static or Dynamic
- Can be Distributed or Centralized
- Can be Global
Routing
Dynamic
Static/Manual
Distributed
Centralized
True Distrib.
Global
10Outline
- Quick flashback
- What is routing?
- Graph theory
- Routing algorithms
- Hierarchical routing
11Routing Foundations
- Graph theory used to build routing algorithms
- Allows us to prove properties about algorithms
- A little graph theory will last us a long way
- Nodes
- Links
- Link costs
- Minimum cost distance
12A Little Something About Graphs
- Graphs are like maps only without geometry!
- Cares only about connections
- Consist of
- Nodes
- Links, which may have costs
- Can be
- Connected, contain loops
- Special Case A Tree
- A connected graph that does not contain loops!
13Transforming a Map to a Graph
Topology Description of Graph
2
1
2
2
1.5
14Making the point
Same Topology!
15Routing Graph Theory
- Switches Hosts are Nodes (A,B,C,)
- Links between nodes are Edges (no names)
- Each edge has a Cost associated with it.
- C(B,C) 2
- C(C,B) 2
- Main Problem - Calculating the path with the
lowest cost, from A to F. ? D(A,F) 8
1
1
2
3
9
6
7
4
16Shortest Path Tree
1
2
1
1
C
2
3
9
4
6
7
4
10
6
17Outline
- Quick flashback
- What is routing?
- Graph theory
- Routing algorithms
- Hierarchical routing
18What Are We Looking For?
- Speed to convergence
- Memory Usage
- Amount of routing messages
- Scalability
19Distance Vector Algorithm
- Outline of the Algorithm
- Based on Bellman-Ford algorithm
- An example of the Algorithm
- Problems Solutions
20Outline of the Algorithm
- The Algorithm Basics
- Each node knows the cost of the link of each its
directly connected neighbors initial
forwarding table. - Periodically each node transmits their table to
all their neighbors. - When a node receives such a table it calculates
the distance to the nodes on the received table. - If the node discovers a shorter path to a
destination node, its own table is updated. If
the table was updated the new table is
immediately sent to the neighbors, otherwise the
node waits for a timeout or a new message.
21From the View of a Node
- A Nodes Routing Table consists of triples in the
form ltDestination,Cost,Nexthopgt - The Messages sent are lists containing tuples in
the form ltDestination, Costgt
Routing Table for B
22A Distance Vector Example
(A,1), (C,1)
A
Node
cost
Nexthop
B
1
B
C
1
C
(A,1), (B,1),(D,1)
E
1
E
F
1
F
D
2
C
G
2
F
(A,1), (G,1)
B
C
F
Node
cost
Nexthop
Node
cost
Nexthop
Node
cost
Nexthop
A
1
A
B
1
B
A
1
A
(A,1), (C,1)
(A,1), (B,1),(D,1)
(A,1), (G,1)
C
1
C
A
1
A
G
1
G
D
1
D
23Final Information at Nodes
24Book Stylie
1
7
8
2
1
2
D
c(E,D) min D (C,w)
w
22 4
D
c(E,D) min D (A,w)
w
23 5
loop!
B
c(E,B) min D (A,w)
w
86 14
loop!
25Distance table gives routing table
Outgoing link to use, cost
A B C D
A,1 D,5 D,4 D,4
destination
Routing table
Distance table
26Problems Solutions
- Node/link failures may give rise to unstable
conditions - Count to Infinity - Long convergence times on large networks
- Limit the size of Network
- Distance vector tables always transmitted (even
if contents have not changed) - Two partial solutions are
- Split Horizon
- Poison Reverse
27A Count-to-Infinity Example
(E, 4),
(E, 3),
A
(E, 2),
(E, 4),
(E, 3),
Node
cost
Nexthop
B
1
B
(E, ?),
(E, 2),
(E, 3),
(E, 4),
C
1
C
-
?
4
5
B
E
1
E
B
(E,?),
F
1
F
D
2
C
G
2
F
B
C
Node
cost
Nexthop
Node
cost
Nexthop
-
-
?
?
C
B
C
B
E
2
A
E
2
A
C
B
4
4
5
5
3
3
28Split Horizon
(E, 3),
A
(E, 2),
(E, 3),
Node
cost
Nexthop
B
1
B
(E, ?),
(E, 2),
(E, 3),
C
1
C
-
?
B
E
1
E
B
(E,?),
F
1
F
D
2
C
G
2
F
B
C
Node
cost
Nexthop
Node
cost
Nexthop
-
-
?
E
2
A
E
2
A
C
B
3
3
29Count-to-infinity
- Only real solution is to set a low infinity
- E.g., 16
- Split Horizon Poisoned Reverse only breaks
loops with 2 links
30Link-State Algorithm
- Outline of the Algorithm
- (Dijkstras Shortest Path Algorithm)
- Reliable Flooding
- Route Calculation - Forward Search Alg.
- Properties
31Outline of the Algorithm (1)
- The Algorithm Basics
- Assumption Each node knows the cost of the link
of each its directly connected neighbors. Same as
for the Dist. Vector Alg. - Basic Idea Every node knows how to reach its
neighbors. If this information is spread to every
node, then every node will have enough
information to determine the correct path to any
node in the network. In fact every node will be
able to build a complete map of the network. This
means that every node will eventually have access
to the same information, as every other node.
32Outline of the Algorithm (2)
- Thus Link-State protocols rely on 2 things
- Reliable spreading of link-state information
(Reliable Flooding) - Calculation of paths from the sum of all the
accumulated link-state knowledge
33Purpose of Reliable Flooding
34Route Calculation (1)
- Question How is shortest path calculated from
complete map? - Is most often performed by a realization of
Dijkstras algorithm, called Forward Search or
Shortest Path First. - It contains two lists a Tentative a Confirmed
one - Each list contains entries in the form of
ltDestination, Cost, NextHopgt
35Route Calculation (2)
- The Basic Idea
- Initialize Confirmed list with myself
- Call the most recently added node next
- For each neighbor of next, calculate the cost
to reach the neighbor from me via next - a) If neighbor is on neither of the lists, then
add ltneighbor, Cost, Nexthopgt to the Tentative
list. - b) If neighbor is on the Tentative list but the
cost using the new path is less. Then replace the
current entry. - Pick the entry with the smallest cost and add it
to the Confirmed list and return to step 2).
36A Forward Search Example
D
Step
Confirmed
Tentative
1
(D,0)
(B,11) (C,2)
E
2
(D,0) (C,2)
(B,5) (A,12) (E,11)
9
B
5
3
3
(A,10) (E,11)
(D,0) (C,2) (B,5)
A
C
10
4
(D,0) (C,2) (B,5) (A,10)
(E,11)
11
2
D
5
--
(D,0) (C,2) (B,5) (A,10) (E,11)
37Properties
- Self-stabilizes quickly
- Does not generate much traffic
- Responds rapidly to topology changes
- - Large amount of information (an entire LSP)
needs to be stored at every node. - A drawback in scalability
38Distance Vector vs Link-State
- The difference between the two algorithms can be
summarized - D.V. Each node only talks to its directly
connected neighbors, but sends its entire
forwarding table. - L-S Each node talks to all other nodes, but only
tells them what it knows for sure (i.e. only the
state of its directly connected links)
39Outline
- Quick flashback
- What is routing?
- Graph theory
- Routing algorithms
- Hierarchical routing
40Hierarchical Routing
- Our routing study thus far - idealization
- all routers identical
- network flat
- not true in practice
- scale with 200 million destinations
- cant store all dests in routing tables!
- routing table exchange would swamp links!
- administrative autonomy
- internet network of networks
- each network admin may want to control routing in
its own network
41Hierarchical Routing
- aggregate routers into regions, autonomous
systems (AS) - routers in same AS run same routing protocol
- intra-AS routing protocol
- Interior Gateway Protocol - IGP
- routers in different AS can run different
intra-AS routing protocol
- special routers in AS
- run intra-AS routing protocol with all other
routers in AS - also responsible for routing to destinations
outside AS - run inter-AS routing protocol with other gateway
routers - Exterior Gateway Protocol - EGP
42Intra-AS and Inter-AS routing
Host h2
Intra-AS routing within AS B
Intra-AS routing within AS A
- Well examine specific inter-AS and intra-AS
Internet routing protocols shortly