How to get size of HTTP request and response including protocol overhead?

For Linux, and other unix(like) OSses you may use iftop utility. For example: Monitoring my router web interface: sudo iftop -f 'port 80 and host 172.19.76.1' -iwlan0

  • -f -- filter: port 80 -- monitor port 80 of the target host and host 172.19.76.1 -- hostname or address of the target host.
  • -iwlan0 -- [i]nterface wlan0

iftop screenshot


I know that this question has been asked long time ago.

In theory to get size of HTTP request and response including protocol overhead:

Data Size and Protocol Overhead

When application data is sent by a protocol, the data is encapsulated into a protocol data unit (PDU). A PDU includes Application Data (payload) and Header.

Packet Size = Application Data + Header Size

The total data generated by the application = the total size of all the packets used to complete a full data transmission.

Data Size and Protocol Overhead Example

But how to find the size in practically I don't know yet.