Fragmented traffic, stateless or stateful

639 views
Skip to first unread message

Robert Blomberg

unread,
Feb 25, 2017, 7:35:55 AM2/25/17
to TRex Traffic Generator
Hi!

I want to achieve fragmented traffic in trex either statefull or stateless.

To do stateless fragmented, I could use scapys "fragment"-function. Though, then I need to send multiple packets.

I see that the streams could only add one packet and not multiple ones.

Is there a way to use multiple streams or have multiple packet in one stream in trex?

For statefull, I tested with attached pcap, but seems that trex doesn't like the format of reassembled packets.

Any options of what I could do here?

/Robert Blomberg
ipv4_frag_overlap.pcap

hanoh haim

unread,
Mar 2, 2017, 12:38:07 PM3/2/17
to Robert Blomberg, TRex Traffic Generator
Hi Robert,

For Stateless you can generate either dependent streams, something like this

A->B->C

See here an example 

(You can generate a utility that convert Scapy fragment to multi-stream and contribute that)

Or generate many fragments in parallel (self_start=True for all) 

Stateful uses the IPv4.id fields so need a change in the code to mask the reserve values. This is the reason it fails to load a pcap with fragments.


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 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/0c7b90b9-deff-4d47-aa8c-41df6db14417%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Hanoh
Sent from my iPhone

Robert Blomberg

unread,
Mar 13, 2017, 8:17:33 AM3/13/17
to TRex Traffic Generator, robert.b...@gmail.com
Hi Hanoh!

Your proposal worked, thanks!

Do you want me to contribute this? If so, is there any process on how to add this?

hanoh haim

unread,
Mar 13, 2017, 12:45:59 PM3/13/17
to Robert Blomberg, TRex Traffic Generator
Hi Robert,
Github pull request is the best way currently 
Please add a profile example under stl folder 

Hanoh

For more options, visit https://groups.google.com/d/optout.

Akash Saxena

unread,
Nov 30, 2018, 9:37:46 AM11/30/18
to TRex Traffic Generator
Hi,

>>(You can generate a utility that convert Scapy fragment to multi-stream and contribute that)
Is this utility is available in latest Trex? I am not able to find this.

