Signing on
Your phone talks by radio to the nearest 5G base station, called a gNB. The gNB only handles the radio. Everything else happens in the core network behind it, linked by fibre.
The 5G core is not one box but a team of programs called network functions, each with one job. At the back, AMF, SMF and UDM make decisions. In front, the UPF carries your actual data.
The phone's first message passes through the gNB to the AMF, the Access and Mobility Management Function. The AMF handles signing on, called registration, and keeps track of where the phone is.
The AMF asks the UDM, Unified Data Management, about this SIM. The UDM stores every subscriber's identity, plan and the data needed to check the SIM's secret key. Once the SIM passes, the phone is registered.
Opening a session
Registered is not online yet. To use the internet, the phone asks for a PDU session: a data connection to one network, here the internet. The AMF hands the request to the SMF, the Session Management Function.
The SMF picks a UPF, the User Plane Function, and gives your phone an IP address. It sends the UPF rules for your packets and tells the gNB where the UPF is. A tunnel now joins gNB and UPF.
Moving your data
Your packet goes by radio to the gNB. The gNB wraps it in a GTP-U header carrying a tunnel number and sends it to the UPF. The UPF unwraps it and sends it out to the internet.
The reply reaches the UPF, which knows which tunnel leads to your address. It wraps the packet and sends it to your gNB, which radios it to you. The AMF and SMF never touch your data.
Changing cells
You walk into gNB B's cell. The phone reports that B is stronger, so gNB A asks gNB B over their direct Xn link to take over. The phone switches to B; A briefly forwards your data.
gNB B tells the AMF it now serves you. The AMF passes this to the SMF, which tells the UPF to send your session's packets to gNB B. The tunnel's end moves; the session itself stays.
Replies now flow through gNB B. The UPF stayed the fixed anchor, so your PDU session and IP address never changed, and a video call keeps going without noticing you moved.
What is going on, line by line
;; step 1/11 · radio · radio
;; Your phone → gNB A
phone ⇄ gNB A, by radio ("New Radio", TS 38.300)
gNB = gNodeB, the 5G base station
behind it: fibre to the 5G core (TS 23.501)
(the lesson "Mobile networks: 4G and 5G" covers the radio side)
AMF, SMF and UDM talk through service-based interfaces (HTTP/2 APIs, TS 29.500), drawn as one shared line; the SMF controls the UPF over N4 (PFCP). A real 5G core has more functions than shown: the AUSF runs the SIM check with the UDM, the PCF sets policy and the NRF helps functions find each other.