The ns-3 Network Simulator Project

Modify ‘examples/tutorial/first.cc’ to use OnOff application

‘examples/tutorial/first.cc’ is a basic C++ program provided for ns-3 beginners. It makes use of the UDPEchoClient and UDPEchoServer applications on the nodes. Modify it to install the OnOff Application.

The student is expected to do the following:

  1. Copy ‘examples/tutorial/first.cc’ and paste it in the scratch directory.
  2. Modify first.cc in the scratch folder to install the OnOffHelper application on the client node to send data. Use PacketSinkApplication on the server node to receive the data. You may use ‘examples/tcp/tcp-star-server.cc’ as a reference for this purpose.
  3. Set both OnTime and OffTime attributes to 2 seconds so that traffic is off for the first 2 seconds and switches on for the next 2 seconds. The traffic generation continues alternating in this pattern.
  4. Make a patch with the modifications made in first.cc and submit it for evaluation.

Task tags

  • tutorial
  • c++

Students who completed this task

Kr0n0s, SaiMyGuy, hax0kartik, howie

Task type

  • code Code
  • chrome_reader_mode Documentation / Training
close

2019