Upload
anastasia-watts
View
221
Download
4
Embed Size (px)
Citation preview
Distance-Vector Routing
Department of Computer ScienceSouthern Illinois University Edwardsville
Fall, 2013
Dr. Hiroshi FujinokiE-mail: [email protected]
CS 447 Networks and Data Communication
TCP_Distance_Vector/000
Distance Vector Routing
Cost
Next
A B C D E F
A
B
C
D
E
F
1
1
1
1 1
1
1
1
1
Cost
Next
A B C D E F
Cost
Next
A B C D E F
1
B
2
B
3
B
1
C
2
C
1
C
2
C
1
B
2
B
2
C
1
C
1
D
1
F
1
F
1
E
0
S
0
S
0
S
TCP_Distance_Vector/001
CS 447 Networks and Data Communication
Distance Vector Routing
(1) A node (router) initialize its private distance vector (= routing table) for only its direct neighbor(s)
(2) Routers in direct neighborhood periodically exchange their cost matrix
(3) Before a router sends its routing table to its neighbor, add the whatever link cost to the neighbor to every slot in the routing table (and transmit it).
(4) If a router receives the routing table from one of its direct neighbors, compare the cost in the local routing table to the one in the new table.
- If the cost in the new table is lower than what is in your local routing table, update the one in the local routing table by the new (cheaper cost) and update “next hop” by the neighbor’s router’s ID (ore address)
- If the higher cost is reported by the new routing table, but if the neighbor is same as the one you learned, update it anyway.
TCP_Distance_Vector/002
CS 447 Networks and Data Communication
Routing Loops in Distance Vector
A B C D X11 1 1
Cost
Next
A B C D X
1 10 2
DBB S
2
D
Cost
Next
A B C D X
1 03
CC S
2
X
1
C
TCP_Distance_Vector/003
CS 447 Networks and Data Communication
Cost
A B C D X
Cost (Distance) Vector
Routing Loops in Distance Vector
A B C D X11 1 1
Cost
Next
A B C D X
1 10 2
DBB S
2
D
Cost
Next
A B C D X
1 03
CC S
2
NA
C
3 124
TCP_Distance_Vector/004
CS 447 Networks and Data Communication
Routing Loops in Distance Vector
A B C D X11 1 1
Cost
Next
A B C D X
1 10
DBB S
2
Cost
Next
A B C D X
1 03
CC S
2
NA
C
Cost
A B C D X
3 124
NA
TCP_Distance_Vector/005
CS 447 Networks and Data Communication
Routing Loops in Distance Vector
A B C D X11 1 1
Cost
Next
A B C D X
1 10 2
DBB S
2
D
Cost
Next
A B C D X
1 03
CC S
2
NA
C
Cost
A B C D X
2 21 33
TCP_Distance_Vector/006
CS 447 Networks and Data Communication
Routing Loops in Distance Vector
A B C D X11 1 1
Cost
Next
A B C D X
1 10 2
DBB S
2
D
Cost
Next
A B C D X
1 03
CC S
2
C
Cost
A B C D X
2 21 33
3
C
Cost
A B C D X
3 12 44
TCP_Distance_Vector/007
CS 447 Networks and Data Communication
Routing Loops in Distance Vector
A B C D X11 1 1
Cost
Next
A B C D X
1 10
DBB S
2 4
D
Cost
Next
A B C D X
1 03
CC S
2
C
Cost
A B C D X
2 21 53
3
C
Cost
A B C D X
3 12 44
This problem is called“Counting-to-Infinity”
TCP_Distance_Vector/008
CS 447 Networks and Data Communication
A solution for routing loops
A B C D X11 1 1
Cost
Next
A B C D X
1 10
DBB S
2 2
D
Cost
Next
A B C D X
1 03
CC S
2
C
Cost
Next
A B C D X
1 10
DBB S
2 3
D
NA
• Transmit the entire routing table
• Router D will check “Next” field in the routing table from C.
• If Router D sees that the origin of the information for “X” in the RT from C is actually itself, it will not use it to update its routing table.
“Split Horizon”
TCP_Distance_Vector/009
CS 447 Networks and Data Communication
Distance Vector Routing
A B
C D X1
1
1
1
1
Cost
Next
X
X
1
Cost
Next
X
D
2
Cost
Next
X
D
2Cost
Next
X
C
3
TCP_Distance_Vector/010
CS 447 Networks and Data Communication
Distance Vector Routing
A B
C D X1
1
1
1
1
Cost
Next
X
Cost
Next
X
D
2
Cost
Next
X
D
2Cost
Next
X
C
3
NA
Cost
Next
X
NA
TCP_Distance_Vector/011
CS 447 Networks and Data Communication
Distance Vector Routing
A B
C D X1
1
1
1
1
Cost
Next
X
Cost
Next
X
D
2
Cost
Next
X
C
3
NA
Cost
Next
X
NA
Cost
Next
X
NA
TCP_Distance_Vector/012
CS 447 Networks and Data Communication
Distance Vector Routing
A B
C D X1
1
1
1
1
Cost
Next
X
Cost
Next
X
D
2
Cost
Next
X
C
3
NA
Cost
Next
X
NA
Cost
Next
X
NA
Cost
Next
X
C
4
TCP_Distance_Vector/013
CS 447 Networks and Data Communication
Distance Vector Routing
A B
C D X1
1
1
1
1
Cost
Next
X
Cost
Next
X
D
2
Cost
Next
X
C
3
NA
Cost
Next
X
A
4
Cost
Next
X
C
4
Cost
Next
X
A
5
TCP_Distance_Vector/014
CS 447 Networks and Data Communication
Distance Vector Routing
A B
C D X1
1
1
1
1
Cost
Next
X
D
2
Cost
Next
X
C
3 Cost
Next
X
A
4
Cost
Next
X
C
4
Cost
Next
X
A
5
Cost
Next
X
B
5
Cost
Next
X
B
6
TCP_Distance_Vector/015
CS 447 Networks and Data Communication