# One way slow network

## coRpTitan

Hello all,

I have following situation:

Computer A(Gentoo 2.6.2_x86)  <---1Gbps-link---> Computer B(Windows 7 x64)

My problem is, when I try to copy file(I tried SMB, FTP, ...) from B -> A I'm able to do this by speed ~20 000 KBps. But problem occurs when I try to download this file(or another file from machine A to B). This transfer is usually ~5-6 000 KBps. 

I would say it's problem somewhere on PC A. Thee is no problem with protocol, because of I'm getting this bad results with all protocols. There is no problem with networking because of I'm able to establish faster connection in another direction. Also I think there is no problem on computer B, because of it have multiple NICs from same vendor with same drivers connected directly to other computers and I'm having this problem only there.

Here is my config on A machine:

```
# lspci -vv

...

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

        Subsystem: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx+

        Latency: 64 (8000ns min, 16000ns max), Cache Line Size: 32 bytes

        Interrupt: pin A routed to IRQ 18

        Region 0: I/O ports at 3000 [size=256]

        Region 1: Memory at 84000000 (32-bit, non-prefetchable) [size=512]

        Expansion ROM at 80000000 [disabled] [size=128K]

        Capabilities: [dc] Power Management version 2

                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1+,D2+,D3hot+,D3cold-)

                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

        Kernel driver in use: r8169

        Kernel modules: r8169

```

I'm using drivers from Realtek website(r8169-6.011.00) because of I was having problems with drivers from kernel.

```
# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:1f:1f:19:bc:66

          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:4925054 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4500771 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1202923600 (1.1 GiB)  TX bytes:661296996 (630.6 MiB)

          Interrupt:18 Base address:0x2000

#
```

```
 # ethtool eth1

Settings for eth1:

        Supported ports: [ TP ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 1000Mb/s

        Duplex: Full

        Port: Twisted Pair

        PHYAD: 0

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: pumbg

        Wake-on: g

        Current message level: 0x00000033 (51)

        Link detected: yes

#
```

When I'm transferring files CPU usage is around 10% and I have enough free memory. Also there is no problem with disk speed, because of when I copy files from one to another directory I'm able to get good result. This computers are connected directly, so there is no router/switch/hub which can cause this problems.

Thank you for any hints.

----------

## Hu

To verify, you think the problem is on Gentoo because it shows the slow speeds when uploading to all systems, or only when it uploads to the Windows system?  Do you see any packet loss or TCP retransmissions during the transfer?  Does the performance start out poor or degrade over time?  If you move small files, is it better, worse, or the same?

----------

## coRpTitan

 *Hu wrote:*   

> To verify, you think the problem is on Gentoo because it shows the slow speeds when uploading to all systems, or only when it uploads to the Windows system?  Do you see any packet loss or TCP retransmissions during the transfer?  Does the performance start out poor or degrade over time?  If you move small files, is it better, worse, or the same?

 

Just to clarify, I don't want to blame Gentoo. I like this system and each system has some problems, nothing is perfect. Why I think it's problem on machine with Gentoo is that when I upload from another computers to that Windows machine I get better speed. When possible, I will try to reboot windows machine and by using Gentoo liveCD try transfer speed again.

When I try to ping between computers I get 0% packet loss. Performance is bad all the time. 

When trying to copy small files I get worst result ~2 000KBps.

About retransmissions: Going to capture beginning of that communication and after that I will let you know.

----------

## coRpTitan

I managed to catch few packets on Gentoo machine by using tcpdump -i eth1 -nn -vv host 192.168.1.2 > cap.txt

.1.1 => Gentoo machine

.1.2 => Windows machine

I was transferring one bigger file from Gentoo -> Windows and I run this tool ~5seconds after I initiated this file transfer.

This is result:

```

21:47:01.621711 IP (tos 0x0, ttl 128, id 16646, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x5c9e (correct), seq 672969848, ack 3510981674, win 64240, length 0

21:47:01.621751 IP (tos 0x0, ttl 64, id 38202, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0xa7ca), seq 62781:64241, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

21:47:01.621918 IP (tos 0x0, ttl 128, id 16647, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x56ea (correct), seq 0, ack 1461, win 64240, length 0

21:47:01.621940 IP (tos 0x0, ttl 64, id 38203, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0xfe29), seq 64241:65701, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

21:47:01.622124 IP (tos 0x0, ttl 128, id 16648, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x5136 (correct), seq 0, ack 2921, win 64240, length 0

21:47:01.622150 IP (tos 0x0, ttl 64, id 38204, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0x600c), seq 65701:67161, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

21:47:01.622332 IP (tos 0x0, ttl 128, id 16649, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x4b82 (correct), seq 0, ack 4381, win 64240, length 0

21:47:01.622355 IP (tos 0x0, ttl 64, id 38205, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0xed72), seq 67161:68621, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

21:47:01.622540 IP (tos 0x0, ttl 128, id 16650, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x45ce (correct), seq 0, ack 5841, win 64240, length 0

21:47:01.622560 IP (tos 0x0, ttl 64, id 38206, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0x28ea), seq 68621:70081, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

21:47:01.622746 IP (tos 0x0, ttl 128, id 16651, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x401a (correct), seq 0, ack 7301, win 64240, length 0

21:47:01.622765 IP (tos 0x0, ttl 64, id 38207, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0x5c60), seq 70081:71541, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

21:47:01.622964 IP (tos 0x0, ttl 128, id 16652, offset 0, flags [DF], proto TCP (6), length 40)

    192.168.1.2.53551 > 192.168.1.1.445: Flags [.], cksum 0x3a66 (correct), seq 0, ack 8761, win 64240, length 0

21:47:01.622984 IP (tos 0x0, ttl 64, id 38208, offset 0, flags [DF], proto TCP (6), length 1500)

    192.168.1.1.445 > 192.168.1.2.53551: Flags [.], cksum 0x8922 (incorrect -> 0x69ef), seq 71541:73001, ack 0, win 65535, length 1460SMB-over-TCP packet:(raw data or continuation?)

```

To be hones I'm not sure if this format of output can be useful, if not please let me know by what tool should I cap better data for analyse. I think 1st packet is just acknowledge of previously sent packet. And 2nd packet at this report is next part of data sent...

----------

## HeissFuss

Try opening the cap file in wireshark.  It's much easier to look at that way.

Do you see the same issue if you upload files from the Win7 machine to the Gentoo one?  Have you tried forcing 100Mbit on the link to see if that improves speed?

----------

