Skip to content

(Inconsistency) Violation of the requirement of Unit Identifier. #834

@ProtocolSpecCheck

Description

@ProtocolSpecCheck

Hi,

I would like to bring your attention a violation between the protocol implementation and the specification regarding the MODBUS/TCP Unit Identifier requirement written in the Modbus Application Protocol Specification:

Requirements in the specification:

For Modbus TCP, the value of Unit Identifier must be defined as 0xFF or 0x00.

Image

How does libmodbus violate this requirement?

Libmodbus lacks validation for the Unit identifier value, accepting request with invalid Unit Identifier value.

  • Terminal-1(server): ./tests/bandwidth-server-many-up
  • Terminal-2(client): send the request with invalid Unit Identifier value, send b'\x00\x01\x00\x00\x00\x06\x0a\x0f\x00\x00\x00\x01\x01\x01'.
  • Server behaviour: Regardless of the value of the Unit Identifier, the server will ignore the check and treat it as valid, recv b'\x00\x01\x00\x00\x00\x06\x0a\x0f\x00\x00\x00\x01'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions