Skip to content

Repository files navigation

VectorCore SGW

VectorCore SGW is an LTE Serving Gateway implementation with separate SGW-C and SGW-U processes. It follows a CUPS design: SGW-C handles GTPv2-C and PFCP control-plane procedures, while SGW-U handles GTP-U forwarding with an eBPF dataplane.

Components

  • sgw-c: SGW Control Plane
  • sgw-u: SGW User Plane
  • sgwctl: configuration validation and runtime inspection tool

Current Feature Set

  • CUPS split between SGW-C and SGW-U.
  • S11 GTPv2-C toward the MME.
  • S5/S8-C GTPv2-C toward the PGW.
  • Sxa PFCP between SGW-C and SGW-U.
  • S1-U and S5/S8-U GTP-U forwarding on SGW-U.
  • eBPF/XDP dataplane for GTP-U TEID match, rewrite, redirect, punt, and drop.
  • PFCP-driven PDR/FAR installation and removal on SGW-U.
  • Default bearer Create Session, Modify Bearer, Delete Session, and Release Access Bearers handling.
  • PGW-initiated Create Bearer handling for dedicated bearers.
  • Piggybacked GTPv2-C message handling.
  • Multi-PDN and multi-UE bearer ownership isolation by S11 context and EBI.
  • GTPv2-C retransmission response caching.
  • GTPv2-C transaction collision handling with configurable strict/permissive policy.
  • Dynamic GTPv2-C Echo probing and peer health tracking for observed MME and PGW peers, including RTT, missed Echo counters, Recovery IE restart tracking, API visibility, Prometheus metrics, and down-peer procedure warnings.
  • PGW restart and S5/S8-C path-failure manager with PGW-to-session indexing, affected-session marking, API visibility, Prometheus metrics, and configurable warning/blocking policy for procedures toward a down PGW.
  • MME restoration and Network Triggered Service Restoration handling with MME path/restart tracking, APN/QCI/ARP preserve/delete policy, optional delete-policy cleanup, DDN triggering, DDN Ack/Failure handling, Modify Bearer completion, API visibility, and Prometheus metrics.
  • Downlink Data Notification throttling and priority paging controls with per-MME token buckets, per-UE suppression, high-priority IMS/QCI/ARP bypass, MME low-priority throttling enforcement, bounded delayed DDN queue, optional Stop Paging after DDN Ack, API visibility, and Prometheus metrics.
  • Static outer IP DSCP marking for SGW-C GTP-C, SGW-C PFCP, SGW-U PFCP, and SGW-U forwarded GTP-U.
  • QCI-aware GTP-U outer DSCP marking in SGW-U using operator-configured QCI-to-DSCP mappings.
  • 3GPP Release 15 NSA/DCNR awareness for GTPv2-C Secondary RAT Usage Data Report IE capture, owner-scoped session storage, S5/S8-C forwarding, API visibility, and Prometheus counters.
  • Recovery counter support.
  • JSON API listeners for SGW-C and SGW-U runtime state.
  • Prometheus metrics listeners.
  • YAML configuration with strict unknown-field rejection.

Build Requirements

  • Linux.
  • Go 1.26.2 or newer compatible Go toolchain.
  • make.
  • clang and libbpf development headers for eBPF object generation.
  • Kernel/eBPF support for XDP attachment.
  • Runtime privileges for SGW-U to attach eBPF programs to network interfaces.

The eBPF bindings are generated with github.com/cilium/ebpf/cmd/bpf2go through go generate.

Build

make clean
make

This builds:

bin/sgw-c
bin/sgw-u
bin/sgwctl

Useful targets:

make test
make vet
make verify
make install
make uninstall

Default install paths:

/opt/vectorcore/bin/sgw-c
/opt/vectorcore/bin/sgw-u
/opt/vectorcore/bin/sgwctl
/opt/vectorcore/etc/sgw-c.yaml
/opt/vectorcore/etc/sgw-u.yaml

Run

Validate configuration:

