Hi, I found a display filter expression "tcp[13]&6" which can filter out all the tcp SYN and RST packet, but I don't understand how does it work. I know the 13 is a offset and "&" is the bit_wise operator, what is the "6"? Why can this expression filter out the result mentioned above? thank you asked 18 Nov '13, 20:30 SteveZhou |
One Answer:
The last 3 bits of the TCP flags are
13 is the decimal byte offset of the flags-byte into the TCP header. So a &6 (0000 0110) tests whether SYN or RST bit are set. answered 18 Nov '13, 21:55 mrEEde edited 19 Nov '13, 01:49 |
got it, but why tcp[13] rather than any other number?
13 is the decimal byte offset of the flags-byte into the TCP header
all right, its decimal byte offset. thanks
Another question is, how can I get to know this number quickly? Is there any reference document?
http://en.wikipedia.org/wiki/Transmission_Control_Protocol
thank you!