Find TCP Throughput using Sequence Numbers
The network throughput calculation is simply:
When using Wireshark, to find the Bytes transferred look at the sequence and acknowledgement fields (when using IPv4). The first packet in the file transfer is where the Seq=1 *and* we have len>0. Below, we see that with packet 81, we begin the file upload.
The final Ack from the server includes Ack=152991 and note that is also has a zero payload with Len=0. This is the clue that its the last packet in the transfer.
To find the amount of data transferred, we look at the Ack when the payload is Len=0, and, in this scenario, the Ack is equal to 152991 in Bytes. Since the Len=0 when the Seq=1 at the initiation of the session (see the first picture), we can see that the bytes transferred is 152991 – 1, which is 152990 Bytes. In essence, the calculation for the total number of bytes is the final Ack minus the initial Seq.
We can also use the same pictures to get the starting and ending times also. The start time is 20:27:28.778136 and the ending time is 20:27:29.039123 and we can calculate that the total time to transfer is 29.039123 – 28.778136, which is 0.260987 seconds. With the total bytes sent and the total time to send, we can start to build the picture of how many Bytes sent per second.
To convert to bits per second, we simply multiply by 8 (8 bits per Byte) and show the result it bits per second or bps.
Finally, we can simplify the bps to Megabits per second, aka Mbps, by dividing by 1,000,000 bits per Megabit.
Therefore, the throughput for this session is 4.689Mbps.
Of course, many, many tools can be used to find Mbps instead of this manual effort. But, if you are working with Wireshark and have the need to calculate your own throughput, then this can be your guide. Have fun !
[By default, Wireshark converts all sequence and acknowledgement numbers into relative numbers. This means that all SEQ and ACK numbers always start at 0 for the first packet seen in each conversation.]
Categories