lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Date: Wed, 27 Feb 2002 16:44:34 +0500


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] Date: Wed, 27 Feb 2002 16:44:34 +0500
Date: Thu, 09 Jan 2003 01:57:48 -0000

Hi Ashraf

On Wednesday 27 February 2002 12.44, you wrote:
> i want to ask the purpose of the three variables define in the tcp_pcb
> structure.
>
> snd_wl1
> snd_wl2
> snd_lbb
>
> i know that snd_wl1 and snd_wl2 used for window updation but i am not able
> to understand that how these variables are used to update the window.
>
> In LwIP when tcp_new function is called it creates a new tcp_pcb structure
> type variable and put snd_wl2 to initial sequence number.
>
> Now what about the snd_wl1.How it is set and used.Also in function
> tcp_receive what is purpose of this line of code
>
>   if(TCP_SEQ_LT(pcb->snd_wl1, seqno) ||(pcb->snd_wl1 == seqno &&
> TCP_SEQ_LT(pcb->snd_wl2, ackno)) || (pcb->snd_wl2 == ackno &&
> seg->tcphdr->wnd > pcb->snd_wnd)) {

The code is written almost directly from the definitions in RFC793:

          If SND.UNA < SEG.ACK =< SND.NXT, the send window should be
          updated.  If (SND.WL1 < SEG.SEQ or (SND.WL1 = SEG.SEQ and
          SND.WL2 =< SEG.ACK)), set SND.WND <- SEG.WND, set
          SND.WL1 <- SEG.SEQ, and set SND.WL2 <- SEG.ACK.

          Note that SND.WND is an offset from SND.UNA, that SND.WL1
          records the sequence number of the last segment used to update
          SND.WND, and that SND.WL2 records the acknowledgment number of
          the last segment used to update SND.WND.  The check here
          prevents using old segments to update the window.

SND.WL1
          segment sequence number at last window update

SND.WL2
          segment acknowledgment number at last window update

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]