Sunday, January 22, 2012

RIPv1 and RIPv2 Explained

RIPv1 is completely out of the exam. However to understand other protocols in better way its a good idea to built a base.

Question: How does RIPv1 transmit updates?
RIPv1 sends its update at every 30 seconds as UDP broadcast (255.255.255.255) on port 520 to all of its connected links where RIP is enable.

The following are the important fields at each layer in the RIPv1 updates.
Ethernet Layer (If updates are exchanges on multiaccess media like ethernet)
Source mac address: mac address of the interface sending the updates
Destination mac address: FFFF.FFFF.FFFF
Type: 0x800 (as next header is IP)
IP Layer
IP Protocol No. 17 (for UDP at the Tansport Layer, next header)
Destination IP Address: 255.255.255.255 (for Broadcast address)
Source IP Address: address of the interface from where router is origination updates
Transport Layer
Source UDP Port: 520
Destination UDP Port: 520
Application Layer
RIP version
Metric (1-16)
Routes max of 25 per update: To keep size of UDP packet less than 512 bytes( this is due to the fact that UDP doesnot have MTP path discovery like TCP so as per the TCP/IP protocol suit recommendation we keep UDP packet less than 512 bytes)

Question: Is it same for RIPV2 right ?
RIPv2 sends its updates as multicast (ip address 224.0.0.9) instead of broadcast in RIPv1. Now in this case the RIPv2 updates are only processed by RIP enable interfaces as oppose to RIPv1 where these packets are processed by all the routers on the link.
In RIPv2 Just replace Multicast address with broadcast address in IP layer as well as Ethernet layer for RIPv2. And everything is remained same for RIPv2

A side note: RIP v1 only supports classful address and does not support varable length subnet masking which RIPv2 does