Windows vs Linux throughput and persistent routes/windows pc slower file transfer?

Khandakar Ashfaqur RahmanKhandakar Ashfaqur Rahman (rigan123)
CERTIFIED EXPERT
Published:
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine.

For this, I arranged a test scenario.I used 2 routers, 4 computers (3 Windows and 1 Linux) and 2 switches.

Scenario:

   Network Scenario
***All the links are Fast Ethernet 100 Mbps link *****

From the figure we can see the BDR router is the internet gateway. The Mikrotik Router has NAT enabled and default gateway is BDR router's LAN IP.2 IP's are assigned into Mikrotik's LAN interface. One is private and another is public IP. Using private block IP (172.x.x.0/24) indicates NAT is using as a routing protocol. To know more about NAT please check the following link:

http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094831.shtml

Test Plan and Subnet Scenario :

172.x.x.0/24 is the LAN of Mikrotik.Gateway is 172.x.x.1. The Microtek router translates it's public IP (41.x.x.30) into 172.x.x.0/24
41.x.x.128/26 is also LAN of Mikrotik.Gateway is 41.x.x129. Default route is using for this subnet
41.x.x.0/27 is the WAN side of Mirotik Router. Default gateway of this subnet is: 41.x.x.1.

So, the difference between 172.x.x.0/24 and 41.x.x.128/26 is routing protocol.172.x.x.0/24 is using NAT and 41.x.x.128/26 is using default route.
41.x.x.0/27 is the subnet of Mikrotik's WAN. We used 2 different machines from this subnet. One is Linux (41.x.x10) and another is Windows(41.x.x9). Now we want to see the throughput between LAN and WAN.So possible methods are:

1. To test throughput between 172.x.x.0/24  and 41.x.x.0/27
    a. Source PC 172.x.x.10 destination PC 41.x.x.9 (Windows)
    b. Source PC 172.x.x.10 destination PC 41.x.x.10 (Linux)

2. To test  throughput between 41.x.x.128/26 and 41.x.x.0/27
    a. Source PC 41.x.x.131 destination PC 41.x..9 (Windows)
    b. Source PC 41.x.x.131 destination PC 41.x.x.10 (Linux)

We'll use IPERF tool for measuring this throughput. We'll put one iperf.exe as a client into source machine.Another iperf.exe we'll put into destination pc as a servicer mode. Now,let's see what's difference between Test 1 & Test 2 and is it really for windows and Linux or not.


PC Configurations:

Win XP Service Pack 3
IP: 172.x.x.10
SM: 255.255.255.0
GW:172.x.x.1


Win XP Service Pack 3
IP:  41.x.x.131
SM: 255.255.255.192
GW:41.x.x.129


Win XP Service Pack 3
IP:  41.x.x.9
SM: 255.255.255.224
GW:41.x.x.1

Redhat Enterprise Linux 4
IP:  41.x.x.10
SM: 255.255.255.224
GW:41.x.x.1

Routers:

BDR Router: This router is the internet gateway.
LAN IP: 41.x.x.1
SM: 255.255.255.224

WAN IP: 41.x.y.228
SM:255.255.255.248


Following shows the routes into BDR Router:

ip route 0.0.0.0 0.0.0.0 41.x.y.225
ip route 41.x.x.128 255.255.255.128 41.x.x.30

#sh ip route

     41.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
C       41.x.y.224/29 is directly connected, FastEthernet0/1
S       41.x.x.128/25 [1/0] via 41.x.x.30
C       41.x.x.0/27 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 41.x.y.225


Mikrotik Router:

WAN IP: 41.x.x.30
SM: 255.255.255.224

LAN IP:172.x.x.1
SM:  255.255.255.0
LAN IP: 41.x.x.129
SM: 255.255.255.192

/ip route> print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 #     DST-ADDRESS        PREF-SRC        G   GATEWAY                 DISTANCE        INTERFACE
 0  A S   0.0.0.0/0                                       r    41.x.x.1                           1              WAN
 1 ADC  41.x.x.0/27                                         41.x.x.30                          0              WAN
 2 ADC  41.x.x.128/26                                     41.x.x.129                        0              LAN    
 3 ADC  172.x.x.0/24                                       172.x.x.1                          0              LAN    

NAT is enabled into Mikrotik router:

@MikroTik] /ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
 0   chain=srcnat action=masquerade src-address=172.x.x.0/24

So, Mikrotik has configured default gateway=41.x.x.1 and private IP range 17.x.x.0/24 is assigned into LAN BY NAT.



Throughput Test :

Now, we want to test throughput between following pcs'

1.  Between 172.x.x.10  and 41.x.x.9 (Between two XP Machine.Using NAT )
2.  Between 172.x.x.10  and 41.x.x.10 (Between XP & Linux.Using NAT)
3.  Between 41.x.x.131  and 41.x.x.9 (Between two XP machine.Using default route)
4.  Between 41.x.x.131  and 41.x.x.10 (Between XP and Linux machine.Using default route)

Tool Used for Throughput test: Iperf
Iperf is a tool that shows throughput between two link. It has server end and client end.We need to set one end as server and another end as client.
iperf -s                          (To run as server)
iperf -c 'server IP'          (To run as client)  
For more details please check iperf documentation

http://openmaniak.com/iperf.php

Results:

