Hi All,

I use the last CVS Head LWIP on LPC2468 with FreeRTOS. My embedded system 
communicates by IP with a PC. When the PC IP interfaces restart, I look for a 
checksum incorrect packet on Wireshark.

This error seems to be a concatenate error. 172.17.2.173:my embedded system 
with LWIP; 172.17.2.172 : PC

    111 7.819682    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=55493 Ack=0 Win=5840 Len=209
    112 7.825543    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=55702 Win=65535 Len=0
    113 7.993714    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=55702 Ack=0 Win=5840 Len=531
    114 7.997536    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=56233 Win=65535 Len=0
    115 8.211446    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [ACK] Seq=56233 Ack=0 Win=5840 Len=1460
    116 8.301504    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=57693 Win=65535 Len=0
    117 8.326219    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=57693 Ack=0 Win=5840 Len=197
    118 8.333736    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=57890 Win=65535 Len=0
    119 8.422016    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=57890 Ack=0 Win=5840 Len=1126
    120 8.429543    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=59016 Win=65535 Len=0
    121 8.632683    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=59016 Ack=0 Win=5840 Len=934
    122 8.634010    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=59950 Win=65535 Len=0
    123 8.869443    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [ACK] Seq=59950 Ack=0 Win=5840 Len=1460       <- Restart of the PC IP 
interfaces
    125 8.871878    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [ACK] Seq=61410 Ack=0 Win=5840 Len=1460
    129 8.874047    172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [ACK] Seq=0 Ack=62870 Win=65535 Len=0
    130 9.307578    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=62870 Ack=0 Win=5840 [TCP CHECKSUM INCORRECT] Len=740    
<- this packet is a concatenation of the same packets than 111 and 113
    131 9.309162    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [ACK] Seq=63610 Ack=0 Win=5840 Len=1460
    132 9.309293    172.17.2.172          172.17.2.173          TCP      [TCP 
Dup ACK 129#1] 48955 > 5678 [ACK] Seq=0 Ack=62870 Win=65535 Len=0
    142 9.789090    172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=65070 Ack=0 Win=5840 [TCP CHECKSUM INCORRECT] Len=1323   
<- this packet is a concatenation of the same packets than 117 and 119ss
    153 10.003902   172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [PSH, ACK] Seq=66393 Ack=0 Win=5840 Len=934
    156 10.019539   172.17.2.172          172.17.2.173          TCP      [TCP 
Dup ACK 129#2] 48955 > 5678 [ACK] Seq=0 Ack=62870 Win=65535 Len=0
    157 10.905015   172.17.2.173          172.17.2.172          TCP      [TCP 
Retransmission] 5678 > 48955 [PSH, ACK] Seq=62870 Ack=0 Win=5840 [TCP CHECKSUM 
INCORRECT] Len=740
    158 13.209979   172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [PSH, ACK] Seq=0 Ack=62870 Win=65535 Len=1
    159 13.210040   172.17.2.172          172.17.2.173          TCP      48955 
> 5678 [FIN, ACK] Seq=1 Ack=62870 Win=65535 Len=0
    160 13.210332   172.17.2.172          172.17.2.173          TCP      48956 
> 5678 [SYN] Seq=0 Len=0 MSS=1460 TSV=1711037 TSER=0 WS=6
    161 13.241498   172.17.2.173          172.17.2.172          TCP      5678 > 
48955 [ACK] Seq=67327 Ack=2 Win=5838 Len=0
    162 13.279770   172.17.2.173          172.17.2.172          TCP      5678 > 
48956 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460
    163 13.279930   172.17.2.172          172.17.2.173          TCP      48956 
> 5678 [ACK] Seq=1 Ack=1 Win=5840 Len=0
    164 14.205872   172.17.2.173          172.17.2.172          TCP      [TCP 
Retransmission] 5678 > 48955 [PSH, ACK] Seq=62870 Ack=2 Win=5838 [TCP CHECKSUM 
INCORRECT] Len=740


In the pbuf_cat function "p->next" must not be equal to "t", but must be equal 
to "NULL". And we must write "p->len+=t->len;". And next after the call of 
"pbuf_cat(useg->p, queue->p);" in "tcp_enqueue fuction" tcp_out.c  , we have 
Add two line:

    pbuf_cat(useg->p, queue->p);
    useg->len += queue->len;
    useg->next = queue->next;
    LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, 
("tcp_enqueue: chaining segments, new len %"U16_F"\n", useg->len));
    if (seg == queue)
    {
      seg = useg;
      seglen = useg->len;
      queuelen--;               //decrementation of the SND_QUEUELEN due to 
concatenation
    }
    memp_free(MEMP_TCP_SEG, queue);
    pbuf_free(queue->p);   /dereference a pbuf chain due to concatenation


Thanks to this modification I haven't a TCP CHECKSUM INCORRECT in wireshark and 
the communication works fine.

Can you tell me  if this modification are the best  and if they will not be 
cause of a problem.

Thanks In advance,

Hervé GARAT
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to