NAS Overview (EMM & ESM) in LTE 4G
The layer between UE and MME that the eNB only relays — EPS Mobility Management and Session Management.
When your phone attaches to an LTE network, asks for a data connection, or wakes up to answer a page, it is really talking to a box deep in the core — the MME — not to the tower it can see. That conversation is NAS (Non-Access Stratum) signalling, and the eNB in the middle just relays it without understanding a byte of it. This page is grounded in TS 24.301.
Introduction
The Non-Access Stratum is the control-plane dialogue between the UE and the MME that governs two things: whether the UE is registered and reachable, and what data connections it holds. Defined in TS 24.301, it is deliberately independent of the radio — the same NAS messages would work over any access technology, which is exactly the point of keeping mobility and session state out of the radio layer.
NAS is used at every milestone of the UE lifecycle. It runs at power-on (Attach), whenever the UE changes location beyond its registered area (Tracking Area Update), whenever it wakes to send or receive data (Service Request / Paging), whenever it authenticates and switches on security (Authentication / Security Mode Command), and whenever a data pipe is created, changed, or torn down (the ESM bearer procedures). If you can read a NAS trace, you can debug almost every "why won't this UE get on the network" ticket.
Because NAS is really two protocols (EMM and ESM) sharing one connection, and because every message rides inside a radio (RRC) container on the air and an S1AP container on S1, a failure almost always lives in one identifiable place: a specific protocol, a specific message, or a specific transport hop. That is why a layered, message-by-message habit pays off here just as it does for random access.
On this page
Why NAS is needed
In plain words: think of the eNB as the receptionist at a building and the MME as the office you actually have business with. When you walk in, you hand the receptionist a sealed envelope; they carry it to the right office and bring back the reply, but they never open it. NAS is the sealed conversation between you (the UE) and the office (the MME); the radio is just the courier.
Concretely, the network needs a place to keep two kinds of long-lived state that must survive the UE moving between cells — and even between radio technologies. The first is mobility and identity: is this UE registered, where (to tracking-area granularity) is it, can it be paged, and is it authenticated? The second is sessions: what EPS bearers does it have, to which PDN, and with what QoS? If either of these lived in the eNB, it would be lost on every handover. Anchoring them in the core, reachable over a radio-independent protocol, is what lets a UE roam across a whole network while staying "the same known subscriber with the same IP session."
The control-plane protocol between the UE and the MME for mobility and session management, defined in TS 24.301. It runs over, but is logically independent of, the radio.
Mobility (which network am I registered to?) and sessions (what data connections do I have?) must survive handovers and cell changes. Keeping them out of the radio layer lets them persist while the UE moves between cells and even radio access types.
NAS messages are tunnelled: inside RRC (as dedicatedInfoNAS) on the air interface, and inside S1AP on S1. The eNB relays the payload without interpreting it.
What NAS Is
The LTE control plane splits into two layers. The Access Stratum (AS) is everything about the radio between the UE and the eNB — RRC, the scheduler, HARQ, measurements, the physical channels. The Non-Access Stratum (NAS) sits above that: it is the end-to-end signalling between the UE and the MME that deals with mobility and sessions, and it does not care which cell, which frequency, or even which radio technology carries it.
The crucial idea for a fresher is that the eNB relays NAS transparently. It never decodes a NAS message. On the radio, the NAS payload is carried as an information element inside an RRC message (for example the dedicatedInfoNAS field). On the S1 interface between eNB and MME, the same NAS payload rides inside an S1AP message. The eNB copies the octets from one container into the other and forwards them — it is a postman, not a reader. That is precisely why the layer is called Non-Access Stratum: it is the stratum that is not part of the access network.
One-line intuition: AS = "how do I talk to this tower"; NAS = "who am I to the network, and what connections do I have" — a private conversation between the UE and the MME that the eNB only carries.
Two Protocols: EMM and ESM
NAS is not one protocol but two, running in parallel over the same signalling connection. They are distinguished by the Protocol Discriminator in the NAS message header, so a single received message is unambiguously either an EMM message or an ESM message.
EMM — EPS Mobility Management — handles everything about the UE's presence and identity in the network: Attach and Detach, Authentication, NAS security setup via Security Mode Command, Tracking Area Update (TAU), Service Request, responding to Paging, and GUTI reallocation. Think of EMM as "am I registered, where am I, and can I be reached."
ESM — EPS Session Management — handles the data connections themselves: activation, modification and deactivation of the default and dedicated EPS bearer contexts, and PDN Connectivity requests. A default bearer is created for every PDN connection and lives for as long as that connection does; dedicated bearers are added on top to give specific traffic flows their own QoS (a distinct QCI and, for GBR bearers, a guaranteed bit rate). Think of ESM as "what pipes do I have to the packet network, and with what QoS."
They cooperate closely. When a UE performs an initial Attach, the EMM Attach Request actually carries a piggybacked ESM PDN Connectivity Request inside it, so that registering and getting your first (default) bearer happen in one round trip. That is why a fresh attach leaves the UE both registered and with a working default bearer — ready to pass user data immediately.
EMM (Mobility Management) | ESM (Session Management) | |
|---|---|---|
| Concerned with | UE registration, location, reachability, security | Data connections (EPS bearers, PDN connectivity) |
| Protocol Discriminator | EPS Mobility Management (value 7) | EPS Session Management (value 2) |
| Key procedures | Attach / Detach, Authentication, Security Mode Command, Tracking Area Update, Service Request, Paging, GUTI reallocation | Default / dedicated bearer activation, modify, deactivate; PDN Connectivity; Bearer Resource Allocation |
| Example messages | Attach Request, Authentication Request, Security Mode Command, Tracking Area Update Request, Service Request | Activate Default EPS Bearer Context Request, Activate Dedicated EPS Bearer Context Request, PDN Connectivity Request |
| Header carries | Security Header Type + message type | EPS Bearer Identity + Procedure Transaction Identity + message type |
| Answers the question | "Am I known and reachable?" | "What data pipes do I have, and with what QoS?" |
One connection, two conversations: EMM and ESM share the same NAS signalling connection and the same security context, but they are separate state machines with separate headers. The MME routes an incoming message to the right handler purely on the Protocol Discriminator.
✅ Debugging steps
- Read the
Protocol Discriminatorfirst — it tells you whether the message you are looking at is EMM (registration/security) or ESM (bearer/session), so you interpret the rest of the header correctly. - On an
Attach Request, confirm the ESMPDN Connectivity Requestis actually present inside theESM message container; a "missing" ESM message is almost always encapsulated, not absent. - For a UE-initiated ESM transaction, track the
Procedure Transaction Identity(PTI) so you can pair the request with the response that answers it.
⚠ Common causes of failure
- Decoder pointed at the wrong protocol because the
Protocol Discriminatorwas misread, so the IEs "don't parse." - ESM procedure stalls because the PTI in the response does not match the outstanding request (or is "unassigned" when a pairing was expected).
- An ESM message carried on a bearer identity of "no EPS bearer identity assigned" when a real bearer was expected, indicating the wrong container was populated.
NAS Message Structure
Every NAS message begins with a small header, and the shape of that header depends on whether the message is EMM or ESM. Getting the fields straight makes protocol traces far easier to read, because the first one or two octets tell you almost everything about how to interpret the rest.
All NAS messages start with a Protocol Discriminator (4 bits) that says EMM or ESM. Alongside it, the interpretation of the other half of the first octet differs by protocol:
- For EMM messages, the first octet also carries the
Security Header Type(4 bits). This tells the receiver how the message is protected — plain, integrity-protected, integrity-protected and ciphered, or a special value for the security-mode and service-request cases. When the message is security-protected, it is wrapped in an outer security-protected NAS message header that prepends theMessage Authentication Code(MAC, 4 octets) and a NAS sequence number, and the real EMM message sits inside as the plaintext (or ciphered) payload. - For ESM messages, the first octet carries the
EPS Bearer Identity(4 bits) instead of a security header type — because every ESM message is about a specific bearer — and the second octet carries theProcedure Transaction Identity(PTI). The PTI ties a request to its response for UE-initiated procedures (like aPDN Connectivity Requestand theActivate Default EPS Bearer Context Requestthat answers it). For network-initiated procedures with no pending transaction, the PTI is set to "no procedure transaction identity assigned."
After the header comes the Message Type octet, which names the exact message (e.g. Attach Request, Activate Dedicated EPS Bearer Context Request), followed by the mandatory and optional information elements for that message. Because ESM messages are transported inside EMM (they ride the same connection), the EPS bearer identity of a plain EMM message is set to "no EPS bearer identity assigned."
| Field | Present in | Size | Purpose |
|---|---|---|---|
Protocol Discriminator | EMM & ESM | 4 bits | Selects the protocol (EMM = 7, ESM = 2); tells the MME which handler receives the message. |
Security Header Type | EMM only | 4 bits | How the message is protected: plain, integrity only, integrity+ciphered, or the security-mode/service-request special values. |
EPS Bearer Identity | ESM only | 4 bits | Which EPS bearer this session message concerns (shares the first octet in place of the security header type). |
Procedure Transaction Identity | ESM only | 1 octet | Correlates a UE-initiated ESM request with its response; "unassigned" for network-initiated procedures. |
Message Authentication Code | Security-protected EMM | 4 octets | The integrity checksum over the whole NAS message, computed with KNASint. |
| NAS sequence number | Security-protected EMM | 1 octet | The low byte of the NAS COUNT, carried so the receiver can rebuild the full counter. |
Message Type | EMM & ESM | 1 octet | Names the specific message; followed by that message's mandatory and optional IEs. |
Spec note: the very first NAS messages of a connection (before security is up) are sent plain, i.e. with Security Header Type = "not security protected." Once the NAS Security Mode Command / Complete exchange finishes, subsequent messages use the security-protected header carrying the MAC and sequence number.
NAS Security: Integrity, Ciphering, Keys and COUNT
NAS has its own security, entirely separate from AS (radio) security. This matters because the two protect different things: AS security (set up by the eNB via the RRC SecurityModeCommand) protects the radio bearers between UE and eNB, while NAS security protects the UE–MME signalling — it is anchored in the core and must survive even as the UE hands over between eNBs.
NAS security provides two services. Integrity protection lets the MME trust that a message really came from this UE and was not altered in flight; it is computed as a Message Authentication Code using the key KNASint. Ciphering makes the NAS payload confidential using the key KNASenc. Both keys are derived from the master key K_ASME (itself produced during authentication), together with the identifiers of the chosen algorithms. In LTE, integrity protection is mandatory once a security context exists — every protected NAS message is integrity-checked — whereas ciphering may in principle use the null algorithm (EEA0), though operators normally enable it.
Two more concepts tie the scheme together:
- The
eKSI(evolved Key Set Identifier) is a small tag that names which security context (which set of keys) a message uses. Because a UE and MME can hold a cached native context and also a mapped one (e.g. after inter-RAT movement), theeKSIlets both sides agree on the active keys without re-running authentication every time. - The NAS
COUNTis a counter that feeds both the integrity and ciphering algorithms as input, guaranteeing that the same plaintext never produces the same ciphertext or MAC twice — which is what defeats replay. It is maintained separately for uplink and downlink and is built from an overflow counter (the high bits) plus a sequence number (the low 8 bits). Only the sequence number is carried in the message header; the receiver reconstructs the fullCOUNTby tracking overflow locally.
All of this is switched on by the NAS Security Mode Command (SMC) procedure. The MME sends a Security Mode Command that selects the integrity and ciphering algorithms and echoes the UE security capabilities (so the UE can detect a bidding-down attack); this message is integrity-protected but not yet ciphered. The UE verifies the MAC and replies with a fully protected (integrity + ciphered) Security Mode Complete. From that point on the NAS connection is secured with KNASint and KNASenc.
| Element | Role | Derived from / set by |
|---|---|---|
K_ASME | NAS master key at the MME/UE | Produced from authentication (AKA) vectors |
KNASint | Integrity key for NAS (computes the MAC) | K_ASME + integrity algorithm id |
KNASenc | Ciphering key for NAS (confidentiality) | K_ASME + ciphering algorithm id |
eKSI | Names which security context/key set is active | Assigned at authentication |
NAS COUNT | Anti-replay input to integrity & ciphering | Overflow counter + 8-bit sequence number, per direction |
| NAS SMC | Turns security on, selects algorithms | Security Mode Command / Security Mode Complete |
Two security contexts, one root: KNASint/KNASenc protect NAS (UE–MME) and are anchored in the core; the AS keys (KRRCint, KRRCenc, KUPenc) protect the radio (UE–eNB) and are derived via KeNB. Both descend from K_ASME, but they live at different layers and are refreshed independently.
✅ Debugging steps
- Confirm the
Security Mode Commandis integrity-protected (a validMessage Authentication Codepresent) and that the UE's returnedSecurity Mode Completeis both integrity-protected and ciphered. - Check that the algorithms named in the SMC (selected
EEA/EIA) are ones the UE advertised in itsUE network capability; a mismatch is a bidding-down flag, not a normal outcome. - Verify the
eKSI/KSIin the message points at a context both sides hold; if the UE presents "no key available," expect a fresh authentication to precede security. - Watch the NAS
COUNT/ sequence number progression per direction — a MAC failure with a jumped or reset counter points at a COUNT desync rather than a wrong key.
⚠ Common causes of failure
- NAS
MAC failure: wrongKNASint, mismatched algorithm selection, or a NASCOUNTdesynchronisation between UE and MME. - UE aborts the SMC because the echoed
UE network capabilitydoes not match what it sent (suspected bidding-down). - Stale or purged security context at the MME — the
eKSIthe UE presents no longer maps to a validK_ASME, so the protected message cannot be verified. - Ciphering enabled on one side only (e.g. an
EEA0vs non-null mismatch), so the payload decodes to garbage even though integrity passes.
EMM, ECM and ESM States
NAS tracks several independent state machines in the UE and network, and it helps to keep them apart. Two of them — EMM and ECM — are the ones a fresher is asked about most.
The EMM state says whether the UE is registered. In EMM-DEREGISTERED the network holds no valid location or context for the UE — this is the state after power-on before attach, or after a detach. After a successful Attach, the UE moves to EMM-REGISTERED: the MME knows its tracking area, holds a valid GUTI and security context for it, and it can be paged.
The ECM (EPS Connection Management) state says whether there is an active NAS signalling connection right now. In ECM-IDLE the UE is registered but has no S1 or RRC connection — it is camped, saving battery, and is only reachable via Paging; the network knows its location only to tracking-area granularity. In ECM-CONNECTED there is an active connection: an RRC connection on the radio and an S1-MME association in the core, and the eNB knows the UE at cell granularity.
These map cleanly onto RRC states. ECM-IDLE corresponds to RRC_IDLE; ECM-CONNECTED corresponds to RRC_CONNECTED. Moving from idle to connected is exactly what the Service Request procedure (or an attach / TAU) does — it establishes the RRC connection and the S1 signalling connection so that data or signalling can flow. The reverse transition to ECM-IDLE happens when the connection is released after inactivity.
Separately, ESM maintains a state per EPS bearer context — essentially BEARER CONTEXT INACTIVE versus BEARER CONTEXT ACTIVE — and per-procedure states while an activation or modification is in flight. A bearer context is a piece of persistent state (it survives the UE going to ECM-IDLE), which is why a UE can drop its radio connection to save power and still resume its data session immediately on the next Service Request without re-establishing bearers from scratch.
| Layer | Idle-side state | Connected-side state | Meaning |
|---|---|---|---|
| EMM | EMM-DEREGISTERED | EMM-REGISTERED | Is the UE registered / known to the MME? |
| ECM | ECM-IDLE | ECM-CONNECTED | Is there an active NAS signalling connection now? |
| RRC | RRC_IDLE | RRC_CONNECTED | Is there an active radio connection now? |
| ESM (per bearer) | BEARER CONTEXT INACTIVE | BEARER CONTEXT ACTIVE | Does this EPS bearer context exist? |
Two axes, not one: a UE can be EMM-REGISTERED yet ECM-IDLE — registered but sleeping. It is still "on the network," with its bearer contexts intact, just not currently connected. Incoming data triggers a Paging, the UE runs a Service Request, and it transitions to ECM-CONNECTED — while its EMM state never changed.
How NAS Rides on RRC and S1AP
The picture below is worth memorising. Follow a NAS message from the UE to the MME and notice how it changes container but never changes content. The same NAS PDU that the UE's NAS layer produced is what the MME's NAS layer consumes; the eNB simply moves it from the RRC container into the S1AP container.
On the air interface, NAS is carried over Signalling Radio Bearers. SRB1 carries most NAS signalling once the RRC connection is set up; SRB2 (established after security) carries higher-volume or lower-priority NAS messages. The very first NAS message of a connection is often piggybacked in RRCConnectionSetupComplete as the dedicatedInfoNAS field — that is how an Attach Request or Service Request reaches the eNB. On S1, the initial NAS message travels in the S1AP INITIAL UE MESSAGE, and thereafter in UPLINK NAS TRANSPORT and DOWNLINK NAS TRANSPORT, which exist for no purpose other than shuttling a NAS PDU between eNB and MME.
RRC over the signalling radio bearers; on S1 it rides inside S1AP; the eNB relays it without decoding.Notice the double layer of security a NAS message enjoys. First, NAS integrity/ciphering with KNASint/KNASenc is applied end-to-end between UE and MME, so even the eNB cannot read a ciphered NAS payload. Then, on the radio, PDCP applies AS integrity and ciphering to the SRB carrying it. A single Attach Request is therefore protected once by NAS and again by AS — belt and braces, at two independent layers with two independent key sets.
✅ Debugging steps
- When a NAS message "goes missing," check the transport hop separately: is it present in the RRC log (
dedicatedInfoNASonSRB1/SRB2) but absent on S1, or vice-versa? That localises the break to the air or the S1 leg. - For the first message of a connection, confirm it is carried as
INITIAL UE MESSAGEon S1 and that the eNB selected a reachable MME (GUMMEI routing). - Verify subsequent NAS travels in
UPLINK/DOWNLINK NAS TRANSPORTand that SRB2 was established after security if larger NAS messages are being carried.
⚠ Common causes of failure
- SRB not established (RRC connection setup incomplete), so the NAS PDU never reaches the eNB.
- eNB routes the
INITIAL UE MESSAGEto the wrong or an unreachable MME, so NAS is delivered nowhere useful. - S1AP association down between eNB and MME, so NAS transport fails on the core leg despite a healthy radio.
- A large NAS message dropped because
SRB2was not yet available and the payload exceeded what could be carried.
Reading NAS in the logs
Because the eNB does not decode NAS, the two ends worth tracing are the UE's NAS log and the MME's NAS log — and the S1AP container in between confirms the payload was carried unchanged. A NAS trace usually prints the header (protocol, security header type, message type) and then the decoded IEs. The one-line habit is: read the header to know what kind of message it is and whether it is protected, then read the message type and IEs to know what it does.
Representative NAS trace (UE/MME decode) — illustrative, values vary by vendor/build:
| Field | Meaning | Example | Check |
|---|---|---|---|
Protocol Discriminator | Selects EMM (7) or ESM (2) — which handler owns the message. | EPS mobility management (7) | Must match the message type family; a wrong value means the trace is being mis-decoded. |
Security Header Type | Whether the EMM message is plain, integrity-only, or integrity+ciphered. | Plain (0) on attach, (2) on accept | First messages must be plain; anything after SMC should be protected. A protected first message or a plain post-SMC message is a red flag. |
Message Authentication Code | Integrity checksum over the NAS message, computed with KNASint. | 0x8F3C2A17 | Must verify at the receiver; a MAC failure points at key mismatch or NAS COUNT desync. |
| NAS sequence number | Low byte of the NAS COUNT, per direction. | 0 | Should increment monotonically per direction; a jump/reset is a COUNT desync symptom. |
EPS mobile identity | Identity presented: GUTI (temporary) or IMSI (permanent). | GUTI | An IMSI here on a returning UE means GUTI resolution failed — expect an Identity procedure. |
UE network capability | Bitmap of EEA/EIA algorithms the UE supports. | EEA0-2 / EIA1-2 | Must be echoed unchanged in the SMC; a mismatch is a bidding-down indicator. |
ESM message container | The nested ESM message riding inside the EMM message. | PDN connectivity request | On attach it must be present; if "missing," it is encapsulated here, not omitted. |
Procedure Transaction Identity | Pairs a UE-initiated ESM request with its response. | 1 | The Activate Default EPS Bearer answering this must carry the same PTI. |
EPS Bearer Identity | Which bearer an ESM message concerns. | 5 (default bearer) | "no EPS bearer identity assigned" is correct only before a bearer exists. |
Summary
NAS is the UE–MME control-plane conversation the eNB only carries. Keep three things straight and the rest follows. First, two protocols: EMM (registration, location, reachability, security) and ESM (bearers, PDN connectivity), told apart by the Protocol Discriminator. Second, the header tells you how to read the body: Security Header Type says whether an EMM message is protected; the EPS Bearer Identity + Procedure Transaction Identity say which bearer and transaction an ESM message belongs to. Third, two independent axes of state: EMM (registered or not) and ECM (connected or not), which is why a UE can be registered yet asleep in ECM-IDLE.
When something breaks, localise it the same way you would a RACH failure — by layer and by hop. Is the NAS message present in the RRC log but not on S1? Does the Message Authentication Code verify? Is the Security Header Type what it should be for this stage of the connection? Does the ESM PTI pair up? Each answer narrows a vague "attach/NAS failure" into a specific, testable cause.
Quick Q&A
Q. Does the eNB read NAS messages?
A. No. The eNB relays NAS transparently. On the radio it carries the NAS payload inside an RRC container (e.g. dedicatedInfoNAS) over SRB1/SRB2; on S1 it carries the same payload inside S1AP (INITIAL UE MESSAGE, UPLINK/DOWNLINK NAS TRANSPORT). It never decodes NAS content — that is the MME's job. This is exactly why NAS is called the Non-Access Stratum.
Q. What is the difference between EMM and ESM, and how does a receiver tell them apart?
A. EMM (EPS Mobility Management) handles registration, location and reachability — Attach/Detach, authentication, Tracking Area Update, Service Request, paging response, GUTI reallocation. ESM (EPS Session Management) handles data connections — default and dedicated EPS bearer activation/modification/deactivation and PDN Connectivity. The receiver distinguishes them by the Protocol Discriminator in the first octet.
Q. Which header fields are unique to ESM messages?
A. ESM messages carry an EPS Bearer Identity (which bearer the message concerns, sharing the first octet in place of a security header type) and a Procedure Transaction Identity (PTI) that correlates a UE-initiated request with its response. EMM messages instead carry a Security Header Type.
Q. Is NAS integrity or ciphering mandatory, and what stops replay?
A. Integrity protection is mandatory once a NAS security context exists (a Message Authentication Code computed with KNASint is on every protected message); ciphering with KNASenc is normally on but can use the null algorithm. Replay is prevented by the NAS COUNT — an overflow counter plus an 8-bit sequence number, per direction — fed into both algorithms so no message can be silently replayed.
Q. Can a UE be registered but not connected?
A. Yes. EMM and ECM are separate axes. A UE can be EMM-REGISTERED (known to the MME, pageable, bearer contexts intact) while in ECM-IDLE (no active signalling connection), which maps to RRC_IDLE. It saves power there and is woken by Paging, after which a Service Request brings it to ECM-CONNECTED / RRC_CONNECTED.
Q. What does the eKSI do?
A. The eKSI (evolved Key Set Identifier) names which security context / key set is currently active, so the UE and MME can agree on the keys derived from a given K_ASME without re-running authentication on every message — useful when both a native and a mapped context exist.
LTE ↔ NR: NR keeps the same two-layer split but renames almost everything. NAS in 5G is 5GS NAS (TS 24.501) between UE and AMF (not MME); EMM/ESM become 5GMM and 5GSM; Attach/TAU become Registration; the temporary identity is the 5G-GUTI; the master key is K_AMF with NAS keys K-NASenc/K-NASint; and the permanent identity is protected on the air by the encrypted SUCI (concealing the SUPI), closing the IMSI-in-the-clear gap LTE still has. On transport, NAS rides inside RRC on the air and inside NGAP (over the N2 interface, not S1AP/S1) between gNB and AMF, but it is still relayed transparently.
Where NAS connects
NAS is the umbrella; the individual procedures are where the detail lives. From here, follow how a UE first registers and proves its identity, how its data pipes are set up and torn down, and how it keeps the network informed of where it is.