A 5G NR Attach on the Air Interface, Layer by Layer

Reading a real, NEA2-ciphered 5G NR radio capture — from the first random-access response to two mobile-terminated returns at the end. The encrypted trace was decoded and annotated with VisualEther after applying the UE keys included in the Wireshark issue. The keys decipher the radio stack all the way down to the SDAP user plane.

💡 Read the walkthrough and the diagram side by side. Open the interactive diagram (or PDF) in a split-screen window so the captions stay in view as you read. In Edge, Chrome, or Firefox, right-click the link and pick your browser's split-screen option (Edge labels it "Open link in split screen window"). On macOS, prefer Chrome or Firefox — Safari has no in-browser split screen. Otherwise, open the diagram in a new tab and snap the two windows side by side.

Overview

The flow is 151 frames over about 49 seconds, captured at the MAC layer of a single 5G NR cell. One full connection that attaches, secures itself, opens a data bearer, moves user-plane traffic, and is released — followed by two shorter connections where the network reaches back for the UE.

Two facts shape everything you will read:

Every step is visible in the packets. In the interactive viewer or the HTML sequence diagram above, click any message to open its parameter details and the complete Wireshark field tree for that frame.

A primer on the 5G radio stack

Before the walkthrough, here is the layer cake every frame rides on. Reading top to bottom is reading a message from application intent down to radio symbols.

LayerJob in one lineWhat you'll see in the trace
NAS / 5GMM & 5GSMUE ↔ core-network signaling (registration, sessions)Registration Request, Authentication, Service Request
RRCUE ↔ gNB radio-connection controlRRC Setup, Security Mode Command, Reconfiguration, Release
SDAPMaps QoS flows onto data bearers (5G-new)SDAP header carrying the QoS Flow Identifier (QFI)
PDCPCiphering, integrity, sequence numberingPDCP SN / COUNT, MAC-I integrity tag
RLCReliable delivery (ARQ), segmentationRLC-AM Data & Status PDUs, ACK_SN, poll bit
MACScheduling, multiplexing, control elementsLCID, Contention Resolution, BSR, Timing Advance

The same layers run on both ends of the link, and each one talks to its peer on the other side — MAC to MAC, RLC to RLC, and so on up the stack. The control plane and the user plane share the whole PHY / MAC / RLC / PDCP foundation and differ only at the top: RRC and NAS for signaling, SDAP for data. Each plane also reaches a different endpoint in the core — the NAS signaling terminates at the AMF (tunneled transparently through the gNB), while the user data continues past the gNB to the UPF:

sequenceDiagram accTitle: 5G NR control-plane protocol stack and peer relationships accDescr: The control-plane layers, top of stack to bottom. NAS spans the UE and the AMF, passing transparently through the gNB. RRC, PDCP, RLC, MAC and PHY each span the UE and the gNB. participant UE participant gNB participant AMF Note over UE,AMF: NAS Note over UE,gNB: RRC Note over UE,gNB: PDCP Note over UE,gNB: RLC Note over UE,gNB: MAC Note over UE,gNB: PHY
Control plane: each layer is a box spanning the entities that run it. RRC, PDCP, RLC, MAC and PHY span the UE and the gNB; NAS spans the UE and the AMF, its box stretching past the gNB it tunnels through. Read top (NAS) to bottom (PHY) as the stack.
sequenceDiagram accTitle: 5G NR user-plane protocol stack and peer relationships accDescr: The user-plane layers, top of stack to bottom. SDAP, PDCP, RLC, MAC and PHY each span the UE and the gNB. Below them, the N3 interface, GTP-U carrying the QoS Flow Identifier, spans the gNB and the UPF. participant UE participant gNB participant UPF Note over UE,gNB: SDAP Note over UE,gNB: PDCP Note over UE,gNB: RLC Note over UE,gNB: MAC Note over UE,gNB: PHY Note over gNB,UPF: N3 · GTP-U (QFI)
User plane: SDAP, PDCP, RLC, MAC and PHY span the UE and the gNB. Below the radio stack, an N3 box (GTP-U carrying the QFI) spans the gNB and the UPF — where the QoS flow continues into the core. SDAP's radio peer is the gNB, not the UPF.

Key ideas from this stack:

Signaling bearers vs. data bearers. Control messages travel on a Signaling Radio Bearer (SRB) — here SRB1, which the trace calls "Bearer 1," and later SRB2. User data travels on a Data Radio Bearer (DRB) — here DRB 1 on LCID 4, which does not exist at the start; watch it get built when the data session opens.

RLC Acknowledged Mode (RLC-AM). Both SRBs and the DRB run RLC-AM, a reliable-delivery protocol with its own ARQ (Automatic Repeat reQuest). The sender numbers each PDU with a Sequence Number (SN); the receiver periodically returns a Status PDU carrying a cumulative ACK_SN ("I have everything below this number"). A sender can set a poll bit to demand an immediate Status PDU, and if a polled PDU is not acknowledged before the t-PollRetransmit timer fires, RLC resends it.

SDAP and the QoS Flow Identifier. SDAP (Service Data Adaptation Protocol, TS 37.324) is the thin layer new to 5G that sits above PDCP on a data bearer. Its one-byte header tags each user packet with a QFI — the QoS Flow Identifier — so the network can hold a packet to the right quality-of-service treatment. In this trace, the uplink SDAP header is present, and every user packet is stamped QFI 2.

