srv6 — IPv6 Segment Routing Header (SRH Type 4) SID Stacks
- Default Port / Protocol
- IPv6 NextHdr 43 (Routing Type 4)
- Host Endpoint Rule
- IPv6-Only
- Wireshark Display Filter
- ipv6.routing.type == 4
- Standards & Specs
- RFC 8754, RFC 8986, RFC 9252
What It Does on the Wire
Who needs MPLS label distribution when 128-bit IPv6 addresses carry the entire program? Repeat sid <ipv6> as many times as you want on srv6 and the compiler calculates Hdr Ext Len and Last Entry automatically.
Segment Routing over IPv6 (srv6, RFC 8754 / RFC 8986) encodes explicit source-routed paths, L3VPN/EVPN service functions (End.DT4, End.DX2), and 5G transport slicing directly into the IPv6 data plane using the Segment Routing Header (SRH, IPv6 Extension Header 43, Routing Type 4). Each SRH carries an ordered vector of 128-bit IPv6 Segment Identifiers (sid), a Segments Left pointer (segleft), Last Entry index, Flags, and a 16-bit packet Tag.
FrameAssembly enforces IPv6-only endpoints on srv6 at compile time, supports repeatable sid <ipv6> modifiers to build multi-hop segment lists of any length, and auto-computes both Hdr Ext Len (2 * num_sids in 8-octet units) and Last Entry (num_sids - 1).
Carrier Backbone Traffic Engineering & TI-LFA Fast Reroute
Construct multi-SID SRH headers (sid 2001:db8:1::1 sid 2001:db8:2::1 sid 2001:db8:3::d4) with explicit segleft indices to verify P/PE router SRH processing and Wireshark ipv6.routing.type == 4 dissection.
5G Transport Slicing & SRv6 BGP L3VPN / EVPN Service SIDs
Combine 20-bit IPv6 flowlabel, dscp, SRH tag, and RFC 8986 Locator:Function:Args SIDs to test SmartNIC, VPP, and Linux kernel seg6 policies.
Perimeter IPv6 Routing Header (NextHdr 43) Security Audits
Verify border routers and firewalls drop untrusted external SRv6 source-routed packets at domain boundaries per RFC 8754 Section 5 security mandates.
RFC Wire Header Layout (srv6)
Select any 32-bit wire word or field slice below to inspect which .frasm modifiers control those octets and what defaults the compiler writes.
Filter with ipv6.routing.type == 4 in Wireshark to inspect Hdr Ext Len, Routing Type 4 (SRH), Segments Left, Last Entry, Tag, and the ordered 128-bit Segment List[0..n].
Minimal Quickstart (srv6_quickstart.frasm)
Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.
host pe_ingress { ip 2001:db8:c0ca::1 }
host p_transit { ip 2001:db8:c0ca::2 }
compile {
pe_ingress -> p_transit srv6 segleft 1 sid 2001:db8:100::1 sid 2001:db8:200::1 nextheader 59
}Handled Automatically on the Wire
- Sets the outer IPv6 Next Header field to
43(Routing Header) and initializes the SRH fixed 8-byte header withRouting Type = 4(SRH). - Calculates
Hdr Ext Len(num_sids * 2) andLast Entry(num_sids - 1) automatically from your repeatablesid <ipv6>list (inserting a default SID when omitted). - Validates at compile time that both endpoints declare IPv6 addresses, preventing accidental IPv4 SRH framing.
3-Segment SRv6 L3VPN Path Progression Across Ingress PE, Transit P & Egress PE
Traces a packet traversing an SRv6 Traffic-Engineered path as segleft decrements from 2 to 1 across transit hops, carrying a VRF classification tag and ECMP flowlabel.
host pe1_v6 { ip 2001:db8:fab::11 mac 00:1c:73:01:00:11 }
host p1_v6 { ip 2001:db8:fab::22 mac 00:1c:73:02:00:22 }
host pe2_v6 { ip 2001:db8:fab::33 mac 00:1c:73:03:00:33 }
compile {
// 1. Hop 1 (PE1 -> P1): 3 SIDs in SRH (End.DT4 VPN SID at index 0, transit SIDs at 1 & 2), segleft = 2
pe1_v6 -> p1_v6 srv6 segleft 2 tag 100 nextheader 4 sid 2001:db8:33::d4 sid 2001:db8:22::e1 sid 2001:db8:11::e1 dscp 46 flowlabel 0x4a100 payload "inner-vrf-frame" wait 1ms
// 2. Hop 2 (P1 -> PE2): Transit node decrements segleft -> 1 and Hop Limit -> 63
p1_v6 -> pe2_v6 srv6 segleft 1 tag 100 nextheader 4 sid 2001:db8:33::d4 sid 2001:db8:22::e1 sid 2001:db8:11::e1 ttl 63 dscp 46 flowlabel 0x4a100 payload "inner-vrf-frame" wait 2ms
// 3. SRv6 OAM probe with No-Next-Header (59) and O-flag (0x20)
pe1_v6 -> pe2_v6 srv6 segleft 0 flags 0x20 tag 999 nextheader 59 sid 2001:db8:33::e1
}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show srv6_te_path.frasm
# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly srv6_te_path.frasm srv6_te_path.pcap
frameassembly srv6_te_path.frasm srv6_te_path.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse srv6_te_path.pcap srv6_te_path_edited.frasm
# 4. Verify dissected protocol fields in tshark
tshark -r srv6_te_path.pcap -Y "ipv6.routing.type == 4"All srv6 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 srv6:
src_host -> dst_host srv6 [nextheader <0..255>] [segleft <0..255>] [flags <0..255>] [tag <0..65535>] [sid <ipv6>]...| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| sid <ipv6> (repeatable) | 128-bit IPv6 Segment Identifier (repeatable) | Single default SID (2001:db8::1) | Appends each 16-byte IPv6 SID into Segment List[0..n] and updates Hdr Ext Len and Last Entry. |
| segleft <0..255> | 8-bit Segments Left index (0..255) | 0 (or SidCount - 1) | Sets the active segment index pointer in byte 3 of the SRH. |
| nextheader <0..255> | 8-bit IANA protocol number (0..255) | 59 (IPv6 No Next Header) | Sets byte 0 of the SRH (4=IPv4-in-SRv6, 41=IPv6-in-SRv6, 58=ICMPv6, 59=No Next Header, 143=Ethernet L2VPN). |
| flags <0..255> | 8-bit SRH Flags bitmask (0..255) | 0 | Sets byte 5 of the SRH (such as RFC 9259 OAM O-flag = 0x20). |
| tag <0..65535> | 16-bit unsigned packet group tag (0..65535) | 0 | Writes the big-endian 16-bit Tag in bytes 6..7 of the SRH. |
Cross-Layer Wrappers Valid with srv6
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 srv6
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). |
| comment "<text>" | Quoted UTF-8 annotation | Omitted | Attaches an Enhanced Packet Block opt_comment annotation when compiling to .pcapng (Wireshark pkt_comment filter). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef", "de:ad:be:ef", or "\x01\x02") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | ethertype <0..65535> | Colon/hyphen/Cisco MAC · EtherType 0..65535 (e.g. 0x0800) | Host MAC / RFC multicast MAC / auto EtherType | Overrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType. |
| fcs | badfcs | Ethernet CRC-32 trailer flags (choose one) | Omitted | fcs appends a valid IEEE 802.3 4-byte CRC-32 Frame Check Sequence trailer; badfcs XOR-corrupts the CRC-32 for NIC/tap negative tests. |
| 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> [label <0..1048575>] [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Repeatable label stack (0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255) | Unlabeled (auto bos=0 on outer labels, bos=1 on bottom) | Prepends one or more 32-bit MPLS label shims (0x8847, e.g. mpls 16000 mpls 24010) ahead of Layer 2 EoMPLS or Layer 3 payloads. |
| 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. |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (valid on IPv6 endpoint pairs only). |
Gotchas & Quick Fixes
srv6 Requires IPv6 Endpoints on Both Hosts
host r1 { ip 10.0.0.1 }
host r2 { ip 10.0.0.2 }
compile { r1 -> r2 srv6 }host r1 { ip 2001:db8::1 }
host r2 { ip 2001:db8::2 }
compile { r1 -> r2 srv6 sid 2001:db8:1::1 }Because SRv6 is an IPv6 Routing Extension Header (Next Header 43), validate_semantics rejects IPv4 or MAC-only endpoints on srv6 frames.
Repeat sid <ipv6> for Each Hop (Never Comma-Separated Arrays)
r1 -> r2 srv6 sid [2001:db8:1::1, 2001:db8:2::1]r1 -> r2 srv6 sid 2001:db8:1::1 sid 2001:db8:2::1Pass each 128-bit Segment ID as its own sid <ipv6> modifier clause on the same frame line.