What is SGW and PGW in 5G?
In mobile network architectures, SGW (Serving Gateway) and PGW (Packet Data Network Gateway) are fundamental components of the core network in LTE and early 5G deployments using EPC (Evolved Packet Core). While 5G Standalone (SA) replaces these with new elements, they still play a critical role in 5G Non-Standalone (NSA) mode.
SGW – Serving Gateway
The SGW acts as a local mobility anchor point for user data traffic and manages routing and forwarding between the base stations (eNodeBs in LTE and gNodeBs in EN-DC) and the PGW. It handles packet routing and forwarding for both uplink and downlink data.
Main functions of the SGW:
- Routing user-plane packets between base stations and the PGW
- Serving as a mobility anchor during intra-LTE handovers and between LTE and 3G networks
- Lawful interception and packet marking
- Maintaining data path continuity in idle and active states
In 5G NSA mode (EN-DC), the SGW still performs these roles as part of the EPC while the radio access network includes 5G NR.
PGW – Packet Data Network Gateway
The PGW is the gateway that connects the mobile core network to external packet data networks such as the internet or private enterprise networks. It is responsible for IP address allocation, QoS enforcement, and charging rules application.
Main functions of the PGW:
- IP address assignment to user equipment (UE)
- Enforcing policies from PCRF (Policy and Charging Rules Function)
- Traffic filtering and flow-based charging
- Acting as a gateway to external packet networks
In 5G NSA architecture, the PGW continues to manage the external data path and enforces service policies, while the NR radio access is anchored via LTE eNodeB.
Are SGW and PGW used in 5G Standalone?
No. In 5G SA mode, the EPC is replaced by the 5GC (5G Core), where new functions take over the roles of SGW and PGW. These are:
- UPF (User Plane Function) – replaces both SGW and PGW for data forwarding
- AMF (Access and Mobility Management Function) – handles mobility and signaling
- SMF (Session Management Function) – manages sessions and interacts with UPF
Is it possible to have multiple SGWs or PGWs?
Yes. In large mobile networks, there are often multiple SGWs and PGWs deployed for load balancing, redundancy, and geographic distribution. The MME dynamically selects an SGW during session setup based on UE location and network conditions.
How does data flow from UE to internet in NSA?
In 5G NSA with EN-DC, the data path is as follows: UE → eNodeB (Master Node) → gNodeB (Secondary Node) → SGW → PGW → Internet. Control signaling is managed via LTE, while the 5G NR boosts user data capacity.