Two security contexts. 5G separates core security (NAS, negotiated with the AMF) from radio security (AS, negotiated with the gNB). Each has its own Security Mode Command / Complete handshake, its own algorithms, and its own keys. This is the single most important idea in this capture, so it gets its own primer below.

Follow one protocol at a time

You have just met six layers. The interactive diagram stacks them all on one timeline — true to how the connection really happens, but a lot to absorb at once. Six companion walkthroughs slice the same capture the other way — one protocol, from the first frame to the last — each built from a session VisualEther extracted when it split the trace by protocol and bearer. They are laid out below from the bottom of the stack upward, so you can climb them in order or take the one layer you came for.

The three security contexts

All of this depends on the capture being readable, and it very nearly isn't. Three independent security contexts wrap this traffic: NAS, negotiated between the UE and the AMF; AS, negotiated between the UE and the gNB; and the IPsec that protects IMS signaling inside the user plane. The keys published with the Wireshark issue are Access-Stratum keys, so they open the AS context at PDCP and nothing else. The ciphered NAS bodies stay opaque, and so does anything behind ESP. A seventh companion works through all three, and through what the AS keys do expose once PDCP gives up its payload: an IPv6 user plane with a SIP registration running over it.

The flow at a glance

The capture unfolds in six phases. Each is a section below; the interactive diagram shows every arrow.

  1. Onto the cell (frames 1–4) — Random Access Response, RRC Setup Request → Setup + Contention Resolution → Setup Complete, carrying the first NAS Registration Request.
  2. Authenticate and secure (frames 5–18) — Authentication, then two security bring-ups: the NAS (core) Security Mode procedure, run twice, and the AS (radio) Security Mode Command that turns on NEA2/NIA2.
  3. Open a data session (frames 19–39) — UE Capability exchange and an RRC Reconfiguration that builds the SDAP data bearer (DRB 1, QFI 2).
  4. User-plane data (frames 40–127) — deciphered SDAP traffic on the DRB with a climbing ACK_SN and clean RLC-AM segmentation.
  5. Release (frames 128–129) — one RRC Release, retransmitted once when the UE does not answer.
  6. Mobile-terminated returns (frames 130–151) — two fresh connections triggered by mt-Access, each carrying a NAS Service Request.

The one long connection drives the radio state machine from idle to connected and back:

stateDiagram-v2 accTitle: RRC connection state journey accDescr: The UE moves from RRC_IDLE to RRC_CONNECTED on random access plus RRC Setup, exchanges signaling and user data while connected, and returns to RRC_IDLE on RRC Release. The capture repeats this cycle three times. [*] --> RRC_IDLE RRC_IDLE --> RRC_CONNECTED: RA + RRC Setup RRC_CONNECTED --> RRC_IDLE: RRC Release RRC_IDLE --> [*] note right of RRC_CONNECTED: Signaling + user data
The RRC state journey: IDLE to CONNECTED and back to IDLE. The capture repeats this three times — one mo-Signalling connection, then two mt-Access returns.

On the core-network side, the first connection starts a registration, but we never see it finish — not because it failed, but because the messages that would confirm it are ciphered at the NAS layer:

stateDiagram-v2 accTitle: 5GMM mobility state journey accDescr: The UE moves from 5GMM-DEREGISTERED to REGISTERED-INITIATED on the Registration Request in frame 4. The Registration Accept that would move it to REGISTERED is ciphered at the NAS layer and not readable in this capture, so that transition is uncertain. state "5GMM-DEREGISTERED" as DEREG state "5GMM-REGISTERED-INITIATED" as REGINIT state "5GMM-REGISTERED" as REG [*] --> DEREG DEREG --> REGINIT: Registration Request REGINIT --> REG: Accept (NAS-ciphered, unseen) note right of REG: Not confirmable from this trace
5GMM (mobility) state, UE side: the Registration Request rides frame 4. The Registration Accept is not readable here — post-security NAS is ciphered with keys we do not hold — so the confirmed transition to REGISTERED is shown dashed.

Now the same story, frame by frame.

Phase 1 — Onto the cell (frames 1–4)

sequenceDiagram accTitle: Phase 1 — RRC connection setup accDescr: The gNB sends the Random Access Response, the UE sends Msg3 RRC Setup Request, the gNB replies with Msg4 RRC Setup and Contention Resolution, and the UE sends Msg5 RRC Setup Complete carrying the NAS Registration Request, entering RRC_CONNECTED. participant UE participant gNB gNB->>UE: Msg2 · Random Access Response (Temp C-RNTI) UE->>gNB: Msg3 · RRC Setup Request (CCCH, mo-Signalling) gNB->>UE: Msg4 · RRC Setup + Contention Resolution UE->>gNB: Msg5 · RRC Setup Complete (+ NAS Registration Request) Note over UE,gNB: UE enters RRC_CONNECTED