Test 1:
C:\Documents and Settings\***\Desktop>iperf.exe -c 41.x.x.9
[ ID] Interval                 Transfer     Bandwidth
[1912]  0.0-10.0 sec   111 MBytes  92.7 Mbits/sec

Test  2:
C:\Documents and Settings\***\Desktop>iperf.exe -c 41.x.x.10
[ ID] Interval                 Transfer     Bandwidth
[1912]  0.0-10.0 sec   111 MBytes  92.6 Mbits/sec

Test  3:
C:\Documents and Settings\***\Desktop>iperf.exe -c 41.x.x.9
[ ID] Interval             Transfer         Bandwidth
[1912]  0.0-10.0 sec  68.7 MBytes  57.6 Mbits/sec

Test  4:
C:\Documents and Settings\sysman\Desktop>iperf.exe -c 41.x.x.10
[ ID] Interval               Transfer       Bandwidth
[1912]  0.0-10.0 sec   108 MBytes  90.1 Mbits/sec

So, All cases, throughput is more than 90Mbps except Test 3.So, what's the routing issue into Windows than Linux ?


Solution:

I tried to figure out the solution by checking route print and traceroute from both Linux and Windows.

Route Print into 41.x.x.9:

===========================================================================
Active Routes:
Network Destination        Netmask                       Gateway             Interface           Metric
       0.0.0.0                      0.0.0.0                          41.x.x.1               41.x.x.9            10
      41.x.x.0                     255.255.255.224           41.x.x.9              41.x.x.9             1
      41.x.x.9                     255.255.255.255          127.0.0.1             127.0.0.1           10
   41.255.255.255            255.255.255.255          41.x.x.9               41.x.x.9              10
        127.0.0.0                 255.0.0.0                      127.0.0.1            127.0.0.1           1
        224.0.0.0                 240.0.0.0                      41.x.x.9               41.x.x.9             10
  255.255.255.255           255.255.255.255          41.x.x.9               41.x.x.9             1
Default Gateway:       41.x.x.1



Route print at 41.x.x.10

# route -n
Kernel IP routing table
Destination     Gateway        Genmask               Flags Metric Ref    Use     Iface
41.x.x.0           0.0.0.0          255.255.255.224    U        0        0        0      eth0
169.254.0.0     0.0.0.0          255.255.0.0            U        0        0       0      eth0
0.0.0.0             41.x.x.1         0.0.0.0                   UG      0        0        0      eth0

Now, we see that windows and linux routing table are not same.


Tracert from 41.x.x.9:

Tracing route to [41.x.x.131]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  [41.x.x.1]
  2     1 ms     1 ms     1 ms      [41.x.x.30]
  3     1 ms     1 ms     1 ms      [41.x.x.131]

Trace complete.


Traceroute from 41.x.x.10:

[root@***l ~]# traceroute 41.x.x.131
traceroute to 41.x.x.131 (41.x.x.131), 30 hops max, 40 byte packets
 1  (41.x.x.30)  0.848 ms  1.141 ms  1.122 ms
 2  * * *

Traceroute
From the figure, we see the difference of routing between Windows and Linux though the they are in the same subnet and using same default gateway.So, we need to add two persistent routes into windows PC so that it doesn't reach it's gateway first to reach at 41.x.x.128/25.

Let's add the following:

C:\Documents and Settings\**\Desktop>route add -p 41.x.x.0 mask 255.255.255.224 41.x.x.9 metric 1
C:\Documents and Settings\**\Desktop>route add -p 41.x.x.128 mask 255.255.255.128 41.x.x.30 metric 1

Let's see the difference now:

C:\Documents and Settings\***\Desktop>route print

===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask                   Gateway       Interface     Metric
          0.0.0.0                   0.0.0.0                      41.x.x.1         41.x.x.9       10
         41.x.x.0                  255.255.255.224       41.x.x.9        41.x.x.9       1
         41.x.x.9                  255.255.255.255       127.0.0.1      127.0.0.1    10
         41.x.x.128              255.255.255.128       41.x.x.30      41.x.x.9       1
      41.255.255.255        255.255.255.255        41.x.x.9        41.x.x.9       10
        127.0.0.0                255.0.0.0                    127.0.0.1      127.0.0.1    1
        224.0.0.0                240.0.0.0                    41.x.x.9        41.x.x.9       10
  255.255.255.255  255.255.255.255                41.x.x.9        41.x.x.9       1
Default Gateway:       41.x.x.1
===========================================================================
Persistent Routes:
  Network Address          Netmask            Gateway Address  Metric
      41.x.x.0             255.255.255.224        41.x.x.9                 1
    41.x.x.128           255.255.255.128        41.x.x.30               1


C:\Documents and Settings\**>tracert 41.x.x.131

Tracing route to [41.x.x.131]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms   [41.x.x.30]
  2    <1 ms    <1 ms    <1 ms   [41.x.x.131]

Trace complete.


Finally we get,

C:\Documents and Settings\***\Desktop>iperf.exe -c 41.x.x.9
[ ID] Interval               Transfer       Bandwidth
[1912]  0.0-10.0 sec   110 MBytes  92.4 Mbits/sec

We find this is the only route issue which was causing throughput problem in windows machine only. Adding persistent routes may simply resolve this problem.
2
10,860 Views
Khandakar Ashfaqur RahmanKhandakar Ashfaqur Rahman (rigan123)
CERTIFIED EXPERT

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.