Week 5 - Modbus Protocol Flashcards

1
Q

Serial Protocols (RS-232 and RS-485)

A

Among the oldest and still widely used protocols.

They have low data rates (around 20 kbits/s) and no IP network or internet connectivity.

Variants are implemented in various devices like microcontrollers, embedded systems, single-board computers, and more.

Extremely basic and lack built-in security features.

Often used as a foundation for developing other protocols like Modbus Serial.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Modbus

A

protocol published by Modicon (now Schneider Electric) in 1979 for PLCs.

It is widely used in the industry, openly published, and royalty-free.

connects supervisory computers with remote terminal units (RTUs) in SCADA systems.

It uses terms like “master-slave” or “client-server” and has evolved to Modbus TCP for Ethernet and IP/TCP communication.

Queries follow a specific structure called a Modbus Frame, and Modbus supports data types like inputs, coils, input registers, and holding registers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Modbus Frame

A

Modbus application protocol defines what is known as a Protocol Data Unit (PDU) which is completely independent of the underlying communication layers, be it TCP/IP or Serial.

The structure of the PDU is always the same, and it is only encapsulated depending on the type of physical connection (serial or TCP/IP communication).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Modbus Data types

A

Inputs (discrete input),
Coils,
Input register (input data),
Holding register (output data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Inputs (discrete input)

A

1 bit of data (0 or 1), can only be read by a client, and its value is altered by I/O.

For instance, if I/O pins sense 5 volts, its value will change to 1, and zero volts make it 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Coils

A

1 bit of data (0 or 1), can be written to (or read from) by the client.

For instance, the client makes the value of a Coil 1, which means a specific I/O pin becomes 5 volts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Input register (input data)

A

16 bits (2 bytes or 1 word), controlled by I/O.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Holding register (output data)

A

16 bits (2 bytes or 1 word), controlled by the user program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Modbus functions

A

Read Discrete Inputs
Read Coils
Write Single Coil
Write Multiple Coils
Read Input Registers
Read Multiple Holding Registers
Write Single Holding Register
Write Multiple Holding Registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

PDU in transit

A

PDU structure is always the same, and PDU is only encapsulated depending on the type of physical connection (i.e., serial or TCP/IP communication.

This encapsulation introduces additional fields on the PDU depending on the type of
communication, this encapsulation is called Application Data Unit (ADU).

Function Code - Data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

PDU in transit (serial)

A

Address Field,
Error Checking (CRC/LRC);

Addresses - Function Code - Data - CRC (or LRC)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Address Field

A

Slave address (master uses to specify the slave/server) ranges from 1 to 247.

Slave responses by placing its own address in this field to let the master know which slave is responding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Error check (CRC/LRC) Field

A

This is often 16-bit redundancy that is calculated depending on the rest of the PDU content and can indicate and correct some level of transmission error.

Stands for Cyclic and Longitudinal Redundancy Check.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

PDU in transit (TCP/IP)

A

Modbus has defined PDU regardless of TCP/IP or Serial
communication

Modbus TCP has its own encapsulation of this fixed PDU for transmission over IP network, the encapsulated PDU is called Application Data Unit (ADU)

MBAP Header - Function Code - Data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Modbus Protocol Application header (MBPA)

A

Transaction identifier (2 bytes),
Protocol identifier (2 bytes),
Length (2 bytes),
Unit identifier/device address ( 1 byte);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Transaction identifier (2 bytes)

A

It is used for pairing the transactions of the server and
client.

Its value is set by the client to identify each request.

same value is repeated by the server device in the response.

17
Q

Protocol identifier (2 bytes)

A

Where 0 indicates modbus TCP and 1 indicates modbus RTU.

18
Q

Length (2 bytes)

A

This is set by master and slave, identifying the number of bytes in the
message that follow.

It is counted from Unit Identifier to the end of the message.

19
Q

Unit identifier/device address ( 1 byte)

A

This value is set by the master to identify and
address a specific slave.

The same value is repeated by the slave in the response to identify
itself.

Used for accessing modbus RTU devices over the gateway in a TCP/IP modbus.

Modbus TCP/IP uses the IP address anyways and unit identifier is meaningless in that case and might have any value.

20
Q

Modbus PDU

A

Function code (1 byte): identifies what needs to be done.

Address of first memory (2 bytes).

21
Q

PDU in transit (TCP/IP vs RTU)

A

Modbus RTU has error correction overhead in the form of CRC/LRC, not present in Modbus TCP ADU.

Slave ID or Unit ID is the same, but not used in Modbus TCP unless for communicating with a legacy Modbus serial device.

Modbus ADU contains MBAP header which contains additional info.

22
Q

Modbus limitations

A

Limited number of data types: Boolean/bit and Integer/byte.

Large binary objects are often not supported.

No standard way to find the description of data.

It’s a client/server (master/slave) protocol, so field devices (servers) cannot initiate data requests.

Limited to addressing 247 devices on one data link.

Provides no security against unauthorized commands or data interception.

23
Q

Profibus

A

A common ICS protocol.

Comes in two common forms: Profibus-DP and Profibus-PA.

Full duplex communication.

Uses RS-485 protocol for signaling and cables.

24
Q

Profinet

A

Based on Ethernet and Profibus.

Designed for low latency applications.

Higher data transmission speed compared to Profibus.

Uses Profinet Ethernet cables.

Provides more flexibility and capabilities for both client-initiated and server-initiated events.