How to Calculate Packet Size

Save

In computer networking, a packet is the basic unit for data being sent across the network. Each packet contains information about its origin, its destination and its contents. Packets are sent when initiating a connection between two computers, during the connection itself and when a connection is broken. Some packets even contain other packets.

Things You'll Need

  • Command line interpreter
  • Windows- or Linux-based computer
  • TCPDump (Linux)
  • WinPcap and WinDump (Windows)

Instructions for tcpdump

  • Open the command line software

  • Run tcpdump as follows:

    tcpdump -v

  • Examine the tcpdump output. An example:

    16:50:16.752851 IP (tos 0x0, ttl 64, id 26928, offset 0, flags [DF], proto TCP (6), length 46) yyy.yyy.yyy.yyy.22003 > zzz.zzz.zzz.zzz.5190: P, cksum 0x7d2a (correct), 2169864800:2169864806(6) ack 1098759742 win 62984

  • Find the 'length' section of the tcpdump output. In the given example, the length was 46, indicating a packet length of 46 bytes.

Instructions for WinDump

  • Open the command line software

  • Run tcpdump as follows:

    windump -v

  • Examine the windump output. An example:

    16:50:16.752851 IP (tos 0x0, ttl 64, id 26928, offset 0, flags [DF], proto TCP (6), length 46) yyy.yyy.yyy.yyy.22003 > zzz.zzz.zzz.zzz.5190: P, cksum 0x7d2a (correct), 2169864800:2169864806(6) ack 1098759742 win 62984

  • Find the 'length' section of the windump output. In the given example, the length was 46, indicating a packet length of 46 bytes.

References

  • Photo Credit Comstock Images/Comstock/Getty Images
Promoted By Zergnet

Comments

Resources

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!