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 funcationality 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... | |
![]() | |
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 |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
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 |
uint32_t | m_nSinks |
uint32_t | m_port |
uint32_t | m_protocol |
std::string | m_protocolName |
int | m_routingTables |
double | m_TotalSimTime |
RoutingStats | routingStats |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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 382 of file vanet-routing-compare.cc.
RoutingHelper::RoutingHelper | ( | ) |
|
virtual |
|
private |
Assigns IPv4 addresses to net devices and their interfaces.
d | net device container |
adhocTxInterfaces | IPv4 interface container |
Definition at line 623 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 711 of file vanet-routing-compare.cc.
References routingStats.
Referenced by VanetRoutingExperiment::CheckThroughput(), VanetRoutingExperiment::ProcessOutputs(), and ReceiveRoutingPacket().
|
static |
Get class TypeId.
Definition at line 499 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 funcationality 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 522 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 704 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 687 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::Recv().
Referenced by SetupRoutingPacketReceive().
void RoutingHelper::SetLogging | ( | int | log | ) |
Enable/disable logging.
log | non-zero to enable logging |
Definition at line 717 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 635 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(), 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 541 of file vanet-routing-compare.cc.
References ns3::Socket::Bind(), m_port, ns3::MakeCallback(), ReceiveRoutingPacket(), and ns3::Socket::SetRecvCallback().
Referenced by SetupRoutingMessages().
|
private |
Sets up the protocol protocol on the nodes.
c | node container |
Definition at line 553 of file vanet-routing-compare.cc.
References ns3::Ipv4ListRoutingHelper::Add(), 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 |
Definition at line 493 of file vanet-routing-compare.cc.
Referenced by ReceiveRoutingPacket(), SetLogging(), and SetupRoutingProtocol().
|
private |
Definition at line 489 of file vanet-routing-compare.cc.
Referenced by Install(), and SetupRoutingMessages().
|
private |
Definition at line 488 of file vanet-routing-compare.cc.
Referenced by SetupRoutingMessages(), and SetupRoutingPacketReceive().
|
private |
Definition at line 487 of file vanet-routing-compare.cc.
Referenced by Install(), SetupRoutingMessages(), and SetupRoutingProtocol().
|
private |
Definition at line 492 of file vanet-routing-compare.cc.
Referenced by ReceiveRoutingPacket(), and SetupRoutingProtocol().
|
private |
Definition at line 490 of file vanet-routing-compare.cc.
Referenced by Install(), and SetupRoutingProtocol().
|
private |
Definition at line 486 of file vanet-routing-compare.cc.
Referenced by Install(), and SetupRoutingMessages().
|
private |
Definition at line 491 of file vanet-routing-compare.cc.
Referenced by GetRoutingStats(), and OnOffTrace().