|
Illustrated TCP/IP
by Matthew G. Naugle
Wiley Computer Publishing, John Wiley & Sons, Inc.
ISBN: 0471196568 Pub Date: 11/01/98
|
Chapter 97
Updating Other Routers (Distance Vectors)
Updating Other Routers (Distance Vectors)
- Upon initialization, each router reads its preconfigured IP address and metric (cost in hops) of all its active ports.
- Each router transmits a portion of its routing table (network ID, metric) to each neighbor router.
- Each router uses the most recent updates from each neighbor.
- Each router uses the update information to calculate its own shortest path (distance in hops) to a network.
- Tables are updated only:
- If the received information indicates a shorter path to the destination network.
- If the received update information indicates a network is no longer reachable.
- If a new network is found.
|
Some but not all the entries of the routers route table are sent out the ports to update other routers as to the networks that this router knows about. There are a few exceptions, which will be explained in a moment. These updates are not forwarded by any router, meaning the updates stay on the network on which they originated. Any router that is located on the same network will receive the packet, read the routing table data, and update its table if needed. All participating routers will accomplish this. In other words, all routers forward their tables out each active port. As each table is received, the routers are building a picture of the network. As each broadcast is transmitted, more and more information is being propagated throughout the network. Eventually, all routers will know of all networks on their internet.
There are three possibilities that can cause a router to update its existing table based on just-received information:
- 1. If the received table contains an entry to a network with a lower hop count, it will replace its entry with the new entry containing the lower hop count.
- 2. If a network exists in the just-received table that does not exist in its own table, it will add the new entry.
- 3. If the router forwards packets to a particular network through a specified router (indicated by the next-hop router address) and that routers hop count to a network destination changes, it will change its entry. In other words, if router A normally routes data for a network X through router B, and router Bs hop-count entry to that network changes, router A changes its entry.