The ns-3 Network Simulator Project

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

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 Wireshark 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 Wireshark: 'wireshark first-0-0.pcap' and then 'wireshark first-1-0.pcap'
  7. Send both the screenshots of Wireshark for evaluation.

Task tags

  • tracing
  • tutorial
  • wireshark

Students who completed this task

Kr0n0s

Task type

  • code Code
  • chrome_reader_mode Documentation / Training

Level

Beginner
close

2019