A 5G connection begins with the four-step random-access handshake. Step 1 (the UE's PRACH preamble) is a physical-layer event and is not in this MAC-level capture; our story opens at Msg2.

Frame 1 — Random Access Response (Msg2). The gNB answers a preamble with a Temporary C-RNTI (0x1001), a Timing Advance, and the uplink grant the UE will use for Msg3. It is addressed by RA-RNTI 0x0500 — the identity derived from when the preamble arrived, since the gNB does not yet know who sent it.

Frame 2 — RRC Setup Request (Msg3). The UE asks to open an RRC connection. Having no dedicated identity yet, it speaks on the Common Control Channel (CCCH, uplink LCID 52) and includes a random value for contention resolution. Its establishment cause is mo-Signallingmobile-originated signaling, meaning "a UE wants to talk to the core," as opposed to mo-Data for bulk traffic.

Frame 3 — RRC Setup + Contention Resolution (Msg4). The gNB answers on the CCCH and does two jobs in one frame. A MAC UE Contention Resolution Identity control element (LCID 62) echoes the UE's Msg3 back, so the UE — seeing its own bytes reflected — knows it won the random-access contest rather than a different UE that picked the same preamble. The RRC payload then installs SRB1 and the master cell-group configuration (the buffer-status and power-headroom reporting rules the UE follows from now on). On receipt, the UE enters RRC_CONNECTED.

Frame 4 — RRC Setup Complete (Msg5). The UE confirms on SRB1 (LCID 1) and piggybacks its first NAS message — a Registration Request — to the core inside the RRC container. This is the hinge of the whole trace: from here the radio conversation (RRC) and the core-network conversation (NAS) proceed in parallel, every NAS message tunneled inside an RRC envelope. One detail worth noting: the Registration Request arrives integrity-protected (NAS security-header type 1), which means the UE already holds a NAS security context from an earlier visit — this is a returning UE, not a first-ever power-on.

Phase 2 — Authenticate and secure (frames 5–18)

sequenceDiagram accTitle: Phase 2 — Authentication and the two security bring-ups accDescr: The AMF challenges the UE with an Authentication Request and the UE responds. The NAS Security Mode Command and Complete run twice to establish core-network security, then the RRC Security Mode Command and Complete activate radio security with NEA2 ciphering and NIA2 integrity. participant UE participant gNB/AMF gNB/AMF->>UE: Authentication Request (NAS, plaintext) UE->>gNB/AMF: Authentication Response gNB/AMF->>UE: NAS Security Mode Command (×2) UE->>gNB/AMF: NAS Security Mode Complete (ciphered) gNB/AMF->>UE: RRC Security Mode Command (NEA2 / NIA2) UE->>gNB/AMF: RRC Security Mode Complete Note over UE,gNB/AMF: Two contexts now active — NAS and AS

This phase is the heart of the capture, and the place where the two-security-layer idea becomes concrete.

Frames 7 and 9 — Authentication. The AMF challenges the UE (Authentication Request, carried as an RRC DL Information Transfer) and the UE answers (Authentication Response). Both are NAS plaintext — the fresh authentication run has not yet switched on NAS ciphering. A correct response lets the network trust the UE and derive fresh keys.

Frames 11–16 — NAS (core) security, run twice. The AMF sends a NAS Security Mode Command (frame 11), and the UE replies with a Security Mode Complete (frame 12). Then it happens again — a second Security Mode Command (frame 14) and Complete (frame 15). The command messages carry NAS security-header type 3 ("integrity-protected with a new NAS security context"); the completes come back as type 4 ("integrity-protected and ciphered"). That type-4 marking is the moment NAS ciphering switches on: from frame 12 onward, the NAS message bodies are encrypted with keys we do not have, so they read as sealed envelopes. Running the procedure twice re-keys the NAS context — on a lab rig the likely reason is a deliberate re-establishment rather than a fault, and the ordering (a Complete arrives before the second Command) confirms these are two genuine procedures, not a retransmission.

Frames 17–18 — AS (radio) security. Now the other Security Mode procedure. The gNB's RRC Security Mode Command selects ciphering NEA2 (AES) and integrity NIA2 (AES-CMAC), and the UE confirms. From here, PDCP on every bearer is ciphered and integrity-protected. These are precisely the keys published in the Wireshark issue — the ones that, fed into Wireshark, decipher the RRC Reconfiguration and the whole user plane you are about to see. Note the symmetry: two Security Mode Commands, two Completes, two contexts — one for the core, one for the radio.

Threaded through this phase are RLC-AM Status PDUs on SRB1 (frames 5, 8, 10, 13, 16), each reporting a cumulative ACK_SN that increases 1 → 2 → 3 → 4 in lockstep with the conversation. They confirm delivery over the air to the gNB.

Phase 3 — Opening a data session (frames 19–39)

sequenceDiagram accTitle: Phase 3 — UE capabilities and building the SDAP data bearer accDescr: The gNB asks for UE capabilities and the UE responds, then an RRC Reconfiguration adds SRB2 and the data radio bearer DRB1 with an SDAP configuration for QFI 2, and the UE confirms with Reconfiguration Complete. participant UE participant gNB gNB->>UE: UE Capability Enquiry UE->>gNB: UE Capability Information gNB->>UE: RRC Reconfiguration (+ SRB2, DRB1, SDAP · QFI 2) UE->>gNB: RRC Reconfiguration Complete Note over UE,gNB: DRB 1 (LCID 4) now live for user data

Everything so far was signaling. Now the UE and gNB build a path for user data.

Frames 20–23 — UE Capability exchange. The gNB asks what the UE supports (UE Capability Enquiry) and the UE answers (UE Capability Information) with its bands, MIMO layers, modulation, and ROHC profiles. Among the R16 features it advertises is loggedMeasurements-r16 support — the UE can perform logged Minimization-of-Drive-Tests measurements — though the network never configures an actual MDT session in this trace. The capability report is large enough to be segmented across RLC-AM PDUs (frame 22 is a middle segment), then reassembled.

Frame 38 — RRC Reconfiguration: the data bearer is born. The pivotal frame of the phase. Inside one RRC message, the gNB adds SRB2 and a data radio bearer, DRB 1 on LCID 4, and maps a PDU session's QoS flow onto it:

This frame is the one Wireshark work-item 19757 was filed about: without the UE keys, the reconfiguration is an opaque PDCP blob; with them, it decodes cleanly. It also carries a piggybacked NAS message — but that NAS PDU is ciphered at the NAS layer (header type 2), so its contents stay sealed even though the RRC around it is now perfectly readable. That contrast, in a single frame, is the two-security-layer story in miniature.

Here is that frame's complete decoded field tree. Expand any node to open it:

⚙️ [00042] Frame 38 RRC Reconfiguration 2024-04-13T03:06:58.116758Z 📡 gNB 📱 UE
frame : Frame 38: Packet, 235 bytes on wire (1880 bits), 235 bytes captured (1880 bits)
Encapsulation type : Ethernet (1)
Arrival Time : Apr 12, 2024 20:06:58.116758000 Pacific Daylight Time
UTC Arrival Time : Apr 13, 2024 03:06:58.116758000 UTC
Epoch Arrival Time : 1712977618.116758000
Time shift for this packet : 0.000000000 seconds
Time delta from previous captured frame : 301.014000 milliseconds
Time delta from previous displayed frame : 301.014000 milliseconds
Time since reference or first frame : 2.325030000 seconds
Frame Number : 38
Frame Length : 235 bytes (1880 bits)
Capture Length : 235 bytes (1880 bits)
Frame is marked : False
Frame is ignored : False
Protocols in frame : eth:ethertype:ip:udp:mac-nr:rlc-nr:pdcp-nr:nr-rrc:nas-5gs
Character encoding : ASCII (0)
eth : Ethernet II, Src: 00:00:00:00:00:00, Dst: 00:00:00:00:00:00
Destination : 00:00:00:00:00:00
Destination (resolved) : 00:00:00:00:00:00
Destination OUI : 00:00:00 (Officially Xerox, but 0:0:0:0:0:0 is more common)
Destination OUI (resolved) : Officially Xerox, but 0:0:0:0:0:0 is more common
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : 00:00:00:00:00:00
Address (resolved) : 00:00:00:00:00:00
Address OUI : 00:00:00 (Officially Xerox, but 0:0:0:0:0:0 is more common)
Address OUI (resolved) : Officially Xerox, but 0:0:0:0:0:0 is more common
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Source : 00:00:00:00:00:00
Source (resolved) : 00:00:00:00:00:00
Source OUI : 00:00:00 (Officially Xerox, but 0:0:0:0:0:0 is more common)
Source OUI (resolved) : Officially Xerox, but 0:0:0:0:0:0 is more common
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : 00:00:00:00:00:00
Address (resolved) : 00:00:00:00:00:00
Address OUI : 00:00:00 (Officially Xerox, but 0:0:0:0:0:0 is more common)
Address OUI (resolved) : Officially Xerox, but 0:0:0:0:0:0 is more common
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Type : IPv4 (0x0800)
Stream index : 0
ip : Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
0100 .... = Version : 4
.... 0101 = Header Length : 20 bytes (5)
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint : Default (0)
.... ..00 = Explicit Congestion Notification : Not ECN-Capable Transport (0)
Total Length : 221
Identification : 0x0025 (37)
010. .... = Flags : 0x2, Don't fragment
0... .... = Reserved bit : Not set
.1.. .... = Don't fragment : Set
..0. .... = More fragments : Not set
...0 0000 0000 0000 = Fragment Offset : 0
Time to Live : 64
Protocol : UDP (17)
Header Checksum : 0xffff [validation disabled]
Header checksum status : Unverified
Source Address : 127.0.0.1
Source or Destination Address : 127.0.0.1
Source Host : 127.0.0.1
Source or Destination Host : 127.0.0.1
Destination Address : 127.0.0.1
Source or Destination Address : 127.0.0.1
Destination Host : 127.0.0.1
Source or Destination Host : 127.0.0.1
Stream index : 0
udp : User Datagram Protocol, Src Port: 13337, Dst Port: 0
Source Port : 13337
Destination Port : 0
Source or Destination Port : 13337
Source or Destination Port : 0
Length : 201
Checksum : 0xffff [unverified]
Checksum Status : Unverified
Stream index : 0
Stream Packet Number : 38
Timestamps
Time since first frame : 2.325030000 seconds
Time since previous frame : 301.014000 milliseconds
UDP payload (193 bytes)
mac-nr : MAC-NR DL-SCH (LCID:1 165 bytes) (Padding 0 bytes)
Context (RNTI=32768)
Radio Type : FDD (1)
Direction : Downlink (1)
RNTI : 0x8000 (32768)
RNTI Type : C-RNTI (3)
UEId : 1
System Frame Number : 421
Slot : 8
HarqId : 2
Subheader : (LCID:1 165 bytes)
0... .... = Reserved : 0x00
.0.. .... = Format : 8 bits
..00 0001 = LCID : 1 (1)
..00 0001 = LCID : 0x01
SDU Length : 165
DL-SCH SDU […] : c00600069714fb5e390b6c6caa8d2797fecedc8a24a8c153a18f8a9677267862ba21e50c33c5e2cfb90f0ede1c70ebabb200b46d31c14773e4d21249ec3a8318cdd9672ebf1c0fa020770c5eff7410692dfb8c05aea95af117216bc76099bbcb5e759766eb99f49cc6cc0525639f6
RLC-NR UEId=1 [DL] [AM] SRB:1 [DATA] (P) SN=6 [163-bytes]
Context
Direction : Downlink (1)
RLC Mode : Acknowledged Mode (4)
UEId : 1
Bearer Type : SRB (4)
Bearer Id : 1
PDU Length : 165
Sequence Number length : 12
AM
AM Header (P) SN=6
1... .... = Data/Control : Data PDU
.1.. .... = Polling Bit : Status report is requested
..00 .... = Segmentation Info : Data field contains all bytes of an RLC SDU (0x0)
.... 0000 0000 0110 = Sequence Number : 6
AM Data […] : 00069714fb5e390b6c6caa8d2797fecedc8a24a8c153a18f8a9677267862ba21e50c33c5e2cfb90f0ede1c70ebabb200b46d31c14773e4d21249ec3a8318cdd9672ebf1c0fa020770c5eff7410692dfb8c05aea95af117216bc76099bbcb5e759766eb99f49cc6cc0525639f61b5bcc5
PDCP-NR (SN=6 )
Configuration : UEId= 1 SRB-1 (direction=Downlink, plane=Signalling)
Direction : Downlink (1)
Plane : Signalling (1)
UE : 1
Bearer type : DCCH (1)
Bearer Id : 1
Seqnum length : 12
MAC-I Present : True
Ciphering disabled : False
UE Security (ciphering=NEA2 (AES), integrity=NIA2 (AES))
Configuration frame : 17
Ciphering Algorithm : NEA2 (AES) (2)
Integrity Algorithm : NIA2 (AES) (2)
BEARER : 0
DIRECTION : Downlink (1)
COUNT : 6
CIPHER KEY : 95F23667A60D91689B31772783E6FDDD
0000 .... = Reserved : 0
.... 0000 0000 0110 = Seq Num : 6
Sequence Analysis - OK
Previous frame for Bearer : 30
Expected SN : 6
OK : True
Deciphered Data […] : 008aa0409a01a00404ebf0d225009200158e019f23af019061e6409094197980001e9f80a6c1c8d580d5703c3a5f51ae0c26e268d126fb9b5a5a7ce3dab4fb0e5f74455d7b6809dcc5943aba2b496456dd4c682f856e82e338a368e2efee1d7454e13f8a50b13fb124e7f2b2
NR Radio Resource Control (RRC) protocol
NR Radio Resource Control (RRC) protocol
DL-DCCH-Message
message : c1 (0)
c1 : rrcReconfiguration (0)
NR Radio Resource Control (RRC) protocol
rrcReconfiguration
rrc-TransactionIdentifier : 0
criticalExtensions : rrcReconfiguration (0)
rrcReconfiguration
1... .... Optional Field Bit : True (radioBearerConfig is present)
.0.. .... Optional Field Bit : False (secondaryCellGroup is NOT present)
..0. .... Optional Field Bit : False (measConfig is NOT present)
...0 .... Optional Field Bit : False (lateNonCriticalExtension is NOT present)
.... 1... Optional Field Bit : True (nonCriticalExtension is present)
NR Radio Resource Control (RRC) protocol
radioBearerConfig
.... .0.. Extension Bit : False
.... ..1. Optional Field Bit : True (srb-ToAddModList is present)
.... ...0 Optional Field Bit : False (srb3-ToRelease is NOT present)
1... .... Optional Field Bit : True (drb-ToAddModList is present)
.0.. .... Optional Field Bit : False (drb-ToReleaseList is NOT present)
..1. .... Optional Field Bit : True (securityConfig is present)
srb-ToAddModList : 1 item
Item 0
SRB-ToAddMod
.... 0... Extension Bit : False
.... .0.. Optional Field Bit : False (reestablishPDCP is NOT present)
.... ..0. Optional Field Bit : False (discardOnPDCP is NOT present)
.... ...0 Optional Field Bit : False (pdcp-Config is NOT present)
srb-Identity : 2
drb-ToAddModList : 1 item
Item 0
DRB-ToAddMod
.... ...0 Extension Bit : False
1... .... Optional Field Bit : True (cnAssociation is present)
.0.. .... Optional Field Bit : False (reestablishPDCP is NOT present)
..0. .... Optional Field Bit : False (recoverPDCP is NOT present)
...1 .... Optional Field Bit : True (pdcp-Config is present)
cnAssociation : sdap-Config (1)
sdap-Config
.... .0.. Extension Bit : False
.... ..1. Optional Field Bit : True (mappedQoS-FlowsToAdd is present)
.... ...0 Optional Field Bit : False (mappedQoS-FlowsToRelease is NOT present)
pdu-Session : 1
sdap-HeaderDL : absent (1)
sdap-HeaderUL : present (0)
..1. .... defaultDRB : True
mappedQoS-FlowsToAdd : 1 item
Item 0
QFI : 2
drb-Identity : 1
pdcp-Config
.... 0... Extension Bit : False
.... .1.. Optional Field Bit : True (drb is present)
.... ..0. Optional Field Bit : False (moreThanOneRLC is NOT present)
.... ...0 Optional Field Bit : False (t-Reordering is NOT present)
drb
1... .... Optional Field Bit : True (discardTimer is present)
.1.. .... Optional Field Bit : True (pdcp-SN-SizeUL is present)
..1. .... Optional Field Bit : True (pdcp-SN-SizeDL is present)
...0 .... Optional Field Bit : False (integrityProtection is NOT present)
.... 1... Optional Field Bit : True (statusReportRequired is present)
.... .0.. Optional Field Bit : False (outOfOrderDelivery is NOT present)
discardTimer : infinity (15)
pdcp-SN-SizeUL : len18bits (1)
pdcp-SN-SizeDL : len18bits (1)
.... 0... Extension Bit : False
headerCompression : notUsed (0)
notUsed : NULL
statusReportRequired : true (0)
securityConfig
.... ...0 Extension Bit : False
1... .... Optional Field Bit : True (securityAlgorithmConfig is present)
.1.. .... Optional Field Bit : True (keyToUse is present)
securityAlgorithmConfig
..0. .... Extension Bit : False
...1 .... Optional Field Bit : True (integrityProtAlgorithm is present)
.... 0... Extension Present Bit : False
cipheringAlgorithm : nea2 (2)
0... .... Extension Present Bit : False
integrityProtAlgorithm : nia2 (2)
keyToUse : master (0)
nonCriticalExtension
.... .1.. Optional Field Bit : True (masterCellGroup is present)
.... ..0. Optional Field Bit : False (fullConfig is NOT present)
.... ...1 Optional Field Bit : True (dedicatedNAS-MessageList is present)
0... .... Optional Field Bit : False (masterKeyUpdate is NOT present)
.0.. .... Optional Field Bit : False (dedicatedSIB1-Delivery is NOT present)
..0. .... Optional Field Bit : False (dedicatedSystemInformationDelivery is NOT present)
...0 .... Optional Field Bit : False (otherConfig is NOT present)
.... 0... Optional Field Bit : False (nonCriticalExtension is NOT present)
masterCellGroup : 4002b1c033e475e0320c3cc81212832f3000
NR Radio Resource Control (RRC) protocol
NR Radio Resource Control (RRC) protocol
CellGroupConfig
0... .... Extension Bit : False
.1.. .... Optional Field Bit : True (rlc-BearerToAddModList is present)
..0. .... Optional Field Bit : False (rlc-BearerToReleaseList is NOT present)
...0 .... Optional Field Bit : False (mac-CellGroupConfig is NOT present)
.... 0... Optional Field Bit : False (physicalCellGroupConfig is NOT present)
.... .0.. Optional Field Bit : False (spCellConfig is NOT present)
.... ..0. Optional Field Bit : False (sCellToAddModList is NOT present)
.... ...0 Optional Field Bit : False (sCellToReleaseList is NOT present)
cellGroupId : 0
rlc-BearerToAddModList : 2 items
Item 0
RLC-BearerConfig
.... ...0 Extension Bit : False
1... .... Optional Field Bit : True (servedRadioBearer is present)
.0.. .... Optional Field Bit : False (reestablishRLC is NOT present)
..1. .... Optional Field Bit : True (rlc-Config is present)
...1 .... Optional Field Bit : True (mac-LogicalChannelConfig is present)
logicalChannelIdentity : 4
servedRadioBearer : drb-Identity (1)
drb-Identity : 1
.... ...0 Extension Bit : False
rlc-Config : am (0)
am
ul-AM-RLC
..1. .... Optional Field Bit : True (sn-FieldLength is present)
sn-FieldLength : size18 (1)
t-PollRetransmit : ms80 (15)
pollPDU : p32768 (18)
pollByte : kB750 (14)
maxRetxThreshold : t8 (5)
dl-AM-RLC
1... .... Optional Field Bit : True (sn-FieldLength is present)
sn-FieldLength : size18 (1)
t-Reassembly : ms80 (16)
t-StatusProhibit : ms30 (6)
mac-LogicalChannelConfig
.... .0.. Extension Bit : False
.... ..1. Optional Field Bit : True (ul-SpecificParameters is present)
ul-SpecificParameters
.... ...0 Extension Bit : False
0... .... Optional Field Bit : False (allowedServingCells is NOT present)
.0.. .... Optional Field Bit : False (allowedSCS-List is NOT present)
..0. .... Optional Field Bit : False (maxPUSCH-Duration is NOT present)
...0 .... Optional Field Bit : False (configuredGrantType1Allowed is NOT present)
.... 1... Optional Field Bit : True (logicalChannelGroup is present)
.... .1.. Optional Field Bit : True (schedulingRequestID is present)
priority : 1
prioritisedBitRate : infinity (15)
bucketSizeDuration : ms50 (3)
logicalChannelGroup : 1
schedulingRequestID : 0
0... .... logicalChannelSR-Mask : False
.0.. .... logicalChannelSR-DelayTimerApplied : False
Item 1
RLC-BearerConfig
..0. .... Extension Bit : False
...1 .... Optional Field Bit : True (servedRadioBearer is present)
.... 0... Optional Field Bit : False (reestablishRLC is NOT present)
.... .0.. Optional Field Bit : False (rlc-Config is NOT present)
.... ..1. Optional Field Bit : True (mac-LogicalChannelConfig is present)
logicalChannelIdentity : 2
servedRadioBearer : srb-Identity (0)
srb-Identity : 2
mac-LogicalChannelConfig
.... ...0 Extension Bit : False
1... .... Optional Field Bit : True (ul-SpecificParameters is present)
ul-SpecificParameters
.0.. .... Extension Bit : False
..0. .... Optional Field Bit : False (allowedServingCells is NOT present)
...0 .... Optional Field Bit : False (allowedSCS-List is NOT present)
.... 0... Optional Field Bit : False (maxPUSCH-Duration is NOT present)
.... .0.. Optional Field Bit : False (configuredGrantType1Allowed is NOT present)
.... ..1. Optional Field Bit : True (logicalChannelGroup is present)
.... ...1 Optional Field Bit : True (schedulingRequestID is present)
priority : 3
prioritisedBitRate : infinity (15)
bucketSizeDuration : ms50 (3)
logicalChannelGroup : 0
schedulingRequestID : 0
..0. .... logicalChannelSR-Mask : False
...0 .... logicalChannelSR-DelayTimerApplied : False
dedicatedNAS-MessageList : 1 item
Item 0
DedicatedNAS-Message […] : 7e029b0723560355c0f0e97d46b8309b89a3449bee6d6969f38f6ad3ec397dd11575eda027731650eae8ad25915b7531a0be15ba0b8ce28da38bbfb875d15384fe2942c4fec4939fcaca325d3a94bd7e7ff20f7351fa4913327cf815a5524eb8fc404d3524a57ff1360
Non-Access-Stratum 5GS (NAS)PDU
Security protected NAS 5GS message
Extended protocol discriminator : 5G mobility management messages (126)
0000 .... = Spare Half Octet : 0
.... 0010 = Security header type : Integrity protected and ciphered (2)
Message authentication code : 0x9b072356
Sequence number : 3
Encrypted data
MAC : 0x3c518bcb
Subheader : (Padding 0 bytes)
00.. .... = Reserved : 0x00
..11 1111 = LCID : Padding (63)
..11 1111 = LCID : 0x3f
Rendered from a Wireshark PCAP by VisualEther.

Frame 38, gNB → UE. The RRC layer opens because the UE keys deciphered PDCP; the NAS payload near the bottom stays encrypted because its keys are a separate context.

💡 Navigating the tree. Top to bottom is descending the stack. Four paths worth expanding:

  • Down to the RRC message: mac-nrSubheader (LCID: 1)RLC-NRPDCP-NRnr-rrcDL-DCCH-Messagec1: rrcReconfigurationcriticalExtensions. PDCP-NRUE Security shows NEA2 / NIA2 — everything below that node is readable only because the keys were applied.
  • The new bearers: radioBearerConfigsrb-ToAddModListsrb-Identity: 2, and → drb-ToAddModListdrb-Identity: 1.
  • The QoS mapping: DRB-ToAddModcnAssociation: sdap-Configsdap-HeaderDL: absent, sdap-HeaderUL: present, mappedQoS-FlowsToAddQFI: 2. Then nonCriticalExtensionmasterCellGrouprlc-BearerToAddModListlogicalChannelIdentity: 4 and rlc-Config: amul-AM-RLCt-PollRetransmit: ms80.
  • Where the descent stops: criticalExtensionsdedicatedNAS-MessageListDedicatedNAS-MessageSecurity header type: Integrity protected and ciphered (2)Encrypted data. The RRC envelope opens; its NAS passenger does not.

Frame 39 — RRC Reconfiguration Complete. The UE applies the new configuration. DRB 1 is live.

Phase 4 — Moving user data (frames 40–127)

sequenceDiagram accTitle: Phase 4 — User-plane data on the DRB accDescr: On the data radio bearer, the UE sends uplink SDAP data PDUs stamped QFI 2, the gNB returns RLC Status PDUs with an increasing ACK_SN and no NACKs, and larger SDUs are segmented and reassembled. participant UE participant gNB Note over UE,gNB: DRB 1 · RLC-AM · PDCP deciphered with the UE keys loop User-plane bursts, PDCP SN 0–17 UE->>gNB: UL SDAP Data PDU · QFI 2 (some segmented) gNB->>UE: RLC Status PDU · ACK_SN climbs (no NACKs) end gNB->>UE: Final Status PDU · ACK_SN = 18

With DRB 1 up, user traffic flows as SDAP Data PDUs on the bearer. Because the AS keys deciphered PDCP, each uplink PDU shows its SDAP header stamped QFI 2 — and everything beneath it is now in the clear too. Two RLC fields carry the delivery story:

The transfer runs cleanly. The DRB's ACK_SN climbs steadily to 18, and — importantly — not a single NACK appears anywhere. Between bursts you will see MAC Timing Advance Commands and Short Buffer Status Reports: routine link and scheduling upkeep while the user-plane queue ebbs and flows.

What is actually inside that QFI-2 user plane — IPv6 bring-up, and the beginnings of an IMS session protected by IPsec — is a story of its own, told in the companion decryption walkthrough. Here it is enough to see the shape of healthy user-plane delivery on a deciphered bearer.

Phase 5 — Releasing the connection (frames 128–129)

sequenceDiagram accTitle: Phase 5 — RRC Release and one retransmission accDescr: The gNB sends an RRC Release with the poll bit set. The UE does not acknowledge in time, so RLC retransmits the identical PDU once when the poll-retransmit timer fires. participant UE participant gNB gNB->>UE: RRC Release · PDCP SN 7, MAC-I 0xa48652fc, poll bit set Note right of UE: No Status PDU returns in time gNB->>UE: RRC Release (retx · duplicate PDCP SN 7)

Frame 128 — RRC Release. The gNB sends the UE back to RRC_IDLE (there is no suspendConfig, so it is a full release, not the suspended RRC_INACTIVE state). It travels on SRB1 as PDCP SN 7, COUNT 7, with integrity tag MAC-I = 0xa48652fc, and the RLC poll bit set — so the gNB expects a Status PDU confirming delivery.

Frame 129 — the same release again. Wireshark flags this as a duplicate: identical PDCP SN 7, identical MAC-I. It is not a second release — it is one retransmission of frame 128, fired because t-PollRetransmit expired with no acknowledgment. With no NACK anywhere in the capture, this is a plain poll-retransmit resend. The identical SN and MAC-I are the signature that it is one message resent, not a new command — the same reasoning you would use to tell a harmless retransmission tail from a real downlink problem.

Phase 6 — Mobile-terminated returns (frames 130–151)

sequenceDiagram accTitle: Phase 6 — Two mobile-terminated Service Request connections accDescr: After the release, a fresh random access with establishment cause mt-Access sets up a new RRC connection carrying a NAS Service Request, AS security is re-established, and then a third connection repeats the mt-Access Service Request before the capture ends. participant UE participant gNB gNB->>UE: Random Access Response (connection 2) UE->>gNB: RRC Setup Request (mt-Access) gNB->>UE: RRC Setup UE->>gNB: RRC Setup Complete (+ NAS Service Request) gNB->>UE: RRC Security Mode Command (NEA2 / NIA2) UE->>gNB: RRC Security Mode Complete Note over UE,gNB: A third mt-Access connection follows, then capture ends

After the release, the capture shows the network reaching back for the UE — twice.

Frames 130–146 — connection 2. A fresh random-access handshake opens a new RRC connection, but this time the RRC Setup Request carries establishment cause mt-Accessmobile-terminated access. Something in the network (an incoming call, an SMS, downlink data) is trying to reach the UE. The UE responds by piggybacking a NAS Service Request (frame 133) — the procedure a UE in idle mode uses to re-enter connected mode and resume its sessions. AS security is then re-established from scratch (frame 136, NEA2/NIA2 again): every RRC connection negotiates its own radio keys. A brief signaling exchange follows, ending in another single poll-retransmit (frame 146).

Frames 147–151 — connection 3. After a ~32-second gap, the pattern repeats: random access, an mt-Access RRC Setup, and a NAS Service Request (frame 150). The capture ends here, mid-setup, before this third connection re-establishes security.

Takeaways

  1. A connection has a sequence. Random access → RRC setup → authenticate → secure → open a bearer → move data → release.
  2. 5G secures the core and the radio separately. NAS and AS each run their own Security Mode handshake with their own keys. The published keys here are the AS/PDCP keys — which is exactly why the radio layers and the SDAP user plane open up while the NAS bodies stay encrypted.
  3. The keys are what make the trace legible. With NEA2 ciphering, the RRC Reconfiguration and everything on the DRB are opaque until the UE keys are applied.
  4. SDAP tags every user packet with a QFI. On a data bearer, the SDAP header carries the QoS Flow Identifier (QFI 2 here) that ties the packet to its QoS treatment — the 5G-new layer that sits just above PDCP.
  5. RLC-AM reliability is normal, and context decides the diagnosis. Cumulative ACK_SN, poll bits, and timer-driven retransmissions are healthy behavior. A duplicate SN with an identical MAC-I means retransmission, not a new message.
  6. Establishment cause tells you who started it. mo-Signalling opened the first connection; mt-Access opened the last two — the difference between the UE reaching out and the network reaching in.

Try it on your own capture

Every arrow in this walkthrough was decoded and captioned by VisualEther from a raw Wireshark PCAP — including the decryption step that turned an opaque NEA2 trace into a readable one. Point it at your own 5G, LTE, or IMS capture and read it the same way.