While reassembling datagram at receiver which data structure would be better in terms of
- if 1-2 fragment got lost we should discard complete datagram
- sorting of fragments should be faster
- if fragments are further fragmented then reassembling all should be smooth.
Short answer: Array, usually termed as Buffer.
Long answer:
You can read RFC 791 for all the details.
[Page 28] mentions the Reassembly Procedure:
I had earlier worked with Contiki OS. You can see how a buffer is declared and used there.
You can also have some fun going through Google's Efficient IP datagram reassembly patent.