A Discrete-Event Network Simulator
API
ns3::dsr::DsrRouting Class Reference

Dsr Routing base. More...

#include "dsr-routing.h"

+ Inheritance diagram for ns3::dsr::DsrRouting:
+ Collaboration diagram for ns3::dsr::DsrRouting:

Public Member Functions

 DsrRouting ()
 Constructor. More...
 
virtual ~DsrRouting ()
 Destructor. More...
 
uint16_t AddAckReqHeader (Ptr< Packet > &packet, Ipv4Address nextHop)
 This function is called to add ack request header for network acknowledgement. More...
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
void CallCancelPacketTimer (uint16_t ackId, Ipv4Header const &ipv4Header, Ipv4Address realSrc, Ipv4Address realDst)
 Call the cancel packet retransmission timer function. More...
 
void CancelLinkPacketTimer (DsrMaintainBuffEntry &mb)
 Cancel the link packet retransmission timer for a specific maintenance entry. More...
 
void CancelNetworkPacketTimer (DsrMaintainBuffEntry &mb)
 Cancel the network packet retransmission timer for a specific maintenance entry. More...
 
void CancelPacketAllTimer (DsrMaintainBuffEntry &mb)
 Cancel all the packet timers. More...
 
void CancelPacketTimerNextHop (Ipv4Address nextHop, uint8_t protocol)
 Cancel the packet retransmission timer for a all maintenance entries with nextHop address. More...
 
void CancelPassivePacketTimer (DsrMaintainBuffEntry &mb)
 Cancel the passive packet retransmission timer for a specific maintenance entry. More...
 
bool CancelPassiveTimer (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t segsLeft)
 Cancel the passive timer. More...
 
void CancelRreqTimer (Ipv4Address dst, bool isRemove)
 Cancel the route request timer. More...
 
void CheckSendBuffer ()
 Check the send buffer of packets with route when send buffer timer expire. More...
 
void ForwardErrPacket (DsrOptionRerrUnreachHeader &rerr, DsrOptionSRHeader &sourceRoute, Ipv4Address nextHop, uint8_t protocol, Ptr< Ipv4Route > route)
 This function is responsible for forwarding error packets along the route. More...
 
void ForwardPacket (Ptr< const Packet > packet, DsrOptionSRHeader &sourceRoute, Ipv4Header const &ipv4Header, Ipv4Address source, Ipv4Address destination, Ipv4Address targetAddress, uint8_t protocol, Ptr< Ipv4Route > route)
 Forward the packet using the route saved in the source route option header. More...
 
IpL4Protocol::DownTargetCallback GetDownTarget (void) const
 This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 case) More...
 
IpL4Protocol::DownTargetCallback6 GetDownTarget6 (void) const
 This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 case) More...
 
std::vector< std::string > GetElementsFromContext (std::string context)
 Get the elements from the tracing context. More...
 
uint16_t GetIDfromIP (Ipv4Address address)
 Get the node id from ip address. More...
 
Ipv4Address GetIPfromID (uint16_t id)
 Get the ip address from id. More...
 
Ipv4Address GetIPfromMAC (Mac48Address address)
 Get the Ip address from mac address. More...
 
Ptr< NetDeviceGetNetDeviceFromContext (std::string context)
 Get the netdevice from the context. More...
 
Ptr< NodeGetNode () const
 Get the node. More...
 
Ptr< NodeGetNodeWithAddress (Ipv4Address ipv4Address)
 Get the node with give ip address. More...
 
Ptr< dsr::DsrOptionsGetOption (int optionNumber)
 Get the option corresponding to optionNumber. More...
 
Ptr< dsr::DsrPassiveBufferGetPassiveBuffer () const
 Get the passive buffer. More...
 
uint32_t GetPriority (DsrMessageType messageType)
 Set the priority of the packet in network queue. More...
 
int GetProtocolNumber (void) const
 Get the dsr protocol number. More...
 
Ptr< dsr::DsrRreqTableGetRequestTable () const
 Get the request table. More...
 
Ptr< dsr::DsrRouteCacheGetRouteCache () const
 Get the route cache. More...
 
void IncreaseRetransTimer ()
 This function is called to increase the retransmission timer for data packet in the network queue. More...
 
void Insert (Ptr< dsr::DsrOptions > option)
 Insert a new Dsr Option. More...
 
void LinkScheduleTimerExpire (DsrMaintainBuffEntry &mb, uint8_t protocol)
 This function deals with packet retransmission timer expire using link acknowledgment. More...
 
void NetworkScheduleTimerExpire (DsrMaintainBuffEntry &mb, uint8_t protocol)
 This function deals with packet retransmission timer expire using network acknowledgment. More...
 
void PacketNewRoute (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol)
 When route vector corrupted, originate a new packet, normally not happening. More...
 
bool PassiveEntryCheck (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t segsLeft, uint16_t fragmentOffset, uint16_t identification, bool saveEntry)
 Find the same passive entry. More...
 
void PassiveScheduleTimerExpire (DsrMaintainBuffEntry &mb, uint8_t protocol)
 This function deals with packet retransmission timer expire using passive acknowledgment. More...
 
void PrintVector (std::vector< Ipv4Address > &vec)
 Print the route vector. More...
 
void PriorityScheduler (uint32_t priority, bool continueWithFirst)
 This function is called to schedule sending packets from the network queue by priority. More...
 
uint8_t Process (Ptr< Packet > &packet, Ipv4Header const &ipv4Header, Ipv4Address dst, uint8_t *nextHeader, uint8_t protocol, bool &isDropped)
 Process method Called from Ipv4L3Protocol::Receive. More...
 
virtual enum IpL4Protocol::RxStatus Receive (Ptr< Packet > p, Ipv6Header const &header, Ptr< Ipv6Interface > incomingInterface)
 
virtual enum IpL4Protocol::RxStatus Receive (Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > incomingInterface)
 
void RouteRequestTimerExpire (Ptr< Packet > packet, std::vector< Ipv4Address > address, uint32_t requestId, uint8_t protocol)
 Handle route discovery timer. More...
 
void SalvagePacket (Ptr< const Packet > packet, Ipv4Address source, Ipv4Address dst, uint8_t protocol)
 Salvage the packet which has been transmitted for 3 times. More...
 
void ScheduleCachedReply (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, Ptr< Ipv4Route > route, double hops)
 Schedule the cached reply to a random start time to avoid possible route reply storm. More...
 
void ScheduleInitialReply (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, Ptr< Ipv4Route > route)
 this is a generating the initial route reply from the destination address, a random delay time [0, m_broadcastJitter] is used before unicasting back the route reply packet More...
 
void ScheduleInterRequest (Ptr< Packet > packet)
 Schedule the intermediate route request. More...
 
void ScheduleLinkPacketRetry (DsrMaintainBuffEntry &mb, uint8_t protocol)
 Schedule the packet retransmission based on link-layer acknowledgment. More...
 
void ScheduleNetworkPacketRetry (DsrMaintainBuffEntry &mb, bool isFirst, uint8_t protocol)
 Schedule the packet retransmission based on network layer acknowledgment. More...
 
void SchedulePassivePacketRetry (DsrMaintainBuffEntry &mb, uint8_t protocol)
 Schedule the packet retransmission based on passive acknowledgment. More...
 
void Scheduler (uint32_t priority)
 This function is called to schedule sending packets from the network queue. More...
 
void ScheduleRreqRetry (Ptr< Packet > packet, std::vector< Ipv4Address > address, bool nonProp, uint32_t requestId, uint8_t protocol)
 Schedule the route request retry. More...
 
Ipv4Address SearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Get the next hop of the route. More...
 
void Send (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol, Ptr< Ipv4Route > route)
 This function is called by higher layer protocol when sending packets. More...
 
void SendAck (uint16_t ackId, Ipv4Address destination, Ipv4Address realSrc, Ipv4Address realDst, uint8_t protocol, Ptr< Ipv4Route > route)
 Send network layer acknowledgment back to the earlier hop to notify the receipt of data packet. More...
 
void SendBuffTimerExpire ()
 The send buffer timer expire. More...
 
void SendErrorRequest (DsrOptionRerrUnreachHeader &rerr, uint8_t protocol)
 Send the error request packet. More...
 
void SendGratuitousReply (Ipv4Address replyTo, Ipv4Address replyFrom, std::vector< Ipv4Address > &nodeList, uint8_t protocol)
 Send the gratuitous reply. More...
 
void SendInitialRequest (Ipv4Address source, Ipv4Address destination, uint8_t protocol)
 Broadcast the route request packet in subnet. More...
 
void SendPacket (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, uint8_t protocol)
 This function is called by when really sending out the packet. More...
 
void SendPacketFromBuffer (DsrOptionSRHeader const &sourceRoute, Ipv4Address nextHop, uint8_t protocol)
 This function is responsible for sending out data packets when have route, if no route found, it will cache the packet and send out route requests. More...
 
bool SendRealDown (DsrNetworkQueueEntry &newEntry)
 This function is called to send packets down stack. More...
 
void SendReply (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, Ptr< Ipv4Route > route)
 Send the route reply back to the request originator with the cumulated route. More...
 
void SendRequest (Ptr< Packet > packet, Ipv4Address source)
 Forward the route request if the node is not the destination. More...
 
void SendUnreachError (Ipv4Address unreachNode, Ipv4Address destination, Ipv4Address originalDst, uint8_t salvage, uint8_t protocol)
 This function is responsible for sending error packets in case of break link to next hop. More...
 
void SetDownTarget (IpL4Protocol::DownTargetCallback callback)
 This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 case) More...
 
void SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback)
 This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 case) More...
 
void SetNode (Ptr< Node > node)
 Set the node. More...
 
void SetPassiveBuffer (Ptr< dsr::DsrPassiveBuffer > r)
 Set the node. More...
 
void SetRequestTable (Ptr< dsr::DsrRreqTable > r)
 Set the node. More...
 
Ptr< Ipv4RouteSetRoute (Ipv4Address nextHop, Ipv4Address srcAddress)
 Set the route to use for data packets, used by the option headers when sending data/control packets. More...
 
void SetRouteCache (Ptr< dsr::DsrRouteCache > r)
 Set the route cache. More...
 
bool IsLinkCache ()
 functions used to direct to route cache More...
 
void UseExtends (DsrRouteCacheEntry::IP_VECTOR rt)
 functions used to direct to route cache More...
 
bool LookupRoute (Ipv4Address id, DsrRouteCacheEntry &rt)
 functions used to direct to route cache More...
 
bool AddRoute_Link (DsrRouteCacheEntry::IP_VECTOR nodelist, Ipv4Address source)
 functions used to direct to route cache More...
 
bool AddRoute (DsrRouteCacheEntry &rt)
 functions used to direct to route cache More...
 
void DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node)
 functions used to direct to route cache More...
 
bool UpdateRouteEntry (Ipv4Address dst)
 functions used to direct to route cache More...
 
bool FindSourceEntry (Ipv4Address src, Ipv4Address dst, uint16_t id)
 functions used to direct to route cache More...
 
- Public Member Functions inherited from ns3::IpL4Protocol
virtual ~IpL4Protocol ()
 
virtual void ReceiveIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv4Address payloadSource, Ipv4Address payloadDestination, const uint8_t payload[8])
 Called from lower-level layers to send the ICMP packet up in the stack. More...
 
