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

TCP payload begins

0

How Wireshark knows where TCP header ends and TCP payload begins. In the IP header, there are two values that indicate the length of the TCP/IP in a specific packet. If you subscribe "Header Length" from "Total Length" (Total Length - Header Length = TCP header and data) in IP header you will get a total length of TCP Header and data. I'm looking a method to get a length of TCP data only.

asked 17 May '15, 00:55

Namik's gravatar image

Namik
6112
accept rate: 0%


3 Answers:

0

IP has two values: IP header length, and IP total length.

TCP size (header plus payload) is IP total length minus IP header length.

TCP payload size is TCP size minus TCP header length.

answered 17 May '15, 02:35

Jasper's gravatar image

Jasper ♦♦
23.8k551284
accept rate: 18%

0

From TCP/IP Guide: "Data Offset: Specifies the number of 32-bit words of data in the TCP header. In other words, this value times four equals the number of bytes in the header, which must always be a multiple of four. It is called a “data offset” since it indicates by how many 32-bit words the start of the data is offset from the beginning of the TCP segment."

answered 17 May '15, 02:44

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

0

I'm looking a method to get a length of TCP data only.

what about the display filter, tcp.len which can be added as a column.

alt text

Regards
Kurt

answered 17 May '15, 06:09

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%