lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Remote tcp connection with TAPIF interface


From: jean-louis . gilbert
Subject: [lwip-users] Remote tcp connection with TAPIF interface
Date: Fri, 27 Aug 2004 17:09:52 +0200

> Hello,
> 
> We are using lw-ip on linux kernel 2.4.18. There are two machines
> connected with a switch. Each of these machines has a bridge interface
> containing a tap0 and eth0 interfaces.
> A first machine A is running a tcp client application (socket, bind,
> connect), which tries to connect the other machine B running tcp "server"
> (socket, bind, listen and accept) .
> The client and the server code are exactly the same, concerning the lw-ip
> initialisation (see attached files).
> 
> The machine B configuration:
>       - Declaration of the bridge br1 with address: 192.168.0.6 declared
> in the following way:
>               #brctl addbr br1
>               #brctl addif br1 eth0
>               #ifconfig eth0 0.0.0.0 promisc up
>               #ifconfig br1 192.168.0.6 up
>       After having launched the server application, the tap interface is
> configured and added to the bridge br1 (we add "#brctl addif br1 tap0" and
> "#ifconfig tap0 0.0.0.0 promisc up" to "low_level_init(...)" function.
>       ----> We have set the system arp table with the following command:
>               #arp -s          192.168.0.2     HwAddr_of_tap0
>       Where 192.168.0.2 is the application IPAddress set in the source
> file "test_tcp_server.c".
> 
> 
> The machine A configuration:
>       - Declaration of the bridge br0 with address: 192.168.0.3 declared
> in the following way:
>               #brctl addbr addbr br0
>               #brctl addif br0 eth0
>               #ifconfig eth0 0.0.0.0 promisc up
>               #ifconfig br0 192.168.0.3 up
>       After having launched the client application, the tap interface is
> configured and added to the bridge br0 (we add "#brctl addif br0 tap0" and
> "#ifconfig tap0 0.0.0.0 promisc up" to "low_level_init(...)" function.
>       ----> We have set the system arp table wiuth the following command:
>               #arp -s          192.168.0.5     HwAddr_of_tap0
>       Where 192.168.0.5 is the application IPAddress set in the source
> file "test_tcp_client.c".
> 
> 
> The problem is that when the client (A) tries to connect to (B)
> 192.168.0.2 address, port 19 (server application) it returns an error with
> value: -3.
> It seems that in the "etharp_output(...)" function in the client side, all
> the items in the "arp_table" are set to ETHARP_STATE_EMPTY state. 
> It always enters in the following piece of code:
>       /* could not find the destination Ethernet address in ARP cache? */
>           if (dest == NULL) {
>             /* ARP query for the IP address, submit this IP packet for
> queueing */
>             /* TODO: How do we handle netif->ipaddr == ipaddr? */
>             etharp_query(netif, ipaddr, q);
>             /* { packet was queued (ERR_OK), or discarded } */
>             /* return nothing */
>             return NULL;
>                 }
> 
> However, if we use a linux standard telnet application on A, we manage to
> connect to B, and we receive the "Hello World" message on A.
> 
> Does somebody has encounter this type of problem ?
> Is our system environment configuration correct ?
> Do we need to add the server interface in the client ("add_netif of
> "192.168.0.2" in the "test_tcp_client") ?
> How the ARP query has been made in the code in order for the "arp_table"
> to be filled ?
> 
> In advance, thank you for your help...
> kind regards.
> 
> 
>  <<test_tcp_client.c>>  <<test_tcp_server.c>>  <<tapif.c>> 
> 
*****************************
Gilbert Jean-Louis
BGLJ/FR/OPS-F/SAT/SC2
Software Core for Computer-based systems
THALES Communications                           
1-5,Avenue Carnot
91883 MASSY cedex                               

Téléphone:  01-69-75-32-16                      
e-mail: address@hidden

Attachment: test_tcp_client.c
Description: Binary data

Attachment: test_tcp_server.c
Description: Binary data

Attachment: tapif.c
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]