Campus & VLANs · qinq_mpls_trunk.frasmFrameAssembly v3.1.2

Stamp 802.1Q VLAN, Double-Tagged QinQ & MPLS Without an IXIA Rack

Normal OS sockets won’t let unprivileged users emit outer 802.1ad QinQ S-tags, 20-bit MPLS labels, or 802.1p priority bits—and desktop NIC drivers famously strip 802.1Q tags before Wireshark even sees them.

The Catch

When a carrier hands you a new Metro Ethernet circuit or you’re tuning VoIP strict-priority queues, you just want to know whether S-VLAN 2000 + C-VLAN 150 + MPLS 40960 + DSCP 46 make it to the other side unscathed.

Renting a hardware traffic generator or wiring up three spare lab routers just to push four shim bytes onto an Ethernet header is ridiculous when you can type qinq 2000 innervlan 150 mpls 40960 exp 5 on one line.

Setup & Topology

Voice VLAN 110 (DSCP EF) + Carrier QinQ 2000/150 + MPLS 40960 Check

Branch CPE (10.220.1.10) <-> Carrier QinQ 2000/150 + MPLS 40960 <-> HQ Edge (10.220.1.200)

Three frames cover the whole trunk check: (1) a Voice VLAN 110 G.711 RTP packet stamped with pcp 5 and dscp 46 (EF); followed by (2 & 3) cpe -> hq and cpe <- hq double-tagged 802.1ad frames (qinq 2000 innervlan 150) carrying MPLS label 40960 (exp 5) and a TLS handshake.

Adapt It for Your Network

  1. Set branch_cpe and hq_gateway to your circuit endpoints.
  2. Drop vlan, pcp, dei, dscp, qinq <outer> innervlan <inner>, and mpls <label> right in front of any protocol.
  3. Compile -> verify tag stacks in tshark -> replay onto your trunk NIC.

.frasm -> .pcap

Preview frames inline or open in Playground ->

Writes raw 802.1Q (0x8100), 802.1ad (0x88a8), MPLS (0x8847), and DSCP EF headers straight into a 3-frame .pcap.

qinq_mpls_trunk.frasm
Open in Playground
host branch_cpe { ip 10.220.1.10 }
host hq_gateway { ip 10.220.1.200 }
flow metro_trunk(cpe, hq) {
cpe -> hq vlan 110 pcp 5 dei 0 dscp 46 rtp pt 0 seq 1 timestamp 160 payload "G711_VOICE_EF" wait 5ms
cpe -> hq qinq 2000 innervlan 150 mpls 40960 exp 5 tls clienthello sni "wan.example.com" wait 5ms
cpe <- hq qinq 2000 innervlan 150 mpls 40960 exp 5 tls serverhello wait 5ms
}
compile {
metro_trunk(branch_cpe, hq_gateway)
}
Local CLI Build, Inspect & Replay Commands
# 1. Build the VLAN, QinQ, MPLS & DSCP QoS capture
frameassembly qinq_mpls_trunk.frasm qinq_mpls_trunk.pcap

# 2. Verify VLAN IDs, 802.1p PCP priority, DSCP markings, and MPLS labels in tshark
tshark -r qinq_mpls_trunk.pcap -T fields -e frame.number -e vlan.id -e vlan.priority -e mpls.label -e ip.dsfield.dscp

# 3. Replay onto your 802.1Q / 802.1ad trunk interface
sudo tcpreplay -i eth0 qinq_mpls_trunk.pcap
Browser Tab -> Local Terminal & VS Code

Keep qinq_mpls_trunk.frasm in Git and compile .pcap in under 1ms

Single rootless binary + VS Code extension with live squiggles, quick-fixes, and side-by-side packet ladders ready for Wireshark.

Grab CLI + VS Code ->

More Examples

All 81 Protocols ->