./bin/sgw-c -c configs/sgw-c.yaml -validate
./bin/sgw-u -c configs/sgw-u.yaml -validate
./bin/sgwctl validate -sgwc configs/sgw-c.yaml -sgwu configs/sgw-u.yaml

Start SGW-U:

./bin/sgw-u -d -c configs/sgw-u.yaml

Start SGW-C:

./bin/sgw-c -d -c configs/sgw-c.yaml

Start SGW-U before SGW-C so the PFCP peer is available when SGW-C starts.

CLI Flags

sgw-c:

-c string path to SGW-C YAML config
default: /etc/vectorcore/sgw/sgw-c.yaml
-d enable debug console logging
-validate load and validate config, then exit
-v print version and exit

sgw-u:

-c string path to SGW-U YAML config
default: /etc/vectorcore/sgw/sgw-u.yaml
-d enable debug console logging
-validate load and validate config, then exit
-v print version and exit

sgwctl:

validate validate SGW-C and/or SGW-U config files
dry-run alias for validate
health show SGW-C health
sessions list SGW-C sessions
bearers list SGW-C sessions with bearer details
pfcp show SGW-C and SGW-U PFCP association status
gtpc-peers show SGW-C GTP-C peer health
pgw-failures show SGW-C PGW path and restart state
recovery show SGW-C checkpoint and recovery status
bearer-inactivity show SGW-C bearer inactivity cleanup status
idle-downlink show SGW-C idle downlink status and SGW-U GTP-U counters
bpf show SGW-U BPF map state

Validation example:

./bin/sgwctl validate -sgwc configs/sgw-c.yaml -sgwu configs/sgw-u.yaml

SGW-C Configuration

Default file: configs/sgw-c.yaml

Configuration layout and migration

The canonical SGW-C schema separates transport from optional behavior:

  • gtpc: contains S11/S5-C bindings, S11 retransmission timers, transaction handling, and GTP peer health.
  • pfcp: contains the local endpoint, heartbeat settings, and SGW-U peers.
  • features: contains NSA/DCNR, PGW failure handling, MME restoration, DDN control, idle-downlink notification, session recovery, and bearer-inactivity cleanup.
  • qos:, logging:, api:, metrics:, and shutdown: remain independent top-level concerns.

This is a backward-incompatible schema change. Parsing is strict: the former top-level s11: block, feature blocks under gtpc:, flat feature settings, and policy reason: fields are rejected. Validate migrated files with sgw-c -validate or sgwctl validate before deployment.

Old:

gtpc:
mme_restoration:
preserve:
- apn: "ims"reason: "preserve IMS PDN for network triggered service restoration"s11:
t3_response_seconds: 3n3_requests: 5

New:

gtpc:
s11:
bind: "sgwinterface"timers:
t3_response_seconds: 3n3_requests: 5features:
mme_restoration:
policy:
preserve:
# Preserve IMS PDNs for network-triggered service restoration.# Generated reason: mme-restoration-preserve-apn-ims
- apn: "ims"

Policy reasons are generated internally; operators should put human rationale in YAML comments. Codes use <feature>-<action>-<matchers> with matcher fields ordered as APN, QCI, ARP range, bearer type, and idle timeout. Values are lowercased and sanitized. Examples include ddn-high-priority-apn-ims, mme-restoration-delete-apn-internet-qci-9, and bearer-inactivity-cleanup-dedicated-idle-300. Generated codes continue to appear in logs, APIs, session state, and recovery checkpoints. Procedural reasons such as per-mme-rate-limit remain unchanged.

Top-level sections:

