RIP
The routing tables in gateways and hosts must be initialized and kept up
to date.
One of the protocols that has been designed for dynamic table
update is the
Routing Information Protocol (RIP).
Active gateways advertize their routes to others by broadcasting
periodically a RIP message, which
contains pairs of (IP address, number of hops), i.e. the IP address
of a network and the number of hops along the
path to that network.
RIP uses a hop count metric to measure the distance to
a destination.
A gateway is defined one hop from directly connected network,
two hops from a network that is reachable through an other gateway,
three hops from a network that is reachable through two other gateways etc.
Passive hosts and other gateways listen and update their tables according
to the broadcasted RIP messages.
The routing tables will be updated with the smallest hop count
to a particular network.
RIP updates may cause inconsistencies. Consider the following example :
The three gateways each have a route to network N1 (a).
G1 is directly connected, G2 has learned it from G1
and G3 has learned from G3 from the RIP broadcast messages.
When the connection between network N1 and gateway G1 disappears (b),
G1 will set the hop count for the network in its routing table
to infinity and report the new route in the next RIP
message.
But if G2 can broadcast its old value for hop count to network N1
(which is 2), just before
G1 could send out the new RIP message with hop count infinity,
G1 will update its routing table with a route through gateway G2
(i.e. will set the hopcount to N1 to 3),
since the hop count of 2 indicates a shorter route than the direct
route with hop count than infinity.
Possible solutions to minimize the occurrence of a routing loop are:
- split horizon - a gateway should not propagate route information
about a particular interface back to that same interface.
In the example above, gateway G2 should not advertize its hop count 2
to network N1 to gateway G1.
- In case a gateway advertizes a short route to a network, other gateways
update their tables immediately.
E.g. if G1 is first connected to N1 it will broadcast a hop count 1 to N1.
G2 and G3 will immediately update their routing tables using this
information.
On the other hand, if a gateway stops advertizing a route, other gateways
waits some time, then find (if possible) an alternative
route and broadcast that alternative. It could be that the alternative
depends on the network that has gone down. However, at least the bad news
travels slow, while the good news travels quickly .
In the above example there is no alternative. So, after waiting some
time G2 will broadcast to G3 the hop count infinity to N1.
- hold down - if a message is received that a particluar network
is down, a gateway ignores new routing information about that network
for some time. This gives other gateways time to receive the bad news
and not mistakenly accept an out of date update message.
-
poison reverse updates -
once a network goes down, the advertizing gateway
retains the entry for several update periodes, with hop count infinity.
In other words, for some time it is specifically advertized that
network N1 is down, rather than that network N1 is no longer
included in the RIP updates to indicate that it is down.
Poison reverse updates work best in combination with
-
triggered updates -these updates force a gateway to immediately
broadcast the recieved update, in stead of waiting for the next periodic
update.
RIP uses the convention, that IP address 0.0.0.0 in a routing table
means the default address.
RIP uses UDP
as the transport protocol and operates at UDP port 520.
The use of broadcast, potential for routing loops, hold down can make RIP
inefficient for Wide Area Networks.
For WAN other protocols are used for updating routing tables in the
gateways.