[Tinyos-help] Sequence Number

Greg Hackmann gwh2 at cse.wustl.edu
Tue Dec 4 10:52:43 PST 2007


manu suryavansh wrote:
> Hi,
> 
> I am using the sequence number transmitted to find out the number of
> packets, I am using byte 20 and 21 (counting from 0) for my sequence
> number, the problem is that suddenly the sequence number start counting
> out of order for examples below is a list of sequence numbers I received
> (snip)
> So as you can see, I received sequence number in the range of 5000 and
> suddenly it became 320 and then again it became correct
> 
> Please tell me what is the problem or any better way to find the number
> of lost packets
> 
> Thank you
> Manu Suryavansh

When you convert these sequence numbers into base 16, you get

5113 => 13F9
5114 => 13FA
...
5119 => 13FF
320  => 140
321  => 141
322  => 142
...
335  => 14F
5136 => 1410
5137 => 1411
...

Note that the numbers that should be between 0x1400 .. 0x140F are coming
out as 0x140 .. 0x14F; i.e., 0s that occur in the upper half of bytes
are being dropped.

How are you collecting and displaying these sequence numbers?  If you're
displaying them in base 16 on the PC side, you're most likely just
forgetting to pad the bytes with extra 0s when you print them out.

Greg Hackmann


More information about the Tinyos-help mailing list