Professional Documents
Culture Documents
10 Routing PDF
10 Routing PDF
Length
Length of IP fragment
Identification
To match up with other fragments
Flags
Fragment offset
9/29/2005
IP Fragmentation Example #2
Outline
MTU =
2000
router
router
Length = 2000, M=1, Offset = 0, ID=1234
Length = 3820, M=0, ID=1234
IP
Header
IP
Data
IP
Header
IP
Data
Distance Vector
1980 bytes
Link State
3800 bytes
Length = 1840, M=0, Offset = 1980, ID=1234
IP
Header
IP
Data
1820 bytes
9/29/2005
9/29/2005
Fragmentation is Harmful
Connectionless
Reassembly at endpoints
9/29/2005
9/29/2005
Best effort
Fail by dropping packet
Destination can give up on reassembly
No need to signal sender that failure occurred
MTU =
2000
host
router
9/29/2005
router
host
MTU = 1500
MTU = 4000
9/29/2005
ICMP
Frag. Needed
MTU = 2000
ICMP
Frag. Needed
MTU = 1500
MTU =
2000
router
host
MTU = 1500
MTU = 4000
Length = 2000, Dont Fragment
IP
Packet
IP
Packet
9/29/2005
10
Important Concepts
IP forwarding global addressing, alternatives, lookup
tables
IP addressing hierarchical, CIDR,
IP service best effort, simplicity of routers
IP packets header fields, fragmentation, ICMP
host
router
router
host
host
router
MTU = 1500
MTU = 4000
9/29/2005
MTU =
2000
host
router
router
host
MTU = 1500
MTU = 4000
Length = 1500, Dont Fragment
IP
Packet
11
9/29/2005
12
Outline
IP Forwarding
The Story So Far
IP addresses are structure to reflect
Internet structure
IP packet headers carry these addresses
When Packet Arrives at Router
Examine header to determine intended
destination
Look up in table to determine next hop
in path
Send packet out appropriate port
Router
9/29/2005
13
Graph Model
Represent each router as node
Direct link between routers represented by edge
Task
Determine least cost path from every node to every other node
Path cost d(x,y) = sum of link costs
E
1
3
B
Lecture 10: Intra-Domain Routing
Dest
Cost
Next
Hop
2
6
9/29/2005
14
Properties
9/29/2005
15
9/29/2005
16
Distance-Vector Method
Initial Table for A
Centralized
Dest
Link-state
Every node collects complete graph structure
Each computes shortest paths from it
Each generates own routing table
Cost
Next
Hop
2
6
Idea
Distance-vector
Initially
Only have entries for directly connected nodes
9/29/2005
17
Distance-Vector Update
18
Bellman-Ford algorithm
Repeat
d(z,y)
c(x,z)
y
d(x,y)
Update(x,y,z)
d c(x,z) + d(z,y)
# Cost of path from x to y with first hop z
if d < d(x,y)
# Found better path
return d,z
Algorithm
9/29/2005
Until converge
else
19
9/29/2005
20
Start
Iteration #1
Table for B
Dst
Cst
Hop
Dst
Cst
Hop
E
F
Table for C
Table for A
6
1
Table for D
Table for E
Table for B
Dst
Cst
Hop
Dst
Cst
Hop
Table for C
Table for F
2
6
Table for D
Table for E
Table for F
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Table for B
Dst
Cst
Hop
Dst
Cst
Hop
Table for C
F
6
1
22
Table for D
Table for E
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Y
50
algorithm
terminates
good
news
travels
fast
Table for F
Cst
Dst
9/29/2005
Iteration #2
Table for A
9/29/2005
21
Dst
9/29/2005
23
9/29/2005
24
50
60
9/29/2005
25
50
Y
50
Table for A
Table for B
Table for D
26
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Dst
Cst
Hop
Table for A
Dst
Cst
Hop
Dst
Cst
Hop
Cst
Hop
13
Better
Route
Cst
Hop
19
9/29/2005
D
Table for B
Dst
Cst
Hop
14
Table for A
Dst
Table for A
Dst
Table for F
Forced
Update
Forced
Update
Forced
Update
27
Table for F
Dst
Forced
Update
algorithm
terminates
9/29/2005
algorithm
terminates
algorithm
continues
on!
9/29/2005
60
Forced
Update
Table for D
Dst
Cst
Hop
15
28
RIP Updates
Initial
When router first starts, asks for copy of table for every neighbor
Uses it to iteratively generate own table
Features
Every link has cost 1
Infinity = 16
Limits to networks where everything reachable within
15 hops
Every router listens for updates on UDP port 520
RIP message can contain entries for up to 25 table
entries
Lecture 10: Intra-Domain Routing
Triggered
When every entry changes, send copy of entry to neighbors
Except for one causing update (split horizon rule)
Neighbors use to update their tables
Sending Updates
9/29/2005
Periodic
29
9/29/2005
30
Outline
Small Infinity
Count to infinity doesnt take very long
Route Timer
Every route has timeout limit of 180 seconds
Reached when havent received update from next
hop for 6 periods
If not updated, set to infinity
Soft-state refresh important concept!!!
Distance Vector
Link State
Behavior
When router or link fails, can take minutes to stabilize
9/29/2005
31
9/29/2005
32
X Wants to Send
Information
9/29/2005
Dijkstras Algorithm
9/29/2005
(b)
(a)
X
D
33
(c)
(d)
34
Given
Source
Node
0
A
Done
Unseen
Horizon
Node Sets
Done
Already have least cost path to it
Horizon:
Reachable in 1 hop from node in
Done
Unseen:
Cannot reach directly from node in
Done
9/29/2005
35
9/29/2005
Label
d(v) = path cost
From s to v
Path
Keep track of last link in path
36
Source
Node
Horizon
Done
B
Unseen
37
9/29/2005
38
Dijkstras Algorithm
C
5 6
F
6
Source
Node
0
A
Done
Horizon
5
2
1
2
2
Done
Unseen
Horizon
Dijkstras Algorithm
Source
Node
Horizon
No nodes done
Source in horizon
Done
Unseen
6
1
9/29/2005
Source
Node
B
Unseen
Repeat
39
9/29/2005
40
10
Dijkstras Algorithm
E
Dijkstras Algorithm
E
1
3
Source
Node
0
A
Horizon
Done
0
A
Source
Node
Unseen
9/29/2005
41
9/29/2005
With consistent
LSDBs*, all nodes
compute consistent
loop-free paths
Can still have
transient loops
Open
9/29/2005
B
1
Shortest-path first
X
3
A
5
42
2
D
Packet from CA
may loop around BDC
if B knows about failure
and C & D do not
43
9/29/2005
44
11
Originating router
Typically, minimum IP address for router
Link ID
ID of router at other end of link
Metric
Cost of link
Link-state age
Incremented each second
Packet expires when reaches 3600
Sequence number
Incremented each time sending new link information
9/29/2005
Cases
No entry present
Add entry, propagate to all neighbors other than Y
Entry present with sequence number p < q
Update entry, propagate to all neighbors other than Y
Entry present with sequence number p > q
Send entry back to Y
To tell Y that it has out-of-date information
Entry present with sequence number p = q
Ignore it
45
9/29/2005
Flooding Issues
Adoption of OSPF
Periodically
When status of link changes
Detected by connected node
46
OSPF Advantages
Fast convergence when configuration changes
47
9/29/2005
48
12
Comparison of LS and DV
Algorithms
Comparison of LS and DV
Algorithms
Message complexity
Space requirements:
LS maintains entire topology
DV maintains only neighbor
state
DV:
Speed of Convergence
49
9/29/2005
50
EXTRA SLIDES
9/29/2005
51
13
Dijsktras Algorithm
9/29/2005
53
1 Initialization:
2 N = {A}
3 for all nodes v
4
if v adjacent to A
5
then D(v) = c(A,v)
6
else D(v) = infinity
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12
D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N
9/29/2005
54
start N
A
AD
ADE
ADEB
ADEBC
ADEBCF
5
2
2
1
9/29/2005
C
3
55
14