USNavalResearchLaboratory / mgen

Multi-Generator (MGEN) traffic generation tool
https://www.nrl.navy.mil/itd/ncs/products/mgen
Other
83 stars 25 forks source link

Binding to selected network interface #45

Open ksadura opened 1 year ago

ksadura commented 1 year ago

Hi, On my Ubuntu machine I have two network interfaces opened (let's call them X and Y). Is it possbile to specify outbound interface for UDP unicast traffic? In iperf3 we can force it using -B flag e.g.

iperf3 -c <server_addr> -p <server_port> -B <outbound_interface_addr>

Now, in mgen server logs we can read that X interface address is always source address of received packets (I want it to be Y address).

weston-nrl commented 1 year ago

For multicast traffic, you can use the "interface" option. For unicast, that's controlled by your system routing table.

bebopagogo commented 1 year ago

While MGEN has a “src” option that control the source port for a flow, I don’t think we have implemented a full source address bind option yet.  I think that could be a good idea if it gives the desired behavior.

If your objective is to send a packet out one physical interface and have it be received on another one over some route between those two interfaces, that is trickier in my experience than just setting the source address binding.  The loopback route seems to get used regardless of routing table manipulation in my experience unless you use something like LXC containers to have the interfaces configured in different namespaces.  We have used that approach successfully with MGEN to use the same machine for transmitting and receiving traffic and able to measure latency accurately since the same system clock is referenced for timing.

Best regards,

Brian

From: Krzysztof Sadura @.> Reply-To: USNavalResearchLaboratory/mgen @.> Date: Sunday, March 5, 2023 at 4:34 PM To: USNavalResearchLaboratory/mgen @.> Cc: Subscribed @.> Subject: [USNavalResearchLaboratory/mgen] Binding to selected network interface (Issue #45)

Hi, On my Ubuntu machine I have two network interfaces opened (let's call them X and Y). Is it possbile to specify outbound interface for UDP unicast traffic? In iperf3 we can force it using -B flag e.g. iperf3 -c -p -B Now, in mgen server logs we can read that X interface address is always source address of received packets (I want it to be Y address).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>