lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] 1.3.0 tcp_out.c - testing 'is seq num in window'?


From: art r
Subject: [lwip-devel] 1.3.0 tcp_out.c - testing 'is seq num in window'?
Date: Wed, 23 Apr 2008 13:15:48 -0500

Greetings,

 

The code in ver 1.3.0 (from download dir), in tcp_out.c, tests for ‘seq number in window’ is done several times.

 

The ones that use the receive window are…

 

513:      if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,

514:                          pcb->rcv_nxt+pcb->rcv_ann_wnd)) {

 

1040:    if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,

1041:                        pcb->rcv_nxt + pcb->rcv_ann_wnd - 1)){

 

1285:      if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,

1286:                          pcb->rcv_nxt + pcb->rcv_ann_wnd-1)){

 

1295:    if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd-1)){

 

The first 3 use the announced window rcv_ann_wnd, while the last uses the ‘real’ window rcv_wnd.

 

I would have expected that all tests would be identical.

 

(The first cases uses rec_ann_wnd, while all others use rcv_ann_wnd – 1. I assume that the difference is due to the RST packet have a ‘pseudo’ length of 1, similar to a SYN packet.)

 

(I also believe the third case is redundant and have mentioned this in a separate posting.)

 

Should all cases use the same window value? I would have expected the real window to be used per my (limited!) understanding of TCP.

 

Regards,

Art R.

 


reply via email to

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