The ns-3 Network Simulator Project

Enable packet capture (PCAP) in first.cc and display PCAP files in tcpdump

Tracing helps the users to understand the set of events that take place during a simulation run. ns-3 allows trace files can be generated in .pcap format which can then be opened in tcpdump for further analysis.

The student is expected to do the following:

  1. Refer to 'examples/tutorial/second.cc' to understand how to enable PCAP in ns-3 programs.
  2. Copy ‘examples/tutorial/first.cc’ to 'scratch'.
  3. Modify 'scratch/first.cc' to enable PCAP support.
  4. Run the modified program: ./waf --run scratch/first
  5. Verify whether you have two PCAP files generated in the ns-3 root directory: first-0-0.pcap and first-1-0.pcap
  6. Open the PCAP files in tcpdump: 'tcpdump -nn -tt -r first-0-0.pcap' and then 'tcpdump -nn -tt -r first-1-0.pcap'
  7. Send the screenshot of tcpdump for evaluation.

Task tags

  • tracing
  • tcpdump
  • tutorial

Students who completed this task

ra1nst0rm3d, howie

Task type

  • code Code
  • chrome_reader_mode Documentation / Training

Level

Beginner
close

2019