3 May 2007 12:59
Re: Simulation of TCP connections with multiple source IP addresses
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
--
--
(Continue reading)
I don't think we can re-use much...
_______________________________________________________
Reply to this item at:
<
RSS Feed