|
From: | Jonathan Larmour |
Subject: | Re: [lwip-users] Simulation of TCP connections with multiple source IP addresses |
Date: | Thu, 03 May 2007 11:59:13 +0100 |
User-agent: | Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515) |
Leena Mokadam wrote:
Hello, I am a LWIP's new user. My query is about TCP connection with mutiple source IPs. Can we maintain (send/receive) multiple network interfaces using LWIP? I have to simulate multiple IP addresses for the same PC and send/receive TCP data with multiple IP address. For example, My PC needs to simulate following IP addresses 192.168.20.120, 192.168.20.121, 192.168.20.122, 192.168.20.123, 192.168.20.124 and 192.168.20.125. And my program needs to maintain a TCP connection for all of these IP address to various different servers. It involves sending and receiving of data. Please let me know if this is possible woith the help of LWIP. I am not sure as I have yet not seen any LWIP API which accepts source IP address and Destination IP address.
In the current code, lwIP's routing and interface structure is intentionally simplified. You can have only one IP address for each interface ("netif"). I _think_ lwip should allow you to do what you want if you set up a netif for each IP address. When you need to send something from a specific address, then you will need to call bind()/netconn_bind()/tcp_bind() (depending on the interface you're using) to set the local IP address to use for that connection.
If you need to set up a listening port, you will also need to have multiple listeners - one bound to each IP address separately.
Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. ------["The best things in life aren't things."]------ Opinions==mine
[Prev in Thread] | Current Thread | [Next in Thread] |