Skip to content
SIP Mastery

Part 9 · SIP in the real world / Module 27

IMS and VoLTE

SIP as mobile operators use it: why the IMS exists; its functions (P-CSCF, I-CSCF, S-CSCF, HSS, MMTel AS, BGCF, MGCF, IBCF); IMS registration with AKA and IPsec; the P-headers, Path, and Service-Route; a VoLTE call with QoS preconditions; AMR-WB and EVS; VoWiFi and emergency calls; and where IMS SIP differs from RFC 3261 SIP in daily practice.

AdvancedNOC coreDEV core

After this module, you can

  • Explain why mobile operators built the IMS around SIP, and what they added.
  • Name each IMS function, and say which one adds or acts on each IMS header.
  • Follow an IMS registration through the CSCFs and the HSS, with the AKA challenge and the IPsec setup.
  • Read the segmented precondition lines of a VoLTE call, and say at each step whether the phone may ring.
  • Compare AMR-WB and EVS, and say where transcoding happens.
  • List the differences between IMS SIP and RFC 3261 SIP that matter when you read a trace.
On this page10 sections
  1. 27.1Why IMS exists
  2. 27.2Architecture
  3. 27.3IMS registration: AKA and IPsec
  4. 27.4IMS headers
  5. 27.5A VoLTE call: preconditions and QoS bearers
  6. 27.6VoLTE codecs: AMR-WB and EVS
  7. 27.7VoWiFi and emergency calls
  8. 27.8Where IMS SIP differs from RFC 3261 SIP in daily practice
  9. Common mistakes
  10. Summary

27.1 Why IMS exists

Mobile operators wanted SIP for voice, but SIP alone does not give them what a phone network needs. The IMSIMS. The 3GPP architecture that mobile operators use for voice and messaging over IP. It is built on SIP, with extra headers, AKA authentication, and QoS control. (IP Multimedia Subsystem) is the 3GPP architecture that adds it:

An operator needs The IMS uses
Authentication with the SIM, not a password AKAAKA. Authentication with the secret on the SIM. The network sends a challenge (RAND) and a proof of itself (AUTN); the SIM returns RES, used as the digest password (RFC 3310). in digest (RFC 3310)
A protected link from the phone, over the radio IPsec between the phone and the P-CSCF (RFC 3329)
Guaranteed voice quality on a shared radio network QoS bearers, and preconditions in SIP (RFC 3312)
Charging for every call, at every network element P-Charging-Vector and charging functions (RFC 7315)
Roaming, with the services of the home network The home S-CSCF always serves the user
Emergency calls and lawful interception Emergency registration, location in SIP, interception points
The PSTN and the old circuit-switched network MGCF and media gateways

VoLTEVoLTE. Voice calls over a 4G (LTE) network through the IMS, with a dedicated bearer for the media and AMR-WB or EVS as the codec. VoNR is the same over 5G. is IMS voice on a 4G network, as GSMA IR.92 profiles it; VoNR is the same on 5G. The SIP rules are in 3GPP TS 24.229, a document of more than a thousand pages, and the architecture in TS 23.228. 3GPP documents are not RFCs, so this module quotes the RFCs that IMS builds on.

27.2 Architecture

The SIP servers of the IMS are the CSCFsCSCF. The SIP servers of the IMS. There are three kinds - P-CSCF, I-CSCF, and S-CSCF.: Call Session Control Functions. Click a function on the map to see its job and its headers; pick a path to see which functions a request passes:

IMS core map

Who does what in the IMS

REGISTER goes UE → P-CSCF → I-CSCF. The I-CSCF asks the HSS which S-CSCF to use; the S-CSCF gets the AKA vectors and the user profile from the HSS.

Home networkPSTNOther operatorUEP-CSCFI-CSCFS-CSCFHSSMMTel ASBGCFMGCFIBCF— SIP ┄ Diameter

P-CSCF Proxy CSCF

The first SIP hop, found when the phone connects to the IMS APN. It holds the IPsec associations, asserts the phone's identity, and asks the PCRF for the voice bearer.

Headers

  • Path (in REGISTER)
  • P-Asserted-Identity (replaces P-Preferred-Identity)
  • P-Charging-Vector
  • P-Visited-Network-ID
  • Security-Server

Interfaces

Gm, Mw (to the CSCFs), Rx (to the PCRF)

