RIP Message Format

  • RIP
    • RIPv1
    • RIPv2
    • RIPng

RIP Message Format : UDP


RIPv1 Message Format : 520/udp

┃ 8bit         | 8bit       | 16bit       ┃
┏--------------+------------+-------------┓ -----------------|
┃ Command(1~6) | Version(1) | Reserved(0) ┃                  |
┠--------------+------------+-------------┨                  |
┃ AFI(2)                    | Reserved(0) ┃                24byte
┠---------------------------+-------------┨ ----|            |
┃ IP Address                              ┃     |            |
┠-----------------------------------------┨     |            |
┃ Reserved(0)                             ┃     |            |
┠-----------------------------------------┨  a routing entry |
┃ Reserved(0)                             ┃     |            |
┠-----------------------------------------┨     |            |
┃ Metric(1~16)                            ┃     |            |
┠-----------------------------------------┨ ----|------------|
┃ ... ... up to 25 routing entries        ┃
┗-----------------------------------------┛

Command: 1–Request, 2–Response
IP Address: main net ip addr, subnet ip addr, host routing addr
AFI,Address Family Identifier,地址族标识:
When Request the whole routing table Message,AFI=0 (0.0.0.0), Metric=16


RIPv2 Message Format : 520/udp

From Routing TCP/IP(Volume I,Second Edition):
┃ 8bit         | 8bit       | 16bit       ┃
┏--------------+------------+-------------┓ -----------------|
┃ Command(1/2) | Version(1) | Reserved(0) ┃                  |
┠--------------+------------+-------------┨                  |
┃ AFI(2)                    | Route tag   ┃                24byte
┠---------------------------+-------------┨ ----|            |
┃ IP Address                              ┃     |            |
┠-----------------------------------------┨     |            |
┃ Subnet Mask                             ┃     |            |
┠-----------------------------------------┨  a routing entry |
┃ Next Hop                                ┃     |            |
┠-----------------------------------------┨     |            |
┃ Metric(1~16)                            ┃     |            |
┠-----------------------------------------┨ ----|------------|
┃ ... ... up to 25 routing entries        ┃
┗-----------------------------------------┛
From TCP/IP Illustrated(Volume 1: The Protocols):
┃ 8bit         | 8bit       | 16bit          ┃
┏--------------+------------+----------------┓ -----------------|
┃ Command(1~6) | Version(2) | routing domain ┃                  |
┠--------------+------------+----------------┨                  |
┃ AFI(2)                    | routing tag    ┃                24byte
┠---------------------------+----------------┨ ----|            |
┃ IP Address                                 ┃     |            |
┠--------------------------------------------┨     |            |
┃ Subnet Mask                                ┃     |            |
┠--------------------------------------------┨  a routing entry |
┃ Next Hop                                   ┃     |            |
┠--------------------------------------------┨     |            |
┃ Metric(1~16)                               ┃     |            |
┠--------------------------------------------┨ ----|------------|
┃ ... ... up to 25 routing entries           ┃
┗--------------------------------------------┛

RIPng Message Format : 521/udp

┃ 8bit         | 8bit       | 16bit       ┃
┏--------------+------------+-------------┓ -----------------|
┃ Command(1/2) | Version(1) | Reserved(0) ┃                  |
┠--------------+------------+-------------┨                  |
┃ AFI(2)                    | Route tag   ┃                24byte
┠---------------------------+-------------┨ ----|            |
┃ IP Address                              ┃     |            |
┠-----------------------------------------┨     |            |
┃ Subnet Mask                             ┃     |            |
┠-----------------------------------------┨  a routing entry |
┃ Next Hop                                ┃     |            |
┠-----------------------------------------┨     |            |
┃ Metric(1~16)                            ┃     |            |
┠-----------------------------------------┨ ----|------------|
┃ ... ... up to 25 routing entries        ┃
┗-----------------------------------------┛