virtual void ReceiveIcmp (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv6Address payloadSource, Ipv6Address payloadDestination, const uint8_t payload[8])
 Called from lower-level layers to send the ICMPv6 packet up in the stack. 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<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 by TypeId. 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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (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 ()
 Get the type identificator. More...
 
- Static Public Member Functions inherited from ns3::IpL4Protocol
static TypeId GetTypeId (void)
 Get the type ID. 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...
 

Static Public Attributes

static const uint8_t PROT_NUMBER = 48
 Define the dsr protocol number. More...
 

Protected Member Functions

virtual void DoDispose (void)
 Drop trace callback. More...
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. 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...
 

Protected Attributes

TracedCallback< Ptr< const Packet > > m_dropTrace
 The trace for drop, receive and send data packets. More...
 
TracedCallback< const DsrOptionSRHeader & > m_txPacketTrace
 packet trace callback More...
 

Private Types

typedef std::list< Ptr< DsrOptions > > DsrOptionList_t
 Define the list to hold DSR options. More...
 

Private Member Functions

bool PromiscReceive (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
 Promiscuous receive data packets destined to some other node. More...
 
void SendRerrWhenBreaksLinkToNextHop (Ipv4Address nextHop, uint8_t protocol)
 Send the route error message when the link breaks to the next hop. More...
 
void Start ()
 

Private Attributes

uint16_t m_ackId
 The ack id assigned to each acknowledge. More...
 
std::vector< Ipv4Addressm_addresses
 The bind ipv4 addresses with next hop, src, destination address in sequence. More...
 
std::map< NetworkKey, uint32_t > m_addressForwardCnt
 Map network key + forward counts. More...
 
std::map< NetworkKey, Timerm_addressForwardTimer
 Map network key + forward timer. More...
 
std::map< Ipv4Address, Timerm_addressReqTimer
 Map IP address + RREQ timer. More...
 
Time m_blacklistTimeout
 The black list time out. More...
 
Ipv4Address m_broadcast
 The broadcast IP address. More...
 
uint32_t m_broadcastJitter
 The max time to delay route request broadcast. More...
 
std::string m_cacheType
 The type of route cache. More...
 
std::vector< Ipv4Addressm_clearList
 The node that is clear to send packet to. More...
 
uint32_t m_discoveryHopLimit
 Maximum hops to go for route request. More...
 
IpL4Protocol::DownTargetCallback m_downTarget
 The callback for down layer. More...
 
DsrErrorBuffer m_errorBuffer
 The error buffer to save the error messages. More...
 
std::vector< Ipv4Addressm_finalRoute
 The route cache. More...
 
DsrGraReply m_graReply
 The gratuitous route reply. More...
 
uint32_t m_graReplyTableSize
 Set the gratuitous reply table size. More...
 
Time m_gratReplyHoldoff
 The max gratuitous reply hold off time. More...
 
Time m_initStability
 The initial stability value for link cache. More...
 
Ptr< Ipv4m_ip
 The ip ptr. More...
 
Ptr< Ipv4L3Protocolm_ipv4
 Ipv4l3Protocol. More...
 
Ptr< Ipv4Routem_ipv4Route
 Ipv4 Route. More...
 
bool m_linkAck
 define if we use link acknowledgement or not More...
 
Time m_linkAckTimeout
 The timeout value for link acknowledge. More...
 
std::map< LinkKey, Timerm_linkAckTimer
 The timer for link acknowledgment. More...
 
std::map< LinkKey, uint32_t > m_linkCnt
 Map packet key + link forward counts. More...
 
uint32_t m_linkRetries
 

of retries have been sent for link acknowledgment

More...
 
std::map< std::string, uint32_t > m_macToNodeIdMap
 The map of mac address to node id. More...
 
Ipv4Address m_mainAddress
 Our own Ip address. More...
 
DsrMaintainBuffer m_maintainBuffer
 The declaration of maintain buffer. More...
 
uint32_t m_maxCacheLen
 Max # of cache entries for route cache. More...
 
Time m_maxCacheTime
 Max time for caching the route cache entry. More...
 
uint32_t m_maxEntriesEachDst
 Max number of route entries to save for each destination. More...
 
uint32_t m_maxMaintainLen
 Max # of entries for maintainance buffer. More...
 
Time m_maxMaintainTime
 Time out for maintainance buffer. More...
 
uint32_t m_maxMaintRexmt
 Maximum number of retransmissions of data packets. More...
 
Time m_maxNetworkDelay
 Maximum network delay. More...
 
uint32_t m_maxNetworkSize
 Maximum network queue size. More...
 
Time m_maxRequestPeriod
 The max request period. More...
 
uint32_t m_maxRreqId
 The max number of request ids for a single destination. More...
 
Time m_maxRreqTime
 Max time for caching the route request entry. More...
 
uint8_t m_maxSalvageCount
 Maximum # times to salvage a packet. More...
 
uint32_t m_maxSendBuffLen
 The maximum number of packets that we allow a routing protocol to buffer. More...
 
Time m_minLifeTime
 The min life time. More...
 
DsrNetworkQueue m_networkQueue
 The network queue. More...
 
Ptr< Nodem_node
 The node ptr. More...
 
Time m_nodeTraversalTime
 Time estimated for packet to travel between two nodes. More...
 
std::map< Ipv4Address, Timerm_nonPropReqTimer
 Map IP address + RREQ timer. More...
 
Time m_nonpropRequestTimeout
 The non-propagation request timeout. More...
 
uint32_t m_numPriorityQueues
 The number of priority queues used. More...
 
DsrOptionList_t m_options
 List of DSR Options supported. More...
 
Time m_passiveAckTimeout
 The timeout value for passive acknowledge. More...
 
std::map< PassiveKey, Timerm_passiveAckTimer
 The timer for passive acknowledgment. More...
 
Ptr< dsr::DsrPassiveBufferm_passiveBuffer
 A "drop-front" queue used by the routing layer to cache route request sent. More...
 
std::map< PassiveKey, uint32_t > m_passiveCnt
 Map packet key + passive forward counts. More...
 
uint32_t m_passiveRetries
 

of retries have been sent for passive acknowledgment

More...
 
std::map< uint32_t, Ptr< dsr::DsrNetworkQueue > > m_priorityQueue
 priority queues More...
 
uint32_t m_requestId
 The id assigned to each route request. More...
 
Time m_requestPeriod
 The base time interval between route requests. More...
 
uint32_t m_requestTableIds
 The request table identifiers. More...
 
uint32_t m_requestTableSize
 The max size of the request table size. More...
 
Time m_retransIncr
 the increase time for retransmission timer when face network congestion More...
 
Ptr< dsr::DsrRouteCachem_routeCache
 A "drop-front" queue used by the routing layer to cache routes found. More...
 
std::string m_routeSortType
 The type of route sort methods. More...
 
uint32_t m_rreqRetries
 Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route. More...
 
Ptr< dsr::DsrRreqTablem_rreqTable
 A "drop-front" queue used by the routing layer to cache route request sent. More...
 
DsrSendBuffer m_sendBuffer
 The send buffer. More...
 
Time m_sendBufferTimeout
 The maximum period of time that a routing protocol is allowed to buffer a packet for. More...
 
Time m_sendBuffInterval
 how often to check send buffer More...
 
Timer m_sendBuffTimer
 The send buffer timer. More...
 
uint32_t m_sendRetries
 

of retries have been sent for network acknowledgment

More...
 
uint32_t m_stabilityDecrFactor
 The initial decrease factor for link cache. More...
 
uint32_t m_stabilityIncrFactor
 The initial increase factor for link cache. More...
 
bool m_subRoute
 Whether to save sub route or not. More...
 
uint32_t m_tryLinkAcks
 Maximum number of packet transmission using link acknowledgment. More...
 
uint32_t m_tryPassiveAcks
 Maximum number of packet transmission using passive acknowledgment. More...
 
Ptr< UniformRandomVariablem_uniformRandomVariable
 Provides uniform random variables. More...
 
Time m_useExtends
 The use extension of the life time for link cache. More...
 
uint8_t segsLeft
 The segment left value from SR header. More...
 

Additional Inherited Members

- Public Types inherited from ns3::IpL4Protocol
typedef Callback< void, Ptr< Packet >, Ipv4Address, Ipv4Address, uint8_t, Ptr< Ipv4Route > > DownTargetCallback
 callback to send packets over IPv4 More...
 
typedef Callback< void, Ptr< Packet >, Ipv6Address, Ipv6Address, uint8_t, Ptr< Ipv6Route > > DownTargetCallback6
 callback to send packets over IPv6 More...
 
enum  RxStatus { RX_OK, RX_CSUM_FAILED, RX_ENDPOINT_CLOSED, RX_ENDPOINT_UNREACH }
 Rx status codes. More...
 

Detailed Description

Dsr Routing base.

Config Paths

ns3::dsr::DsrRouting is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/$ns3::dsr::DsrRouting"

Attributes

  • RouteCache: The route cache for saving routes from route discovery process.
  • RreqTable: The request table to manage route requests.
  • PassiveBuffer: The passive buffer to manage promisucously received passive ack.
  • MaxSendBuffLen: Maximum number of packets that can be stored in send buffer.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 64
    • Flags: construct write read
  • MaxSendBuffTime: Maximum time packets can be queued in the send buffer .
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +30000000000.0ns
    • Flags: construct write read
  • MaxMaintLen: Maximum number of packets that can be stored in maintenance buffer.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 50
    • Flags: construct write read
  • MaxMaintTime: Maximum time packets can be queued in maintenance buffer.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +30000000000.0ns
    • Flags: construct write read
  • MaxCacheLen: Maximum number of route entries that can be stored in route cache.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 64
    • Flags: construct write read
  • RouteCacheTimeout: Maximum time the route cache can be queued in route cache.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +300000000000.0ns
    • Flags: construct write read
  • MaxEntriesEachDst: Maximum number of route entries for a single destination to respond.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 20
    • Flags: construct write read
  • SendBuffInterval: How often to check send buffer for packet with route.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +500000000000.0ns
    • Flags: construct write read
  • NodeTraversalTime: The time it takes to traverse two neighboring nodes.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +40000000.0ns
    • Flags: construct write read
  • RreqRetries: Maximum number of retransmissions for request discovery of a route.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 16
    • Flags: construct write read
  • MaintenanceRetries: Maximum number of retransmissions for data packets from maintenance buffer.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2
    • Flags: construct write read
  • RequestTableSize: Maximum number of request entries in the request table, set this as the number of nodes in the simulation.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 64
    • Flags: construct write read
  • RequestIdSize: Maximum number of request source Ids in the request table.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 16
    • Flags: construct write read
  • UniqueRequestIdSize: Maximum number of request Ids in the request table for a single destination.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 256
    • Flags: construct write read
  • NonPropRequestTimeout: The timeout value for non-propagation request.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +30000000.0ns
    • Flags: construct write read
  • DiscoveryHopLimit: The max discovery hop limit for route requests.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 255
    • Flags: construct write read
  • MaxSalvageCount: The max salvage count for a single data packet.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 15
    • Flags: construct write read
  • BlacklistTimeout: The time for a neighbor to stay in blacklist.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +3000000000.0ns
    • Flags: construct write read
  • GratReplyHoldoff: The time for gratuitous reply entry to expire.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • BroadcastJitter: The jitter time to avoid collision for broadcast packets.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10
    • Flags: construct write read
  • LinkAckTimeout: The time a packet in maintenance buffer wait for link acknowledgment.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +100000000.0ns
    • Flags: construct write read
  • TryLinkAcks: The number of link acknowledgment to use.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1
    • Flags: construct write read
  • PassiveAckTimeout: The time a packet in maintenance buffer wait for passive acknowledgment.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +100000000.0ns
    • Flags: construct write read
  • TryPassiveAcks: The number of passive acknowledgment to use.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1
    • Flags: construct write read
  • RequestPeriod: The base time interval between route requests.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +500000000.0ns
    • Flags: construct write read
  • MaxRequestPeriod: The max time interval between route requests.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +10000000000.0ns
    • Flags: construct write read
  • GraReplyTableSize: The gratuitous reply table size.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 64
    • Flags: construct write read
  • CacheType: Use Link Cache or use Path Cache
    • Set with class: StringValue
    • Underlying type:
    • Initial value: LinkCache
    • Flags: construct write read
  • StabilityDecrFactor: The stability decrease factor for link cache
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2
    • Flags: construct write read
  • StabilityIncrFactor: The stability increase factor for link cache
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 4
    • Flags: construct write read
  • InitStability: The initial stability factor for link cache
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +25000000000.0ns
    • Flags: construct write read
  • MinLifeTime: The minimal life time for link cache
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • UseExtends: The extension time for link cache
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +120000000000.0ns
    • Flags: construct write read
  • EnableSubRoute: Enables saving of sub route when receiving route error messages, only available when using path route cache
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • RetransIncr: The increase time for retransmission timer when facing network congestion
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +20000000.0ns
    • Flags: construct write read
  • MaxNetworkQueueSize: The max number of packet to save in the network queue.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 400
    • Flags: construct write read
  • MaxNetworkQueueDelay: The max time for a packet to stay in the network queue.
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +30000000000.0ns
    • Flags: construct write read
  • NumPriorityQueues: The max number of packet to save in the network queue.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2
    • Flags: construct write read
  • LinkAcknowledgment: Enable Link layer acknowledgment mechanism
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read

Attributes defined in parent class ns3::IpL4Protocol

  • ProtocolNumber: The IP protocol number.

TraceSources

Size of this type is 1360 bytes (on a 64-bit architecture).

Definition at line 95 of file dsr-routing.h.

Member Typedef Documentation

Define the list to hold DSR options.

Definition at line 680 of file dsr-routing.h.

Constructor & Destructor Documentation

ns3::dsr::DsrRouting::DsrRouting ( )

Constructor.

Definition at line 356 of file dsr-routing.cc.

References Insert(), m_sendBuffTimer, m_uniformRandomVariable, NS_LOG_FUNCTION_NOARGS, ns3::Timer::Schedule(), ns3::Seconds(), SendBuffTimerExpire(), and ns3::Timer::SetFunction().

+ Here is the call graph for this function:

ns3::dsr::DsrRouting::~DsrRouting ( )
virtual

Destructor.

Definition at line 391 of file dsr-routing.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

bool ns3::dsr::DsrRouting::AddRoute ( DsrRouteCacheEntry rt)

functions used to direct to route cache

Definition at line 664 of file dsr-routing.cc.

References ns3::dsr::DsrErrorBuffer::DropPacketForErrLink(), ns3::dsr::DsrRouteCacheEntry::GetVector(), m_errorBuffer, m_mainAddress, m_routeCache, and SearchNextHop().

+ Here is the call graph for this function:

bool ns3::dsr::DsrRouting::AddRoute_Link ( DsrRouteCacheEntry::IP_VECTOR  nodelist,
Ipv4Address  source 
)

functions used to direct to route cache

Definition at line 657 of file dsr-routing.cc.

References ns3::dsr::DsrErrorBuffer::DropPacketForErrLink(), m_errorBuffer, m_routeCache, and SearchNextHop().

+ Here is the call graph for this function:

int64_t ns3::dsr::DsrRouting::AssignStreams ( int64_t  stream)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 2620 of file dsr-routing.cc.

References m_uniformRandomVariable, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::CallCancelPacketTimer ( uint16_t  ackId,
Ipv4Header const &  ipv4Header,
Ipv4Address  realSrc,
Ipv4Address  realDst 
)

Call the cancel packet retransmission timer function.

Parameters
ackIdacknowledge ID
ipv4Headerheader
realSrcsource IP address
realDstdestination IP address

Definition at line 2029 of file dsr-routing.cc.

References CancelNetworkPacketTimer(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetSource(), ns3::Simulator::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::CancelLinkPacketTimer ( DsrMaintainBuffEntry mb)

Cancel the link packet retransmission timer for a specific maintenance entry.

Parameters
mbmaintian byffer entry

TODO need to think about this part

Definition at line 2055 of file dsr-routing.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffer::GetSize(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::DsrMaintainBuffer::LinkEqual(), ns3::dsr::LinkKey::m_destination, m_linkAckTimer, m_linkCnt, m_maintainBuffer, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::LinkKey::m_ourAdd, ns3::dsr::LinkKey::m_source, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by CancelPacketAllTimer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::CancelPacketAllTimer ( DsrMaintainBuffEntry mb)

Cancel all the packet timers.

Parameters
mbmaintain buffer entry

Definition at line 2046 of file dsr-routing.cc.

References CancelLinkPacketTimer(), CancelNetworkPacketTimer(), CancelPassivePacketTimer(), and NS_LOG_FUNCTION.

Referenced by CancelPacketTimerNextHop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::CancelPacketTimerNextHop ( Ipv4Address  nextHop,
uint8_t  protocol 
)
void ns3::dsr::DsrRouting::CancelPassivePacketTimer ( DsrMaintainBuffEntry mb)

Cancel the passive packet retransmission timer for a specific maintenance entry.

Parameters
mbmaintian byffer entry

Definition at line 2155 of file dsr-routing.cc.

References ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::PassiveKey::m_ackId, ns3::dsr::PassiveKey::m_destination, m_passiveAckTimer, m_passiveCnt, ns3::dsr::PassiveKey::m_segsLeft, ns3::dsr::PassiveKey::m_source, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by CancelPacketAllTimer(), CancelPassiveTimer(), PassiveEntryCheck(), and PassiveScheduleTimerExpire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrRouting::CancelPassiveTimer ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  destination,
uint8_t  segsLeft 
)
void ns3::dsr::DsrRouting::CancelRreqTimer ( Ipv4Address  dst,
bool  isRemove 
)

Cancel the route request timer.

Parameters
dstThe dst address of the route request timer
isRemovewhether to remove the route request entry or not

Definition at line 2896 of file dsr-routing.cc.

References m_addressReqTimer, m_nonPropReqTimer, m_rreqTable, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by RouteRequestTimerExpire(), and SendErrorRequest().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::CheckSendBuffer ( )

Check the send buffer of packets with route when send buffer timer expire.

When found a route and use it, UseExtends to the link cache

This will be priority 0

Todo:
New DsrNetworkQueueEntry

When found a route and use it, UseExtends to the link cache

Definition at line 831 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrSendBuffer::GetBuffer(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), GetPriority(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::Packet::GetSize(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::dsr::DsrRouteCacheEntry::GetVector(), ns3::Timer::IsSuspended(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, ns3::dsr::LinkKey::m_destination, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_ip, m_ipv4Route, m_linkAck, m_linkCnt, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::LinkKey::m_ourAdd, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_priorityQueue, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, m_sendBuffInterval, m_sendBuffTimer, ns3::dsr::LinkKey::m_source, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_INFO, NS_LOG_LOGIC(), PacketNewRoute(), ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ns3::Timer::Resume(), ns3::Simulator::Schedule(), ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), Scheduler(), SearchNextHop(), SendBuffTimerExpire(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::Timer::Suspend().

Referenced by SendBuffTimerExpire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::DeleteAllRoutesIncludeLink ( Ipv4Address  errorSrc,
Ipv4Address  unreachNode,
Ipv4Address  node 
)

functions used to direct to route cache

Definition at line 672 of file dsr-routing.cc.

References m_routeCache.

void ns3::dsr::DsrRouting::DoDispose ( void  )
protectedvirtual

Drop trace callback.

Reimplemented from ns3::Object.

Definition at line 549 of file dsr-routing.cc.

References ns3::Object::DoDispose(), m_ipv4, m_node, m_routeCache, third::mac, NS_LOG_FUNCTION_NOARGS, and third::wifi.

+ Here is the call graph for this function:

bool ns3::dsr::DsrRouting::FindSourceEntry ( Ipv4Address  src,
Ipv4Address  dst,
uint16_t  id 
)

functions used to direct to route cache

Definition at line 682 of file dsr-routing.cc.

References m_rreqTable.

void ns3::dsr::DsrRouting::ForwardErrPacket ( DsrOptionRerrUnreachHeader rerr,
DsrOptionSRHeader sourceRoute,
Ipv4Address  nextHop,
uint8_t  protocol,
Ptr< Ipv4Route route 
)
void ns3::dsr::DsrRouting::ForwardPacket ( Ptr< const Packet packet,
DsrOptionSRHeader sourceRoute,
Ipv4Header const &  ipv4Header,
Ipv4Address  source,
Ipv4Address  destination,
Ipv4Address  targetAddress,
uint8_t  protocol,
Ptr< Ipv4Route route 
)
IpL4Protocol::DownTargetCallback ns3::dsr::DsrRouting::GetDownTarget ( void  ) const
virtual

This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 case)

Returns
current Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 3512 of file dsr-routing.cc.

References m_downTarget.

IpL4Protocol::DownTargetCallback6 ns3::dsr::DsrRouting::GetDownTarget6 ( void  ) const
virtual

This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 case)

Returns
current Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 3518 of file dsr-routing.cc.

References NS_FATAL_ERROR.

std::vector< std::string > ns3::dsr::DsrRouting::GetElementsFromContext ( std::string  context)

Get the elements from the tracing context.

Parameters
contextcontext
Returns
the elements we are looking for

Definition at line 534 of file dsr-routing.cc.

Referenced by GetNetDeviceFromContext().

+ Here is the caller graph for this function:

uint16_t ns3::dsr::DsrRouting::GetIDfromIP ( Ipv4Address  address)

Get the node id from ip address.

Parameters
addressIPv4 address
Returns
the node id

Definition at line 777 of file dsr-routing.cc.

References first::address, ns3::NodeList::GetNNodes(), ns3::NodeList::GetNode(), and ns3::Object::GetObject().

Referenced by CheckSendBuffer(), ForwardErrPacket(), ForwardPacket(), PacketNewRoute(), SalvagePacket(), Send(), SendAck(), SendErrorRequest(), SendGratuitousReply(), SendInitialRequest(), SendPacketFromBuffer(), and SendUnreachError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ipv4Address ns3::dsr::DsrRouting::GetIPfromID ( uint16_t  id)

Get the ip address from id.

Parameters
idunique ID
Returns
the ip address for the id

Definition at line 793 of file dsr-routing.cc.

References ns3::NodeList::GetNode(), ns3::Object::GetObject(), and NS_LOG_DEBUG.

Referenced by PromiscReceive(), and Receive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ipv4Address ns3::dsr::DsrRouting::GetIPfromMAC ( Mac48Address  address)

Get the Ip address from mac address.

Parameters
addressMac48Address
Returns
the ip address

Definition at line 688 of file dsr-routing.cc.

References first::address, ns3::NodeList::GetNNodes(), ns3::NodeList::GetNode(), ns3::Object::GetObject(), and NS_LOG_FUNCTION.

Referenced by PromiscReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< NetDevice > ns3::dsr::DsrRouting::GetNetDeviceFromContext ( std::string  context)

Get the netdevice from the context.

Parameters
contextcontext
Returns
the netdevice we are looking for

Definition at line 522 of file dsr-routing.cc.

References ns3::Node::GetDevice(), GetElementsFromContext(), ns3::NodeList::GetNode(), and NS_ASSERT.

+ Here is the call graph for this function:

Ptr< Node > ns3::dsr::DsrRouting::GetNode ( void  ) const

Get the node.

Returns
the node

Definition at line 579 of file dsr-routing.cc.

References m_node, and NS_LOG_FUNCTION_NOARGS.

Referenced by Receive().

+ Here is the caller graph for this function:

Ptr< Node > ns3::dsr::DsrRouting::GetNodeWithAddress ( Ipv4Address  ipv4Address)

Get the node with give ip address.

Parameters
ipv4AddressIPv4 address
Returns
the node associated with the ip address

Definition at line 625 of file dsr-routing.cc.

References ns3::NodeList::GetNNodes(), ns3::NodeList::GetNode(), ns3::Object::GetObject(), and NS_LOG_FUNCTION.

Referenced by PromiscReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< dsr::DsrOptions > ns3::dsr::DsrRouting::GetOption ( int  optionNumber)

Get the option corresponding to optionNumber.

Parameters
optionNumberthe option number of the option to retrieve
Returns
a matching Dsr option

Definition at line 3529 of file dsr-routing.cc.

References m_options.

Referenced by PromiscReceive(), and Receive().

+ Here is the caller graph for this function:

Ptr< dsr::DsrPassiveBuffer > ns3::dsr::DsrRouting::GetPassiveBuffer ( ) const

Get the passive buffer.

Returns
the passive buffer

Definition at line 618 of file dsr-routing.cc.

References m_passiveBuffer.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint32_t ns3::dsr::DsrRouting::GetPriority ( DsrMessageType  messageType)

Set the priority of the packet in network queue.

Parameters
messageTypeMessage type
Returns
the priority value

Definition at line 809 of file dsr-routing.cc.

References ns3::dsr::DSR_CONTROL_PACKET.

Referenced by CheckSendBuffer(), ForwardErrPacket(), IncreaseRetransTimer(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), and SendUnreachError().

+ Here is the caller graph for this function:

int ns3::dsr::DsrRouting::GetProtocolNumber ( void  ) const
virtual

Get the dsr protocol number.

Returns
protocol number

Implements ns3::IpL4Protocol.

Definition at line 770 of file dsr-routing.cc.

References PROT_NUMBER.

Referenced by SendRealDown().

+ Here is the caller graph for this function:

Ptr< dsr::DsrRreqTable > ns3::dsr::DsrRouting::GetRequestTable ( ) const

Get the request table.

Returns
the request table

Definition at line 605 of file dsr-routing.cc.

References m_rreqTable.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Ptr< dsr::DsrRouteCache > ns3::dsr::DsrRouting::GetRouteCache ( ) const

Get the route cache.

Returns
the route cache

Definition at line 592 of file dsr-routing.cc.

References m_routeCache.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::IncreaseRetransTimer ( )

This function is called to increase the retransmission timer for data packet in the network queue.

Definition at line 1712 of file dsr-routing.cc.

References ns3::dsr::DSR_DATA_PACKET, GetPriority(), m_addressForwardTimer, m_priorityQueue, m_retransIncr, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by PriorityScheduler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::Insert ( Ptr< dsr::DsrOptions option)

Insert a new Dsr Option.

Parameters
optionthe option to insert

Definition at line 3524 of file dsr-routing.cc.

References m_options.

Referenced by DsrRouting().

+ Here is the caller graph for this function:

bool ns3::dsr::DsrRouting::IsLinkCache ( )

functions used to direct to route cache

Definition at line 642 of file dsr-routing.cc.

References m_routeCache.

void ns3::dsr::DsrRouting::LinkScheduleTimerExpire ( DsrMaintainBuffEntry mb,
uint8_t  protocol 
)
bool ns3::dsr::DsrRouting::LookupRoute ( Ipv4Address  id,
DsrRouteCacheEntry rt 
)

functions used to direct to route cache

Definition at line 652 of file dsr-routing.cc.

References m_routeCache.

void ns3::dsr::DsrRouting::NetworkScheduleTimerExpire ( DsrMaintainBuffEntry mb,
uint8_t  protocol 
)
void ns3::dsr::DsrRouting::NotifyNewAggregate ( void  )
protectedvirtual

Notify all Objects aggregated to this one of a new Object being aggregated.

This function must be implemented in the stack that needs to notify other stacks connected to the node of their presence in the node.

This method is invoked whenever two sets of Objects are aggregated together. It is invoked exactly once for each Object in both sets. This method can be overriden by subclasses who wish to be notified of aggregation events. These subclasses must chain up to their base class NotifyNewAggregate() method.

It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 397 of file dsr-routing.cc.

References ns3::Object::GetObject(), m_ip, m_ipv4, m_node, ns3::MakeCallback(), ns3::Object::NotifyNewAggregate(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), ns3::Ipv4L3Protocol::Send(), SetDownTarget(), SetNode(), and Start().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::PacketNewRoute ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  destination,
uint8_t  protocol 
)

When route vector corrupted, originate a new packet, normally not happening.

Parameters
packetto route
sourceaddress
destinationaddress
protocolnumber

When found a route and use it, UseExtends to the link cache

Definition at line 1145 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::DsrSendBuffer::Enqueue(), ns3::dsr::DsrMaintainBuffer::Enqueue(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Packet::GetUid(), ns3::dsr::DsrRouteCacheEntry::GetVector(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, m_addressReqTimer, ns3::dsr::LinkKey::m_destination, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_linkAck, m_linkCnt, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::NetworkKey::m_nextHop, m_nonPropReqTimer, ns3::dsr::LinkKey::m_ourAdd, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, m_sendBufferTimeout, ns3::dsr::LinkKey::m_source, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), SearchNextHop(), SendInitialRequest(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), and ns3::dsr::DsrFsHeader::SetSourceId().

Referenced by CheckSendBuffer(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), and SendUnreachError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrRouting::PassiveEntryCheck ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  destination,
uint8_t  segsLeft,
uint16_t  fragmentOffset,
uint16_t  identification,
bool  saveEntry 
)
void ns3::dsr::DsrRouting::PassiveScheduleTimerExpire ( DsrMaintainBuffEntry mb,
uint8_t  protocol 
)
void ns3::dsr::DsrRouting::PrintVector ( std::vector< Ipv4Address > &  vec)

Print the route vector.

Parameters
vecthe vector to print.

Definition at line 706 of file dsr-routing.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by CancelPacketTimerNextHop().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::PriorityScheduler ( uint32_t  priority,
bool  continueWithFirst 
)

This function is called to schedule sending packets from the network queue by priority.

Parameters
priorityschedule
continueWithFirstuse all priorities

Definition at line 1639 of file dsr-routing.cc.

References ns3::RandomVariableStream::GetInteger(), IncreaseRetransTimer(), m_numPriorityQueues, m_priorityQueue, m_uniformRandomVariable, ns3::MicroSeconds(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), ns3::Simulator::Schedule(), ns3::Seconds(), and SendRealDown().

Referenced by Scheduler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t ns3::dsr::DsrRouting::Process ( Ptr< Packet > &  packet,
Ipv4Header const &  ipv4Header,
Ipv4Address  dst,
uint8_t *  nextHeader,
uint8_t  protocol,
bool &  isDropped 
)

Process method Called from Ipv4L3Protocol::Receive.

Parameters
packetthe packet
ipv4HeaderIPv4 header of the packet
dstdestination address of the packet received (i.e. us)
nextHeaderthe next header
protocolthe protocol number
isDroppedif the packet must be dropped
Returns
the size processed
bool ns3::dsr::DsrRouting::PromiscReceive ( Ptr< NetDevice device,
Ptr< const Packet packet,
uint16_t  protocol,
const Address from,
const Address to,
NetDevice::PacketType  packetType 
)
private

Promiscuous receive data packets destined to some other node.

Parameters
deviceThe network device
packetData packet we just received
protocolThe protocol we receive, need to verify it is dsr protocol
fromThe from address we received the packet
toThe address this packet is destined for
packetTypeThe dsr packet type, 0 is for control packet, 1 for data packet
Returns
true if the packet was processed, false otherwise

This is the ip address we just received data packet from

Remember this is the entry for previous node

Get the previous node's maintenance buffer and passive ack

Definition at line 1043 of file dsr-routing.cc.

References ns3::Mac48Address::ConvertFrom(), ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::dsr::DsrFsHeader::GetDestId(), ns3::Ipv4Header::GetDestination(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIPfromID(), GetIPfromMAC(), ns3::dsr::DsrFsHeader::GetMessageType(), ns3::dsr::DsrFsHeader::GetNextHeader(), GetNodeWithAddress(), ns3::Object::GetObject(), GetOption(), ns3::Ipv4Header::GetProtocol(), ns3::Packet::GetSize(), ns3::Ipv4Header::GetSource(), ns3::dsr::DsrFsHeader::GetSourceId(), ns3::Packet::GetUid(), m_ipv4, m_mainAddress, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_INFO, ns3::NetDevice::PACKET_OTHERHOST, ns3::Ipv4L3Protocol::PROT_NUMBER, PROT_NUMBER, ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), and ns3::dsr::DsrMaintainBuffEntry::SetPacket().

Referenced by Start().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

enum IpL4Protocol::RxStatus ns3::dsr::DsrRouting::Receive ( Ptr< Packet p,
Ipv4Header const &  header,
Ptr< Ipv4Interface incomingInterface 
)
virtual
enum IpL4Protocol::RxStatus ns3::dsr::DsrRouting::Receive ( Ptr< Packet p,
Ipv6Header const &  header,
Ptr< Ipv6Interface incomingInterface 
)
virtual
Parameters
ppacket to forward up
headerIPv6 Header information
incomingInterfacethe Ipv6Interface on which the packet arrived
Returns
receive status

Called from lower-level layers to send the packet up in the stack. Not implemented (IPv6).

Implements ns3::IpL4Protocol.

Definition at line 3490 of file dsr-routing.cc.

References ns3::Ipv6Header::GetDestinationAddress(), ns3::Ipv6Header::GetSourceAddress(), NS_LOG_FUNCTION, and ns3::IpL4Protocol::RX_ENDPOINT_UNREACH.

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::RouteRequestTimerExpire ( Ptr< Packet packet,
std::vector< Ipv4Address address,
uint32_t  requestId,
uint8_t  protocol 
)
void ns3::dsr::DsrRouting::SalvagePacket ( Ptr< const Packet packet,
Ipv4Address  source,
Ipv4Address  dst,
uint8_t  protocol 
)
void ns3::dsr::DsrRouting::ScheduleCachedReply ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  destination,
Ptr< Ipv4Route route,
double  hops 
)

Schedule the cached reply to a random start time to avoid possible route reply storm.

Parameters
packetthe original packet
sourceIPv4 address of the source (i.e. request originator)
destinationIPv4 address of the destination
routeRoute
hopsnumber of hops

Definition at line 3237 of file dsr-routing.cc.

References ns3::UniformRandomVariable::GetValue(), m_nodeTraversalTime, m_uniformRandomVariable, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendReply().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::ScheduleInitialReply ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  nextHop,
Ptr< Ipv4Route route 
)

this is a generating the initial route reply from the destination address, a random delay time [0, m_broadcastJitter] is used before unicasting back the route reply packet

Parameters
packetthe original packet
sourceIPv4 address of the source (i.e. request originator)
nextHopIPv4 address of the next hop
routeRoute

Definition at line 3226 of file dsr-routing.cc.

References NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and SendReply().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::ScheduleInterRequest ( Ptr< Packet packet)

Schedule the intermediate route request.

Parameters
packetthe original packet

Definition at line 3120 of file dsr-routing.cc.

References ns3::RandomVariableStream::GetInteger(), m_broadcastJitter, m_mainAddress, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendRequest().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::ScheduleLinkPacketRetry ( DsrMaintainBuffEntry mb,
uint8_t  protocol 
)
void ns3::dsr::DsrRouting::Scheduler ( uint32_t  priority)

This function is called to schedule sending packets from the network queue.

Parameters
priorityfor sending

Definition at line 1632 of file dsr-routing.cc.

References NS_LOG_FUNCTION, and PriorityScheduler().

Referenced by CheckSendBuffer(), ForwardErrPacket(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), and SendUnreachError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::ScheduleRreqRetry ( Ptr< Packet packet,
std::vector< Ipv4Address address,
bool  nonProp,
uint32_t  requestId,
uint8_t  protocol 
)

Schedule the route request retry.

Parameters
packetthe original packet
addressList of IPv4 addresses
nonPropflag if RREQ is non-propagating
requestIdUnique request ID
protocolthe protocol number

Definition at line 2945 of file dsr-routing.cc.

References first::address, ns3::Timer::CANCEL_ON_DESTROY, ns3::Time::GetSeconds(), m_addressReqTimer, m_maxRequestPeriod, m_nonPropReqTimer, m_nonpropRequestTimeout, m_requestPeriod, m_rreqTable, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC(), and RouteRequestTimerExpire().

Referenced by RouteRequestTimerExpire(), SendErrorRequest(), and SendInitialRequest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ipv4Address ns3::dsr::DsrRouting::SearchNextHop ( Ipv4Address  ipv4Address,
std::vector< Ipv4Address > &  vec 
)

Get the next hop of the route.

Parameters
ipv4Address
vecRoute
Returns
the next hop address of the route

Definition at line 726 of file dsr-routing.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by AddRoute(), AddRoute_Link(), CheckSendBuffer(), PacketNewRoute(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), and SendUnreachError().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::Send ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  destination,
uint8_t  protocol,
Ptr< Ipv4Route route 
)

