COTP
COTP (Connection-Oriented Transport Protocol, ISO 8073 / RFC 905) layered over TPKT and TCP - the "ISO on TCP" stack that Siemens S7 equipment speaks. It is a TCP transport that performs the COTP connection handshake and negotiates a TPDU size before the driver sees the connection.
Because the handshake carries the TSAPs that address a specific rack and slot, this transport is what the S7 driver uses by default. Drivers normally derive the TSAP values themselves - override them only if you know the device expects something else.
Transport syntax
{IP address or hostname}[:{port}]
The port defaults to the driver’s default, which is 102 for S7.
s7://10.0.0.1
s7:cotp://10.0.0.1:102?cotp.tpdu-size=1024
Name |
Type |
Default Value |
Required |
Description |
Name |
COTP |
|||
Code |
|
|||
Maven Dependency |
<dependency> <groupId>org.apache.plc4x</groupId> <artifactId>plc4j-transports-cotp</artifactId> <version>1.0.0</version> </dependency> |
|||
Config options: |
||||
|
INT |
0 |
Local TSAP (Transport Service Access Point) identifier. |
|
|
INT |
0 |
Remote TSAP (Transport Service Access Point) identifier. |
|
|
INT |
8192 |
COTP PDU size for data transmission. Valid values: 128, 256, 512, 1024, 2048, 4096, 8192. |
|
|
INT |
5000 |
Connection timeout for COTP handshake in milliseconds. |
|
|
INT |
0 |
COTP protocol class to use. Class 0 is most commonly used (simple class, no flow control). |
|
|
INT |
5000 |
Connection timeout in milliseconds. |
|
|
INT |
0 |
Socket read timeout in milliseconds. 0 means no timeout. |
|
|
INT |
0 |
Socket write timeout in milliseconds. 0 means no timeout. |
|
|
BOOLEAN |
true |
Enable TCP_NODELAY (disable Nagle’s algorithm). |
|
|
BOOLEAN |
false |
Enable SO_KEEPALIVE. |
|
|
INT |
81920 |
Send buffer size in bytes. 0 uses system default. |
|
|
INT |
81920 |
Receive buffer size in bytes. 0 uses system default. |
|
|
STRING |
Local address to bind to (optional). If not set, uses default. |
||
|
INT |
0 |
Local port to bind to (optional). 0 uses ephemeral port. |
|
The socket options are inherited from the TCP transport and behave identically.