Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Error ip header checksum

Altera_Forum
Honored Contributor II
2,289 Views

Hi all, 

 

I have a question about lwIP. I managed to set up a connection between PC and NIOS II. So far so good, when I send a message to pc it's ok. However when I send a message to NIOS and look at it with ethereal I always get an incorrect checksum it's always 0x0000. 

Is this a known issue, because I can't seem to solve it. My data comes in correct, but it is just something that bothers me... 

 

Cheers, 

 

Danny
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
1,107 Views

 

--- Quote Start ---  

originally posted by dannyjacobs@Dec 15 2005, 02:29 AM 

hi all, 

 

i have a question about lwip. i managed to set up a connection between pc and nios ii. so far so good, when i send a message to pc it's ok. however when i send a message to nios and look at it with ethereal i always get an incorrect checksum it's always 0x0000. 

is this a known issue, because i can't seem to solve it. my data comes in correct, but it is just something that bothers me... 

 

cheers, 

 

danny 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11577) 

--- quote end ---  

 

--- Quote End ---  

 

 

I assume you mean the UDP checksum, if so I suggest you type "UDP checksum zero" into google or if you wish to understand TCP/IP buy Internetowrking with TCP/IP by Douglas Comer.
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

Danny, 

 

UDP checksums are optional. A checksum of 0 means that you haven&#39;t enabled that option. 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

Hi Slacker, 

 

I disabled the UDP checksum from NIOS II to pc, but when I send a UDP-message to NIOS II from PC I alway get an incorrect checksum. It always says it is 0x0000 in stead of e.g. 0x4F7A. Is this because lwIP disables all IP-options!? And it works fine. Everything works the way it should, but it is just something that bothers me... 

 

Cheers, 

 

Danny
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

 

--- Quote Start ---  

originally posted by dannyjacobs@Dec 16 2005, 02:08 AM 

hi slacker, 

 

i disabled the udp checksum from nios ii to pc, but when i send a udp-message to nios ii from pc i alway get an incorrect checksum. it always says it is 0x0000 in stead of e.g. 0x4f7a. is this because lwip disables all ip-options!? and it works fine. everything works the way it should, but it is just something that bothers me... 

 

cheers, 

 

danny 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11606) 

--- quote end ---  

 

--- Quote End ---  

 

 

Danny, 

 

I suggest you either re-read Slacker&#39;s post or follow my advice on learning how to help yourself.  

 

A UDP checksum of 0 is not incorrect as Slacker said it means NO CHECKSUM. As UDP checksums are optional this is perfectly OK.
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

 

--- Quote Start ---  

originally posted by rugbybloke+dec 16 2005, 12:07 pm--><div class='quotetop'>quote (rugbybloke @ dec 16 2005, 12:07 pm)</div> 

--- quote start ---  

<!--quotebegin-dannyjacobs@Dec 16 2005, 02:08 AM 

hi slacker, 

 

i disabled the udp checksum from nios ii to pc, but when i send a udp-message to nios ii from pc i alway get an incorrect checksum. it always says it is 0x0000 in stead of e.g. 0x4f7a. is this because lwip disables all ip-options!? and it works fine. everything works the way it should, but it is just something that bothers me... 

 

cheers, 

 

danny 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11606) 

--- quote end ---  

 

--- Quote End ---  

 

 

Danny, 

 

I suggest you either re-read Slacker&#39;s post or follow my advice on learning how to help yourself.  

 

A UDP checksum of 0 is not incorrect as Slacker said it means NO CHECKSUM. As UDP checksums are optional this is perfectly OK. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11622)</div> 

[/b] 

--- Quote End ---  

 

 

Rugbybloke, 

 

I suggest you learn to READ and not to follow in anyones footsteps.... Just read my first post again and try to UNDERSTAND what is written down there. Perhaps you should go back to primairy school and start learning the alphabet and the meaning of words again. 

 

Good luck with that! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

 

Cheers, 

 

Danny
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

TO_BE_DONE

0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

Rugbybloke, 

 

like I said, it was just something that bothered me. Together with another student we created a connection between an existing board with a very slow datalink (about 1.5 Mbit/s). Now we&#39;ve got an 75 Mbit/s connection with the lwIP stack. 8 MB data is downloaded within 1 sec and that is what the company we worked for wanted. We also created a SPI-connection, so we can send UDP-messages with info and SPI responds to that, so when you said I should learn to help myself that kind of p*ssed me off. In 15 weeks we set up al of this without even knowing before what NIOS II was. So reading that just bugged me. Hereby my apologies to you... 

I didn&#39;t realise it was a bug in Ethereal (until now of course http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif ) but it should have gotten to me, seeing that the data comes in correct. But for the few weeks that we&#39;ve got here I want to deliver it perfectly... 

And to all of you thanks for all your help. When I got stuck I needed the small tips that you sent me. 

 

Cheers, 

 

Danny
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

Danny, 

 

How are you getting 75Mb/s? What hardware (MAC, PHY, etc.)? 

 

Also, the true answer to your problem is that it&#39;s not a bug in ethereal, it&#39;s probably just that your PC is offloading Tx checksumming to the network card. Therefore, ethereal can&#39;t see it using pcap. Regardless, it doesn&#39;t matter anyway. 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
1,107 Views

hi, im danny&#39;s coworker, ill answer a few of those Q&#39;s 

 

first of all, thanks for the suggestion that the PC is offloading the checksum, this kinda makes sense since we are using a secondary interface (a pci card) for the nios, but an onboard lan connection for the corporate lan 

 

as for the configuration, here goes: 

- stand alone Lwip web server converted to UDP, compiler optimizations to -3 (i think) for a large mem footprint but fast code, LWIP checksumming disabled 

- a Nios 2/f core, clocked at 135 mhz (highest we could go in a ES stratix 2s60, with SDram synced) no onchip ram or TCM, all unused devices removed (no button PIO&#39;s etc.. just the bare essentials for what it needs to do) with 16kb instruction cache, 64 kb data cache, all hardware accelerate modes enabled 

 

then we use a buffer of almost 64kb, fill it up with data en send it out in one go (LWIP autofragments it, but the PC can handle this, the other way around is no go though) and just throw the send routine in a while(1) loop 

 

this has yielded about 77/78 mbit raw speed, and 73/74 pure data transfer (without the udp headers etc) we have gotten to the point where our desktop computers can just barely keep up with receiving the data http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

 

as you read, we are constantly re-using the same packet data, we have yet to do an actual test with constantly changing data being read from memory, as it is i think out entire packet buffer (60kb) fits into the 64kb data cache, and just stays there 

 

oh by the way, our mac/phy is a smsc lan91c111, we are using an altera nios2 dev board
0 Kudos
Reply