How are Linux namespaces associated with trex interface ?

116 views
Skip to first unread message

chris...@gmail.com

unread,
Jan 21, 2025, 6:18:25 AMJan 21
to TRex Traffic Generator
Hi All , 

This is in continuation to my previous post titled "trex_stack_linux_based.cpp- Need help in understanding on how arp and ping works when linux_based namespaces are configured ?"

I could not post there hence creating a new one.

When I have namespaces, I see that linux is not forwarding packets as the mac address of namespace doesn't match the linux interface's mac address. So , I would like to understand how trex associates linux namespaces with linux interface bound to trex .

Here , the linux interface test is bound to trex.
- port_limit: 2
  version   : 2
  #c         : 3
  interfaces: ['test', 'dummy']
  stack     : linux_based
  low_end   : true
  low_end_core: 15

How are namespaces further associated to test ? Please clarify , so that i can use it to debug my packet forwarding failure
From code we only see these commands executed where there is no association to test.

stack going to run: ip netns add trex-a-0-0
stack going to run: ip link add trex-a-0-0-T type veth peer name trex-a-0-0-L
stack going to run: sysctl net.ipv6.conf.trex-a-0-0-T.disable_ipv6=1
stack going to run: ip link set trex-a-0-0-T mtu 9280 up
stack going to run: ip link set trex-a-0-0-L netns trex-a-0-0
stack going to run: ip netns exec trex-a-0-0 sysctl net.ipv6.conf.trex-a-0-0-L.disable_ipv6=1
stack going to run: ip netns exec trex-a-0-0 ip link set trex-a-0-0-L mtu 9280 up
stack going to run: ip netns exec trex-a-0-0 ip link set dev trex-a-0-0-L address 06:10:ab:e3:cf:ae

hanoh haim

unread,
Jan 21, 2025, 9:38:35 AMJan 21
to chris...@gmail.com, TRex Traffic Generator
Hi Chris, 
There is no direct connection between the interface name and the stack, when working with stack we create a linux interface in namespace (vif), and each packet generated by this interface we forward to the physical interface (in your example test) every packet that we read from test it being forward to the vif. this way we are getting the CP stack logic attached to the dpdk interface (arp/ipv6 nd) and because the rate of the CP packets is low we don't have a performance issue 

Thanks
Hanoh



--
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/trex-tgn/3da4c933-ee51-4957-8f34-96ec584d16b7n%40googlegroups.com.


--
Hanoh
Sent from my iPhone

chris...@gmail.com

unread,
Jan 22, 2025, 8:05:39 AMJan 22
to TRex Traffic Generator
Thanks much Hanoh . 
So , trex forwards the packets from vif to test and trex(dpdk) is responsible for sending the packet out. Is this understanding right ?  
 Here , trex is running in a container within a kubernetes pod. Whats happening currently is if I add ip via l3 add ping from trex(container in a pod) to DUT(container in another pod) works fine and the moment I add ip within ns , with ns add , the packets are not seen outside the trex .Trex capture and tcpdump on test interface shows it , but the mac of -L interface is not learnt on my switch and is not reaching the DUT as well , which confirms that the response from Trex never came out of the container. 

Only difference I can see in l3 add the src mac of packet matches test interface's mac and packet forwarding is fine. In case of ns add the src mac of packet doesn't match the test interface mac and hence the packet is not forwarded . So , is it something to do with Trex ?

Please help me in resolving this. I have run out of debugging options . It would be great if you can suggest some debugging options from trex side to make sure the packet is sent out successfully by trex.Can some dpdk logs be checked ?
If yes , where can I check those ?

chris...@gmail.com

unread,
Feb 11, 2025, 3:09:03 AMFeb 11
to TRex Traffic Generator
Hi Hanoh , 

I could resolve the transmission of packets out of sriov vf though mac address doesn't match by turning off spoof check on vf .Now the receive is still blocked as the mac address isn't mathcing the vf's mac .Promiscuous mode is on but it still doesnt forward the packets .Any thoughts on this ?
Meanwhile , when i try to fix this , could you suggest if there is a way for me to configure multiple vlans on the same trex interface without namespaces ?

Thanks,
Chris.
Reply all
Reply to author
Forward
0 new messages