I tried doing it like this, modified https://github.com/cisco-system-traffic-generator/trex-core/blob/master/scripts/stl/multi_burst_2st_1000pkt.py to generate fragmented packets but when I try to see packets in wireshark (capture monitor start), I am not able to see any. 

        frags=fragment(pkt,fragsize=1000)
        return STLProfile( [ STLStream( self_start = True,
                                        name    ='S0',
                                        #packet = STLPktBuilder(pkt = base_pkt/pad),
                                        packet = STLPktBuilder(pkt = frags[0]),
                                        mode = STLTXSingleBurst( pps = 1, total_pkts = self.burst_size),
                                        next = 'S1'), # point to next stream 
                             STLStream( self_start = False,
                                        name    ='S1',
                                        #packet = STLPktBuilder(pkt = base_pkt/pad),
                                        packet = STLPktBuilder(pkt = frags[1]),
                                        mode = STLTXSingleBurst( pps = 1, total_pkts = self.burst_size),
                                        next = 'S2'), # point to next stream 
                             STLStream( self_start = False,
                                        name    ='S2',
                                        #packet = STLPktBuilder(pkt = base_pkt/pad),
                                        packet = STLPktBuilder(pkt = frags[2]),
                                        mode = STLTXSingleBurst( pps = 1, total_pkts = self.burst_size),
                                        ) # point to next stream 

Is this the right way to do this? 

Thanks and Regards,
Akash Saxena

hanoh haim

unread,
Dec 2, 2018, 3:52:20 AM12/2/18
to Akash Saxena, TRex Traffic Generator
Try adding “—software” in CLI. We are using hardware filters to pass traffic to capture core and it might not work for specific combination of NICs with fragments packets

Thanks,
Hanoh


For more options, visit https://groups.google.com/d/optout.

eleak...@gmail.com

unread,
Dec 3, 2018, 4:48:01 AM12/3/18
to TRex Traffic Generator
Thanks!
I am able to see packets in wireshark.

Does Trex has a utility to convert Scapy fragment to multi-stream?

Regards,
Akash Saxena

hanoh haim

unread,
Dec 3, 2018, 7:29:40 AM12/3/18
to eleak...@gmail.com, TRex Traffic Generator
Could you provide the output of

$sudo ./t-rex-64 -i -v 7

I want to verify which NIC you are using 

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 post to this group, send email to trex...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Akash Saxena

unread,
Dec 3, 2018, 7:36:41 AM12/3/18
to TRex Traffic Generator
Hi Hanoh,

>>I want to verify which NIC you are using 

Log Snippet:

# ./t-rex-64 -i -v 7
Killing Scapy server... Scapy server is killed
Starting Scapy server.... Scapy server is started
The ports are bound/configured.
Starting  TRex v2.48 please wait  ... 
Using configuration file /etc/trex_cfg.yaml 
 port limit     :  2 
 port_bandwidth_gb    :  10 
 if_mask        : None 
 prefix              : trex2 
 is low-end : 0 
 stack type :  
 limit_memory        : 3096 
 thread_per_dual_if      : 1 
 if        :  83:00.0, 83:00.1,
 enable_zmq_pub :  1 
 zmq_pub_port   :  4500 
 m_zmq_rpc_port    :  4501 
 src     : 6c:b3:11:50:29:d4
 dest    : 6c:b3:11:50:29:d6
 src     : 6c:b3:11:50:29:d6
 dest    : 6c:b3:11:50:29:d4
 memory per 2x10G ports  
 MBUF_64                                   : 16380 
 MBUF_128                                  : 8190 
 MBUF_256                                  : 8190 
 MBUF_512                                  : 8190 
 MBUF_1024                                 : 8190 
 MBUF_2048                                 : 4095 
 MBUF_4096                                 : 128 
 MBUF_9K                                   : 512 
 TRAFFIC_MBUF_64                           : 65520 
 TRAFFIC_MBUF_128                          : 32760 
 TRAFFIC_MBUF_256                          : 8190 
 TRAFFIC_MBUF_512                          : 8190 
 TRAFFIC_MBUF_1024                         : 8190 
 TRAFFIC_MBUF_2048                         : 32760 
 TRAFFIC_MBUF_4096                         : 128 
 TRAFFIC_MBUF_9K                           : 512 
 MBUF_DP_FLOWS                             : 524288 
 MBUF_GLOBAL_FLOWS                         : 5120 
 master   thread  : 2  
 rx  thread  : 4  
 dual_if : 0 
    socket  : 0  
   [   6   7   8   9   10     ]  
CTimerWheelYamlInfo does not exist  
 flags           : 8010f00
 write_file      : 0
 verbose         : 7
 realtime        : 1
 flip            : 0
 cores           : 1
 single core     : 0
 flow-flip       : 0
 no clean close  : 0
 zmq_publish     : 1
 vlan mode       : 0
 client_cfg      : 0
 mbuf_cache_disable  : 0
 cfg file        :  
 mac file        :  
 out file        :  
 client cfg file :  
 duration        : 0 
 factor          : 1 
 mbuf_factor     : 1 
 latency         : 0 pkt/sec 
 zmq_port        : 4500 
 telnet_port     : 4501 
 expected_ports  : 2 
 tw_bucket_usec  : 20.000000 usec 
 tw_buckets      : 1024 usec 
 tw_levels       : 3 usec 
 port : 0 dst:6c:b3:11:50:29:d6  src:6c:b3:11:50:29:d4
 port : 1 dst:6c:b3:11:50:29:d4  src:6c:b3:11:50:29:d6
 port : 2 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 3 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 4 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 5 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 6 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 7 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 8 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 9 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 10 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 11 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 12 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 13 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 14 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 port : 15 dst:00:00:00:01:00:00  src:00:00:00:00:00:00
 Total Memory : 
 MBUF_64                                   : 81900 
 MBUF_128                                  : 40950 
 MBUF_256                                  : 16380 
 MBUF_512                                  : 16380 
 MBUF_1024                                 : 16380 
 MBUF_2048                                 : 36855 
 MBUF_4096                                 : 1024 
 MBUF_DP_FLOWS                             : 524288 
 MBUF_GLOBAL_FLOWS                         : 5120 
 get_each_core_dp_flows                    : 524288 
 Total memory                              :     248.40 Mbytes  
 core_mask  54  
 sockets : 0  
 active sockets : 1 
 ports_sockets : 1 
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 phy   |   virt   
 6      1   
DPDK args 
 xx  -c  0x54  -n  4  --log-level  8  --master-lcore  2  -w  0000:83:00.0  -w  0000:83:00.1  --legacy-mem  --file-prefix  trex2  --socket-mem  3096,3096  
EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/trex2/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
 EAL: Probing VFIO support...
EAL: PCI device 0000:83:00.0 on NUMA socket 1
EAL:   probe driver: 8086:1583 net_i40e
EAL: PCI device 0000:83:00.1 on NUMA socket 1
EAL:   probe driver: 8086:1583 net_i40e
                input : [83:00.0, 83:00.1]
                 dpdk : [0000:83:00.0, 0000:83:00.1]
             pci_scan : [0000:83:00.0, 0000:83:00.1]
                  map : [ 0, 1]
 TRex port mapping 
 ----------------- 
 TRex vport: 0 dpdk_rte_eth: 0 
 TRex vport: 1 dpdk_rte_eth: 1 
 set driver name net_i40e 
 driver capability  : TCP_UDP_OFFLOAD  TSO 
 Number of ports found: 2


if_index : 0 
driver name : net_i40e 
min_rx_bufsize : 1024 
max_rx_pktlen  : 9728 
max_rx_queues  : 320 
max_tx_queues  : 320 
max_mac_addrs  : 64 
rx_offload_capa : 0x13e6f 
tx_offload_capa : 0x19fbf 
rss reta_size   : 512 
flow_type_rss   : 0x7ef8 
port 0: FW ver 06.00.01
port 1: FW ver 06.00.01
zmq publisher at: tcp://*:4500
port 0 desc: Ethernet Controller XL710 for 40GbE QSFP+
port 1 desc: Ethernet Controller XL710 for 40GbE QSFP+
 wait 1 sec .
port : 0 
------------
link         :  link : Link Up - speed 40000 Mbps - full-duplex
promiscuous  : 0 
port : 1 
------------
link         :  link : Link Up - speed 40000 Mbps - full-duplex
promiscuous  : 0 
 number of ports         : 2 
 max cores for 2 ports   : 1 
 max queue per port      : 3 
 -------------------------------
RX core uses TX queue number 1 on all ports
 core, c-port, c-queue, s-port, s-queue, lat-queue
 ------------------------------------------
 1        0      0       1       0      2  
 -------------------------------
base stack ctor
Legacy stack ctor
add port node
add node
Run pending tasks for ticket 0 
Running in FG
Legacy node ctor
base stack ctor
Legacy stack ctor
add port node
add node
Run pending tasks for ticket 0 
Running in FG
Legacy node ctor
i40e_ethertype_filter_set(): filter vlan ether_type in first tag is not supported.
i40e_ethertype_filter_set(): filter vlan ether_type in first tag is not supported.
*******Pretest after resolving ********
Pre test info start ===================
Port 0:
  Sources:
    ip: 0.0.0.0 mac: 6c:b3:11:50:29:d4
  Destinations:
Port 1:
  Sources:
    ip: 0.0.0.0 mac: 6c:b3:11:50:29:d6
  Destinations:
Pre test info end ===================
Pre test statistics for port 0
 opackets                                 : 0 
 obytes                                   : 0 
 ipackets                                 : 0 
 ibytes                                   : 0 
 m_tx_arp                                 : 0 
 m_rx_arp                                 : 0 
i40e_ethertype_filter_set(): filter vlan ether_type in first tag is not supported.
Pre test statistics for port 1
 opackets                                 : 0 
 obytes                                   : 0 
 ipackets                                 : 0 
 ibytes                                   : 0 
 m_tx_arp                                 : 0 
 m_rx_arp                                 : 0 
i40e_ethertype_filter_set(): filter vlan ether_type in first tag is not supported.
clear ip4
clear ip6
conf dst
set dst valid
set is loop
Run pending tasks for ticket 0 
Running in FG
another cfg
conf dst internal
conf dst valid internal
conf loop internal
clear ip4
clear ip6
conf dst
set dst valid
set is loop
Run pending tasks for ticket 0 
Running in FG
another cfg
conf dst internal
conf dst valid internal
conf loop internal



-Per port stats table 
      ports |               0 |               1 
 -----------------------------------------------------------------------------------------
   opackets |               0 |               0 
     obytes |               0 |               0 
   ipackets |               0 |               0 
     ibytes |               0 |               0 
    ierrors |               0 |               0 
    oerrors |               0 |               0 
      Tx Bw |       0.00  bps |       0.00  bps 

-Global stats enabled 
 Cpu Utilization : 0.0  %
 Platform_factor : 1.0  
 Total-Tx        :       0.00  bps  
 Total-Rx        :       0.00  bps  
 Total-PPS       :       0.00  pps  
 Total-CPS       :       0.00  cps  

 Expected-PPS    :       0.00  pps  
 Expected-CPS    :       0.00  cps  
 Expected-BPS    :       0.00  bps  

 Active-flows    :        0  Clients :        0   Socket-util : 0.0000 %    
 Open-flows      :        0  Servers :        0   Socket :        0 Socket/Clients :  -nan 
 OOO Packets     :        0 
 Missed Packets  :        0 
 drop-rate       :       0.00  bps   
 current time    : 1.7 sec  
 test duration   : 0.0 sec  

Regards,
Akash Saxena

hanoh haim

unread,
Dec 3, 2018, 7:57:41 AM12/3/18
to Akash Saxena, TRex Traffic Generator
thanks we will look into this
you can track this in this defect. 



For more options, visit https://groups.google.com/d/optout.

Akash Saxena

unread,
Dec 3, 2018, 7:59:58 AM12/3/18
to TRex Traffic Generator
Thanks!

hanoh haim

unread,
Dec 6, 2018, 9:03:16 AM12/6/18
to Akash Saxena, TRex Traffic Generator
Hi Akash, 

This branch should fix the issue

Could you verify?



For more options, visit https://groups.google.com/d/optout.

Akash Saxena

unread,
Dec 10, 2018, 10:01:04 AM12/10/18
to TRex Traffic Generator
Hi Hanoch,

I am facing while running trex after compiling the branch sources.

Log snippet:
# ./t-rex-64 -c 1 -i 
Starting  TRex v2.05 please wait  ... 
found configuration file at /etc/trex_cfg.yaml 
_t-rex-64: ../../src/platform_cfg.cpp:160: void CMacYamlInfo::copy_src(char*): Assertion `m_src_base.size() == 6' failed.
./t-rex-64: line 33: 49094 Aborted                 (core dumped) ./_$(basename $0) $INPUT_ARGS

Regards,
Akash Saxena

hanoh haim

unread,
Dec 10, 2018, 2:43:22 PM12/10/18
to Akash Saxena, TRex Traffic Generator
Please take latest from the main branch.
You took the wrong branch 


For more options, visit https://groups.google.com/d/optout.

Akash Saxena

unread,
Dec 11, 2018, 9:42:14 AM12/11/18
to TRex Traffic Generator
Verified using the main branch. Working fine as expected.
Thanks!

Regards,
Akash Saxena

hanoh haim

unread,
Dec 11, 2018, 9:43:09 AM12/11/18
to Akash Saxena, TRex Traffic Generator
thanks Akash


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages