Protocol 23 of 81Layer 3FrameAssembly v3.1.2
llms-full.txt
ripRouting Information Protocol — RIPv2 & Dual-Stack RIPng

Hop-Count Nostalgia That Refuses to Die (rip UDP 520 / RIPng 521)

Default Port / Protocol
UDP 520 (RIPv2) / UDP 521 (RIPng)
Host Endpoint Rule
Dual-Stack Morphing (v4/v6)
Wireshark Display Filter
rip || ripng
Standards & Specs
RFC 2453, RFC 2080
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6RIPv2 / RIPng (UDP 520 (RIPv2) / UDP 521 (RIPng))

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.

rip_quickstart.frasm7 lines
Open in 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 -> 520 over IPv4 hosts or RIPng on UDP 521 -> 521 over IPv6 hosts.
  • Populates Address Family Identifier 2 (AF_INET), 255.255.255.0 default 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) or ff02::9 (RIPng).
Multi-Frame Lab · Ready to Compile

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).

rip_v2_ripng.frasm13 lines
Open in Playground
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
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 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.frasm

All 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 / OptionAccepted ValueDefaultEffect on Packet
request | response | reply | command <1|2>RIP Command selectorresponse (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)1Sets the route hop-count metric (1..15 reachable hops, 16 infinity / unreachable).
nexthop <ip>IPv4 address literal0.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)0Sets 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
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances 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)OmittedAppends 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 MACHost MAC / RFC multicast MACOverrides 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..1UntaggedWraps 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..4095Untagged (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..255Unlabeled (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..3ttl 64, dscp 0, ecn 0Sets 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..8191ipid 1, flags 0, fragoffset 0Sets 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)0Sets 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..65535srcport 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)

Avoid
r1 -> r2 rip response prefix "10.50.10.0/24"
Valid v3.1.2 Syntax
r1 -> r2 rip response prefix 10.50.10.0 metric 2

Unlike 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)

Avoid
r1 -> r2 rip response metric 255
Valid v3.1.2 Syntax
r1 -> r2 rip response metric 16

Per RFC 2453, RIP metrics range from 1 to 16 (16 = infinity).

Field Guide 05
VLANs, QinQ, MPLS, Tunnel Soup & Dual-Stack IPv6