Protocol 109 of 81Layer 7FrameAssembly v3.3.0
Raw .mdllms-full.txt
s7commplusSiemens SIMATIC S7-1200 / S7-1500 S7commPlus OMS Protocol

s7commplus — Port 102 S7-1200/1500 0x72 OMS+ Symbolic Sessions

Default Port / Protocol
TCP 102 (TPKT + COTP + 0x72)
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
s7comm-plus || cotp
Standards & Specs
RFC 1006 (ISO-on-TCP), ISO 8073 COTP, Siemens OMS+ / S7commPlus
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6TCP 102 (TPKT + COTP + 0x72)Siemens S7commPlus
L2 Tagging: vlan · qinq · repeatable mpls · fcsHost Family: Dual-Stack IPv4/IPv6L3 QoS & TTL: ttl · dscp · ecnL4 State: Auto 4-tuple seq / acknum

What It Does on the Wire

Modern Siemens S7-1200 and S7-1500 PLCs replaced classic 0x32 s7comm with 0x72 s7commplus on TCP 102 — validate your OT IDS against TIA Portal createobject, getmultivariables, and setmultivariables sessions.

Siemens S7commPlus (s7commplus) is the modern object-oriented Object Management System (OMS+) protocol used by TIA Portal, WinCC Unified, and SIMATIC S7-1200 / S7-1500 PLCs on TCP port 102 (RFC 1006 TPKT + ISO 8073 COTP). Unlike classic s7comm (Protocol ID 0x32), S7commPlus frames begin with Protocol ID 0x72, a protocol Version (1, 2, or 3 with TLS/integrity trailer), 16-bit Data Length, Opcode (0x31 Request, 0x32 Response, 0x33 Notification), 16-bit Function Code (0x04ca CreateObject session setup, 0x0542 GetMultiVariables, 0x0552 SetMultiVariables, 0x0586 DeleteObject), Sequence Number, and Session ID.

FrameAssembly wraps 0x72 S7commPlus headers and trailing 0x72 <version> 00 00 end-markers inside valid TPKT + COTP DT frames over stateful TCP port 102.

01. Application

Purdue Level 1/2 Firewall Deep-Packet Inspection (0x32 vs 0x72)

Verify industrial firewalls (Claroty, Dragos, Nozomi, Palo Alto Industrial, FortiGate OT) distinguish modern S7-1500 s7commplus (0x72) TIA Portal writes from legacy S7-300/400 s7comm (0x32).

02. Application

Unauthorized PLC Variable Write (SetMultiVariables 0x0552) Detection

Simulate an engineering workstation establishing an OMS+ session (CreateObject 0x04ca) followed by SetMultiVariables (func "write") to trigger OT IDS write-alert rules safely.

03. Application

S7-1500 Firmware v1/v2 vs v3 (version 3) Dissector Regression

Test packet-capture sensors across S7commPlus version 1, version 2, and TIA Portal v17+ version 3 framing.

Fig. 1 · RFC Octet & Bit Schematic

RFC Wire Header Layout (s7commplus)

Select any 32-bit wire word or field slice below to inspect which .frasm modifiers control those octets and what defaults the compiler writes.

0 ··············· 15 · 16 ··············· 31 bit
Selected Wire Segment
Siemens S7commPlus Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
s7commplus version · opcode · func · seqnum · sessionid · payload · hexpayload
Compiler Default Behavior
RFC-compliant Siemens S7commPlus defaults (RFC 1006 (ISO-on-TCP))
Wireshark Dissection Note · Inspecting Siemens 0x72 S7commPlus Sessions on TCP 102

Expand TPKT -> ISO 8073 COTP -> S7comm-Plus (0x72 protocol ID) on TCP 102 to verify header/trailer framing, Session ID, Opcode, and Function codes for S7-1200/1500 PLCs.

Minimal Quickstart (s7commplus_quickstart.frasm)

Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.

s7commplus_quickstart.frasm10 lines
Open in Playground
host tia_portal { ip 192.168.10.20 }
host s7_1500 { ip 192.168.10.100 }
compile {
tia_portal -> s7_1500 tcp syn srcport 51102 dstport 102 wait 1ms
tia_portal <- s7_1500 tcp syn ack wait 1ms
tia_portal -> s7_1500 tcp ack wait 1ms
tia_portal -> s7_1500 s7commplus version 2 opcode 0x31 func "createobject" seqnum 1 sessionid 0 wait 2ms
tia_portal <- s7_1500 s7commplus version 2 isresponse func "createobject" seqnum 1 sessionid 0x000003e8
}

Handled Automatically on the Wire

  • Defaults to stateful TCP port 102 and prepends the 4-byte RFC 1006 TPKT (03 00 <len>) + 3-byte ISO 8073 COTP DT Data (02 f0 80) headers automatically.
  • Frames the inner 0x72 S7commPlus header, calculates the 16-bit OMS+ data block length, and appends the mandatory 4-byte 0x72 <version> 00 00 trailer.
  • Sets Opcode = 0x32 (Response) automatically whenever isresponse or response is specified.
Multi-Frame Example

TIA Portal <-> SIMATIC S7-1500 Session: CreateObject, GetMultiVariables & SetMultiVariables

Opens TCP 102 to a SIMATIC S7-1500 CPU, negotiates an S7commPlus session (CreateObject 0x04ca), reads symbolic PLC tags (GetMultiVariables 0x0542), and executes a tag write (SetMultiVariables 0x0552).

s7commplus_tia_portal_session.frasm17 lines
Open in Playground
host eng_laptop { ip 10.110.2.15 }
host plc_s71516 { ip 10.110.1.50 }
compile {
eng_laptop -> plc_s71516 tcp syn srcport 53102 dstport 102 win 65535 mss 1460 wait 1ms
eng_laptop <- plc_s71516 tcp syn ack win 65535 mss 1460 wait 1ms
eng_laptop -> plc_s71516 tcp ack wait 1ms
// 1. OMS+ Session Establishment: CreateObject (0x04ca) assigns Session ID 0x01000234
eng_laptop -> plc_s71516 s7commplus version 3 opcode 0x31 func 0x04ca seqnum 1 sessionid 0 id 0x010d wait 3ms
eng_laptop <- plc_s71516 s7commplus version 3 isresponse func 0x04ca seqnum 1 sessionid 0x01000234 wait 5ms
// 2. Symbolic Tag Poll: GetMultiVariables (0x0542 / "read")
eng_laptop -> plc_s71516 s7commplus version 3 func "read" seqnum 2 sessionid 0x01000234 id 0x8a0e0001 wait 2ms
eng_laptop <- plc_s71516 s7commplus version 3 isresponse func "read" seqnum 2 sessionid 0x01000234 wait 10ms
// 3. Tag Write: SetMultiVariables (0x0552 / "write") -> triggers OT write-policy inspection
eng_laptop -> plc_s71516 s7commplus version 3 func "write" seqnum 3 sessionid 0x01000234 id 0x8a0e0002 wait 2ms
eng_laptop <- plc_s71516 s7commplus version 3 isresponse func "write" seqnum 3 sessionid 0x01000234
}
Terminal Commands (FrameAssembly CLI v3.3.0)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show s7commplus_tia_portal_session.frasm

# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly s7commplus_tia_portal_session.frasm s7commplus_tia_portal_session.pcap
frameassembly s7commplus_tia_portal_session.frasm s7commplus_tia_portal_session.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse s7commplus_tia_portal_session.pcap s7commplus_tia_portal_session_edited.frasm

# 4. Verify dissected protocol fields in tshark
tshark -r s7commplus_tia_portal_session.pcap -Y "s7comm-plus || cotp"

All s7commplus Keywords & Header Options

Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after s7commplus:

src_host -> dst_host s7commplus [version <1..3>] [opcode "<text_or_num>"] [isresponse | response] [func "<text_or_num>"] [seqnum <0..65535>] [sessionid <number>] [id <number>] [flags <0..255>]
Keyword / OptionAccepted ValueDefaultEffect on Packet
version <1..3>8-bit S7commPlus Protocol Version (1, 2, or 3)2Sets the Version byte immediately following the 0x72 magic byte in both header and trailer.
opcode "<text_or_num>" | isresponse | response8-bit OMS+ Opcode (0x31 Request, 0x32 Response, 0x33 Notification)0x31 (Request); 0x32 when isresponse/response is setSets the S7commPlus message Opcode byte.
func "<text_or_num>"16-bit Function Code or mnemonic ("read","write","createobject","deleteobject","explore")0x0542 (GetMultiVariables / read)Writes the 16-bit OMS+ Function Code (0x04ca CreateObject, 0x04d4 Explore, 0x0542 GetMultiVariables, 0x0552 SetMultiVariables, 0x0586 DeleteObject).
seqnum <0..65535>16-bit PDU Sequence Number1Writes the big-endian 2-byte transaction Sequence Number.
sessionid <number> | id <number> | flags <0..255>32-bit Session ID, 32-bit Object/Integrity ID, and 8-bit Transport Flagssessionid 1, id 0, flags 0x36Populates the 32-bit OMS+ Session ID, target Object ID, and transport flags.

Cross-Layer Wrappers Valid with s7commplus

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

15 options
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back).
comment "<text>"Quoted UTF-8 annotationOmittedAttaches an Enhanced Packet Block opt_comment annotation when compiling to .pcapng (Wireshark pkt_comment filter).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef", "de:ad:be:ef", or "\x01\x02") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac> | ethertype <0..65535>Colon/hyphen/Cisco MAC · EtherType 0..65535 (e.g. 0x0800)Host MAC / RFC multicast MAC / auto EtherTypeOverrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType.
fcs | badfcsEthernet CRC-32 trailer flags (choose one)Omittedfcs appends a valid IEEE 802.3 4-byte CRC-32 Frame Check Sequence trailer; badfcs XOR-corrupts the CRC-32 for NIC/tap negative tests.
vlan <0..4095> [pcp <0..7>] [dei <0|1>]VLAN ID 0..4095, PCP 0..7, DEI 0..1UntaggedWraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority.
qinq <0..4095> [innervlan <0..4095>]Outer S-VLAN 0..4095, Inner C-VLAN 0..4095Untagged (innervlan 1 when qinq is set)Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100).
mpls <0..1048575> [label <0..1048575>] [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>]Repeatable label stack (0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255)Unlabeled (auto bos=0 on outer labels, bos=1 on bottom)Prepends one or more 32-bit MPLS label shims (0x8847, e.g. mpls 16000 mpls 24010) ahead of Layer 2 EoMPLS or Layer 3 payloads.
ttl <0..255> [dscp <0..63>] [ecn <0..3>]TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3ttl 64, dscp 0, ecn 0Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings.
ipid <0..65535> [df] [mf] [fragoffset <0..8191>] [routeralert] [badipchecksum]IPv4 ID, DF/MF flags, offset 0..8191, Router Alert & checksum faultipid 1, flags 0, fragoffset 0, valid RFC 1071 checksumSets IPv4 Identification/fragmentation, injects RFC 2113 Router Alert (20 04 00 00), or corrupts the 16-bit IPv4 header checksum (badipchecksum).
flowlabel <0..1048575>20-bit IPv6 Flow Label (0..1048575)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (valid on IPv6 endpoint pairs only).
srcport <0..65535> | dstport <0..65535>Port number 0..65535srcport 49152 (remembered), TCP 102 (TPKT + COTP + 0x72)Overrides source or destination port and remembers the port pair automatically on <- replies.
transport sctpOptional SCTP association transport (IP Proto 132)TCP (TCP 102 (TPKT + COTP + 0x72))Carries this Layer 7 PDU inside a stateful RFC 9260 SCTP DATA chunk with automatic Verification Tag, TSN tracking, and CRC-32c.
badchecksumL4/ICMP/SCTP checksum fault injection flagValid RFC checksum / CRC-32cDeliberately corrupts the TCP, SCTP CRC-32c, ICMP, or ICMPv6 checksum for negative IDS/firewall testing.
seq <number> | acknum <number> | win|window <0..65535> | urgent <0..65535> | syn | ack | psh | fin | rst | urg | ece | cwrTCP sequence/ack numbers, window, flags, SACK, TCP-MD5 & TFO optionspsh ack, win 65535, automatic TCP seq/acknumOverrides automatic TCP sequence tracking, flags, or RFC 7323/2018/2385/7413 options (mss, wscale, sackperm, sackblock, tsval, tsecr, tcpmd5, tfo).

Gotchas & Quick Fixes

Use s7commplus for S7-1200/S7-1500 (0x72) and s7comm for S7-300/S7-400 (0x32)

Valid v3.3.0 Syntax
hmi -> s7_1500 s7commplus version 3 func "read" seqnum 1 sessionid 100

Both protocols share TCP port 102 (TPKT + COTP), but S7-1200/1500 optimized data blocks use 0x72 (s7commplus) instead of classic 0x32 (s7comm).

Match seqnum and sessionid on PLC Responses

Valid v3.3.0 Syntax
hmi -> plc s7commplus func "read" seqnum 5 sessionid 200 hmi <- plc s7commplus isresponse func "read" seqnum 5 sessionid 200

OT IDS state engines track (sessionid, seqnum) pairs to correlate PLC responses and flag injected rogue SetMultiVariables requests.

Field Guide 03
Poke Stateful Firewalls, Suricata, Zeek & OT Conduits