Packet size in tcp

196 views
Skip to first unread message

Nagraj Kulkarni

unread,
Sep 20, 2023, 12:22:54 AM9/20/23
to TRex Traffic Generator
Hello

How do we control packet sizes in astf profile tests? For example, with http_simple.py, if we need response with specific packet size, 1024 bytes, how do we achieve this?  Don't see any other profile to get imix traffic with tcp. Tried with mss tweaking, but doesn't seem to help.. Appreciate your help

Thanks
Nagraj

hanoh haim

unread,
Sep 20, 2023, 6:58:56 AM9/20/23
to Nagraj Kulkarni, TRex Traffic Generator
Hi Nagraj, 

MSS in both sides should solve the issue. 

Thanks
Hanoh 
Message has been deleted

Nagraj Kulkarni

unread,
Sep 20, 2023, 7:26:56 AM9/20/23
to hanoh haim, TRex Traffic Generator
Hello Hanoh,

Tried setting at both the sides like this but not helping. Am i missing something in the below ?  I tried checking with an example i.e http_

Thanks,
Nagraj

        s_glob_info = ASTFGlobalInfo()
        s_glob_info.tcp.mss = 1024
        s_glob_info.tcp.initwnd = 1

        c_glob_info = ASTFGlobalInfo()
        c_glob_info.tcp.mss = 1024
        c_glob_info.tcp.initwnd = 1


        ip_gen = ASTFIPGen(glob=ASTFIPGenGlobal(ip_offset="1.0.0.0"),
                           dist_client=ip_gen_c,
                           dist_server=ip_gen_s)

        return ASTFProfile(default_ip_gen=ip_gen,
                           default_c_glob_info=c_glob_info,
                           default_s_glob_info=s_glob_info,
                            cap_list=[ASTFCapInfo(file="../avl/delay_10_http_browsing_0.pcap",
                            cps=5)])

hanoh haim

unread,
Sep 20, 2023, 7:51:19 AM9/20/23
to Nagraj Kulkarni, TRex Traffic Generator
Yes, looks good

Thanks
Hanoh

Sai Praveen

unread,
Sep 20, 2023, 8:05:26 AM9/20/23
to hanoh haim, Nagraj Kulkarni, TRex Traffic Generator
Hi Team,

        
           I have a network topology , with linux as one of the device in that topology. Now I have the docker image of Trex in that tlinkux image and want to generate traffic fro one device to another using Trex , the trex server and the console are being run simultaneously in the linux destop . 
The TUi shows like this :
       port    |         0         |         1         |       total      
----------------------------------------------------------------------
owner      |              root |              root |                  
link       |                UP |                UP |                  
state      |      TRANSMITTING |              IDLE |                  
speed      |           10 Gb/s |           10 Gb/s |                  
CPU util.  |             0.49% |              0.0% |                  
--         |                   |                   |                  
Tx bps L2  |        29.00 Mbps |          0.00 bps |        29.00 Mbps
Tx bps L1  |        30.60 Mbps |             0 bps |        30.60 Mbps
Tx pps     |        10.02 Kpps |          0.00 pps |        10.02 Kpps
Line Util. |            0.31 % |            0.00 % |                  
---        |                   |                   |                  
Rx bps     |          0.00 bps |        29.00 Mbps |        29.00 Mbps
Rx pps     |          0.00 pps |        10.02 Kpps |        10.02 Kpps
----       |                   |                   |                  
opackets   |           1838202 |                 0 |           1838202
ipackets   |                 0 |           1838191 |           1838191
obytes     |         665123484 |                 0 |         665123484
ibytes     |                 0 |         665119206 |         665119206
opackets   |        1.84 Mpkts |            0 pkts |        1.84 Mpkts
ipackets   |            0 pkts |        1.84 Mpkts |        1.84 Mpkts
obytes     |         665.12 MB |               0 B |         665.12 MB
ibytes     |               0 B |         665.12 MB |         665.12 MB
-----      |                   |                   |                  
oerrors    |                 0 |                 0 |                 0
ierrors    |                 0 |                 0 |                 0

status:  |

The portattr will show the below details :
      trex>portattr
