Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Distance-vector routing protocol
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== In this network we have 4 routers A, B, C and D: [[File:networkabcd.svg|300px]] We mark the current time (or iteration) in the algorithm with T, and begin (at time 0, or T=0) by creating distance matrices for each router to its immediate neighbours. As we build the routing tables below, the shortest path is highlighted in green, and a new shortest path is highlighted in yellow. Grey columns indicate nodes that are not neighbors of the current node, and are therefore not considered as a valid direction in its table. Red indicates invalid entries in the table since they refer to distances from a node to itself, or via itself. {| |- | T=0 | {| class="wikitable" !bgcolor="#C0C0C0" | from A !via A !via B !via C !via D |--- !to A |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#D0FF00"|3 | |bgcolor="#C0C0C0"| |--- !to C |bgcolor="#DD5555"| | |bgcolor="#D0FF00"|23 |bgcolor="#C0C0C0"| |--- !to D |bgcolor="#DD5555"| | | |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#DD5555" | from B !via A !via B !via C !via D |--- !to A |bgcolor="#D0FF00"|3 |bgcolor="#DD5555"| | |bgcolor="#C0C0C0"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to C | |bgcolor="#DD5555"| |bgcolor="#D0FF00"|2 |bgcolor="#C0C0C0"| |--- !to D | |bgcolor="#DD5555"| | |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#DD5555" | from C !via A !via B !via C !via D |--- !to A |bgcolor="#D0FF00"|23 | |bgcolor="#DD5555"| | |--- !to B | |bgcolor="#D0FF00"|2 |bgcolor="#DD5555"| | |--- !to C |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to D | | |bgcolor="#DD5555"| |bgcolor="#D0FF00"|5 |} | {| class="wikitable" !bgcolor="#C0C0C0" | from D !via A !via B !via C !via D |--- !to A |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| | |bgcolor="#DD5555"| |--- !to B |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| | |bgcolor="#DD5555"| |--- !to C |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#D0FF00"|5 |bgcolor="#DD5555"| |--- !to D |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |} |- |colspan=5| At this point, all the routers (A, B, C, D) have new "shortest-paths" for their DV (the list of distances that are from them to another router via a neighbor). They each broadcast this new DV to all their neighbors: A to B and C, B to C and A, C to A, B, and D, and D to C. As each of these neighbors receives this information, they now recalculate the shortest path using it. For example: A receives a DV from C that tells A there is a path via C to D, with a distance (or cost) of 5. Since the current "shortest-path" to C is 23, then A knows it has a path to D that costs 23+5=28. As there are no other shorter paths that A knows about, it puts this as its current estimate for the shortest-path from itself (A) to D, via C. | |- | T=1 | {| class="wikitable" !bgcolor="#C0C0C0" | from A !via A !via B !via C !via D |--- !to A |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#80FF80"|3 |25 |bgcolor="#C0C0C0"| |--- !to C |bgcolor="#DD5555"| |bgcolor="#D0FF00"|5 |23 |bgcolor="#C0C0C0"| |--- !to D |bgcolor="#DD5555"| | |bgcolor="#D0FF00"|28 |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#C0C0C0" | from B !via A !via B !via C !via D |--- !to A |bgcolor="#80FF80"|3 |bgcolor="#DD5555"| |25 |bgcolor="#C0C0C0"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to C |26 |bgcolor="#DD5555"| |bgcolor="#80FF80"|2 |bgcolor="#C0C0C0"| |--- !to D | |bgcolor="#DD5555"| |bgcolor="#D0FF00"|7 |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#C0C0C0" | from C !via A !via B !via C !via D |--- !to A |23 |bgcolor="#D0FF00"|5 |bgcolor="#DD5555"| | |--- !to B |26 |bgcolor="#80FF80"|2 |bgcolor="#DD5555"| | |--- !to C |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to D | | |bgcolor="#DD5555"| |bgcolor="#80FF80"|5 |} | {| class="wikitable" !bgcolor="#C0C0C0" | from D !via A !via B !via C !via D |--- !to A |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#D0FF00"|28 |bgcolor="#DD5555"| |--- !to B |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#D0FF00"|7 |bgcolor="#DD5555"| |--- !to C |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#80FF80"|5 |bgcolor="#DD5555"| |--- !to D |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |} |- |colspan=5| Again, all the routers have gained in the last iteration (at T=1) new "shortest-paths", so they all broadcast their DVs to their neighbors; This prompts each neighbor to re-calculate their shortest distances again. For instance: A receives a DV from B that tells A there is a path via B to D, with a distance (or cost) of 7. Since the current "shortest-path" to B is 3, then A knows it has a path to D that costs 7+3=10. This path to D of length 10 (via B) is shorter than the existing "shortest-path" to D of length 28 (via C), so it becomes the new "shortest-path" to D. | |- | T=2 | {| class="wikitable" !bgcolor="#C0C0C0" | from A !via A !via B !via C !via D |--- !to A |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#80FF80"|3 |25 |bgcolor="#C0C0C0"| |--- !to C |bgcolor="#DD5555"| |bgcolor="#80FF80"|5 |23 |bgcolor="#C0C0C0"| |--- !to D |bgcolor="#DD5555"| |bgcolor="#D0FF00"|10 |28 |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#C0C0C0" | from B !via A !via B !via C !via D |--- !to A |bgcolor="#80FF80"|3 |bgcolor="#DD5555"| |7 |bgcolor="#C0C0C0"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to C |8 |bgcolor="#DD5555"| |bgcolor="#80FF80"|2 |bgcolor="#C0C0C0"| |--- !to D |31 |bgcolor="#DD5555"| |bgcolor="#80FF80"|7 |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#C0C0C0" | from C !via A !via B !via C !via D |--- !to A |23 |bgcolor="#80FF80"|5 |bgcolor="#DD5555"| |33 |--- !to B |26 |bgcolor="#80FF80"|2 |bgcolor="#DD5555"| |12 |--- !to C |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to D |51 |9 |bgcolor="#DD5555"| |bgcolor="#80FF80"|5 |} | {| class="wikitable" !bgcolor="#C0C0C0" | from D !via A !via B !via C !via D |--- !to A |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#D0FF00"|10 |bgcolor="#DD5555"| |--- !to B |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#80FF80"|7 |bgcolor="#DD5555"| |--- !to C |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#80FF80"|5 |bgcolor="#DD5555"| |--- !to D |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |} |- |colspan=5| This time, only routers A and D have new shortest-paths for their DVs. So they broadcast their new DVs to their neighbors: A broadcasts to B and C, and D broadcasts to C. This causes each of the neighbors receiving the new DVs to re-calculate their shortest paths. However, since the information from the DVs doesn't yield any shorter paths than they already have in their routing tables, then there are no changes to the routing tables. | |- | T=3 | {| class="wikitable" !bgcolor="#C0C0C0" | from A !via A !via B !via C !via D |--- !to A |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#80FF80"|3 |25 |bgcolor="#C0C0C0"| |--- !to C |bgcolor="#DD5555"| |bgcolor="#80FF80"|5 |23 |bgcolor="#C0C0C0"| |--- !to D |bgcolor="#DD5555"| |bgcolor="#80FF80"|10 |28 |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#C0C0C0" | from B !via A !via B !via C !via D |--- !to A |bgcolor="#80FF80"|3 |bgcolor="#DD5555"| |7 |bgcolor="#C0C0C0"| |--- !to B |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to C |8 |bgcolor="#DD5555"| |bgcolor="#80FF80"|2 |bgcolor="#C0C0C0"| |--- !to D |13 |bgcolor="#DD5555"| |bgcolor="#80FF80"|7 |bgcolor="#C0C0C0"| |} | {| class="wikitable" !bgcolor="#C0C0C0" | from C !via A !via B !via C !via D |--- !to A |23 |bgcolor="#80FF80"|5 |bgcolor="#DD5555"| |15 |--- !to B |26 |bgcolor="#80FF80"|2 |bgcolor="#DD5555"| |12 |--- !to C |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |--- !to D |33 |9 |bgcolor="#DD5555"| |bgcolor="#80FF80"|5 |} | {| class="wikitable" !bgcolor="#C0C0C0" | from D !via A !via B !via C !via D |--- !to A |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#80FF80"|10 |bgcolor="#DD5555"| |--- !to B |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#80FF80"|7 |bgcolor="#DD5555"| |--- !to C |bgcolor="#C0C0C0"| |bgcolor="#C0C0C0"| |bgcolor="#80FF80"|5 |bgcolor="#DD5555"| |--- !to D |bgcolor="#EE5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |bgcolor="#DD5555"| |} |- |colspan=5| None of the routers have any new shortest-paths to broadcast. Therefore, none of the routers ''receive'' any new information that might change their routing tables. The algorithm comes to a stop. | |}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Distance-vector routing protocol
(section)
Add topic