|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #ifndef OUTPUTMANAGER_H
25 #define OUTPUTMANAGER_H
31 #include "ns3/core-module.h"
33 #include "ns3/output-stream-wrapper.h"
34 #include "ns3/internet-module.h"
36 #include "ns3/enums.h"
37 #include <experimental/filesystem>
67 bool printDescription);
109 void SendOnion (
int packet_size,
int head_size,
int body_size,
int onion_path_len, Time sent_at);
129 void NewHandshake (
int node_num, Ipv4Address node_ip, Time recv_at);
136 void OnionRoutingSend (Ipv4Address send_ip, Ipv4Address recv_ip,
int packet_size,
int head_size,
137 int body_size, Time sent_at);
172 void AddNodeDetails (Ipv4Address node_ip,
int coord_x,
int coord_y);
180 void AddNodeDetails (Ipv4Address node_ip,
int coord_x,
int coord_y,
int n_degree);
216 "onion_details,sim_name,sim_num,num_of_nodes,topology,routing,onion_"
217 "id,packet_size,onion_head_size,onion_body_size,onion_"
218 "path_length,sent_at,recv_at,query_time_to_return";
219 std::string
h_routingHeader =
"onion_routing,sim_name,sim_num,num_of_nodes,topology,routing,"
220 "onion_id,send_ip,recv_ip,packet_size,onion_head_size,onion_body_"
221 "size,sent_at,recv_at,hop_time";
222 std::string
h_timeoutHeader =
"timeout,sim_name,sim_num,num_of_nodes,topology,routing,onion_id,"
223 "onion_path_length,abort_time";
225 "coord_x,coord_y,node_degree";
239 std::map<uint32_t,std::string>
std::string h_onionHeader
header of CSV format
OutputManager()
Default constructor.
void SimulationEnd(std::string end_at)
Print at the end of the simulation.
void OnionRoutingSend(Ipv4Address send_ip, Ipv4Address recv_ip, int packet_size, int head_size, int body_size, Time sent_at)
Called by each node that sends an onion message.
int m_onionId
identifies the onion message
void OnionRoutingRecv(Time recv_at)
Called by each node that receives an onion message.
void AddNodeDetails(Ipv4Address node_ip, int coord_x, int coord_y)
register node details: IP, location on the network
void SendOnion(int packet_size, int head_size, int body_size, int onion_path_len, Time sent_at)
Called by the sink node when it sends a new onion message.
void CreateOutputFile()
Create stream wrapper and the output file, if the output file already exists, then delete the content...
std::string Ipv4ToString(Ipv4Address ip)
Convert an IpV4 address to a string.
std::string m_simDetails
holds details of the simulation
Class that manages the output of the simulation. ConsoleLog output and Output on ....
std::string m_routingLog
holds data of the onion message traveling from hop to hop
void PrintLine(std::string line)
print the given argument on the csv file
std::string h_routingHeader
header of CSV format
std::string CurrentTime(void)
return the current time as a string
std::string m_onionData
holds data of the onion message currently executing in the network
int m_onionPathLength
the onion path length
bool m_printDescription
boolean choice to print the description of the simulation parameters
void PrintIntro(std::string intro)
Print the simulation description containing simulation settings on the csv file or on the console log...
void AbortOnion(Time abort_at)
Called when an onion is deleted.
std::string m_routingData
holds data of the onion message traveling from hop to hop
static TypeId GetTypeId(void)
Register this type.
void PrintNodeDetails(std::map< uint32_t, std::string > reachable)
print node details on the csv file, print only nodes reachable by the sink node
Topology
Enumeration defining different network topologies that can be used in the simulation.
void NewHandshake(int node_num, Ipv4Address node_ip, Time recv_at)
Called when the sink receives a new handhake message.
double t_onionDelta
Hold time information of the onion message traveling in the network.
void RecvOnion(Time recv_at)
Called by the sink node when it receives back the onion message.
std::string m_simName
holds the name of the simulation
enum Routing m_routing
information on the routing protocol
std::map< uint32_t, std::string > m_nodeDetails
holds details of nodes in the network for printing at the end of the csv file.
void SetRouting(enum Routing routing)
set the enum of the current routing algorithm used in the network
enum Routing GetRouting(void)
return the enum of the current routing algorithm used in the network
std::string h_timeoutHeader
header of CSV format
Routing
Enumeration defining different routing algorithms that can be used in the simulator.
Ptr< OutputStreamWrapper > m_simStreamWrapper
stream wrapper to write on file
~OutputManager()
Default destructor.
std::string m_outputFilePath
path to the directory where output files are stored
double t_hopDelta
Hold time information of the onion message traveling from hop to hop.
std::string h_nodeDetailsHeader
header of CSV format