Category 03 of 08Layer 43 Native ProtocolsFrameAssembly v3.2.2
Raw .mdllms-full.txt

Layer 4 Transport Protocols (TCP, UDP & SCTP)

Modern stateful NGFWs, Suricata flow:established rules, and Zeek stream analyzers silently drop single spoofed TCP payload packets that lack a valid 3-way handshake and matching sequence/acknowledgment progression. FrameAssembly maintains a deterministic per-4-tuple TCP state machine shared across raw tcp frames and every TCP-based Layer 7 protocol.

Alongside stateful TCP (with padded RFC 7323 mss, wscale, sackperm, and tsval/tsecr options plus explicit seq/win/rst chaos overrides), Layer 4 includes bidirectional port-inheriting udp datagrams and 4G/5G telecom sctp chunks checksummed with reflected Castagnoli CRC-32c.

Keywords in Category 03:tcpudpsctp
Wire & Endpoint Rules

Wire Framing & Endpoint Rules for Layer 4 Transports

Rule 01

Shared 4-Tuple TCP State Machine

Initial seq starts at 1000 per direction; syn and fin advance seq by +1; payload frames emit psh ack and advance seq by +payload_len while updating peer acknum.

Rule 02

Bidirectional Port Inheritance

Setting srcport / dstport on a -> b stores the tuple so a <- b replies swap source and destination ports automatically without retyping them.

Rule 03

9-Protocol transport tcp|udp Whitelist

Cross-layer transport tcp or transport udp is valid strictly on dns, sip, syslog, kerberos, memcached, dnp3, modbus, nfs, and ethernetip.

Rule 04

Reflected Castagnoli CRC-32c on SCTP

sctp computes hardware-table RFC 9260 Castagnoli CRC-32c (never Adler-32) across init, initack, cookieecho, cookieack, data, and heartbeat chunks.

Multi-Protocol Capture Example

Stateful TCP RFC 7323 Stream, UDP Probe & Telecom SCTP NGAP

Demonstrates a 3-way TCP handshake with RFC 7323 window scaling/SACK/timestamps followed by payload delivery, a custom UDP health datagram, and an SCTP port 38412 5G NGAP INIT + DATA exchange.

l4_tcp_udp_sctp.frasm15 lines
Open in Playground
host client { ip 10.50.1.10 }
host server { ip 10.50.1.20 }
compile {
client -> server tcp syn srcport 53100 dstport 8443 win 65535 mss 1460 wscale 7 sackperm tsval 1000 tsecr 0 wait 1ms
client <- server tcp syn ack win 65535 mss 1460 wscale 7 sackperm tsval 2000 tsecr 1000 wait 1ms
client -> server tcp ack tsval 1001 tsecr 2000 wait 1ms
client -> server tcp psh ack payload "PING-STREAM
" wait 2ms
client <- server tcp ack wait 2ms
client -> server udp srcport 54000 dstport 9125 payload "udp-health-ok" wait 2ms
client -> server sctp init srcport 38412 dstport 38412 vtag 0 tsn 100 wait 1ms
client <- server sctp initack vtag 0x22334455 tsn 500 wait 1ms
client -> server sctp data vtag 0x22334455 tsn 100 stream 1 ssn 0 ppid 60 hexpayload "0015000800000000"
}
Terminal Commands (FrameAssembly CLI v3.2.2)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show l4_tcp_udp_sctp.frasm

# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly l4_tcp_udp_sctp.frasm l4_tcp_udp_sctp.pcap
frameassembly l4_tcp_udp_sctp.frasm l4_tcp_udp_sctp.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse l4_tcp_udp_sctp.pcap l4_tcp_udp_sctp_edited.frasm

# 4. Verify dissected protocol fields in tshark
tshark -r l4_tcp_udp_sctp.pcap -Y "tcp || udp || sctp"
All 3 Protocols

All 3 Native Protocols in Layer 4 Transport Protocols

Select any lowercase protocol keyword below for its full RFC wire layout, modifier table, cross-layer wrappers, and runnable lab capture.

#KeywordProtocol & Wire SummaryDefault Port / ProtoEndpoint RuleWireshark Filter
29tcpTransmission Control Protocol & RFC 7323 Options

tcp — Automatic 4-Tuple Handshakes, RFC 7323 Options & Chaos

IP Proto 6 (Default dstport 80)Dual-Stack IPv4/IPv6tcp
30udpUser Datagram Protocol

udp — Custom Datagrams, Port Memory & Mandatory Checksums

IP Proto 17 (Default dstport 80)Dual-Stack IPv4/IPv6udp
31sctpStream Control Transmission Protocol

sctp — 4-Way Telecom Handshakes, Multi-Stream & CRC-32c

IP Proto 132 (38412 NGAP / 36412 S1AP)Dual-Stack IPv4/IPv6sctp