This is our old Q&A Site. Please post any new questions and answers at

hi, i have n number of packet and i have three different message. beginning message , continuation message and end message. when beginning message received i have to store the message and continuation of message alo be included and when it comes to end message i have to reassembled them.

Packet 1 : fragmentation, beginning message(id=1)

Packet 2 : fragmentation, continuation message(id=1)

Packet 3 : fragmentation, beginning message(id=2)

Packet 4 : fragmentation, beginning message(id=3)

Packet 5 : fragmentation, continuation message(id=1)

Packet 6 : fragmentation, end message(id=1)

how can i reassemble these messages in my dissectors?

This question is marked "community wiki".

asked 27 May '17, 21:30

ghader's gravatar image

accept rate: 0%

edited 30 May '17, 08:22

JeffMorriss's gravatar image

JeffMorriss ♦


So how are those three types of message indicated? Is a non-fragmented message one that's marked as neither beginning, nor continuation, nor end? Or is it marked in some other way? What if a message has only two fragments - is one marked as beginning and the other marked as end?

And do the IDs indicate what message is fragmented, so that, with those 6 packets, only the message with an ID of 1 can be reassembled?

(27 May '17, 22:17) Guy Harris ♦♦

in message packets, there is a flag(message type) that indicate type of message(b,c,e).some message has only two fragments - is one marked as beginning and the other marked as end.the IDs dont indicate what message is fragmented. there is a counter in each message that increase each time send a packet.

Packet 1 : fragmentation, beginning message(id=1),n=10

Packet 2 : fragmentation, continuation message(id=1),n=11

Packet 3 : fragmentation, beginning message(id=2),n=15

Packet 4 : fragmentation, beginning message(id=3),n=20

Packet 5 : fragmentation, continuation message(id=1),n=12

Packet 6 : fragmentation, end message(id=1),n=13

(27 May '17, 22:55) ghader

some message has only two fragments

So all messages are fragmented - there's no message type that's "it's all here, no fragments"? Or is that a fourth message type?

In your example, what indicates which message packets 2 and 5 are continuations of, and what message packet 6 is the end of?

(30 May '17, 20:44) Guy Harris ♦♦

Since you didn't say otherwise I'm assuming your custom dissector is in C (rather than Lua).

Fundamentally you want to use the routines in epan/reassemble.{h,c}. From the looks of it you may be able to use the fragment_add() method. You'll need to go through that code and/or other Wireshark code that uses the reassembly code to see how to use them (there's no README that I'm aware of).

permanent link

answered 30 May '17, 08:21

JeffMorriss's gravatar image

JeffMorriss ♦
accept rate: 27%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 27 May '17, 21:30

question was seen: 997 times

last updated: 30 May '17, 20:44

p​o​w​e​r​e​d by O​S​Q​A