lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Improving LWIP performance


From: Karthik Vadambacheri Manian
Subject: Re: [lwip-users] Improving LWIP performance
Date: Mon, 9 Aug 2010 19:17:29 -0400

Hi kieran,

Thanks for your insights on the below question:

>> 1) Why do checksum errors occur even though I run everything in a
>> virtual machine and no hardware is involved? How can I reduce this?
>
> I would guess a bug in your system.  To reduce it fix the bug!  For
> example, if there was a problem with a packet buffer being reused before
> the previous data had been sent you would see the data in the first
> packet corrupted with contents from a later one.  The checksum would now
> show up this error.  I would look at the packets (through a packet
> capture) that have checksum errors and see if it's either that the
> payload is incorrect (e.g. for each iteration set payload of your
> ping-pong packets to the number of the iteration and look for values out
> of order) or if the checksum has been computed wrongly.

I checked the packets through the debug message in the rtl8139 network card driver in kitten LWK. I found that there is no error in payload but I feel the error may be in computing the checksum.

The below packet causes checksum problem, but the packet is sent and received without errors. The content is in decimal notation.

222  173  190  239  41  88  222  173  190  239  38  34  8  0  69  0  0  190  0  38  0  0  255  6  55  192  192  168  1  2  192  168  1  1  16  1  4  56  0  0  33  162  0  0  34  57  80  24  8  0  128  131  0  0  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52

sender side debug messages:
------------------------------------------
inet_chksum_pseudo(): unwrapped lwip_chksum()=77fb
inet_chksum_pseudo(): wrapped lwip_chksum()=77fb
inet_chksum_pseudo(): pbuf chain lwip_chksum()=7c7f
tcp_output_segment: printing inet_chksum_pseudo()=8380

TCP header:
+-------------------------------+
|     4097      |     1080  | (src port, dest port)
+-------------------------------+
|           0000008610    | (seq no)
+-------------------------------+
|           0000008761    | (ack no)
+-------------------------------+
|  5 |   |011000|   2048  | (hdrlen, flags (PSH ACK ), win)
+-------------------------------+
|    0x8083     |      0     | (chksum, urgp)
+-------------------------------+

receiver side debug messages:
--------------------------------------------

TCP header:
+-------------------------------+
|     4097      |     1080 | (src port, dest port)
+-------------------------------+
|           0000008610    | (seq no)
+-------------------------------+
|           0000008761    | (ack no)
+-------------------------------+
|  5 |   |011000| 2048    | (hdrlen, flags (PSH ACK ), win)
+-------------------------------+
|    0x8083     |      0     | (chksum, urgp)
+-------------------------------+
inet_chksum_pseudo(): unwrapped lwip_chksum()=fe40
inet_chksum_pseudo(): wrapped lwip_chksum()=fe40
inet_chksum_pseudo(): pbuf chain lwip_chksum()=2c5
tcp_input: packet discarded due to failing checksum 0xfd3a


The following packet is sent again since the previous packet had checksum errors and it was also sent and received without any errors. The data which has changed from the previous packet is in typed in bold.

222  173  190  239  41  88  222  173  190  239  38  34  8  0  69  0  0  190  0  39  0  0  255  6  55  191  192  168  1  2  192  168  1  1  16  1  4  56  0  0  33  162  0  0  34  57  80  24  8  0  128  131  0  0  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52  52

sender side debug messages:
-------------------------------------------
inet_chksum_pseudo(): unwrapped lwip_chksum()=77fb
inet_chksum_pseudo(): wrapped lwip_chksum()=77fb
inet_chksum_pseudo(): pbuf chain lwip_chksum()=7c7f
tcp_output_segment: printing inet_chksum_pseudo()=8380

TCP header:
+-------------------------------+
|     4097      |     1080  | (src port, dest port)
+-------------------------------+
|           0000008610    | (seq no)
+-------------------------------+
|           0000008761    | (ack no)
+-------------------------------+
|  5 |   |011000|  2048   | (hdrlen, flags (PSH ACK ), win)
+-------------------------------+
|    0x8083     |      0     | (chksum, urgp)
+-------------------------------+

receiver side debug messages:
--------------------------------------------

TCP header:
+-------------------------------+
|     4097      |     1080  | (src port, dest port)
+-------------------------------+
|           0000008610    | (seq no)
+-------------------------------+
|           0000008761    | (ack no)
+-------------------------------+
|  5 |   |011000|  2048   | (hdrlen, flags (PSH ACK ), win)
+-------------------------------+
|    0x8083     |      0     | (chksum, urgp)
+-------------------------------+
inet_chksum_pseudo(): unwrapped lwip_chksum()=fb7b
inet_chksum_pseudo(): wrapped lwip_chksum()=fb7b
inet_chksum_pseudo(): pbuf chain lwip_chksum()=ffff  <==== checksum has passed here

Also I found that the version of LWIP used in kitten is lwip 1.3.0. I also tried replacing inet_chksum.c (which has the code for computing checksum) from lwip 1.3.2 but the results are same. Can you please give your insights on where it is going wrong?

Thanks in advance,
karthik



reply via email to

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