sgwc:
node_id: "sgw-c-1"plmn:
mcc: "311"mnc: "435"state_dir: "/var/lib/vectorcore-sgw"control_plane_ip: "10.90.250.59"interfaces:
control:
sgwinterface:
listen: "10.90.250.59:2123"gtpc:
s11:
bind: "sgwinterface"timers:
t3_response_seconds: 3n3_requests: 5s5c:
bind: "sgwinterface"transactions:
create_bearer_retry_guard:
enabled: truecollision_handling:
mode: "strict"active_procedure_timeout_seconds: 120peer_health:
enabled: truetimers:
echo_interval_seconds: 30echo_timeout_seconds: 3thresholds:
suspect_after_missed: 2down_after_missed: 3degraded_rtt_ms: 500probe:
mme: truepgw: truewarn_on_down_peer_procedure: truepfcp:
local_addr: "127.0.0.1:8805"heartbeat:
interval_seconds: 10timeout_seconds: 30sgwu:
- name: "sgw-u-1"node_id: "sgw-u-1"addr: "127.0.0.2:8805"features:
nsa_dcnr:
enabled: trueforward_secondary_rat_usage_reports: truepgw_failure_handling:
enabled: truedetection:
mark_sessions_on_path_down: truemark_sessions_on_restart: trueactions:
block_new_procedures_to_down_pgw: falsenotify_mme_on_pgw_restart: falsemme_restoration:
enabled: truedetection:
mark_sessions_on_path_down: truemark_sessions_on_restart: trueactions:
enforce_delete_policy: truetrigger_ddn: truecleanup_timeout_seconds: 30default_action: "preserve"policy:
preserve:
- apn: "ims"
- qci: 1
- arp:
priority_min: 1priority_max: 3delete:
- apn: "internet"qci: 9ddn:
enabled: truerate_limit:
per_mme_per_second: 50per_mme_burst: 100per_ue_suppression_seconds: 10low_priority_throttling:
honor_mme_throttling: truethrottle_seconds: 30high_priority_bypass: truedelayed_queue:
max_entries: 1000max_entries_per_mme: 200max_age_seconds: 30stop_paging:
enabled: falseon_ddn_ack: falsepolicy:
high_priority:
- apn: "ims"
- qci: 1
- arp:
priority_min: 1priority_max: 3low_priority:
- apn: "internet"qci: 9idle_downlink_notification:
enabled: falseactions:
trigger_ddn: trueconditions:
require_release_access_drop: truethrottling:
report_throttle_seconds: 10policy:
high_priority:
- apn: "ims"
- qci: 1
- arp:
priority_min: 1priority_max: 3suppress:
- apn: "internet"qci: 9session_recovery:
enabled: falsestorage:
backend: "sqlite"sqlite_path: "/opt/vectorcore/data/sgwc-db"startup:
restore: truereconcile: truecheckpoint_interval_seconds: 5bearer_inactivity:
enabled: falsetimers:
check_interval_seconds: 30dedicated_bearer_idle_seconds: 300pending_bearer_timeout_seconds: 60default_bearer_idle_seconds: 0conditions:
require_no_recent_control_activity: trueactions:
delete_default_bearers: falsepolicy:
preserve:
- apn: "ims"qci: 5bearer_type: "default"
- qci: 1cleanup:
- bearer_type: "dedicated"idle_seconds: 300qos:
outer_marking:
enabled: truegtpc:
enabled: truedscp: 40pfcp:
enabled: truedscp: 40logging:
level: infofile: /var/log/vectorcore/sgw/sgw-c.logapi:
listen: "127.0.0.1:8080"metrics:
listen: "127.0.0.1:9090"shutdown:
timeout_seconds: 5

SGW-C options:

