A software engineer in my group is using Wireshark to help in some CAN bus performance testing. He tells me that the bit rate as reported by Wireshark exceeds the CAN bus configured bit rate, For example, the CAN bus configured bit rate is 100 Kbps and the measured bit rate (as reported by Wireshark) is 111 Kbps. How can this be? asked 15 Apr '13, 21:52 smilnor edited 16 Apr '13, 00:23 Guy Harris ♦♦ showing 5 of 9 show 4 more comments |
One Answer:
Looking at a CANbus capture (done with the "virtual" CANbus on a (virtual :-)) Linux box), the packets have:
followed by payload data. The "Frames" section of the Wikipedia page about CANbus shows the frame header as having a start-of-frame bit, an 11-bit identifier, two flags from the aforementioned 4-byte field, a reserved bit, a 4-bit length code, a data field, a 15-bit CRC, a 1-bit CRC delimiter, a 1-bit ACK slot, a 1-bit ACK delimiter, and a 7-bit EOF. So a frame with n bytes of payload data would, on the wire, have 19 bits of header, n*8 bits of payload data, 16 bits of CRC, 2 bits of ACK stuff, and 7 bits of EOF, for a total of 44 + n*8 bits, and would, in the capture, have 32 bits of flags+identifier, 8 bits of frame length, 8 bits of whatever, and n*8 bits of payload data, for a total of 48 + n*8 bits. I.e., the frame from which Wireshark calculates the bit rate has 4 more bits than it would have on the wire, and thus would exceed the actual on-the-wire bit rate. answered 16 Apr '13, 11:52 Guy Harris ♦♦ edited 16 Apr '13, 19:56 |
Whitout knowing the protocol or implementation - perhaps some meta data in the packets wireshark reads is counted too?
which 'module' of Wireshark shows that value (how did you generate that report)?
The statistics module for iograph was used to plot bits/tick with tick set at 1 second. The captured data came from the CAN dev interface on a 12.04 Linux desktop.
O.K. then see the answer of @Guy Harris.
The Peak USB to CAN adapter was configured as a NET device so we could use Wireshark to capture data
I agree that metadata is causing the higher than expected results but after looking through the data I do not see where it is coming from.
The delta between the bit rate in Wireshark and the bus, comes from the difference how the bit rate was calculated: net values for the CAN bus, gross values for Wireshark (protocol overhead).
When the CAN bus is configured at 100 Kbps, it can only transmit at 100 Kbps - whether it is payload information or payload plus overhead.
I could see the payload plus overhead being reported at the full wirespeed of 100 Kbps, and the payload reported at something less than 100 Kbps. But to report anything going more than the 100 Kbps does not make sense to me.
Still confused ....
Wireshark's calculated bit rate is not real. See my updated answer.