Go Back   UNIX Socket FAQ > UNIX Platforms > Networking

Reply
 
Thread Tools Display Modes
  #1  
Old 03-19-2005, 06:39 AM
raghulram raghulram is offline
 
Join Date: Mar 2005
Posts: 4
Question Packet Size

Hi ...

I am sniffing the packets and i need to find the size of each packet(HEADER + DATA).
There is a field in IP HEADER called ip_totallength.Will this filed give the packet size..

plz help me..
Reply With Quote
  #2  
Old 03-19-2005, 05:55 PM
RobSeace RobSeace is offline
Administrator
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 3,380
Default

Well, yes, the total length in the IP header should indeed give you the full size of
the header + data... However, in the case of fragmented packets, I believe each
fragment's total length value will only reflect the length of that fragment, so if you
care about the true original packet size, you'll need to do reassembly of the frags,
and add up the lengths of each...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:45 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.