[Vortex] Question regarding sequence number calculations

Francis Brosnan Blazquez francis at aspl.es
Tue Dec 11 10:12:44 CET 2012


Hi Phil,

I think your numbers are right. Please, apply suggested changes and send
us a patch for review so we can integrate it into the svn. See general
instructions for this if you need them at [1].

Before sending a patch, please, check regression tests keep working (by
running ./vortex-regression-client and ./vortex-regression-listener
located under test/ directory).

Let us to know how this issue progress, Cheers!

[1] http://www.aspl.es/vortex/support.html

> I’m trying to understand something in the vortex code, namely how
> sequence numbers are calculated when they overflow.
> 
>  
> 
> From the BEEP RFC, the max seq number is 4294967295 (2^32 - 1), and
> that arithmetic needs to be done modulo 4294967296 (2^32).
> 
>  
> 
> I see in the vortex code that there are defines for both of these
> (MAX_SEQ_NO & MAX_SEQ_MOD) in vortex_types.h, but MAX_SEQ_MOD is never
> used.
> 
>  
> 
> In the code, there are a number of places where MAX_SEQ_NO is used and
> a few places where it’s used to perform modulus arithmetic.
> 
> Of particular concern (though admittedly, I’m no BEEP expect and I’ve
> only traced a little of the vortex code) is around line 2230 of
> vortex_channel.c, from the 1.1.12 release:
> 
>  
> 
> channel->last_seq_no = ((channel->last_seq_no + frame_size) %
> (MAX_SEQ_NO));
> 
>  
> 
> I think this incorrectly calculate the next seq number.  i.e. if the
> last_seq_no was 4294967295, and the frame size was 10, then (according
> to the RFC) last_seq_no should end up as 9, while this code would
> assign it to 10.
> 
>  
> 
> Similarly at line 2299 of the same file:
> 
>  
> 
> channel->last_seq_no_expected   = ((channel->last_seq_no_expected +
> frame_size) % (MAX_SEQ_NO)
> 
>  
> 
> Like I said, I don’t really know the codebase or protocol all too
> well, so I’m a bit wary of making any modifications to the code base. 
> 
>  
> 
> -Phil
> 
> 
> _______________________________________________
> Vortex mailing list
> Vortex at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex

-- 
Francis Brosnan Blázquez <francis.brosnan at aspl.es>
ASPL
91 134 14 22 - 91 134 14 45 - 91 116 07 57

AVISO LEGAL

Este mensaje se dirige exclusivamente a su destinatario. Los datos
incluidos en el presente correo son confidenciales y sometidos a secreto
profesional, se prohíbe divulgarlos, en virtud de las leyes vigentes. Si
usted no lo es y lo ha recibido por error o tiene conocimiento del mismo
por cualquier motivo, le rogamos que nos lo comunique por este medio y
proceda a destruirlo o borrarlo.

En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL). No obstante, usted puede ejercitar sus derechos de acceso,
rectificación, cancelación y oposición dispuestos en la mencionada Ley
Orgánica, notificándolo por escrito a:
ASPL - Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de
Henares (Madrid).



More information about the Vortex mailing list