question

VL avatar image
VL asked jkho commented

Generating traffic to a specific port using Python REST Api

To summarize, I have 5 ports, each port has an analyzer running, the generator runs only on port 1. I want only port 2 to receive the packets while port 3,4,5 do not receive anything.

I tried to change the configuration of the streamblock set on port 1:

stc.config(handle_streamblock_port1, {'ExpectedRxPort': handle_port2})

but all the analyzer of all the ports are still receiving all the packets.

Thank you for helping me out on what is the property to change to make that work.

Spirent TestCenter (STC)automationapi
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jkho avatar image jkho commented ·

The ExpectedRxPort parameter is used to indicate where we expect to receive traffic from the stream block and is used to identify misrouted or flooded frames. It does not control who potentially receives a packet.

What is the device or system under test? Are the ports connected to a L2 switch, a router, etc.?

0 Likes 0 ·
VL avatar image
VL answered jkho commented

I'm connected to a router, I'm using a Spirent C50.

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jkho avatar image jkho commented ·

Can you provide more information on the router configuration? If the traffic sent was received on all ports, it seems like it was being broadcast/multicasted on the other interfaces on the router or maybe they're all on the same VLAN. Does the router have different IP networks for each interface?

Assuming there are different IP networks, then you should be able to differentiate which port traffic goes to by setting the destination IP of the stream block to an IP address on the network on router interface port 2 is connected on. A stream block or device with the IP address matching the destination from port 1 must be configured on port 2 so ARP/ND will work. The gateway of the streamblock 1 should be set to the IP address of the router interface port 1 is connected to.

0 Likes 0 ·
example.png (13.9 KiB)
VL avatar image
VL answered jkho commented

There is a issue with my switch that keep broadcasting. I was able to fix that in the GUI.

When it comes to the API, I haven't tried yet, I will try the same and I was advised to try the following command to have only Port2 as a receiver of Port1.

stc.config(StreamBlock_Port_1,**{"ExpectedRx-targets" : [Port_2]})

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jkho avatar image jkho commented ·

Can you elaborate on this a bit more: "There is a issue with my switch that keep broadcasting. I was able to fix that in the GUI."? What did you do in the GUI to fix the issue? Also to confirm, the ports are connected to an L2 switch and not a router?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.