Loading...
Searching...
No Matches
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.
virtual ~SatPacketTrace ()
 Destructor.
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.
virtual void DoDispose ()
 Dispose of this class instance.
virtual void NotifyConstructionCompleted () override
 Notifier called once the ObjectBase is fully constructed.

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID.

Private Member Functions

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

Private Attributes

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

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 44 of file satellite-packet-trace.h.

Constructor & Destructor Documentation

◆ SatPacketTrace()

ns3::SatPacketTrace::SatPacketTrace ( )

Constructor.

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

◆ ~SatPacketTrace()

ns3::SatPacketTrace::~SatPacketTrace ( )
virtual

Destructor.

Definition at line 66 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 112 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 ( )
virtual

Dispose of this class instance.

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

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

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

References m_fileName.

◆ NotifyConstructionCompleted()

void ns3::SatPacketTrace::NotifyConstructionCompleted ( )
overridevirtual

Notifier called once the ObjectBase is fully constructed.

This method is invoked once all member attributes have been initialized. Subclasses can override this method to be notified of this event but if they do this, they must chain up to their parent's NotifyConstructionCompleted method.

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

References ns3::SatEnvVariables::GetInstance(), m_fileName, m_packetTraceStream, and PrintHeader().

Here is the call graph for this function:

◆ PrintHeader()

void ns3::SatPacketTrace::PrintHeader ( )
private

Print header to the packet trace log.

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

References m_packetTraceStream.

Referenced by NotifyConstructionCompleted().

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 108 of file satellite-packet-trace.h.

Referenced by GetTypeId(), and NotifyConstructionCompleted().

◆ m_packetTraceStream

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

Stream wrapper used for packet traces.

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

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


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