Skip to contentSkip to conversation

Linux based router for Gigabit traffic

DISCUSSION Anantha Kiran 13 participants 15 messages Aug 22, 2004 – Aug 27, 2004

lore
Share & tools
lore
#0 lore raw

Hi
I am doing a project, in which i have to redirect traffic coming from one ethernet card of a machine, to one of three remaining three ethernet cards of same machine based on the src,dest IP and Port values of the pkt. I wrote a net_hook module to do this which i working fine for lower speeds like < 400 Mbps traffic. But project goal is to deal with gigabit traffic. I have used gigabit ethernet cards and Switch. But when the traffic rate is more than 400Mbps it is dropping packets. I did test, by increasing the transmit queue length. But same problem is coming. I have found during the pkt drop there is no memory or CPU is hundred percently utilised. So, what can be the resource that is lacking while dropping of pkts is happend.

We have done a test, in which module will simply forward pkts from "eth0" through "eth1". Same problem of pkt dropping at highier speed is happening.

Now we thought , it can be due to PCI bus. But we are unable to find what is configuration of PCI bus , our system is using. we have used "lspci" to find that. But i am unable to interpret it. I am attaching that output file. Can anybody tell me how to interpret that or give some guidelines , like whom to mail, to find that.

Atlast we try to solve the problem in the following manner. Idea is to, install a router for my machine which can deal with gigabit traffic. If the router is able to work with gigabit traffic, then definitely pkts dropping will not be due to PCI bus.

So, canbdoy please, suggest some opensource router for linux which
can deal with gigabit traffic. Or atleast some suggestions to solve this problem.

Signature · 2 lines
K.AnanthaKiran
D-108/HALL-7
#1 lore raw
Quoted 23 lines · Anantha Kiran

Hi
I am doing a project, in which i have to redirect traffic coming from one ethernet card of a machine, to one of three remaining three ethernet cards of same machine based on the src,dest IP and Port values of the pkt. I wrote a net_hook module to do this which i working fine for lower speeds like < 400 Mbps traffic. But project goal is to deal with gigabit traffic. I have used gigabit ethernet cards and Switch. But when the traffic rate is more than 400Mbps it is dropping packets. I did test, by increasing the transmit queue length. But same problem is coming. I have found during the pkt drop there is no memory or CPU is hundred percently utilised. So, what can be the resource that is lacking while dropping of pkts is happend.

We have done a test, in which module will simply forward pkts from "eth0" through "eth1". Same problem of pkt dropping at highier speed is happening.

Now we thought , it can be due to PCI bus. But we are unable to find what is configuration of PCI bus , our system is using. we have used "lspci" to find that. But i am unable to interpret it. I am attaching that output file. Can anybody tell me how to interpret that or give some guidelines , like whom to mail, to find that.

Quoted 10 lines

Atlast we try to solve the problem in the following manner. Idea is to, install a router for my machine which can deal with gigabit traffic. If the router is able to work with gigabit traffic, then definitely pkts dropping will not be due to PCI bus.

So, canbdoy please, suggest some opensource router for linux which can deal with gigabit traffic. Or atleast some suggestions to solve this problem.

Quite simply a general purpose CPU system isn't normally built to handle network traffic at gigabit rates, especially not from multiple ports at once. If you really want a line rate gigabit router, you need custom ASIC to do hardware offload of that work. Several networking companies make just such hardware (of course most only sell the chips, not full pci cards with integrated NICS). Check out broadcom, AMCC or Intel, they all have hardware like what you're looking for. Neil

#13 lore raw
In reply to Anantha Kiran
Quoted 13 lines · Anantha Kiran

Hi
I am doing a project, in which i have to redirect traffic coming from one ethernet card of a machine, to one of three remaining three ethernet cards of same machine based on the src,dest IP and Port values of the pkt. I wrote a net_hook module to do this which i working fine for lower speeds like < 400 Mbps traffic. But project goal is to deal with gigabit traffic. I have used gigabit ethernet cards and Switch. But when the traffic rate is more than 400Mbps it is dropping packets. I did test, by increasing the transmit queue length. But same problem is coming. I have found during the pkt drop there is no memory or CPU is hundred percently utilised. So, what can be the resource that is lacking while dropping of pkts is happend.

Quoted 3 lines

We have done a test, in which module will simply forward pkts from "eth0" through "eth1". Same problem of pkt dropping at highier speed is happening.

The lspci output shows that you have a GE and a FE interfaces. Getting thru more than 100 Mbps should not be possible with that..

01:01.0 Ethernet controller: Intel Corp. 82540EM Gigabit Ethernet Controller (rev 02)
Subsystem: Intel Corp. PRO/1000 MT Desktop Adapter
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (63750ns min), cache line size 08

