changing IP header like TOS - stateless trex

130 views
Skip to first unread message

Mani Amoozadeh

unread,
May 4, 2023, 1:11:40 PM5/4/23
to TRex Traffic Generator
Hi all,

I am running TREX like the following, and everything looks good,

cd /opt/cisco/trex/v3.02

./t-rex-64 -f trex_config.yaml -d 30 -m 180 -w 2 -k 5 --no-scapy-server --iom 0

where trex_config.yaml looks like the following:

traffic:
  - duration: 5
    generator:
      distribution: "seq"
      clients_start: "11.11.11.2"
      clients_end: "11.11.11.2"
      servers_start: "12.12.12.2"
      servers_end: "12.12.12.2"
      clients_per_gb: 1
      min_clients: 1
      dual_port_mask: "1.0.0.0"
      tcp_aging: 0
      udp_aging: 0
    cap_info:
      - name: cap2/udp_64B.pcap
        cps: 100.0
        ipg: 10000
        rtt: 10000
        w: 1
        limit: 1

how can I set TOS field in all packets?

Besart Dollma

unread,
May 8, 2023, 2:41:30 AM5/8/23
to TRex Traffic Generator
Hi, 
You are using STF which is old and deprecated. Moving to ASTF/STL will enable you to set the TOS with the following limitations: https://trex-tgn.cisco.com/trex/doc/trex_astf.html#_tunables_reference_a_id_tunables_a
Best,

Veeralaxmi Prakash

unread,
Aug 29, 2023, 9:32:56 AM8/29/23
to TRex Traffic Generator
@Mani
did you get it successfully updating TOS in  TREX

László Frank

unread,
Aug 31, 2023, 4:55:22 AM8/31/23
to TRex Traffic Generator
Hi All,

I have the same question. When using STL, how to set TOS value ?

Like when I am starting traffic from trex console as  :  trex>startf -f stl/my_profile.py
In the Python traffic profile generator (myprofile.py), when the base packet is created it loos like this : base_pkt = Ether()/IP()/UDP()
Any options here with IP class constructor parameters ? I mean similar to : IP(ip.tos=6) ? I could not find it documented nowhere.

Thanks in advance.

hanoh haim

unread,
Sep 4, 2023, 7:47:17 AM9/4/23
to László Frank, TRex Traffic Generator
Hi you should look into scapy library for doc 

Reply all
Reply to author
Forward
0 new messages