Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
363 views
in Technique[技术] by (71.8m points)

networking - which data structure to choose for ip datagram reassembly at receiver end?

While reassembling datagram at receiver which data structure would be better in terms of

  1. if 1-2 fragment got lost we should discard complete datagram
  2. sorting of fragments should be faster
  3. if fragments are further fragmented then reassembling all should be smooth.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Short answer: Array, usually termed as Buffer.

Long answer:

You can read RFC 791 for all the details.

  1. Apparently, you can start reading from [Page 24] "Fragmentation and Reassembly". You don't sort. Sorting is costly. You do some math and put the fragments in the right place instead.

[Page 28] mentions the Reassembly Procedure:

enter image description here

  1. I had earlier worked with Contiki OS. You can see how a buffer is declared and used there.

  2. You can also have some fun going through Google's Efficient IP datagram reassembly patent.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...