Function Role in SIP terms
P-CSCFP-CSCF. The first SIP proxy of the IMS for a phone. It holds the IPsec associations with the phone, asserts its identity, and asks for QoS bearers. Outbound proxy and edge proxy: the phone’s first hop, with IPsec
I-CSCFI-CSCF. The IMS proxy at the entry of the home network. It asks the HSS which S-CSCF serves a user. Proxy at the entry of the home network; asks the HSS where the user is served
S-CSCFS-CSCF. The IMS registrar and main proxy of a user. It authenticates with AKA, and sends calls to application servers by the user profile. Registrar, authenticating proxy, and the proxy that applies the user’s services
HSSHSS. The IMS user database. It holds identities, the AKA secret, the user profile, and the name of the user's S-CSCF. Not SIP: the database behind the registrar, over DiameterDiameter. The AAA protocol of mobile networks. The CSCFs use it to query the HSS (the Cx interface), and the P-CSCF to ask the PCRF for QoS (Rx).
MMTel ASMMTel AS. The IMS application server for telephony services, such as forwarding, call waiting, hold, and conference. A B2BUA or proxy for the telephony services
BGCFBGCF. The IMS function that chooses where a call leaves for the PSTN., MGCFMGCF. The IMS gateway control to the PSTN. It converts SIP to ISUP, and controls a media gateway. Routing to the PSTN, and the gateway to ISUP (Module 24)
IBCFIBCF. The SBC between two operators' IMS networks. The SBC between two operators (Module 25)

27.3 IMS registration: AKA and IPsec

Before it can register, the phone must find its P-CSCF. When the phone connects to the IMS APN, the network gives it the P-CSCF addresses in the connection setup itself (or by DHCP and DNS). The phone then registers its public identity (IMPUIMPU. A public identity of an IMS user, as a SIP URI or tel URI. Others call it; it is the AOR that the UE registers.), and authenticates with its private one (IMPIIMPI. The private identity that the UE authenticates with. It appears only in Authorization and is never routed.), which lives on the ISIMISIM. The application on the SIM card that holds the IMS identities and the AKA secret..

Flow builder · an IMS registration

IMS registration: AKA and IPsec

  • SIP
  • TCP / IP
Authentication
Then

UE10.45.0.7P-CSCF10.255.0.10I-CSCF10.255.0.20S-CSCF10.255.0.30HSS10.255.0.4001REGISTER02REGISTER03Diameter UAR04Diameter UAA05REGISTER06Diameter MAR07Diameter MAA08401 Unauthorized09401 Unauthorized10401 Unauthorized11IPsec SAs up12REGISTER (credentials)13REGISTER14Diameter UAR15Diameter UAA16REGISTER17Diameter SAR18Diameter SAA19200 OK20200 OK21200 OK
01/21

The UE registers its public identity. Security-Client lists the IPsec settings it supports; the Authorization header is empty but names the private identity.

  • UEUnregistered
All steps as text
  1. UE → P-CSCF: REGISTER. The UE registers its public identity. Security-Client lists the IPsec settings it supports; the Authorization header is empty but names the private identity.
  2. P-CSCF → I-CSCF: REGISTER. The P-CSCF removes the sec-agree headers, and adds Path, P-Visited-Network-ID, and P-Charging-Vector.
  3. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  4. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  5. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  6. S-CSCF → HSS: Diameter MAR. The S-CSCF asks the HSS for an AKA authentication vector.
  7. HSS → S-CSCF: Diameter MAA. The HSS returns RAND, AUTN, the expected result XRES, and the keys CK and IK.
  8. S-CSCF → I-CSCF: 401 Unauthorized. The S-CSCF challenges with AKA: the nonce carries RAND and AUTN, and algorithm=AKAv1-MD5.
  9. I-CSCF → P-CSCF: 401 Unauthorized. The I-CSCF forwards the challenge.
  10. P-CSCF → UE: 401 Unauthorized. The P-CSCF keeps CK and IK for IPsec, removes them, and adds Security-Server with its own IPsec settings.
  11. UE → P-CSCF: IPsec SAs up. The ISIM checks AUTN and computes RES, CK, and IK. The UE and the P-CSCF set up IPsec with IK, on the ports in the Security headers.
  12. UE → P-CSCF: REGISTER (credentials). Over the protected port, the UE answers with RES as the digest password. Security-Verify repeats the P-CSCF's list.
  13. P-CSCF → I-CSCF: REGISTER. The request came over the IPsec association, so the P-CSCF marks it integrity-protected="yes".
  14. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  15. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  16. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  17. S-CSCF → HSS: Diameter SAR. The response matches XRES. The S-CSCF tells the HSS that it now serves the user, and asks for the user profile.
  18. HSS → S-CSCF: Diameter SAA. The HSS returns the user profile: the identities, and the initial filter criteria for the application servers.
  19. S-CSCF → I-CSCF: 200 OK. The S-CSCF accepts. Service-Route names the route for the UE's own requests; P-Associated-URI lists its other identities.
  20. I-CSCF → P-CSCF: 200 OK. The I-CSCF forwards the 200 OK.
  21. P-CSCF → UE: 200 OK. Registration done. The UE stores the Service-Route, and uses it in every later request.

Three things in this flow are new compared with Module 12 and Module 13.

