Wireshark for OPC UA: How to Capture and Decode Client/Server Traffic

By | April 10, 2026

OPC UA (Unified Architecture) is the leading platform-independent protocol for industrial data exchange. It connects SCADA systems, MES platforms, HMI panels, historians, and cloud gateways to PLCs, DCS controllers, and edge devices.

OPC UA uses the OPC Binary protocol over TCP on port 4840 (IANA registered as “opc.tcp”). Wireshark decodes every OPC UA service — OpenSecureChannel, CreateSession, Browse, Read, Write, Publish, and more — down to individual node IDs, attribute values, and status codes.

But there are two common problems. First, many OPC UA servers use non-standard ports — Wireshark will not decode them automatically. Second, if the connection is encrypted (which it should be in production), Wireshark shows “UA Secure Conversation Message (encrypted)” and you cannot see the service content without a key log file.

This guide covers capture setup, verified display filters, how to decode both encrypted and unencrypted OPC UA traffic, and how to troubleshoot the most common OPC UA communication problems.

1. How OPC UA Appears in Wireshark

Wireshark decodes OPC UA Binary as a single protocol layer:

LayerWhat It Shows
TCPPort 4840 (default), TCP handshake
OpcUaMessage type, service request/response, node IDs, values, status codes

The Info column shows the OPC UA service name:

HEL - Hello Message
ACK - Acknowledge Message
OPN - OpenSecureChannelRequest
OPN - OpenSecureChannelResponse
MSG - CreateSessionRequest
MSG - CreateSessionResponse
MSG - BrowseRequest
MSG - ReadRequest
MSG - ReadResponse
MSG - CreateSubscriptionRequest
MSG - PublishResponse
CLO - CloseSecureChannelRequest

2. How to Capture OPC UA Traffic

Capture Filter

tcp port 4840

If your server uses a different port:

tcp port 49380

Where to Capture

LocationWhen to Use
On the OPC UA client machineSee what the client sends and receives
On the OPC UA serverSee all client connections
On a network switch (port mirroring)Non-intrusive capture between client and server

3. Decoding OPC UA on Non-Standard Ports

Wireshark decodes OPC UA automatically only on port 4840. Many OPC UA servers use custom ports (e.g., 49380, 48010, 4841, 62541). If your traffic shows as raw TCP:

Fix: Change Preferences

  1. Go to Edit → Preferences → Protocols → OpcUa
  2. In the TCP port(s) field, add your port (comma-separated for multiple ports)
  3. Click OK

Fix: Use “Decode As”

  1. Right-click a packet on the non-standard port
  2. Select Decode As…
  3. Set: Field = TCP port, Value = your port, Current = OpcUa
  4. Click OK

⚠️ Important: The OPC UA port is found in the server’s endpoint URL. For example, opc.tcp://192.168.1.50:49380 uses port 49380. Always check the endpoint URL first.

4. Display Filters for OPC UA

All filter field names verified against the official Wireshark OpcUa Binary Protocol Display Filter Reference.

Basic Filters

FilterWhat It Shows
opcuaAll OPC UA traffic
tcp.port == 4840All traffic on OPC UA default port

Message Type Filters

OPC UA uses message types identified by a 3-letter code in the first bytes:

FilterWhat It Shows
opcua.transport.type == "HEL"Hello message (connection init)
opcua.transport.type == "ACK"Acknowledge message
opcua.transport.type == "OPN"OpenSecureChannel request/response
opcua.transport.type == "MSG"Service message (Browse, Read, Write, etc.)
opcua.transport.type == "CLO"CloseSecureChannel request
opcua.transport.type == "ERR"Error message

Service Filters

Each OPC UA service has a unique ServiceId (numeric NodeId). You can filter by the service name using the Wireshark Info column search, or by ServiceId:

ServiceServiceIdCommon Use
GetEndpointsRequest428Discovery — list available endpoints
GetEndpointsResponse431Discovery response
OpenSecureChannelRequest446Establish secure channel
OpenSecureChannelResponse449Secure channel confirmation
CreateSessionRequest461Create a session
CreateSessionResponse464Session confirmation
ActivateSessionRequest467Activate session with credentials
ActivateSessionResponse470Activation confirmation
BrowseRequest527Browse the address space
BrowseResponse530Browse results
ReadRequest631Read node values
ReadResponse634Read results
WriteRequest673Write node values
WriteResponse676Write results
CreateSubscriptionRequest787Create a subscription
PublishRequest826Client requests notifications
PublishResponse829Server sends data changes
CloseSessionRequest473Close the session

Filter example for WriteRequest:

opcua.ServiceId == 673

Data Filters

FilterWhat It Shows
opcua.StatusCodeStatus code in responses
opcua.nodeid.stringString NodeId (e.g., tag name)
opcua.nodeid.numericNumeric NodeId
opcua.AttributeIdWhich attribute is being read/written (13 = Value)
opcua.SecurityPolicyUriSecurity policy used
opcua.EndpointUrlEndpoint URL in Hello or GetEndpoints
opcua.ApplicationUriApplication URI of client or server
opcua.ChannelIdSecure Channel ID
opcua.TokenIdSecurity Token ID

