UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » Send your consturcted packet

#1 2011-11-02 09:23 AM

clinux
Member
Registered: 2011-11-02
Posts: 2

Send your consturcted packet

Hello,this may be a silly question but,i have un intersert in examining packet exchnage and how packets are constucted from thier resposible structures,ICMP,and otehr protocol packets and i need help some one to disscus it with me the Structure of a packet construction.

Offline

#2 2011-11-02 09:05 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: Send your consturcted packet

I'm not entirely sure what you're looking for exactly...  But, you can find the layout of various protocol packet headers many places online...  Wikipedia is a good place to start...  (That's the IPv4 layout, but you'll find similar info for all the various other protocols as well...  Scroll up to the top of that page, and click on one of the other protocols listed on the right...)

Also, since you talk about constructing packets, perhaps you want to check out the source to libraries like libnet or libdnet...

Offline

#3 2011-11-04 10:25 AM

clinux
Member
Registered: 2011-11-02
Posts: 2

Re: Send your consturcted packet

Thanks,i m doing some research in constructing a packets,the Ip,Tcp,Header,using ip/tcp header Structs of course they are IPV4 ,but,i think it wouldn't be too far for IPV6.Now,what i need to know to construction of packets is how to construct Ip and TCp headers with some code...and what the checksum function does using code,pls,thankyou~

Offline

#4 2011-11-04 01:38 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: Send your consturcted packet

Well, I already posted links to some code for you...  Libnet is all about constructing raw packets, and shows you pretty much all you need to know to do it...  Also, if you search here for something like "raw packet" you will find lots of code posted in the forums, as well...

As for what the checksum function does, well it calculates a checksum of the packet...  This is just a hash value of (parts of) the packet contents, which is used by the receiver of the packet to verify that it hasn't become corrupt during transit...  You can find code for that right here in the forums as well, or inside the libnet source, too...

Offline

  • Index
  • » C
  • » Send your consturcted packet

Board footer

Powered by FluxBB