PathPurpose
sgwc.node_idSGW-C node identifier.
sgwc.plmn.mccMCC for the local PLMN.
sgwc.plmn.mncMNC for the local PLMN.
sgwc.state_dirDirectory for persisted runtime state such as the recovery counter.
sgwc.control_plane_ipIP advertised in SGW-C control-plane F-TEIDs.
interfaces.control.<name>.listenUDP listen address for a named control interface.
gtpc.s11.bindNamed control interface used for S11.
gtpc.s11.timers.t3_response_secondsGTPv2-C retransmission timeout for unanswered S11 requests.
gtpc.s11.timers.n3_requestsMaximum S11 retransmission count before transaction failure.
gtpc.s5c.bindNamed control interface used for S5/S8-C.
gtpc.transactions.create_bearer_retry_guard.enabledEnables repeated Create Bearer retry guard.
gtpc.transactions.collision_handling.modeGTPv2-C transaction collision policy. strict rejects unsafe overlaps. permissive only relaxes bearer-scoped overlaps when one side has no decoded EBI scope.
gtpc.transactions.collision_handling.active_procedure_timeout_secondsTimeout for stale active GTPv2-C procedure state. Default 120.
gtpc.peer_health.enabledEnables SGW-C GTPv2-C peer health tracking and Echo probing.
gtpc.peer_health.timers.echo_interval_secondsGTPv2-C Echo probe interval. Default 30.
gtpc.peer_health.timers.echo_timeout_secondsGTPv2-C Echo response timeout. Default 3.
gtpc.peer_health.thresholds.suspect_after_missedConsecutive missed Echo threshold for suspect state. Default 2.
gtpc.peer_health.thresholds.down_after_missedConsecutive missed Echo threshold for down state. Default 3.
gtpc.peer_health.thresholds.degraded_rtt_msRTT threshold for degraded state. Default 500.
gtpc.peer_health.probe.mmeEnables Echo probing for observed MME GTP-C peers.
gtpc.peer_health.probe.pgwEnables Echo probing for observed PGW GTP-C peers.
gtpc.peer_health.warn_on_down_peer_procedureLogs a warning when a procedure starts toward a peer currently marked down.
features.nsa_dcnr.enabledEnables Release 15 NSA/DCNR awareness in SGW-C.
features.nsa_dcnr.forward_secondary_rat_usage_reportsForwards S11 Secondary RAT Usage Data Report IEs to the owner PGW session on S5/S8-C Modify Bearer.
features.pgw_failure_handling.enabledEnables PGW restart/path-failure session marking.
features.pgw_failure_handling.detection.mark_sessions_on_path_downMarks sessions indexed to a PGW when that PGW transitions down or back up.
features.pgw_failure_handling.detection.mark_sessions_on_restartMarks sessions indexed to a PGW when that PGW's Recovery IE restart counter changes.
features.pgw_failure_handling.actions.block_new_procedures_to_down_pgwIf true, rejects new PGW-owned S5/S8-C procedures toward a PGW currently marked down. Default false, warning-only.
features.pgw_failure_handling.actions.notify_mme_on_pgw_restartReserved for future TS 29.274 PGW Restart Notification support. Must be false in this release.
features.mme_restoration.enabledEnables MME restoration/NTSR handling.
features.mme_restoration.detection.mark_sessions_on_path_downMarks sessions indexed to an MME when that MME transitions down or back up.
features.mme_restoration.detection.mark_sessions_on_restartMarks sessions indexed to an MME when that MME's Recovery IE restart counter changes.
features.mme_restoration.actions.enforce_delete_policyEnforces delete-policy sessions with S5/S8-C Delete Session and PFCP cleanup. PGW rejection retains local state.
features.mme_restoration.actions.trigger_ddnSends S11 Downlink Data Notification for preserved sessions during NTSR.
features.mme_restoration.actions.cleanup_timeout_secondsTimeout for restoration cleanup and DDN send operations. Default 30.
features.mme_restoration.actions.default_actionPolicy action for unmatched sessions. preserve or delete. Default preserve.
features.mme_restoration.policy.preserve[]Preserve rules matched by APN, QCI, and/or ARP priority range. Preserve rules win over delete rules.
features.mme_restoration.policy.delete[]Delete rules matched by APN, QCI, and/or ARP priority range.
features.ddn.enabledEnables DDN throttling and priority paging decisions.
features.ddn.rate_limit.per_mme_per_secondPer-MME DDN token refill rate. Default 50.
features.ddn.rate_limit.per_mme_burstPer-MME DDN token bucket burst size. Default 100.
features.ddn.rate_limit.per_ue_suppression_secondsSuppresses duplicate non-high-priority DDNs for the same UE within this window. Default 10.
features.ddn.low_priority_throttling.honor_mme_throttlingApplies MME-provided DDN Ack low-priority throttling to future low-priority DDN decisions.
features.ddn.low_priority_throttling.throttle_secondsFallback low-priority throttle duration when the MME throttling IE lacks a usable duration. Default 30.
features.ddn.low_priority_throttling.high_priority_bypassAllows high-priority DDNs to bypass an empty per-MME token bucket.
features.ddn.delayed_queue.max_entriesGlobal bound for delayed DDN queue entries. Default 1000.
features.ddn.delayed_queue.max_entries_per_mmePer-MME bound for delayed DDN queue entries. Default 200.
features.ddn.delayed_queue.max_age_secondsMaximum age for queued delayed DDN work. Default 30.
features.ddn.stop_paging.enabledEnables Stop Paging support. Default false until ISR lab validation.
features.ddn.stop_paging.on_ddn_ackIf true, sends Stop Paging after accepted DDN Ack when restoration state proves it is eligible. Requires enabled=true.
features.ddn.policy.high_priority[]High-priority DDN rules matched by APN, QCI, and/or ARP priority range.
features.ddn.policy.low_priority[]Low-priority DDN rules matched by APN, QCI, and/or ARP priority range.
features.idle_downlink_notification.enabledEnables idle downlink packet reporting/DDN trigger flow. Default false until live lab validation is complete.
features.idle_downlink_notification.actions.trigger_ddnAllows SGW-C to send S11 DDN for accepted idle downlink reports.
features.idle_downlink_notification.throttling.report_throttle_secondsPer bearer/session idle downlink report throttle. Default 10.
features.idle_downlink_notification.conditions.require_release_access_dropLimits idle downlink reports to DROP state caused by Release Access Bearers. Default true.
features.idle_downlink_notification.policy.high_priority[]Idle downlink report rules eligible for DDN, matched by APN, QCI, and/or ARP priority range. Defaults include IMS, QCI 1, and high ARP.
features.idle_downlink_notification.policy.suppress[]Idle downlink report rules suppressed by policy. Defaults suppress low-priority internet QCI 9.
features.session_recovery.enabledEnables SGW-C session checkpoint/recovery. Default false until restore/reconcile phases are complete.
features.session_recovery.storage.backendCheckpoint backend. sqlite is the supported local restart-recovery backend; Redis/etcd are reserved for future HA.
features.session_recovery.storage.sqlite_pathSQLite checkpoint DB path.
features.session_recovery.startup.restoreReload checkpointed SGW-C session state at startup. Restored sessions must reconcile before becoming active.
features.session_recovery.startup.reconcileReconcile restored sessions against SGW-U PFCP/eBPF state at startup. Requires restore=true.
features.session_recovery.checkpoint_interval_secondsMinimum periodic checkpoint cadence for dirty sessions. Default 5.
features.bearer_inactivity.enabledEnables bearer inactivity tracking/cleanup. Default false while activity detection and cleanup execution are phased in.
features.bearer_inactivity.timers.check_interval_secondsPeriodic inactivity scan interval. Default 30.
features.bearer_inactivity.timers.dedicated_bearer_idle_secondsDefault idle threshold for dedicated bearers. Default 300.
features.bearer_inactivity.timers.pending_bearer_timeout_secondsTimeout for pending bearer procedures before they can be considered stale. Default 60.
features.bearer_inactivity.timers.default_bearer_idle_secondsDefault-bearer idle threshold. 0 disables default-bearer inactivity cleanup.
features.bearer_inactivity.actions.delete_default_bearersAllows default-bearer inactivity cleanup when explicitly paired with a positive default-bearer idle timeout. Default false.
features.bearer_inactivity.conditions.require_no_recent_control_activityRequires no recent bearer/session control activity before cleanup eligibility. Default true.
features.bearer_inactivity.policy.preserve[]Preserve rules matched by APN, QCI, bearer type, and/or ARP priority range. Preserve rules are intended to protect IMS signaling, QCI 1, and high-priority sessions.
features.bearer_inactivity.policy.cleanup[]Cleanup rules matched by bearer type/APN/QCI/ARP. Phase 1 only validates policy; later phases execute cleanup.
pfcp.local_addrSGW-C PFCP local address.
pfcp.heartbeat.interval_secondsPFCP heartbeat interval.
pfcp.heartbeat.timeout_secondsPFCP heartbeat timeout.
pfcp.sgwu[].nameSGW-U peer name.
pfcp.sgwu[].node_idSGW-U peer node ID.
pfcp.sgwu[].addrSGW-U PFCP address.
qos.outer_marking.enabledEnables outer IP DSCP marking.
qos.outer_marking.gtpc.enabledEnables DSCP marking on SGW-C GTP-C sockets.
qos.outer_marking.gtpc.dscpGTP-C DSCP value, range 0-63. Default 40.
qos.outer_marking.pfcp.enabledEnables DSCP marking on SGW-C PFCP sockets.
qos.outer_marking.pfcp.dscpPFCP DSCP value, range 0-63. Default 40.
logging.levelLog level.
logging.fileLog file path.
api.listenSGW-C HTTP API listen address.
metrics.listenSGW-C metrics listen address.
shutdown.timeout_secondsGraceful shutdown timeout.