Combination Examples

All Read requests to a specific server:

opcua.ServiceId == 631 && ip.dst == 192.168.1.50

All error messages:

opcua.transport.type == "ERR"

All encrypted messages (cannot see service content):

opcua && !opcua.ServiceId

Failed operations (non-zero status code):

opcua.StatusCode != 0

5. How to Read a Decoded OPC UA Packet

Hello Message

OpcUa Binary Protocol
    Message Type: HEL
    Chunk Type: F (Final)
    Message Size: 61
    ProtocolVersion: 0
    ReceiveBufferSize: 65535
    SendBufferSize: 65535
    MaxMessageSize: 16777216
    MaxChunkCount: 5000
    EndpointUrl: opc.tcp://192.168.1.50:4840

ReadRequest

OpcUa Binary Protocol
    Message Type: MSG
    ServiceId: ReadRequest (631)
    NodesToRead:
        NodeId: ns=2; s="Channel1.Device1.Temperature"
        AttributeId: Value (13)

ReadResponse

OpcUa Binary Protocol
    Message Type: MSG
    ServiceId: ReadResponse (634)
    Results:
        Value: 23.5 (Double)
        StatusCode: Good (0x00000000)
        SourceTimestamp: 2026-04-10 14:30:15.123

6. What a Healthy OPC UA Session Looks Like

#DirectionInfo
1Client → ServerTCP SYN
2Server → ClientTCP SYN-ACK
3Client → ServerTCP ACK
4Client → ServerHEL — Hello (endpoint URL, buffer sizes)
5Server → ClientACK — Acknowledge (negotiated buffer sizes)
6Client → ServerOPN — OpenSecureChannelRequest
7Server → ClientOPN — OpenSecureChannelResponse
8Client → ServerMSG — GetEndpointsRequest
9Server → ClientMSG — GetEndpointsResponse
10Client → ServerMSG — CreateSessionRequest
11Server → ClientMSG — CreateSessionResponse
12Client → ServerMSG — ActivateSessionRequest
13Server → ClientMSG — ActivateSessionResponse
14Client → ServerMSG — BrowseRequest / ReadRequest / CreateSubscriptionRequest
Service calls continue
NClient → ServerMSG — CloseSessionRequest
N+1Client → ServerCLO — CloseSecureChannelRequest

The sequence is always: HEL → ACK → OPN → CreateSession → ActivateSession → Services → CloseSession → CLO

7. Decoding Encrypted OPC UA Traffic

OPC UA supports three security modes:

Security ModeWhat Wireshark Shows
NoneFull decoded service content — all fields visible
SignService content visible, but a signature is appended
SignAndEncrypt“UA Secure Conversation Message (encrypted)” — content hidden

How to Decrypt in Wireshark

OPC UA encryption uses ephemeral symmetric keys derived during the OpenSecureChannel handshake. To decrypt:

Step 1. Set the environment variable OPCUAKEYLOGFILE on the OPC UA client or server machine:

# Linux
export OPCUAKEYLOGFILE=/tmp/opcua_keys.log

# Windows
set OPCUAKEYLOGFILE=C:\temp\opcua_keys.log

The OPC UA stack (if it supports key logging) writes session keys to this file.

Step 2. In Wireshark: Edit → Preferences → Protocols → OpcUa → OPCUA debug file → point to the key log file.

Step 3. Stop capture, save as .pcapng, reopen. Wireshark decrypts the traffic on reload.

⚠️ Note: Not all OPC UA stacks support key logging. Unified Automation SDK and UaExpert support it. Open62541 has partial support. Check your stack documentation. If key logging is not available, temporarily switch to SecurityPolicy None for debugging (do not leave this in production).

UaExpert Built-in Support

UaExpert (free OPC UA client from Unified Automation) has built-in key logging and can inject keys into .pcapng files directly using Wireshark’s editcap tool.

8. Diagnosing Connection and Session Failures

No Connection at All

Filter: tcp.port == 4840

What You SeeCauseFix
TCP SYN, no SYN-ACKServer offline or port blockedCheck server status. Check firewall for port 4840.
HEL sent, ERR receivedServer rejected the HelloCheck endpoint URL. Server may not accept the client’s buffer sizes.
OPN sent, ERR receivedSecurity policy mismatchClient and server must agree on SecurityPolicy and MessageSecurityMode.

Session Creation Fails

Filter: opcua.ServiceId == 461 || opcua.ServiceId == 464

What You SeeCauseFix
CreateSessionResponse with bad StatusCodeServer rejected the sessionCheck StatusCode for the reason (e.g., BadTooManySessions, BadCertificateInvalid).
ActivateSessionResponse with BadUserAccessDeniedWrong credentialsCheck username/password or certificate.
ActivateSessionResponse with BadIdentityTokenRejectedUnsupported authentication typeServer may not support anonymous or username/password. Check server security config.

9. Diagnosing Read and Write Problems

Read Failures

Filter: opcua.ServiceId == 634 (ReadResponse)

Click the ReadResponse and check each result’s StatusCode:

StatusCodeMeaningCommon Cause
Good (0x00000000)Value read successfullyOK
BadNodeIdUnknownNode does not existWrong NodeId string or namespace index
BadAttributeIdInvalidAttribute not supportedTrying to read an attribute the node does not have
BadNotReadableNode is not readableAccess level does not allow reading
BadUserAccessDeniedUser not authorizedCurrent session does not have read permission

Write Failures

Filter: opcua.ServiceId == 676 (WriteResponse)

StatusCodeMeaningCommon Cause
BadNotWritableNode is not writableAccess level is read-only
BadTypeMismatchWrong data typeWriting a string to a numeric node
BadOutOfRangeValue out of allowed rangeValue exceeds the configured limits

10. Diagnosing Subscription and Publish Problems

OPC UA subscriptions let the server push data changes to the client without polling.

No Data Updates

Filter: opcua.ServiceId == 829 (PublishResponse)

What You SeeCauseFix
PublishResponse with no data changesNo values changed since last publishNormal if nothing changed. Check MonitoredItem sampling interval.
No PublishResponse at allSubscription not created or client not sending PublishRequestCheck CreateSubscriptionResponse for success. Verify client sends PublishRequest.
PublishResponse with StatusCode != GoodSubscription errorCheck specific error code. May be BadSubscriptionIdInvalid or BadTooManyPublishRequests.

Publish Timing

OPC UA clients must continuously send PublishRequests to the server. If the client stops sending them, the server stops pushing data. Count the PublishRequests — there should be a steady stream.

Filter: opcua.ServiceId == 826 (PublishRequest)

11. Diagnosing Certificate and Security Issues

Filter: opcua.transport.type == "ERR" or opcua.StatusCode != 0

ErrorMeaningFix
BadCertificateInvalidServer does not trust the client certificateImport the client certificate into the server’s trusted store
BadCertificateUntrustedCertificate not in the trust listAdd the certificate to the server’s trust list or PKI store
BadCertificateTimeInvalidCertificate has expiredRenew the certificate
BadCertificateHostNameInvalidCertificate hostname does not match the endpointRegenerate the certificate with the correct hostname/IP
BadSecurityPolicyRejectedClient’s security policy not supported by serverCheck which SecurityPolicies the server supports (GetEndpoints response)

12. Useful Wireshark Columns for OPC UA Analysis

Column TitleTypeField Name
Service IDCustomopcua.ServiceId
Status CodeCustomopcua.StatusCode
Channel IDCustomopcua.ChannelId
Endpoint URLCustomopcua.EndpointUrl
Delta TimeCustomframe.time_delta_displayed

13. Common OPC UA Problems and What They Look Like in Wireshark

ProblemWireshark SymptomFilter
Server offlineTCP SYN with no SYN-ACKtcp.flags.syn == 1 && tcp.port == 4840
Wrong port configuredNo OPC UA decoding (raw TCP)Set port in Preferences → Protocols → OpcUa
Hello rejectedERR message after HELopcua.transport.type == "ERR"
Security policy mismatchERR after OPN, or bad StatusCodeopcua.SecurityPolicyUri — compare client vs server
Certificate rejectedStatusCode BadCertificateInvalidopcua.StatusCode != 0
Bad credentialsActivateSession failsopcua.ServiceId == 470 — check StatusCode
Node not foundReadResponse with BadNodeIdUnknownopcua.ServiceId == 634 — check per-result StatusCode
Encrypted traffic“UA Secure Conversation Message (encrypted)”Load OPCUAKEYLOGFILE in Preferences → Protocols → OpcUa
No subscription dataNo PublishResponse packetsopcua.ServiceId == 829
Slow responseLarge time deltaopcua && frame.time_delta > 2

Summary

Wireshark decodes the full OPC UA binary protocol — from Hello/Acknowledge through every service call to CloseSecureChannel.

The key things to remember:

  • OPC UA runs on TCP port 4840 by default. Many servers use custom ports — configure them in Preferences → Protocols → OpcUa.
  • Use opcua as the main display filter
  • Use opcua.transport.type to filter by message type (HEL, ACK, OPN, MSG, CLO, ERR)
  • Use opcua.ServiceId to filter by specific services (631=Read, 673=Write, 829=PublishResponse)
  • Use opcua.StatusCode != 0 to find all failed operations
  • Encrypted traffic requires the OPCUAKEYLOGFILE environment variable and key log loading in Wireshark
  • The session sequence is always: HEL → ACK → OPN → CreateSession → ActivateSession → Services → Close
  • If OPC UA shows as raw TCP, the port is not configured in Wireshark preferences
Author: Zakaria El Intissar

I'm an automation and industrial computing engineer with 12 years of experience in power system automation, SCADA communication protocols, and electrical protection. I build tools and write guides for Modbus, DNP3, IEC 101/103/104, and IEC 61850 on ScadaProtocols.com to help engineers decode, analyze, and troubleshoot real industrial communication systems.

Leave a Reply

Your email address will not be published. Required fields are marked *