Reference R16 min readFrameAssembly v3.1.2
llms-full.txt

Wireshark / tcpdump / Scapy -> .frasm Rosetta Stone

One-page translation map from Wireshark display filters, tcpdump, Scapy, and tcprewrite to exact FrameAssembly v3.1.2 keywords.

TL;DR — What Matters Here
  • Every built-in .frasm v3.1.2 keyword, protocol, flag, and time unit is strictly [a-z0-9]+ — zero underscores, zero hyphens.
  • Frame #1 = 0ns; inline wait <n><ns|us|ms|s|m> sets the gap *before* the next frame (default +10ms when omitted).
  • 8 L2 protocols allow MAC-only hosts · 9 dual-L4 protocols accept transport tcp|udp · 70 L3–L7 protocols run over both IPv4 & IPv6.

1. Wireshark Display Filter -> .frasm Modifier Map

Know the Wireshark filter? Here is the exact .frasm token to type:

rosetta_all_in_one.frasm9 lines
Open in Playground
host client { ip 10.10.20.15 mac 001a.2b3c.4d15 }
host edge { ip 10.10.20.1 mac 001a.2b3c.4d01 }
compile {
client -> edge tcp syn srcport 51443 dstport 443 win 65535 mss 1460 sackperm vlan 100 pcp 5 dscp 46 wait 1ms
client <- edge tcp syn ack win 65535 mss 1460 sackperm vlan 100 pcp 5 dscp 46 wait 1ms
client -> edge tcp ack vlan 100 pcp 5 dscp 46 wait 1ms
client -> edge tls clienthello sni "portal.corp.local" alpn "h2" vlan 100 pcp 5 dscp 46
}
IntentWireshark FilterFrameAssembly v3.1.2 (.frasm)
802.1Q VLAN + 802.1p Priorityvlan.id == 100 && vlan.priority == 5vlan 100 pcp 5 dei 0
802.1ad QinQ S-Tag + C-Tagvlan.etype == 0x88a8qinq 2000 innervlan 150
MPLS Shim Labelmpls.label == 24010 && mpls.bottom == 1mpls 24010 exp 5 bos 1 mplsttl 64
IPv4/IPv6 Hop Limit & DiffServip.ttl == 64 && ip.dsfield.dscp == 46ttl 64 dscp 46 ecn 0
IPv4 DF / Fragmentationip.flags.df == 1 / ip.frag_offset > 0df or ipid 0x1234 mf fragoffset 0
TCP Ports, Flags & Optionstcp.dstport == 443 && tcp.flags.syn == 1tcp syn srcport 51234 dstport 443 win 65535 mss 1460 wscale 7 sackperm
Explicit TCP SEQ & ACK Numberstcp.seq == 1000 && tcp.ack == 5001tcp ack seq 1000 acknum 5001 (bare ack = flag bit!)
HTTP Request + Host Headerhttp.host == "api.internal" && http.request.method == "POST"http post uri "/v1/login" hosthdr "api.internal"
TLS ClientHello SNI & ALPNtls.handshake.extensions_server_name == "app.corp.local"tls clienthello sni "app.corp.local" alpn "h2"
SNMPv2c / v3 Trap OID + Stringsnmp.name == 1.3.6.1.6.3.1.1.4.1.0varbind 1.3.6.1.6.3.1.1.4.1.0 oidval 1.3.6.1.6.3.1.1.5.3 varbind 1.3.6.1.2.1.1.5.0 string "sw1"

2. Scapy, tcprewrite & snmptrap -> FrameAssembly

How those multi-flag shell pipelines shrink down into .frasm:

JobThe Old WayFrameAssembly (v3.1.2)
Scrub IPs, VLANs, or L7 hostnames in a .pcaptcprewrite --srcipmap=... --fixcsum (L3/L4 only; breaks if L7 size changes)frameassembly reverse in.pcap edit.frasm -> edit text -> frameassembly edit.frasm out.pcap
Stateful TCP + L7 stream for Suricata25+ lines of Python Scapy juggling seq, ack, and len(payload)3 handshake lines (-> / <-) + 1 L7 line in compile { ... }
Encrypted SNMPv3 authPriv trapsnmptrap -v 3 -e 0x... + missing vendor MIB errors + live socketsnmp3 trap user "..." engineid "..." auth sha256 "..." priv aes "..."
Preview packet table in terminaltcpdump -nn -tt -r demo.pcapframeassembly show demo.frasm (before even writing a .pcap)

3. Timing & Protocol Whitelist Cheat Matrix

Four compiler rules worth keeping in your back pocket:

RuleExact Set / BehaviorNotes
Post-packet wait clockFrame #1 = 0ns. wait <n><ns|us|ms|s|m> advances clock before the *next* frame.Omitted wait = +10ms · wait 0ns = zero-gap burst · never standalone.
8 MAC-only L2 protocolsarp, vlan, qinq, lldp, stp, lacp, eapol, mplshost sw1 { mac 00:1c:73:00:00:01 } works here; all 73 L3-L7 protocols require matching IPs.
IPv4 vs IPv6 rulesIPv4-only: igmp · IPv6-only: ndp, mld · Dual-stack: all other 70 L3-L7 protocolsicmp, ospf, rip, vrrp, hsrp, and dhcp morph v4 <-> v6 automatically (ospf routerid stays dotted-quad).
9 transport tcp|udp protocolsDefault UDP: dns, sip, syslog, kerberos, memcached · Default TCP: dnp3, modbus, nfs, ethernetipRejected on single-transport protocols (http, bgp, quic, ntp, ...).

4. Six Deliberate Keyword Disambiguations

Six modifier names avoid colliding with top-level blocks or flag bits:

  • hosthdr "api.internal" — HTTP / SSDP Host: header (host declares network boxes).
  • transporthdr "RTP/AVP;unicast;client_port=5004-5005" — RTSP Transport: header (transport tcp|udp picks L4).
  • acknum 1001 — 32-bit TCP acknowledgment number (bare ack = ACK flag bit).
  • srcport / dstport — L4 ports (sport / dport are rejected).
  • varbind <oid> string "<txt>" & varbind 1.3.6.1.6.3.1.1.4.1.0 oidval <oid> — SNMP varbinds (str and trapoid do not exist).
  • CoAP shorthands (get, post, put, delete, created, changed, notfound) and code "0.01" are mutually exclusive on the same frame.