03-28-2013 11:47 AM
I am kind of new to EDK design.
I tried the xapps1026 and build those servers( echo, rxtest, txtest, http server, tftp server), with EDK 12.3.
They all work fine with my spartan6lx16 board within the ethernet.
LwIP specifies that it can be used within ethernet.
But my goal is to build a real "internet" server, that I can visit from another ethernet.
Is that possible to do it with LwIP?
Or with any other similar type of IP core?
What type of hardware do I have to get at least?
Thanks ahead for your help.
04-02-2013 01:37 PM
No body here knows it?
Any Xilinx employee can give me some suggestion on this?
04-02-2013 05:07 PM
Your statements and questions are confusing. As far as I can tell you either don't know anything about TCP/IP networking and are therefore having difficulty asking an answerable question and it's not surprising that nobody has responded, or your question is really how to set up your local TCP/IP network to be able to access a server on it from the internet which has nothing to do with Xilinx hardware or software and again it's not surprising that nobody has responded.
04-04-2013 02:26 PM
Thanks for the reply and clarification.
Indeed the titile of this thread is kind of confusing.
My goal is to build a webserver that I can visit from internet.
The point is I have to write code for such a web server.
I am not familiar with TCP/IP and server.
So I am wondering how much code this web server will require,
and whether spartan6lx16 is capable enough to carry and run this server.
With LwIP and the application design from the verdor,
I tried a simple http server which I can visit from our ethernet, whose ip starts with 192.168.
But not sure for a webserver that I can visit from internet,
is lwIP(hardware) still capable enough to handle this situation?
And is there any application(webserver code, can automatically gain a unique IP) design that I can use?
04-04-2013 07:30 PM
It will be difficult for you to write a program that you can access over any network using TCP/IP (like a web server) if you don't know anything about TCP/IP, so you should do some learning about TCP/IP (I assume you knew you'd have to do that eventually).
Starting with your last question, the networking feature that handles automatically assigning TCP/IP addresses is called Dynamic Host Configuration Protocol, most commonly referred to as DHCP. If somewhere on your local network you have a DHCP server assigning the 192.168.x.x addresses, then it's simply a matter of enabling your TCP/IP application on the Spartan-6 board to issue a DHCP request to get an address. If there is not a DHCP server on your local network, then you will need to set one up somewhere before you can use that feature. The alternative to DHCP is to manually configure an IP address for each device on the network.
If you have a more or less "standard" local network set up, you will likely have a firewall router that has a single connection to the internet and a number of ports available to your local network. This router will likely have a DHCP server built in to it, and is what assigns the 192.168.x.x addresses to the devices on your local network. Note that the 192.168.x.x range of addresses are not routable, and are reserved for local IP networks. My local network here for example uses 192.168.x.x addresses, as probably a lot of peoples local networks do. What "not routable" means is when I type 192.168.1.10 as an address for example, I will only ever reach the machine on my local network with that address, that address will NOT be sent out the router through the internet and somehow end up at a machine on your local network.
You may be wondering then if your machine has a 192.168.x.x address and you want to access it from the internet, how could you do it? The answer is that the firewall router has a single "real" public IP address which is routable that uniquely identifies that router on the whole internet. The router then uses Network Address Translation (NAT) to allow you to have multiple machines on your local network that all share the same single real IP address of the router. The router also has an address on your local network, usually 192.168.1.1 (but not always, it can be configured differently). A normal PC when it boots up makes a DHCP request to get an address, and the router informs the PC of the router's address, and the router becomes the gateway to the internet. So no real configuration is necessary when you plug in a laptop for example to your local network, as long as the laptop is set up to use DHCP then it (usually) just works. For outbound requests from a device on your local network to some other place on the internet, the router remembers the machine's local address, translates the request to its own address and a unique port number, sends the request out to the internet, and will then re-translate any responses that come back to the local machine's local IP address. Thus it appears that all of the machines on your local network are connected to the internet, but they're really not, it's the router doing the NAT magic that makes it look that way.
Inbound requests from the internet that did not first originate on a local machine however are a different story. Since the router has only one IP address on the internet side, all incoming requests get directed to that single IP address and the router has no way of knowing which of the possibly hundreds of different machines on the local network side are really the target of that request. You have to specifically set that up, using a feature of the router known as Port Forwarding. In a nutshell you pick an IP port number, or range of IP port numbers, and tell the router that when it sees an incoming request for one of those port numbers to redirect to local IP address 192.168.x.x (configurable). You want to be careful about which port numbers you enable and where you send them to, as you're essentially opening up holes in your firewall and you could create a security risk. But that's how you gain access to any machine on your local network from anywhere on the internet.
You will of course need to find the IP address of your router. What can make this tricky is the fact that most internet connections use DHCP to assign the router's IP address. Being dynamic as the name implies, that means that the IP address of your router can periodically change from time to time. You have to be prepared to deal with that changing IP address, or if your router supports it, you can use something called Dynamic DNS. That's basically a service, sometimes free sometimes not, where whenever your router notices that it has a different IP address, it notifies a server on the internet (that the service provider makes available to you which is why it may not be free), of its new address. You then can access your router or whatever machines you have set up port forwarding to on your local network by using the naming convention described by the dynamic DNS service you chose. If you're lucky enough to have a static IP address from your ISP then you don't need to worry about that though, you can just use your registered domain name if you have one or your fixed IP address assigned by your ISP.
LWIP is a software library that provides TCP/IP services and is designed to be included in small embedded hardware projects. Here's a thread on these forums talking about enabling DHCP. Assuming you get that all set up correctly, then whatever server application you write should be able to grab a unique IP address, if you do have a router and/or some other DHCP server on your local network (most likely you do). LWIP has nothing to do with IP cores or hardware, other than it needs to be compiled to run on a given processor and linked with your application. If you can compile, link, install and run your application along with LWIP on a given processor, then the answer to whether the hardware is capable enough is "yes". If it won't fit (not enough memory for example, or no Ethernet port is available), then the answer is "no". Exactly how much code would be required is entirely up to how large your application is going to be, remembering of course you have to link in the Ethernet driver and LWIP code too.
As you can see, your question touches a number of different areas of TCP/IP networking. That's why it's going to be very difficult for you to accomplish what you're asking about without understanding TCP/IP networking. Hopefully the high level summary I have provided gives you some concepts that you can fire into teh Googlez and do some research on, or else it may scare you away :-)
04-05-2013 06:46 AM
Thanks so much for such a clear and excellent explanation !
Indeed this is a very good high level summary, at least for me.
It helps a lot to understand the situation and know the further direction.
I should treat you a big meal, if you come to NYC sometime :)
06-06-2013 09:02 PM