Skip to main content

Gn/Gp Interface Documentation

GTP-C Communication with SGSN (2G/3G Networks)

OmniPGW by Omnitouch Network Services


Overview

The Gn/Gp interface enables OmniPGW to function as a GGSN (Gateway GPRS Support Node) for 2G/3G networks using the GTP-C v1 protocol. This interface handles PDP (Packet Data Protocol) context management between the GGSN and SGSNs.

  • Gn interface: Connects to SGSNs within the same PLMN (home network)
  • Gp interface: Connects to SGSNs in other PLMNs (roaming scenarios)

Both interfaces use identical protocols - the distinction is purely topological.


Key Differences from PGW (S5/S8)

AspectGGSN (Gn/Gp)PGW (S5/S8)
Protocol VersionGTP-C v1GTP-C v2
3GPP SpecificationTS 29.060TS 29.274
Session ConceptPDP ContextPDN Session + Bearers
Bearer IdentifierNSAPI (0-15)EBI (5-15)
Policy InterfaceNone (static policy)Gx (PCRF)
QoS ModelR99 QoS ProfileEPS Bearer QoS (QCI)
Port2123 (shared)2123

Protocol Details

GTP-C Version 1

  • Protocol: GTP-C v1 (3GPP TS 29.060)
  • Transport: UDP
  • Port: 2123 (shared with S5/S8 GTP-C v2)
  • Interface Type: Control Plane

TEID (Tunnel Endpoint Identifier)

Each PDP context has unique TEIDs for control and user plane:

  • GGSN Control TEID: Allocated by OmniPGW for incoming control messages
  • GGSN Data TEID: Allocated by UPF for incoming user data
  • SGSN Control TEID: Provided by SGSN for outgoing control messages
  • SGSN Data TEID: Provided by SGSN for outgoing user data
Message Flow:
SGSN → GGSN: Destination TEID = GGSN's Control TEID
GGSN → SGSN: Destination TEID = SGSN's Control TEID

CUPS Support (Control and User Plane Separation)

OmniPGW supports CUPS architecture for 2G/3G:

  • GSN Address for Signalling: OmniPGW's control plane IP (from gn.local_ipv4_address)
  • GSN Address for User Traffic: UPF's IP address (from PFCP Session Establishment Response)

This allows the GGSN-C and PGW-U/UPF to run on separate nodes with different IP addresses, which is standard for CUPS deployments.

NSAPI (Network Service Access Point Identifier)

The NSAPI identifies individual PDP contexts within a subscriber session:

  • Range: 5-15 (0-4 reserved)
  • Usage: Multiple PDP contexts per subscriber possible
  • Equivalent: Similar to EBI in LTE/EPC

Configuration

Basic Configuration

# config/runtime.exs
config :pgw_c,
# Gn/Gp interface is enabled automatically when gn config is present
gn: %{
# Local IPv4 address for Gn interface
local_ipv4_address: "10.0.0.20",

# Optional: Local IPv6 address
local_ipv6_address: nil,

# Port for GTP-C v1 (shared with S5/S8)
local_port: 2123
},

# DNS servers returned in PCO (shared with PGW)
dns: %{
primary_ipv4: {8, 8, 8, 8},
secondary_ipv4: {8, 8, 4, 4}
}

Gn Interface Parameters

ParameterTypeRequiredDefaultDescription
local_ipv4_addressStringYes-IPv4 address to bind for Gn interface. This is the GGSN address advertised to SGSNs.
local_ipv6_addressStringNonilOptional IPv6 address. Most 2G/3G networks are IPv4-only.
local_portIntegerNo2123UDP port for GTP-C. Standard port per 3GPP TS 29.060. Shared with S5/S8.

DNS Parameters

ParameterTypeRequiredDefaultDescription
primary_ipv4TupleNo{8, 8, 8, 8}Primary DNS server IPv4 address returned in PCO.
secondary_ipv4TupleNo{8, 8, 4, 4}Secondary DNS server IPv4 address returned in PCO.
primary_ipv6TupleNonilPrimary DNS server IPv6 address.
secondary_ipv6TupleNonilSecondary DNS server IPv6 address.

Network Requirements

Firewall Rules:

# Allow GTP-C from SGSN network
iptables -A INPUT -p udp --dport 2123 -s <sgsn_network>/24 -j ACCEPT

# Allow outbound GTP-C to SGSN
iptables -A OUTPUT -p udp --dport 2123 -d <sgsn_network>/24 -j ACCEPT

Message Types

PDP Context Management

Create PDP Context Request

Direction: SGSN → GGSN

Purpose: Establish a new PDP context for data connectivity

Key IEs (Information Elements):

IE NameTypeDescription
IMSIIdentityInternational Mobile Subscriber Identity
NSAPIIntegerNetwork Service Access Point Identifier (5-15)
TEID Data IIntegerSGSN's user plane tunnel endpoint
TEID ControlIntegerSGSN's control plane tunnel endpoint
End User AddressAddressRequested PDN type and optional IP
Access Point NameStringAPN for the connection
GSN Address (Signalling)IPSGSN signalling plane address
GSN Address (User)IPSGSN user plane address
QoS ProfileBinaryRequested QoS parameters
MSISDNIdentityMobile phone number (optional)
Selection ModeEnumAPN selection mode
Protocol Configuration OptionsOptionsAdditional protocol options

Example:

Create PDP Context Request
├── IMSI: 310260123456789
├── NSAPI: 5
├── TEID Data I: 0x12345678
├── TEID Control: 0x87654321
├── End User Address: IPv4 (dynamic)
├── APN: internet
├── GSN Address (Signalling): 10.1.1.100
├── GSN Address (User): 10.1.1.100
├── QoS Profile: [R99 QoS parameters]
└── PCO: [DNS request, etc.]

Create PDP Context Response

Direction: GGSN → SGSN

Purpose: Acknowledge PDP context creation with allocated resources

Key IEs:

IE NameTypeDescription
CauseResultSuccess or error code
Reordering RequiredBooleanWhether reordering is needed
RecoveryCounterGGSN restart counter
TEID Data IIntegerGGSN's user plane tunnel endpoint
TEID ControlIntegerGGSN's control plane tunnel endpoint
NSAPIIntegerConfirmed NSAPI
Charging IDBinaryCharging correlation ID
End User AddressAddressAllocated UE IP address
GSN Address (Signalling)IPGGSN signalling plane address
GSN Address (User)IPGGSN user plane address
QoS ProfileBinaryNegotiated QoS parameters
Protocol Configuration OptionsOptionsDNS servers, etc.

Success Response:

Create PDP Context Response
├── Cause: Request Accepted (128)
├── TEID Data I: 0xAABBCCDD
├── TEID Control: 0xDDCCBBAA
├── NSAPI: 5
├── Charging ID: 0x11223344
├── End User Address
│ └── IPv4: 100.64.1.42
├── GSN Address (Signalling): 10.0.0.20
├── GSN Address (User): 10.0.0.20
├── QoS Profile: [Negotiated QoS]
└── PCO
├── Primary DNS: 8.8.8.8
└── Secondary DNS: 8.8.4.4

Update PDP Context Request

Direction: SGSN → GGSN

Purpose: Modify an existing PDP context (e.g., SGSN relocation, QoS change)

Common scenarios:

  • Inter-SGSN handover (routing area update)
  • QoS renegotiation
  • SGSN address change

Key IEs:

IE NameDescription
NSAPIPDP context identifier
TEID Data INew SGSN user plane TEID
GSN AddressNew SGSN addresses
QoS ProfileUpdated QoS (optional)

Update PDP Context Response

Direction: GGSN → SGSN

Purpose: Acknowledge PDP context update

Key IEs:

IE NameDescription
CauseSuccess or error code
TEID Data IGGSN user plane TEID
GSN AddressGGSN addresses
QoS ProfileNegotiated QoS

Delete PDP Context Request

Direction: SGSN → GGSN

Purpose: Terminate a PDP context

Key IEs:

IE NameDescription
NSAPIPDP context to delete
Teardown IndDelete all contexts for this subscriber

Delete PDP Context Response

Direction: GGSN → SGSN

Purpose: Acknowledge PDP context deletion

Key IEs:

IE NameDescription
CauseSuccess or error code

Path Management

Echo Request / Response

Direction: Bidirectional

Purpose: Path keepalive and restart detection

Key IEs:

IE NameDescription
RecoveryRestart counter for detecting node restarts

Message Flows

PDP Context Activation

PDP Context Deactivation

Inter-SGSN Handover


Shared Infrastructure

OmniPGW's GGSN functionality shares infrastructure with PGW mode:

UE IP Address Allocation

Uses the same AddressRegistry and subnet configuration as PGW. See UE IP Allocation for configuration details.

UPF/PFCP Session Management

Uses the same PFCP session establishment as PGW:

  • PDR/FAR/QER rules created per PDP context
  • UPF selection via the same upf_selection configuration
  • See PFCP Interface for details

Online Charging (Gy)

Optional Diameter Gy integration available:

  • Credit control for prepaid subscribers
  • Same Gy configuration as PGW mode
  • See Diameter Gy Interface for configuration

CDR Generation

Uses the same CDR generation as PGW. See Data CDR Format for details.


Cause Codes

Success

CodeNameDescription
128Request AcceptedSuccessful operation

Rejection Causes

