Technical Discussion
  >> Linux Issues


Register (or login) on our website and you will not see this ad.


  Print Thread
Standard User zhugeliang
(committed) Fri 15-Jul-11 13:00:39
Print Post

2 NICs .. seperate packets of data


[link to this post]
 
As you may notice from my previous post, I have 2 network cards in my machine. I have managed to increase the mtu to 8978 on the second one.

My question.

Would it be possible in Ubuntu to utilise both of these cards to allow separate types of data to pass through each card.

For example.

eth0 (onboard card) - TCP only

eth1 (Gb card) - All other

---------

If possible, would this be a setting on the router/switch or an OS level change, or come to think of it, would it be somethnig i would need to change on a program by program basis?

I'm thinking that separating the throughput to both cards would be helpful, but am I right?

Finally, if this is possible, would both cards be set to the same ip, or just the same network.

Human knowledge consists not only of libraries of parchment and ink - it is also comprised of the volumes of knowledge that are written on the human heart, chiselled on the human soul, and engraved on the human psyche.
In a world filled with hate, we must still dare to hope. In a world filled with anger, we must still dare to comfort. In a world filled with despair, we must still dare to dream. And in a world filled with distrust, we must still dare to believe.
<img src="http://www.speedtest.net/result/996953454.png">
Standard User john2007
(legend) Fri 15-Jul-11 13:26:05
Print Post

Re: 2 NICs .. seperate packets of data


[re: zhugeliang] [link to this post]
 
I can't think of any reason you'd want to separate tcp from other traffic but I think the iptables command would let you do it.

What is at the other end of eth0 and eth1?
Standard User zhugeliang
(committed) Fri 15-Jul-11 13:29:59
Print Post

Re: 2 NICs .. seperate packets of data


[re: john2007] [link to this post]
 
they just connect to a bog standard vm supplied router - netgear. im on the 50m package but at work now, so cant check or remember the model.

Human knowledge consists not only of libraries of parchment and ink - it is also comprised of the volumes of knowledge that are written on the human heart, chiselled on the human soul, and engraved on the human psyche.
In a world filled with hate, we must still dare to hope. In a world filled with anger, we must still dare to comfort. In a world filled with despair, we must still dare to dream. And in a world filled with distrust, we must still dare to believe.
<img src="http://www.speedtest.net/result/996953454.png">


Register (or login) on our website and you will not see this ad.

Standard User prlzx
(committed) Tue 19-Jul-11 22:38:30
Print Post

Re: 2 NICs .. seperate packets of data


[re: zhugeliang] [link to this post]
 
The short answer is that there is no benefit to 2 NICs connected to the same switch (or router) in your case.

Secondly trying to separate TCP on one NIC from all other data on another won't give you higher throughput. Also, other machines or devices will likely become confused when trying to talk to your PC.

Thirdly you can only really benefit from MTU higher than 1500 (Jumbo Frames) if all devices on the same LAN / subnet (including the router) can deal with it

The longer answer is that you can only get a benefit from 2 NICs to the same switch in communicating on your local network (not the internet),
and then only if you have a smart / managed switch that can do Link Aggregation on the two ports connected to the PC,
and then only if the OS / driver can do the same on the PC (sometimes also called NIC bonding or teaming).

Depending on the config that would achieve one or more of failover, load balancing, higher throughput. A typical use case is for a server.

Edit:
This is not OS-specific - what you are doing will maybe lead to services which announce themselves to the network doing so twice, which will look to the rest of the network like two computers (or services) with the same name but different IPs. You can imagine how this would be a problem for example if accessing shared files.

What tends to happen especially where the NICs are different speeds is that the gigabit card will get a lower metric for the route to the LAN and the slower card just will be ignored. Check the output of "netstat -r" to see how your PC sees your setup.
Edit: "netstat -re" will give you an extra column for metric
- "arp -a" will give you a list of other devices (IPs and MAC addresses) recently seen on each interface.

You can't fix it by setting the same IP address on both cards. They will each announce their different MAC addresses claiming that IP (using ARP messages). If you are lucky one interface will give up on the duplicate IP, if not the network will flap back and forth as other devices constantly update their ARP cache for that IP address.



prompt $P - Invalid drive specification - Abort, Retry, Fail? $G
prlzx on n e w n e t Max ADSL

Edited by prlzx (Tue 19-Jul-11 23:26:15)

  Print Thread

Jump to