This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.
0
1

I am capturing packets using libpcap. I am calculating the payload size as given here
size_payload = ntohs(ip->ip_len) - (size_ip + size_tcp);
Now when I print ntohs(ip->ip_len), I see that the value is 1280. For the same packets, wireshark shows a value of 1500 for the total length field in the IP header. Why do they differ?

asked 28 Sep '12, 01:59

rony358's gravatar image

rony358
1122
accept rate: 0%

edited 28 Sep '12, 01:59

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,620
×87
×37

question asked: 28 Sep '12, 01:59

question was seen: 3,034 times

last updated: 28 Sep '12, 01:59

p​o​w​e​r​e​d by O​S​Q​A