Skip to content
Documentation Background

Mobility and handover

An IP address does two jobs. It names the host, and it tells routers where in the network that host is attached. Move to a different subnet and the address has to change, which breaks every open TCP connection, because TCP identifies a connection by the address pair and ports (multiplexing and demultiplexing). Mobility is the set of techniques for avoiding that.


ScenarioExampleWhat is needed
Within one access networkWalking from a meeting room to a cafe, disconnecting and joining a different Wi-Fi networkNothing special. The device disconnects and reconnects, and connections do not survive
Between access networks of one providerDriving across a city on 5G, or roaming between APs of one officeThe provider’s network hands the device over. Connections should survive
Between providersRoaming abroad onto a partner networkHandover plus inter-operator signaling, authentication, and billing

There are two ways to build the second case:

  • Link-layer mobility. Keep the device in one IP subnet. The address does not change, so routers need no update. Wi-Fi does this.
  • Network and core mobility. The core tracks where the device is and redirects its traffic through tunnels, so the device can cross subnets with a stable address. Cellular does this.

A handover can be started by:

  • Falling channel quality. The device moves away from its base station. The measure is RSSI in Wi-Fi and a channel quality report (CQI, plus RSRP and RSRQ) in cellular.
  • Load balancing. The network moves devices to a neighboring cell even though the signal is acceptable.
  • Prediction. Newer systems use models of movement to hand over before the signal degrades.

Who decides differs. In Wi-Fi the client decides by its own rules. In cellular the network decides, using measurement reports the device sends.


A handover moves the device from a source base station to a target. The procedure has three phases and also involves the core.

sequenceDiagram
    participant D as Device
    participant S as Source gNB
    participant T as Target gNB
    participant C as AMF, SMF, UPF
    D->>S: Measurement reports
    S->>T: Handover request
    T-->>S: Request acknowledged
    S->>D: RRC reconfiguration (go to target)
    S->>T: Transfer context, forward in-flight data
    D->>T: Attach and reconfiguration complete
    T->>C: Path switch request
    C->>C: UPF updates the tunnel to point at the target
    C-->>S: End marker on the old tunnel
    T->>D: Buffered data, then new data
  1. Decision. The device reports signal strength of nearby cells. The source decides to hand over and asks the target, which checks its resources and agrees.
  2. In the RAN. The source tells the device to reconfigure and passes the connection context (security state, quality-of-service settings) to the target. The device detaches, tunes to the target, and attaches. While this happens the source keeps receiving packets from the UPF and forwards them to the target, which buffers them so nothing is lost.
  3. In the core. The target asks the AMF to switch the path. The SMF has the UPF change the tunnel endpoint from the source to the target. The UPF sends an end marker down the old tunnel to show the last packet. The target flushes the buffered packets, followed by new ones arriving directly, and the source releases the context.

The device keeps its IP address through all this. The UPF is the fixed anchor, and only the other end of its tunnel moves, as explained in 5G core network. The interruption is typically tens of milliseconds, which an application sees as a brief pause or a few reordered packets.


Wi-Fi mobility is link-layer only. Moving between APs of the same ESS keeps the SSID and subnet, so the IP address stays. Moving to an AP in another subnet gives a new address, and TCP connections break.

The steps for a client to move are: notice the current signal getting weak, scan for a better AP, authenticate and associate with it, then (if enterprise security is used) redo the key exchange. The last step is the slow part, and can cause a pause of hundreds of milliseconds, enough to drop a voice call.

StandardWhat it does
802.11r (fast BSS transition)Reduces the re-authentication handshake when changing APs inside the ESS
802.11kThe AP gives the client a list of neighboring APs, so scanning is quick
802.11vThe network can suggest a better AP to the client (steering)

Enterprise vendors add their own controllers to coordinate this. On the data path, nothing is tunneled in the simple case. The wired switches just learn the client’s MAC on the new AP’s port, the same self-learning as in ARP and switching, and in-flight frames are recovered by retransmission.

A well-known problem is the sticky client: a device that stays attached to a distant AP at a low rate when a closer AP is available, because its firmware roams late. It slows everyone on that AP (see airtime in Wi-Fi operation). Fixes are steering via 802.11v, lowering AP power so the signal drops sooner, and disabling the lowest data rates.

Wi-Fi5G
ScopeOne subnetAcross subnets and regions
MetricRSSICQI, RSRP, RSRQ
Who decidesThe clientThe network
In-flight dataLost frames recovered by retransmissionForwarded and buffered by the target
Path updateSwitch MAC learningGTP tunnel update at the UPF

The IETF standardized Mobile IP to give network-layer mobility for any IP network. A host has a permanent home address on its home network. When it visits another subnet it gets a temporary care-of address. A home agent on the home network intercepts packets sent to the home address and tunnels them to the care-of address, so peers keep using the same address.

It never became common on the open internet. The internet had no framework for the accounting, authentication, and settlement between providers that roaming requires, and cellular networks arrived first with mobility built in, tied to subscriptions and roaming agreements.

Today’s answer is two technologies side by side: cellular for mobility at wide scale, and Wi-Fi for fast local access.


Applications and platforms have their own ways around the problem:

  • QUIC connection migration. A QUIC connection is identified by a connection ID rather than by the address pair, so it can continue after the client’s IP address changes, for example when a phone moves from Wi-Fi to cellular. See HTTP/3 and QUIC.
  • VPNs that roam. WireGuard and similar tunnels accept packets from a new source address and keep the session. This is why a VPN often survives a Wi-Fi to cellular switch where plain TCP does not.
  • Reconnect logic. Mobile apps should retry quickly on network change and use resumable transfers. Treat a network change as normal, not as an error.
  • Short-lived TCP connections and idempotent requests are easier to repeat than long streams.