TCP Wireshark – Calculating the Throughput of a TCP Connection

tcpwireshark

Given a TCP session, is there a way to determine the throughput of the sender?
I have a wireshark sniff, and I see that to calculate the throughput of the sender I can use the
TCP-Window-Size-in-bits / Latency-in-seconds = Bits-per-second-throughput formula,
But the window is constantly changing (due to the tcp protocol).
Furthermore, why does the tcp window size is taken into account? isn't that true that sometimes the sender sends more than one segment before receiving the ack?

Best Answer

isn't that true that sometimes the sender sends more than one segment before receiving the ack?

This is exactly what "window" means. Imagine a protocol requiring acknowledgment but only sending a single data packet/segment each time (window = 1 segment) - there can only be a single segment/ACK pair in each round-trip period, regardless of the actual bandwidth.

The send window provides a method to send multiple segments consecutively before expecting ACKs. Each segment that's ACKed is removed from the send window and the window advanced to a new segment - hence "sliding window".

Sending multiple segments "in parallel" with an adaptive, sliding window, you can make use of the total bandwidth. Generally, you cannot transport more data than one full window within each RTT period.

TCP uses a sliding window that is controlled by the (constantly monitored) RTT value as congestion sensor - from a simplified perspective, when RTT goes up, the window size goes down and vice versa. Naturally, each value may change at any time due to the network load and other variables.