Skip to main content

Session Management Guide

PDN Connection Lifecycle and Operations

OmniPGW by Omnitouch Network Services


Overview

A PDN (Packet Data Network) Session represents a UE's data connection through OmniPGW. Each session coordinates multiple interfaces and resources to enable data connectivity.


Session Components

Session Identifiers

Each session has multiple identifiers for different interfaces:

IdentifierInterfacePurpose
TEIDS5/S8 (GTP-C)Tunnel Endpoint ID for SGW-C communication
SEIDSxb (PFCP)Session Endpoint ID for PGW-U communication
Session-IDGx (Diameter)Diameter session for PCRF communication
Charging-IDAccountingUnique ID for billing/charging

Session Data


Session Creation

Call Flow

Steps

1. Receive Create Session Request (S5/S8)

Session creation is initiated via GTP-C signaling on the S5/S8 interface. See S5/S8 Interface for complete GTP-C protocol details and message formats.

Input:

  • IMSI, MSISDN, IMEI
  • APN (e.g., "internet")
  • RAT Type (EUTRAN)
  • UE Location (TAI, ECGI)
  • Bearer Context (QoS, F-TEID)

2. Resource Allocation

- Allocate UE IP from APN pool
- Generate Charging ID
- Generate Gx Session-ID
- Allocate S5/S8 TEID
- Select PGW-U peer

3. Policy Request (Gx)

Request policy from PCRF:

  • Send CCR-Initial
  • Receive CCA-Initial with QoS and PCC rules

4. User Plane Setup (PFCP)

Program PGW-U with forwarding rules:

  • Send Session Establishment Request
  • Include PDRs, FARs, QERs, BAR
  • Receive F-TEID for S5/S8 tunnel

5. Response to SGW-C

Send Create Session Response:

  • UE IP Address
  • S5/S8 F-TEID (from PGW-U)
  • PCO (DNS, P-CSCF, MTU)
  • Bearer Context

Session Modification

Triggers

Sessions can be modified due to:

  • QoS Changes - PCRF updates bitrates
  • Bearer Operations - Add/remove dedicated bearers
  • Handover - SGW change
  • Policy Updates - New PCC rules from PCRF

QoS Modification Flow


Session Deletion

Call Flow

Cleanup Process

Resources Released:

  1. UE IP address → back to pool
  2. TEID → removed from registry
  3. SEID → removed from registry
  4. Session-ID → removed from registry
  5. Charging-ID → released
  6. Session process terminated

Billing Records Generated:

  • Final CDR (Charging Data Record) written for offline billing - See Data CDR Format

Session State

State Machine

Session Tracking

Registry Lookups:

By TEID (S5/S8):
TEID 0x12345678 → Session PID

By SEID (Sxb):
SEID 0xABCDEF → Session PID

By Session-ID (Gx):
"pgw.example.com;123;456" → Session PID

By UE IP:
100.64.1.42 → Session PID

By IMSI + EBI:
"310260123456789" + EBI 5 → Session PID

Monitoring Sessions

Active Session Count

# Total active sessions
teid_registry_count

# PFCP sessions
seid_registry_count

# Gx sessions
session_id_registry_count

Session Metrics

# Session creation rate
rate(s5s8_inbound_messages_total{message_type="create_session_request"}[5m])

# Session deletion rate
rate(s5s8_inbound_messages_total{message_type="delete_session_request"}[5m])

# Session creation latency (p95)
histogram_quantile(0.95,
rate(s5s8_inbound_handling_duration_bucket{request_message_type="create_session_request"}[5m])
)

Common Issues

Session Creation Fails

Causes:

  1. IP Pool Exhausted - No IPs available
  2. PCRF Unreachable - Gx timeout
  3. PGW-U Down - No PFCP peer available
  4. PCRF Rejection - User unknown, not authorized

Debug:

# Check IP pool
curl http://pgw:9090/metrics | grep address_registry_count

# Check PCRF connectivity
# Check for Gx errors in logs

# Check PGW-U association
# Verify PFCP peer status

Session Stuck/Stale

Symptoms:

  • Session not deleted properly
  • Resources not released
  • Registries show higher count than expected

Causes:

  1. Delete Session Request not received
  2. Session process crash without cleanup
  3. Registry leak

Resolution:

# Restart OmniPGW (releases all sessions)
# Implement session timeout mechanism

UE Cannot Establish Session

Symptoms:

  • UE attach fails
  • Create Session Response with error cause

Common Causes & Responses:

Cause ValueMeaningAction
User UnknownPCRF rejected (IMSI not in database)Provision subscriber
No Resources AvailableIP pool exhaustedExpand IP pool
Remote Peer Not RespondingPCRF/PGW-U timeoutCheck connectivity
Service Not SupportedInvalid APNConfigure APN pool

Best Practices

Session Limits

Configure appropriate capacity:

Expected concurrent users: 10,000
Session overhead per user: ~10KB RAM
Total RAM for sessions: ~100MB

Erlang VM settings:
- Max processes: 262,144 (default)
- Process heap size: Adjust based on load

Session Cleanup

Ensure proper cleanup:

  1. Always respond to Delete Session Requests
  2. Implement session timeout for stale sessions
  3. Monitor registry counts for leaks

High Availability

Session Redundancy:

  • Use stateless design (sessions tied to instance)
  • Implement session database for HA (future)
  • DNS/load balancer for failover

Session Data Elements

What Information Does a Session Store?

Each active PDN session maintains the following information:

UE Identification:

  • IMSI: "310260123456789" (subscriber identity)
  • MSISDN: "14155551234" (phone number)
  • MEI/IMEI: Device identifier

PDN Connection Details:

  • APN: "internet" (network name)
  • UE IP Address: 100.64.1.42 (allocated IP)
  • PDN Type: IPv4, IPv6, or IPv4v6

Session Identifiers:

  • Charging ID: Unique billing identifier
  • Default Bearer EBI: EPS Bearer Identifier (typically 5)

QoS Parameters:

  • APN-AMBR: Aggregate Maximum Bit Rate
    • Uplink: 100 Mbps
    • Downlink: 50 Mbps

Forwarding Rules:

  • PDRs (Packet Detection Rules): Match packets
  • FARs (Forwarding Action Rules): Forward/drop actions
  • QERs (QoS Enforcement Rules): Rate limiting
  • BAR (Buffering Action Rule): Downlink buffering

Interface Context:

  • S5/S8 State: Local/remote TEIDs, SGW-C address
  • Sxb State: Local/remote SEIDs, PGW-U address
  • Gx State: Diameter Session-ID, request counter

Web UI - Live Session Monitoring

OmniPGW includes a real-time Web UI for monitoring active sessions without needing to query metrics or logs.

UE Search & Deep Dive

Access: http://<omnipgw-ip>:<web-port>/ue_search

UE Search Interface

Purpose: Search for specific UE sessions and view detailed information

Features:

1. Search Functionality Search sessions by:

  • IMSI (e.g., "310170123456789")
  • MSISDN (phone number)
  • IP Address (e.g., "100.64.1.42")

2. Search Options

  • Dropdown selector to choose search type
  • Real-time search with instant results
  • Clear interface with search hints

3. Deep Dive Results Once found, displays comprehensive session information:

a) Active Sessions

  • All active sessions for this subscriber
  • IMSI, MSISDN, UE IP Address
  • APN, RAT Type
  • PGW TEID, SGW TEID

b) Current Location Real-time location data from the session:

  • TAC (Tracking Area Code) - Tracking area where UE is located
  • Cell ID (ECI) - E-UTRAN Cell Identifier
  • ECGI - E-UTRAN Cell Global Identifier (PLMN + ECI)
  • MCC/MNC - Mobile Country Code / Mobile Network Code

Cell Tower Database Integration: If the OpenCellID database is configured, the interface displays:

  • Cell tower geographic coordinates (latitude/longitude)
  • Embedded Google Maps showing exact tower location
  • Visual map of UE's last known cell site

See Cell Tower Database Setup below for configuration instructions.

