Network Traffic Generation
Shachar Shemesh
shachar at shemesh.biz
Sat Mar 14 08:48:47 IST 2009
Daniel Feiglin wrote:
> For what it's worth, they can both be pinged
> from the host and the ifconfig output looks fine.
>
I am sorry. "For what it's worth" is exactly nothing. The setup you are
trying to achieve is not possible as is.
The problem is convincing the TCP/IP stack to route packets to an IP it
knows to be local through a physical network card. Truth be told, I'm
faced with a similar problem for a project I'm working on, and don't
have a great solution either.
Do the following experiment. Connect the 100 card to a network, and from
another computer ping the 101 address while a sniffer is running. You
will see an ARP reply going out from the 100 card, carrying the 100 MAC
address, and the ping will succeed despite the 101 card being
disconnected. Why? Because the computer says "I know how to reach 101 -
it's my IP, so if the ARP reached the 100 card, it's probably a good MAC
address to respond with".
> Later, the crossed cable will be replaced by a radio link (which relates
> to the purpose of all this).
>
> To carry out the packet generation, I downloaded and built the iperf
> program (http://sourceforge.net/forum/forum.php?forum_id=808751).
>
From the quick look I gave it, it seems that iperf does not force the
sending of the packets from a network interface (it can bind to address,
but that still goes through the machine's TCP/IP stack and routing
tables, so no solutions there).
What you need is to partition the TCP/IP stack for the machine. You need
to have the 100 and 101 addresses belong to separate routing tables. The
most immediate solution is to run a virtual machine, and give it
exclusive access to one of the NICs. This way you can configure, for
example, the 100 address in the real machine and the 101 address in the
virtual one.
There is also a solution I've heard of once, but never had chance to
either try it or even look at it. Basically, it does this partitioning
inside one running kernel. It came as a patch to the Linux kernel. I
don't recall how its called or what are the details, so it may even not
be a solution at all.
> Has anyone on the list done this (using iperf or something similar)
> using a single box with two NICs?
>
>
Never done it, but maybe a packet based traffic generator, instead of a
traffic based one, will be able to be told "issue the packets through
this NIC". The problem is, of course, that I don't think a packet
generator checks what you are trying to check - TCP throughput. Either
way, give tcpreplay a go and see whether it is capable of testing what
you want tested (I doubt it).
Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20090314/b35f42d0/attachment.html>
More information about the Linux-il
mailing list