Link to home
Start Free TrialLog in
Avatar of Minions
Minions

asked on

About identification field in an IP packet

There is an field in IP Packet's header called "Identification". I need to generate IP packets, and this Identification field is the only one I can't obtain. I don't know what this ID field means.

So, I ask: How can I generate the Identification number, in runtime, to send IP packets?

I prefer a 'function' code that returns Identification, but an API or DLL call is OK too. But  please, don't indicate any Delphi's standard component or an third component to make/send IP packets, because I want to generate very customized packets.
Avatar of knightmad
knightmad

"I don't know what this ID field means."
Check this site: http://www.erg.abdn.ac.uk/users/gorry/course/inet-pages/ip-packet.html
The Identifcation field is a "16-bit number which together with the source address uniquely identifies this packet - used during reassembly of fragmented  datagrams" In other words ... this is an unique identifier to your packet ...

What do you mean exactly by "very customized packets"? Will them use TCP, UDP, ICMP, ... ? If you are considering to use an ICMP solution, check this site: http://delphi.about.com/library/weekly/aa081503a.htm 
Avatar of Minions

ASKER

I don't get it... So I can put any number as an identificator??? Looks like that field is only used with "big" packets (which have to be send fragmented). I'm not sure about that, so I have to chenge this number every time to "tell" the server "this is another packed"? But I'm working with very little packets (there aren't packet bigger than 500 bytes).

"Will them use TCP, UDP, ICMP, ... ?"

I'm using UPD protocol, but my only problem is that identification field. I already did codes to calculate IP header's checksum and UPD checksum (was a little hard).

I don't know WHAT number I have to put there!!! That's my problem :-(
ASKER CERTIFIED SOLUTION
Avatar of knightmad
knightmad

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Minions

ASKER

Good link :-)

I discovered now: I can put any number there, because it's used only to diferenciate 2 packets. If I send a packet to a server I have to change the ID number to send another (I choose to simply increase it).

I needed to know about that field because it's used in checksum calculation.

Thanks knightmad for the links!