In stateless trex, is it possible to use only one port to send packets?

2,530 views
Skip to first unread message

Guoliang Han

unread,
Dec 20, 2017, 7:19:19 AM12/20/17
to TRex Traffic Generator
Hi, Team:

I need stateless trex send packets on only ONE port, but it seems a little difficult:

1) if in /etc/trex_cfg.yaml,  set port_limit to 1 and only set 1 interface, "ERROR need at least 2 ports" appears.
2) if I set two ports in trex_cfg.yaml but one ports is not up, t-rex-64 cannot be started, showing "EAL: Error - exiting with code: 1; Cause: one of the links is down"
3) If i set two ports in trex_cfg.yaml and two ports are both up, trex service can be started and I can configure in GUI that only one port sends packets.
However, I don't want the other port up (which needs another fiber and another optical module).

So is there alternative ways to do it?
Thanks a lot in advance.

Guoliang

hanoh haim

unread,
Dec 20, 2017, 7:49:20 AM12/20/17
to Guoliang Han, TRex Traffic Generator
See inline

On Wed, 20 Dec 2017 at 14:19 Guoliang Han <guolian...@gmail.com> wrote:
Hi, Team:

I need stateless trex send packets on only ONE port, but it seems a little difficult:

1) if in /etc/trex_cfg.yaml,  set port_limit to 1 and only set 1 interface, "ERROR need at least 2 ports" appears.
2) if I set two ports in trex_cfg.yaml but one ports is not up, t-rex-64 cannot be started, showing "EAL: Error - exiting with code: 1; Cause: one of the links is down"
3) If i set two ports in trex_cfg.yaml and two ports are both up, trex service can be started and I can configure in GUI that only one port sends packets.
However, I don't want the other port up (which needs another fiber and another optical module).
It is not required to have a link up for unused port.

So is there alternative ways to do it?
Thanks a lot in advance.

Guoliang

--
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/0108520d-bff0-44a3-85da-d6780f075814%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Hanoh
Sent from my iPhone

Guoliang Han

unread,
Dec 20, 2017, 10:15:40 PM12/20/17
to hanoh haim, TRex Traffic Generator
Hi, hanoh:

Thanks for your reply. But if one port is not up, stateless trex GUI cannot be started:

# ./t-rex-64 -i -c 6
Killing Scapy server... Scapy server is killed
Starting Scapy server.... Scapy server is started
The ports are bound/configured.
Starting  TRex v2.32 please wait  ... 
 set driver name net_ixgbe 
 driver capability  : TCP_UDP_OFFLOAD  TSO 
 Number of ports found: 2 
zmq publisher at: tcp://*:4500
 wait 2 sec ..
port : 0 
------------
link         :  link : Link Up - speed 10000 Mbps - full-duplex
promiscuous  : 0 
port : 1 
------------
link         :  Link Down
promiscuous  : 0 
EAL: Error - exiting with code: 1
  Cause:  One of the links is down 


On 20 December 2017 at 20:49, hanoh haim <hhaim...@gmail.com> wrote:
See inline

On Wed, 20 Dec 2017 at 14:19 Guoliang Han <guolian...@gmail.com> wrote:
Hi, Team:

I need stateless trex send packets on only ONE port, but it seems a little difficult:

1) if in /etc/trex_cfg.yaml,  set port_limit to 1 and only set 1 interface, "ERROR need at least 2 ports" appears.
2) if I set two ports in trex_cfg.yaml but one ports is not up, t-rex-64 cannot be started, showing "EAL: Error - exiting with code: 1; Cause: one of the links is down"
3) If i set two ports in trex_cfg.yaml and two ports are both up, trex service can be started and I can configure in GUI that only one port sends packets.
However, I don't want the other port up (which needs another fiber and another optical module).
It is not required to have a link up for unused port.

So is there alternative ways to do it?
Thanks a lot in advance.

Guoliang

--
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+unsubscribe@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/0108520d-bff0-44a3-85da-d6780f075814%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Guoliang Han

unread,
Jan 15, 2018, 2:04:46 AM1/15/18
to hanoh haim, TRex Traffic Generator
Hi, Team:

Any Update?

Is it possible to use stateless trex to send packets from only one port, while all the other ports link down?

I tried several ways, but failed. I also tried to modify some code, but it led to coredump.

hanoh haim

unread,
Jan 16, 2018, 7:20:36 AM1/16/18
to Guoliang Han, TRex Traffic Generator
1) Did you try to mark this lines 
https://github.com/cisco-system-traffic-generator/trex-core/blob/master/src/main_dpdk.cpp#L4270

#if 0
         if (  get_ex_drv()->drop_packets_incase_of_linkdown() ){
                printf(" WARNING : there is no link on one of the ports, driver support auto drop in case of link down - continue\n");
            }else{
                dump_links_status(stdout);
                rte_exit(EXIT_FAILURE, " One of the links is down \n");
            }
#endif

if you will send traffic only on the port with the link there won't be crash 


2) the plan is to add support for dummy port. this way you will be able to support one port. there is no ETA yet. 


thanks,
Hanoh


Matt Callaghan

unread,
May 8, 2018, 11:06:49 AM5/8/18
to TRex Traffic Generator
Looks like dummy ports has been added as of version 2.38.
 * https://trex-tgn.cisco.com/trex/doc/trex_manual.html#_dummy_ports

Does anyone know if there is documentation though to provide example usage?
(I'm wondering about the limitations of single-port mode ... probably stateless only?)
Reply all
Reply to author
Forward
0 new messages