Required SGW-C fields include sgwc.node_id, sgwc.plmn.mcc, sgwc.plmn.mnc, gtpc.s11.bind, gtpc.s5c.bind, pfcp.local_addr, and at least one pfcp.sgwu entry.

SGW-C exposes runtime state through its HTTP API listener:

EndpointPurpose
/healthSGW-C health response.
/sessionsSGW-C session list.
/sessions/{session_id}Detailed SGW-C session and bearer state, including PGW failure, MME restoration, and DDN control decision fields.
/gtpc/peersObserved GTP-C peer health and Recovery IE state.
/gtpc/pgw-failuresPGW path/restart state and affected session counts.
/gtpc/mme-restorationsMME restoration/path/restart state and affected session counts.
/gtpc/ddn-controlDDN throttling, priority paging, token, throttle, delay, suppress, and per-UE state.
/gtpc/idle-downlinkIdle downlink report/DDN status counters.
/pfcp/associationsSGW-C PFCP association state.
/recovery/statusSGW-C checkpoint backend, restore counts, peer Recovery IE restore counts, and current recovery summary.

SGW-U API endpoints include:

EndpointPurpose
/sessionsSGW-U PFCP sessions with PDR/FAR state.
/pfcp/associationsSGW-U PFCP association state with SGW-C peers.
/bpf/rulesSGW-U eBPF forwarding rules and per-rule counters.
/gtpu/countersSGW-U userspace GTP-U counters, including idle downlink hits.

