s1ap — 3GPP 4G S1-MME eNodeB-to-MME ASN.1 APER over SCTP 36412
- Default Port / Protocol
- SCTP 36412 (PPID 18)
- Host Endpoint Rule
- Dual-Stack IPv4/IPv6
- Wireshark Display Filter
- s1ap
- Standards & Specs
- 3GPP TS 36.413, 3GPP TS 24.301, RFC 9260
What It Does on the Wire
Test 4G LTE S1-MME security gateways and telecom NDR probes offline: s1ap emits 3GPP TS 36.413 ASN.1 APER frames straight inside SCTP 36412 (PPID 18) with Castagnoli CRC-32c.
S1 Application Protocol (s1ap, 3GPP TS 36.413) is the 4G LTE S1-MME control-plane protocol linking eNodeB (eNB) radio base stations to the Mobility Management Entity (MME) exclusively over SCTP port 36412 (PPID = 18). Like 5G NGAP, S1AP uses ASN.1 Aligned PER (APER) encoding to carry cell-level setup (S1SetupRequest/Response with Global-ENB-ID, SupportedTAs 16-bit TAC, and eNBname) and UE-associated signaling (InitialUEMessage, DownlinkNASTransport, UplinkNASTransport, UEContextRelease with MME-UE-S1AP-ID, eNB-UE-S1AP-ID, and embedded EPS-NAS 3GPP TS 24.301 PDUs).
FrameAssembly packs compliant APER S1AP containers inside CRC-32c SCTP DATA chunks (PPID 18) over IPv4 or IPv6 backhaul hosts.
LTE Small-Cell / Private CBRS eNodeB <-> MME S1 Setup Testing
Generate s1setuprequest (enbid, plmn, 16-bit tac, enbname) and s1setupresponse captures to validate Magma, Open5GS, srsRAN, and Citizen Broadband Radio Service (315010) EPC cores.
4G Attach & EPS-NAS (nas-eps) Dissector Regression Suites
Carry binary 3GPP TS 24.301 Attach Request and Authentication vectors inside naspdu across initialuemessage and downlinknastransport / uplinknastransport.
4G/5G NSA Dual-Connectivity Backhaul Firewall Verification
Test IPsec backhaul concentrators and telco firewalls carrying side-by-side 4G s1ap (SCTP 36412, PPID 18), 5G ngap (SCTP 38412, PPID 60), and gtpu (UDP 2152).
RFC Wire Header Layout (s1ap)
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 s1ap in Wireshark to inspect SCTP DATA (PPID 18) -> S1AP-PDU IEs including MME-UE-S1AP-ID, eNB-UE-S1AP-ID, Global-ENB-ID, TAI, and embedded EPS NAS-PDU.
Minimal Quickstart (s1ap_quickstart.frasm)
Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.
host enb_01 { ip 10.44.1.11 }
host mme_epc { ip 10.44.1.100 }
compile {
enb_01 -> mme_epc s1ap s1setuprequest enbid 0x001a2 plmn "00101" tac 10 enbname "enb-macro-01" wait 4ms
enb_01 <- mme_epc s1ap s1setupresponse plmn "00101" enbname "mme-epc-01"
}Handled Automatically on the Wire
- Wraps every S1AP message inside IP Protocol
132SCTP (dstport 36412,DATAchunkPPID = 18) with valid Castagnoli CRC-32c. - Encodes ASN.1 APER
S1AP-PDUProcedure Codes (17S1Setup,12InitialUEMessage,11DownlinkNASTransport,13UplinkNASTransport,23UEContextRelease,15ErrorIndication) and sorted ProtocolIE fields. - Formats 3-byte BCD
PLMNidentity, 20-bit MacroeNB-ID, and 16-bit LTETAC(0..65535) automatically.
4G LTE S1-MME Attach Signaling: S1Setup, InitialUEMessage, EPS-NAS Auth & Release
Simulates a CBRS private-LTE eNodeB onboarding onto an MME over SCTP 36412, forwarding an EPS Attach Request (naspdu "0741..."), completing mutual authentication, and releasing the S1 UE context.
host cbrs_enb { ip 172.24.36.12 }
host epc_mme { ip 172.24.36.100 }
compile {
// 1. S1Setup Request & Response (Procedure Code 17, SCTP 36412 PPID 18)
cbrs_enb -> epc_mme s1ap s1setuprequest enbid 0x01020 plmn "315010" tac 401 enbname "cbrs-warehouse-enb1" wait 3ms
cbrs_enb <- epc_mme s1ap s1setupresponse plmn "315010" enbname "magma-mme-01" wait 6ms
// 2. UE Attach: InitialUEMessage (Procedure Code 12) carrying EPS Attach Request (0x07 0x41)
cbrs_enb -> epc_mme s1ap initialuemessage enbueid 101 plmn "315010" tac 401 naspdu "074171080910101234567890" wait 4ms
// 3. Downlink & Uplink NAS Transport (Authentication Request 0x07 0x52 / Response 0x07 0x53)
cbrs_enb <- epc_mme s1ap downlinknastransport mmeueid 9001 enbueid 101 naspdu "075200100102030405060708090a0b0c0d0e0f10" wait 4ms
cbrs_enb -> epc_mme s1ap uplinknastransport mmeueid 9001 enbueid 101 naspdu "075308aabbccddeeff0011" wait 20ms
// 4. Inactivity S1 UE Context Release (Procedure Code 23)
cbrs_enb <- epc_mme s1ap uecontextreleasecommand mmeueid 9001 enbueid 101 wait 2ms
cbrs_enb -> epc_mme s1ap uecontextreleasecomplete mmeueid 9001 enbueid 101
}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show s1ap_lte_attach_flow.frasm
# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly s1ap_lte_attach_flow.frasm s1ap_lte_attach_flow.pcap
frameassembly s1ap_lte_attach_flow.frasm s1ap_lte_attach_flow.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse s1ap_lte_attach_flow.pcap s1ap_lte_attach_flow_edited.frasm
# 4. Verify dissected protocol fields in tshark
tshark -r s1ap_lte_attach_flow.pcap -Y "s1ap"All s1ap 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 s1ap:
src_host -> dst_host s1ap [s1setuprequest | s1setupresponse | s1setupfailure | initialuemessage | downlinknastransport | uplinknastransport | uecontextreleasecommand | uecontextreleasecomplete | errorindication] [msgtype "<text>"] [proccode <0..255>] [criticality "<text>"] [mmeueid <number>] [enbueid <0..16777215>] [plmn "<text>"] [enbid <number>] [tac <0..65535>] [enbname "<text>"] [naspdu "<hex>"]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| s1setuprequest | s1setupresponse | s1setupfailure | initialuemessage | downlinknastransport | uplinknastransport | uecontextreleasecommand | uecontextreleasecomplete | errorindication | 3GPP TS 36.413 S1AP Elementary Procedure | s1setuprequest | Selects the ASN.1 APER PDU Choice and TS 36.413 Procedure Code + mandatory ProtocolIE sequence. |
| msgtype "<text>" | proccode <0..255> | criticality "<text>" | Explicit APER PDU Choice, ProcedureCode, and Criticality | Derived from procedure keyword | Overrides the outer S1AP procedureCode and criticality ("reject", "ignore", "notify"). |
| mmeueid <number> | enbueid <0..16777215> | 32-bit MME-UE-S1AP-ID (IE 0) & 24-bit eNB-UE-S1AP-ID (IE 8) | mmeueid 1, enbueid 1 on UE messages | Writes the APER integer UE context identifiers pairing eNB and MME state machines. |
| plmn "<text>" | 5- or 6-digit MCC+MNC string (e.g. "00101", "315010") | "00101" | Encodes the 3-octet TBCD PLMNidentity in Global-ENB-ID, SupportedTAs, TAI, and EUTRAN-CGI. |
| enbid <number> | tac <0..65535> | enbname "<text>" | 20-bit Macro eNB-ID, 16-bit LTE TAC (0..65535), and PrintableString eNBname | enbid 1, tac 1, enbname "eNB-01" | Populates IE 59 (Global-ENB-ID), IE 64 (SupportedTAs), IE 67 (TAI), and IE 60 (eNBname). |
| naspdu "<hex>" | Even-length hex byte string (IE 26 NAS-PDU) | "0741" (EPS Attach stub) | Embeds binary 3GPP TS 24.301 EPS-NAS octets inside IE 26 for Wireshark nas-eps dissection. |
Cross-Layer Wrappers Valid with s1ap
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
13 options
Cross-Layer Wrappers Valid with s1ap
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. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] [routeralert] [badipchecksum] | IPv4 ID, DF/MF flags, offset 0..8191, Router Alert & checksum fault | ipid 1, flags 0, fragoffset 0, valid RFC 1071 checksum | Sets IPv4 Identification/fragmentation, injects RFC 2113 Router Alert (20 04 00 00), or corrupts the 16-bit IPv4 header checksum (badipchecksum). |
| 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). |
| srcport <0..65535> | dstport <0..65535> | Port number 0..65535 | srcport 49152 (remembered), SCTP 36412 (PPID 18) | Overrides source or destination port and remembers the port pair automatically on <- replies. |
| badchecksum | L4/ICMP/SCTP checksum fault injection flag | Valid RFC checksum / CRC-32c | Deliberately corrupts the TCP, SCTP CRC-32c, ICMP, or ICMPv6 checksum for negative IDS/firewall testing. |
Gotchas & Quick Fixes
4G S1AP TAC Is 16-Bit (0..65535), Unlike 5G NGAP 24-Bit TAC
enb -> mme s1ap s1setuprequest tac 100000enb -> mme s1ap s1setuprequest tac 401In 4G LTE (3GPP TS 36.413), TAC is a 2-octet OCTET STRING (SIZE(2)) (0..=65535), whereas 5G NR (ngap) widened TAC to 3 octets (0..=16777215).
s1ap Is Strictly SCTP-Only (SCTP 36412, PPID 18)
enb -> mme s1ap initialuemessage transport udpenb -> mme s1ap initialuemessage enbueid 1 naspdu "0741"3GPP TS 36.412 mandates SCTP for S1-MME; validate_semantics rejects transport tcp and transport udp on s1ap.