Operation of RIP

NOTE
The metric for RIP is hop count.
The RIP process operates from UDP port 520; all RIP messages are encapsulated in a UDP segment with
both the Source and Destination Port fields set to that value. RIP defines two message types: Request
messages and Response messages. A Request message is used to ask neighboring routers to send an
update. A Response message carries the update. The metric used by RIP is hop count, with 1 signifying a
directly connected network of the advertising router and 16 signifying an unreachable network.
On startup, RIP broadcasts a packet carrying a Request message out each RIP-enabled interface. The RIP
process then enters a loop, listening for RIP Request or Response messages from other routers. Neighbors
receiving the Request send a Response containing their routing table.
When the requesting router receives the Response messages, it processes the enclosed information. If a
particular route entry included in the update is new, it is entered into the routing table along with the
address of the advertising router, which is read from the source address field of the update packet. If the
route is for a network that is already in the table, the existing entry will be replaced only if the new route
has a lower hop count. If the advertised hop count is higher than the recorded hop count and the update
was originated by the recorded next-hop router, the route will be marked as unreachable for a specified
holddown period. If at the end of that time the same neighbor is still advertising the higher hop count, the
new metric will be accepted.