AKA in place of a password. The S-CSCF gets an authentication vector from the HSS, and puts RAND and AUTN in the nonce. The ISIM checks AUTN, so the phone also authenticates the network, and computes RES, which becomes the digest password:

RFC 3310 §3.1 · Algorithm Directive
“In order to direct the client into using AKA for authentication instead of the standard password system, the RFC 2617 defined algorithm directive is overloaded in Digest AKA:”
Read the section ↗
RFC 3310 §3.3 · Client Authentication
“The resulting AKA RES parameter is treated as a "password" when calculating the response directive of RFC 2617.”
Read the section ↗

If the sequence number in AUTN is out of range, for example after a SIM swap, the phone sends AUTS instead, and the HSS resynchronises. Choose AKA, SQN out of sync in the builder:

RFC 3310 §3.4 · Synchronization Failure
“A valid AUTS parameter is used to re-synchronize the SQN in the AuC. The synchronized SQN is then used to generate a fresh authentication vector AV, with which the client is then re-challenged.”
Read the section ↗

Security agreement and IPsec. The phone lists its IPsec settings in Security-Client; the P-CSCF answers with Security-Server in the 401. Both build IPsec security associations with the IK key from AKA, and the second REGISTER goes over them, with Security-Verify to prove that nobody changed the lists:

RFC 3329 §2.1 · Overview of Operation
“Step 1: Clients wishing to use this specification can send a list of their supported security mechanisms along the first request to the server.”
Read the section ↗
RFC 3329 §2.1 · Overview of Operation
“Step 4: The client contacts the server again, now using the selected security mechanism. The server's list of supported security mechanisms is returned as a response to the challenge. Step 5: The server verifies its own list of security mechanisms in order to ensure that the original list had not been modified.”
Read the section ↗

The HSS behind the registrar. The I-CSCF asks the HSS which S-CSCF serves the user (UAR), the S-CSCF asks for the AKA vector (MAR), and, after success, for the user profile (SAR). The profile holds the initial filter criteria: the rules that send the user’s calls to application servers.

RFC 3310 §2 · AKA Mechanism Overview
“The server compares the authentication response RES with the expected response, XRES. If the two match, the user has been successfully authenticated, and the session keys, IK and CK, can be used for protecting further communications between the client and the server.”
Read the section ↗

27.4 IMS headers

Most IMS headers are P-headers (“private”), defined in RFC 7315 for 3GPP use. These are the ones you will meet in every trace:

Header Added by Says
P-Access-Network-Info UE (and P-CSCF) The radio access and the cell: 3GPP-E-UTRAN-FDD; utran-cell-id-3gpp=…
P-Visited-Network-ID P-CSCF Which network the phone is in, when it roams
P-Charging-Vector P-CSCF, then others A charging ID (icid-value) for the whole call, in every network
P-Asserted-Identity P-CSCF The identity the network checked (Module 7)
P-Associated-URI S-CSCF, in the 200 OK to REGISTER The user’s other identities, such as a tel URI
Path P-CSCF, in REGISTER Calls to the user go through this P-CSCF (RFC 3327)
Service-Route S-CSCF, in the 200 OK to REGISTER The route for the user’s own requests (RFC 3608)
P-Called-Party-ID S-CSCF, on terminating calls Which of the user’s identities was called
RFC 7315 §4.4 · The P-Access-Network-Info Header Field
“For example, a 3GPP UA may use this header field to pass information about the access network such as radio access technology and radio cell identity to its home service provider.”
Read the section ↗
RFC 7315 §4.3 · The P-Visited-Network-ID Header Field
“There is a need to indicate to the home network which network is the visited network that is providing services to the roaming UA.”
Read the section ↗
RFC 7315 §4.6 · The P-Charging-Vector Header Field
“This requires coordination among the network entities (e.g., SIP proxies), which includes correlating charging records generated from different entities that are related to the same session.”
Read the section ↗
RFC 7315 §4.1 · The P-Associated-URI Header Field
“This extension allows a registrar to return a set of associated URIs for a registered SIP address-of-record.”
Read the section ↗

Service-Route is why an IMS phone’s requests skip the I-CSCF: the phone puts the P-CSCF and the Service-Route in Route, and every request goes straight to its own S-CSCF. Turn on Subscribe to the reg event, and follow the SUBSCRIBE (Module 23):

Flow builder · registration, then the reg event along the Service-Route

IMS registration: AKA and IPsec, then the reg event

  • SIP
  • TCP / IP
Authentication
Then

UE10.45.0.7P-CSCF10.255.0.10I-CSCF10.255.0.20S-CSCF10.255.0.30HSS10.255.0.4001REGISTER02REGISTER03Diameter UAR04Diameter UAA05REGISTER06Diameter MAR07Diameter MAA08401 Unauthorized09401 Unauthorized10401 Unauthorized11IPsec SAs up12REGISTER (credentials)13REGISTER14Diameter UAR15Diameter UAA16REGISTER17Diameter SAR18Diameter SAA19200 OK20200 OK21200 OK22SUBSCRIBE23SUBSCRIBE24200 OK25200 OK26NOTIFY27NOTIFY28200 OK29200 OK
01/29

