Archive for the ‘Networks’ Category

Linux ethernet driver ring buffer

Friday, April 2nd, 2010

While performing some tests with a congested 10Mbps link, a strange thing happened: The link was congested only on one direction and both endpoint queues were RED queues. Based on the parameters and the queue size, the delay between those two links should be something near 170ms. However, the delay was much larger: >300ms (!).

The “problem” was the ring-buffer of the underlying driver (e1000). This one used a buffer of 128 packets which when added to the average 150 packets in the queue, resulted in >300ms delay.

You can see this buffer by running:

#ethtool -g eth0

And you can modify this buffer by running:

#ethtool -G eth0 tx 80

This is the transmit buffer which (when filled) adds to the delay of the local queue.

Of course, in normal use, this buffer is a good thing as it will allow to get higher transfer rates easier (from the POV of the operating system). But when making experiments, this little thing gets in the way.

Another thing is that there seems to be a minimum value for this number. For example, on this card:

Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller

the minimum value is 80 (using e1000 driver from kernel 2.6.32)

So beware and don’t loose a week looking for this thing like I did.

NOTE: This is not related to the transmit queue length that is used on the interface, as shown by:

# ifconfig eth0
# ip link show eth0

How to disable CDP-4-NATIVE_VLAN_MISMATCH (native vlan mismatch)

Tuesday, October 27th, 2009

Cisco switches support CDP and use it to help us in a number of ways. One of them is to detect native VLAN mismatch between two connected ports. For 99% of the time this is a “good thing to do” ™ but there are some corner cases where this is not what you want.

For example, if you have a switch that is connected with another switch and their connected ports are configured as access ports (and not trunk ports) then this message doesn’t make much sense.

Well… it does…

Cisco switches also support VTP which eases the VLAN management task. For VTP to work, switches that are under the same “local network” are also under the same “VTP domain”. A VTP domain logically groups switches.

Now, here is the problem: Two switches connected using access mode that are in the same VTP domain should share the same VLAN configuration, even if they are configured as transparent.

What to do: To bypass this problem you have to change the vtp domain on those switches so that it doesn’t match. If you haven’t changed that already, they most probably are not in any VTP domain at all or they are in the same VTP domain.

The solution:

  1. Configure at least one of the two switches to be in transparent mode. You may not want that, but if you don’t know what this means then just do it:

    Switch(config)# vtp mode transparent
  2. Change the VTP domain of that switch:

    Switch(config)# vtp domain a_unique_name

    (you may want to use the hostname)

… and this annoying message:


Oct 27 12:16:29.352 EET: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet2/6 (2), with sw-el0 GigabitEthernet0/8 (1).

will be gone

The Day The Routers Died

Thursday, September 17th, 2009

Great video!

And don’t forget to visit the IPv4 address report.

Plus a net-geeky video and how the three finger salute started.

Routes with greater prefix and Proxy ARP ~= IP Mobility

Friday, July 18th, 2008

Inside an Autonomous System, it is possible to move a machine inside a network, keeping its IP address even though it goes to a network segment that doesn’t serve the corresponding Network.

Something like this:

RouterA -------- Network Segment
                        |
         Host A (10.1.0.2/24, GW: 10.1.0.1)

It is possible to move Host A to another network segment, lets say to interface FastEthernet of RouterB. Of course this would require address and possibly other configuration changes to Host A. Changin the IP address of a server is not always a good idea ™.

Lets say that we move Host A to interface FastEthernet of Router B. Supposing that a routing protocol is setup and works in the Autonomous System, Host A may keep its IP address by configuring RouterB (cisco commands):

RouterB(config)# ip route 10.1.0.2 255.255.255.255
   FastEthernet 0/1

RouterB(config)# interface FastEthernet 0/1
RouterB(config-if)# ip proxy-arp      # This is the default

RouterB(config)# router eigrp 1
RouterB(config-router)# redistribute static

RouterA(config)# interface FastEthernet 0/1
RouterA(config-if)# ip proxy-arp

This will work because:

  • Whenever Host A tries to reach a host in its subnet (ARP request), Router B will respond with its mac address. This is what Proxy ARP does.
  • All routers within the A.S. will learn the 10.1.0.2/32 route. Even Router A will prefer to use this one instead of the directly connected 10.1.0.0/24 since it has a longest preffix (routing table lookups are longest matching preffix lookups)
  • Since Router A will also learn this route and since it has Proxy ARP enabled, it will respond to ARP requests for 10.1.0.1 with its address