Port Status

     port       |          0           |          1          
-------------------------------------------------------------
driver          |    net_af_packet     |    net_af_packet    
description     |       Unknown        |       Unknown        
link status     |          UP          |          UP          
link speed      |       10 Gb/s        |       10 Gb/s        
port status     |     TRANSMITTING     |         IDLE        
promiscuous     |         off          |         off          
multicast       |         off          |         off          
flow ctrl       |         N/A          |         N/A          
--              |                      |                      
layer mode      |         IPv4         |         IPv4        
src IPv4        |      172.19.3.1      |      179.19.4.1      
src MAC         |  9a:9d:fb:3b:6d:a2   |  72:e6:2a:de:c9:d2  
---             |                      |                      
Destination     |      179.19.3.2      |      179.19.4.2      
ARP Resolution  |      unresolved      |      unresolved      
----            |                      |                      
VLAN            |          -           |          -          
-----           |                      |                      
PCI Address     |         N/A          |         N/A          
NUMA Node       |          -1          |          -1          
RX Filter Mode  |    hardware match    |    hardware match    
RX Queueing     |         off          |         off          
Grat ARP        |         off          |         off  


These are the default config file also:
[root@5d3385bfca9f v2.41]# cat /etc/trex_cfg.yaml
- port_limit    : 2
  version       : 2
  low_end       : true
  interfaces    : ["veth0", "veth1"]   # list of the interfaces to bind run ./dpdk_nic_bind.py --status
  port_info     :  # set eh mac addr

                 - ip         : 172.19.3.1
                   default_gw : 179.19.3.2
                 - ip         : 179.19.4.1
                   default_gw : 179.19.4.2

when I run this trex server and console. after if I check tcpdump in the destination device there no traffic from the src device .below is the python file there I added my src and dst ipaddress:
[root@5d3385bfca9f stl]# cat imix.py
from trex_stl_lib.api import *

# IMIX profile - involves 3 streams of UDP packets
# 1 - 60 bytes
# 2 - 590 bytes
# 3 - 1514 bytes
class STLImix(object):

    def __init__ (self):
        # default IP range
        self.ip_range = {'src': {'start': "172.19.3.1", 'end': "172.19.3.1"},
                         'dst': {'start': "172.19.4.1",  'end': "172.19.4.1"}}

        # default IMIX properties
        self.imix_table = [ {'size': 60,   'pps': 28,  'isg':0 },
                            {'size': 590,  'pps': 16,  'isg':0.1 },
                            {'size': 1514, 'pps': 4,   'isg':0.2 } ]


 Below is is the topology  I attached kindly help me out . Thanks in advance

regards,
praveen

On Wed, Sep 20, 2023 at 5:21 PM hanoh haim <hhaim...@gmail.com> wrote:
Yes, looks good

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 on the web visit https://groups.google.com/d/msgid/trex-tgn/CA%2BYxBoLoapkEkfoy3dqt42f4Pu8Zgnmi3hRzgNEwDX3HzFym6w%40mail.gmail.com.
topol.png

hanoh haim

unread,
Sep 20, 2023, 8:08:51 AM9/20/23
to Sai Praveen, Nagraj Kulkarni, TRex Traffic Generator
Hi Sai, 
How this question related to the MSS question?

Thanks
Hanoh

Sai Praveen

unread,
Sep 20, 2023, 8:10:46 AM9/20/23
to hanoh haim, Nagraj Kulkarni, TRex Traffic Generator
not mms . from pastthat past 2weeks I am waiting for reply from team.

Nagraj Kulkarni

unread,
Sep 20, 2023, 8:38:45 AM9/20/23
to hanoh haim, TRex Traffic Generator
But the Rx capture on DUT shows trex sending same packet as in pcap though trex n dut agree on mss in initial handshake, this is what puzzles me

hanoh haim

unread,
Sep 20, 2023, 8:59:28 AM9/20/23
to Nagraj Kulkarni, TRex Traffic Generator
Hi, 
 If your DUT is linux based, or has a GRO you would need to disable GRO optimization. 
try to capture the traffic in trex side

Thanks
Hanoh

 
Reply all
Reply to author
Forward
0 new messages