14#include "ns3/core-module.h"
15#include "ns3/csma-module.h"
16#include "ns3/internet-module.h"
17#include "ns3/network-module.h"
31 if (packet->RemovePacketTag(
tosTag))
36 if (packet->RemovePacketTag(
ttlTag))
74 cmd.AddValue(
"PacketSize",
"Packet size in bytes",
packetSize);
75 cmd.AddValue(
"PacketCount",
"Number of packets to send",
packetCount);
77 cmd.AddValue(
"IP_TOS",
"IP_TOS",
ipTos);
79 cmd.AddValue(
"IP_TTL",
"IP_TTL",
ipTtl);
101 ipv4.SetBase(
"10.1.1.0",
"255.255.255.0");
133 csma.EnableAsciiAll(
ascii.CreateFileStream(
"socket-options-ipv4.tr"));
134 csma.EnablePcapAll(
"socket-options-ipv4",
false);
144 interPacketInterval);
a polymophic address class
Manage ASCII trace files for device models.
Parse command-line arguments.
build a set of CsmaNetDevice objects
Class for representing data rates.
AttributeValue implementation for DataRate.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
holds a vector of std::pair of Ptr<Ipv4> and interface index.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static void Run()
Run the simulation.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
indicates whether the socket has IP_TOS set.
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
a unique identifier for an interface.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
void ReceivePacket(Ptr< Socket > socket)
static void SendPacket(Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
uint32_t pktSize
packet size used for the simulation (in bytes)
static const uint32_t packetSize
Packet size generated at the AP.