S7comm (S7 Communication)
What is S7comm (S7 Communication)?
S7comm (S7 Communication) is the proprietary Siemens protocol that S7-300/400 PLCs, engineering software and SCADA systems use for PLC programming, data exchange and diagnostics, carried over ISO-on-TCP on TCP port 102. AdminKit explains how an S7 connection is set up and why port 102 should not be reachable from the internet.
By AdminKit team, Netbase JSC · Updated
S7comm (S7 Communication) is the protocol Siemens S7 programmable logic controllers (PLCs) speak with the engineering software that programs them, with SCADA systems that read their data, and with each other. The Wireshark wiki entry on S7comm describes it as a Siemens proprietary protocol used between PLCs of the S7-300/400 family for PLC programming, data exchange between PLCs, SCADA access to PLC data and diagnostics, and notes that Siemens has used it since the Simatic S7 product line launched in 1994.
How does an S7comm connection work?
On Ethernet, S7comm is stacked on two older ISO transport layers. TPKT, from RFC 1006, carries ISO transport over TCP on port 102; COTP (ISO 8073) runs inside it; and the S7comm message sits inside COTP, always starting with the protocol identifier byte 0x32. A client connects in three steps:
- Open a TCP connection to the PLC on port 102.
- Send a COTP connection request whose destination TSAP encodes the connection type and the rack and slot of the PLC’s CPU.
- Send an S7comm setup-communication request to agree details such as the PDU size.
After that, each message is a command or a reply to one. The Snap7 overview of Siemens communications, from an open-source S7 library, groups the commands into data read/write, cyclic data, directory and system information, block moves, PLC control, date and time, security and programming. It also notes that Siemens provides plenty of documentation on using the protocol but no internal protocol specification, so third-party tools are built from traffic analysis. To filter it in a capture:
tcp port 102
Why does an exposed port 102 matter?
A host that can complete those three steps can read PLC data and, depending on the controller’s protection settings, write data, stop the CPU or download program blocks. That is what made S7 controllers a target for Stuxnet: MITRE ATT&CK records that it copied itself into Siemens Step 7 project files, downloaded altered code and data blocks to the PLC, and specifically targeted S7-300 series CPUs. Like Modbus/TCP and DNP3, S7comm was designed for plant networks, and NIST SP 800-82 recommends keeping such ICS/OT networks segmented from business networks and the internet.
AdminKit’s port check does not test port 102; its fixed list covers nine TCP ports, including Modbus on 502. For that protocol, AdminKit’s Modbus check shows whether a Modbus/TCP device on your own public IP answers from the internet.
AdminKit groups S7comm under its machine protocols cluster — browse the AdminKit glossary index for other related terms.
Frequently asked questions
What port does S7comm use?
TCP port 102. S7comm rides on ISO-on-TCP (RFC 1006), and port 102 is the well-known port IANA lists as iso-tsap for that transport.
What can an S7comm client do on a PLC?
The protocol carries reads and writes of PLC data, PLC control commands such as start and stop, date and time, directory and system information, and program block uploads and downloads, which is how engineering software programs the controller.
Is there a public specification for S7comm?
No. Siemens documents how to use S7 communication but does not publish the internal protocol specification, so open-source tools such as the Wireshark dissector and the Snap7 library are based on analysis of the traffic.
Does AdminKit's port check test port 102?
No. AdminKit's port check probes a fixed list of nine TCP ports, and 102 is not one of them. AdminKit's Modbus check covers Modbus/TCP on port 502 only.