Back

Wireshark Protocol Deep Dive: GTP, Diameter, SIP, SCTP, S1AP & Advanced Tools

Master Wireshark protocol analysis for PS Core: GTP, Diameter, SIP, SCTP, S1AP, PCAP operations, tshark CLI, statistics, and troubleshooting.

Wireshark Protocol Deep Dive: GTP, Diameter, SIP, SCTP, S1AP & Advanced Tools

This comprehensive guide covers every major protocol used in Packet Switched Core networks and how to analyze them with Wireshark. From GTP tunneling and Diameter charging to SIP-based IMS signaling, SCTP transport, S1AP eNodeB control, and advanced command-line tools — this is the definitive reference for PS Core engineers.


GTP (GPRS Tunneling Protocol)

Introduction

GTP is the backbone of packet‑switched mobile networks. It carries both user data (GTP‑U) and control signaling (GTP‑C) across the LTE/EPC core. Wireshark decodes GTP on UDP ports 2123 (control) and 2152 (user).


Diameter

What is Diameter?

Diameter is the next‑generation AAA protocol that replaces RADIUS. In PS Core it handles:

  • Billing/Charging (Gx) between PGW and PCRF
  • Authentication/Authorization (S6a) between MME and HSS
  • Policy control (Rx) between PCRF and P‑CSCF
Application‑IDNameInterface
0Diameter BaseConnection management
4Gx (CC‑Application)Charging
16777236S6aSubscription
16777264RxQoS
16777232Cx/DxIMS

Standard Ports

  • 3868/TCP or SCTP – default Diameter transport
  • 5868/TCP or SCTP – TLS‑encrypted Diameter

Header Overview

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version (8)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message Length (24)          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flags (8)                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Command Code (24)            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application‑ID (32)           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Hop‑by‑Hop ID (32)           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| End‑to‑End ID (32)           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AVP / Grouped AVPs ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
FieldSize (bytes)Description
Version1Always 1
Length3Total message length (including 20‑byte header)
Flags1R (request), P (proxiable), E (error), T (potentially retransmitted)
Command Code3Function identifier (e.g., 272 for CCR)
Application‑ID4Application context (e.g., 4 for Gx)
Hop‑by‑Hop ID4Matches request ↔ response
End‑to‑End ID4Correlates across peers

Important AVPs

AVP CodeNameDescription
1User‑NameIMSI or user identifier
26Vendor‑Id10415 for 3GPP
256Result‑CodeResult of the command
258Experimental‑Result‑CodeExtended result
264Destination‑Host
265Destination‑Realm
266Disconnect‑Cause
263Session‑Id
247CC‑Request‑Type
248CC‑Request‑Number
258Event‑Trigger
267Rating‑Group
271GPR‑QoS‑Information
272User‑Equipment‑Info
432Charging‑Rule‑Install
433Charging‑Rule‑Remove
437Charging‑Rule‑Definition
438Charging‑Rule‑Name
439Event‑Charging‑Rule‑Name
440Metering‑Method
441Offline‑Charging
442Online‑Charging

Command Codes

CodeNameUsage
257Capabilities‑Exchange (CER/CEA)
258Device‑Watchdog (DWR/DWA)
260Disconnect‑Peer (DPR/DPA)
272Credit‑Control (CCR/CCA) – Gx
268Authentication‑Information (AIR/AIA) – S6a
274Session‑Termination (STR/STA)
265AA (RAR/RAA) – Rx
298Abort‑Session

Wireshark Diameter Filters

# Show all Diameter
Diameter

# Show all CCR‑Initial (Gx)
Diameter && diameter.cmd.code == 272 && diameter.flags.request == 1 && diameter.CC-Request-Type == 1

# Show CCR‑Update
Diameter && diameter.cmd.code == 272 && diameter.flags.request == 1 && diameter.CC-Request-Type == 2

# Show CCR‑Termination
Diameter && diameter.cmd.code == 272 && diameter.flags.request == 1 && diameter.CC-Request-Type == 3

