trex-core icon indicating copy to clipboard operation
trex-core copied to clipboard

Suggestion: Specific requirements / instructions on how to use your own PCAP files?

Open davehouser1 opened this issue 3 years ago • 4 comments

I have read through the manual here, and its not clear what the specific requirements are for using your own pcap are.

Reading this post states that stateful mode requires a 5Tuple. Is this still the case?

How can I use my own .pcap file? What are the specific requirements to use your own pcap file? What is supported and what is not? A simple guide on using your own pcap file, knowing what to look for (what is required), and adjusting your yaml in order to send via trex would be helpful.

Info about the PCAP I want to use:

  • This file is a .pcap (not pcapng)
  • The packets included are all icmp packets (Every type and code sending from one host to another no reply) [I get it, if all entries in the pcap must be a 5Tuple, then this pcap would never work. However I could not find where this is stated in the manual]

davehouser1 avatar Mar 11 '21 20:03 davehouser1

Hi Dave,

  1. STF is very old and deprecated. Please consider ASTF if you need stateful traffic or STL if you need stateless traffic.
  2. The post you provided is from 11 days ago. Maybe you posted the wrong link?
  3. In case you decide to use STL: https://trex-tgn.cisco.com/trex/doc/trex_stateless.html#_pcap_based_traffic_tutorials
  4. In case you decide to use ASTF, take a look at this example, it uses a PCAP file https://trex-tgn.cisco.com/trex/doc/trex_astf.html#_tutorial_prepare_trex_configuration_file
  5. I agree that in in ASTF mode the PCAP limitations are not well documented. I will open an issue on this and we will try and prepare some better documentation. However, if you need documentation on how to manipulate a loaded PCAP you can use this https://trex-tgn.cisco.com/trex/doc/cp_astf_docs/api/profile_code.html?highlight=cap#astfcapinfo-class
  6. Adjusting yaml is not relevant as aforementioned.
  7. .pcap files are fine.
  8. Some limitations include:
    • Only Ipv4 and Ipv6 traffic.
    • Only one session is allowed in file.
    • Only UDP and TCP. The handling is done in the following file: https://github.com/cisco-system-traffic-generator/trex-core/blob/abbc1b790291f72fbcab94f416f851f15c89cfb6/scripts/automation/trex_control_plane/interactive/trex/astf/cap_handling.py in case you want to take a look.

Thanks, Bes

bdollma avatar Mar 12 '21 08:03 bdollma

@bdollma, Thanks! Will read though and test more. Also I edited my original post to remove the inaccurate "~6 years" comment.

Question: If I wanted to generate ICMP traffic to send to hosts, is that possible with trex?

davehouser1 avatar Mar 12 '21 18:03 davehouser1

Hi @davehouser1, It is possible. Take a look at Emu, there are examples there on how to ICMP too.

bdollma avatar Mar 12 '21 18:03 bdollma