What happens, when you connects to server and requests some simple page:
- Server application generates requested data (e.g.
<body>Hello world</body>
string) and passes it to HTTP layer
- HTTP layer generates necessary header according to RFC (specifies HTTP version, status code, content type etc), prepends it to generated data and pass everything to TCP layer
- TCP layer may break data into more than one pieces (not our case, message is already too small) and prepend necessary info for transport layer to each piece (src/dst port number, sequence number, some flags, checksum etc), then passes it to IP level
- IP layer prepends necessary info for routing (source/dest addresses, TTL and other stuff), then passes it to lower layer (e.g. Ethernet)
- Ethernet adds its part (MAC addresses, maybe VLAN tags) and pushes all to physical device
- Resulted data is sent byte-by-byte from server's NIC to network
So your question is actually up to you. What do you want to measure? Is it "data, which I need to display excluding all auxiliary info"? Or is it "all number of bytes I need to send/receive for getting this lovely cat picture"? Here is a list of fields to get size of each part:
- To get data lenght only (as string, unfortunately):
http.content_length_header == "606"
- To get (data + HTTP header) length:
tcp.len == 973
- To get (data + HTTP + TCP + IP layers):
ip.len=1013
- To get every byte sent:
frame.len == 1027
If you want to measure bandwidth occupation, use frame.len
. If you're interested in "pure site weight", it should be independent from environment, so use http.content_length_header
. Things might become more complicated on high level considering the following:
- Era of HTTPS means you can't easily observe HTTP content in traces, so
tcp.len
might be the highest option
- Some data (e.g. audio, video) is transferred over different protocol stack (e.g. IP - UDP - RTP)