RIP Routing Protocol: UDP Port 520, Metric and Versions
RIPv1 and RIPv2 send routing messages over UDP port 520. RIPng is the IPv6 version and uses UDP port 521. This guide explains those ports, the hop-count metric, update behavior, and the differences between RIP versions.
RIP Overview Overview
Direct answer: RIPv1 and RIPv2 use UDP port 520. RIPng uses UDP port 521 for IPv6. RIP is a distance-vector protocol that selects routes by hop count, accepts paths up to 15 hops, and treats metric 16 as unreachable.
In This Lesson
1. The Transport Layer and Socket Layer
Unlike OSPF, which communicates directly over raw IP using IP protocol 89, or BGP, which relies on TCP port 179, RIP is handled by the operating system like ordinary application traffic. The RIP routing process binds to UDP port 520 and sends or receives updates through that socket.
Because RIP uses UDP, packets do not include sequencing, windowing, acknowledgements, or built-in delivery confirmation. If an update is dropped during congestion, queue overflow, or interface buffering pressure, RIP does not retransmit that exact packet. The protocol simply waits for the next periodic update cycle to advertise the information again.
2. Hop Count Metric and the Infinity Value
RIP measures the distance to a destination with a single metric: hop count. Each router-to-router step increases the metric by one, and the path with the lowest hop count is preferred.
- Direct connections: A network directly attached to a router's active interface is advertised with a hop count metric of 1.
- Maximum usable metric: The highest valid metric in a working RIP topology is 15.
- Infinity threshold: Metric 16 means unreachable. When a route reaches 16, the router treats it as dead and poisons the route in the database.
3. Comprehensive Protocol Breakdown: RIPv1 vs. RIPv2
RIPv1 and RIPv2 share the same broad distance-vector model and timer-driven behavior, but their packet information, routing intelligence, and security posture are very different. These differences matter during migrations, troubleshooting, and interview-level design discussions.
| Architectural Feature | RIP Version 1 (RIPv1) | RIP Version 2 (RIPv2) |
|---|---|---|
| Subnet Mask Support | Classful. Does not transmit subnet masks in updates and assumes default Class A, B, or C boundaries. | Classless. Sends subnet mask information with the network prefix, allowing precise route interpretation. |
| VLSM and CIDR Compatibility | Unsupported. Cannot reliably distinguish between split subnets such as /26 and /28. | Fully supported. Enables CIDR and VLSM designs across enterprise networks. |
| Traffic Destination | Broadcast to 255.255.255.255, causing every node on the link to inspect the traffic up to Layer 4. | Multicast to 224.0.0.9, so only routers listening for RIP updates process the packet. |
| Triggered Updates | RIP implementations send triggered information for deleted routes between regular updates. | Also uses rate-limited triggered updates; unchanged routes can be omitted from the message. |
| Cryptographic Security | None. Accepts incoming UDP 520 data without authentication, making rogue injection possible. | Supported. Can validate updates with cleartext or MD5 authentication, depending on platform support. |
4. Engineering Notes
- Packet loss is silent: RIP does not retransmit individual updates, so missed information may persist until the next timer-driven update.
- Topology size is constrained: The metric 16 infinity value caps useful RIP paths at 15 hops.
- Version choice matters: RIPv2 is the practical choice for subnetted networks because it supports CIDR, multicast updates, and authentication.
5. Protocol Standards
RFC 2453 specifies RIP version 2, UDP port 520, subnet-mask fields, multicast updates to 224.0.0.9, and triggered-update behavior. RFC 2080 specifies RIPng for IPv6 and UDP port 521.