Skip to main content

S5/S8 Interface Documentation

GTP-C Communication with PGW-C

OmniSGW by Omnitouch Network Services


Table of Contents

  1. Overview
  2. Protocol Details
  3. Configuration
  4. Session Establishment
  5. Session Modification
  6. Session Termination
  7. Message Types
  8. Network Operations
  9. Troubleshooting

Overview

The S5/S8 interface connects OmniSGW to the PGW-C (Packet Gateway Control Plane) using the GTP-C v2 (GPRS Tunnelling Protocol - Control plane) protocol. This interface handles PDN session management signaling between the gateways.

Key Features

  • GTP-C v2 Protocol - Standards-compliant signaling
  • TEID-based Session Routing - Tunnel endpoint identifiers for tracking
  • PDN Connectivity Management - Create/modify/delete PDN connections
  • Bearer Management - Default and dedicated bearer operations
  • Charging ID Exchange - Coordinated billing across gateways
  • IP Address Allocation - UE IP provisioning from PGW pools

Protocol Details

GTP-C Version 2

  • Protocol: GTP-C v2 (3GPP TS 29.274)
  • Transport: UDP
  • Port: 2123 (standard)
  • Interface Type: Control Plane
  • Direction: Bidirectional request/response

TEID (Tunnel Endpoint Identifier)

Each PDN session has unique TEIDs for both directions:

  • SGW TEID - Allocated by SGW-C for S5/S8 messages from PGW
  • PGW TEID - Allocated by PGW-C for S5/S8 messages from SGW
Message Flow:
SGW-C → PGW-C: Uses PGW-C's TEID in header
PGW-C → SGW-C: Uses SGW-C's TEID in header

Charging ID

Charging ID is critical for billing coordination:

  • Generated by: PGW-C during Create Session Response
  • Passed to: SGW-C for CDR generation
  • Used for: Correlating offline charges between SGW and PGW CDRs
  • Format: 32-bit integer, unique per PDN connection

Configuration

Basic Configuration

# config/runtime.exs
config :sgw_c,
s5s8: %{
# Local IPv4 address for S5/S8 interface
local_ipv4_address: "10.0.0.15",

# Optional: Local IPv6 address
local_ipv6_address: nil,

# Optional: Override default port
local_port: 2123,

# PGW-C peers
pgw_peers: [
%{
ip_address: "10.0.0.20",
name: "pgw-c-primary"
},
%{
ip_address: "10.0.0.21",
name: "pgw-c-secondary"
}
],

# Message timeouts
message_timeout_ms: 5000,
max_retries: 3,
retry_backoff_ms: 1000
}

Network Requirements

Firewall Rules:

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

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

Routing:

# Ensure route to PGW-C network
ip route add <pgw_network>/24 via <gateway_ip> dev eth0

Session Establishment

Initial PDN Connection Request

When MME requests a PDN connection via S11, SGW-C forwards to PGW-C via S5/S8.

Create Session Request (SGW-C → PGW-C)

Key Information Elements:

IE NameSourceDescription
IMSIMMEMobile subscriber identity
MSISDNMMEMobile phone number
MEIMMEMobile Equipment Identity
Bearer ContextMMEBearer configuration (QCI, ARP)
APNMMEAccess Point Name (internet, ims, mms)
Serving NetworkMMEPLMN code (MCC/MNC)
RAT TypeMMERadio Access Technology (EUTRAN)
ULIMMEUser Location Information (TAI, ECGI)
Charging IDSGWSGW-generated charging reference

Create Session Response (PGW-C → SGW-C)

Key Information Elements:

IE NameSourceDescription
CausePGWSuccess/failure indication
Bearer ContextPGWAllocated bearer with TEID
PDN Address AllocationPGWAssigned UE IP address
APN RestrictionPGWPolicies for this APN
Charging IDPGWPGW-generated charging ID
TEIDPGWAllocated for S5/S8 tunnel

Response Codes

Cause CodeDescriptionRecovery
0Request AcceptedSession established
16No resources availableReject to MME, user action
25Semantics error in IECheck message formatting
49No matching rulePGW-C policy mismatch
64Context not foundSession already exists
65Semantic error in responsePGW misconfiguration
72Missing/incorrect mandatory IEMessage incomplete

Session Modification

Bearer QoS Modification

When MME requests QoS changes via S11, SGW-C propagates to PGW-C via S5/S8.

Bearer Creation (Dedicated Bearer)

PGW-C can request dedicated bearer activation via S5/S8:

Bearer Deletion (Dedicated Bearer)

When a dedicated bearer is no longer needed:


Session Termination

Normal PDN Disconnection

State Transitions:

[PDN Connected]
↓ (Delete Session Request from MME)
[Releasing PGW Session]
↓ (PGW Delete Response received)
[Releasing SGW Resources]
↓ (TEID released, CDR logged)
[PDN Disconnected]

Message Types

Summary of S5/S8 Messages

Message Details

Create Session Request/Response

  • Triggers: Initial attach, PDN connectivity request
  • Frequency: ~1 per PDN connection per UE
  • Direction: Bidirectional

Delete Session Request/Response

  • Triggers: Detach, PDN disconnection
  • Frequency: ~1 per PDN connection termination
  • Direction: Bidirectional

Modify Bearer Request/Response

  • Triggers: QoS change, bearer modification
  • Frequency: Variable (0 to many per session)
  • Direction: Bidirectional

Create/Delete Bearer Request/Response

  • Triggers: Dedicated bearer activation/deactivation
  • Frequency: Variable (0 to many per session)
  • Direction: Bidirectional

Echo Request/Response

  • Triggers: Path/peer monitoring
  • Frequency: Periodic (recommended 1/minute minimum)
  • Direction: Bidirectional

Network Operations

Peer Monitoring

Monitor PGW-C connectivity:

# Check active S5/S8 TEIDs
curl -s http://127.0.0.40:42068/metrics | grep s5s8_teid

# Monitor S5/S8 message flow
curl -s http://127.0.0.40:42068/metrics | grep s5s8_inbound_messages_total

# Expected: steady stream of Create/Delete/Modify messages

PDN Session Verification

Inspect active PDN connections:

Web UI → UE Sessions page
└── For each UE session:
├── Associated PGW-C peer
├── Charging ID (from PGW)
├── UE IP address (from PGW)
├── Bearer list with QoS
└── S5/S8 TEID pair

Message Flow Inspection

Track S5/S8 message activity:

# Count Create Session operations
curl -s http://127.0.0.40:42068/metrics | grep create_session_request_total

# Monitor bearer modifications
curl -s http://127.0.0.40:42068/metrics | grep modify_bearer

# Check error rate
curl -s http://127.0.0.40:42068/metrics | grep s5s8_inbound_errors_total

PGW Selection Strategy

If multiple PGW-C peers configured:

Selection Logic:
├── Load-balanced: Round-robin across peers
├── Sticky: Same APN always uses same PGW
├── Active-Standby: Failover on peer unavailable
└── Custom: Application-specific logic

Monitor distribution:

# Sessions per PGW peer
curl -s http://127.0.0.40:42068/metrics | grep session_by_pgw_peer

Troubleshooting

Session Establishment Failures

Problem: "Create Session Request rejected by PGW"

Diagnosis:

# Check cause code
curl -s http://127.0.0.40:42068/metrics | grep create_session_response_cause

# Check PGW connectivity
curl -s http://127.0.0.40:42068/metrics | grep s5s8_peer_status

Common Causes & Solutions:

CauseReasonSolution
16No resourcesCheck PGW capacity, IP pool exhaustion
25Semantic errorVerify bearer context matches PGW expectations
49No matching ruleCheck APN configuration at PGW
72Missing IEVerify MME is sending required fields

Bearer Operation Failures

Problem: "Modify Bearer Request fails"

Diagnosis:

  1. Check metrics for modify_bearer error rate
  2. Inspect QoS parameters for validity
  3. Verify PGW is reachable

Solutions:

  • Reduce QoS modification frequency
  • Verify QoS values within PGW policy
  • Check PGW for PCRF/policy issues

Message Timeout Issues

Problem: "S5/S8 messages timing out"

Metrics:

# Message latency
curl -s http://127.0.0.40:42068/metrics | grep s5s8_inbound_duration_seconds

# Timeout count
curl -s http://127.0.0.40:42068/metrics | grep s5s8_timeout_total

Solutions:

  • Increase message_timeout_ms if network RTT is high
  • Check network congestion
  • Verify PGW CPU/memory availability
  • Monitor for packet loss

Charging ID Mismatch

Problem: "Charging ID mismatch in CDRs"

Diagnosis:

  • Verify PGW is returning valid Charging ID
  • Check CDR logs for missing Charging ID
  • Compare SGW and PGW CDRs

Solution:

  • Ensure PGW sends Charging ID in all responses
  • Handle missing Charging ID gracefully in CDR logging

For detailed metrics reference and Prometheus dashboard setup, see the Monitoring & Metrics Guide.


Best Practices

Configuration

  • PGW Redundancy: Configure multiple PGW-C peers for failover
  • Load Distribution: Use round-robin for balanced load
  • Timeouts: Set appropriately based on WAN RTT (typical: 5-10 seconds)
  • Retries: 2-3 retries with exponential backoff

Operations

  • Peer Health: Monitor echo response times
  • APN Routing: Match SGW APN config to PGW APNs
  • Error Tracking: Alert on sustained S5/S8 error rate
  • Capacity Planning: Monitor IP pool usage at PGW

Session Management

  • Session Limits: Track concurrent sessions vs. PGW capacity
  • Bearer Count: Monitor default + dedicated bearer distribution
  • QoS Validation: Verify QoS parameters accepted by PGW
  • Charging: Verify Charging ID received and logged

Integration with Other Interfaces

S11 ↔ S5/S8 Coordination

S11 Message Flow (from MME)

SGW-C Session Processing

S5/S8 Message (to PGW-C)

Wait for Response

S11 Response (back to MME)

S5/S8 ↔ Sxa Coordination

S5/S8 Create Session Response (from PGW)

Extract Bearer/QoS Info

Sxa Session Establishment (to SGW-U)

Wait for User Plane Ready

Complete S11 Create Session Response