The UE registers its public identity. Security-Client lists the IPsec settings it supports; the Authorization header is empty but names the private identity.

  • UEUnregistered
All steps as text
  1. UE → P-CSCF: REGISTER. The UE registers its public identity. Security-Client lists the IPsec settings it supports; the Authorization header is empty but names the private identity.
  2. P-CSCF → I-CSCF: REGISTER. The P-CSCF removes the sec-agree headers, and adds Path, P-Visited-Network-ID, and P-Charging-Vector.
  3. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  4. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  5. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  6. S-CSCF → HSS: Diameter MAR. The S-CSCF asks the HSS for an AKA authentication vector.
  7. HSS → S-CSCF: Diameter MAA. The HSS returns RAND, AUTN, the expected result XRES, and the keys CK and IK.
  8. S-CSCF → I-CSCF: 401 Unauthorized. The S-CSCF challenges with AKA: the nonce carries RAND and AUTN, and algorithm=AKAv1-MD5.
  9. I-CSCF → P-CSCF: 401 Unauthorized. The I-CSCF forwards the challenge.
  10. P-CSCF → UE: 401 Unauthorized. The P-CSCF keeps CK and IK for IPsec, removes them, and adds Security-Server with its own IPsec settings.
  11. UE → P-CSCF: IPsec SAs up. The ISIM checks AUTN and computes RES, CK, and IK. The UE and the P-CSCF set up IPsec with IK, on the ports in the Security headers.
  12. UE → P-CSCF: REGISTER (credentials). Over the protected port, the UE answers with RES as the digest password. Security-Verify repeats the P-CSCF's list.
  13. P-CSCF → I-CSCF: REGISTER. The request came over the IPsec association, so the P-CSCF marks it integrity-protected="yes".
  14. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  15. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  16. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  17. S-CSCF → HSS: Diameter SAR. The response matches XRES. The S-CSCF tells the HSS that it now serves the user, and asks for the user profile.
  18. HSS → S-CSCF: Diameter SAA. The HSS returns the user profile: the identities, and the initial filter criteria for the application servers.
  19. S-CSCF → I-CSCF: 200 OK. The S-CSCF accepts. Service-Route names the route for the UE's own requests; P-Associated-URI lists its other identities.
  20. I-CSCF → P-CSCF: 200 OK. The I-CSCF forwards the 200 OK.
  21. P-CSCF → UE: 200 OK. Registration done. The UE stores the Service-Route, and uses it in every later request.
  22. UE → P-CSCF: SUBSCRIBE. The UE subscribes to its own registration state. Route lists the P-CSCF, then the Service-Route: the S-CSCF.
  23. P-CSCF → S-CSCF: SUBSCRIBE. The P-CSCF replaces P-Preferred-Identity with P-Asserted-Identity, and follows the Route straight to the S-CSCF. No I-CSCF, no HSS query.
  24. S-CSCF → P-CSCF: 200 OK. The S-CSCF accepts the subscription.
  25. P-CSCF → UE: 200 OK. The P-CSCF forwards it.
  26. S-CSCF → P-CSCF: NOTIFY. The S-CSCF sends the full registration state, along the Path that the P-CSCF added.
  27. P-CSCF → UE: NOTIFY. The P-CSCF forwards the NOTIFY over the IPsec association.
  28. UE → P-CSCF: 200 OK. The UE confirms. If the network later ends or shortens the registration, a NOTIFY tells the UE at once.
  29. P-CSCF → S-CSCF: 200 OK. The P-CSCF forwards the 200 OK.
RFC 3608 §3 · Discussion of Mechanism
“A registrar may use a Service-Route header field to inform a UA of a service route that, if used by the UA, will provide services from a proxy or set of proxies associated with that registrar.”
Read the section ↗

27.5 A VoLTE call: preconditions and QoS bearers

On LTE, voice gets its own dedicated bearerdedicated bearer. A radio and core network path with guaranteed bit rate for one type of traffic. VoLTE voice uses one with QCI 1.: a path with QCI 1 and a guaranteed bit rate, from the phone through the radio network to the core. The P-CSCF asks the PCRF for it as soon as it sees the codec in the SDP answer. Module 22 showed preconditions with an end-to-end status. VoLTE uses the segmented status: each phone reports its own radio link (local) and what it knows about the other one (remote):

RFC 3312 §4 · SDP parameters
“The segmented status reflects the status of the access network reservations of both user agents.”
Read the section ↗
RFC 3312 §5.1.1 · SDP encoding
“For the segmented status type, the user agent MUST generate two current status lines: one with the tag "local" and the other with the tag "remote".”
Read the section ↗

