[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [lwip-devel] Question on comparations of sequence numbers

**From**: |
Simon Goldschmidt |

**Subject**: |
Re: [lwip-devel] Question on comparations of sequence numbers |

**Date**: |
Mon, 26 Dec 2011 22:09:39 +0100 |

narke <address@hidden> wrote:
>* I mean, just for example, if the sequence number space is only 2 bit,*
>* then we have only 0, 1, 2, 3 as valid sequence numbers, right? And,*
>* if current sequence number is 3, so the next one must be 0 ( 0 = 3 + 1*
>* mod 4), right?.*
>* *
>* Well, now assume SND.UNA = 3 and SND.WND = 3, so the send window is 3,*
>* 0, 1 or [3, 1]. In this example, 0 is in the window and a = 3, b =*
>* 1, but a <= 0 <= b does not hold.*
>* *
>* Okay, here the biggest possbile window size is 4.*
OK, so now I understand. In that case, note that your example doesn't really
hold: in real life, the maximum window size is 16 bit (unsigned) while our
macros cast to 32 bit (signed!), so your a<=0<=b isn't really correct as it
doesn't take care for the data types.
Simon