# Show AIR (Authentication‑Information Request – S6a)
Diameter && diameter.cmd.code == 268 && diameter.flags.request == 1

# Show AIA (Authentication‑Information Answer)
Diameter && diameter.cmd.code == 268 && diameter.flags.request == 0

# Show all error responses
Diameter && diameter.flags.request == 0 && diameter.result_code != 2001

# Filter by IMSI (User‑Name AVP)
Diameter && diameter.User-Name == "9891234567890"

# Filter by APN (Called‑Station‑Id contains APN)
Diameter && diameter.Called-Station-Id contains "internet"

# Filter by Result‑Code (e.g., 5003 – Unable to Deliver)
Diameter && diameter.result_code == 5003

SIP (Session Initiation Protocol)

What is SIP?

SIP is the signaling protocol used in IMS for creating, modifying, and terminating multimedia sessions. It carries voice, video, and messaging over IP networks.

IMS Architecture

UE → P‑CSCF → S‑CSCF → I‑CSCF → HSS
        ↕              ↕
     PCRF        Application Server
InterfaceBetweenPurpose
GmUE ↔ P‑CSCFRegistration / Session
MwP‑CSCF ↔ S‑CSCFSignaling
MxS‑CSCF ↔ I‑CSCFRouting
CxS‑CSCF ↔ HSSSubscription

Transport

TransportPortSecurity
TCP5060Unencrypted
UDP5060Unencrypted
TCP+TLS5061Encrypted
SCTP5060High‑reliability

SIP Message Structure

┌─────────────────────────────────────┐
│ Method Request‑URI SIP/2.0          │ ← Request Line
├─────────────────────────────────────┤
│ Header1: Value1                     │ ← Headers
│ Header2: Value2                     │
├─────────────────────────────────────┤
│                                     │ ← Empty Line
├─────────────────────────────────────┤
│ Body (SDP, etc.)                   │ ← Message Body
└─────────────────────────────────────┘

Key Methods

MethodPurpose
REGISTERRegister UE in IMS
INVITEStart session (call)
ACKConfirm INVITE
BYEEnd session
CANCELCancel pending INVITE
OPTIONSCapability query
UPDATEUpdate session
PRACKProvisional ACK
SUBSCRIBESubscribe to events
NOTIFYNotify events
MESSAGESMS over IMS

SIP Status Codes

CodeReason
100Trying
180Ringing
183Session Progress
200OK
403Forbidden
404Not Found
408Request Timeout
486Busy Here
487Request Terminated
500Server Internal Error
503Service Unavailable

IMS Headers

HeaderDescription
P‑Access‑Network‑InfoAccess network info (e.g., 3GPP‑E‑UTRAN‑FDD)
P‑Asserted‑IdentityVerified identity
P‑Charging‑VectorICID, IOI for charging
P‑Called‑Party‑IDDestination party ID
Service‑RouteService routing path
Security‑Client / ServerIPSec parameters

SIP + SDP (Session Description Protocol)

SDP is carried inside the SIP body and describes the media streams:

v=0
o=- 3845392 3845392 IN IP4 10.10.1.1
s=-
c=IN IP4 10.10.1.1
t=0 0
m=audio 49170 RTP/AVP 0 8 97
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:97 iLBC/8000
Payload TypeCodecUsage
0PCMU (G.711 μ‑law)Standard voice
8PCMA (G.711 A‑law)Standard voice
97iLBCLow‑bandwidth voice
98EVSEnhanced voice
102H.264Video
113H.265Advanced video

Wireshark SIP Filters

# Show all SIP
sip

# Filter by method
sip.Method == "INVITE"
sip.Method == "REGISTER"
sip.Method == "BYE"
sip.Method == "SUBSCRIBE"
sip.Method == "NOTIFY"
sip.Method == "MESSAGE"

# Filter by status code
sip.Status-Code == 200
sip.Status-Code == 100
sip.Status-Code == 403
sip.Status-Code == 503

# Filter by Call-ID
sip.Call-ID == "abc123@operator.com"

# Filter by From/To
sip.From contains "+9891234567890"
sip.To contains "+9899876543210"

# Show INVITE with SDP
sip.Method == "INVITE" && sip contains "v=0"

# Show all errors (4xx / 5xx)
sip.Status-Code >= 400 && sip.Status-Code < 600

# Show SIP for specific IMSI
sip contains "9891234567890"

SCTP (Stream Control Transmission Protocol)

What is SCTP?

SCTP is a transport protocol that combines features of UDP (message‑oriented) and TCP (reliable, ordered). It is used in telecom for carrying signaling protocols such as Diameter and S1AP.

ApplicationPortTransport
S1AP (S1‑MME)36412eNodeB ↔ MME
Diameter (S6a/Gx/Rx)3868MME/SGSN ↔ HSS/PCRF
SIGTRAN (M2UA/M3UA)2905/2904SS7 over IP

SCTP vs TCP

FeatureTCPSCTP
Multi‑homing
Multi‑streaming
Message‑oriented✗ (byte stream)
Cookie‑based security✓ (4‑way → 2‑way)
Ordered delivery✓ (per‑stream)✓ (per‑stream)
Heartbeat✗ (keep‑alive)✓ (HEARTBEAT)

Multi‑homing

┌──────────────────────────────────────┐
│ SCTP Association                     │
│                                      │
│ Endpoint A                           │
│   ├── Primary:   10.10.1.1           │
│   ├── Secondary: 10.10.2.1           │
│   └── Secondary: 192.168.1.1         │
│         ↕ (Multi‑homed paths)        │
│ Endpoint B                           │
│   ├── Primary:   10.20.1.1           │
│   ├── Secondary: 10.20.2.1           │
│   └── Secondary: 192.168.2.1         │
└──────────────────────────────────────┘

Multi‑streaming

SCTP Association
├── Stream 0: S1AP Procedures
├── Stream 1: NAS Transport
├── Stream 2: Paging
└── Stream 3: Error Indication

SCTP Header

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port               | Destination Port              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Verification Tag                                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum                                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Chunks ...                                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Key Chunk Types

TypeNameDescription
0DATAUser data
1INITStart association
2INIT ACKStart response
3SACKSelective ACK
4HEARTBEATLiveness check
5HEARTBEAT ACKLiveness reply
6ABORTConnection abort
7SHUTDOWNGraceful shutdown
13ERRORError report
14Cookie EchoSecurity handshake
15Cookie ACKCookie response

Wireshark SCTP Filters

# Show all SCTP
sctp

# Filter by port
sctp.srcport == 36412
sctp.dstport == 3868

# Filter by chunk type
sctp.chunk.type == 1   # INIT
sctp.chunk.type == 0   # DATA
sctp.chunk.type == 4   # HEARTBEAT
sctp.chunk.type == 6   # ABORT
sctp.chunk.type == 7   # SHUTDOWN

# Filter by verification tag
sctp.verification_tag == 0x12345678

# Show S1AP traffic
sctp.dstport == 36412 || sctp.srcport == 36412

# Show Diameter traffic
sctp.dstport == 3868 || sctp.srcport == 3868

What is GTP?

GTP is the tunneling protocol used for carrying user data and signaling across 2G/GPRS, 3G/UMTS, and 4G/LTE networks. It comes in three variants:

  • GTPv1-C: Control plane for 2G/3G (Gn/Gp interfaces)
  • GTPv2-C: Control plane for 4G/LTE (S11/S5/S8 interfaces)
  • GTP-U: User plane data transport (all generations)

Protocol Layering

┌──────────────────────────┐
│       GTP Header         │
├──────────────────────────┤
│  Information Elements    │
├──────────────────────────┤
│  UDP (2123/2152)         │
├──────────────────────────┤
│  IP                      │
├──────────────────────────┤
│  Ethernet                │
└──────────────────────────┘

GTP Ports

PortProtocolUsage
2123UDPGTPv1-C and GTPv2-C
2152UDPGTP-U

Interfaces and GTP

