ns3::SatPacketTrace Class Reference

The SatPacketTrace implements a packet trace functionality. More...

#include "satellite-packet-trace.h"

+ Inheritance diagram for ns3::SatPacketTrace:
+ Collaboration diagram for ns3::SatPacketTrace:

Public Member Functions

 SatPacketTrace ()
 Constructor. More...
 
virtual ~SatPacketTrace ()
 Destructor. More...
 
void AddTraceEntry (Time now, SatEnums::SatPacketEvent_t packetEvent, SatEnums::SatNodeType_t nodeType, uint32_t nodeId, Mac48Address macAddress, SatEnums::SatLogLevel_t logLevel, SatEnums::SatLinkDir_t linkDir, std::string packetInfo)
 Add a packet trace entry to the log. More...
 
virtual void DoDispose ()
 Dispose of this class instance. More...
 
TypeId GetInstanceTypeId () const
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void PrintHeader ()
 Print header to the packet trace log. More...
 

Private Attributes

std::string m_fileName
 File name of the packet trace log. More...
 
Ptr< OutputStreamWrapper > m_packetTraceStream
 Stream wrapper used for packet traces. More...
 

Detailed Description

The SatPacketTrace implements a packet trace functionality.

The movement of packet through the satellite stack can be traced in different protocol layers and direction.

Definition at line 41 of file satellite-packet-trace.h.

Constructor & Destructor Documentation

◆ SatPacketTrace()

ns3::SatPacketTrace::SatPacketTrace ( )

Constructor.

Definition at line 40 of file satellite-packet-trace.cc.

References m_fileName, m_packetTraceStream, and PrintHeader().

+ Here is the call graph for this function:

◆ ~SatPacketTrace()

ns3::SatPacketTrace::~SatPacketTrace ( )
virtual

Destructor.

Definition at line 54 of file satellite-packet-trace.cc.

Member Function Documentation

◆ AddTraceEntry()

void ns3::SatPacketTrace::AddTraceEntry ( Time  now,
SatEnums::SatPacketEvent_t  packetEvent,
SatEnums::SatNodeType_t  nodeType,
uint32_t  nodeId,
Mac48Address  macAddress,
SatEnums::SatLogLevel_t  logLevel,
SatEnums::SatLinkDir_t  linkDir,
std::string  packetInfo 
)

Add a packet trace entry to the log.

Parameters
nowTime time of a trace event
packetEventPacket event(SND, RCV, DRP, ENQ)
nodeTypeNode type (UT, SAT, GW, NCC, TER)
nodeIdNode id
macAddressMAC address
logLevelLog level (ND, LLC, MAC, PHY, CH)
linkDirLink direction (FWD, RTN)
packetInfoPacket info (List of: Packet id, source MAC address, destination MAC address)

TODO: Currently the packet trace logs all entries updated by the protocol layers. A filtering functionality may be implemented later, to restrict the amount of output data. The user may configure the filtering rules by attributes, e.g.

  • Entries from only certain type packet events
  • Entries from only certain node types
  • Entries from only certain node ids
  • Entries with certain log level (i.e. protocol layer)
  • Entries from one simulation direction

Definition at line 107 of file satellite-packet-trace.cc.

References ns3::SatEnums::GetLinkDirName(), ns3::SatEnums::GetLogLevelName(), ns3::SatEnums::GetNodeTypeName(), ns3::SatEnums::GetPacketEventName(), and m_packetTraceStream.

Referenced by ns3::SatBeamHelper::EnablePacketTrace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::SatPacketTrace::DoDispose ( void  )
virtual

Dispose of this class instance.

Definition at line 80 of file satellite-packet-trace.cc.

◆ GetInstanceTypeId()

TypeId ns3::SatPacketTrace::GetInstanceTypeId ( void  ) const

Definition at line 60 of file satellite-packet-trace.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::SatPacketTrace::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 67 of file satellite-packet-trace.cc.

References m_fileName.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ PrintHeader()

void ns3::SatPacketTrace::PrintHeader ( )
private

Print header to the packet trace log.

Definition at line 87 of file satellite-packet-trace.cc.

References m_packetTraceStream.

Referenced by SatPacketTrace().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_fileName

std::string ns3::SatPacketTrace::m_fileName
private

File name of the packet trace log.

Definition at line 97 of file satellite-packet-trace.h.

Referenced by SatPacketTrace(), and GetTypeId().

◆ m_packetTraceStream

Ptr<OutputStreamWrapper> ns3::SatPacketTrace::m_packetTraceStream
private

Stream wrapper used for packet traces.

Definition at line 102 of file satellite-packet-trace.h.

Referenced by SatPacketTrace(), AddTraceEntry(), and PrintHeader().


The documentation for this class was generated from the following files: