MAC address override in TRex stateless traffic

867 views
Skip to first unread message

Yichen Wang

unread,
Sep 19, 2016, 8:28:09 PM9/19/16
to TRex Traffic Generator
Hi,

I am trying to use TRex v2.08 to generate the stateless traffic, and here is the piece of code to generate the traffic:

pkt_base = Ether(src=src_mac, dst=dst_mac) / IP() / UDP()
payload = 'x' * (max(64, int(l2frame_size)) - 46)
pkt = STLPktBuilder(pkt=pkt_base / payload)
s = [STLStream(name='test', packet=pkt, mode=STLTXCont())]

From what I see from the switch connected to my TRex, packets are being TX/RX with no problem. However, from the TRex console, I can only see packets are going out (TX), but not a single packet getting received (RX). If I change the code to something like:
pkt_base = Ether() / IP() / UDP()
to use the MAC defined in /etc/trex_cfg.yaml, TRex will work perfectly.

So is there a known bug which will cause problems when doing "MAC Override"?

Thanks very much!

Regards,
Yichen

ido barnea

unread,
Sep 20, 2016, 1:28:38 AM9/20/16
to Yichen Wang, TRex Traffic Generator
Hi Yichen,
When you doing “MAC override”, you actually “confuse” the devices. Need good reason to do this.
You need to make the switch know which MAC belong to which port.
Even when traffic reaches the TRex, network card will usually drop it because it is not its MAC address.
You can change this by putting the port into promiscuous mode by running something like this in the console (see portattr —help for all options):
portattr -a --prom

Ido
> --
> 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 post to this group, send email to trex...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/00ce9a98-a812-4127-bd62-77ad5cc3e343%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Yichen Wang

unread,
Sep 20, 2016, 6:06:40 PM9/20/16
to TRex Traffic Generator, xfeng...@gmail.com
Hi, Ido,

Your suggestions work for me. Thanks a lot for your helps!

Regards,
Yichen

aparna.s

unread,
Sep 22, 2016, 11:34:12 AM9/22/16
to TRex Traffic Generator
Hello,

I'm seeing a similar issue on TRex v2.08. I configure my MAC addresses to a certain value, but when I look at the packet capture while sending traffic from TRex, it picks up the MAC address configured in trex_cfg.yaml. I also set the ports to promiscuous mode, although here it is just outgoing and not incoming traffic, so that should not affect it. Can you point me to what could be wrong here?

Thanks and Regards,
Aparna

aparn...@gmail.com

unread,
Sep 22, 2016, 11:44:30 AM9/22/16
to TRex Traffic Generator, aparn...@gmail.com
It worked with MAC override, although I did not set this in v2.00. Is it necessary to set MAC override in v2.08?

Regards,
Aparna

Reply all
Reply to author
Forward
0 new messages