That card has a PCI bus of:
PCI 2.3 32-bit 33/66 MHz

which means it can handle up to about 260 MB/s thru the bus. If about 10% of that is transaction overhead, and then 50/50 goes to network traffic, that gives upper limit of 115 MB/s which is about 0.92 Gbit/s.

But if the bus runs at mere 33 MHz ...

01:08.0 Ethernet controller: Intel Corp. 82801BD PRO/100 VE (LOM) Ethernet Controller (rev 81)
Subsystem: Intel Corp.: Unknown device 3009
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (2000ns min, 14000ns max), cache line size 08

"LOM" cards are something that are built into the system boards. They communicate command and management traffic thru the PCI bus, but payload traffic goes thru separate channel to main memory hub.

The LOM cards are usually giga-ethers, which means the pci-ids are
something most strange.. Also this is located into same PCI bus as
the PRO/1000 MT card above, and the bus can't alter speed in between different cards -- which means that the bus is running at 33 MHz.

Possibly that LOM "card" really is some GE card, and it can run
full GE speed to main memory. However it will eat into PCI bus
bandwidth for the command traffic, although the data traffic flows thru a LOM side-channel.

The PCI bridge in between main hub, and the bus where those cards are tells:

00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB PCI Bridge (rev 81) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR+
Latency: 0
Bus: primary=00, secondary=01, subordinate=01, sec-latency=32

So, that bus is running at 33 MHz, and a 32 bit wide GE card in it can get around 0.4 Gbit/s thru it (remembering that that bus has also other traffic thru it, than just ethernet traffic itself.)

Quoted 10 lines

Now we thought , it can be due to PCI bus. But we are unable to find what is configuration of PCI bus , our system is using. we have used "lspci" to find that. But i am unable to interpret it. I am attaching that output file. Can anybody tell me how to interpret that or give some guidelines , like whom to mail, to find that.

Atlast we try to solve the problem in the following manner. Idea is to, install a router for my machine which can deal with gigabit traffic. If the router is able to work with gigabit traffic, then definitely pkts dropping will not be due to PCI bus.

A motherboard with two or more LOM GE interfaces MIGHT do it. Those are usually available only with 10/100/1000Base-T, not with optical (gbic) mode.

Another approach is to have system with multiple PCI-X busses, and add PCI-X GE cards.

For example:
http://www.supermicro.com/products/motherboard/Xeon800/E7520/X6DH8-XG2.cfm

Quoted 6 lines

So, canbdoy please, suggest some opensource router for linux which
can deal with gigabit traffic. Or atleast some suggestions to solve this problem.

Signature · 2 lines
K.AnanthaKiran
D-108/HALL-7

/Matti Aarnio

#2 lore raw
In reply to Neil Horman
Quoted 7 lines · On Sun, 22 Aug 2004 08:49:04 -0400 Neil Horman <[email protected]> wrote:

Quite simply a general purpose CPU system isn't normally built to handle network traffic at gigabit rates, especially not from multiple ports at once. If you really want a line rate gigabit router, you need custom ASIC to do hardware offload of that work. Several networking companies make just such hardware (of course most only sell the chips, not full pci cards with integrated NICS). Check out broadcom, AMCC or Intel, they all have hardware like what you're looking for.

Gigabit routing is possible with commodity hardware. It's a software problem for the cases that go fast enough currently.

#3 lore raw
Quoted 2 lines · David S. Miller

Gigabit routing is possible with commodity hardware. It's a software problem for the cases that go fast enough currently.

To properly handle full duplex gigabit speeds at 300 bytes average packet size we need approx 800k packets per second.

So I guess the question should be rephrased into "how many packets per second can you get commodity architecture to do?" because that's of more interest than how many megabit/s we can handle (as it's usually the limiting factor).

Signature · 1 line
Mikael Abrahamsson    email: [email protected]
#5 lore raw
In reply to David S. Miller
Quoted 5 lines · David S. Miller
Quoted 2 lines · On Sun, 22 Aug 2004 08:49:04 -0400 Neil Horman <[email protected]> wrote:

Quite simply a general purpose CPU system isn't normally built to handle network traffic at gigabit rates, especially not from

Quoted 8 lines

multiple

Quoted 1 line

ports at once. If you really want a line rate gigabit router, you

need

Quoted 1 line

custom ASIC to do hardware offload of that work. Several networking

Gigabit routing is possible with commodity hardware. It's a software problem for the cases that go fast enough currently.
-

Possible, but only up to 2 gbps. Correct me if I'm wrong, but one full-
duplex gigabit card alone can fill up the entire theoretical maximum bandwidth of the PCI bus, which is only 266MBps. Four gigabit cards on a normal PCI bus is far more than PCI can handle.

#6 lore raw
In reply to David S. Miller
Quoted 9 lines · David S. Miller
Quoted 1 line · On Sun, 22 Aug 2004 08:49:04 -0400 Neil Horman <[email protected]> wrote:

Quite simply a general purpose CPU system isn't normally built to handle network traffic at gigabit rates, especially not from multiple ports at once. If you really want a line rate gigabit router, you need custom ASIC to do hardware offload of that work. Several networking companies make just such hardware (of course most only sell the chips, not full pci cards with integrated NICS). Check out broadcom, AMCC or Intel, they all have hardware like what you're looking for.

Gigabit routing is possible with commodity hardware. It's a software problem for the cases that go fast enough currently.

Really? What are PCI bus transfer rates up to these days? I havent looked into it in quite a while. N3il

Signature · 8 lines
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *[email protected]
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/
#7 lore raw
Quoted 2 lines · Neil Horman

Really? What are PCI bus transfer rates up to these days? I havent looked into it in quite a while. N3il

Your average 33mhz PCI bus has a paltry maximum bandwidth of 1 gbps. Full-duplex gigabit routing on more than one interface pretty much requires PCI Express. Here's a little table:
PCI32 33MHz = 133MB/s PCI32 66MHz = 266MB/s PCI64 33MHz = 266MB/s
PCI64 66MHz = 533MB/s
PCI-X 133MHz = 1066MB/s

Also gigabit routing on your average unmodified linux distribution requires a VERY hefty CPU to keep up, even just with two or three gigabit interfaces.

#4 lore raw
In reply to Mikael Abrahamsson

Well, as was mentioned, the question is "what type of commodity hardware". You can easily buy motherboards now with PCI X (express).

Then, you also have to consider USB network cards, which I assume are a different bus system as well. It all matters if you are in a controlled environment or you have to work with lowest common denominator. ----- Original Message -----
From: "Mikael Abrahamsson" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Monday, August 23, 2004 3:11 AM
Subject: Re: Linux based router for Gigabit traffic

Quoted 20 lines · David S. Miller
Quoted 3 lines

Gigabit routing is possible with commodity hardware. It's a software problem for the cases that go fast enough currently.

To properly handle full duplex gigabit speeds at 300 bytes average packet size we need approx 800k packets per second.

So I guess the question should be rephrased into "how many packets per second can you get commodity architecture to do?" because that's of more interest than how many megabit/s we can handle (as it's usually the limiting factor).

Signature · 6 lines
Mikael Abrahamsson    email: [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#9 lore raw
In reply to Neil Horman
Quoted 8 lines · Neil Horman
Quoted 2 lines · Anantha Kiran

Hi
I am doing a project, in which i have to redirect traffic coming from

Quite simply a general purpose CPU system isn't normally built to handle network traffic at gigabit rates, especially not from multiple ports at once. If you really want a line rate gigabit router, you need

Modern CPU's can handle gigabit and by the numbers 10 gigabit traffic for what he is wanting. (If you use PCI-X or Express)

It is mainly getting the PCI bus and kernel
interrupts to deal with that speed. We are able to push through 750 mbits on E1000 cards through netfilter on HTTP loads. The main problem is that the card generates an IRQ per packet and the soft irq takes up all the CPU load. On mixed network loads we are at about 400 mbits also.. but it isnt the bus that is loaded but the number of packets per second that the card can handle.

To find out what the bottleneck is on the system, you need to make sure your box has the correct tools ( a top that shows soft-irq, a newer mpstat and other items). Also make sure that the motherboard Bus is PCI-X or better.

#10 lore raw

DNS "named" question

Hello,

This question is more like hitting in the dark, I guess.

We have a primary and secondary DNS server. Twice or thrice so far since "named" automatically failed. Eg. on those times, I simply typed "/etc/rc.d/init/named restart" It showed "STOP - FAILED", "START - OK", after which things were normal.

I was wondering if anyone could give me pointers what could cause "named" to be down automatically simultaneously on both primary and secondary DNS servers.
Individually each of the servers function properly. So, there should be some event (which got unlogged) which trigerred both servers to shut down "named"?

There was nothing abnormal in the log files. Also, "named" was down on both primary and secondary DNS servers on each occasion.

Thanks
Tony

#11 lore raw

Re: DNS 'named' question

Quoted 5 lines · Tony Gogoi

Hello,

This question is more like hitting in the dark, I guess.

Quoted 8 lines

We have a primary and secondary DNS server. Twice or thrice so far since "named" automatically failed. Eg. on those times, I simply typed "/etc/rc.d/init/named restart" It showed "STOP - FAILED", "START - OK", after which things were normal.

I was wondering if anyone could give me pointers what could cause "named" to be down automatically simultaneously on both primary and secondary DNS servers.

Probably a bad record, spelling mistake, typo, etc. in your zone files. nslint is your friend in this case.

Quoted 6 lines

Individually each of the servers function properly. So, there should be some event (which got unlogged) which trigerred both servers to shut down "named"?

There was nothing abnormal in the log files. Also, "named" was down on both primary and secondary DNS servers on each occasion.

Depending on the undisclosed version of your undisclosed DNS software, there is probably a log setting that can help you debug this. Either way, you should at least get a 'named died/shutdown/killed' message some place.

#12 lore raw

Re: DNS "named" question

In reply to Tony Gogoi
Quoted 19 lines · Tony Gogoi

Hello,

This question is more like hitting in the dark, I guess.

We have a primary and secondary DNS server. Twice or thrice so far since "named" automatically failed. Eg. on those times, I simply typed "/etc/rc.d/init/named restart" It showed "STOP - FAILED", "START - OK", after which things were normal.

I was wondering if anyone could give me pointers what could cause "named" to be down automatically simultaneously on both primary and secondary DNS servers.
Individually each of the servers function properly. So, there should be some event (which got unlogged) which trigerred both servers to shut down "named"?

There was nothing abnormal in the log files. Also, "named" was down on both primary and secondary DNS servers on each occasion.

Quoted 9 lines

Thanks
Tony

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Try running something like this:

# named -d 255 -u named -g > ~/named.log 2>&1 &

(note that you need a user called 'named' for that to work)

The next time named crashes, take a look at the last few lines of ~/named.log and see if it gives you any clue as to where the problem is. You can always turn up the debug level (the 255) to get more information about what is going on.

~Bradley

#8 lore raw
In reply to urgrue

An HTTP load is pretty much unidirectional (outbound), so that 700megabits is the total system load.

Anantha wants to ROUTE 1gigabit of traffic -- That's 1gig in + 1gig out =2gig total.

if you divide your 700Megabit HTTP traffic by two, you'll get a bit less than the 400Mb that he's claiming to have gotten so far.

A quick overview:

Matti's bus bandwith calcs indicate that standard PCI won't do the job in terms of theoretical bandwidth capability. Once you switch up to PCI-Express, you'll have the bus bandwith, but you may end up with A CPU limit (the soft INT's).
At that point, you might have to go to Real-Time Linux and, possibly, custom drivers. If you can get away from the the kernel Task Switching overhead for each packet, you should be OK in terms of CPU capability.

Quoted 27 lines · Stephen J. Smoogen
Quoted 8 lines · Anantha Kiran

No, we are not using NAPI for this. But we wrote a net_hook module which catches the pkts before allowing it to go upper layers.

CPU utilization is 70+ while dropping.

Can u tell me the configuration of your low-end machine.Like PCI-bus, and others.

Ours are Intel(R) Xeon(TM) CPU 2.40GHz and the motherboard has a PCI-X chipset on it. We have one Intel fibre optic Gig-E on the 02:01 PCI-X Bus, and the other on the 03:01 PCI-X bus. I see a limit of about 750 mbits/sec on a fixed load (HTTP accesses for specific boxes), and 400 mbits/sec on a mixed load (ICMP/UDP/TCP). In each case, the maximum looks to not be the bus speed as much as the soft-irq limit (which is what mpstat says is using all the resources). The number of packets per second that ifconfig and other tools gives me looks about the same. so I am thinking it isnt bus width at the moment as much as IRQ/packets per second.

The kernels are NAPI compiled.. but I really havent figure out if using netfilters on these mixed loads 'disables' it.

Signature · 4 lines
Stephen Samuel +1(604)876-0426                [email protected]
		   http://www.bcgreen.com/~samuel/
   Powerful committed communication. Transformation touching
     the jewel within each person and bringing it to light.
#14 lore raw
In reply to Anantha Kiran
Quoted 9 lines · Anantha Kiran <ananth.kandukuri <at> gmail.com> writes:

Hi
I am doing a project, in which i have to redirect traffic coming from one ethernet card of a machine, to one of three remaining three ethernet cards of same machine based on the src,dest IP and Port values of the pkt. I wrote a net_hook module to do this which i working fine for lower speeds like < 400 Mbps traffic. But project goal is to deal with gigabit traffic.

Quoted 5 lines

...

So, canbdoy please, suggest some opensource router for linux which
can deal with gigabit traffic. Or atleast some suggestions to solve this problem.

I have not used any gigabit hardware but I know on 100Mbps cards throughput at all speeds is noticely improved by enabling full duplex. And that is what I suggest to you. I believe you set it with ifconfig but I have not done so through ifconfig since 2.2.x.x. Now-a-days most distros allow those changes to be made when you're setting up your box during the installation.

neolozer