hypatia-impl

Link queue tracking

This tracks the queue of point-to-point network devices (part of a ‘link’). Note: if you have a queueing discipline installed, this will also have queues in it: these queue are not tracked by this.

It encompasses the following files:

You can use the application(s) separately, or make use of the helper which requires a topology (which is recommended).

Getting started: using helper

  1. Add the following to the config_ns3.properties in your run folder:

    enable_link_queue_tracking=true
    
  2. In your code, import the helper:

    #include "ns3/ptop-link-queue-tracker-helper.h"
    
  3. Before the start of the simulation run, in your code add:

    // Install link queue trackers
    PtopLinkQueueTrackerHelper linkQueueTrackerHelper = PtopLinkQueueTrackerHelper(basicSimulation, topology);
    
  4. After the run, in your code add:

    // Write link queue result
    linkQueueTrackerHelper.WriteResults();
    
  5. After the run, you should have the link queue log files in the logs_ns3 of your run folder.

Getting started: directly using tracker

  1. In your code, import the tracker:

    #include "ns3/ptop-link-queue-tracker.h"
    
  2. Before the start of the simulation run, in your code add:

    Ptr<PointToPointNetDevice> networkDevice = ... // Get the network device from somewhere
    Ptr<PtopLinkQueueTracker> tracker = CreateObject<PtopLinkQueueTracker>(networkDevice);
    // ... store the tracker to keep it alive and later retrieve its results
    
  3. After the run, in your code add:

    const std::vector<std::tuple<int64_t, int64_t, int64_t>> log_entries_pkt = tracker->GetIntervalsNumPackets();
    for (size_t j = 0; j < log_entries_pkt.size(); j++) {
        int64_t interval_start_ns = std::get<0>(log_entries_pkt[j]);
        int64_t interval_end_ns = std::get<1>(log_entries_pkt[j]);
        int64_t interval_queue_num_packets = std::get<2>(log_entries_pkt[j]);
        // ... then do something with it, print it
    }
    

Helper information

You MUST set the following key in config_ns3.properties for queue tracking to be enabled:

The link queue log files

There are two log files generated by the run in the logs_ns3 folder within the run folder: