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)
| Aspect | GGSN (Gn/Gp) | PGW (S5/S8) |
|---|---|---|
| Protocol Version | GTP-C v1 | GTP-C v2 |
| 3GPP Specification | TS 29.060 | TS 29.274 |
| Session Concept | PDP Context | PDN Session + Bearers |
| Bearer Identifier | NSAPI (0-15) | EBI (5-15) |
| Policy Interface | None (static policy) | Gx (PCRF) |
| QoS Model | R99 QoS Profile | EPS Bearer QoS (QCI) |
| Port | 2123 (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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
local_ipv4_address | String | Yes | - | IPv4 address to bind for Gn interface. This is the GGSN address advertised to SGSNs. |
local_ipv6_address | String | No | nil | Optional IPv6 address. Most 2G/3G networks are IPv4-only. |
local_port | Integer | No | 2123 | UDP port for GTP-C. Standard port per 3GPP TS 29.060. Shared with S5/S8. |
DNS Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
primary_ipv4 | Tuple | No | {8, 8, 8, 8} | Primary DNS server IPv4 address returned in PCO. |
secondary_ipv4 | Tuple | No | {8, 8, 4, 4} | Secondary DNS server IPv4 address returned in PCO. |
primary_ipv6 | Tuple | No | nil | Primary DNS server IPv6 address. |
secondary_ipv6 | Tuple | No | nil | Secondary 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 Name | Type | Description |
|---|---|---|
| IMSI | Identity | International Mobile Subscriber Identity |
| NSAPI | Integer | Network Service Access Point Identifier (5-15) |
| TEID Data I | Integer | SGSN's user plane tunnel endpoint |
| TEID Control | Integer | SGSN's control plane tunnel endpoint |
| End User Address | Address | Requested PDN type and optional IP |
| Access Point Name | String | APN for the connection |
| GSN Address (Signalling) | IP | SGSN signalling plane address |
| GSN Address (User) | IP | SGSN user plane address |
| QoS Profile | Binary | Requested QoS parameters |
| MSISDN | Identity | Mobile phone number (optional) |
| Selection Mode | Enum | APN selection mode |
| Protocol Configuration Options | Options | Additional 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 Name | Type | Description |
|---|---|---|
| Cause | Result | Success or error code |
| Reordering Required | Boolean | Whether reordering is needed |
| Recovery | Counter | GGSN restart counter |
| TEID Data I | Integer | GGSN's user plane tunnel endpoint |
| TEID Control | Integer | GGSN's control plane tunnel endpoint |
| NSAPI | Integer | Confirmed NSAPI |
| Charging ID | Binary | Charging correlation ID |
| End User Address | Address | Allocated UE IP address |
| GSN Address (Signalling) | IP | GGSN signalling plane address |
| GSN Address (User) | IP | GGSN user plane address |
| QoS Profile | Binary | Negotiated QoS parameters |
| Protocol Configuration Options | Options | DNS 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 Name | Description |
|---|---|
| NSAPI | PDP context identifier |
| TEID Data I | New SGSN user plane TEID |
| GSN Address | New SGSN addresses |
| QoS Profile | Updated QoS (optional) |
Update PDP Context Response
Direction: GGSN → SGSN
Purpose: Acknowledge PDP context update
Key IEs:
| IE Name | Description |
|---|---|
| Cause | Success or error code |
| TEID Data I | GGSN user plane TEID |
| GSN Address | GGSN addresses |
| QoS Profile | Negotiated QoS |
Delete PDP Context Request
Direction: SGSN → GGSN
Purpose: Terminate a PDP context
Key IEs:
| IE Name | Description |
|---|---|
| NSAPI | PDP context to delete |
| Teardown Ind | Delete all contexts for this subscriber |
Delete PDP Context Response
Direction: GGSN → SGSN
Purpose: Acknowledge PDP context deletion
Key IEs:
| IE Name | Description |
|---|---|
| Cause | Success or error code |
Path Management
Echo Request / Response
Direction: Bidirectional
Purpose: Path keepalive and restart detection
Key IEs:
| IE Name | Description |
|---|---|
| Recovery | Restart 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
| Code | Name | Description |
|---|---|---|
| 128 | Request Accepted | Successful operation |
Rejection Causes
| Code | Name | When Used |
|---|---|---|
| 192 | Non-existent | PDP context not found |
| 193 | Invalid message format | Malformed GTP message |
| 194 | IMSI not known | Subscriber not found |
| 195 | MS is GPRS Detached | MS not attached |
| 196 | MS is not GPRS Responding | MS unreachable |
| 197 | MS Refuses | MS rejected request |
| 198 | Version not supported | GTP version mismatch |
| 199 | No resources available | Resource exhaustion |
| 200 | Service not supported | Unsupported service |
| 201 | Mandatory IE incorrect | IE validation failed |
| 202 | Mandatory IE missing | Required IE absent |
| 203 | Optional IE incorrect | Optional IE invalid |
| 204 | System failure | Internal error |
| 205 | Roaming restriction | Roaming not allowed |
| 206 | P-TMSI Signature mismatch | Security failure |
| 207 | GPRS connection suspended | Connection suspended |
| 208 | Authentication failure | Auth failed |
| 209 | User authentication failed | User 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:
- Network connectivity issue
- OmniPGW not listening on configured IP
- Firewall blocking UDP 2123
- 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
-
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
-
SGSN Connectivity
- Ensure all SGSNs can reach GGSN IP
- Consider dedicated VLAN for Gn traffic
- Plan for roaming (Gp) if applicable
-
IP Address Planning
- Same IP pools serve both PGW and GGSN modes
- Consider separate APN-based pools for 2G/3G
Performance
-
Session Capacity
- Monitor
session_countmetric - Plan for expected 2G/3G subscriber count
- Consider that 2G/3G typically has fewer concurrent sessions
- Monitor
-
UDP Buffer Sizes
- Same recommendations as S5/S8
- Typical: 4-8 MB per socket
Migration Considerations
When migrating from standalone GGSN to OmniPGW:
-
APN Configuration
- Ensure APNs match existing GGSN configuration
- Verify DNS server settings in PCO
-
IP Pool Migration
- Plan IP pool cutover carefully
- Consider gradual migration per APN
-
QoS Mapping
- R99 QoS profiles accepted as-is
- No QCI translation needed for 2G/3G
Related Documentation
Core Functions
- Configuration Guide - Complete configuration reference
- Session Management - Session lifecycle details
- UE IP Allocation - IP address management
- PCO Configuration - Protocol Configuration Options
Related Interfaces
- S5/S8 Interface - 4G/LTE equivalent interface
- PFCP Interface - User plane coordination
- Diameter Gy Interface - Online charging
Operations
- Monitoring Guide - Metrics and alerting
- Troubleshooting - Common issues
- Data CDR Format - CDR generation
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)
OmniPGW Gn/Gp Interface - by Omnitouch Network Services