You are not logged in.
Hi!
I have two PCs running arch: one laptop and one desktop.
Laptop has two interfaces one wlan and one wired one:
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether c4:17:fe:d4:a9:4a brd ff:ff:ff:ff:ff:ff
3: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:26:b9:a4:54:59 brd ff:ff:ff:ff:ff:ff
Desktop only one wired:
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 90:e6:ba:0d:3f:b9 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.155/24 brd 192.168.1.255 scope global dynamic enp2s0
valid_lft 78774sec preferred_lft 78774sec
inet6 fe80::92e6:baff:fe0d:3fb9/64 scope link
valid_lft forever preferred_lft forever
Both wired interfaces are 1000 Mbps/Full duplex as well as Ethernet Switch is 1Gbps capable.
I noticed that ssh connection estableshed from desktop to laptop (when laptop connected over wireless) is very laggy. Sometimes it's ok, but sometimes the response comes like 10-15 seconds after the command was typed in. I found it strange, since the rest of the wireless clients @ home, like two Android devices as well as Windows-powered laptop don't experience any similar lag whenever connecting to Internet (Ethernet switch is integrated with Internet gateway).
Anyway I decided to use HW WiFi switch on the laptop (to turn WIFi off) and established a wireline connection from laptop to the switch. After that ssh (connected to wireline IP of laptop) went smooth and seamless. I even ran a iperf test showing the expected throughput:
laptop (wired ip 192.168.1.103):
iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.1.103 port 5001 connected with 192.168.1.155 port 45763
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.0 sec 1.10 GBytes 941 Mbits/sec
desktop (wired ip 192.168.1.155):
iperf -c 192.168.1.103
------------------------------------------------------------
Client connecting to 192.168.1.103, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.155 port 45763 connected with 192.168.1.103 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 1.10 GBytes 942 Mbits/sec
So the iperf flows go 192.168.1.103<---->192.168.1.155 at full speed, and as said, ssh is not laggy.
Now guess what? If wireless interface gets re-enabled (HW switch is switched on), the throughput on the same path gets drastically reduced and lags reappear! And yes, I'm absolutelly sure no traffic actually goes between desktop's LAN iface and laptop's wifi!
See the log
laptop (wired ip 192.168.1.103, wireless ip 192.168.1.75):
iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.1.103 port 5001 connected with 192.168.1.155 port 45810
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-11.2 sec 1.62 MBytes 1.22 Mbits/sec
desktop (wired ip 192.168.1.155):
iperf -c 192.168.1.103
------------------------------------------------------------
Client connecting to 192.168.1.103, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.155 port 45810 connected with 192.168.1.103 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-11.0 sec 1.62 MBytes 1.24 Mbits/sec
tcpdump on desktop:
sudo tcpdump | grep 192.168.1.75
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp2s0, link-type EN10MB (Ethernet), capture size 262144 bytes
23:47:30.978585 IP 192.168.1.75 > 239.192.0.0: igmp v2 report 239.192.0.0
As you can see no traffic goes through the wireless IP address, still the throughput is "wireless", although endpoint is specidied as wireline. ssh connected from desktop to laptop's wireline also lags if it was connected to wireless IP.
P.S. While I was doing the excercise above, I saw even more weird picture. The iperf to wireless and LAN IPs were giving exact same result of ~ 1 Gbps throughput, which is clearly cannot be the case for connection between wireless and LAN.
I'm a bit lost, seems like Linux sends all the traffic through one or another interface no matter what IP address was targetted by a TCP/IP session. Can anyone clarify this?
Thanks!
Last edited by lhog (2014-11-11 20:56:54)
Offline
After googling around I have found out that the Linux networking system is done in the way that IP address belongs to a host and not to an interface, so when multiple interfaces are situated in the same subnet, then any of the interfaces could be used to physically carry the IP packets.
This is weird and counterintuitive, still it is what it is. The topic could be archived.
Offline
I stumbled upon http://support.microsoft.com/kb/175767 a few days ago - just putting it here for reference.
Offline
I havent tried it but using ssh with bind_address should let you pick which ip address/interface the connection will be made from.
Offline
crondog:
The issue is actually not the TCP/IP binding, which works well as expected, rather a loose behavior in L2/ARP domain. What linux essentially does whenever it has dilemma which of several interface to use from a number of interfaces in the same subnet/L2 domain, it uses the one pointed to by a default route. So it doesn't really matter if the L3 application targets one IP or another, the responding box can reply you using the other interface, though with originally targeted IP address.
Here are few links which might describe issue better and point out few solutions:
http://z-issue.com/wp/linux-rhel-6-cent … esnt-ping/
http://serverfault.com/questions/336021 … t-in-linux
http://serverfault.com/questions/415304 … ame-subnet
https://www.centos.org/forums/viewtopic.php?t=8401
http://www.linuxforums.org/forum/red-ha … issue.html
Last edited by lhog (2014-11-12 17:06:02)
Offline
I intuitively reached the same conclusion a few months ago. I just felt like my network performance was snappier when wifi was off than when it was on. So, I stopped bringing up wireless, by default.
Tim
Offline