Hi Trex Dev team,
[Host1] port0 <-------> et13 [Switch] {client}
[Host1] port1 -------> et18 [Switch] {server}
I want to capture packets using the BPF filter that Trex provides, and here is my client program:
def astf_test(server, mult, duration, profile_path):
# create client
c = ASTFClient(server = server)
# connect to server
c.connect()
passed = True
try:
# take all the ports
c.reset()
# load ASTF profile
profile_path = os.path.join(astf_path.get_profiles_path(), 'http_simple.py')
c.load_profile(profile_path)
# clear the stats before injecting
c.clear_stats()
c.set_service_mode(ports = [port_0], enabled = True)
#c.ping_ip(src_port = port_0, dst_ip = '11.11.11.2', pkt_size = 200, count = 5)
# start a capture
idd = c.start_capture(tx_ports = [port_0], limit = 100)
#print(idd)
print("Injecting with multiplier of '%s' for %s seconds" % (mult, duration))
c.start(mult = mult, duration = duration)
# block until done
c.wait_on_traffic()
c.stop_capture(capture_id = idd['id'], output = '/tmp/pings.pcap')
c.set_service_mode(ports = port_0, enabled = False)
# read the stats after the test
stats = c.get_stats()
# use this for debug info on all the stats
pprint(stats)
However I see all the server not responding at all, only with TCP traffic. Please tell me what I might be doing wrong..
If I send pings with the service mode, it works fine, I'm able to see /tmp/pings.pcap with proper pings.
This happens only with c.set_service_mode(ports = [port_0], enabled = True)
Ruling out Switch side drops
If service mode is disabled, I don't see any drops, even at the switch:
switch #show platform counters | grep 13 | grep "Good IPV4 L3.*nicast"
Ethernet13 RX - Good IPV4 L3 Unicast 84
Ethernet13 TX - Good IPV4 L3 unicast packets 350
switch #show platform counters | grep 18 | grep "Good IPV4 L3.*nicast"
Ethernet18 RX - Good IPV4 L3 Unicast 350
Ethernet18 TX - Good IPV4 L3 unicast packets 84
But if I run this test with service mode, I see the server not responding:
switch #show platform counters | grep 13 | grep "Good IPV4 L3.*nicast"
Ethernet13 RX - Good IPV4 L3 Unicast 70
Ethernet13 TX - Good IPV4 L3 unicast packets 0
switch #show platform counters | grep 18 | grep "Good IPV4 L3.*nicast"
Ethernet18 RX - Good IPV4 L3 Unicast 0
Ethernet18 TX - Good IPV4 L3 unicast packets 70
Server is started using: ./t-rex-64 -i --astf
Client is started using: ./trex-console
Connecting to RPC server on localhost:4501 [SUCCESS]
Connecting to publisher server on localhost:4500 [SUCCESS]
[SUCCESS]
Acquiring ports [0, 1]: [SUCCESS]
Server Info:
Server version: v3.02 @ ASTF
Server mode: Advanced Stateful
Server CPU: 1 x Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
Ports count: 2 x 10Gbps @ 82599ES 10-Gigabit SFI/SFP+ Network Connection
Please help! In essence I want to write a script that can capture traffic.
Thanks,
Ananya