Reference R16 min readFrameAssembly v3.1.2
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
.frasmv3.1.2 keyword, protocol, flag, and time unit is strictly[a-z0-9]+— zero underscores, zero hyphens. - Frame #1 =
0ns; inlinewait <n><ns|us|ms|s|m>sets the gap *before* the next frame (default+10mswhen 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
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}| Intent | Wireshark Filter | FrameAssembly v3.1.2 (.frasm) |
|---|---|---|
| 802.1Q VLAN + 802.1p Priority | vlan.id == 100 && vlan.priority == 5 | vlan 100 pcp 5 dei 0 |
| 802.1ad QinQ S-Tag + C-Tag | vlan.etype == 0x88a8 | qinq 2000 innervlan 150 |
| MPLS Shim Label | mpls.label == 24010 && mpls.bottom == 1 | mpls 24010 exp 5 bos 1 mplsttl 64 |
| IPv4/IPv6 Hop Limit & DiffServ | ip.ttl == 64 && ip.dsfield.dscp == 46 | ttl 64 dscp 46 ecn 0 |
| IPv4 DF / Fragmentation | ip.flags.df == 1 / ip.frag_offset > 0 | df or ipid 0x1234 mf fragoffset 0 |
| TCP Ports, Flags & Options | tcp.dstport == 443 && tcp.flags.syn == 1 | tcp syn srcport 51234 dstport 443 win 65535 mss 1460 wscale 7 sackperm |
| Explicit TCP SEQ & ACK Numbers | tcp.seq == 1000 && tcp.ack == 5001 | tcp ack seq 1000 acknum 5001 (bare ack = flag bit!) |
| HTTP Request + Host Header | http.host == "api.internal" && http.request.method == "POST" | http post uri "/v1/login" hosthdr "api.internal" |
| TLS ClientHello SNI & ALPN | tls.handshake.extensions_server_name == "app.corp.local" | tls clienthello sni "app.corp.local" alpn "h2" |
| SNMPv2c / v3 Trap OID + String | snmp.name == 1.3.6.1.6.3.1.1.4.1.0 | varbind 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:
| Job | The Old Way | FrameAssembly (v3.1.2) |
|---|---|---|
Scrub IPs, VLANs, or L7 hostnames in a .pcap | tcprewrite --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 Suricata | 25+ lines of Python Scapy juggling seq, ack, and len(payload) | 3 handshake lines (-> / <-) + 1 L7 line in compile { ... } |
Encrypted SNMPv3 authPriv trap | snmptrap -v 3 -e 0x... + missing vendor MIB errors + live socket | snmp3 trap user "..." engineid "..." auth sha256 "..." priv aes "..." |
| Preview packet table in terminal | tcpdump -nn -tt -r demo.pcap | frameassembly show demo.frasm (before even writing a .pcap) |
3. Timing & Protocol Whitelist Cheat Matrix
Four compiler rules worth keeping in your back pocket:
| Rule | Exact Set / Behavior | Notes |
|---|---|---|
Post-packet wait clock | Frame #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 protocols | arp, vlan, qinq, lldp, stp, lacp, eapol, mpls | host sw1 { mac 00:1c:73:00:00:01 } works here; all 73 L3-L7 protocols require matching IPs. |
| IPv4 vs IPv6 rules | IPv4-only: igmp · IPv6-only: ndp, mld · Dual-stack: all other 70 L3-L7 protocols | icmp, ospf, rip, vrrp, hsrp, and dhcp morph v4 <-> v6 automatically (ospf routerid stays dotted-quad). |
9 transport tcp|udp protocols | Default UDP: dns, sip, syslog, kerberos, memcached · Default TCP: dnp3, modbus, nfs, ethernetip | Rejected 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 / SSDPHost:header (hostdeclares network boxes).transporthdr "RTP/AVP;unicast;client_port=5004-5005"— RTSPTransport:header (transport tcp|udppicks L4).acknum 1001— 32-bit TCP acknowledgment number (bareack= ACK flag bit).srcport/dstport— L4 ports (sport/dportare rejected).varbind <oid> string "<txt>"&varbind 1.3.6.1.6.3.1.1.4.1.0 oidval <oid>— SNMP varbinds (strandtrapoiddo not exist).- CoAP shorthands (
get,post,put,delete,created,changed,notfound) andcode "0.01"are mutually exclusive on the same frame.