CodeNameWhen Used
192Non-existentPDP context not found
193Invalid message formatMalformed GTP message
194IMSI not knownSubscriber not found
195MS is GPRS DetachedMS not attached
196MS is not GPRS RespondingMS unreachable
197MS RefusesMS rejected request
198Version not supportedGTP version mismatch
199No resources availableResource exhaustion
200Service not supportedUnsupported service
201Mandatory IE incorrectIE validation failed
202Mandatory IE missingRequired IE absent
203Optional IE incorrectOptional IE invalid
204System failureInternal error
205Roaming restrictionRoaming not allowed
206P-TMSI Signature mismatchSecurity failure
207GPRS connection suspendedConnection suspended
208Authentication failureAuth failed
209User authentication failedUser auth failed

Monitoring

Gn Interface Metrics

# Message counters
gn_inbound_messages_total{message_type="create_pdp_context_request"}
gn_inbound_messages_total{message_type="update_pdp_context_request"}
gn_inbound_messages_total{message_type="delete_pdp_context_request"}

gn_outbound_messages_total{message_type="create_pdp_context_response"}
gn_outbound_messages_total{message_type="update_pdp_context_response"}
gn_outbound_messages_total{message_type="delete_pdp_context_response"}

# Transaction latency
gn_outbound_transaction_duration_bucket

Useful Queries

PDP Context Creation Rate:

rate(gn_inbound_messages_total{message_type="create_pdp_context_request"}[5m])

Success Rate:

sum(rate(gn_outbound_messages_total{message_type="create_pdp_context_response"}[5m]))
/ sum(rate(gn_inbound_messages_total{message_type="create_pdp_context_request"}[5m]))

Active PDP Contexts:

gn_inbound_messages_total{message_type="create_pdp_context_request"}
- gn_inbound_messages_total{message_type="delete_pdp_context_request"}

Troubleshooting

Issue: No Response to Create PDP Context

Symptoms:

  • SGSN sends Create PDP Context Request
  • No response received
  • Timeout at SGSN

Possible causes:

  1. Network connectivity issue
  2. OmniPGW not listening on configured IP
  3. Firewall blocking UDP 2123
  4. UPF/PFCP establishment failure

Debug:

# Check OmniPGW is listening
netstat -ulnp | grep 2123

# Check for incoming packets
tcpdump -i any -n port 2123

# Verify configuration
grep "local_ipv4_address" config/runtime.exs

# Check PFCP connectivity
curl http://pgw:9090/metrics | grep pfcp

Issue: PDP Context Creation Rejected

Symptoms:

  • Create PDP Context Response with error cause
  • PDP context not established

Common causes:

Cause 199 (No resources available):
→ IP pool exhausted
→ Check: curl http://pgw:9090/metrics | grep address_registry_count
→ Expand IP pool in ue.subnet_map

Cause 202 (Mandatory IE missing):
→ SGSN not sending required IEs
→ Check SGSN configuration
→ Review message in tcpdump

Cause 204 (System failure):
→ UPF/PFCP failure
→ Check PFCP association status
→ Review OmniPGW logs

Issue: Update PDP Context Fails

Symptoms:

  • Update PDP Context Response with error cause
  • Handover fails

Possible causes:

  • PDP context not found (different TEID)
  • NSAPI mismatch
  • Session already deleted

Debug:

# Check active sessions
curl http://pgw:9090/metrics | grep session_count

# Review logs for context lookup
journalctl -u omnipgw | grep "PDP Context"

Best Practices

Network Design

  1. Shared Port with S5/S8

    • Gn and S5/S8 share UDP port 2123
    • OmniPGW auto-detects GTP version from message
    • Single IP can serve both 2G/3G and 4G
  2. SGSN Connectivity

    • Ensure all SGSNs can reach GGSN IP
    • Consider dedicated VLAN for Gn traffic
    • Plan for roaming (Gp) if applicable
  3. IP Address Planning

    • Same IP pools serve both PGW and GGSN modes
    • Consider separate APN-based pools for 2G/3G

Performance

  1. Session Capacity

    • Monitor session_count metric
    • Plan for expected 2G/3G subscriber count
    • Consider that 2G/3G typically has fewer concurrent sessions
  2. UDP Buffer Sizes

    • Same recommendations as S5/S8
    • Typical: 4-8 MB per socket

Migration Considerations

When migrating from standalone GGSN to OmniPGW:

  1. APN Configuration

    • Ensure APNs match existing GGSN configuration
    • Verify DNS server settings in PCO
  2. IP Pool Migration

    • Plan IP pool cutover carefully
    • Consider gradual migration per APN
  3. QoS Mapping

    • R99 QoS profiles accepted as-is
    • No QCI translation needed for 2G/3G

Core Functions

Operations


References

  • 3GPP TS 29.060 - GPRS Tunnelling Protocol (GTP) across the Gn and Gp interface
  • 3GPP TS 23.060 - General Packet Radio Service (GPRS); Service description
  • 3GPP TS 24.008 - Mobile radio interface Layer 3 specification (QoS profiles)

Back to Documentation Index


OmniPGW Gn/Gp Interface - by Omnitouch Network Services