This function is called by higher layer protocol when sending packets.

Parameters
packetto send
sourceIP address
destinationIP address
protocolnumber
routeIP route

When found a route and use it, UseExtends to the link cache

Definition at line 1420 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::DsrSendBuffer::Enqueue(), ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrSendBuffer::Find(), GetIDfromIP(), ns3::RandomVariableStream::GetInteger(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::dsr::DsrRouteCacheEntry::GetVector(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, m_addressReqTimer, ns3::dsr::LinkKey::m_destination, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_downTarget, m_linkAck, m_linkCnt, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::NetworkKey::m_nextHop, m_nonPropReqTimer, ns3::dsr::LinkKey::m_ourAdd, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_routeCache, m_rreqTable, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, m_sendBufferTimeout, ns3::dsr::LinkKey::m_source, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, m_uniformRandomVariable, ns3::MilliSeconds(), ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), PacketNewRoute(), ns3::Simulator::Schedule(), ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), SearchNextHop(), SendInitialRequest(), SendPacketFromBuffer(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), and ns3::dsr::DsrFsHeader::SetSourceId().

Referenced by ns3::DsrHelper::Create().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendAck ( uint16_t  ackId,
Ipv4Address  destination,
Ipv4Address  realSrc,
Ipv4Address  realDst,
uint8_t  protocol,
Ptr< Ipv4Route route 
)