The strip under the caption shows the state of each phone after each step. UE B must not ring until both segments have QoS:

Flow builder · a VoLTE call with segmented preconditions

A VoLTE call, with QoS preconditions

  • SIP
  • RTP media
  • TCP / IP
Codecs
What if

UE A10.45.0.7IMS core10.255.0.10UE B10.46.0.901INVITE02100 Trying03INVITE04183 Session Progress05183 Session Progress06dedicated bearer (QCI 1)07dedicated bearer (QCI 1)08PRACK09PRACK10200 OK (PRACK)11200 OK (PRACK)12UPDATE13UPDATE14200 OK (UPDATE)15200 OK (UPDATE)16180 Ringing17180 Ringing18200 OK19200 OK20ACK21ACK22RTP (EVS)
01/22

UE A offers EVS and AMR-WB. a=curr says no QoS yet on either side; a=des says UE A must have its own.

  • UE ANo QoS
All steps as text
  1. UE A → IMS core: INVITE. UE A offers EVS and AMR-WB. a=curr says no QoS yet on either side; a=des says UE A must have its own.
  2. IMS core → UE A: 100 Trying. The P-CSCF stops UE A's retransmissions.
  3. IMS core → UE B: INVITE. The core asserts the caller's identity and adds a charging vector. Now over 1300 bytes, the INVITE goes over TCP.
  4. UE B → IMS core: 183 Session Progress. UE B answers in a reliable 183, without ringing. a=des: both sides must have QoS; a=conf asks UE A to report its side.
  5. IMS core → UE A: 183 Session Progress. The answer reaches UE A. Both P-CSCFs now know the codec, and ask the PCRF for voice bearers.
  6. IMS core → UE A: dedicated bearer (QCI 1). The network sets up a dedicated bearer for UE A's voice: QCI 1, with a guaranteed bit rate.
  7. IMS core → UE B: dedicated bearer (QCI 1). And one for UE B. UE B now has its own QoS, but does not know about UE A's.
  8. UE A → IMS core: PRACK. UE A acknowledges the reliable 183.
  9. IMS core → UE B: PRACK. The core forwards the PRACK.
  10. UE B → IMS core: 200 OK (PRACK). UE B confirms the PRACK.
  11. IMS core → UE A: 200 OK (PRACK). The core forwards the 200 OK.
  12. UE A → IMS core: UPDATE. UE A has its bearer. As a=conf asked, it reports a=curr:qos local sendrecv in an UPDATE.
  13. IMS core → UE B: UPDATE. UE B learns that UE A's side is ready. Both segments now have QoS.
  14. UE B → IMS core: 200 OK (UPDATE). UE B answers: its local and remote QoS are both sendrecv. The preconditions are met.
  15. IMS core → UE A: 200 OK (UPDATE). UE A learns the same.
  16. UE B → IMS core: 180 Ringing. Only now does UE B ring: both radio links now have a guaranteed voice path.
  17. IMS core → UE A: 180 Ringing. UE A plays a ringback tone.
  18. UE B → IMS core: 200 OK. Bob answers. The SDP is already agreed, so the 200 OK has none.
  19. IMS core → UE A: 200 OK. The call is up.
  20. UE A → IMS core: ACK. UE A acknowledges.
  21. IMS core → UE B: ACK. The core forwards the ACK.
  22. UE A → UE B: RTP (EVS). HD voice with EVS, 16 kHz, on the QCI 1 bearers.
Step UE A says UE B knows Can UE B ring?
INVITE curr local none, curr remote none, des mandatory local Nothing is ready No
183 (reliable) — Asks for a report: conf:qos remote sendrecv No
Bearers set up Has its own QoS Has its own QoS No: UE B does not know about UE A
UPDATE curr local sendrecv Both segments ready Yes
180, 200 — Rings, then answers —

Turn off QoS preconditions to see the alternative: UE B rings at once, and the bearers come after the answer. If the radio network cannot give a bearer at that moment, the user has answered a call with no audio:

RFC 3312 §1 · Introduction
“In order to minimize "ghost rings", it is necessary to reserve network resources for the session before the callee is alerted.”
Read the section ↗

With the precondition lines, the INVITE is over 1300 bytes, so it travels over TCP (Module 19). IMS phones and P-CSCFs switch to TCP for large requests as a matter of routine.

27.6 VoLTE codecs: AMR-WB and EVS

AMR-WBAMR-WB. The wideband codec of VoLTE (50–7000 Hz, 6.6–23.85 kbit/s). EVSEVS. The newer VoLTE codec. It goes up to fullband, works at many bit rates, and hides packet loss better than AMR-WB.
Audio band Wideband (50–7000 Hz) Narrowband to super-wideband, and fullband
Bit rates 6.6–23.85 kbit/s (9 modes) 5.9–128 kbit/s
Clock rate in SDP 16000 16000
Packet loss Good Better: channel-aware mode, jitter buffer in the codec
Status Required in every VoLTE phone The newer default; falls back to AMR-WB