SGW-C exports the following control-plane metrics on its Prometheus listener:

MetricPurpose
sgwc_gtpv2c_collision_rejections_totalCount of rejected overlapping GTPv2-C procedures by action, policy, active procedure, new procedure, and owner.
sgwc_gtpv2c_collision_stale_expired_totalCount of stale active-procedure records expired before a new collision decision.
sgwc_gtpc_peer_stateOne-hot peer health state gauge by role, peer, and state.
sgwc_gtpc_peer_echo_rtt_secondsLast GTPv2-C Echo RTT by role and peer.
sgwc_gtpc_peer_echo_sent_totalCount of GTPv2-C Echo Requests sent by role and peer.
sgwc_gtpc_peer_echo_responses_totalCount of GTPv2-C Echo Responses received by role and peer.
sgwc_gtpc_peer_echo_timeouts_totalCount of GTPv2-C Echo timeouts by role and peer.
sgwc_gtpc_peer_restarts_totalCount of Recovery IE restart-counter changes by role and peer.
sgwc_pgw_path_stateOne-hot PGW path/restart state gauge by PGW and state.
sgwc_pgw_affected_sessionsCurrent count of sessions affected by PGW path/restart state.
sgwc_pgw_restarts_totalCount of PGW Recovery IE restart-counter changes handled by SGW-C.
sgwc_pgw_path_down_totalCount of PGW path-down transitions handled by SGW-C.
sgwc_mme_restoration_stateOne-hot MME restoration/path/restart state gauge by MME and state.
sgwc_mme_restoration_affected_sessionsCurrent count of sessions affected by MME restoration state.
sgwc_mme_restarts_totalCount of MME Recovery IE restart-counter changes handled by SGW-C restoration.
sgwc_mme_path_down_totalCount of MME path-down transitions handled by SGW-C restoration.
sgwc_ddn_control_tokensCurrent per-MME DDN control token count.
sgwc_ddn_control_sent_totalCount of DDN sends allowed by DDN control per MME.
sgwc_ddn_control_delayed_totalCount of DDN delay decisions per MME.
sgwc_ddn_control_suppressed_totalCount of DDN suppress decisions per MME.
sgwc_ddn_control_high_priority_bypassed_totalCount of high-priority DDN bypass sends per MME.
sgwc_ddn_control_low_priority_throttle_activeGauge showing whether MME low-priority DDN throttling is active.
sgwc_ddn_control_ue_sent_totalCount of DDN sends allowed by DDN control per UE.
sgwc_ddn_control_ue_delayed_totalCount of DDN delay decisions per UE.
sgwc_ddn_control_ue_suppressed_totalCount of DDN suppress decisions per UE.
sgwc_checkpoint_enabledGauge showing whether SGW-C session checkpointing is enabled.
sgwc_checkpoint_sessions_loadedSession snapshots loaded from checkpoint storage at startup.
sgwc_checkpoint_sessions_restoredSession snapshots restored at startup.
sgwc_checkpoint_peer_snapshots_loadedPeer Recovery IE snapshots loaded at startup.
sgwc_checkpoint_gtpc_peers_restoredMME/PGW Recovery IE snapshots restored at startup.
sgwc_checkpoint_pfcp_peers_restoredSGW-U Recovery Time Stamp snapshots restored at startup.
sgwc_checkpoint_flushes_totalCheckpoint writer flush attempts.
sgwc_checkpoint_flush_failures_totalCheckpoint writer flush failures.
sgwc_checkpoint_session_saves_totalSession snapshots saved by the checkpoint writer.
sgwc_checkpoint_session_deletes_totalSession snapshots deleted by the checkpoint writer.
sgwc_checkpoint_peer_saves_totalPeer Recovery IE snapshots saved by the checkpoint writer.
sgwc_recovery_sessionsCurrent SGW-C sessions by recovery/session state.
sgwc_pfcp_reconciliation_sessionsCurrent SGW-C sessions by PFCP reconciliation state.
sgwc_pfcp_repair_plan_sessionsCurrent SGW-C sessions by PFCP repair plan action.
sgwc_nsa_secondary_rat_usage_reports_captured_totalCount of Release 15 Secondary RAT Usage Data Report IEs captured on S11 by APN and source procedure.
sgwc_nsa_secondary_rat_usage_reports_forwarded_totalCount of Release 15 Secondary RAT Usage Data Report IEs forwarded on S5/S8-C by APN and resulting cause.

