RIPng for IPv6
Extracted elements (26)
Rather than including a next hop field in every RTE (which would nearly double RTE size), RIPng uses a special next hop RTE (metric=0xFF) that applies to all subsequent address RTEs until end of message or another next hop RTE is encountered.
RIPng omits per-interface authentication fields present in RIP-2, instead relying entirely on IPv6's IP Authentication Header (RFC 1826) and IP Encapsulating Security Payload (RFC 1827) for integrity and confidentiality of routing exchanges.
The 15-hop maximum diameter is an intentional protocol design limitation. Using larger per-link costs reduces the effective maximum further, making RIPng inappropriate for large or complex autonomous systems.
RIPng is derived from RIP-1 (RFC 1058) and RIP-2 (RFC 1723) with the minimum changes needed for IPv6 operation. It uses version number 1 in the header; packets with unrecognized versions are handled per section 2.4 input processing.
A Response MUST be ignored if it is not sourced from the RIPng port (521). The source IPv6 address of the datagram MUST be a link-local address; datagrams from the router's own addresses MUST be ignored.
After sending a triggered update, a timer MUST be set to a random interval between 1 and 5 seconds; additional changes during this interval are coalesced into a single update when the timer expires. Sending complete routing tables in triggered updates is strongly discouraged.
An inbound next hop address that is not a link-local address SHOULD be treated as 0:0:0:0:0:0:0:0 (i.e., packets should be forwarded to the advertisement originator instead).
Periodic advertisement and triggered update packets sent to the all-rip-routers multicast group MUST have their IPv6 hop count set to 255, and inbound multicast packets from the RIPng port must be checked to ensure the hop count is 255, guaranteeing the sender is a directly-attached neighbor.
Routes to link-local addresses MUST never be included in an RTE in any Response message.
The IPv6 source address of an outgoing Response message (unsolicited or triggered) MUST be the designated link-local address of the sending interface. A router with multiple link-local addresses on one interface must originate only a single Response per interface.
To prevent timer synchronization among neighboring routers (which can cause collisions), implementations MUST either use a timer unaffected by system load or apply a random offset of ±0–15 seconds to the 30-second update interval.
Unsolicited Response messages (regular and triggered updates) MUST be multicast to FF02::9 (all-rip-routers) on all directly-connected networks that support broadcasting or are point-to-point links.
When a route's metric from the same upstream router changes, or a better metric arrives from any router, the new route MUST be adopted, the route change flag set, and a triggered update signalled. If the new metric is infinity, the deletion process begins.
When validating individual RTEs in a Response, a destination that is a multicast prefix or a link-local address is invalid and the entry must be ignored. The prefix length must be 0–128 inclusive and the metric must be 1–16 inclusive.
A default route is represented by a prefix and prefix length both equal to zero. Default routes are processed identically to other destination prefixes and should generally not be propagated outside an AS boundary.
RIPng defines two command types: 1 (Request) asks a router to send all or part of its routing table; 2 (Response) carries all or part of the sender's routing table and may be solicited or unsolicited.
RIPng is a UDP-based protocol that sends and receives datagrams on UDP port 521. All routing update messages are sent from the RIPng port; unsolicited updates have both source and destination port equal to 521.
RIPng uses three timers per route: a 30-second periodic update, a 180-second route timeout (expiry triggers deletion), and a 120-second garbage-collection timer after which the route is removed from the routing table.
Split Horizon with Poison Reverse is the preferred method of loop avoidance: routes learned from a neighbor are re-advertised back to that neighbor with metric 16 (infinity) rather than being omitted. Implementations should provide per-interface control to select no horizoning, split horizoning, or poison reverse.
The metric field encodes the cost to a destination as an integer 1–15 inclusive; value 16 represents infinity (unreachable). RIPng is limited to networks with a maximum path diameter of 15 hops.
The route tag field is a 2-octet attribute that must be preserved and re-advertised with a route. Its primary purpose is to distinguish internal RIPng routes from external routes imported from an EGP or another IGP.
Since RIPng runs over IPv6, it relies on the IP Authentication Header and IP Encapsulating Security Payload to ensure integrity, authentication, and confidentiality of routing exchanges. No RIPng-internal authentication mechanism is defined.
A route transitions from Active (timeout running) to Expired (metric set to 16, garbage-collection timer started, triggered update sent) on timeout or explicit metric-16 update, and then to Deleted when the 120-second garbage-collection timer expires. A new route received while garbage-collection is running resets the route to Active.
Each Route Table Entry (RTE) is 20 octets: a 16-octet IPv6 prefix, a 2-octet route tag, a 1-octet prefix length (0–128), and a 1-octet metric (1–16). All fields are in network byte order.
The next hop RTE is a special 20-octet RTE identified by metric value 0xFF. The 16-octet prefix field holds the IPv6 next hop address; route tag and prefix length must be zero. A next hop of 0:0:0:0:0:0:0:0 means the originator of the advertisement.
The RIPng packet header consists of a 1-octet command field, 1-octet version field, and a 2-octet must-be-zero field, followed by one or more 20-octet Route Table Entries (RTEs).