Hi,
I want to explain an issue in the routing table, in some situation plugging the 
ethernet Wire can drop an active connection.
Please find one of the scenario below.
I have a fix explained in the solution proposal, i have write the patch for 
0.69.6 version and i can rewrite it for the master branch.
Does this patch have any chance to be integrated upstream ?

 Use Case
--------------

1) Turn on the machine A without an Ethernet Cable
2) From machine B try to reach the machine A via WiFi ( ping 10.2.3.22 )
The ping are OK, the packet cross the gateway and arrive to machine A.
3) plug the Ethernet Connman connect the wired services
4) From machine B try to reach the machine A via WiFi (ping 10.2.3.22)
The ping (or any other protocol) are not OK. The machine A receive the request 
(see with wireshark) but A is not responding.

Result : after plugin the Ethernet cable on the Host A, the communication with 
Host B is broken, The wireless IP of A is no longer responding.

                                 _______
                                | Host B |
                                | ______ |
                                    |IP : 10.0.252.222/23
      _____________________ ________|
    | IP : 10.0.253.61/23           | IP : 10.0.252.254/23 ( gateway)
 ___|_(ethernet)                ____|___
|       |                       |Router |
|Host A |                       |_______|
|______ |                           | IP : 10.2.3.254/24 ( gateway)
    | IP : 10.2.3.22/24             |
    |  (wifi)                       |
    |_______________________________|



Routing table of A
--------------------------
$ route -n
Destination     Passerelle  Genmask              Indic Metric Ref   Use Iface
10.2.3.254      0.0.0.0      255.255.255.255     UH    0      0     0 wlan30
10.0.252.254    0.0.0.0      255.255.255.255     UH    0      0     0 eth1
10.0.252.31     10.2.3.254   255.255.255.255    UGH    0      0     0 wlan30
10.0.252.37     10.2.3.254   255.255.255.255    UGH    0      0     0 wlan30
10.2.3.0        0.0.0.0      255.255.255.0        U    0      0     0 wlan30
10.0.252.0      0.0.0.0      255.255.254.0        U    0      0     0 eth1
0.0.0.0         10.2.3.254   0.0.0.0             UG    0      0     0 wlan30

$ip route show
10.2.3.254 dev wlan30  scope link
10.0.252.254 dev eth1  scope link
10.0.252.31 via 10.2.3.254 dev wlan30
10.0.252.37 via 10.2.3.254 dev wlan30
10.2.3.0/24 dev wlan30  proto kernel  scope link  src 10.2.3.22
10.0.252.0/23 dev eth1  proto kernel  scope link  src 10.0.252.125
default via 10.2.3.254 dev wlan30

Solution Proposal
-------------------------
Each interface has his own routing table for the response.

1) When interface is UP and have his IP assigned, create an IP rule to match 
the src IP and a routing table, all the routing rules for wifi are dumped into 
a new table "wifi".

$ ip rule show
0:    from all lookup local
32762:    from 10.2.3.22 lookup wifi
32766:    from all lookup main
32767:    from all lookup default

$ ip route show table wifi
10.2.3.254 dev wlan30
10.0.252.31 via 10.2.3.254 dev wlan30
10.2.3.0/24 dev wlan30
default via 10.2.3.254 dev wlan30

$ ip route show table main
10.2.3.254 dev wlan30
10.0.252.31 via 10.2.3.254 dev wlan30
10.2.3.0/24 dev wlan30  proto kernel  scope link  src 10.2.3.22
default via 10.2.3.254 dev wlan30

2) From machine B try to reach the machine A via WiFi ( ping 10.2.3.22 )
The ping are OK, the packet cross the gateway and arrive to machine A.

3) Connect the ethernet cable
Ethernet interface is up and have an IP address, create another ip rule for 
this interface :

$ip rule show
0:    from all lookup local
32761:    from 10.0.252.125 lookup ethernet
32762:    from 10.2.3.22 lookup wifi
32766:    from all lookup main
32767:    from all lookup default

the main table is kept whithout any change
$ ip route show table main
10.2.3.254 dev wlan30
10.0.252.254 dev eth1
10.0.252.31 via 10.2.3.254 dev wlan30
10.2.3.0/24 dev wlan30  proto kernel  scope link  src 10.2.3.22
10.0.252.0/23 dev eth1  proto kernel  scope link  src 10.0.252.125
default via 10.2.3.254 dev wlan30

One table to respond correctly on each interface:

$ip route show table wifi
10.2.3.254 dev wlan30
10.0.252.31 via 10.2.3.254 dev wlan30
10.2.3.0/24 dev wlan30
default via 10.2.3.254 dev wlan30

$ip route show table ethernet
10.0.252.254 dev eth1
10.0.252.0/23 dev eth1
default via 10.0.252.254 dev eth1

4) From machine B try to reach the machine A via WiFi (ping 10.2.3.22).
The ping are OK. The machine is responding, after plugging the ethernet Wire 
the communication is not dropped.


--
Massot Julien

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to