Modbus UDP versus TCP
When using Wireshark to capture Modbus TCP packets, it will detect and display if one TCP packet contains more than one query. This is correct according to the Modbus TCP specification, where the transaction ID in the header is used to identify each query.
But when using UDP instead of TCP, then Wireshark does not show if there are more than one Query in the packet. In the packet data, I can see that there are several queries, but Wireshark does not display this, as it does for the Modbus TCP.
Is this something that can be fixed in Wireshark?
Can you provide a sample capture with multiple queries in a UDP frame?
Any links to a standard or RFC that support this?
epan/dissectors/packet-mbtcp.c:
dissect_mbudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { if (!is_mbtcp(tvb, pinfo)) return 0; /* Make entries in Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Modbus/UDP"); col_clear(pinfo->cinfo, COL_INFO); return dissect_mbtcp_pdu_common(tvb, pinfo, tree, proto_mbudp, global_mbus_udp_ports); }Looks like the code just does the first PDU for UDP.
I tried to copy capture file in here, but looks like I need more points to do that. I can copy the bytes from the message here, if that helps.
The format follows the Modbus Messaging on TCP/IP Implementation Guide V1.0b from october 2006, chapter 4.2.1.1, and rule number 4. It uses the transaction identifier to relate queries and responses.
Here is the hex dump of the bytes from the UDP request containing the 4 queries in one UDP telegram. The transaction identifiers are 0,1,2 and 3, to identify each query. I have marked each transaction identifier in bold.
0000 00 a0 1d 2c b7 98 00 a0 1d 13 b0 1f 08 00 45 00 0010 00 4c b8 50 40 00 40 11 f6 f4 c0 a8 85 09 c0 a8 0020 85 01 da ce 01 f6 00 38 91 ...(more)
(The comment above had reached max comment size so reposting as two comments)
I tried to copy capture file in here, but looks like I need more points to do that. I can copy the bytes from the message here, if that helps.
The format follows the Modbus Messaging on TCP/IP Implementation Guide V1.0b from october 2006, chapter 4.2.1.1, and rule number 4. It uses the transaction identifier to relate queries and responses.
Here is the hex dump of the bytes from the UDP request containing the 4 queries in one UDP telegram. The transaction identifiers are 0,1,2 and 3, to identify each query. I have marked each transaction identifier in bold.
(more)(Repost second section. This hex dump may be truncated due to max comment size above?)
(more)The response hex dump is also packed into one UDP telegram as follows, and I have marked the related transaction identifiers in bold also here.
The capture file can be placed on a public file share then the question updated with a link to it.