The RoutingHelper class generates routing data between nodes (vehicles) and uses the RoutingStats class to collect statistics on routing data (application-data packet and byte counts). More...
Public Member Functions | |
RoutingHelper () | |
Constructor. More... | |
virtual | ~RoutingHelper () |
Destructor. More... | |
RoutingStats & | GetRoutingStats () |
Returns the RoutingStats instance. More... | |
void | Install (NodeContainer &c, NetDeviceContainer &d, Ipv4InterfaceContainer &i, double totalTime, int protocol, uint32_t nSinks, int routingTables) |
Installs routing functionality on nodes and their devices and interfaces. More... | |
void | OnOffTrace (std::string context, Ptr< const Packet > packet) |
Trace the receipt of an on-off-application generated packet. More... | |
void | SetLogging (int log) |
Enable/disable logging. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get class TypeId. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
void | AssignIpAddresses (NetDeviceContainer &d, Ipv4InterfaceContainer &adhocTxInterfaces) |
Assigns IPv4 addresses to net devices and their interfaces. More... | |
void | ReceiveRoutingPacket (Ptr< Socket > socket) |
Process a received routing packet. More... | |
void | SetupRoutingMessages (NodeContainer &c, Ipv4InterfaceContainer &adhocTxInterfaces) |
Sets up routing messages on the nodes and their interfaces. More... | |
Ptr< Socket > | SetupRoutingPacketReceive (Ipv4Address addr, Ptr< Node > node) |
Sets up a routing packet for tranmission. More... | |
void | SetupRoutingProtocol (NodeContainer &c) |
Sets up the protocol protocol on the nodes. More... | |
Private Attributes | |
int | m_log |
log More... | |
uint32_t | m_nSinks |
number of sink nodes (< all nodes) More... | |
uint32_t | m_port |
port More... | |
uint32_t | m_protocol |
routing protocol; 0=NONE, 1=OLSR, 2=AODV, 3=DSDV, 4=DSR More... | |
std::string | m_protocolName |
protocol name More... | |
int | m_routingTables |
dump routing table (at t=5 sec). 0=No, 1=Yes More... | |
double | m_TotalSimTime |
seconds More... | |
RoutingStats | routingStats |
routing statistics More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
The RoutingHelper class generates routing data between nodes (vehicles) and uses the RoutingStats class to collect statistics on routing data (application-data packet and byte counts).
A routing protocol is configured, and all nodes attempt to send (i.e. route) small packets to another node, which acts as data sinks. Not all nodes act as data sinks. for the vehicular network
Definition at line 371 of file vanet-routing-compare.cc.
RoutingHelper::RoutingHelper | ( | ) |
Constructor.
Definition at line 487 of file vanet-routing-compare.cc.
|
virtual |
Destructor.
Definition at line 497 of file vanet-routing-compare.cc.
|
private |
Assigns IPv4 addresses to net devices and their interfaces.
d | net device container |
adhocTxInterfaces | IPv4 interface container |
Definition at line 603 of file vanet-routing-compare.cc.
References ns3::Ipv4AddressHelper::Assign(), NS_LOG_INFO, and ns3::Ipv4AddressHelper::SetBase().
Referenced by Install().
RoutingStats & RoutingHelper::GetRoutingStats | ( | ) |
Returns the RoutingStats instance.
Definition at line 696 of file vanet-routing-compare.cc.
References routingStats.
Referenced by VanetRoutingExperiment::CheckThroughput(), VanetRoutingExperiment::ProcessOutputs(), and ReceiveRoutingPacket().
|
static |
Get class TypeId.
Definition at line 479 of file vanet-routing-compare.cc.
References ns3::TypeId::SetParent().
void RoutingHelper::Install | ( | NodeContainer & | c, |
NetDeviceContainer & | d, | ||
Ipv4InterfaceContainer & | i, | ||
double | totalTime, | ||
int | protocol, | ||
uint32_t | nSinks, | ||
int | routingTables | ||
) |
Installs routing functionality on nodes and their devices and interfaces.
c | node container |
d | net device container |
i | IPv4 interface container |
totalTime | the total time that nodes should attempt to route data |
protocol | the routing protocol (1=OLSR;2=AODV;3=DSDV;4=DSR) |
nSinks | the number of nodes which will act as data sinks |
routingTables | dump routing tables at t=5 seconds (0=no;1=yes) |
Definition at line 502 of file vanet-routing-compare.cc.
References AssignIpAddresses(), m_nSinks, m_protocol, m_routingTables, m_TotalSimTime, SetupRoutingMessages(), and SetupRoutingProtocol().
Referenced by VanetRoutingExperiment::SetupRoutingMessages().
Trace the receipt of an on-off-application generated packet.
context | this object |
packet | a received packet |
Definition at line 689 of file vanet-routing-compare.cc.
References ns3::Packet::GetSize(), RoutingStats::IncTxBytes(), and routingStats.
Referenced by VanetRoutingExperiment::ConfigureApplications().
Process a received routing packet.
socket | the receiving socket |
Definition at line 671 of file vanet-routing-compare.cc.
References GetRoutingStats(), ns3::Packet::GetSize(), RoutingStats::IncRxBytes(), RoutingStats::IncRxPkts(), m_log, m_protocolName, NS_LOG_UNCOND, PrintReceivedRoutingPacket(), and ns3::Socket::RecvFrom().
Referenced by SetupRoutingPacketReceive().
void RoutingHelper::SetLogging | ( | int | log | ) |
Enable/disable logging.
log | non-zero to enable logging |
Definition at line 702 of file vanet-routing-compare.cc.
References m_log.
Referenced by VanetRoutingExperiment::ParseCommandLineArguments().
|
private |
Sets up routing messages on the nodes and their interfaces.
c | node container |
adhocTxInterfaces | IPv4 interface container |
Definition at line 615 of file vanet-routing-compare.cc.
References ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::UniformRandomVariable::GetValue(), ns3::OnOffHelper::Install(), m_nSinks, m_port, m_protocol, m_TotalSimTime, ns3::Seconds(), ns3::OnOffHelper::SetAttribute(), ns3::RandomVariableStream::SetStream(), SetupRoutingPacketReceive(), sink, ns3::ApplicationContainer::Start(), and ns3::ApplicationContainer::Stop().
Referenced by Install().
|
private |
Sets up a routing packet for tranmission.
addr | destination address |
node | source node |
Definition at line 521 of file vanet-routing-compare.cc.
References m_port, ns3::MakeCallback(), ReceiveRoutingPacket(), and sink.
Referenced by SetupRoutingMessages().
|
private |
Sets up the protocol protocol on the nodes.
c | node container |
Definition at line 533 of file vanet-routing-compare.cc.
References ns3::AsciiTraceHelper::CreateFileStream(), ns3::DsrMainHelper::Install(), ns3::InternetStackHelper::Install(), list, m_log, m_protocol, m_protocolName, m_routingTables, NS_FATAL_ERROR, NS_LOG_UNCOND, ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(), and ns3::InternetStackHelper::SetRoutingHelper().
Referenced by Install().
|
private |
log
Definition at line 473 of file vanet-routing-compare.cc.
Referenced by ReceiveRoutingPacket(), SetLogging(), and SetupRoutingProtocol().
|
private |
number of sink nodes (< all nodes)
Definition at line 469 of file vanet-routing-compare.cc.
Referenced by Install(), and SetupRoutingMessages().
|
private |
port
Definition at line 468 of file vanet-routing-compare.cc.
Referenced by SetupRoutingMessages(), and SetupRoutingPacketReceive().
|
private |
routing protocol; 0=NONE, 1=OLSR, 2=AODV, 3=DSDV, 4=DSR
Definition at line 467 of file vanet-routing-compare.cc.
Referenced by Install(), SetupRoutingMessages(), and SetupRoutingProtocol().
|
private |
protocol name
Definition at line 472 of file vanet-routing-compare.cc.
Referenced by ReceiveRoutingPacket(), and SetupRoutingProtocol().
|
private |
dump routing table (at t=5 sec). 0=No, 1=Yes
Definition at line 470 of file vanet-routing-compare.cc.
Referenced by Install(), and SetupRoutingProtocol().
|
private |
seconds
Definition at line 466 of file vanet-routing-compare.cc.
Referenced by Install(), and SetupRoutingMessages().
|
private |
routing statistics
Definition at line 471 of file vanet-routing-compare.cc.
Referenced by GetRoutingStats(), and OnOffTrace().