# Realtek 8139 Full-Duplex mode (max transfer speed 900kb/sec)

## Flux-

I have read about problems of Full-Duplex mode that doesn't work etc. I have a Realtek 8139 NIC. It has worked fine since from the install, but there was one problem I did mark. I'm using Gentoo in my server. I tried to transfer some big files to my server from my workstation. The problem is that ftp transfer's max speed is about 900kb/sec (I have a 10/100 switch).

I have set my workstation's NIC, the switch and my server's NIC to work with Full-Duplex mode. But still, the transfer speed is only that 900kb/sec.

Here is what I got with mii-tool:

```

root@yume flux # mii-tool

eth0: negotiated 100baseTx-FD flow-control, link ok

root@yume flux #

```

So it seems to work fine.

What could be the problem?

----------

## RedDawn

Right now im in stage1 emerge system is running > :Smile:     Well im not sure but take a look at your FTP Servers configuration file!  I think some FTP server configuration file come with a Maximum Transfer speed already set in them! maybe you can change em and it should work!  rememeber that if you wanna take full advanged of your 10/100 networks you need to:

100Mbs (divided by) 8.  and mutiply  the anser you get by 1024 and put that as the max transfer speed!  well hope it works Worked for me! im transfering stuff at Approximately 12.5-13MBs   Take care!

----------

## fleed

Also, if you're testing with ssh/scp that could be what's holding you back.

----------

## Raoul_Duke

I know this doesn't help....but i've got 8139's in both my server and desktop machine (both gentoo) and i get 8mb transfer speed. Didn't do anything special either. Maybe check ftp cap like mentioned above?

----------

## NeddySeagoon

Flux-,

900k bytes/sec on a 100M bit network link is about as good as its gets. 

8 bits per byte, some packet overhead bytes some dead time etc. 

Full duplex doesn'r help FTP much because the data is all going one way and there will be dead time while the receiver checks packets and generates ACK, or maybe even NAK, in which case the packet is resent.

If you had a lot of traffic both ways at the same time, then full duplex would come into its own.

Regards.

NeddySeagoon

----------

## fleed

100Mbit/s = (100/8)Mbyte/s = 12.5Mbyte/s theoretical tops with no compression. The best I've seen on my network is about 11MBps with nfs so 900KBs is very low indeed. full/half duplex should make very little difference if you're only transferring data one way, as Neddy said. 

If you're using ssh you'll get something way below what you'd get with ftp/nfs/smb.

Check for collisions (ifconfig) Since you're using a switch there should none. 

You could also check by connecting the two machines with a cross-over cable so the switch is out of the picture.

----------

## chiatello

 *fleed wrote:*   

> 100Mbit/s = (100/8)Mbyte/s = 12.5Mbyte/s theoretical tops with no compression. The best I've seen on my network is about 11MBps with nfs so 900KBs is very low indeed. full/half duplex should make very little difference if you're only transferring data one way, as Neddy said. 
> 
> If you're using ssh you'll get something way below what you'd get with ftp/nfs/smb.
> 
> Check for collisions (ifconfig) Since you're using a switch there should none. 
> ...

 

but speed is measured in bits kbits per second and whatnot

----------

## Flux-

Ifconfig says that there are about 142 collisions.

```

eth0:0    Link encap:Ethernet  HWaddr 00:20:18:8B:60:1A

          inet addr:192.162.0.1  Bcast:80.186.47.255  Mask:255.255.240.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:142 txqueuelen:100

          RX bytes:390264863 (372.1 Mb)  TX bytes:119295002 (113.7 Mb)

          Interrupt:10 Base address:0x9000

```

I have a 1mbps adsl connection and it transfers about 100kb/s, so 10mbps should be able to transfer 1000kb/s (~1mb/s, what my transfer speed is right now) and 100mbps should be able to transfer 10000kb/s (~10mb/s) with my logic. I can be wrong too but but :/

I have tested my transfer speed with ftp and I got that 900kb/s. IMHO ftp is one of the fastest protocols.  I can test with a cross-over cable later today, when I have enough time for that.

What should I do with that Full-Duplex mode? Would it be better to change it half?

----------

## NeddySeagoon

Flux-,

Oops. Sorry about the dropped decimal point.

FTP uses TCP/IP NFS uses UDP. There is no built in error checking in UDP, so it goes faster on the same hardware.

Leave the full duplex alone. When you are looking at a problem, only change one thing at at time.

All the poor network data rate is telling you is that the bottleneck is elsewhere.

What happens if you ftp a file on each computer by connecting via their own IP address  (not 127.0.0.1) ?

You may want to send the file to /dev/null so you only have one disk access.

Now you are FTPing a file through the network stack to /dev/null.

What data rate do you get on each PC ?

Regards,

NeddySeagoon

----------

## Flux-

 *NeddySeagoon wrote:*   

> What happens if you ftp a file on each computer by connecting via their own IP address  (not 127.0.0.1) ?
> 
> You may want to send the file to /dev/null so you only have one disk access.
> 
> Now you are FTPing a file through the network stack to /dev/null.
> ...

 

I tried that on my server. The transfer speed started from 6MB/s, it quickly changed to 3MB/s and then started to get slower and slower. 2.59MB/s was the upload speed when the send was finished.

Now I tried that on my workstation too. The speed was around 50kb/s, but I'm not sure if there were some limits on.

----------

## fleed

Hmm, sounds fishy. That means you're getting pretty good throughput with your network, if it's going faster than a local file transfer. 

Also, with a switch you should have no collisions. Maybe your PCs are too slow? What are their specs? What do you get with hdparm -tT /dev/hda (for eg).

----------

## Flux-

My workstation is an AMD TB 1.3ghz with 512mb memory. My server is an Intel P200MMX with 64mb memory. Oh, I forgot to mention that I'm using WinXP on my workstation.

Here's the hdparm:

```

root@yume flux # hdparm -tT /dev/hda

/dev/hda:

 Timing buffer-cache reads:   140 MB in  2.01 seconds =  69.65 MB/sec

 Timing buffered disk reads:   38 MB in  3.10 seconds =  12.28 MB/sec

root@yume flux #

```

----------

## fleed

try 

```
time dd if=/dev/zero of=/tmp/big_file bs=1m count=100
```

 to see what kind of write performance you get out of your server. Since you get 12mbps on read, write will be lower than that. Still, that's not even close to the throughput you're seeing out of ftp so there must be something slow on the machine. It's not that old so I'd expect better performance out of it. You could also try the nic drivers from www.scyld.com to see if you get something better. 

Don't remember if this has been mentioned before but does dmesg or /var/log/messages show anything?

----------

## Flux-

Here's what I got:

```

root@yume root # time dd if=/dev/zero of=/tmp/big_file bs=1 count=100

100+0 records in

100+0 records out

real    0m0.017s

user    0m0.005s

sys     0m0.010s

root@yume root #

```

dmesg seems to be normal too, I can paste it here if it's necessary.

I tried to install those NIC drivers, but when I tried to insmod the new module, it didn't work. I guess this isn't heading to anywhere, so maybe it's better for me to live with that 10mbps connection :)

----------

## Flux-

The last lines from the dmesg:

```

pci-scan.c:v1.11 8/31/2002  Donald Becker <becker@scyld.com> http://www.scyld.com/linux/drivers.html

rtl8139.c:v1.23 3/10/2003 Donald Becker, becker@scyld.com.

 http://www.scyld.com/network/rtl8139.html

rtl8139.c:v1.23 3/10/2003 Donald Becker, becker@scyld.com.

 http://www.scyld.com/network/rtl8139.html

rtl8139.c:v1.23 3/10/2003 Donald Becker, becker@scyld.com.

 http://www.scyld.com/network/rtl8139.html

rtl8139.c:v1.23 3/10/2003 Donald Becker, becker@scyld.com.

 http://www.scyld.com/network/rtl8139.html

rtl8139.c:v1.23 3/10/2003 Donald Becker, becker@scyld.com.

 http://www.scyld.com/network/rtl8139.html

```

I got pci-scan installed normally, but not the NIC module.

```

root@yume root # insmod rtl8139.o

rtl8139.o: init_module: No such device

Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.

      You may find more information in syslog or the output from dmesg

root@yume root #

```

(Don't know is there any help of this anymore)

----------

## fleed

For the dd test, you only tested 100 bytes, you should have used bs=1m, and not bs=1. Only 100 bytes doens't really tell us anything about the write speed of the drive.

You might need to specify irq or io settings for the modules to work. Look at lspci to see what it's using (I think, plz correct me if I'm wrong)

----------

## Flux-

There was a problem when I used bs as 1m

```

root@yume flux # time dd if=/dev/zero of=/tmp/big_file bs=1m count=100

dd: invalid number `1m'

real    0m0.015s

user    0m0.005s

sys     0m0.005s

```

----------

## fleed

Oops, sorry mate. Should have been 1M.

----------

## Flux-

Ok :)

```

root@yume flux # time dd if=/dev/zero of=/tmp/big_file bs=1M count=100

100+0 records in

100+0 records out

real    0m9.697s

user    0m0.005s

sys     0m3.365s

```

----------

## fleed

10813406 bytes per sec = 10MBs or 10.8mBs. So your write speed is not the bottleneck.

----------

## smart

with 64M RAM swapping might be your enemy. What do you get on

vmstat -S K

after an FTP upload test?

----------

## Flux-

I tried first the ftp transfer speed with cross-cables. The speed was something like 200kb/s (don't know if the cable's bad or something).

Then I uploaded a file to my server. Speed was around 800-850kb/s. After that:

```

root@yume root # vmstat -S K

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa

 0  0   7020    756   1540  33756    3    7    13    15   34    38 16  4 80  0

```

Woah! I downloaded a file from my workstation and the speed was something like 5.50mb/s. After that:

```

root@yume flux # vmstat -S K

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa

 0  0   7020    784   1320  34068    3    7    13    16   35    38 16  4 80  0

```

Then I uploaded the same file. Speed was around 3.10MB/s. And after that:

```

root@yume flux # vmstat -S K

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa

 0  0   7020    772   1344  33584    3    7    14    16   36    38 16  4 80  0

```

This is strange. If I upload to my server a file from my workstation, the speed is around 800kb/s. But if I dowload the file from my workstation with ncftp the speed is around 5MB/s. I uploaded the same file with ncftp back to my workstation, the speed was around 3.10MB. It's a lot faster when the ftp-daemond (GuildFTP, WinXP) is used in my workstation and the server uses ncftp. But still, the speed isn't as fast as a 100mbps should be. Don't know if it would get any faster than this.

----------