c) Bearer Information Detailed bearer listing with QoS parameters:

Default Bearer:

  • EBI (EPS Bearer Identifier)
  • QCI (QoS Class Identifier)
  • Charging Rule Name
  • APN-AMBR (uplink/downlink)

Dedicated Bearers (if active):

  • EBI, QCI, Charging Rule Name
  • MBR UL/DL (Maximum Bit Rate)
  • GBR UL/DL (Guaranteed Bit Rate)

d) Charging Information (Gy Interface)

  • Gy Session ID
  • Granted Quota, Used Quota
  • Charging Characteristics

e) Policy Information (Gx Interface)

  • Gx Session ID
  • PCRF Origin/Destination Host
  • CC Request Number
  • Installed Charging Rules (PCC rules from bearers)

f) Recent Events

  • Event history for this subscriber
  • Session create/update/delete events

UE Search Bearer Details

Use Cases:

  • Troubleshoot specific subscriber issues
  • Verify session establishment
  • Check assigned IP address
  • Inspect session parameters

PGW Sessions Page

Access: http://<omnipgw-ip>:<web-port>/pgw_sessions

PGW Sessions List

Purpose: Real-time view of all active PDN sessions

Features:

1. Session Overview

  • Live session count (updates every 2 seconds)
  • Grid view of all active sessions
  • No refresh needed - auto-updates

2. Quick Session Information Visible for each session:

  • IMSI - Subscriber identity
  • UE IP - Allocated IP address
  • SGW TEID - S5/S8 tunnel ID from SGW
  • PGW TEID - S5/S8 tunnel ID from OmniPGW
  • APN - Access Point Name

3. Search Functionality Search sessions by:

  • IMSI (e.g., "310260")
  • UE IP address (e.g., "100.64")
  • MSISDN / phone number
  • APN name

4. Expandable Details Click any session row to see complete details:

  • Full subscriber information (IMSI, MSISDN, IMEI)
  • Network context (RAT type, serving network MCC/MNC)
  • QoS parameters (AMBR uplink/downlink in human-readable format)
  • Tunnel identifiers (both TEIDs in hex format)
  • Process ID for debugging
  • Complete session state (raw data structure)

Session Details

Network Topology View

Access: http://<omnipgw-ip>:<web-port>/topology

Network Topology

Purpose: Visual representation of network connections and active sessions

Features:

1. Topology Visualization

  • Visual graph of network elements
  • Shows PGW-C (Control Plane) node
  • Connected HSS (Home Subscriber Server) peers
  • Active session count display

2. Interactive Elements

  • Zoom controls (+/-)
  • Center view button
  • Click nodes for details
  • Shows connection status (green = active, red = down)

3. Session Count

  • Real-time active session counter
  • Updates automatically
  • Visual indication of load

Use Cases:

  • Understand network architecture at a glance
  • Verify peer connections
  • Monitor topology changes
  • Quick network health check

Session History & Audit Log

Access: http://<omnipgw-ip>:<web-port>/session_history

Session History

Purpose: Track historical session events and audit trail

Features:

1. Event Filtering

  • Filter by event type (All Events, Session Created, Session Deleted, etc.)
  • Date range selection (From Date / To Date)
  • Search by IMSI, MSISDN, IP address, or TEID

2. Export Functionality

  • Export to CSV for analysis
  • Includes all filtered results
  • Useful for compliance and reporting

3. Event Types Tracked

  • Session creation events
  • Session deletion events
  • Modification events
  • Error events

Use Cases:

  • Audit trail for compliance
  • Historical session analysis
  • Troubleshoot past issues
  • Generate usage reports
  • Track session patterns over time

Operational Use Cases

Session Verification:

1. User reports connectivity issue
2. Search Web UI by IMSI or phone number
3. Verify session exists and UE has IP address
4. Check QoS values match subscriber plan
5. Verify tunnel endpoints are established

Capacity Monitoring:

  • Glance at active session count
  • Compare against licensed capacity
  • Identify usage patterns by APN

Troubleshooting:

  • Find specific session by any identifier
  • Inspect full session state without SSH/IEx
  • Verify SGW and PGW TEIDs match between systems
  • Check AMBR values applied from PCRF

Advantages Over Metrics:

  • See individual session details (metrics show aggregates)
  • Search and filter capabilities
  • Human-readable formatting (bandwidth in Mbps, not bps)
  • Real-time state inspection
  • No command-line access required

Cell Tower Database Setup

OmniPGW can integrate with the OpenCellID database to display cell tower locations in the UE Search interface. This feature enables geographic visualization of where subscribers are located based on their serving cell site.

Overview

When configured, the UE Search interface will:

  • Display cell tower coordinates (latitude/longitude)
  • Show an embedded Google Maps view of the tower location
  • Provide visual confirmation of subscriber location
  • Help troubleshoot location-based routing issues

Setup

Access the Cell Towers page at http://<omnipgw-ip>:<web-port>/cell_towers and click the "Redownload Database" button. This triggers an automatic background download and import process.

Features:

  • Downloads fresh data from OpenCellID.org
  • Automatically extracts and imports into SQLite
  • Runs in the background (takes 10-15 minutes)
  • Shows progress notifications via web interface
  • Safe: only deletes old database after confirming new download succeeds

First-Time Setup: When you first access the Cell Towers page, it will show setup instructions with the "Redownload Database" button. Simply click it to initialize the database.

Database Information

Database Location:

  • SQLite DB: priv/cell_towers.db
  • CSV Download (temporary): priv/data/cell_towers.csv.gz
  • Indexes: Automatically created on MCC, MNC, LAC, CellID for fast lookups

Database Size:

  • ~107 MB compressed download from OpenCellID.org
  • Import time: 10-15 minutes depending on hardware

Lookup Performance:

  • Cell tower lookups are indexed and very fast (<1ms)
  • No performance impact on session establishment
  • Lookups happen only when viewing UE Search results

Features Enabled

After setup, the following features become available:

UE Search Page:

  • Current Location section shows cell tower coordinates
  • Embedded Google Maps displaying tower location
  • Visual representation of subscriber's last known cell site

Cell Towers Web UI:

  • View database statistics (total records, database size, created date)
  • Redownload Database button - One-click update to latest OpenCellID data
  • Browse the cell tower database
  • Search by MCC, MNC, LAC, Cell ID
  • View geographic distribution of towers
  • See setup instructions if database not yet configured

Operational Benefits:

  • Quickly identify subscriber geographic location
  • Verify roaming scenarios
  • Troubleshoot location-based issues
  • Support emergency services location requirements

Updating the Database

The OpenCellID database is community-maintained and updated regularly.

To refresh your local database:

  1. Navigate to http://<omnipgw-ip>:<web-port>/cell_towers
  2. Click the "Redownload Database" button
  3. Confirm the action in the popup dialog
  4. Wait 10-15 minutes for background download/import to complete
  5. Refresh the page to see updated statistics

Recommended Update Frequency: Monthly or quarterly

Note: OpenCellID may rate-limit downloads. If you've downloaded recently, wait a few hours before trying again.

Troubleshooting

Redownload Fails:

  • Check internet connectivity to OpenCellID.org
  • Verify firewall allows HTTPS downloads
  • Check disk space (~200 MB free space required)
  • Check application logs for specific error messages
  • OpenCellID may be rate-limiting - wait a few hours and try again
  • Check that the web UI shows the error message from the background task

Database Write Errors:

  • Check database write permissions in priv/ directory
  • Ensure sufficient disk space (~150 MB for database)
  • Verify the application has permission to create/delete files in priv/

Cell Tower Not Found:

  • Database may not have coverage for all cell sites
  • OpenCellID is community-contributed and may have gaps
  • Cell tower data may be outdated for newly deployed sites

Map Not Displaying:

  • Check browser JavaScript console for errors
  • Verify Google Maps embed permissions
  • Check if cell tower coordinates are valid

Core Session Functions

Policy and Charging

Network Interfaces

Operations


Back to Operations Guide


OmniPGW Session Management - by Omnitouch Network Services