[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PWE3] 16 bit interpretation of sequence checking?



BACKGROUND:
==========
In "draft-ietf-pwe3-atm-encap-04.txt" section 4.3.4 describes
the sequence number processing as:
     ----------------------------------------------------------------------
     - if the sequence number on the packet is 0, then the packet passes
       the sequence number check.

     - otherwise if the packet sequence number >= the expected sequence
       number and the packet sequence number - the expected sequence
       number < 32768, then the packet is in order.

     - otherwise if the packet sequence number < the expected sequence
       number and the expected sequence number - the packet sequence
       number >= 32768, then the packet is in order.

     - otherwise the packet is out of order.

   If a packet is in order then, it can be delivered immediately. If the
   packet is in order, then the expected sequence number MUST be set
   using the algorithm:

   expected_sequence_number := packet_sequence_number + 1 mod 2**16
   if (expected_sequence_number = 0) then expected_sequence_number:= 1;
     ----------------------------------------------------------------------

QUESTION 1:
==========
Is "the packet passes the sequence number check" the same as 
"the packet is in order" ? I.e, Should the expected_sequence_number
be updated if the sequence number i 0 ?

QUESTION 2:
==========
I enterpret this rather complex description above as a way to map 16 bit 
behaviour into a 32 bit environment. As a hardware designer I have 
a hard time convincing myself (and others) that the above is equivalent 
to the following psueudo-code:

      diff = SeqNo - ExpNo;
      if ((SeqNo=0) or (diff[15]=0) then OK;
      else NOT_OK;
      end if;
      if OK then NewExpNo = (SeqNo=FFFF) ? 1 : SeqNo+1;
      end if;

where all variables are 16 bit and count operations allow wrap-around.
All comments are appreciated.
      / Björn


     =================================================================
    / Björn 'Mr Bear' Berglöf
   /  Xelerated:   08  - 506 257 94  mailto:bjorn.berglof@xelerated.com
  /   Mobile:      0733- 277 808     http://www.mrbear.se
 /    Home office: 08  - 532 532 69  mailto:bjorn@mrbear.se
=================================================================

_______________________________________________
pwe3 mailing list
pwe3@ietf.org
https://www1.ietf.org/mailman/listinfo/pwe3