lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Remote tcp connection with TAPIF interface


From: jean-louis . gilbert
Subject: RE: [lwip-users] Remote tcp connection with TAPIF interface
Date: Wed, 1 Sep 2004 09:16:01 +0200

Hello all,

I'm still trying to solve the problem of the remote tcp connection
("connect(...)" more precisely) which doesn't work with the (same)
configuration described below.

Leon Woestenberg advises me to disable ETHARP_QUEUEING, unfortunately it
doesn't solved the problem.
So, i try to change the tapif configuration by setting the hardware address
of tapif with the system address of tap0 (obtained by "ioctl"), here is the
example of code in low_level_init(..) in tapif.c:

*************************************************************   
    .....
        if (ioctl(tapif->fd, TUNSETIFF, (void *) &ifr) < 0) {
      perror("tapif_init: "DEVTAP" ioctl TUNSETIFF");
      exit(1);
    }
      /***********************
        s = socket(PF_INET, SOCK_DGRAM, 0);
        ioctl(s, SIOCGIFHWADDR, &buffer);
        for(int i =0;i<6;i++)
         tapif->ethaddr->addr[i]= buffer.ifr_hwaddr.sa_data[i]
      *********/         
}
#endif /*linux*/
....

***************************************************

This is done on side (A) and (B). In this case the ARP_REQUEST and the
ARP_REPLY are actually received on each side and consequently the arp_table
is filled with the right IP_address and the corresponding MAC_adress (event
for the client side (A)). This solved my prvious pb with ARP.

So now the negotiation of the connection itself (sending a SYN packet to
(B)) can start, but no packet, in which TCP_Header containing SYN flags
reach (B). Normally, if all is working, the TCP_header will be print (DEBUG
mode) with SYN flags on (B).

I will try to dump data on (A) while it is writing on tap0... with
tcpdump....

Thank you for your help....

Regards

Jean-louis

*****************************
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




-----Message d'origine-----
De: address@hidden
[mailto:address@hidden 
Date: vendredi 27 août 2004 17:10
À: address@hidden
Objet: [lwip-users] Remote tcp connection with TAPIF interface



> 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".
> 
> 
*****************************
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





reply via email to

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