What roles do the S-GW and P-GW play on the LTE data path?
S-GW and P-GW sit on the data plane between phone and internet: the P-GW is the internet gateway router providing NAT services, with traffic tunneled extensively between the gateways.
Their place in the network: Both gateways lie on the data plane — the actual path user packets travel from the phone to/from the internet. Signaling (control plane) goes to the MME instead.
P-GW (PDN Gateway):
- The gateway of the mobile network to the outside world
- Acts as the internet gateway router for the mobile device
- Provides NAT services — your phone typically gets a private IP address, and the P-GW translates it for the public internet
- Makes extensive use of tunneling toward the S-GW
S-GW (Serving Gateway):
- The local anchor point for user data within the EPC
- Forwards tunneled traffic between eNodeB and P-GW
Why tunneling? Your phone keeps its IP address while moving between cells. That's only possible because the IP path is virtualized: packets are wrapped in tunnels (GTP), and when you move, only the tunnel endpoints change — the inner IP connection survives untouched.
Security observation: The NAT at the P-GW means mobile devices are normally not directly reachable from the internet — an accidental but useful security property, similar to a home router.
Go deeper:
System Architecture Evolution (Wikipedia) — the S-GW as inter-eNodeB mobility anchor and the P-GW as the PDN/internet gateway, with the S5/S8 and S1-U interfaces.