This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Bit Rate Measurements

0

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's gravatar image

smilnor
1111
accept rate: 0%

edited 16 Apr '13, 00:23

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196

Whitout knowing the protocol or implementation - perhaps some meta data in the packets wireshark reads is counted too?

(15 Apr '13, 21:54) Anders ♦

and the measured bit rate (as reported by Wireshark) is 111 Kbps.

which 'module' of Wireshark shows that value (how did you generate that report)?

(16 Apr '13, 04:17) Kurt Knochner ♦

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.

(16 Apr '13, 15:51) Mark Maestas

O.K. then see the answer of @Guy Harris.

(16 Apr '13, 15:52) Kurt Knochner ♦

The Peak USB to CAN adapter was configured as a NET device so we could use Wireshark to capture data

(16 Apr '13, 15:52) Mark Maestas

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.

(16 Apr '13, 15:53) Mark Maestas

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).

(16 Apr '13, 15:55) Kurt Knochner ♦

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 ....

(16 Apr '13, 19:29) smilnor

Wireshark's calculated bit rate is not real. See my updated answer.

(16 Apr '13, 19:57) Guy Harris ♦♦
showing 5 of 9 show 4 more comments

One Answer:

0

Looking at a CANbus capture (done with the "virtual" CANbus on a (virtual :-)) Linux box), the packets have:

  • a 4-byte field with an identifier and some flag bits
  • a 1-byte frame length
  • a 1-byte field that's not dissected

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%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

edited 16 Apr '13, 19:56