4

The first 16 bits in a tcp header, (rfc793), are for the source port, right? The next 16 are for the destination port. When I run tcpdump -xx I can recognise MAC addresses of boxes on my system. Does this mean that the "ports" are MAC addresses?

jayeola
  • 41

1 Answers1

3

No, they aren't.

Regardless of its name, tcpdump captures packets at the lowest possible level – it doesn't limit itself to just TCP.

When you use -xx, tcpdump outputs the link layer header of all packets, so the first 4 bytes of the output aren't TCP – they are part of the Ethernet frame.

Even with plain -x, tcpdump would print the IP header before TCP/UDP.

If you want to see the packet structure, use Wireshark instead – it will display every packet as a tree, and highlight the specific bytes for every value.

u1686_grawity
  • 452,512