IMS architecture explained: P-CSCF, I-CSCF, S-CSCF and the HSS
Short version: IMS is a SIP network with the roles pulled apart. The P-CSCF is the edge you talk to, the I-CSCF is the doorman who looks you up, the S-CSCF is the brain that registers you and routes your calls, and the HSS is the database all of them consult. Once you can name which box made a given decision, an IMS trace stops being intimidating.
Why the roles are split at all
A plain SIP deployment can put registrar, proxy and application logic on one box. IMS — the 3GPP's IP Multimedia Subsystem, the architecture behind VoLTE and VoWiFi — splits them because a mobile operator has problems a PBX does not: subscribers who roam into other networks, a subscriber database that must survive any single node, services that must be applied consistently no matter where the user attaches, and a regulatory duty to control the edge. Each of those problems got its own function, and the functions talk standard SIP (with 3GPP extensions) on interfaces with two-letter names.
The cast
| Node | Stands for | What it actually decides |
|---|---|---|
| P-CSCF | Proxy Call Session Control Function | The first SIP hop for the phone, always. Sets up the IPsec or TLS security association, polices what the device may send, compresses signalling on radio links, and asks the policy function (PCRF/PCF, over Rx) to build the voice bearer when SDP is agreed. Functionally the operator's access SBC. |
| I-CSCF | Interrogating CSCF | The entry point into a home network. Asks the HSS (over Cx) "which S-CSCF serves this user?" and forwards accordingly. Stateless, replaceable, deliberately boring. |
| S-CSCF | Serving CSCF | The registrar and the routing brain. Authenticates the user against HSS-supplied vectors, holds the registration, evaluates the initial filter criteria, and detours requests to application servers. Every call to or from the user passes through it. |
| HSS | Home Subscriber Server | The subscriber database: identities, credentials, service profiles, and which S-CSCF currently serves each user. Speaks Diameter (Cx/Sh), not SIP. In 5G core the role continues as the UDM. |
| AS / TAS | (Telephony) Application Server | Where supplementary services live — forwarding, barring, conferencing, voicemail. Reached from the S-CSCF over the ISC interface, which is ordinary SIP. |
| MGCF + IMS-MGW | Media Gateway Control Function | The PSTN border: converts SIP to ISUP/BICC and RTP to TDM. The BGCF picks which breakout gateway a PSTN-bound call should use. |
The interfaces worth memorising: Gm (phone to P-CSCF), Mw (CSCF to CSCF), Cx (I/S-CSCF to HSS, Diameter), ISC (S-CSCF to application server, SIP), Rx (P-CSCF to policy, Diameter). Most IMS trace questions are answered by knowing which interface you are looking at.
Registration, step by step
- The phone sends
REGISTERto the P-CSCF it discovered during attach. The request carries the private identity (IMPI) and public identity (IMPU), and aSecurity-Clientheader offering IPsec parameters. - The P-CSCF forwards it, adding a
Pathheader — its own address — so the S-CSCF will later know to route everything for this user back through it. - The I-CSCF asks the HSS (Cx:
UAR/UAA) whether the user exists and which S-CSCF should serve them, then forwards the REGISTER there. - The S-CSCF fetches authentication vectors from the HSS (Cx:
MAR/MAA) and answers 401 Unauthorized with an AKA challenge — theWWW-Authenticateheader carries RAND and AUTN. This first 401 is not a failure; it is the protocol working. - The SIM computes the response; the phone re-REGISTERs with it, now inside the
negotiated IPsec associations. The S-CSCF verifies, stores the registration
(Cx:
SAR/SAA), downloads the user's service profile, and answers 200 OK carrying aService-Routeheader — the route the phone must use for everything it sends from now on. - The S-CSCF then performs third-party registration: it sends its own REGISTER to each application server the filter criteria name, so the TAS knows the user is reachable.
How a call finds its services
The service profile downloaded at registration contains initial filter criteria
(iFC): ordered rules that say "if a request matches this pattern, detour it to that
application server first". When the user places a call, the S-CSCF walks the iFC list
and chains the INVITE through each matching AS over ISC before routing it onward. This
is why a single INVITE inside an operator core can appear four or five times in one
capture with slightly different Route stacks — it is the same call being
threaded through its service chain, not a loop. For the terminating side the same
happens in reverse on the callee's S-CSCF.
What each box looks like in a trace
- P-CSCF fingerprints:
Pathon REGISTER,P-Asserted-Identityinserted after authentication,Security-Serverin the 401, and the far side of the trace going quiet — beyond it everything is IPsec. - S-CSCF fingerprints:
Service-Routein the 200 OK to REGISTER,P-Charging-Vectorwith anicid-valuethat stays constant across the whole call — the single best correlation key in IMS, andRecord-Routeentries with its name. - iFC at work: the same Call-ID reappearing with a growing
Routeset naming...@tas...or similar — a service chain, not a retransmission (the CSeq and branch will differ; compare with real retransmissions). - HSS trouble: invisible in SIP except as its consequences —
REGISTER answered 403/404 for a valid user, or 504 when Cx times out. If you also
have the Diameter capture, the
Result-CodeAVP in the UAA/MAA tells the real story.
hiccup recognises the IMS headers — Path, Service-Route, P-Asserted-Identity, P-Charging-Vector — and uses the icid to stitch one call's appearances together across the core, alongside the Diameter it finds in the same capture. Self-hosted, free for individual users.
upload a trace