Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

"packet length" or "captured length" in "Jpcap"

843790Apr 21 2010 — edited Apr 26 2010
Hi all
I recently downloaded the jpcap library and read all docs and
tutorials.

I want to develop a very simple application just calculates the total

traffic (send/receive) on my network interface.

But i don't know which parameter i should consider, and i know this is

because of my knowledge lack in (inter)networking.

Also i don't know which types of packet i should consider(just guess

something,e.g:i should survey every packet for destination & source

address and if source are my address and destination is my router(or other

clients in LAN) i should not increment the total bytes with this packet's length or captured length


I also tried in last two days to find out resources in web(Google /Wikipedia) to find out what are all kinds of packets and didn't found anything useful .Although i learned some types from the API documentations (such IPPacket including TCPPacket, ICMPPacket, UDPPacket or ARPPacket and one or two more),so ,while i think i know how to capture packets and even how to filter them, but i am confusing about which packets i should consider for my goal (to just counting traffic to/from Internet).

+And in this API there is two field in class packet: caplen as "captured length" and len as "packet length" and i used the example application "Jpcapdumper" and i see when it captures packets, in udp packets, the "packet length" and the "captured length" are different (captured length is bigger than packet length)+

Thus i need you people to help
Sorry for long writing

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2010
Added on Apr 21 2010
11 comments
951 views