Matt Garman wrote:
> My motherboard has two on-board NICs. I'm trying to diagnose a network
> performance problem. What I'd like to do is enable both NICs, put a
> cross-over cable between them, and perform some speed benchmarking.
>
> I got both NICs setup with IP addresses (eth0=192.168.1.1,
> eth1=192.168.1.2).
>
> Now how do I actual force data across the cable? I was using scp and
> gkrellm and as far as I can tell, the system is smart enough to know
> that it doesn't need to go out on the network to copy a file from eth0
> to eth1. But can I change this?
>
> Thanks,
> Matt
>
You can't in any easy, direct way. Most applications are written to
open sockets which are bound to and connect to ip addresses. Because
the linux kernel is smart enough to realize that you are connecting to
an ip address on a local interface it wont send data through one NIC to
the other, but instead forward it directly to the destination interface.
If you want to do this there are three methods:
1) Get a second pc with 2 NICS on it (use an identical motherboard if
you can) and measure performance between them.
2) Get (lease/rent) and network performance test tool (a smartbits or an
ixia device) and use that to bench your system network performance.
3) Write some code (or find some other application) that opens a
PF_PACKET socket and binds it to one interface. Then write the code to
spit raw data in the appropriate format out that socket so as to be
recognized as a packet destined for the other interface. This will
allow you to implement the test you wanted above, as the kernel won't do
any of its routing magic on this socket.
Each method has a few drawbacks (1 introduces another pc variable in the
test, 2 can be very expensive, and 3 can show degraded performance due
to other system bottlenecks besides the NIC). All however will give you
some idea of what your system can preform like.
--
/************************************************** *
*Neil Horman
*Software Engineer
*Red Hat, Inc.,
http://people.redhat.com/nhorman
*gpg keyid: 1024D / 0x92A74FA1
*
http://www.keyserver.net
************************************************** */