NS3 Traffic Generator to save some metrics into a dataset

122 views
Skip to first unread message

SMalta

unread,
Apr 24, 2021, 2:40:41 PM4/24/21
to ns-3-users
Hi List,

I am trying to implement a Traffic Generator to save data into a Dataset to use it on Machine Learning

So far I have a simulation with some wifi stations nodes, one csma/WifiAp (n0) node and one csma (n1) node serving as HTTP server.

 

//   Wifi 10.1.3.0

//                 AP

// *     *     *     *

// |     |      |     |   

// nx  n3   n2   n0   n1(Http Server) 

//                 |    |

//                 ======

//               csma LAN 10.1.2.0

 

I am using ThreeGppHttp model with wifi stations as clients and csma n1 node as Server and this allows me to generate http flows and calculate the Throughput and delay for each flow.

I have also learned how to save traces. Right now I am able to save TX/RX packets size from HTTP server device/csma interface and save this information to a file each time a packet is received or transmitted.

My main idea is to simulate during 24h a wifi network to generate traffic and capture statistics metrics in node 0 csma/WifiAp.

I would like to save in my dataset metrics like:

  • RX Bytes per second
  • TX Bytes per second
  • Number of active flows per second
  • Etc…

 Could someone kindly point me in the correct direction to do this.

 I have checked tracesources from csmaNetDevices and found two traces that could help me:

                PhyTxEnd: Trace source indicating a packet has been completely transmitted over the channel.

                PhyRxEnd: Trace source indicating a packet has been completely received by the device.


Do you think that the correct approach would be to:

  • Use PhyTxEnd/PhyRxEnd  traces on Access Point csma interface, to sum into variables TXBytes or RXBytes the size of each packet.
  • And then schedule in simulator a function to be run every second to:
    • calculate TXBytes or RXBytes per second
    • Save this information on the dataset
    • Reset TXBytes or RXBytes variables.

 

Using this approach I could have in my dataset the RX/TX bytes for each simulation second on that specific interface.

Many Thanks,

Silvestre Malta

Reply all
Reply to author
Forward
0 new messages