[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] SOF_REUSEADDR & SOF_REUSEPORT
From: |
Kjell Andersson XW (LI/EAB) |
Subject: |
RE: [lwip-users] SOF_REUSEADDR & SOF_REUSEPORT |
Date: |
Tue, 13 Jan 2004 11:48:02 +0100 |
>>That pcb then responds with an ACK to the client. The clients sees the
>>ACK and thinks it is a correct connection ACK and moves to ESTABLISHED
>>state. The server pcb that is in state LISTEN never sees the SYN
>>request.
>
>Why does the client move to established when it gets only an ACK? It
>should get a SYN-ACK to do that.
I think that is quite strange too.
I got an answer on my previous question though. It is not a good idea to reuse
the <Src IP, src Port, Dest IP, Dest port> combination. So, my case is faulty
in the usage, but I still think that lwIP responds in a strange way.
A log (my stack is loopbacked and handles both 192.168.0.101 and 192.168.0.102):
[...]
ip_input: iphdr->dest 0xc0a80066 netif->ip_addr 0xc0a80066 (0xc0a80000,
0xc0a80000, 0x66)
ip_input: packet accepted on interface cb
ip_input:
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 40 | (v, hl, tos, len)
+-------------------------------+
| 15 |010| 0 | (id, flags, offset)
+-------------------------------+
| 255 | 6 | 0xf9a4 | (ttl, proto, chksum)
+-------------------------------+
| 192 | 168 | 0 | 101 | (src)
+-------------------------------+
| 192 | 168 | 0 | 102 | (dest)
+-------------------------------+
ip_input: p->len 40 p->tot_len 40
TCP header:
+-------------------------------+
| 80 | 80 | (src port, dest port)
+-------------------------------+
| 0000006535 | (seq no)
+-------------------------------+
| 0000007105 | (ack no)
+-------------------------------+
| 5 | |010000| 31999 | (hdrlen, flags (ACK ), win)
+-------------------------------+
| 0x7ad1 | 0 | (chksum, urgp)
+-------------------------------+
pbuf_header: old 6a0fc40 new 6a0fc54 (-20)
inet_chksum_pseudo(): checksumming pbuf 6a0fc20 (has next 0)
lwip_chksum(6a0fc54, 20)
inet: chksum: no odd byte
inet_chksum_pseudo(): pbuf chain lwip_chksum()=ffff
pbuf_header: old 6a0fc54 new 6a0fc68 (-20)
tcp_input: first PCB and SOF_REUSEPORT set.
tcp_input: reference counter on PBUF set to 2
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags ACK -+-+-+-+-+-+-+-+-+-+-+-+-+-+
State: SYN_SENT
SYN-SENT: ackno 7105 pcb->snd_nxt 7105 unacked 7104
tcp_process: SYN-SENT --queuelen 0
pbuf_free(a5704)
pbuf_free: deallocating a5704
Trace:Event: IP_Connection::TCP_Connected: 192.168.0.101 port 80 <-
192.168.0.102 port 80
tcp_output: nothing to send (0)
tcp_output: snd_wnd 31999, cwnd 4096, wnd 4096, seg == NULL, ack 7105
pbuf_free(6a0fc20)
pbuf_free: 6a0fc20 has ref 1, ending here.
State: ESTABLISHED
tcp_input: searching next PCB.
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags ACK -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_input: freeing PBUF with reference counter set to 1
pbuf_free(6a0fc20)
pbuf_free: deallocating 6a0fc20
tcp_fasttmr: delayed ACK
pbuf_alloc(length=20)
pbuf_alloc(length=20) == a5704
tcp_output: sending ACK for 6536
inet_chksum_pseudo(): checksumming pbuf a5704 (has next 0)
lwip_chksum(a5738, 20)
inet: chksum: no odd byte
inet_chksum_pseudo(): pbuf chain lwip_chksum()=8530
pbuf_header: old a5738 new a5724 (20)
lwip_chksum(a5724, 20)
inet: chksum: no odd byte
ip_output_if: cb1
[...]