ripRouting Information Protocol — RIPv2 & Dual-Stack RIPngHop-Count Nostalgia That Refuses to Die (rip UDP 520 / RIPng 521)
What It Does on the Wire
Every textbook swears RIP died in 1998, right up until you inherit a branch router running it. rip builds RIPv2 (520) over IPv4 and RIPng (521) over IPv6, right up to metric 16 poison reverse.
Routing Information Protocol (rip) is a distance-vector routing protocol limited to a maximum hop count of 15 (metric 16 = infinity / route poison). In FrameAssembly v3.1.2, rip morphs automatically by address family: between IPv4 hosts, it emits RIPv2 (RFC 2453, UDP 520 -> 520, 20-byte Route Table Entry with Route Tag, Subnet Mask, Next Hop, and 32-bit Metric); between IPv6 hosts, it emits RIPng (RFC 2080, UDP 521 -> 521, Version 1, 20-byte IPv6 Prefix RTE).
Both request (command 1) and response/reply (command 2) messages compile cleanly with zero boilerplate.
Route Poisoning (metric 16) & Split-Horizon Testing
Emit rip response prefix 10.200.0.0 metric 16 poison updates to verify branch router withdrawal timers.
Legacy Unauthenticated RIPv2 Spoofing Detection
Test IDS/NDR signatures and switch ACLs designed to catch unexpected UDP 520 / 224.0.0.9 route injection attempts on campus VLANs.
Dual-Stack Lab Exam & Wireshark Training Captures
Compare side-by-side RIPv2 (UDP 520) and RIPng (UDP 521) wire layouts generated from identical .frasm statements.
Minimal Quickstart (rip_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host branch_rtr { ip 10.10.0.1 }host edge_rtr { ip 10.10.0.2 }compile { branch_rtr -> edge_rtr rip request wait 2ms branch_rtr <- edge_rtr rip response prefix 10.200.0.0 metric 2 tag 100}What the Compiler Calculates So You Don't Have To
- Selects RIPv2 on UDP
520 -> 520over IPv4 hosts or RIPng on UDP521 -> 521over IPv6 hosts. - Populates Address Family Identifier
2(AF_INET),255.255.255.0default mask, Route Tag, Next Hop, and Metric in RIPv2—or 128-bit IPv6 prefix + prefix-length + 8-bit metric in RIPng. - Derives RFC multicast Ethernet MACs automatically when sending to
224.0.0.9(RIPv2) orff02::9(RIPng).
RIPv2 Multicast Update, Route Poisoning (Metric 16), and IPv6 RIPng
Shows a branch router advertising 10.50.10.0 (metric 2), subsequently poisoning the route (metric 16) upon link loss, and advertising an IPv6 prefix over RIPng (ff02::9).
host rtr_branch { ip 172.16.10.2 }host rip_mcast { ip 224.0.0.9 }host rtr6_a { ip fe80::10:1 }host ripng_all { ip ff02::9 }compile { // 1. Periodic RIPv2 multicast advertisement (metric 2, route tag 65010) rtr_branch -> rip_mcast rip response prefix 10.50.10.0 nexthop 0.0.0.0 metric 2 tag 65010 ttl 2 wait 10ms // 2. Triggered route-poison update (metric 16 = infinity / unreachable) rtr_branch -> rip_mcast rip response prefix 10.50.10.0 nexthop 0.0.0.0 metric 16 tag 65010 ttl 2 wait 5ms // 3. IPv6 RIPng advertisement on UDP 521 -> 521 to ff02::9 rtr6_a -> ripng_all rip response prefix 2001:db8:50:: metric 1 tag 100 ttl 255}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show rip_v2_ripng.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly rip_v2_ripng.frasm rip_v2_ripng.pcap
frameassembly rip_v2_ripng.frasm rip_v2_ripng.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse rip_v2_ripng.pcap rip_v2_ripng_edited.frasmAll rip Keywords & Header Options
Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after rip:
src_host -> dst_host rip [request | response | reply] [prefix <ip>] [metric <1..16>] [nexthop <ip>] [tag <0..65535>]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| request | response | reply | command <1|2> | RIP Command selector | response (Command 2) | Selects Command 1 (request) or Command 2 (response / reply). |
| prefix <ip> | IPv4 or IPv6 address literal (no /CIDR slash) | 10.0.0.0 (v4) / 2001:db8:: (v6) | Sets the advertised destination network address in the Route Table Entry. |
| metric <1..16> | Hop count integer (1..16) | 1 | Sets the route hop-count metric (1..15 reachable hops, 16 infinity / unreachable). |
| nexthop <ip> | IPv4 address literal | 0.0.0.0 (advertising router) | Sets the immediate Next Hop IP in RIPv2 (0.0.0.0 means use the UDP packet source IP). |
| tag <0..65535> | Whole number (0..65535) | 0 | Sets the 16-bit external Route Tag (often carrying redistributed BGP ASN). |
Cross-Layer Wrappers Valid with rip
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
10 options
Cross-Layer Wrappers Valid with rip
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | Colon, hyphen, or Cisco dot MAC | Host MAC / RFC multicast MAC | Overrides the 14-byte Ethernet II source or destination MAC address for this single packet. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority. |
| qinq <0..4095> [innervlan <0..4095>] | Outer S-VLAN 0..4095, Inner C-VLAN 0..4095 | Untagged (innervlan 1 when qinq is set) | Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100). |
| mpls <0..1048575> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255 | Unlabeled (at most 1 mpls tag per packet) | Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header. |
| ttl <0..255> [dscp <0..63>] [ecn <0..3>] | TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3 | ttl 64, dscp 0, ecn 0 | Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] | IPv4 ID, DF/MF flags, fragment offset 0..8191 | ipid 1, flags 0, fragoffset 0 | Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6). |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts). |
| srcport <0..65535> | dstport <0..65535> | Port number 0..65535 | srcport 49152 (remembered), UDP 520 (RIPv2) / UDP 521 (RIPng) | Overrides source or destination port and remembers the port pair automatically on <- replies. |
Gotchas & Quick Fixes
Pass Plain IP Literals to rip prefix (No /24 Suffix)
r1 -> r2 rip response prefix "10.50.10.0/24"r1 -> r2 rip response prefix 10.50.10.0 metric 2Unlike bgp update prefix "10.20.0.0/16", rip prefix <ip> expects an unquoted IPv4 or IPv6 address literal (10.50.10.0 or 2001:db8:50::).
Valid Hop-Count Metric Bounds (1..16)
r1 -> r2 rip response metric 255r1 -> r2 rip response metric 16Per RFC 2453, RIP metrics range from 1 to 16 (16 = infinity).