Why Can Devices Access the Internet from a Nearby P-GW After Attach?

2026-04-04

A structured explanation of how Local Breakout is realized from the perspective of the Attach procedure and P-GW selection

Introduction

Even when using smartphones or IoT devices abroad,
for some reason connectivity often feels smooth, as if the device is accessing the Internet “from a nearby location.”

However, in reality, roaming traffic does not simply exit directly to the Internet from the local network.

So then,

  • Why can it access the Internet from “nearby”?
  • At what point is that exit determined?

In this article, we explain these questions through the mechanism of Local Breakout (LBO).

The key points are as follows:

  • The traffic exit point of the UE (P-GW) is determined by the Home Operator’s policy
  • The P-GW is selected during the Attach procedure (control plane)
  • After that, a GTP session (data plane) establishes a tunnel between the S-GW and P-GW, finalizing the traffic exit point

In other words, Local Breakout is not something that is optimized afterward, but rather:
👉 It is logically determined during the Attach procedure and physically finalized through GTP session establishment.

By reading this article, you will gain a structured understanding of how Local Breakout works.

If you have not yet read “Why Can Devices Access the Internet After Attach?,”
reading it first will help deepen your understanding of how a UE (smartphone or IoT device) becomes capable of network communication.


1. What Is Local Breakout in the First Place?

Here, let us consider a case where a smartphone or IoT device contracted with a Japanese carrier is traveling in Europe.

For example, this is a situation where a SIM contracted in Japan is being used as-is while roaming in Europe.

In this case, there are two major traffic patterns.

Home Routed (HR)
Local Breakout (LBO)
Item
Home Routed (HR)
Local Breakout (LBO)
Traffic Path
UE → Visited Network in Europe → Home Network in Japan → Internet
UE → Visited Network in Europe → P-GW near Europe → Internet
Exit Location
Home Network (Japan)
Near the roaming location (Europe)
Communication Distance
Long (detour)
Short
Latency
More likely to increase
Reduction can be expected
How the IP Address Appears
Appears as a Japanese IP address
Appears as a European IP address

Important Point

The important point here is the following:

👉 In both cases, the traffic exit is controlled by the Home Operator.

In other words,

  • The Visited Network is not arbitrarily sending traffic out to the Internet
  • The Home Operator decides “from where traffic exits”

That is the structure.

How this “exit decision” is made is the essence of Local Breakout.


2. What Happens During Attach?

As explained in previous articles, when a UE connects to the network, the following steps take place:

The important point here is:

👉 “How is the traffic exit point (P-GW) selected?”

To understand this mechanism, let us look a little more deeply at what happens during Attach.
First, as a review, let us organize the overall flow so far.

Communication Process Supplement Related Article
1 UE → MME Attach Request Start of network connection Why Is the Initial Roaming Connection Slow?
Covered in this range
2 MME → HSS Subscriber Authentication Subscriber information acquisition
3 HSS → MME Acquire APN / Policy Information Default / Allowed APN
4 UE → MME PDN Connectivity Request UE specifies the APN Why Can Devices Access the Internet After Attach?
Covered in this range
5 MME → S-GW Create Session Request Connection conditions finalized
6 S-GW → DNS APN Resolution APN + Serving Network
7 S-GW → P-GW Creation of GTP Session Internet exit finalized

Here, let us look at an example in which the connection destination is distributed based on “the connected location (Visited Network) as a decision factor.”

The goal is:

  • Whether it is in Japan

  • Whether it is in Europe
    Based on such information,

    👉 Reflect it in the policy for “which P-GW should be used”

That is the goal.

*PLMN is a 5- to 6-digit identifier of a mobile operator
(explained in the article “Why Is the Initial Roaming Connection Slow?”)

The Relationship Between APN and Subscriber Policy

First, what serves as the premise for P-GW selection is the relationship between the APN and subscriber policy.
In process “3,” the following information is notified from the HSS in the Home Network to the MME:

  • Default APN
  • Allowed APN (usable APNs)

Then, in the PDN Connectivity Request in “4,” the UE specifies the APN it wants to connect to.

What is important here is:

👉 Whether the APN requested by the UE is included in the Allowed APN

This is the key point.

  • If included → the connection process proceeds with that APN
  • If not included → connection is rejected (PDN Connectivity Reject)
  • If no APN is specified → the Default APN is applied

In other words, at this stage,

👉 “Which APN to use”

is determined.

Identification of the Actual Destination P-GW

Next, based on the determined APN, the actual destination P-GW is identified.

In the Create Session Request in “5,” the MME notifies the S-GW of the following information:

  • APN to be used
  • Subscriber information (such as IMSI)
  • Serving Network (Visited PLMN) After receiving this, the S-GW issues a DNS query to identify the destination P-GW.

The query at this time is composed based on:

👉 APN + Serving Network (Visited PLMN)

Example: iot.jupiter5.net + 23415 (UK Serving Network)

This DNS query is sent to the DNS on the Home Network side, and based on the policy on the Home Network side, the appropriate P-GW address is returned.

Home DNS is not merely simple name resolution.
Based on information such as:

  • APN
  • The connected Serving Network (Visited PLMN)
    it is designed so that the appropriate P-GW is returned

For example:

  • Connection from a European PLMN → P-GW near Europe
  • Connection from a North American PLMN → P-GW in North America
    In this way, a geographically optimal P-GW is selected.

As a result,

👉 The destination P-GW is determined

That is the flow.

Supplement: More Advanced Control

In this article, to keep the explanation simple,

👉 We assume a configuration in which the P-GW is selected based on APN + Serving Network

as the premise.

On the other hand, in actual commercial networks, more advanced control may be applied.

For example:

  • Branching the destination on a per-subscriber basis (per IMSI)
  • Connecting the same APN to different regions

These are realized through additional elements such as:

  • Policy control in the Control Plane
  • Coordination with DNS and internal logic

In addition, it is necessary to consider whether the MME in the Serving Network is implemented in a way that correctly follows these policies.

To avoid such complexity and to ensure connectivity with multiple Serving Network operators, architectures using a GTP Proxy are sometimes adopted.

A GTP Proxy is deployed by the Home Network operator and sits between the S-GW and P-GW, enabling:

👉 Policy control to be enforced within the Home Network

without relying on the behavior of each Serving Network.

In any case, these approaches introduce additional components and increase overall complexity, so they are not covered in this article.


3. Impact from a Practical Perspective

This is actually the most important part.

IP Addresses Differ by P-GW

  • Each P-GW has a different IP pool
  • Even with the same SIM, the IP changes depending on the destination connected to

👉 The “location” seen from the Internet changes.


Impact on Geo-based Services

  • CDN delivery destinations
  • Access control
  • Content restrictions

Examples:

  • Even though the connection is from Japan, it appears as an overseas IP
  • AWS region selection becomes mismatched

Impact on IoT Design

This is very important in IoT.

  • Webhook design
  • Endpoint placement
  • Latency design

👉 If systems are not designed with “where traffic exits from” as a premise, it can lead to problems.

Typical examples:

  • Increased latency due to sending data to a distant region
  • Unexpected IPs being blocked by a firewall

Summary

  • The Internet exit point of the UE is determined during Attach
  • The P-GW is selected according to the Home Operator’s policy
  • Location information is also one of the decision factors
  • Distributed placement of P-GWs enables Local Breakout
  • This design has a major impact on performance and service behavior

Written by Tatsuya
IP / IoT / Mobile Network Architect
← Top Page
← Blog Index