Send network layer acknowledgment back to the earlier hop to notify the receipt of data packet.

Parameters
ackIdACK ID
destinationIPv4 address of the immediate ACK receiver
realSrcIPv4 address of the real source
realDstIPv4 address of the real destination
protocolthe protocol number
routeRoute
Todo:
New DsrNetworkQueueEntry

Definition at line 3248 of file dsr-routing.cc.

References ns3::Packet::AddHeader(), ns3::dsr::DSR_CONTROL_PACKET, GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_downTarget, m_ip, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), Scheduler(), ns3::dsr::DsrOptionAckHeader::SetAckId(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrOptionAckHeader::SetRealDst(), and ns3::dsr::DsrOptionAckHeader::SetRealSrc().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::SendBuffTimerExpire ( )

The send buffer timer expire.

Definition at line 821 of file dsr-routing.cc.

References ns3::Timer::Cancel(), CheckSendBuffer(), ns3::Timer::IsRunning(), m_sendBuffInterval, m_sendBuffTimer, and ns3::Timer::Schedule().

Referenced by CheckSendBuffer(), and DsrRouting().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendErrorRequest ( DsrOptionRerrUnreachHeader rerr,
uint8_t  protocol 
)

Send the error request packet.

Parameters
rerrthe route error header
protocolthe protocol number

When found a route and use it, UseExtends to the link cache

Try to send out the packet from the buffer once we found one route

Definition at line 2791 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(), ns3::Packet::AddPacketTag(), first::address, CancelRreqTimer(), ns3::Packet::Copy(), ns3::dsr::DsrSendBuffer::Find(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_addressReqTimer, m_discoveryHopLimit, m_downTarget, m_mainAddress, m_nonPropReqTimer, m_requestId, m_routeCache, m_rreqTable, m_sendBuffer, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), PacketNewRoute(), ScheduleRreqRetry(), SearchNextHop(), SendPacketFromBuffer(), SendRequest(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::SocketIpTtlTag::SetTtl().

Referenced by SendUnreachError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendGratuitousReply ( Ipv4Address  replyTo,
Ipv4Address  replyFrom,
std::vector< Ipv4Address > &  nodeList,
uint8_t  protocol 
)

Send the gratuitous reply.

Parameters
replyToThe destination address to send the reply to
replyFromThe source address sending the reply
nodeListRoute
protocolthe protocol number

Push back the node addresses other than those between srcAddress and our own ip address

Definition at line 3132 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrGraReply::AddEntry(), ns3::Packet::AddHeader(), ns3::dsr::DsrGraReply::FindAndUpdate(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), m_finalRoute, m_graReply, m_gratReplyHoldoff, m_ipv4Route, m_mainAddress, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), SendReply(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionRrepHeader::SetNodesAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), and ns3::dsr::DsrFsHeader::SetSourceId().

+ Here is the call graph for this function:

void ns3::dsr::DsrRouting::SendPacket ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  nextHop,
uint8_t  protocol 
)

This function is called by when really sending out the packet.

Parameters
packetto send
sourceIP address
nextHopIP address
protocolnumber
Todo:
New DsrNetworkQueueEntry

Definition at line 1603 of file dsr-routing.cc.

References ns3::dsr::DSR_DATA_PACKET, GetPriority(), m_ip, m_ipv4Route, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), ns3::Ipv4Route::SetOutputDevice(), and SetRoute().

Referenced by ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), and SchedulePassivePacketRetry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendPacketFromBuffer ( DsrOptionSRHeader const &  sourceRoute,
Ipv4Address  nextHop,
uint8_t  protocol 
)

This function is responsible for sending out data packets when have route, if no route found, it will cache the packet and send out route requests.

Parameters
sourceRoutesource route
nextHopnext hop IP address
protocolnumber

When found a route and use it, UseExtends to the link cache

When found a route and use it, UseExtends to the link cache

Todo:
New DsrNetworkQueueEntry

Definition at line 1748 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::dsr::DsrSendBuffer::Dequeue(), ns3::dsr::DsrErrorBuffer::Dequeue(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrSendBuffer::Find(), ns3::dsr::DsrErrorBuffer::Find(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::RandomVariableStream::GetInteger(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst(), ns3::dsr::DsrSendBuffEntry::GetPacket(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), GetPriority(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::dsr::DsrErrorBuffer::GetSize(), ns3::Packet::GetSize(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, ns3::dsr::LinkKey::m_destination, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_downTarget, m_errorBuffer, m_ip, m_ipv4Route, m_linkAck, m_linkCnt, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::LinkKey::m_ourAdd, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_priorityQueue, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, ns3::dsr::LinkKey::m_source, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, m_uniformRandomVariable, ns3::MilliSeconds(), ns3::Simulator::Now(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ns3::Simulator::Schedule(), ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), Scheduler(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode().

Referenced by RouteRequestTimerExpire(), Send(), and SendErrorRequest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrRouting::SendRealDown ( DsrNetworkQueueEntry newEntry)

This function is called to send packets down stack.

Parameters
newEntryqueue entry
Returns
true if success

Definition at line 1736 of file dsr-routing.cc.

References ns3::Packet::Copy(), ns3::dsr::DsrNetworkQueueEntry::GetIpv4Route(), ns3::dsr::DsrNetworkQueueEntry::GetNextHopAddress(), ns3::dsr::DsrNetworkQueueEntry::GetPacket(), GetProtocolNumber(), ns3::dsr::DsrNetworkQueueEntry::GetSourceAddress(), m_downTarget, and NS_LOG_FUNCTION.

Referenced by PriorityScheduler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendReply ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  nextHop,
Ptr< Ipv4Route route 
)

Send the route reply back to the request originator with the cumulated route.

Parameters
packetthe original packet
sourceIPv4 address of the source (i.e. request originator)
nextHopIPv4 address of the next hop
routeRoute
Todo:
New DsrNetworkQueueEntry

Definition at line 3194 of file dsr-routing.cc.

References ns3::dsr::DSR_CONTROL_PACKET, GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_downTarget, m_ipv4, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), and ns3::Ipv4Route::SetOutputDevice().

Referenced by ScheduleCachedReply(), ScheduleInitialReply(), and SendGratuitousReply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendRequest ( Ptr< Packet packet,
Ipv4Address  source 
)

Forward the route request if the node is not the destination.

Parameters
packetthe original packet
sourceaddress
Todo:
New DsrNetworkQueueEntry

Definition at line 3091 of file dsr-routing.cc.

References ns3::dsr::DSR_CONTROL_PACKET, GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_broadcast, m_downTarget, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), and Scheduler().

Referenced by RouteRequestTimerExpire(), ScheduleInterRequest(), SendErrorRequest(), and SendInitialRequest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SendRerrWhenBreaksLinkToNextHop ( Ipv4Address  nextHop,
uint8_t  protocol 
)
private

Send the route error message when the link breaks to the next hop.

Parameters
nextHopnext hop address
protocolprotocol number
void ns3::dsr::DsrRouting::SendUnreachError ( Ipv4Address  unreachNode,
Ipv4Address  destination,
Ipv4Address  originalDst,
uint8_t  salvage,
uint8_t  protocol 
)

This function is responsible for sending error packets in case of break link to next hop.

Parameters
unreachNodeunreachable node
destinationaddress
originalDstaddress
salvagepacket flag
protocolnumber

When found a route and use it, UseExtends to the link cache

Todo:
New DsrNetworkQueueEntry

Definition at line 1264 of file dsr-routing.cc.

References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrErrorBuffer::Enqueue(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), GetPriority(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::dsr::DsrRouteCacheEntry::GetVector(), m_addressReqTimer, m_errorBuffer, m_ip, m_ipv4Route, m_mainAddress, m_nonPropReqTimer, m_priorityQueue, m_routeCache, m_sendBufferTimeout, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), PacketNewRoute(), Scheduler(), SearchNextHop(), SendErrorRequest(), SendInitialRequest(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode().

Referenced by CancelPacketTimerNextHop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SetDownTarget ( IpL4Protocol::DownTargetCallback  cb)
virtual

This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 case)

Parameters
cbcurrent Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 3499 of file dsr-routing.cc.

References m_downTarget.

Referenced by ns3::DsrHelper::Create(), and NotifyNewAggregate().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SetDownTarget6 ( IpL4Protocol::DownTargetCallback6  cb)
virtual

This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 case)

Parameters
cbcurrent Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 3505 of file dsr-routing.cc.

References NS_FATAL_ERROR.

void ns3::dsr::DsrRouting::SetNode ( Ptr< Node node)

Set the node.

Parameters
nodethe node to set

Definition at line 573 of file dsr-routing.cc.

References m_node.

Referenced by ns3::DsrMainHelper::Install(), and NotifyNewAggregate().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SetPassiveBuffer ( Ptr< dsr::DsrPassiveBuffer r)

Set the node.

Parameters
rthe passive buffer to set

Definition at line 611 of file dsr-routing.cc.

References m_passiveBuffer.

Referenced by GetTypeId(), and Start().

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SetRequestTable ( Ptr< dsr::DsrRreqTable r)

Set the node.

Parameters
rthe request table to set

Definition at line 598 of file dsr-routing.cc.

References m_rreqTable.

Referenced by GetTypeId(), and Start().

+ Here is the caller graph for this function:

Ptr< Ipv4Route > ns3::dsr::DsrRouting::SetRoute ( Ipv4Address  nextHop,
Ipv4Address  srcAddress 
)

Set the route to use for data packets, used by the option headers when sending data/control packets.

Parameters
nextHopnext hop IPv4 address
srcAddressIPv4 address of the source
Returns
the route

Definition at line 759 of file dsr-routing.cc.

References m_ipv4Route, NS_LOG_FUNCTION, ns3::Ipv4Route::SetDestination(), ns3::Ipv4Route::SetGateway(), and ns3::Ipv4Route::SetSource().

Referenced by CheckSendBuffer(), LinkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), RouteRequestTimerExpire(), SalvagePacket(), SendErrorRequest(), SendGratuitousReply(), SendPacket(), SendPacketFromBuffer(), and SendUnreachError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::dsr::DsrRouting::SetRouteCache ( Ptr< dsr::DsrRouteCache r)

Set the route cache.

Parameters
rthe route cache to set

Definition at line 585 of file dsr-routing.cc.

References m_routeCache.

Referenced by GetTypeId(), and Start().

+ Here is the caller graph for this function:

bool ns3::dsr::DsrRouting::UpdateRouteEntry ( Ipv4Address  dst)

functions used to direct to route cache

Definition at line 677 of file dsr-routing.cc.

References m_routeCache.

void ns3::dsr::DsrRouting::UseExtends ( DsrRouteCacheEntry::IP_VECTOR  rt)

functions used to direct to route cache

Definition at line 647 of file dsr-routing.cc.

References m_routeCache.

Member Data Documentation

uint16_t ns3::dsr::DsrRouting::m_ackId
private

The ack id assigned to each acknowledge.

Definition at line 748 of file dsr-routing.h.

Referenced by AddAckReqHeader(), and ForwardPacket().

std::vector<Ipv4Address> ns3::dsr::DsrRouting::m_addresses
private

The bind ipv4 addresses with next hop, src, destination address in sequence.

Definition at line 834 of file dsr-routing.h.

std::map<NetworkKey, uint32_t> ns3::dsr::DsrRouting::m_addressForwardCnt
private
std::map<NetworkKey, Timer> ns3::dsr::DsrRouting::m_addressForwardTimer
private

Map network key + forward timer.

Definition at line 804 of file dsr-routing.h.

Referenced by CancelNetworkPacketTimer(), IncreaseRetransTimer(), and ScheduleNetworkPacketRetry().

std::map<Ipv4Address, Timer> ns3::dsr::DsrRouting::m_addressReqTimer
private

Map IP address + RREQ timer.

Definition at line 800 of file dsr-routing.h.

Referenced by CancelRreqTimer(), PacketNewRoute(), ScheduleRreqRetry(), Send(), SendErrorRequest(), and SendUnreachError().

Time ns3::dsr::DsrRouting::m_blacklistTimeout
private

The black list time out.

Definition at line 756 of file dsr-routing.h.

Referenced by GetTypeId().

Ipv4Address ns3::dsr::DsrRouting::m_broadcast
private

The broadcast IP address.

Definition at line 758 of file dsr-routing.h.

Referenced by SendRequest(), and Start().

uint32_t ns3::dsr::DsrRouting::m_broadcastJitter
private

The max time to delay route request broadcast.

Definition at line 760 of file dsr-routing.h.

Referenced by GetTypeId(), and ScheduleInterRequest().

std::string ns3::dsr::DsrRouting::m_cacheType
private

The type of route cache.

Definition at line 780 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

std::vector<Ipv4Address> ns3::dsr::DsrRouting::m_clearList
private

The node that is clear to send packet to.

Definition at line 832 of file dsr-routing.h.

uint32_t ns3::dsr::DsrRouting::m_discoveryHopLimit
private

Maximum hops to go for route request.

Definition at line 704 of file dsr-routing.h.

Referenced by GetTypeId(), RouteRequestTimerExpire(), SendErrorRequest(), and Start().

TracedCallback<Ptr<const Packet> > ns3::dsr::DsrRouting::m_dropTrace
protected

The trace for drop, receive and send data packets.

packet drop trace callback

Definition at line 654 of file dsr-routing.h.

Referenced by GetTypeId(), and Receive().

DsrErrorBuffer ns3::dsr::DsrRouting::m_errorBuffer
private

The error buffer to save the error messages.

Definition at line 730 of file dsr-routing.h.

Referenced by AddRoute(), AddRoute_Link(), SendPacketFromBuffer(), SendUnreachError(), and Start().

std::vector<Ipv4Address> ns3::dsr::DsrRouting::m_finalRoute
private

The route cache.

Definition at line 798 of file dsr-routing.h.

Referenced by SendGratuitousReply().

DsrGraReply ns3::dsr::DsrRouting::m_graReply
private

The gratuitous route reply.

Definition at line 828 of file dsr-routing.h.

Referenced by SendGratuitousReply(), and Start().

uint32_t ns3::dsr::DsrRouting::m_graReplyTableSize
private

Set the gratuitous reply table size.

Definition at line 778 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_gratReplyHoldoff
private

The max gratuitous reply hold off time.

Definition at line 774 of file dsr-routing.h.

Referenced by GetTypeId(), and SendGratuitousReply().

Time ns3::dsr::DsrRouting::m_initStability
private

The initial stability value for link cache.

Definition at line 788 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Ptr<Ipv4> ns3::dsr::DsrRouting::m_ip
private
Ptr<Ipv4L3Protocol> ns3::dsr::DsrRouting::m_ipv4
private

Ipv4l3Protocol.

Definition at line 686 of file dsr-routing.h.

Referenced by DoDispose(), NotifyNewAggregate(), PromiscReceive(), SendReply(), and Start().

Ptr<Ipv4Route> ns3::dsr::DsrRouting::m_ipv4Route
private
bool ns3::dsr::DsrRouting::m_linkAck
private

define if we use link acknowledgement or not

Definition at line 824 of file dsr-routing.h.

Referenced by CheckSendBuffer(), ForwardPacket(), GetTypeId(), PacketNewRoute(), Send(), and SendPacketFromBuffer().

Time ns3::dsr::DsrRouting::m_linkAckTimeout
private

The timeout value for link acknowledge.

Definition at line 766 of file dsr-routing.h.

Referenced by GetTypeId(), and ScheduleLinkPacketRetry().

std::map<LinkKey, Timer> ns3::dsr::DsrRouting::m_linkAckTimer
private

The timer for link acknowledgment.

Definition at line 814 of file dsr-routing.h.

Referenced by CancelLinkPacketTimer(), LinkScheduleTimerExpire(), and ScheduleLinkPacketRetry().

std::map<LinkKey, uint32_t> ns3::dsr::DsrRouting::m_linkCnt
private

Map packet key + link forward counts.

Definition at line 812 of file dsr-routing.h.

Referenced by CancelLinkPacketTimer(), CheckSendBuffer(), ForwardPacket(), LinkScheduleTimerExpire(), PacketNewRoute(), Send(), and SendPacketFromBuffer().

uint32_t ns3::dsr::DsrRouting::m_linkRetries
private

of retries have been sent for link acknowledgment

Definition at line 716 of file dsr-routing.h.

Referenced by LinkScheduleTimerExpire().

std::map<std::string, uint32_t> ns3::dsr::DsrRouting::m_macToNodeIdMap
private

The map of mac address to node id.

Definition at line 836 of file dsr-routing.h.

uint32_t ns3::dsr::DsrRouting::m_maxCacheLen
private

Max # of cache entries for route cache.

Definition at line 736 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_maxCacheTime
private

Max time for caching the route cache entry.

Definition at line 738 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

uint32_t ns3::dsr::DsrRouting::m_maxEntriesEachDst
private

Max number of route entries to save for each destination.

Definition at line 742 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

uint32_t ns3::dsr::DsrRouting::m_maxMaintainLen
private

Max # of entries for maintainance buffer.

Definition at line 732 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_maxMaintainTime
private

Time out for maintainance buffer.

Definition at line 734 of file dsr-routing.h.

Referenced by CheckSendBuffer(), ForwardPacket(), GetTypeId(), PacketNewRoute(), ScheduleNetworkPacketRetry(), Send(), SendPacketFromBuffer(), and Start().

uint32_t ns3::dsr::DsrRouting::m_maxMaintRexmt
private

Maximum number of retransmissions of data packets.

Definition at line 720 of file dsr-routing.h.

Referenced by GetTypeId(), and NetworkScheduleTimerExpire().

Time ns3::dsr::DsrRouting::m_maxNetworkDelay
private

Maximum network delay.

Definition at line 702 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

uint32_t ns3::dsr::DsrRouting::m_maxNetworkSize
private

Maximum network queue size.

Definition at line 700 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_maxRequestPeriod
private

The max request period.

Definition at line 776 of file dsr-routing.h.

Referenced by GetTypeId(), and ScheduleRreqRetry().

uint32_t ns3::dsr::DsrRouting::m_maxRreqId
private

The max number of request ids for a single destination.

Definition at line 754 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_maxRreqTime
private

Max time for caching the route request entry.

Definition at line 740 of file dsr-routing.h.

uint8_t ns3::dsr::DsrRouting::m_maxSalvageCount
private

Maximum # times to salvage a packet.

Definition at line 706 of file dsr-routing.h.

Referenced by GetTypeId(), and SalvagePacket().

uint32_t ns3::dsr::DsrRouting::m_maxSendBuffLen
private

The maximum number of packets that we allow a routing protocol to buffer.

Definition at line 724 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_minLifeTime
private

The min life time.

Definition at line 790 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

DsrNetworkQueue ns3::dsr::DsrRouting::m_networkQueue
private

The network queue.

Definition at line 830 of file dsr-routing.h.

Ptr<Node> ns3::dsr::DsrRouting::m_node
private

The node ptr.

Definition at line 692 of file dsr-routing.h.

Referenced by DoDispose(), GetNode(), NotifyNewAggregate(), Receive(), and SetNode().

Time ns3::dsr::DsrRouting::m_nodeTraversalTime
private

Time estimated for packet to travel between two nodes.

Definition at line 722 of file dsr-routing.h.

Referenced by GetTypeId(), ScheduleCachedReply(), and ScheduleNetworkPacketRetry().

std::map<Ipv4Address, Timer> ns3::dsr::DsrRouting::m_nonPropReqTimer
private

Map IP address + RREQ timer.

Definition at line 802 of file dsr-routing.h.

Referenced by CancelRreqTimer(), PacketNewRoute(), ScheduleRreqRetry(), Send(), SendErrorRequest(), and SendUnreachError().

Time ns3::dsr::DsrRouting::m_nonpropRequestTimeout
private

The non-propagation request timeout.

Definition at line 710 of file dsr-routing.h.

Referenced by GetTypeId(), and ScheduleRreqRetry().

uint32_t ns3::dsr::DsrRouting::m_numPriorityQueues
private

The number of priority queues used.

Definition at line 822 of file dsr-routing.h.

Referenced by GetTypeId(), PriorityScheduler(), and Start().

DsrOptionList_t ns3::dsr::DsrRouting::m_options
private

List of DSR Options supported.

Definition at line 684 of file dsr-routing.h.

Referenced by GetOption(), and Insert().

Time ns3::dsr::DsrRouting::m_passiveAckTimeout
private

The timeout value for passive acknowledge.

Definition at line 762 of file dsr-routing.h.

Referenced by GetTypeId(), and SchedulePassivePacketRetry().

std::map<PassiveKey, Timer> ns3::dsr::DsrRouting::m_passiveAckTimer
private

The timer for passive acknowledgment.

Definition at line 810 of file dsr-routing.h.

Referenced by CancelPassivePacketTimer(), PassiveScheduleTimerExpire(), and SchedulePassivePacketRetry().

Ptr<dsr::DsrPassiveBuffer> ns3::dsr::DsrRouting::m_passiveBuffer
private

A "drop-front" queue used by the routing layer to cache route request sent.

Definition at line 820 of file dsr-routing.h.

Referenced by GetPassiveBuffer(), PassiveEntryCheck(), and SetPassiveBuffer().

std::map<PassiveKey, uint32_t> ns3::dsr::DsrRouting::m_passiveCnt
private

Map packet key + passive forward counts.

Definition at line 808 of file dsr-routing.h.

Referenced by CancelPassivePacketTimer(), CheckSendBuffer(), ForwardPacket(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), and SendPacketFromBuffer().

uint32_t ns3::dsr::DsrRouting::m_passiveRetries
private

of retries have been sent for passive acknowledgment

Definition at line 714 of file dsr-routing.h.

Referenced by PassiveScheduleTimerExpire().

std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> > ns3::dsr::DsrRouting::m_priorityQueue
private
uint32_t ns3::dsr::DsrRouting::m_requestId
private

The id assigned to each route request.

Definition at line 746 of file dsr-routing.h.

Referenced by SendErrorRequest(), and SendInitialRequest().

Time ns3::dsr::DsrRouting::m_requestPeriod
private

The base time interval between route requests.

Definition at line 708 of file dsr-routing.h.

Referenced by GetTypeId(), and ScheduleRreqRetry().

uint32_t ns3::dsr::DsrRouting::m_requestTableIds
private

The request table identifiers.

Definition at line 752 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

uint32_t ns3::dsr::DsrRouting::m_requestTableSize
private

The max size of the request table size.

Definition at line 750 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

Time ns3::dsr::DsrRouting::m_retransIncr
private

the increase time for retransmission timer when face network congestion

Definition at line 796 of file dsr-routing.h.

Referenced by GetTypeId(), and IncreaseRetransTimer().

std::string ns3::dsr::DsrRouting::m_routeSortType
private

The type of route sort methods.

Definition at line 782 of file dsr-routing.h.

uint32_t ns3::dsr::DsrRouting::m_rreqRetries
private

Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route.

Definition at line 718 of file dsr-routing.h.

Referenced by GetTypeId(), and RouteRequestTimerExpire().

Ptr<dsr::DsrRreqTable> ns3::dsr::DsrRouting::m_rreqTable
private

A "drop-front" queue used by the routing layer to cache route request sent.

Definition at line 818 of file dsr-routing.h.

Referenced by CancelRreqTimer(), FindSourceEntry(), GetRequestTable(), Receive(), RouteRequestTimerExpire(), ScheduleRreqRetry(), Send(), SendErrorRequest(), SendInitialRequest(), and SetRequestTable().

DsrSendBuffer ns3::dsr::DsrRouting::m_sendBuffer
private
Time ns3::dsr::DsrRouting::m_sendBufferTimeout
private

The maximum period of time that a routing protocol is allowed to buffer a packet for.

Definition at line 726 of file dsr-routing.h.

Referenced by GetTypeId(), PacketNewRoute(), Send(), SendUnreachError(), and Start().

Time ns3::dsr::DsrRouting::m_sendBuffInterval
private

how often to check send buffer

Definition at line 772 of file dsr-routing.h.

Referenced by CheckSendBuffer(), GetTypeId(), and SendBuffTimerExpire().

Timer ns3::dsr::DsrRouting::m_sendBuffTimer
private

The send buffer timer.

Definition at line 770 of file dsr-routing.h.

Referenced by CheckSendBuffer(), DsrRouting(), and SendBuffTimerExpire().

uint32_t ns3::dsr::DsrRouting::m_sendRetries
private

of retries have been sent for network acknowledgment

Definition at line 712 of file dsr-routing.h.

Referenced by NetworkScheduleTimerExpire(), and ScheduleNetworkPacketRetry().

uint32_t ns3::dsr::DsrRouting::m_stabilityDecrFactor
private

The initial decrease factor for link cache.

Definition at line 784 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

uint32_t ns3::dsr::DsrRouting::m_stabilityIncrFactor
private

The initial increase factor for link cache.

Definition at line 786 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

bool ns3::dsr::DsrRouting::m_subRoute
private

Whether to save sub route or not.

Definition at line 794 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

uint32_t ns3::dsr::DsrRouting::m_tryLinkAcks
private

Maximum number of packet transmission using link acknowledgment.

Definition at line 768 of file dsr-routing.h.

Referenced by GetTypeId(), and LinkScheduleTimerExpire().

uint32_t ns3::dsr::DsrRouting::m_tryPassiveAcks
private

Maximum number of packet transmission using passive acknowledgment.

Definition at line 764 of file dsr-routing.h.

Referenced by GetTypeId(), and PassiveScheduleTimerExpire().

TracedCallback<const DsrOptionSRHeader &> ns3::dsr::DsrRouting::m_txPacketTrace
protected

packet trace callback

Definition at line 655 of file dsr-routing.h.

Referenced by GetTypeId().

Ptr<UniformRandomVariable> ns3::dsr::DsrRouting::m_uniformRandomVariable
private
Time ns3::dsr::DsrRouting::m_useExtends
private

The use extension of the life time for link cache.

Definition at line 792 of file dsr-routing.h.

Referenced by GetTypeId(), and Start().

const uint8_t ns3::dsr::DsrRouting::PROT_NUMBER = 48
static

Define the dsr protocol number.

Definition at line 106 of file dsr-routing.h.

Referenced by GetProtocolNumber(), and PromiscReceive().

uint8_t ns3::dsr::DsrRouting::segsLeft
private

The segment left value from SR header.

Definition at line 696 of file dsr-routing.h.


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