Additional transaction collision behavior and validation notes are in docs/gtpv2c-transaction-collision.md.

GTPv2-C peer health behavior and validation notes are in docs/gtpc-peer-health.md.

PGW restart and path-failure behavior and validation notes are in docs/pgw-restart-path-failure.md.

MME restoration/NTSR behavior and live validation notes are in docs/mme-ntsr-lab-validation.md.

DDN throttling and priority paging validation notes are in docs/ddn-control-phase8-validation.md.

Bearer inactivity cleanup behavior and live validation notes are in docs/bearer-inactivity-lab-validation.md.

NSA/DCNR Secondary RAT report behavior and validation notes are in docs/5g-nsa-dcnr-awareness.md.

SGW-U Configuration

Default file: configs/sgw-u.yaml

Top-level sections:

sgwu:
node_id: "sgw-u-1"pfcp:
listen: "127.0.0.2:8805"allowed_sgwc:
- "127.0.0.1"interfaces:
user:
sgwinterface:
ifname: "eth0"listen: "10.90.250.59:2152"gtpu:
s1u:
bind: "sgwinterface"s5u:
bind: "sgwinterface"qos:
outer_marking:
enabled: truegtpu:
enabled: truedscp: 0pfcp:
enabled: truedscp: 40qci_marking:
enabled: trueoverride_default_gtpu: truedefault_gtpu_dscp: 0unknown_teid_dscp: 0trust_inner_dscp: falseqci_to_dscp:
1: 462: 343: 264: 265: 406: 187: 268: 09: 0dataplane:
driver_mode: "xdp-generic"unknown_teid: "punt"attach_on_start: truecleanup_on_exit: truemap_max_entries: 65536logging:
level: infofile: /var/log/vectorcore/sgw/sgw-u.logapi:
listen: "127.0.0.1:8081"metrics:
listen: "127.0.0.1:9091"shutdown:
timeout_seconds: 5

SGW-U options:

PathPurpose
sgwu.node_idSGW-U node identifier.
pfcp.listenSGW-U PFCP listen address.
pfcp.allowed_sgwc[]SGW-C control addresses allowed to use PFCP.
interfaces.user.<name>.ifnameLinux interface used by a named user-plane interface.
interfaces.user.<name>.listenGTP-U local address for that named user-plane interface.
gtpu.s1u.bindNamed user-plane interface used for S1-U.
gtpu.s5u.bindNamed user-plane interface used for S5/S8-U.
qos.outer_marking.enabledEnables outer IP DSCP marking.
qos.outer_marking.gtpu.enabledEnables DSCP marking on forwarded GTP-U outer IPv4 headers.
qos.outer_marking.gtpu.dscpGTP-U outer DSCP value, range 0-63. Default 0.
qos.outer_marking.pfcp.enabledEnables DSCP marking on SGW-U PFCP sockets.
qos.outer_marking.pfcp.dscpPFCP DSCP value, range 0-63. Default 40.
qos.qci_marking.enabledEnables QCI-aware GTP-U outer DSCP marking for known bearer rules.
qos.qci_marking.override_default_gtpuUses QCI mapping instead of outer_marking.gtpu.dscp when bearer QCI metadata is available.
qos.qci_marking.default_gtpu_dscpDSCP used when QCI marking is enabled but bearer QCI is missing or unmapped.
qos.qci_marking.unknown_teid_dscpReserved fallback DSCP setting for unknown TEID handling.
qos.qci_marking.trust_inner_dscpMust be false; copying UE inner DSCP is not supported.
qos.qci_marking.qci_to_dscpOperator QCI-to-DSCP map. QCI range 1-255, DSCP range 0-63. Defaults include QCI 1 to DSCP 46, QCI 5 to DSCP 40, QCI 9 to DSCP 0.
dataplane.driver_modeXDP attach mode: xdp-generic, xdp-native, or xdp-offload.
dataplane.unknown_teidUnknown TEID action: punt or drop.
dataplane.attach_on_startAttach the eBPF dataplane during startup.
dataplane.cleanup_on_exitRemove eBPF hooks during shutdown.
dataplane.map_max_entrieseBPF map capacity.
logging.levelLog level.
logging.fileLog file path.
api.listenSGW-U HTTP API listen address.
metrics.listenSGW-U metrics listen address.
shutdown.timeout_secondsGraceful shutdown timeout.

Required SGW-U fields include sgwu.node_id, pfcp.listen, at least one pfcp.allowed_sgwc entry, gtpu.s1u.bind, and gtpu.s5u.bind.

S1-U and S5/S8-U listen addresses must use explicit IPv4 addresses, not 0.0.0.0.

Interfaces and Ports

InterfaceProtocolDefault port
S11GTPv2-CUDP/2123
S5/S8-CGTPv2-CUDP/2123
SxaPFCPUDP/8805
S1-UGTP-UUDP/2152
S5/S8-UGTP-UUDP/2152
SGW-C APIHTTPTCP/8080
SGW-U APIHTTPTCP/8081
SGW-C metricsHTTPTCP/9090
SGW-U metricsHTTPTCP/9091

Example Lab Configs

configs/interop/ contains lab templates for a two-node SGW-C/SGW-U deployment:

  • configs/interop/sgw-c-lab.yaml
  • configs/interop/sgw-u-lab.yaml

They set lab IP addresses, PFCP peer wiring, shared control-plane binding, and VM-friendly xdp-generic dataplane mode.

About

4G LTE SGW with eBPF dataplane

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages