You are here: Home Journal Network media status and settings
About the Author

Khairil believes that one can earn a decent living and enjoy life while enriching the wider community.

 

He currently works as an IT consultant for Inigo, advocates FOSS and free knowledge and culture.

 

Contact

Commenting is enabled with OpenID login.

 

All content on this site shared under the Creative Commons Attribution License 3.0

.

 

This is a personal site, comments and content here does not reflect the official viewpoint of Inigo Consulting.

OpenID Log in

 

Network media status and settings

— filed under: , , ,

Network Switch Lights

Most of us now work with relatively large amounts of data, whether it be media or data. I've been on a Gigabit Ethernet switch now for a few years, because transferring data or virtual machine images of several gigabytes over the network is painfully slow at 100Mb/s (12.5MB/s max). If you see this limit when transferring files with GigE equipment and Cat5e/6 cables, chances are auto-negotiation is setting a conservative limit.

One usually thinks of wired connections as relatively plug and play, and that's true for the most part. Unfortunately, I found out recently, that at least on my Ubuntu Linux workstation, with cheap networking equipment such the RealTeks, the Lantecs and what not that you have at home, the defaults may set your media speed to 100Mb/s (Fast Ethernet) and not 1000Mb/s (Gigabit Ethernet).

These days you do not need to look at blinking lights to see if stuff is connected (usually).

Checking and setting Ethernet media status on Linux

sudo ethtool eth0 (or your ethernet device):

Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
    Advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: pumbg
    Wake-on: g
    Current message level: 0x00000033 (51)
    Link detected: yes

You'll notice that Speed here is at 1000Mb/s. Initially it was at 100Mb/s by default on mine.

Setting it is rather straight forward, with speed defined in Mb/s:

sudo ethtool -s eth0 speed 1000

The man page for ethtool is actually friendly with examples, something that often isn't the case in Linux.

You probably want to set this as default on startup, in something like rc.local.

Checking and setting Ethernet media status on FreeBSD

ifconfig command on FreeBSD generally provides all this info for you:

re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 7200
    options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
    ether 00:13:f7:3a:80:f3
    inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
    inet 10.1.1.1 netmask 0xffffff00 broadcast 10.1.1.255
    inet 10.1.1.2 netmask 0xffffffff broadcast 10.1.1.2
    inet 10.1.1.3 netmask 0xffffffff broadcast 10.1.1.3
    inet 10.1.1.4 netmask 0xffffffff broadcast 10.1.1.4
    inet 10.1.1.5 netmask 0xffffffff broadcast 10.1.1.5
    inet 10.1.1.6 netmask 0xffffffff broadcast 10.1.1.6
    inet 10.1.1.7 netmask 0xffffffff broadcast 10.1.1.7
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active

No problems here, 1000baseT as default.

A bit of tuning and jumbo frames

More on jumbo frames (Wikipedia) and their benefits.

By default in this case I get an increase in speed from Fast Ethernet (~25MB/s), but you can tune things further. One tuning option is to enable jumbo frames. The default MTU is only 1500. Most of us at home are likely to be using some sort of RealTek card. Usually MTU of jumbo frames is 9000, but RealTek cards only support a max MTU of 7422. On Linux the max is 7200 and on FreeBSD 7422 for RealTek. So I set both at 7200.

Setting the MTU can be done graphically or via ifconfig on both operating systems.

Now I'm getting around 40MB/s which is about 330% increase in speed from initial default setting of 100Mb/s on Linux.


No

No
Document Actions