is lwIP absolutely necessary for tcp-ip?

hello.

i am trying to set up ethernet interface between my pc and a XUP Virtex2Pro board, and want to use tcp/ip. xilinx edk seems to have the lwip stack as a library. is it necessary to use this library, or can one still implement tcp/ip by suitably changing the ethertype/length field in the frame? in my case, only one pc will communicate, and the physical address will not change... so, can i write a frame receive handler to strip the header and ip addresses to access data? my real concern is the pc side... will setting the ethertype field to tcp/ip work or is it necessary to use lwIP?

pls reply asap

thanks vikram

Reply to
vikram
Loading thread data ...

Of course you don't *need* lwIP - it's "only software" after all - but how much work you need to do depends on how much IP functionality you require, and I'm guessing it's more than you think.

I wrote a simple diagnostic suite for a custom Altera-based board that received an ICMP echo (ping) and sent a response without an IP stack. However, attempt to do much more than that and your software effort starts to increase dramatically.

If you're only interested in, for example, receiving UDP packets and not much else, you're probably OK on a well-behaved system (no fragmentation etc). You need to check the ethtype field, filter unwanted addresses etc etc and do some simple parsing on the IP/UDP headers in order to locate the data. Of course you still need to interface to the MAC driver, which may or may not be trivial depending on the driver itself...

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, 
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply to
Mark McDougall

lwip will do all the work for you but of course it will be slower than custom code. Consequences of that depend on your bandwidth.

Anyway, if you don't want a full IP stack, you can use UDP (which is pretty easy). You need to build a packet with corect Ethernet, IP, and UDP headers, and then your data. You can reuse the header for the next packets.

Ethernet header needs (of course) to have the correct fields including addresses, protocol type, etc. IP checksum (which only applies to the header) needs to be correct.

You can compute the UDP checksum or simply set it to 0, in which case the PC will ignore the checksum field. If the checksum is not 0 and it is wrong, the PC will drop the packet.

If you are on a LAN, Ethernet CRC will take care of error checking anyway so the UDP checksum is not needed. Just set it to 0. Computing this checksum is the most time consuming operation in UDP so being able to ignore it is nice when you have a slow CPU like uBlaze.

Check Wikipedta for a description of the headers. It's really simple. You can also use a packet sniffer like ethereal to grok the headers and debug your code.

Reply to
PFC

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.