cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
189
Views
0
Helpful
3
Replies

How to send traffic from selected trex port in astf mode

bbarot
Level 1
Level 1

Screenshot 2024-06-03 at 17.29.10.png

I have total 4 ports [0,1,2,3]. I am running Trex in ASTF mode. I want to send traffic from my client1 (Port0) to Server1(Port1). And rest two port should not send the request. I am not sure how we can define which port to use like stl mode. So can anyone guide me how I can define such ports related configuration in ASTF mode ?

3 Replies 3

I think you are correct, the ASTF mode in Trex doesn't allow you to directly specify which ports to use for traffic generation like in STL mode. You might be able to fix this by using server to client (or client to server) flow? I have not tried this fyi, update to your needs

# Define a client-to-server flow
trex_cfg = {
    "flows": [
        {
            "name": "client1_to_server1",
            "type": "client-to-server",
            "client_ports": [0],  # Use only port 0 for client
            "server_ports": [1],
            # ... other flow configurations ...
        }
    ]
}

# Start Trex with the configuration
trex.start(trex_cfg)

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

bbarot
Level 1
Level 1

Thanks @bigevilbeard for the quick response. In which file I need to  update this? 

You should update the Trex configuration file (.yaml or .json) with the ASTF settings.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io