A VoLTE phone offers EVS first and AMR-WB as the fallback, both with dynamic payload types and fmtp parameters such as mode-change-capability and max-red. Choose UE B has AMR-WB only in the builder to see the fallback. Calls to the PSTN are transcoded to G.711 in the media gateway behind the MGCF; calls to another operator may be transcoded in the IBCF’s media gateway, if the two networks do not share a codec.

27.7 VoWiFi and emergency calls

VoWiFiVoWiFi. IMS voice calls over Wi-Fi. The phone reaches the operator through an IPsec tunnel to the ePDG. (Wi-Fi calling) uses the same IMS, over any Wi-Fi. The phone builds an IPsec tunnel, authenticated with EAP-AKA, to the operator’s ePDGePDG. The operator's gateway for phones on untrusted Wi-Fi. The phone builds an IPsec tunnel to it, and reaches the IMS through the tunnel., and reaches its P-CSCF through the tunnel. The SIP is the same as on LTE, with three differences: P-Access-Network-Info says IEEE-802.11, there is no dedicated bearer on Wi-Fi, so preconditions are met at once on that side, and a call can hand over between Wi-Fi and LTE without a new INVITE.

Emergency calls have their own rules, because they must work without a valid subscription, and must carry the caller’s location:

  • The phone recognises the emergency number, and calls urn:service:sos (RFC 5031) through an emergency registration, or with no registration at all.
  • The P-CSCF sends it to the E-CSCF, which finds the right emergency centre (PSAP) for the location.
  • The location travels in P-Access-Network-Info (the cell), and often as a geolocation in the INVITE.

27.8 Where IMS SIP differs from RFC 3261 SIP in daily practice

You expect, from RFC 3261 In IMS
Digest with a password; MD5 AKA (algorithm=AKAv1-MD5), RES as the password
TLS or nothing on the first hop IPsec on protected ports, agreed with Security-Client/Server/Verify
A Route from DNS, or an outbound proxy P-CSCF, then the Service-Route, in every request
From is the identity P-Asserted-Identity is the identity; From may say anything, or “anonymous”
AORs are SIP URIs IMPUs as SIP and tel URIs, IMPI only for authentication
Registration for an hour Expires: 600000 (about a week), with the reg event to learn of changes
Preconditions and 100rel are rare Almost every call uses them: reliable 183, PRACK, UPDATE
UDP for most messages TCP whenever a request is over 1300 bytes, which is often
Feature tags are rare +g.3gpp.icsi-ref, +sip.instance with the IMEI, P-Preferred-Service on every call

Common mistakes

Expecting an MD5 digest

A developer tests a SIP client against an IMS core with a username and password. The S-CSCF challenges with algorithm=AKAv1-MD5. The client answers with a normal MD5 digest, the response does not match XRES, and the registration fails with 403.

Broken: MD5 with a password

IMS registration: a client without AKA is rejected

  • SIP
  • TCP / IP
  • ⚠Problem
UE10.45.0.7P-CSCF10.255.0.10I-CSCF10.255.0.20S-CSCF10.255.0.30HSS10.255.0.4001REGISTER02REGISTER03Diameter UAR04Diameter UAA05REGISTER06Diameter MAR07Diameter MAA08401 Unauthorized09401 Unauthorized10401 Unauthorized11REGISTER (credentials)⚠12REGISTER13Diameter UAR14Diameter UAA15REGISTER16403 Forbidden17403 Forbidden18403 Forbidden
01/18

A generic SIP client registers to the IMS. It has a username and password, but no ISIM.

  • UEUnregistered
All steps as text
  1. UE → P-CSCF: REGISTER. A generic SIP client registers to the IMS. It has a username and password, but no ISIM.
  2. P-CSCF → I-CSCF: REGISTER. The P-CSCF removes the sec-agree headers, and adds Path, P-Visited-Network-ID, and P-Charging-Vector.
  3. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  4. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  5. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  6. S-CSCF → HSS: Diameter MAR. The S-CSCF asks the HSS for an AKA authentication vector.
  7. HSS → S-CSCF: Diameter MAA. The HSS returns RAND, AUTN, the expected result XRES, and the keys CK and IK.
  8. S-CSCF → I-CSCF: 401 Unauthorized. The S-CSCF challenges with AKA: the nonce carries RAND and AUTN, and algorithm=AKAv1-MD5.
  9. I-CSCF → P-CSCF: 401 Unauthorized. The I-CSCF forwards the challenge.
  10. P-CSCF → UE: 401 Unauthorized. The challenge reaches the client.
  11. UE → P-CSCF: REGISTER (credentials). The client does not know AKA. It answers as for a normal digest challenge: MD5, with its configured password. Problem: IMS does not use a password. The S-CSCF expects RES from the ISIM as the digest password.
  12. P-CSCF → I-CSCF: REGISTER. The P-CSCF removes the sec-agree headers, and adds Path, P-Visited-Network-ID, and P-Charging-Vector.
  13. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  14. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  15. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  16. S-CSCF → I-CSCF: 403 Forbidden. The response does not match XRES. The S-CSCF rejects the registration.
  17. I-CSCF → P-CSCF: 403 Forbidden. The I-CSCF forwards the 403.
  18. P-CSCF → UE: 403 Forbidden. The client cannot register. It must use AKA with an ISIM or USIM.

Remember: IMS authenticates the SIM, not a password. A client needs an ISIM or USIM (or a test SIM with known keys), AKA, and usually IPsec with the P-CSCF.

Ignoring Service-Route on later requests

A phone registers, and then sends its next request with only the P-CSCF in Route. The P-CSCF compares the Route with the Service-Route it stored. Depending on the operator’s policy it repairs the Route, or rejects the request with 400.

Broken: Route without the S-CSCF

IMS registration: AKA and IPsec, then the reg event

  • SIP
  • TCP / IP
  • ⚠Problem
UE10.45.0.7P-CSCF10.255.0.10I-CSCF10.255.0.20S-CSCF10.255.0.30HSS10.255.0.4001REGISTER02REGISTER03Diameter UAR04Diameter UAA05REGISTER06Diameter MAR07Diameter MAA08401 Unauthorized09401 Unauthorized10401 Unauthorized11IPsec SAs up12REGISTER (credentials)13REGISTER14Diameter UAR15Diameter UAA16REGISTER17Diameter SAR18Diameter SAA19200 OK20200 OK21200 OK22SUBSCRIBE⚠23400 Bad Request
01/23

The UE registers its public identity. Security-Client lists the IPsec settings it supports; the Authorization header is empty but names the private identity.

  • UEUnregistered
All steps as text
  1. UE → P-CSCF: REGISTER. The UE registers its public identity. Security-Client lists the IPsec settings it supports; the Authorization header is empty but names the private identity.
  2. P-CSCF → I-CSCF: REGISTER. The P-CSCF removes the sec-agree headers, and adds Path, P-Visited-Network-ID, and P-Charging-Vector.
  3. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  4. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  5. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  6. S-CSCF → HSS: Diameter MAR. The S-CSCF asks the HSS for an AKA authentication vector.
  7. HSS → S-CSCF: Diameter MAA. The HSS returns RAND, AUTN, the expected result XRES, and the keys CK and IK.
  8. S-CSCF → I-CSCF: 401 Unauthorized. The S-CSCF challenges with AKA: the nonce carries RAND and AUTN, and algorithm=AKAv1-MD5.
  9. I-CSCF → P-CSCF: 401 Unauthorized. The I-CSCF forwards the challenge.
  10. P-CSCF → UE: 401 Unauthorized. The P-CSCF keeps CK and IK for IPsec, removes them, and adds Security-Server with its own IPsec settings.
  11. UE → P-CSCF: IPsec SAs up. The ISIM checks AUTN and computes RES, CK, and IK. The UE and the P-CSCF set up IPsec with IK, on the ports in the Security headers.
  12. UE → P-CSCF: REGISTER (credentials). Over the protected port, the UE answers with RES as the digest password. Security-Verify repeats the P-CSCF's list.
  13. P-CSCF → I-CSCF: REGISTER. The request came over the IPsec association, so the P-CSCF marks it integrity-protected="yes".
  14. I-CSCF → HSS: Diameter UAR. The I-CSCF asks the HSS: may this user register here, and which S-CSCF serves it?
  15. HSS → I-CSCF: Diameter UAA. The HSS names the S-CSCF.
  16. I-CSCF → S-CSCF: REGISTER. The I-CSCF forwards the REGISTER to that S-CSCF.
  17. S-CSCF → HSS: Diameter SAR. The response matches XRES. The S-CSCF tells the HSS that it now serves the user, and asks for the user profile.
  18. HSS → S-CSCF: Diameter SAA. The HSS returns the user profile: the identities, and the initial filter criteria for the application servers.
  19. S-CSCF → I-CSCF: 200 OK. The S-CSCF accepts. Service-Route names the route for the UE's own requests; P-Associated-URI lists its other identities.
  20. I-CSCF → P-CSCF: 200 OK. The I-CSCF forwards the 200 OK.
  21. P-CSCF → UE: 200 OK. Registration done. The UE stores the Service-Route, and uses it in every later request.
  22. UE → P-CSCF: SUBSCRIBE. The UE subscribes to its own registration state, but its Route lists only the P-CSCF. It ignored the Service-Route. Problem: Without the S-CSCF in Route, the request would miss the user's S-CSCF: no services, no charging.
  23. P-CSCF → UE: 400 Bad Request. The P-CSCF checks the Route against the stored Service-Route. They differ, and this operator's policy is to reject.

Remember: store the Service-Route from every successful REGISTER, and put the P-CSCF and the Service-Route in Route on every request outside a dialog, until the next registration.

Not answering the precondition steps

A phone accepts the reliable 183, but ignores a=conf, and never sends the UPDATE that reports its QoS. UE B waits for that report and never rings. The caller sees “connecting” until they give up.

Broken: no UPDATE

A VoLTE call, with QoS preconditions: UE A never reports its QoS

  • SIP
  • TCP / IP
  • ⚠Problem
UE A10.45.0.7IMS core10.255.0.10UE B10.46.0.901INVITE02100 Trying03INVITE04183 Session Progress05183 Session Progress06dedicated bearer (QCI 1)07dedicated bearer (QCI 1)08PRACK09PRACK10200 OK (PRACK)11200 OK (PRACK)⚠12CANCEL13200 OK (CANCEL)14CANCEL15200 OK (CANCEL)16487 Request Terminated17ACK18487 Request Terminated19ACK
01/19

UE A offers EVS and AMR-WB. a=curr says no QoS yet on either side; a=des says UE A must have its own.

  • UE ANo QoS
All steps as text
  1. UE A → IMS core: INVITE. UE A offers EVS and AMR-WB. a=curr says no QoS yet on either side; a=des says UE A must have its own.
  2. IMS core → UE A: 100 Trying. The P-CSCF stops UE A's retransmissions.
  3. IMS core → UE B: INVITE. The core asserts the caller's identity and adds a charging vector. Now over 1300 bytes, the INVITE goes over TCP.
  4. UE B → IMS core: 183 Session Progress. UE B answers in a reliable 183, without ringing. a=des: both sides must have QoS; a=conf asks UE A to report its side.
  5. IMS core → UE A: 183 Session Progress. The answer reaches UE A. Both P-CSCFs now know the codec, and ask the PCRF for voice bearers.
  6. IMS core → UE A: dedicated bearer (QCI 1). The network sets up a dedicated bearer for UE A's voice: QCI 1, with a guaranteed bit rate.
  7. IMS core → UE B: dedicated bearer (QCI 1). And one for UE B. UE B now has its own QoS, but does not know about UE A's.
  8. UE A → IMS core: PRACK. UE A acknowledges the reliable 183.
  9. IMS core → UE B: PRACK. The core forwards the PRACK.
  10. UE B → IMS core: 200 OK (PRACK). UE B confirms the PRACK.
  11. IMS core → UE A: 200 OK (PRACK). The core forwards the 200 OK. Problem: UE A never sends the UPDATE that a=conf asked for. UE B waits, and never rings.
  12. UE A → IMS core: CANCEL. After about 30 seconds of silence, Alice gives up. Her phone shows "connecting" the whole time.
  13. IMS core → UE A: 200 OK (CANCEL). The core accepts the CANCEL.
  14. IMS core → UE B: CANCEL. The core cancels the INVITE to UE B.
  15. UE B → IMS core: 200 OK (CANCEL). UE B accepts. It never rang.
  16. UE B → IMS core: 487 Request Terminated. UE B ends the INVITE transaction.
  17. IMS core → UE B: ACK. The core acknowledges the 487.
  18. IMS core → UE A: 487 Request Terminated. The 487 reaches UE A.
  19. UE A → IMS core: ACK. UE A acknowledges.

Remember: when the other side asks with a=conf, report your QoS as soon as your bearer is up: an UPDATE in the early dialog, with a=curr:qos local sendrecv. Answer every UPDATE with the current state of both segments.

Summary

  • The IMS is SIP plus what an operator needs: SIM authentication, IPsec on the radio side, QoS, charging, roaming, emergency calls, and PSTN interworking.
  • P-CSCF: the phone’s first hop, with IPsec. I-CSCF: the entry of the home network. S-CSCF: registrar and service proxy. HSS: the database, over Diameter.
  • IMS registration: REGISTER, a 401 with AKAv1-MD5, IPsec set up with IK, then a protected REGISTER with RES as the digest password. The 200 OK carries Service-Route and P-Associated-URI.
  • Every request outside a dialog follows the P-CSCF and the Service-Route to the user’s S-CSCF.
  • A VoLTE call uses segmented preconditions: a reliable 183, PRACK, an UPDATE when each side has its QCI 1 bearer, and only then 180.
  • VoLTE voice is EVS or AMR-WB; VoWiFi reaches the same IMS through an ePDG; emergency calls use urn:service:sos and carry the location.