Dsr Routing base. More...
#include "dsr-routing.h"
Public Member Functions | |
DsrRouting () | |
Constructor. | |
~DsrRouting () override | |
Destructor. | |
uint16_t | AddAckReqHeader (Ptr< Packet > &packet, Ipv4Address nextHop) |
This function is called to add ack request header for network acknowledgement. | |
bool | AddRoute (DsrRouteCacheEntry &rt) |
Add route cache entry if it doesn't yet exist in route cache See also DsrRouteCache::AddRoute. | |
bool | AddRoute_Link (DsrRouteCacheEntry::IP_VECTOR nodelist, Ipv4Address source) |
dd route link to cache See also DsrRouteCache::AddRoute_Link | |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. | |
void | CallCancelPacketTimer (uint16_t ackId, const Ipv4Header &ipv4Header, Ipv4Address realSrc, Ipv4Address realDst) |
Call the cancel packet retransmission timer function. | |
void | CancelLinkPacketTimer (DsrMaintainBuffEntry &mb) |
Cancel the link packet retransmission timer for a specific maintenance entry. | |
void | CancelNetworkPacketTimer (DsrMaintainBuffEntry &mb) |
Cancel the network packet retransmission timer for a specific maintenance entry. | |
void | CancelPacketAllTimer (DsrMaintainBuffEntry &mb) |
Cancel all the packet timers. | |
void | CancelPacketTimerNextHop (Ipv4Address nextHop, uint8_t protocol) |
Cancel the packet retransmission timer for a all maintenance entries with nextHop address. | |
void | CancelPassivePacketTimer (DsrMaintainBuffEntry &mb) |
Cancel the passive packet retransmission timer for a specific maintenance entry. | |
bool | CancelPassiveTimer (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t segsLeft) |
Cancel the passive timer. | |
void | CancelRreqTimer (Ipv4Address dst, bool isRemove) |
Cancel the route request timer. | |
void | CheckSendBuffer () |
Check the send buffer of packets with route when send buffer timer expire. | |
void | DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node) |
Delete all the routes which includes the link from next hop address that has just been notified as unreachable. | |
bool | FindSourceEntry (Ipv4Address src, Ipv4Address dst, uint16_t id) |
Find the source request entry in the route request queue, return false if not found. | |
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. | |
void | ForwardPacket (Ptr< const Packet > packet, DsrOptionSRHeader &sourceRoute, const Ipv4Header &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. | |
IpL4Protocol::DownTargetCallback | GetDownTarget () const override |
This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 case) | |
IpL4Protocol::DownTargetCallback6 | GetDownTarget6 () const override |
This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 case) | |
std::vector< std::string > | GetElementsFromContext (std::string context) |
Get the elements from the tracing context. | |
uint16_t | GetIDfromIP (Ipv4Address address) |
Get the node id from ip address. | |
Ipv4Address | GetIPfromID (uint16_t id) |
Get the ip address from id. | |
Ipv4Address | GetIPfromMAC (Mac48Address address) |
Get the Ip address from mac address. | |
Ptr< NetDevice > | GetNetDeviceFromContext (std::string context) |
Get the netdevice from the context. | |
Ptr< Node > | GetNode () const |
Get the node. | |
Ptr< Node > | GetNodeWithAddress (Ipv4Address ipv4Address) |
Get the node with give ip address. | |
Ptr< dsr::DsrOptions > | GetOption (int optionNumber) |
Get the option corresponding to optionNumber. | |
Ptr< dsr::DsrPassiveBuffer > | GetPassiveBuffer () const |
Get the passive buffer. | |
uint32_t | GetPriority (DsrMessageType messageType) |
Set the priority of the packet in network queue. | |
int | GetProtocolNumber () const override |
Get the dsr protocol number. | |
Ptr< dsr::DsrRreqTable > | GetRequestTable () const |
Get the request table. | |
Ptr< dsr::DsrRouteCache > | GetRouteCache () const |
Get the route cache. | |
void | IncreaseRetransTimer () |
This function is called to increase the retransmission timer for data packet in the network queue. | |
void | Insert (Ptr< dsr::DsrOptions > option) |
Insert a new Dsr Option. | |
bool | IsLinkCache () |
Checks if the link is cached in the route cache See also DsrRouteCache::IsLinkCache. | |
void | LinkScheduleTimerExpire (DsrMaintainBuffEntry &mb, uint8_t protocol) |
This function deals with packet retransmission timer expire using link acknowledgment. | |
bool | LookupRoute (Ipv4Address id, DsrRouteCacheEntry &rt) |
Lookup route cache entry with destination address dst See also DsrRouteCache::LookupRoute. | |
void | NetworkScheduleTimerExpire (DsrMaintainBuffEntry &mb, uint8_t protocol) |
This function deals with packet retransmission timer expire using network acknowledgment. | |
void | PacketNewRoute (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol) |
When route vector corrupted, originate a new packet, normally not happening. | |
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. | |
void | PassiveScheduleTimerExpire (DsrMaintainBuffEntry &mb, uint8_t protocol) |
This function deals with packet retransmission timer expire using passive acknowledgment. | |
void | PrintVector (std::vector< Ipv4Address > &vec) |
Print the route vector. | |
void | PriorityScheduler (uint32_t priority, bool continueWithFirst) |
This function is called to schedule sending packets from the network queue by priority. | |
uint8_t | Process (Ptr< Packet > &packet, const Ipv4Header &ipv4Header, Ipv4Address dst, uint8_t *nextHeader, uint8_t protocol, bool &isDropped) |
Process method Called from Ipv4L3Protocol::Receive. | |
IpL4Protocol::RxStatus | Receive (Ptr< Packet > p, const Ipv4Header &header, Ptr< Ipv4Interface > incomingInterface) override |
IpL4Protocol::RxStatus | Receive (Ptr< Packet > p, const Ipv6Header &header, Ptr< Ipv6Interface > incomingInterface) override |
void | RouteRequestTimerExpire (Ptr< Packet > packet, std::vector< Ipv4Address > address, uint32_t requestId, uint8_t protocol) |
Handle route discovery timer. | |
void | SalvagePacket (Ptr< const Packet > packet, Ipv4Address source, Ipv4Address dst, uint8_t protocol) |
Salvage the packet which has been transmitted for 3 times. | |
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. | |
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 | |
void | ScheduleInterRequest (Ptr< Packet > packet) |
Schedule the intermediate route request. | |
void | ScheduleLinkPacketRetry (DsrMaintainBuffEntry &mb, uint8_t protocol) |
Schedule the packet retransmission based on link-layer acknowledgment. | |
void | ScheduleNetworkPacketRetry (DsrMaintainBuffEntry &mb, bool isFirst, uint8_t protocol) |
Schedule the packet retransmission based on network layer acknowledgment. | |
void | SchedulePassivePacketRetry (DsrMaintainBuffEntry &mb, uint8_t protocol) |
Schedule the packet retransmission based on passive acknowledgment. | |
void | Scheduler (uint32_t priority) |
This function is called to schedule sending packets from the network queue. | |
void | ScheduleRreqRetry (Ptr< Packet > packet, std::vector< Ipv4Address > address, bool nonProp, uint32_t requestId, uint8_t protocol) |
Schedule the route request retry. | |
Ipv4Address | SearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec) |
Get the next hop of the route. | |
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. | |
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. | |
void | SendBuffTimerExpire () |
The send buffer timer expire. | |
void | SendErrorRequest (DsrOptionRerrUnreachHeader &rerr, uint8_t protocol) |
Send the error request packet. | |
void | SendGratuitousReply (Ipv4Address replyTo, Ipv4Address replyFrom, std::vector< Ipv4Address > &nodeList, uint8_t protocol) |
Send the gratuitous reply. | |
void | SendInitialRequest (Ipv4Address source, Ipv4Address destination, uint8_t protocol) |
Broadcast the route request packet in subnet. | |
void | SendPacket (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, uint8_t protocol) |
This function is called by when really sending out the packet. | |
void | SendPacketFromBuffer (const DsrOptionSRHeader &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. | |
bool | SendRealDown (DsrNetworkQueueEntry &newEntry) |
This function is called to send packets down stack. | |
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. | |
void | SendRequest (Ptr< Packet > packet, Ipv4Address source) |
Forward the route request if the node is not the destination. | |
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. | |
void | SetDownTarget (IpL4Protocol::DownTargetCallback callback) override |
This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 case) | |
void | SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback) override |
This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 case) | |
void | SetNode (Ptr< Node > node) |
Set the node. | |
void | SetPassiveBuffer (Ptr< dsr::DsrPassiveBuffer > r) |
Set the node. | |
void | SetRequestTable (Ptr< dsr::DsrRreqTable > r) |
Set the node. | |
Ptr< Ipv4Route > | SetRoute (Ipv4Address nextHop, Ipv4Address srcAddress) |
Set the route to use for data packets, used by the option headers when sending data/control packets. | |
void | SetRouteCache (Ptr< dsr::DsrRouteCache > r) |
Set the route cache. | |
bool | UpdateRouteEntry (Ipv4Address dst) |
Update route cache entry if it has been recently used and successfully delivered the data packet. | |
void | UseExtends (DsrRouteCacheEntry::IP_VECTOR rt) |
Extends the lifetime of a route cache entry. | |
Public Member Functions inherited from ns3::IpL4Protocol | |
~IpL4Protocol () override | |
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. | |
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. | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
void | UnidirectionalAggregateObject (Ptr< Object > other) |
Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type identificator. | |
Static Public Member Functions inherited from ns3::IpL4Protocol | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Attributes | |
static const uint8_t | PROT_NUMBER = 48 |
Define the dsr protocol number. | |
Protected Member Functions | |
void | DoDispose () override |
Drop trace callback. | |
void | NotifyNewAggregate () override |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Protected Attributes | |
TracedCallback< Ptr< const Packet > > | m_dropTrace |
The trace for drop, receive and send data packets. | |
TracedCallback< const DsrOptionSRHeader & > | m_txPacketTrace |
packet trace callback | |
Private Types | |
typedef std::list< Ptr< DsrOptions > > | DsrOptionList_t |
Define the list to hold DSR options. | |
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. | |
void | SendRerrWhenBreaksLinkToNextHop (Ipv4Address nextHop, uint8_t protocol) |
Send the route error message when the link breaks to the next hop. | |
void | Start () |
Private Attributes | |
uint16_t | m_ackId |
The ack id assigned to each acknowledge. | |
std::vector< Ipv4Address > | m_addresses |
The bind ipv4 addresses with next hop, src, destination address in sequence. | |
std::map< NetworkKey, uint32_t > | m_addressForwardCnt |
Map network key + forward counts. | |
std::map< NetworkKey, Timer > | m_addressForwardTimer |
Map network key + forward timer. | |
std::map< Ipv4Address, Timer > | m_addressReqTimer |
Map IP address + RREQ timer. | |
Time | m_blacklistTimeout |
The black list time out. | |
Ipv4Address | m_broadcast |
The broadcast IP address. | |
uint32_t | m_broadcastJitter |
The max time to delay route request broadcast. | |
std::string | m_cacheType |
The type of route cache. | |
std::vector< Ipv4Address > | m_clearList |
The node that is clear to send packet to. | |
uint32_t | m_discoveryHopLimit |
Maximum hops to go for route request. | |
IpL4Protocol::DownTargetCallback | m_downTarget |
The callback for down layer. | |
DsrErrorBuffer | m_errorBuffer |
The error buffer to save the error messages. | |
std::vector< Ipv4Address > | m_finalRoute |
The route cache. | |
DsrGraReply | m_graReply |
The gratuitous route reply. | |
uint32_t | m_graReplyTableSize |
Set the gratuitous reply table size. | |
Time | m_gratReplyHoldoff |
The max gratuitous reply hold off time. | |
Time | m_initStability |
The initial stability value for link cache. | |
Ptr< Ipv4 > | m_ip |
The ip ptr. | |
Ptr< Ipv4L3Protocol > | m_ipv4 |
Ipv4l3Protocol. | |
Ptr< Ipv4Route > | m_ipv4Route |
Ipv4 Route. | |
bool | m_linkAck |
define if we use link acknowledgement or not | |
Time | m_linkAckTimeout |
The timeout value for link acknowledge. | |
std::map< LinkKey, Timer > | m_linkAckTimer |
The timer for link acknowledgment. | |
std::map< LinkKey, uint32_t > | m_linkCnt |
Map packet key + link forward counts. | |
uint32_t | m_linkRetries |
std::map< std::string, uint32_t > | m_macToNodeIdMap |
The map of mac address to node id. | |
Ipv4Address | m_mainAddress |
Our own Ip address. | |
DsrMaintainBuffer | m_maintainBuffer |
The declaration of maintain buffer. | |
uint32_t | m_maxCacheLen |
Max # of cache entries for route cache. | |
Time | m_maxCacheTime |
Max time for caching the route cache entry. | |
uint32_t | m_maxEntriesEachDst |
Max number of route entries to save for each destination. | |
uint32_t | m_maxMaintainLen |
Max # of entries for maintenance buffer. | |
Time | m_maxMaintainTime |
Time out for maintenance buffer. | |
uint32_t | m_maxMaintRexmt |
Maximum number of retransmissions of data packets. | |
Time | m_maxNetworkDelay |
Maximum network delay. | |
uint32_t | m_maxNetworkSize |
Maximum network queue size. | |
Time | m_maxRequestPeriod |
The max request period. | |
uint32_t | m_maxRreqId |
The max number of request ids for a single destination. | |
Time | m_maxRreqTime |
Max time for caching the route request entry. | |
uint8_t | m_maxSalvageCount |
Maximum # times to salvage a packet. | |
uint32_t | m_maxSendBuffLen |
The maximum number of packets that we allow a routing protocol to buffer. | |
Time | m_minLifeTime |
The min life time. | |
DsrNetworkQueue | m_networkQueue |
The network queue. | |
Ptr< Node > | m_node |
The node ptr. | |
Time | m_nodeTraversalTime |
Time estimated for packet to travel between two nodes. | |
std::map< Ipv4Address, Timer > | m_nonPropReqTimer |
Map IP address + RREQ timer. | |
Time | m_nonpropRequestTimeout |
The non-propagation request timeout. | |
uint32_t | m_numPriorityQueues |
The number of priority queues used. | |
DsrOptionList_t | m_options |
List of DSR Options supported. | |
Time | m_passiveAckTimeout |
The timeout value for passive acknowledge. | |
std::map< PassiveKey, Timer > | m_passiveAckTimer |
The timer for passive acknowledgment. | |
Ptr< dsr::DsrPassiveBuffer > | m_passiveBuffer |
A "drop-front" queue used by the routing layer to cache route request sent. | |
std::map< PassiveKey, uint32_t > | m_passiveCnt |
Map packet key + passive forward counts. | |
uint32_t | m_passiveRetries |
std::map< uint32_t, Ptr< dsr::DsrNetworkQueue > > | m_priorityQueue |
priority queues | |
uint32_t | m_requestId |
The id assigned to each route request. | |
Time | m_requestPeriod |
The base time interval between route requests. | |
uint32_t | m_requestTableIds |
The request table identifiers. | |
uint32_t | m_requestTableSize |
The max size of the request table size. | |
Time | m_retransIncr |
the increase time for retransmission timer when face network congestion | |
Ptr< dsr::DsrRouteCache > | m_routeCache |
A "drop-front" queue used by the routing layer to cache routes found. | |
std::string | m_routeSortType |
The type of route sort methods. | |
uint32_t | m_rreqRetries |
Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route. | |
Ptr< dsr::DsrRreqTable > | m_rreqTable |
A "drop-front" queue used by the routing layer to cache route request sent. | |
DsrSendBuffer | m_sendBuffer |
The send buffer. | |
Time | m_sendBufferTimeout |
The maximum period of time that a routing protocol is allowed to buffer a packet for. | |
Time | m_sendBuffInterval |
how often to check send buffer | |
Timer | m_sendBuffTimer |
The send buffer timer. | |
uint32_t | m_sendRetries |
uint32_t | m_stabilityDecrFactor |
The initial decrease factor for link cache. | |
uint32_t | m_stabilityIncrFactor |
The initial increase factor for link cache. | |
bool | m_subRoute |
Whether to save sub route or not. | |
uint32_t | m_tryLinkAcks |
Maximum number of packet transmission using link acknowledgment. | |
uint32_t | m_tryPassiveAcks |
Maximum number of packet transmission using passive acknowledgment. | |
Ptr< UniformRandomVariable > | m_uniformRandomVariable |
Provides uniform random variables. | |
Time | m_useExtends |
The use extension of the life time for link cache. | |
uint8_t | segsLeft |
The segment left value from SR header. | |
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 | |
typedef Callback< void, Ptr< Packet >, Ipv6Address, Ipv6Address, uint8_t, Ptr< Ipv6Route > > | DownTargetCallback6 |
callback to send packets over IPv6 | |
enum | RxStatus { RX_OK , RX_CSUM_FAILED , RX_ENDPOINT_CLOSED , RX_ENDPOINT_UNREACH } |
Rx status codes. More... | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Dsr Routing base.
ns3::dsr::DsrRouting is accessible through the following paths with Config::Set and Config::Connect:
Time
-9.22337e+18ns:+9.22337e+18ns std::string
Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Time
-9.22337e+18ns:+9.22337e+18ns Group: Dsr
Size of this type is 1520 bytes (on a 64-bit architecture).
Definition at line 86 of file dsr-routing.h.
|
private |
Define the list to hold DSR options.
Definition at line 773 of file dsr-routing.h.
ns3::dsr::DsrRouting::DsrRouting | ( | ) |
Constructor.
Definition at line 353 of file dsr-routing.cc.
References ns3::CreateObject(), Insert(), m_sendBuffTimer, m_uniformRandomVariable, NS_LOG_FUNCTION_NOARGS, ns3::Timer::Schedule(), ns3::Seconds(), SendBuffTimerExpire(), and ns3::Timer::SetFunction().
|
override |
uint16_t ns3::dsr::DsrRouting::AddAckReqHeader | ( | Ptr< Packet > & | packet, |
Ipv4Address | nextHop ) |
This function is called to add ack request header for network acknowledgement.
packet | for ack req |
nextHop | IP address of the next hop |
Definition at line 1674 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrFsHeader::GetDestId(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrFsHeader::GetNextHeader(), ns3::dsr::DsrFsHeader::GetSourceId(), m_ackId, m_routeCache, NS_LOG_FUNCTION, ns3::dsr::DsrOptionAckReqHeader::SetAckId(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNumberAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), and ns3::dsr::DsrFsHeader::SetSourceId().
Referenced by ScheduleNetworkPacketRetry().
bool ns3::dsr::DsrRouting::AddRoute | ( | DsrRouteCacheEntry & | rt | ) |
Add route cache entry if it doesn't yet exist in route cache See also DsrRouteCache::AddRoute.
rt | route cache entry |
Definition at line 678 of file dsr-routing.cc.
References ns3::dsr::DsrErrorBuffer::DropPacketForErrLink(), ns3::dsr::DsrRouteCacheEntry::GetVector(), m_errorBuffer, m_mainAddress, m_routeCache, and SearchNextHop().
bool ns3::dsr::DsrRouting::AddRoute_Link | ( | DsrRouteCacheEntry::IP_VECTOR | nodelist, |
Ipv4Address | source ) |
dd route link to cache See also DsrRouteCache::AddRoute_Link
nodelist | vector of nodes |
source | ip address of node to add |
Definition at line 670 of file dsr-routing.cc.
References ns3::dsr::DsrErrorBuffer::DropPacketForErrLink(), m_errorBuffer, m_routeCache, and SearchNextHop().
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.
stream | first stream index to use |
Definition at line 2791 of file dsr-routing.cc.
References m_uniformRandomVariable, and NS_LOG_FUNCTION.
void ns3::dsr::DsrRouting::CallCancelPacketTimer | ( | uint16_t | ackId, |
const Ipv4Header & | ipv4Header, | ||
Ipv4Address | realSrc, | ||
Ipv4Address | realDst ) |
Call the cancel packet retransmission timer function.
ackId | acknowledge ID |
ipv4Header | header |
realSrc | source IP address |
realDst | destination IP address |
Definition at line 2188 of file dsr-routing.cc.
References CancelNetworkPacketTimer(), ns3::Create(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetSource(), ns3::Simulator::Now(), and NS_LOG_FUNCTION.
void ns3::dsr::DsrRouting::CancelLinkPacketTimer | ( | DsrMaintainBuffEntry & | mb | ) |
Cancel the link packet retransmission timer for a specific maintenance entry.
mb | maintain buffer entry |
TODO need to think about this part
Definition at line 2222 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().
void ns3::dsr::DsrRouting::CancelNetworkPacketTimer | ( | DsrMaintainBuffEntry & | mb | ) |
Cancel the network packet retransmission timer for a specific maintenance entry.
mb | maintain buffer entry |
Definition at line 2270 of file dsr-routing.cc.
References ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::NetworkKey::m_ackId, m_addressForwardCnt, m_addressForwardTimer, ns3::dsr::NetworkKey::m_destination, m_maintainBuffer, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::NetworkKey::m_ourAdd, ns3::dsr::NetworkKey::m_source, ns3::dsr::DsrMaintainBuffer::NetworkEqual(), NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by CallCancelPacketTimer(), and CancelPacketAllTimer().
void ns3::dsr::DsrRouting::CancelPacketAllTimer | ( | DsrMaintainBuffEntry & | mb | ) |
Cancel all the packet timers.
mb | maintain buffer entry |
Definition at line 2213 of file dsr-routing.cc.
References CancelLinkPacketTimer(), CancelNetworkPacketTimer(), CancelPassivePacketTimer(), and NS_LOG_FUNCTION.
Referenced by CancelPacketTimerNextHop().
void ns3::dsr::DsrRouting::CancelPacketTimerNextHop | ( | Ipv4Address | nextHop, |
uint8_t | protocol ) |
Cancel the packet retransmission timer for a all maintenance entries with nextHop address.
nextHop | next hop IP address |
protocol | number |
TODO if the errorDst is not seen before
TODO need to think about whether we need the network queue entry or not
Definition at line 2351 of file dsr-routing.cc.
References CancelPacketAllTimer(), CancelPacketTimerNextHop(), ns3::Packet::Copy(), ns3::dsr::DsrMaintainBuffer::Dequeue(), ns3::dsr::DsrMaintainBuffer::Find(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrOptionSRHeader::GetSalvage(), ns3::dsr::DsrMaintainBuffer::GetSize(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), m_maintainBuffer, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, PrintVector(), SalvagePacket(), ns3::Simulator::Schedule(), SendUnreachError(), and ns3::dsr::DsrOptionSRHeader::SetNumberAddress().
Referenced by CancelPacketTimerNextHop(), LinkScheduleTimerExpire(), and NetworkScheduleTimerExpire().
void ns3::dsr::DsrRouting::CancelPassivePacketTimer | ( | DsrMaintainBuffEntry & | mb | ) |
Cancel the passive packet retransmission timer for a specific maintenance entry.
mb | maintain buffer entry |
Definition at line 2317 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().
bool ns3::dsr::DsrRouting::CancelPassiveTimer | ( | Ptr< Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | destination, | ||
uint8_t | segsLeft ) |
Cancel the passive timer.
packet | to process |
source | IP address |
destination | IP address |
segsLeft | segments left |
Definition at line 2159 of file dsr-routing.cc.
References CancelPassivePacketTimer(), m_maintainBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::dsr::DsrMaintainBuffer::PromiscEqual(), segsLeft, ns3::dsr::DsrMaintainBuffEntry::SetAckId(), ns3::dsr::DsrMaintainBuffEntry::SetDst(), ns3::dsr::DsrMaintainBuffEntry::SetPacket(), ns3::dsr::DsrMaintainBuffEntry::SetSegsLeft(), and ns3::dsr::DsrMaintainBuffEntry::SetSrc().
void ns3::dsr::DsrRouting::CancelRreqTimer | ( | Ipv4Address | dst, |
bool | isRemove ) |
Cancel the route request timer.
dst | The dst address of the route request timer |
isRemove | whether to remove the route request entry or not |
Definition at line 3078 of file dsr-routing.cc.
References m_addressReqTimer, m_nonPropReqTimer, m_rreqTable, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by RouteRequestTimerExpire(), and SendErrorRequest().
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
Definition at line 852 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Create(), data, ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrSendBuffer::GetBuffer(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), GetPriority(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), 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::Timer::Resume(), ns3::Time::S, ns3::Simulator::Schedule(), ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), Scheduler(), SearchNextHop(), SendBuffTimerExpire(), 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::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode(), and ns3::Timer::Suspend().
Referenced by SendBuffTimerExpire().
void ns3::dsr::DsrRouting::DeleteAllRoutesIncludeLink | ( | Ipv4Address | errorSrc, |
Ipv4Address | unreachNode, | ||
Ipv4Address | node ) |
Delete all the routes which includes the link from next hop address that has just been notified as unreachable.
See also DsrRouteCache::DeleteAllRoutesIncludeLink
errorSrc | The error source address |
unreachNode | The unreachable node |
node | This node's ip address |
Definition at line 687 of file dsr-routing.cc.
References m_routeCache.
|
overrideprotectedvirtual |
Drop trace callback.
Reimplemented from ns3::Object.
Definition at line 553 of file dsr-routing.cc.
References ns3::Object::DoDispose(), m_ipv4, m_node, m_routeCache, and NS_LOG_FUNCTION_NOARGS.
bool ns3::dsr::DsrRouting::FindSourceEntry | ( | Ipv4Address | src, |
Ipv4Address | dst, | ||
uint16_t | id ) |
Find the source request entry in the route request queue, return false if not found.
See also DsrRreqTable::FindSourceEntry
src | the source address we just received the source request |
dst | the destination address the request is targeted at |
id | the identification number for this request |
Definition at line 701 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 ) |
This function is responsible for forwarding error packets along the route.
rerr | unreachable header |
sourceRoute | source routing header |
nextHop | IP address of next hop |
protocol | number |
route | IP route |
Definition at line 1466 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Create(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::Callback< R, UArgs >::IsNull(), m_downTarget, m_ip, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrFsHeader::SetPayloadLength(), and ns3::dsr::DsrFsHeader::SetSourceId().
void ns3::dsr::DsrRouting::ForwardPacket | ( | Ptr< const Packet > | packet, |
DsrOptionSRHeader & | sourceRoute, | ||
const Ipv4Header & | 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.
packet | The packet |
sourceRoute | Source route saved in option header |
ipv4Header | IPv4 Header |
source | source address |
destination | destination address |
targetAddress | target address |
protocol | protocol number |
route | route |
Definition at line 2835 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrOptionSRHeader::GetSegmentsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::Callback< R, UArgs >::IsNull(), m_ackId, 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_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, ns3::dsr::PassiveKey::m_segsLeft, ns3::dsr::LinkKey::m_source, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrFsHeader::SetPayloadLength(), and ns3::dsr::DsrFsHeader::SetSourceId().
|
overridevirtual |
This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 case)
Implements ns3::IpL4Protocol.
Definition at line 3728 of file dsr-routing.cc.
References m_downTarget.
|
overridevirtual |
This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 case)
Implements ns3::IpL4Protocol.
Definition at line 3734 of file dsr-routing.cc.
References ns3::MakeNullCallback(), and NS_FATAL_ERROR.
std::vector< std::string > ns3::dsr::DsrRouting::GetElementsFromContext | ( | std::string | context | ) |
Get the elements from the tracing context.
context | context |
Definition at line 537 of file dsr-routing.cc.
Referenced by GetNetDeviceFromContext().
uint16_t ns3::dsr::DsrRouting::GetIDfromIP | ( | Ipv4Address | address | ) |
Get the node id from ip address.
address | IPv4 address |
Definition at line 798 of file dsr-routing.cc.
References ns3::NodeList::GetNNodes(), and ns3::NodeList::GetNode().
Referenced by CheckSendBuffer(), ForwardErrPacket(), ForwardPacket(), PacketNewRoute(), SalvagePacket(), Send(), SendAck(), SendErrorRequest(), SendGratuitousReply(), SendInitialRequest(), SendPacketFromBuffer(), and SendUnreachError().
Ipv4Address ns3::dsr::DsrRouting::GetIPfromID | ( | uint16_t | id | ) |
Get the ip address from id.
id | unique ID |
Definition at line 814 of file dsr-routing.cc.
References ns3::NodeList::GetNode(), and NS_LOG_DEBUG.
Referenced by PromiscReceive(), and Receive().
Ipv4Address ns3::dsr::DsrRouting::GetIPfromMAC | ( | Mac48Address | address | ) |
Get the Ip address from mac address.
address | Mac48Address |
Definition at line 707 of file dsr-routing.cc.
References ns3::NodeList::GetNNodes(), ns3::NodeList::GetNode(), and NS_LOG_FUNCTION.
Referenced by PromiscReceive().
Get the netdevice from the context.
context | context |
Definition at line 525 of file dsr-routing.cc.
References GetElementsFromContext(), ns3::NodeList::GetNode(), and NS_ASSERT.
Get the node.
Definition at line 585 of file dsr-routing.cc.
References m_node, and NS_LOG_FUNCTION_NOARGS.
Referenced by Receive().
Ptr< Node > ns3::dsr::DsrRouting::GetNodeWithAddress | ( | Ipv4Address | ipv4Address | ) |
Get the node with give ip address.
ipv4Address | IPv4 address |
Definition at line 634 of file dsr-routing.cc.
References ns3::NodeList::GetNNodes(), ns3::NodeList::GetNode(), and NS_LOG_FUNCTION.
Referenced by PromiscReceive().
Ptr< dsr::DsrOptions > ns3::dsr::DsrRouting::GetOption | ( | int | optionNumber | ) |
Get the option corresponding to optionNumber.
optionNumber | the option number of the option to retrieve |
Definition at line 3747 of file dsr-routing.cc.
References m_options.
Referenced by PromiscReceive(), and Receive().
Ptr< dsr::DsrPassiveBuffer > ns3::dsr::DsrRouting::GetPassiveBuffer | ( | ) | const |
Get the passive buffer.
Definition at line 627 of file dsr-routing.cc.
References m_passiveBuffer.
Referenced by GetTypeId().
uint32_t ns3::dsr::DsrRouting::GetPriority | ( | DsrMessageType | messageType | ) |
Set the priority of the packet in network queue.
messageType | Message type |
Definition at line 828 of file dsr-routing.cc.
References ns3::dsr::DSR_CONTROL_PACKET.
Referenced by CheckSendBuffer(), ForwardErrPacket(), IncreaseRetransTimer(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), and SendUnreachError().
|
overridevirtual |
Get the dsr protocol number.
Implements ns3::IpL4Protocol.
Definition at line 791 of file dsr-routing.cc.
References PROT_NUMBER.
Referenced by SendRealDown().
Ptr< dsr::DsrRreqTable > ns3::dsr::DsrRouting::GetRequestTable | ( | ) | const |
Get the request table.
Definition at line 613 of file dsr-routing.cc.
References m_rreqTable.
Referenced by GetTypeId().
Ptr< dsr::DsrRouteCache > ns3::dsr::DsrRouting::GetRouteCache | ( | ) | const |
Get the route cache.
Definition at line 599 of file dsr-routing.cc.
References m_routeCache.
Referenced by GetTypeId().
|
static |
Get the type identificator.
Definition at line 105 of file dsr-routing.cc.
References GetPassiveBuffer(), GetRequestTable(), GetRouteCache(), m_blacklistTimeout, m_broadcastJitter, m_cacheType, m_discoveryHopLimit, m_dropTrace, m_graReplyTableSize, m_gratReplyHoldoff, m_initStability, m_linkAck, m_linkAckTimeout, m_maxCacheLen, m_maxCacheTime, m_maxEntriesEachDst, m_maxMaintainLen, m_maxMaintainTime, m_maxMaintRexmt, m_maxNetworkDelay, m_maxNetworkSize, m_maxRequestPeriod, m_maxRreqId, m_maxSalvageCount, m_maxSendBuffLen, m_minLifeTime, m_nodeTraversalTime, m_nonpropRequestTimeout, m_numPriorityQueues, m_passiveAckTimeout, m_requestPeriod, m_requestTableIds, m_requestTableSize, m_retransIncr, m_rreqRetries, m_sendBufferTimeout, m_sendBuffInterval, m_stabilityDecrFactor, m_stabilityIncrFactor, m_subRoute, m_tryLinkAcks, m_tryPassiveAcks, m_txPacketTrace, m_useExtends, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeStringAccessor(), ns3::MakeStringChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::MilliSeconds(), ns3::Seconds(), ns3::TypeId::SetParent(), SetPassiveBuffer(), SetRequestTable(), and SetRouteCache().
void ns3::dsr::DsrRouting::IncreaseRetransTimer | ( | ) |
This function is called to increase the retransmission timer for data packet in the network queue.
Definition at line 1834 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().
void ns3::dsr::DsrRouting::Insert | ( | Ptr< dsr::DsrOptions > | option | ) |
Insert a new Dsr Option.
option | the option to insert |
Definition at line 3741 of file dsr-routing.cc.
References m_options.
Referenced by DsrRouting().
bool ns3::dsr::DsrRouting::IsLinkCache | ( | ) |
Checks if the link is cached in the route cache See also DsrRouteCache::IsLinkCache.
Definition at line 652 of file dsr-routing.cc.
References m_routeCache.
void ns3::dsr::DsrRouting::LinkScheduleTimerExpire | ( | DsrMaintainBuffEntry & | mb, |
uint8_t | protocol ) |
This function deals with packet retransmission timer expire using link acknowledgment.
mb | maintenance buffer entry |
protocol | the protocol number |
Definition at line 2707 of file dsr-routing.cc.
References CancelPacketTimerNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::LinkKey::m_destination, m_linkAckTimer, m_linkCnt, m_linkRetries, m_mainAddress, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::LinkKey::m_ourAdd, m_routeCache, ns3::dsr::LinkKey::m_source, m_tryLinkAcks, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ScheduleLinkPacketRetry(), and SetRoute().
Referenced by ScheduleLinkPacketRetry().
bool ns3::dsr::DsrRouting::LookupRoute | ( | Ipv4Address | id, |
DsrRouteCacheEntry & | rt ) |
Lookup route cache entry with destination address dst See also DsrRouteCache::LookupRoute.
id | destination address |
rt | entry with destination address id, if exists |
Definition at line 664 of file dsr-routing.cc.
References m_routeCache.
void ns3::dsr::DsrRouting::NetworkScheduleTimerExpire | ( | DsrMaintainBuffEntry & | mb, |
uint8_t | protocol ) |
This function deals with packet retransmission timer expire using network acknowledgment.
mb | maintenance buffer entry |
protocol | the protocol number |
Definition at line 2799 of file dsr-routing.cc.
References CancelPacketTimerNextHop(), ns3::Packet::Copy(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::NetworkKey::m_ackId, m_addressForwardCnt, ns3::dsr::NetworkKey::m_destination, m_mainAddress, m_maxMaintRexmt, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::NetworkKey::m_ourAdd, m_routeCache, m_sendRetries, ns3::dsr::NetworkKey::m_source, and ScheduleNetworkPacketRetry().
Referenced by ScheduleNetworkPacketRetry().
|
overrideprotectedvirtual |
Notify all Objects aggregated to this one of a new Object being aggregated.
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 overridden 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 395 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().
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.
packet | to route |
source | address |
destination | address |
protocol | number |
When found a route and use it, UseExtends to the link cache
Definition at line 1199 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrSendBuffer::Enqueue(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), 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, PacketNewRoute(), ns3::Time::S, 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(), PacketNewRoute(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), and SendUnreachError().
bool ns3::dsr::DsrRouting::PassiveEntryCheck | ( | Ptr< Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | destination, | ||
uint8_t | segsLeft, | ||
uint16_t | fragmentOffset, | ||
uint16_t | identification, | ||
bool | saveEntry ) |
Find the same passive entry.
packet | to process |
source | IP address |
destination | IP address |
segsLeft | segments left |
fragmentOffset | |
identification | |
saveEntry |
Save this passive buffer entry for later check
Definition at line 2112 of file dsr-routing.cc.
References CancelPassivePacketTimer(), m_passiveBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, segsLeft, ns3::dsr::DsrMaintainBuffEntry::SetAckId(), ns3::dsr::DsrPassiveBuffEntry::SetDestination(), ns3::dsr::DsrMaintainBuffEntry::SetDst(), ns3::dsr::DsrPassiveBuffEntry::SetFragmentOffset(), ns3::dsr::DsrPassiveBuffEntry::SetIdentification(), ns3::dsr::DsrMaintainBuffEntry::SetPacket(), ns3::dsr::DsrPassiveBuffEntry::SetPacket(), ns3::dsr::DsrMaintainBuffEntry::SetSegsLeft(), ns3::dsr::DsrPassiveBuffEntry::SetSegsLeft(), ns3::dsr::DsrPassiveBuffEntry::SetSource(), and ns3::dsr::DsrMaintainBuffEntry::SetSrc().
void ns3::dsr::DsrRouting::PassiveScheduleTimerExpire | ( | DsrMaintainBuffEntry & | mb, |
uint8_t | protocol ) |
This function deals with packet retransmission timer expire using passive acknowledgment.
mb | maintenance buffer entry |
protocol | the protocol number |
Definition at line 2752 of file dsr-routing.cc.
References CancelPassivePacketTimer(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::PassiveKey::m_ackId, ns3::dsr::PassiveKey::m_destination, m_mainAddress, m_passiveAckTimer, m_passiveCnt, m_passiveRetries, ns3::dsr::PassiveKey::m_segsLeft, ns3::dsr::PassiveKey::m_source, m_tryPassiveAcks, NS_LOG_DEBUG, NS_LOG_FUNCTION, ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), and SetRoute().
Referenced by SchedulePassivePacketRetry().
void ns3::dsr::DsrRouting::PrintVector | ( | std::vector< Ipv4Address > & | vec | ) |
Print the route vector.
vec | the vector to print. |
Definition at line 726 of file dsr-routing.cc.
References NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by CancelPacketTimerNextHop().
void ns3::dsr::DsrRouting::PriorityScheduler | ( | uint32_t | priority, |
bool | continueWithFirst ) |
This function is called to schedule sending packets from the network queue by priority.
priority | schedule |
continueWithFirst | use all priorities |
Definition at line 1756 of file dsr-routing.cc.
References IncreaseRetransTimer(), m_numPriorityQueues, m_priorityQueue, m_uniformRandomVariable, ns3::MicroSeconds(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PriorityScheduler(), queueSize, ns3::Simulator::Schedule(), ns3::Seconds(), and SendRealDown().
Referenced by PriorityScheduler(), and Scheduler().
uint8_t ns3::dsr::DsrRouting::Process | ( | Ptr< Packet > & | packet, |
const Ipv4Header & | ipv4Header, | ||
Ipv4Address | dst, | ||
uint8_t * | nextHeader, | ||
uint8_t | protocol, | ||
bool & | isDropped ) |
Process method Called from Ipv4L3Protocol::Receive.
packet | the packet |
ipv4Header | IPv4 header of the packet |
dst | destination address of the packet received (i.e. us) |
nextHeader | the next header |
protocol | the protocol number |
isDropped | if the packet must be dropped |
|
private |
Promiscuous receive data packets destined to some other node.
device | The network device |
packet | Data packet we just received |
protocol | The protocol we receive, need to verify it is dsr protocol |
from | The from address we received the packet |
to | The address this packet is destined for |
packetType | The dsr packet type, 0 is for control packet, 1 for data packet |
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 1086 of file dsr-routing.cc.
References ns3::Mac48Address::ConvertFrom(), ns3::Create(), data, ns3::dsr::DsrFsHeader::GetDestId(), ns3::Ipv4Header::GetDestination(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIPfromID(), GetIPfromMAC(), ns3::dsr::DsrFsHeader::GetMessageType(), ns3::dsr::DsrFsHeader::GetNextHeader(), GetNodeWithAddress(), GetOption(), ns3::Ipv4Header::GetProtocol(), ns3::Ipv4Header::GetSource(), ns3::dsr::DsrFsHeader::GetSourceId(), m_ipv4, m_mainAddress, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_INFO, ns3::NetDevice::PACKET_OTHERHOST, PROT_NUMBER, ns3::Ipv4L3Protocol::PROT_NUMBER, ns3::Time::S, ns3::dsr::DsrMaintainBuffEntry::SetDst(), ns3::dsr::DsrMaintainBuffEntry::SetNextHop(), ns3::dsr::DsrMaintainBuffEntry::SetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::SetPacket(), and ns3::dsr::DsrMaintainBuffEntry::SetSrc().
Referenced by Start().
|
overridevirtual |
p | packet to forward up |
header | IPv4 Header information |
incomingInterface | the Ipv4Interface on which the packet arrived |
Called from lower-level layers to send the packet up in the stack.
this is just here for the sake of passing in the promisc source
Implements ns3::IpL4Protocol.
Definition at line 3509 of file dsr-routing.cc.
References data, ns3::Ipv4Header::GetDestination(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIPfromID(), ns3::dsr::DsrFsHeader::GetNextHeader(), GetNode(), ns3::Object::GetObject(), GetOption(), ns3::Ipv4Header::GetSource(), ns3::dsr::DsrFsHeader::GetSourceId(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4Address::IsMulticast(), m_dropTrace, m_mainAddress, m_node, m_rreqTable, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::IpL4Protocol::RX_CSUM_FAILED, ns3::IpL4Protocol::RX_ENDPOINT_CLOSED, ns3::IpL4Protocol::RX_ENDPOINT_UNREACH, ns3::IpL4Protocol::RX_OK, ns3::dsr::DsrOptionRerrUnsupportedHeader::SetErrorDst(), ns3::dsr::DsrOptionRerrUnsupportedHeader::SetErrorSrc(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrOptionRerrUnsupportedHeader::SetSalvage(), and ns3::dsr::DsrOptionRerrUnsupportedHeader::SetUnsupported().
|
overridevirtual |
p | packet to forward up |
header | IPv6 Header information |
incomingInterface | the Ipv6Interface on which the packet arrived |
Called from lower-level layers to send the packet up in the stack. Not implemented (IPv6).
Implements ns3::IpL4Protocol.
Definition at line 3709 of file dsr-routing.cc.
References ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetSource(), NS_LOG_FUNCTION, and ns3::IpL4Protocol::RX_ENDPOINT_UNREACH.
void ns3::dsr::DsrRouting::RouteRequestTimerExpire | ( | Ptr< Packet > | packet, |
std::vector< Ipv4Address > | address, | ||
uint32_t | requestId, | ||
uint8_t | protocol ) |
Handle route discovery timer.
packet | the original packet |
address | List of IPv4 addresses |
requestId | Unique request ID |
protocol | the protocol number |
Set the salvage value to 0
Try to send out data packet from the send buffer if found
Definition at line 3202 of file dsr-routing.cc.
References CancelRreqTimer(), ns3::dsr::DsrSendBuffer::DropPacketWithDst(), ns3::dsr::DsrSendBuffer::Find(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::dsr::DsrRouteCacheEntry::GetVector(), m_discoveryHopLimit, m_mainAddress, m_routeCache, m_rreqRetries, m_rreqTable, m_sendBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PacketNewRoute(), ScheduleRreqRetry(), SearchNextHop(), SendPacketFromBuffer(), SendRequest(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), and ns3::SocketIpTtlTag::SetTtl().
Referenced by ScheduleRreqRetry().
void ns3::dsr::DsrRouting::SalvagePacket | ( | Ptr< const Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | dst, | ||
uint8_t | protocol ) |
Salvage the packet which has been transmitted for 3 times.
packet | to process |
source | IP address |
dst | destination IP address |
protocol | number |
When found a route and use it, UseExtends to the link cache
Definition at line 2431 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DSR_DATA_PACKET, ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::dsr::DsrOptionSRHeader::GetSalvage(), ns3::dsr::DsrRouteCacheEntry::GetVector(), m_ip, m_ipv4Route, m_mainAddress, m_maxSalvageCount, m_priorityQueue, m_routeCache, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, PacketNewRoute(), Scheduler(), SearchNextHop(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionSRHeader::SetNumberAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), and ns3::dsr::DsrFsHeader::SetSourceId().
Referenced by CancelPacketTimerNextHop().
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.
packet | the original packet |
source | IPv4 address of the source (i.e. request originator) |
destination | IPv4 address of the destination |
route | Route |
hops | number of hops |
Definition at line 3434 of file dsr-routing.cc.
References m_nodeTraversalTime, m_uniformRandomVariable, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendReply().
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
packet | the original packet |
source | IPv4 address of the source (i.e. request originator) |
nextHop | IPv4 address of the next hop |
route | Route |
Definition at line 3424 of file dsr-routing.cc.
References NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and SendReply().
Schedule the intermediate route request.
packet | the original packet |
Definition at line 3309 of file dsr-routing.cc.
References m_broadcastJitter, m_mainAddress, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendRequest().
void ns3::dsr::DsrRouting::ScheduleLinkPacketRetry | ( | DsrMaintainBuffEntry & | mb, |
uint8_t | protocol ) |
Schedule the packet retransmission based on link-layer acknowledgment.
mb | maintenance buffer entry |
protocol | the protocol number |
Definition at line 2536 of file dsr-routing.cc.
References ns3::Timer::CANCEL_ON_DESTROY, ns3::Packet::Copy(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), LinkScheduleTimerExpire(), ns3::dsr::LinkKey::m_destination, m_linkAckTimeout, m_linkAckTimer, ns3::dsr::LinkKey::m_nextHop, ns3::dsr::LinkKey::m_ourAdd, ns3::dsr::LinkKey::m_source, NS_LOG_FUNCTION, SendPacket(), and ns3::Timer::SetFunction().
Referenced by CheckSendBuffer(), ForwardPacket(), LinkScheduleTimerExpire(), PacketNewRoute(), Send(), and SendPacketFromBuffer().
void ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry | ( | DsrMaintainBuffEntry & | mb, |
bool | isFirst, | ||
uint8_t | protocol ) |
Schedule the packet retransmission based on network layer acknowledgment.
mb | maintenance buffer entry |
isFirst | see if this is the first packet retry or not |
protocol | the protocol number |
Definition at line 2595 of file dsr-routing.cc.
References AddAckReqHeader(), ns3::dsr::DsrMaintainBuffer::AllEqual(), ns3::Timer::CANCEL_ON_DESTROY, ns3::Packet::Copy(), ns3::Create(), ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::NetworkKey::m_ackId, m_addressForwardCnt, m_addressForwardTimer, ns3::dsr::NetworkKey::m_destination, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::NetworkKey::m_nextHop, m_nodeTraversalTime, ns3::dsr::NetworkKey::m_ourAdd, m_sendRetries, ns3::dsr::NetworkKey::m_source, NetworkScheduleTimerExpire(), NS_LOG_DEBUG, NS_LOG_ERROR, ns3::Time::S, SendPacket(), ns3::dsr::DsrMaintainBuffEntry::SetAckId(), ns3::dsr::DsrMaintainBuffEntry::SetExpireTime(), ns3::Timer::SetFunction(), and ns3::dsr::DsrMaintainBuffEntry::SetPacket().
Referenced by CheckSendBuffer(), ForwardPacket(), NetworkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), and SendPacketFromBuffer().
void ns3::dsr::DsrRouting::SchedulePassivePacketRetry | ( | DsrMaintainBuffEntry & | mb, |
uint8_t | protocol ) |
Schedule the packet retransmission based on passive acknowledgment.
mb | maintenance buffer entry |
protocol | the protocol number |
Definition at line 2565 of file dsr-routing.cc.
References ns3::Timer::CANCEL_ON_DESTROY, ns3::Packet::Copy(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetPacket(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::PassiveKey::m_ackId, ns3::dsr::PassiveKey::m_destination, m_passiveAckTimeout, m_passiveAckTimer, ns3::dsr::PassiveKey::m_segsLeft, ns3::dsr::PassiveKey::m_source, NS_LOG_DEBUG, NS_LOG_FUNCTION, PassiveScheduleTimerExpire(), and SendPacket().
Referenced by CheckSendBuffer(), ForwardPacket(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), and SendPacketFromBuffer().
void ns3::dsr::DsrRouting::Scheduler | ( | uint32_t | priority | ) |
This function is called to schedule sending packets from the network queue.
priority | for sending |
Definition at line 1749 of file dsr-routing.cc.
References NS_LOG_FUNCTION, and PriorityScheduler().
Referenced by CheckSendBuffer(), ForwardErrPacket(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), and SendUnreachError().
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.
packet | the original packet |
address | List of IPv4 addresses |
nonProp | flag if RREQ is non-propagating |
requestId | Unique request ID |
protocol | the protocol number |
Definition at line 3125 of file dsr-routing.cc.
References ns3::Time::As(), ns3::Timer::CANCEL_ON_DESTROY, m_addressReqTimer, m_maxRequestPeriod, m_nonPropReqTimer, m_nonpropRequestTimeout, m_requestPeriod, m_rreqTable, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, RouteRequestTimerExpire(), and ns3::Time::S.
Referenced by RouteRequestTimerExpire(), SendErrorRequest(), and SendInitialRequest().
Ipv4Address ns3::dsr::DsrRouting::SearchNextHop | ( | Ipv4Address | ipv4Address, |
std::vector< Ipv4Address > & | vec ) |
Get the next hop of the route.
ipv4Address | |
vec | Route |
Definition at line 747 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().
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.
packet | to send |
source | IP address |
destination | IP address |
protocol | number |
route | IP route |
When found a route and use it, UseExtends to the link cache
Definition at line 1511 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrSendBuffer::Enqueue(), ns3::dsr::DsrSendBuffer::Find(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::DsrRouteCacheEntry::GetVector(), ns3::Callback< R, UArgs >::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::Time::S, 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().
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.
ackId | ACK ID |
destination | IPv4 address of the immediate ACK receiver |
realSrc | IPv4 address of the real source |
realDst | IPv4 address of the real destination |
protocol | the protocol number |
route | Route |
Definition at line 3452 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Create(), ns3::dsr::DSR_CONTROL_PACKET, GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::Callback< R, UArgs >::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::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrFsHeader::SetPayloadLength(), ns3::dsr::DsrOptionAckHeader::SetRealDst(), ns3::dsr::DsrOptionAckHeader::SetRealSrc(), and ns3::dsr::DsrFsHeader::SetSourceId().
void ns3::dsr::DsrRouting::SendBuffTimerExpire | ( | ) |
The send buffer timer expire.
Definition at line 841 of file dsr-routing.cc.
References ns3::Timer::Cancel(), CheckSendBuffer(), ns3::Timer::IsRunning(), m_sendBuffInterval, m_sendBuffTimer, and ns3::Timer::Schedule().
Referenced by DsrRouting(), and CheckSendBuffer().
void ns3::dsr::DsrRouting::SendErrorRequest | ( | DsrOptionRerrUnreachHeader & | rerr, |
uint8_t | protocol ) |
Send the error request packet.
rerr | the route error header |
protocol | the 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 2968 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(), CancelRreqTimer(), ns3::Create(), 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::dsr::DsrRouteCacheEntry::GetVector(), ns3::Callback< R, UArgs >::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::DsrOptionRreqHeader::SetId(), 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(), ns3::dsr::DsrOptionRreqHeader::SetTarget(), and ns3::SocketIpTtlTag::SetTtl().
Referenced by SendUnreachError().
void ns3::dsr::DsrRouting::SendGratuitousReply | ( | Ipv4Address | replyTo, |
Ipv4Address | replyFrom, | ||
std::vector< Ipv4Address > & | nodeList, | ||
uint8_t | protocol ) |
Send the gratuitous reply.
replyTo | The destination address to send the reply to |
replyFrom | The source address sending the reply |
nodeList | Route |
protocol | the protocol number |
Push back the node addresses other than those between srcAddress and our own ip address
Definition at line 3324 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrGraReply::AddEntry(), ns3::Create(), 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().
void ns3::dsr::DsrRouting::SendInitialRequest | ( | Ipv4Address | source, |
Ipv4Address | destination, | ||
uint8_t | protocol ) |
Broadcast the route request packet in subnet.
source | source address |
destination | destination address |
protocol | protocol number |
Definition at line 2920 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(), ns3::Create(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Callback< R, UArgs >::IsNull(), m_downTarget, m_mainAddress, m_requestId, m_rreqTable, NS_ASSERT_MSG, NS_LOG_FUNCTION, ScheduleRreqRetry(), SendRequest(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRreqHeader::SetId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrFsHeader::SetPayloadLength(), ns3::dsr::DsrFsHeader::SetSourceId(), ns3::dsr::DsrOptionRreqHeader::SetTarget(), and ns3::SocketIpTtlTag::SetTtl().
Referenced by PacketNewRoute(), Send(), and SendUnreachError().
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.
packet | to send |
source | IP address |
nextHop | IP address |
protocol | number |
Definition at line 1717 of file dsr-routing.cc.
References ns3::dsr::DSR_DATA_PACKET, ns3::Ipv4::GetInterfaceForAddress(), ns3::Ipv4::GetNetDevice(), GetPriority(), m_ip, m_ipv4Route, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), and SetRoute().
Referenced by ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), and SchedulePassivePacketRetry().
void ns3::dsr::DsrRouting::SendPacketFromBuffer | ( | const DsrOptionSRHeader & | 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.
sourceRoute | source route |
nextHop | next hop IP address |
protocol | number |
When found a route and use it, UseExtends to the link cache
When found a route and use it, UseExtends to the link cache
Definition at line 1871 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::Copy(), ns3::Create(), data, ns3::dsr::DsrErrorBuffer::Dequeue(), ns3::dsr::DsrSendBuffer::Dequeue(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrMaintainBuffer::Enqueue(), ns3::dsr::DsrErrorBuffer::Find(), ns3::dsr::DsrSendBuffer::Find(), ns3::dsr::DsrMaintainBuffEntry::GetAckId(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::DsrMaintainBuffEntry::GetDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), ns3::dsr::DsrMaintainBuffEntry::GetNextHop(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst(), ns3::dsr::DsrMaintainBuffEntry::GetOurAdd(), ns3::dsr::DsrErrorBuffEntry::GetPacket(), ns3::dsr::DsrSendBuffEntry::GetPacket(), GetPriority(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft(), ns3::dsr::DsrErrorBuffer::GetSize(), ns3::dsr::DsrSendBuffer::GetSize(), ns3::dsr::DsrMaintainBuffEntry::GetSrc(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::Callback< R, UArgs >::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::Simulator::Schedule(), ScheduleLinkPacketRetry(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), Scheduler(), SendPacketFromBuffer(), 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::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode().
Referenced by RouteRequestTimerExpire(), Send(), SendErrorRequest(), and SendPacketFromBuffer().
bool ns3::dsr::DsrRouting::SendRealDown | ( | DsrNetworkQueueEntry & | newEntry | ) |
This function is called to send packets down stack.
newEntry | queue entry |
Definition at line 1859 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().
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.
packet | the original packet |
source | IPv4 address of the source (i.e. request originator) |
nextHop | IPv4 address of the next hop |
route | Route |
Definition at line 3392 of file dsr-routing.cc.
References ns3::dsr::DSR_CONTROL_PACKET, GetPriority(), ns3::Callback< R, UArgs >::IsNull(), m_downTarget, m_ipv4, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, and Scheduler().
Referenced by ScheduleCachedReply(), ScheduleInitialReply(), and SendGratuitousReply().
void ns3::dsr::DsrRouting::SendRequest | ( | Ptr< Packet > | packet, |
Ipv4Address | source ) |
Forward the route request if the node is not the destination.
packet | the original packet |
source | address |
Definition at line 3281 of file dsr-routing.cc.
References ns3::dsr::DSR_CONTROL_PACKET, GetPriority(), ns3::Callback< R, UArgs >::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().
|
private |
Send the route error message when the link breaks to the next hop.
nextHop | next hop address |
protocol | protocol 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.
unreachNode | unreachable node |
destination | address |
originalDst | address |
salvage | packet flag |
protocol | number |
When found a route and use it, UseExtends to the link cache
Definition at line 1334 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Create(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrErrorBuffer::Enqueue(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), 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(), ns3::Time::S, 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::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode().
Referenced by CancelPacketTimerNextHop().
|
overridevirtual |
This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 case)
cb | current Callback for the L4 protocol |
Implements ns3::IpL4Protocol.
Definition at line 3716 of file dsr-routing.cc.
References m_downTarget.
Referenced by NotifyNewAggregate().
|
overridevirtual |
This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 case)
cb | current Callback for the L4 protocol |
Implements ns3::IpL4Protocol.
Definition at line 3722 of file dsr-routing.cc.
References NS_FATAL_ERROR.
Set the node.
node | the node to set |
Definition at line 579 of file dsr-routing.cc.
References m_node.
Referenced by NotifyNewAggregate().
void ns3::dsr::DsrRouting::SetPassiveBuffer | ( | Ptr< dsr::DsrPassiveBuffer > | r | ) |
Set the node.
r | the passive buffer to set |
Definition at line 620 of file dsr-routing.cc.
References m_passiveBuffer.
Referenced by GetTypeId(), and Start().
void ns3::dsr::DsrRouting::SetRequestTable | ( | Ptr< dsr::DsrRreqTable > | r | ) |
Set the node.
r | the request table to set |
Definition at line 606 of file dsr-routing.cc.
References m_rreqTable.
Referenced by GetTypeId(), and Start().
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.
nextHop | next hop IPv4 address |
srcAddress | IPv4 address of the source |
Definition at line 780 of file dsr-routing.cc.
References ns3::Create(), m_ipv4Route, and NS_LOG_FUNCTION.
Referenced by CheckSendBuffer(), LinkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), RouteRequestTimerExpire(), SalvagePacket(), SendErrorRequest(), SendGratuitousReply(), SendPacket(), SendPacketFromBuffer(), and SendUnreachError().
void ns3::dsr::DsrRouting::SetRouteCache | ( | Ptr< dsr::DsrRouteCache > | r | ) |
Set the route cache.
r | the route cache to set |
Definition at line 592 of file dsr-routing.cc.
References m_routeCache.
Referenced by GetTypeId(), and Start().
|
private |
TODO whether this SendRerrWhenBreaksLinkToNextHop is used or not
Definition at line 423 of file dsr-routing.cc.
References ns3::Time::As(), ns3::CreateObject(), ns3::Ipv4Address::GetBroadcast(), m_broadcast, m_cacheType, m_discoveryHopLimit, m_errorBuffer, m_graReply, m_graReplyTableSize, m_initStability, m_ipv4, m_mainAddress, m_maintainBuffer, m_maxCacheLen, m_maxCacheTime, m_maxEntriesEachDst, m_maxMaintainLen, m_maxMaintainTime, m_maxNetworkDelay, m_maxNetworkSize, m_maxRreqId, m_maxSendBuffLen, m_minLifeTime, m_numPriorityQueues, m_priorityQueue, m_requestTableIds, m_requestTableSize, m_sendBuffer, m_sendBufferTimeout, m_stabilityDecrFactor, m_stabilityIncrFactor, m_subRoute, m_useExtends, ns3::MakeCallback(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PromiscReceive(), ns3::Time::S, ns3::dsr::DsrErrorBuffer::SetErrorBufferTimeout(), ns3::dsr::DsrGraReply::SetGraTableSize(), ns3::dsr::DsrMaintainBuffer::SetMaintainBufferTimeout(), ns3::dsr::DsrErrorBuffer::SetMaxQueueLen(), ns3::dsr::DsrMaintainBuffer::SetMaxQueueLen(), ns3::dsr::DsrSendBuffer::SetMaxQueueLen(), SetPassiveBuffer(), SetRequestTable(), SetRouteCache(), and ns3::dsr::DsrSendBuffer::SetSendBufferTimeout().
Referenced by NotifyNewAggregate().
bool ns3::dsr::DsrRouting::UpdateRouteEntry | ( | Ipv4Address | dst | ) |
Update route cache entry if it has been recently used and successfully delivered the data packet.
See also DsrRouteCache::UpdateRouteEntry
dst | destination address of the route |
Definition at line 695 of file dsr-routing.cc.
References m_routeCache.
void ns3::dsr::DsrRouting::UseExtends | ( | DsrRouteCacheEntry::IP_VECTOR | rt | ) |
Extends the lifetime of a route cache entry.
See also DsrRouteCache::UseExtends
rt | the route to extend |
Definition at line 658 of file dsr-routing.cc.
References m_routeCache.
|
private |
The ack id assigned to each acknowledge.
Definition at line 844 of file dsr-routing.h.
Referenced by AddAckReqHeader(), and ForwardPacket().
|
private |
The bind ipv4 addresses with next hop, src, destination address in sequence.
Definition at line 934 of file dsr-routing.h.
|
private |
Map network key + forward counts.
Definition at line 903 of file dsr-routing.h.
Referenced by CancelNetworkPacketTimer(), CheckSendBuffer(), ForwardPacket(), NetworkScheduleTimerExpire(), PacketNewRoute(), ScheduleNetworkPacketRetry(), Send(), and SendPacketFromBuffer().
|
private |
Map network key + forward timer.
Definition at line 901 of file dsr-routing.h.
Referenced by CancelNetworkPacketTimer(), IncreaseRetransTimer(), and ScheduleNetworkPacketRetry().
|
private |
Map IP address + RREQ timer.
Definition at line 897 of file dsr-routing.h.
Referenced by CancelRreqTimer(), PacketNewRoute(), ScheduleRreqRetry(), Send(), SendErrorRequest(), and SendUnreachError().
|
private |
|
private |
The broadcast IP address.
Definition at line 854 of file dsr-routing.h.
Referenced by SendRequest(), and Start().
|
private |
The max time to delay route request broadcast.
Definition at line 856 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleInterRequest().
|
private |
The type of route cache.
Definition at line 877 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The node that is clear to send packet to.
Definition at line 932 of file dsr-routing.h.
|
private |
Maximum hops to go for route request.
Definition at line 797 of file dsr-routing.h.
Referenced by GetTypeId(), RouteRequestTimerExpire(), SendErrorRequest(), and Start().
|
private |
The callback for down layer.
Definition at line 791 of file dsr-routing.h.
Referenced by ForwardErrPacket(), ForwardPacket(), GetDownTarget(), Send(), SendAck(), SendErrorRequest(), SendInitialRequest(), SendPacketFromBuffer(), SendRealDown(), SendReply(), SendRequest(), and SetDownTarget().
|
protected |
The trace for drop, receive and send data packets.
packet drop trace callback
Definition at line 743 of file dsr-routing.h.
Referenced by GetTypeId(), and Receive().
|
private |
The error buffer to save the error messages.
Definition at line 826 of file dsr-routing.h.
Referenced by AddRoute(), AddRoute_Link(), SendPacketFromBuffer(), SendUnreachError(), and Start().
|
private |
|
private |
The gratuitous route reply.
Definition at line 928 of file dsr-routing.h.
Referenced by SendGratuitousReply(), and Start().
|
private |
Set the gratuitous reply table size.
Definition at line 875 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The max gratuitous reply hold off time.
Definition at line 871 of file dsr-routing.h.
Referenced by GetTypeId(), and SendGratuitousReply().
|
private |
The initial stability value for link cache.
Definition at line 885 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
The ip ptr.
Definition at line 783 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardErrPacket(), NotifyNewAggregate(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), and SendUnreachError().
|
private |
Ipv4l3Protocol.
Definition at line 779 of file dsr-routing.h.
Referenced by DoDispose(), NotifyNewAggregate(), PromiscReceive(), SendReply(), and Start().
Ipv4 Route.
Definition at line 781 of file dsr-routing.h.
Referenced by CheckSendBuffer(), SalvagePacket(), SendGratuitousReply(), SendPacket(), SendPacketFromBuffer(), SendUnreachError(), and SetRoute().
|
private |
define if we use link acknowledgement or not
Definition at line 924 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardPacket(), GetTypeId(), PacketNewRoute(), Send(), and SendPacketFromBuffer().
|
private |
The timeout value for link acknowledge.
Definition at line 863 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleLinkPacketRetry().
The timer for link acknowledgment.
Definition at line 911 of file dsr-routing.h.
Referenced by CancelLinkPacketTimer(), LinkScheduleTimerExpire(), and ScheduleLinkPacketRetry().
Map packet key + link forward counts.
Definition at line 909 of file dsr-routing.h.
Referenced by CancelLinkPacketTimer(), CheckSendBuffer(), ForwardPacket(), LinkScheduleTimerExpire(), PacketNewRoute(), Send(), and SendPacketFromBuffer().
|
private |
Definition at line 809 of file dsr-routing.h.
Referenced by LinkScheduleTimerExpire().
|
private |
The map of mac address to node id.
Definition at line 937 of file dsr-routing.h.
|
private |
Our own Ip address.
Definition at line 787 of file dsr-routing.h.
Referenced by AddRoute(), CheckSendBuffer(), ForwardErrPacket(), ForwardPacket(), LinkScheduleTimerExpire(), NetworkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), PromiscReceive(), Receive(), RouteRequestTimerExpire(), SalvagePacket(), ScheduleInterRequest(), Send(), SendAck(), SendErrorRequest(), SendGratuitousReply(), SendInitialRequest(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendUnreachError(), and Start().
|
private |
The declaration of maintain buffer.
Definition at line 840 of file dsr-routing.h.
Referenced by CancelLinkPacketTimer(), CancelNetworkPacketTimer(), CancelPacketTimerNextHop(), CancelPassiveTimer(), CheckSendBuffer(), ForwardPacket(), PacketNewRoute(), ScheduleNetworkPacketRetry(), Send(), SendPacketFromBuffer(), and Start().
|
private |
Max # of cache entries for route cache.
Definition at line 832 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Max time for caching the route cache entry.
Definition at line 834 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Max number of route entries to save for each destination.
Definition at line 838 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Max # of entries for maintenance buffer.
Definition at line 828 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Time out for maintenance buffer.
Definition at line 830 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardPacket(), GetTypeId(), PacketNewRoute(), ScheduleNetworkPacketRetry(), Send(), SendPacketFromBuffer(), and Start().
|
private |
Maximum number of retransmissions of data packets.
Definition at line 814 of file dsr-routing.h.
Referenced by GetTypeId(), and NetworkScheduleTimerExpire().
|
private |
Maximum network delay.
Definition at line 795 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Maximum network queue size.
Definition at line 793 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The max request period.
Definition at line 873 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleRreqRetry().
|
private |
The max number of request ids for a single destination.
Definition at line 850 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Max time for caching the route request entry.
Definition at line 836 of file dsr-routing.h.
|
private |
Maximum # times to salvage a packet.
Definition at line 799 of file dsr-routing.h.
Referenced by GetTypeId(), and SalvagePacket().
|
private |
The maximum number of packets that we allow a routing protocol to buffer.
Definition at line 818 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The min life time.
Definition at line 887 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The network queue.
Definition at line 930 of file dsr-routing.h.
The node ptr.
Definition at line 785 of file dsr-routing.h.
Referenced by DoDispose(), GetNode(), NotifyNewAggregate(), Receive(), and SetNode().
|
private |
Time estimated for packet to travel between two nodes.
Definition at line 816 of file dsr-routing.h.
Referenced by GetTypeId(), ScheduleCachedReply(), and ScheduleNetworkPacketRetry().
|
private |
Map IP address + RREQ timer.
Definition at line 899 of file dsr-routing.h.
Referenced by CancelRreqTimer(), PacketNewRoute(), ScheduleRreqRetry(), Send(), SendErrorRequest(), and SendUnreachError().
|
private |
The non-propagation request timeout.
Definition at line 803 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleRreqRetry().
|
private |
The number of priority queues used.
Definition at line 922 of file dsr-routing.h.
Referenced by GetTypeId(), PriorityScheduler(), and Start().
|
private |
List of DSR Options supported.
Definition at line 777 of file dsr-routing.h.
Referenced by GetOption(), and Insert().
|
private |
The timeout value for passive acknowledge.
Definition at line 858 of file dsr-routing.h.
Referenced by GetTypeId(), and SchedulePassivePacketRetry().
|
private |
The timer for passive acknowledgment.
Definition at line 907 of file dsr-routing.h.
Referenced by CancelPassivePacketTimer(), PassiveScheduleTimerExpire(), and SchedulePassivePacketRetry().
|
private |
A "drop-front" queue used by the routing layer to cache route request sent.
Definition at line 919 of file dsr-routing.h.
Referenced by GetPassiveBuffer(), PassiveEntryCheck(), and SetPassiveBuffer().
|
private |
Map packet key + passive forward counts.
Definition at line 905 of file dsr-routing.h.
Referenced by CancelPassivePacketTimer(), CheckSendBuffer(), ForwardPacket(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), and SendPacketFromBuffer().
|
private |
Definition at line 807 of file dsr-routing.h.
Referenced by PassiveScheduleTimerExpire().
|
private |
priority queues
Definition at line 926 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardErrPacket(), IncreaseRetransTimer(), PriorityScheduler(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), SendUnreachError(), and Start().
|
private |
The id assigned to each route request.
Definition at line 842 of file dsr-routing.h.
Referenced by SendErrorRequest(), and SendInitialRequest().
|
private |
The base time interval between route requests.
Definition at line 801 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleRreqRetry().
|
private |
The request table identifiers.
Definition at line 848 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The max size of the request table size.
Definition at line 846 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
the increase time for retransmission timer when face network congestion
Definition at line 893 of file dsr-routing.h.
Referenced by GetTypeId(), and IncreaseRetransTimer().
|
private |
A "drop-front" queue used by the routing layer to cache routes found.
Definition at line 914 of file dsr-routing.h.
Referenced by AddAckReqHeader(), AddRoute(), AddRoute_Link(), CheckSendBuffer(), DeleteAllRoutesIncludeLink(), DoDispose(), GetRouteCache(), IsLinkCache(), LinkScheduleTimerExpire(), LookupRoute(), NetworkScheduleTimerExpire(), PacketNewRoute(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), SendPacketFromBuffer(), SendUnreachError(), SetRouteCache(), UpdateRouteEntry(), and UseExtends().
|
private |
The type of route sort methods.
Definition at line 879 of file dsr-routing.h.
|
private |
Maximum number of retransmissions of RREQ with TTL = NetDiameter to discover a route.
Definition at line 811 of file dsr-routing.h.
Referenced by GetTypeId(), and RouteRequestTimerExpire().
|
private |
A "drop-front" queue used by the routing layer to cache route request sent.
Definition at line 916 of file dsr-routing.h.
Referenced by CancelRreqTimer(), FindSourceEntry(), GetRequestTable(), Receive(), RouteRequestTimerExpire(), ScheduleRreqRetry(), Send(), SendErrorRequest(), SendInitialRequest(), and SetRequestTable().
|
private |
The send buffer.
Definition at line 824 of file dsr-routing.h.
Referenced by CheckSendBuffer(), PacketNewRoute(), RouteRequestTimerExpire(), Send(), SendErrorRequest(), SendPacketFromBuffer(), and Start().
|
private |
The maximum period of time that a routing protocol is allowed to buffer a packet for.
Definition at line 821 of file dsr-routing.h.
Referenced by GetTypeId(), PacketNewRoute(), Send(), SendUnreachError(), and Start().
|
private |
how often to check send buffer
Definition at line 869 of file dsr-routing.h.
Referenced by CheckSendBuffer(), GetTypeId(), and SendBuffTimerExpire().
|
private |
The send buffer timer.
Definition at line 867 of file dsr-routing.h.
Referenced by DsrRouting(), CheckSendBuffer(), and SendBuffTimerExpire().
|
private |
Definition at line 805 of file dsr-routing.h.
Referenced by NetworkScheduleTimerExpire(), and ScheduleNetworkPacketRetry().
|
private |
The initial decrease factor for link cache.
Definition at line 881 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
The initial increase factor for link cache.
Definition at line 883 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Whether to save sub route or not.
Definition at line 891 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Maximum number of packet transmission using link acknowledgment.
Definition at line 865 of file dsr-routing.h.
Referenced by GetTypeId(), and LinkScheduleTimerExpire().
|
private |
Maximum number of packet transmission using passive acknowledgment.
Definition at line 861 of file dsr-routing.h.
Referenced by GetTypeId(), and PassiveScheduleTimerExpire().
|
protected |
|
private |
Provides uniform random variables.
Definition at line 939 of file dsr-routing.h.
Referenced by DsrRouting(), AssignStreams(), CancelPacketTimerNextHop(), PriorityScheduler(), ScheduleCachedReply(), ScheduleInterRequest(), Send(), and SendPacketFromBuffer().
|
private |
The use extension of the life time for link cache.
Definition at line 889 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
static |
Define the dsr protocol number.
Definition at line 97 of file dsr-routing.h.
Referenced by GetProtocolNumber(), and PromiscReceive().
|
private |
The segment left value from SR header.
Definition at line 789 of file dsr-routing.h.
Referenced by CancelPassiveTimer(), and PassiveEntryCheck().