14#include "ns3/channel.h"
15#include "ns3/event-id.h"
16#include "ns3/ipv4-header.h"
17#include "ns3/ipv4-l3-protocol.h"
18#include "ns3/mac16-address.h"
19#include "ns3/mac48-address.h"
20#include "ns3/mac64-address.h"
22#include "ns3/nstime.h"
23#include "ns3/packet.h"
87 static void Pause(
const std::string& message);
103 typedef std::vector<TransmissionSample>
150 std::variant<Mac16Address, Mac48Address, Mac64Address>
to;
158 std::variant<Mac16Address, Mac48Address, Mac64Address>
from;
327 std::map<TransmissionSampleKey, TransmissionSampleValue>
344 const std::string& context,
346 const std::variant<Mac16Address, Mac48Address, Mac64Address>& destination);
356 const std::variant<Mac16Address, Mac48Address, Mac64Address>& source);
475 void DoPause(
const std::string& message);
DropReason
Reason why a packet has been dropped.
Smart pointer class similar to boost::intrusive_ptr.
void RegisterCsmaLikeDevice(const std::string &deviceTypeName)
Register CSMA like device function.
void TraceNetDevRxCsma(std::string context, Ptr< const Packet > packet)
CSMA receive trace callback function.
void SetPacketCaptureOptions(uint32_t nodeId, PacketCaptureOptions options)
Set packet capture options function.
void TraceNetDevRxPointToPoint(std::string context, Ptr< const Packet > packet)
Point to point receive trace callback function.
void RegisterDropTracePath(const std::string &tracePath)
Register drop trace path function.
MacAddressMode
The MAC address mode used by a NetDevice transmissions.
@ MAC64ADDRESS
The mode is a Mac 48 bit address (A.K.A Extended address).
@ MAC16ADDRESS
The mode is a Mac 16 bit address (A.K.A.
@ MAC48ADDRESS
The mode is a Mac 48 bit address.
void RegisterWifiLikeDevice(const std::string &deviceTypeName)
Register WIFI like device function.
std::map< uint32_t, PacketCaptureOptions > m_packetCaptureOptions
packet capture options
void TraceNetDevTxLte(std::string context, Ptr< const Packet > packet, const Mac48Address &destination)
LTE transmit trace callback function.
std::map< uint32_t, LastPacketsSample > m_lastPackets
last packets
void SimulatorRunUntil(Time time)
Run simulation until a given (simulated, absolute) time is reached.
PacketDropSampleList GetPacketDropSamples() const
Get packet drop samples.
void SetNodesOfInterest(std::set< uint32_t > nodes)
Set nodes of interest function.
std::map< uint32_t, std::vector< NetDeviceStatistics > > m_nodesStatistics
node statistics
void TraceNetDevTxCsma(std::string context, Ptr< const Packet > packet)
CSMA transmit trace callback function.
void TraceNetDevTxLrWpan(std::string context, Ptr< const Packet > packet)
Lr-Wpan transmit trace callback function.
Time GetSimulatorStopTime()
Get the stop time of the underlying visual simulator implementation.
void DoPause(const std::string &message)
Do pause function.
std::vector< NodeStatistics > GetNodesStatistics() const
Get node statistics.
std::set< uint32_t > m_nodesOfInterest
list of node IDs whose transmissions will be monitored
void TraceNetDevPromiscRxCsma(std::string context, Ptr< const Packet > packet)
CSMA promiscuous receive function.
static void Pause(const std::string &message)
Pause function.
void TraceNetDevRxCommon(const std::string &context, Ptr< const Packet > packet, const std::variant< Mac16Address, Mac48Address, Mac64Address > &source)
Network receive common trace callback function.
std::vector< std::string > m_pauseMessages
pause message
void TraceNetDevRxLte(std::string context, Ptr< const Packet > packet, const Mac48Address &source)
LTE receive trace callback function.
void TraceNetDevRxLrWpan(std::string context, Ptr< const Packet > packet)
Lr-Wpan receive trace callback function.
void TraceIpv4Drop(std::string context, const ns3::Ipv4Header &hdr, Ptr< const Packet > packet, ns3::Ipv4L3Protocol::DropReason reason, Ptr< Ipv4 > dummy_ipv4, uint32_t interface)
Ipv4 drop trace callback function.
TransmissionSampleList GetTransmissionSamples() const
Get transmission samples.
static void LineClipping(double boundsX1, double boundsY1, double boundsX2, double boundsY2, double &lineX1, double &lineY1, double &lineX2, double &lineY2)
Utility function - clips a line to a bounding box.
std::map< TransmissionSampleKey, TransmissionSampleValue > m_transmissionSamples
transmission samples
void TraceNetDevTxPointToPoint(std::string context, Ptr< const Packet > packet)
Point to point transmit trace callback function.
void TraceNetDevRxWifi(std::string context, Ptr< const Packet > packet)
Wi-Fi receive trace callback function.
NetDeviceStatistics & FindNetDeviceStatistics(int node, int interface)
Find net device statistics function.
void TraceDevQueueDrop(std::string context, Ptr< const Packet > packet)
Queue drop trace callback function.
std::map< TxRecordKey, TxRecordValue > m_txRecords
transmit records
std::vector< std::string > GetPauseMessages() const
Get pause message function.
void TraceNetDevTxCommon(const std::string &context, Ptr< const Packet > packet, const std::variant< Mac16Address, Mac48Address, Mac64Address > &destination)
Network transmit common trace callback function.
std::vector< PacketDropSample > PacketDropSampleList
PacketDropSampleList typedef.
static bool FilterPacket(Ptr< const Packet > packet, const PacketCaptureOptions &options)
Filter packet function.
void CallbackStopSimulation()
Stop simulation callback function.
void RegisterPointToPointLikeDevice(const std::string &deviceTypeName)
Register point to point like device function.
std::map< Ptr< Node >, uint32_t > m_packetDrops
packet drops
LastPacketsSample GetLastPackets(uint32_t nodeId) const
Get last packets function.
void TraceNetDevTxWifi(std::string context, Ptr< const Packet > packet)
Wi-Fi transmit trace callback function.
bool GetPacketCaptureOptions(uint32_t nodeId, const PacketCaptureOptions **outOptions) const
Get packet capture options function.
Time m_runUntil
run until time
std::map< uint32_t, Time > m_packetsOfInterest
list of packet UIDs that will be monitored
std::pair< Ptr< Channel >, uint32_t > TxRecordKey
TxRecordKey typedef.
std::vector< TransmissionSample > TransmissionSampleList
TransmissionSampleList typedef.
PacketCaptureMode
PacketCaptureMode enumeration.
@ PACKET_CAPTURE_FILTER_HEADERS_OR
@ PACKET_CAPTURE_DISABLED
@ PACKET_CAPTURE_FILTER_HEADERS_AND
Simulation virtual time values and global simulation resolution.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Structure to handle a sample of the last received, transmitted or drop packets in a node.
std::vector< PacketSample > lastDroppedPackets
Last dropped packets.
std::vector< TxPacketSample > lastTransmittedPackets
Last transmitted packets.
std::vector< RxPacketSample > lastReceivedPackets
Last received packets.
NetDeviceStatistics structure.
uint64_t receivedBytes
received bytes
uint64_t transmittedBytes
transmitted bytes
uint32_t receivedPackets
received packets
NetDeviceStatistics()
constructor
uint32_t transmittedPackets
transmitted packets
NodeStatistics structure.
std::vector< NetDeviceStatistics > statistics
statistics
PacketCaptureOptions structure.
PacketCaptureMode mode
mode
uint32_t numLastPackets
num last packets
std::set< TypeId > headers
headers
PacketDropSample structure.
Ptr< Node > transmitter
transmitter
Ptr< Packet > packet
packet
Ptr< NetDevice > device
device
RxPacketSample structure.
std::variant< Mac16Address, Mac48Address, Mac64Address > from
The source MAC address.
TransmissionSample structure.
Ptr< Node > transmitter
transmitter
Ptr< Channel > channel
channel
Ptr< Node > receiver
NULL if broadcast.
TransmissionSampleKey structure.
Ptr< Channel > channel
channel
bool operator==(const TransmissionSampleKey &other) const
Equality operator.
bool operator<(const TransmissionSampleKey &other) const
Less than operator.
Ptr< Node > transmitter
transmitter
Ptr< Node > receiver
NULL if broadcast.
TransmissionSampleValue structure.
TxPacketSample structure.
std::variant< Mac16Address, Mac48Address, Mac64Address > to
The destination MAC address.
Ptr< Node > srcNode
source node
bool isBroadcast
is broadcast?