InterfaceProtocolBetween
GnGTPv1-CSGSN ↔ GGSN
GpGTPv1-CSGSN ↔ GGSN (roaming)
S11GTPv2-CMME ↔ SGW
S4GTPv2-CSGSN ↔ SGW
S5GTPv2-CSGW ↔ PGW
S8GTPv2-CSGW ↔ PGW (roaming)
S1-UGTP-UeNodeB ↔ SGW
S5-UGTP-USGW ↔ PGW

GTPv1 Header Structure

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Version |P|X|R|  Reserved   |       Message Type            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Message Length        |     Tunnel Endpoint ID        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                      GTP Data / IEs...                        |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
FieldSize (bits)Description
Version3GTP version (1 for GTPv1)
PT (Protocol Type)11=GTP, 0=GTP’
Reserved1Reserved
E (Extension)1Extension Header present
S (Sequence)1Sequence Number present
PN (PDU Number)1PDU Number present
Message Type8Message type
Message Length16Message length (excluding 8-byte header)
TEID32Tunnel Endpoint Identifier

GTPv1-C Message Types

TypeNameUsage
1Echo RequestPath keepalive check
2Echo ResponsePath keepalive reply
3Version Not SupportedVersion rejection
16Create PDP Context RequestCreate PDP context
17Create PDP Context ResponsePDP context response
18Update PDP Context RequestUpdate PDP context
19Update PDP Context ResponseUpdate response
20Delete PDP Context RequestDelete PDP context
21Delete PDP Context ResponseDelete response
26Error IndicationError report
27PDU Notification RequestPDU notification
200G-PDUUser data

Key Information Elements in GTPv1

IEs in Create PDP Context Request

IE TypeNameDescription
1CauseCause/result
2IMSIUser IMSI
3RecoveryRecovery number
4APNAccess Point Name
5GSN AddressGGSN address
6MSISDNMSISDN number
8Quality of ServiceQoS Profile
15TEID Data IData TEID
16TEID Control PlaneControl TEID
128GTP-U Peer AddressGTP-U peer address
133Charging CharacteristicsCharging attributes
134Common FlagsCommon flags
150Selection ModeSelection mode

IEs in Create PDP Context Response

IE TypeNameDescription
1CauseCause (Accept=16, Duplicate=19, …)
3RecoveryRecovery number
5GSN AddressGGSN address
8Quality of ServiceQoS Profile
15TEID Data IData TEID
128GTP-U Peer AddressGTP-U peer address

GTPv2-C Header Structure

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Version |P|T|E|S| Reserved  |       Message Type            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Message Length        | TEID (higher 32 bits)         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   TEID (lower 32 bits)       |     Sequence Number           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Sequence Number (cont)      |          Spare                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                      GTP Data / IEs...                        |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
FieldSize (bits)Description
Version3GTP version (2 for GTPv2)
PT1Always 1
T (Teid Flag)1TEID present
E (EPC Flags)1EPC-related flags
S (Sequence)1Sequence Number present
Message Type8Message type
Message Length16Message length
TEID64Tunnel identifier (8 bytes)
Sequence Number24Sequence number
Spare8Reserved bits

GTPv2-C Message Types

Management Messages

TypeNameDescription
1Echo RequestPath management request
2Echo ResponsePath management reply
3Version Not SupportedVersion rejection
4Peer Address ResolutionPeer address resolution

Tunnel Management Messages (S11/S5)

TypeNameDescription
32Create Session RequestSession creation
33Create Session ResponseSession creation response
34Modify Bearer RequestBearer modification
35Modify Bearer ResponseBearer modification response
36Delete Session RequestSession deletion
37Delete Session ResponseSession deletion response
38Modify Bearer CommandDownlink bearer modification
39Modify Bearer Failure NotificationModification failure
40Delete Bearer CommandBearer deletion command
41Delete Bearer Failure NotificationDeletion failure

Bearer Management Messages

TypeNameDescription
64Create Bearer RequestCreate dedicated bearer
65Create Bearer ResponseDedicated bearer response
66Update Bearer RequestBearer update
67Update Bearer ResponseBearer update response
68Delete Bearer RequestBearer deletion
69Delete Bearer ResponseBearer deletion response
70Downlink Data NotificationDownlink data indication
71DDN AcknowledgeDDN acknowledgment

Handover Messages

TypeNameDescription
33Handover RequestHandover request
35Handover CommandHandover command
161Handover CompleteHandover completion

Key Information Elements in GTPv2-C

IE TypeNameDescription
1CauseCause code
2IMSISubscriber IMSI
51APNAccess Point Name
53AMBRAggregate Maximum Bit Rate
55Bearer ContextBearer context
57Bearer QoSBearer quality of service
61Charging CharacteristicsCharging attributes
68F-TEIDFully Qualified TEID
76MSISDNPhone number
80PDN TypePDN connection type
82RAT TypeRadio Access Technology
84Selection ModeSelection mode
88ULIUser Location Information
95UE Time ZoneUE timezone

F-TEID (IE Type 68)

├── CHOOSE (1 bit): F-TEID selected by peer
├── IPv4 (1 bit): IPv4 address present
├── IPv6 (1 bit): IPv6 address present
├── Interface Type (4 bits):
│   ├── 0: S1-U eNodeB
│   ├── 1: S1-U SGW
│   ├── 2: S5/S8-U SGW
│   ├── 3: S5/S8-U PGW
│   ├── 4: S11-MME
│   ├── 5: S5/S8-C SGW
│   ├── 6: S5/S8-C PGW
│   └── 7: S2b-C PGW
├── TEID (4 bytes): Tunnel identifier
├── IPv4 Address (4 bytes, optional)
└── IPv6 Address (16 bytes, optional)

Cause Values (GTPv2-C)

ValueNameDescription
1Request AcceptedRequest succeeded
64System FailureSystem failure
65No Resources AvailableResources unavailable
66Mandatory IE IncorrectMandatory IE error
67Mandatory IE MissingMandatory IE missing
70Context Not FoundContext not found
71Request RejectedRequest rejected
72APN Access Denied (no subscription)APN blocked
76User Authentication FailedAuth failure
80Version Not SupportedVersion not supported
95Semantically Incorrect MessageSemantic error
96Invalid Message FormatInvalid format
106Unexpected MessageUnexpected message

GTP Analysis with Wireshark Filters

# === Basic GTPv2-C Filters ===

# Show all GTPv2-C
gtpv2

# Show Create Session Request/Response
gtpv2.message_type == 32 || gtpv2.message_type == 33

# Show Modify Bearer Request/Response
gtpv2.message_type == 34 || gtpv2.message_type == 35

# Show Delete Session Request/Response
gtpv2.message_type == 36 || gtpv2.message_type == 37

# Show Echo Request/Response
gtpv2.message_type == 1 || gtpv2.message_type == 2

# Show Dedicated Bearer operations
gtpv2.message_type == 64 || gtpv2.message_type == 65

# === TEID-Based Filters ===

# Show traffic for a specific TEID
gtpv2.teid == 0x12345678

# Show Create Session with zero TEID
gtpv2.message_type == 32 && gtpv2.teid == 0x00000000

# Show F-TEID IE by interface type
gtpv2.fteid.interfaceType == 6   # S5/S8-C PGW
gtpv2.fteid.interfaceType == 1   # S1-U SGW

# === IMSI/APN Filters ===

# Show traffic for specific IMSI
gtpv2.imsi == "9891234567890"

# Show Create Session for specific APN
gtpv2.message_type == 32 && gtpv2.apn == "internet"

# === Cause Code Filters ===

# Show rejected responses
gtpv2.flags.request == 0 && gtpv2.cause != 1

# Show specific causes
gtpv2.cause == 70   # Context not found
gtpv2.cause == 64   # System failure

# === GTP-U Filters ===

# Show GTP-U
gtpu

# Show GTP-U with specific TEID
gtpu.teid == 0xabcdef01

# Show large GTP-U (bulk data)
gtpu && frame.len > 1400