Reputation: 11532
In an IP header there is a short field called "ID Sequence Number" and having the member identifier in the IP structure as iphdr.ip_id
.
Is this field purely for application level sequencing of packets or will network drivers use this field for some purpose?
In other words if I use this field to number packets according to my own application-related needs, am I risking some unintended side effect in the way the packets are treated by the network transport layers?
Upvotes: 1
Views: 1270
Reputation: 5808
That field is for identifying IP fragments that belong to a specific IP datagram. The intent is that it prevents fragments of other datagrams from being used in the reconstruction of this datagram.
For the identification field to serve its purpose its value must be unique across all datagrams sent with an individual IP source address that might possibly be undergoing reassembly concurrently at an individual destination IP address. (Datagram reassembly is per-source, per-destination, so the identification field is only needed to distinguish between datagrams sent with an identical source+destination address pair. There is no risk of a fragment with a different source or destination address being taken into a reassembly.)
Beyond that there are no other constraints on the value of that field. As long as you meet this uniqueness requirement, you can put whatever value you like into it.
Upvotes: 2