Dsr Routing base. More...
#include <dsr-routing.h>
Public Member Functions | |
DsrRouting () | |
Constructor. | |
virtual | ~DsrRouting () |
Destructor. | |
uint16_t | AddAckReqHeader (Ptr< Packet > &packet, Ipv4Address nextHop) |
int64_t | AssignStreams (int64_t stream) |
void | CallCancelPacketTimer (uint16_t ackId, Ipv4Header const &ipv4Header, Ipv4Address realSrc, Ipv4Address realDst) |
void | CancelNetworkPacketTimer (MaintainBuffEntry &mb) |
void | CancelPacketTimerNextHop (Ipv4Address nextHop, uint8_t protocol) |
void | CancelPassivePacketTimer (MaintainBuffEntry &mb) |
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. | |
bool | FindSamePackets (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t segsLeft) |
void | ForwardErrPacket (DsrOptionRerrUnreachHeader &rerr, DsrOptionSRHeader &sourceRoute, Ipv4Address nextHop, uint8_t protocol, Ptr< Ipv4Route > route) |
void | ForwardPacket (Ptr< const Packet > packet, DsrOptionSRHeader &sourceRoute, Ipv4Header const &ipv4Header, Ipv4Address source, Ipv4Address destination, Ipv4Address targetAddress, uint8_t protocol, Ptr< Ipv4Route > route) |
IpL4Protocol::DownTargetCallback | GetDownTarget (void) const |
IpL4Protocol::DownTargetCallback6 | GetDownTarget6 (void) const |
uint8_t | GetExtensionNumber () const |
Get the extension number. | |
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< Node > | GetNode () const |
Get the node. | |
Ptr< Node > | GetNodeWithAddress (Ipv4Address ipv4Address) |
Ptr< dsr::DsrOptions > | GetOption (int optionNumber) |
Get the option corresponding to optionNumber. | |
uint32_t | GetPriority (DsrMessageType messageType) |
int | GetProtocolNumber (void) const |
Get the dsr protocol number. | |
Ptr< dsr::RreqTable > | GetRequestTable () const |
Get the request table. | |
Ptr< dsr::RouteCache > | GetRouteCache () const |
Get the route cache. | |
void | IncreaseRetransTimer () |
void | Insert (Ptr< dsr::DsrOptions > option) |
Insert a new Dsr Option. | |
void | NetworkScheduleTimerExpire (MaintainBuffEntry &mb, uint8_t protocol) |
void | PacketNewRoute (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol) |
When route vector corrupted, originate a new packet, normally not happening. | |
void | PassiveScheduleTimerExpire (MaintainBuffEntry &mb, bool onlyPassive, uint8_t protocol) |
void | PrintVector (std::vector< Ipv4Address > &vec) |
Print the route vector. | |
void | PriorityScheduler (uint32_t priority, bool continueWithFirst) |
uint8_t | Process (Ptr< Packet > &packet, Ipv4Header const &ipv4Header, Ipv4Address dst, uint8_t *nextHeader, uint8_t protocol, bool &isDropped) |
Process method Called from Ipv4L3Protocol::Receive. | |
virtual enum IpL4Protocol::RxStatus | Receive (Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > incomingInterface) |
virtual enum IpL4Protocol::RxStatus | Receive (Ptr< Packet > p, Ipv6Address &src, Ipv6Address &dst, Ptr< Ipv6Interface > incomingInterface) |
void | RouteRequestTimerExpire (Ptr< Packet > packet, std::vector< Ipv4Address > address, uint32_t requestId, uint8_t protocol) |
void | SalvagePacket (Ptr< const Packet > packet, Ipv4Address source, Ipv4Address dst, uint8_t protocol) |
void | ScheduleCachedReply (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, Ptr< Ipv4Route > route, double hops) |
void | ScheduleInitialReply (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, Ptr< Ipv4Route > route) |
void | ScheduleInterRequest (Ptr< Packet > packet) |
void | ScheduleNetworkPacketRetry (MaintainBuffEntry &mb, bool isFirst, uint8_t protocol) |
void | SchedulePassivePacketRetry (MaintainBuffEntry &mb, bool onlyPassive, uint8_t protocol) |
void | Scheduler (uint32_t priority) |
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) |
void | SendAck (uint16_t ackId, Ipv4Address destination, Ipv4Address realSrc, Ipv4Address realDst, uint8_t protocol, Ptr< Ipv4Route > route) |
void | SendBuffTimerExpire () |
The send buffer timer expire. | |
void | SendErrorRequest (DsrOptionRerrUnreachHeader &rerr, uint8_t protocol) |
void | SendGratuitousReply (Ipv4Address replyTo, Ipv4Address replyFrom, std::vector< Ipv4Address > &nodeList, uint8_t protocol) |
void | SendInitialRequest (Ipv4Address source, Ipv4Address destination, uint8_t protocol) |
void | SendPacket (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, uint8_t protocol) |
void | SendPacketFromBuffer (DsrOptionSRHeader const &sourceRoute, Ipv4Address nextHop, uint8_t protocol) |
bool | SendRealDown (DsrNetworkQueueEntry &newEntry) |
void | SendReply (Ptr< Packet > packet, Ipv4Address source, Ipv4Address nextHop, Ptr< Ipv4Route > route) |
void | SendRequest (Ptr< Packet > packet, Ipv4Address source) |
void | SendRequestAndIncrement (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination) |
void | SendUnreachError (Ipv4Address errorHop, Ipv4Address destination, Ipv4Address originalDst, uint8_t salvage, uint8_t protocol) |
void | SetDownTarget (IpL4Protocol::DownTargetCallback callback) |
void | SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback) |
void | SetNode (Ptr< Node > node) |
Set the node. | |
void | SetRequestTable (Ptr< dsr::RreqTable > r) |
Set the node. | |
Ptr< Ipv4Route > | SetRoute (Ipv4Address nextHop, Ipv4Address srcAddress) |
void | SetRouteCache (Ptr< dsr::RouteCache > r) |
Set the route cache. | |
bool | IsLinkCache () |
used to direct to route cache | |
void | UseExtends (RouteCacheEntry::IP_VECTOR rt) |
bool | LookupRoute (Ipv4Address id, RouteCacheEntry &rt) |
bool | AddRoute_Link (RouteCacheEntry::IP_VECTOR nodelist, Ipv4Address source) |
bool | AddRoute (RouteCacheEntry &rt) |
void | DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node) |
bool | UpdateRouteEntry (Ipv4Address dst) |
![]() | |
virtual | ~IpL4Protocol () |
virtual void | ReceiveIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv4Address payloadSource, Ipv4Address payloadDestination, const uint8_t payload[8]) |
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]) |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type identificator. |
Static Public Attributes | |
static const uint8_t | PROT_NUMBER = 48 |
Define the dsr protocol number. |
Protected Member Functions | |
virtual void | DoDispose (void) |
Drop trace callback. | |
virtual void | NotifyNewAggregate () |
Protected Attributes | |
TracedCallback< Ptr< const Packet > > | m_dropTrace |
TracedCallback< const DsrOptionSRHeader & > | m_txPacketTrace |
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 () |
Additional Inherited Members | |
![]() | |
typedef Callback< void, Ptr < Packet >, Ipv4Address, Ipv4Address, uint8_t, Ptr < Ipv4Route > > | DownTargetCallback |
typedef Callback< void, Ptr < Packet >, Ipv6Address, Ipv6Address, uint8_t, Ptr < Ipv6Route > > | DownTargetCallback6 |
enum | RxStatus { RX_OK, RX_CSUM_FAILED, RX_ENDPOINT_CLOSED, RX_ENDPOINT_UNREACH } |
Dsr Routing base.
Definition at line 94 of file dsr-routing.h.
|
private |
Define the list to hold DSR options.
Definition at line 509 of file dsr-routing.h.
ns3::dsr::DsrRouting::DsrRouting | ( | ) |
Constructor.
Definition at line 268 of file dsr-routing.cc.
References Insert(), m_sendBuffTimer, m_uniformRandomVariable, NS_LOG_FUNCTION_NOARGS, ns3::Timer::Schedule(), ns3::Seconds(), SendBuffTimerExpire(), and ns3::Timer::SetFunction().
|
virtual |
uint16_t ns3::dsr::DsrRouting::AddAckReqHeader | ( | Ptr< Packet > & | packet, |
Ipv4Address | nextHop | ||
) |
Definition at line 1423 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::dsr::RouteCache::CheckUniqueAckId(), ns3::Packet::Copy(), ns3::Packet::CopyData(), 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::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), 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 | ( | RouteCacheEntry & | rt | ) |
Definition at line 511 of file dsr-routing.cc.
References ns3::dsr::RouteCache::AddRoute(), ns3::dsr::ErrorBuffer::DropPacketForErrLink(), ns3::dsr::RouteCacheEntry::GetVector(), m_errorBuffer, m_mainAddress, m_routeCache, and SearchNextHop().
bool ns3::dsr::DsrRouting::AddRoute_Link | ( | RouteCacheEntry::IP_VECTOR | nodelist, |
Ipv4Address | source | ||
) |
Definition at line 504 of file dsr-routing.cc.
References ns3::dsr::RouteCache::AddRoute_Link(), ns3::dsr::ErrorBuffer::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 2225 of file dsr-routing.cc.
References m_uniformRandomVariable, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
void ns3::dsr::DsrRouting::CallCancelPacketTimer | ( | uint16_t | ackId, |
Ipv4Header const & | ipv4Header, | ||
Ipv4Address | realSrc, | ||
Ipv4Address | realDst | ||
) |
Definition at line 1825 of file dsr-routing.cc.
References CancelNetworkPacketTimer(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetSource(), ns3::Simulator::Now(), and NS_LOG_FUNCTION.
void ns3::dsr::DsrRouting::CancelNetworkPacketTimer | ( | MaintainBuffEntry & | mb | ) |
Definition at line 1842 of file dsr-routing.cc.
References ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::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::MaintainBuffer::NetworkEqual(), NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by CallCancelPacketTimer(), and CancelPacketTimerNextHop().
void ns3::dsr::DsrRouting::CancelPacketTimerNextHop | ( | Ipv4Address | nextHop, |
uint8_t | protocol | ||
) |
Definition at line 1928 of file dsr-routing.cc.
References CancelNetworkPacketTimer(), ns3::Packet::Copy(), ns3::dsr::MaintainBuffer::Dequeue(), ns3::dsr::MaintainBuffer::Find(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::UniformRandomVariable::GetInteger(), ns3::dsr::MaintainBuffEntry::GetPacket(), ns3::dsr::MaintainBuffer::GetSize(), ns3::dsr::MaintainBuffEntry::GetSrc(), m_maintainBuffer, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_FUNCTION, NS_LOG_INFO, SalvagePacket(), and ns3::Simulator::Schedule().
Referenced by NetworkScheduleTimerExpire().
void ns3::dsr::DsrRouting::CancelPassivePacketTimer | ( | MaintainBuffEntry & | mb | ) |
Definition at line 1892 of file dsr-routing.cc.
References ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::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 FindSamePackets(), and PassiveScheduleTimerExpire().
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 2519 of file dsr-routing.cc.
References m_addressReqTimer, m_nonPropReqTimer, m_rreqTable, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::dsr::RreqTable::RemoveRreqEntry().
Referenced by RouteRequestTimerExpire(), and SendErrorRequest().
void ns3::dsr::DsrRouting::CheckSendBuffer | ( | ) |
Check the send buffer of packets with route when send buffer timer expire.
Definition at line 808 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::dsr::MaintainBuffer::Enqueue(), ns3::dsr::SendBuffer::GetBuffer(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::SendBuffer::GetSize(), ns3::Packet::GetSize(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::Timer::IsSuspended(), ns3::dsr::RouteCache::LookupRoute(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_ip, m_ipv4Route, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_priorityQueue, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, m_sendBuffInterval, m_sendBuffTimer, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_INFO, PacketNewRoute(), ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ns3::Timer::Resume(), ns3::Simulator::Schedule(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), Scheduler(), SearchNextHop(), SendBuffTimerExpire(), SendPacket(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), ns3::Timer::Suspend(), and ns3::dsr::RouteCache::UseExtends().
Referenced by SendBuffTimerExpire().
void ns3::dsr::DsrRouting::DeleteAllRoutesIncludeLink | ( | Ipv4Address | errorSrc, |
Ipv4Address | unreachNode, | ||
Ipv4Address | node | ||
) |
Definition at line 519 of file dsr-routing.cc.
References ns3::dsr::RouteCache::DeleteAllRoutesIncludeLink(), and m_routeCache.
|
protectedvirtual |
Drop trace callback.
Reimplemented from ns3::Object.
Definition at line 427 of file dsr-routing.cc.
References ns3::dsr::RouteCache::DelArpCache(), ns3::Ipv4Interface::GetArpCache(), ns3::Ipv4L3Protocol::GetInterface(), ns3::Ipv4L3Protocol::GetNetDevice(), ns3::Ipv4L3Protocol::GetNInterfaces(), ns3::Object::GetObject(), ns3::dsr::RouteCache::GetTxErrorCallback(), m_ipv4, m_node, m_routeCache, NS_LOG_FUNCTION_NOARGS, and ns3::ObjectBase::TraceDisconnectWithoutContext().
bool ns3::dsr::DsrRouting::FindSamePackets | ( | Ptr< Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | destination, | ||
uint8_t | segsLeft | ||
) |
Definition at line 1800 of file dsr-routing.cc.
References CancelPassivePacketTimer(), ns3::Packet::Copy(), m_maintainBuffer, NS_LOG_FUNCTION, ns3::dsr::MaintainBuffer::PromiscEqual(), ns3::dsr::MaintainBuffEntry::SetAckId(), ns3::dsr::MaintainBuffEntry::SetDst(), ns3::dsr::MaintainBuffEntry::SetPacket(), ns3::dsr::MaintainBuffEntry::SetSegsLeft(), and ns3::dsr::MaintainBuffEntry::SetSrc().
void ns3::dsr::DsrRouting::ForwardErrPacket | ( | DsrOptionRerrUnreachHeader & | rerr, |
DsrOptionSRHeader & | sourceRoute, | ||
Ipv4Address | nextHop, | ||
uint8_t | protocol, | ||
Ptr< Ipv4Route > | route | ||
) |
Definition at line 1259 of file dsr-routing.cc.
References ns3::Packet::AddHeader(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_downTarget, m_ip, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), ns3::dsr::DsrFsHeader::SetNextHeader(), and ns3::Ipv4Route::SetOutputDevice().
void ns3::dsr::DsrRouting::ForwardPacket | ( | Ptr< const Packet > | packet, |
DsrOptionSRHeader & | sourceRoute, | ||
Ipv4Header const & | ipv4Header, | ||
Ipv4Address | source, | ||
Ipv4Address | destination, | ||
Ipv4Address | targetAddress, | ||
uint8_t | protocol, | ||
Ptr< Ipv4Route > | route | ||
) |
Definition at line 2307 of file dsr-routing.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::MaintainBuffer::Enqueue(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrOptionSRHeader::GetSegmentsLeft(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_ackId, m_addressForwardCnt, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_downTarget, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, ns3::dsr::PassiveKey::m_segsLeft, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, NS_ASSERT_MSG, NS_LOG_FUNCTION, ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), SendPacket(), and ns3::dsr::DsrFsHeader::SetNextHeader().
|
virtual |
This method allows a caller to get the current down target callback set for this L4 protocol, for
Implements ns3::IpL4Protocol.
Definition at line 3123 of file dsr-routing.cc.
References m_downTarget.
|
virtual |
Implements ns3::IpL4Protocol.
Definition at line 3129 of file dsr-routing.cc.
References NS_FATAL_ERROR.
uint8_t ns3::dsr::DsrRouting::GetExtensionNumber | ( | ) | const |
Get the extension number.
uint16_t ns3::dsr::DsrRouting::GetIDfromIP | ( | Ipv4Address | address | ) |
Get the node id from ip address.
Definition at line 620 of file dsr-routing.cc.
References ns3::Ipv4::GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::NodeList::GetNNodes(), GetNode(), and ns3::Object::GetObject().
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.
Definition at line 636 of file dsr-routing.cc.
References ns3::Ipv4::GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), GetNode(), ns3::Object::GetObject(), and NS_LOG_DEBUG.
Referenced by PromiscReceive(), and Receive().
Ipv4Address ns3::dsr::DsrRouting::GetIPfromMAC | ( | Mac48Address | address | ) |
Get the Ip address from mac address.
Definition at line 530 of file dsr-routing.cc.
References ns3::Ipv4::GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4::GetNetDevice(), ns3::NodeList::GetNNodes(), GetNode(), ns3::Object::GetObject(), and NS_LOG_FUNCTION.
Referenced by PromiscReceive().
Get the node.
Definition at line 457 of file dsr-routing.cc.
References m_node, and NS_LOG_FUNCTION_NOARGS.
Referenced by GetIDfromIP(), GetIPfromID(), GetIPfromMAC(), and Receive().
Ptr<Node> ns3::dsr::DsrRouting::GetNodeWithAddress | ( | Ipv4Address | ipv4Address | ) |
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 3140 of file dsr-routing.cc.
References m_options.
Referenced by PromiscReceive(), and Receive().
uint32_t ns3::dsr::DsrRouting::GetPriority | ( | DsrMessageType | messageType | ) |
Definition at line 652 of file dsr-routing.cc.
References ns3::dsr::DSR_CONTROL_PACKET.
Referenced by CheckSendBuffer(), ForwardErrPacket(), IncreaseRetransTimer(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), and SendUnreachError().
|
virtual |
Get the dsr protocol number.
Implements ns3::IpL4Protocol.
Definition at line 613 of file dsr-routing.cc.
References PROT_NUMBER.
Referenced by SendRealDown().
Ptr< dsr::RreqTable > ns3::dsr::DsrRouting::GetRequestTable | ( | ) | const |
Get the request table.
Definition at line 483 of file dsr-routing.cc.
References m_rreqTable.
Referenced by GetTypeId().
Ptr< dsr::RouteCache > ns3::dsr::DsrRouting::GetRouteCache | ( | ) | const |
Get the route cache.
Definition at line 470 of file dsr-routing.cc.
References m_routeCache.
Referenced by GetTypeId().
|
static |
Get the type identificator.
This method returns the TypeId associated to ns3::dsr::DsrRouting.
Attributes defined for this type:
Attributes defined in parent class ns3::IpL4Protocol:
TraceSources defined for this type:
Reimplemented from ns3::IpL4Protocol.
Definition at line 101 of file dsr-routing.cc.
References GetRequestTable(), GetRouteCache(), m_blacklistTimeout, m_broadcastJitter, m_cacheType, m_discoveryHopLimit, m_dropTrace, m_graReplyTableSize, m_gratReplyHoldoff, m_initStability, 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_tryPassiveAcks, m_txPacketTrace, m_useExtends, ns3::MakeTraceSourceAccessor(), ns3::MilliSeconds(), ns3::Seconds(), ns3::TypeId::SetParent(), SetRequestTable(), and SetRouteCache().
void ns3::dsr::DsrRouting::IncreaseRetransTimer | ( | ) |
Definition at line 1572 of file dsr-routing.cc.
References ns3::dsr::DSR_DATA_PACKET, GetPriority(), ns3::dsr::DsrNetworkQueue::GetQueue(), 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 3135 of file dsr-routing.cc.
References m_options.
Referenced by DsrRouting().
bool ns3::dsr::DsrRouting::IsLinkCache | ( | ) |
used to direct to route cache
Definition at line 489 of file dsr-routing.cc.
References ns3::dsr::RouteCache::IsLinkCache(), and m_routeCache.
bool ns3::dsr::DsrRouting::LookupRoute | ( | Ipv4Address | id, |
RouteCacheEntry & | rt | ||
) |
Definition at line 499 of file dsr-routing.cc.
References ns3::dsr::RouteCache::LookupRoute(), and m_routeCache.
void ns3::dsr::DsrRouting::NetworkScheduleTimerExpire | ( | MaintainBuffEntry & | mb, |
uint8_t | protocol | ||
) |
Definition at line 2233 of file dsr-routing.cc.
References CancelPacketTimerNextHop(), ns3::Packet::Copy(), ns3::Packet::CopyData(), ns3::dsr::RouteCache::DeleteAllRoutesIncludeLink(), ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetPacket(), ns3::dsr::DsrOptionSRHeader::GetSalvage(), ns3::dsr::MaintainBuffEntry::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, NS_LOG_DEBUG, NS_LOG_LOGIC, PrintVector(), ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ScheduleNetworkPacketRetry(), SendPacket(), SendUnreachError(), and ns3::dsr::DsrOptionSRHeader::SetNumberAddress().
Referenced by ScheduleNetworkPacketRetry().
|
protectedvirtual |
This method is invoked whenever two sets of objects are aggregated together. It is invoked exactly once for each object in both sets. This method can be overriden by subclasses who wish to be notified of aggregation events. These subclasses must chain up to their base class NotifyNewAggregate method. It is safe to call GetObject and AggregateObject from within this method.
This function must be implemented in the stack that needs to notify other stacks connected to the node of their presence in the node.
Reimplemented from ns3::Object.
Definition at line 309 of file dsr-routing.cc.
References ns3::Object::GetObject(), ns3::Ipv4L3Protocol::Insert(), m_ip, m_ipv4, m_node, ns3::MakeCallback(), 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.
Definition at line 1057 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::SendBuffer::Enqueue(), ns3::dsr::MaintainBuffer::Enqueue(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Packet::GetUid(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::dsr::RouteCache::LookupRoute(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, m_addressReqTimer, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::NetworkKey::m_nextHop, m_nonPropReqTimer, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, m_sendBufferTimeout, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), SearchNextHop(), SendInitialRequest(), SendPacket(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::RouteCache::UseExtends().
Referenced by CheckSendBuffer(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), SendRerrWhenBreaksLinkToNextHop(), and SendUnreachError().
void ns3::dsr::DsrRouting::PassiveScheduleTimerExpire | ( | MaintainBuffEntry & | mb, |
bool | onlyPassive, | ||
uint8_t | protocol | ||
) |
Definition at line 2174 of file dsr-routing.cc.
References ns3::dsr::MaintainBuffer::AllEqual(), CancelPassivePacketTimer(), ns3::Packet::Copy(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetPacket(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::GetSrc(), ns3::dsr::PassiveKey::m_ackId, ns3::dsr::PassiveKey::m_destination, m_mainAddress, m_maintainBuffer, 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(), SendPacket(), and SetRoute().
Referenced by SchedulePassivePacketRetry().
void ns3::dsr::DsrRouting::PrintVector | ( | std::vector< Ipv4Address > & | vec | ) |
Print the route vector.
Definition at line 548 of file dsr-routing.cc.
References NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by NetworkScheduleTimerExpire().
void ns3::dsr::DsrRouting::PriorityScheduler | ( | uint32_t | priority, |
bool | continueWithFirst | ||
) |
Definition at line 1499 of file dsr-routing.cc.
References ns3::dsr::DsrNetworkQueue::Dequeue(), ns3::UniformRandomVariable::GetInteger(), ns3::dsr::DsrNetworkQueue::GetSize(), IncreaseRetransTimer(), m_numPriorityQueues, m_priorityQueue, m_uniformRandomVariable, ns3::MicroSeconds(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Seconds(), and SendRealDown().
Referenced by Scheduler().
uint8_t ns3::dsr::DsrRouting::Process | ( | Ptr< Packet > & | packet, |
Ipv4Header const & | ipv4Header, | ||
Ipv4Address | dst, | ||
uint8_t * | nextHeader, | ||
uint8_t | protocol, | ||
bool & | isDropped | ||
) |
Process method Called from Ipv4L3Protocol::Receive.
packet | the packet |
offset | the offset of the extension to process |
dst | destination address of the packet received (i.e. us) |
nextHeader | the next header |
isDropped | if the packet must be dropped |
|
private |
Promiscuous receive data packets destined to some other node.
Definition at line 998 of file dsr-routing.cc.
References ns3::Mac48Address::ConvertFrom(), ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::Ipv4Header::GetDestination(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIPfromID(), GetIPfromMAC(), ns3::dsr::DsrFsHeader::GetNextHeader(), GetOption(), ns3::Ipv4Header::GetProtocol(), ns3::Packet::GetSize(), ns3::Ipv4Header::GetSource(), ns3::dsr::DsrFsHeader::GetSourceId(), ns3::Packet::GetUid(), m_mainAddress, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_INFO, ns3::NetDevice::PACKET_OTHERHOST, ns3::Ipv4L3Protocol::PROT_NUMBER, PROT_NUMBER, ns3::Packet::RemoveAtStart(), and ns3::Packet::RemoveHeader().
Referenced by Start().
|
virtual |
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.
Implements ns3::IpL4Protocol.
Definition at line 2913 of file dsr-routing.cc.
References ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::dsr::RreqTable::FindUnidirectional(), ns3::Ipv4Header::GetDestination(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIPfromID(), ns3::dsr::DsrFsHeader::GetNextHeader(), GetNode(), ns3::Object::GetObject(), GetOption(), ns3::Ipv4L3Protocol::GetProtocol(), ns3::Packet::GetSize(), ns3::Ipv4Header::GetSource(), ns3::dsr::DsrFsHeader::GetSourceId(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4Address::IsMulticast(), m_dropTrace, m_mainAddress, m_node, m_rreqTable, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ns3::IpL4Protocol::RX_CSUM_FAILED, ns3::IpL4Protocol::RX_ENDPOINT_CLOSED, ns3::IpL4Protocol::RX_ENDPOINT_UNREACH, ns3::IpL4Protocol::RX_OK, ns3::dsr::DsrOptionRerrUnsupportHeader::SetErrorDst(), ns3::dsr::DsrOptionRerrUnsupportHeader::SetErrorSrc(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrOptionRerrUnsupportHeader::SetSalvage(), and ns3::dsr::DsrOptionRerrUnsupportHeader::SetUnsupported().
|
virtual |
p | packet to forward up |
src | source IPv6 address |
dst | destination IPv6 address |
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 3100 of file dsr-routing.cc.
References 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 | ||
) |
Definition at line 2640 of file dsr-routing.cc.
References ns3::Packet::AddPacketTag(), CancelRreqTimer(), ns3::Packet::Copy(), ns3::dsr::SendBuffer::DropPacketWithDst(), ns3::dsr::RreqTable::FindAndUpdate(), ns3::dsr::RreqTable::GetRreqCnt(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::dsr::RouteCache::LookupRoute(), m_discoveryHopLimit, m_mainAddress, m_routeCache, m_rreqRetries, m_rreqTable, m_sendBuffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, PacketNewRoute(), ns3::Packet::RemoveHeader(), ScheduleRreqRetry(), SearchNextHop(), SendPacketFromBuffer(), SendRequest(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::SocketIpTtlTag::SetTtl(), and ns3::dsr::RouteCache::UseExtends().
Referenced by ScheduleRreqRetry().
void ns3::dsr::DsrRouting::SalvagePacket | ( | Ptr< const Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | dst, | ||
uint8_t | protocol | ||
) |
Definition at line 1957 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::dsr::RouteCache::CheckUniqueAckId(), ns3::Packet::Copy(), ns3::Packet::CopyData(), ns3::dsr::DSR_DATA_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::dsr::DsrOptionSRHeader::GetSalvage(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::dsr::RouteCache::LookupRoute(), m_ackId, 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(), ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), Scheduler(), SearchNextHop(), ns3::dsr::DsrOptionAckReqHeader::SetAckId(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionSRHeader::SetNumberAddress(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::RouteCache::UseExtends().
Referenced by CancelPacketTimerNextHop().
void ns3::dsr::DsrRouting::ScheduleCachedReply | ( | Ptr< Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | destination, | ||
Ptr< Ipv4Route > | route, | ||
double | hops | ||
) |
Definition at line 2849 of file dsr-routing.cc.
References ns3::UniformRandomVariable::GetValue(), 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 | ||
) |
Definition at line 2838 of file dsr-routing.cc.
References NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and SendReply().
Definition at line 2735 of file dsr-routing.cc.
References ns3::UniformRandomVariable::GetInteger(), m_broadcastJitter, m_mainAddress, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendRequest().
void ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry | ( | MaintainBuffEntry & | mb, |
bool | isFirst, | ||
uint8_t | protocol | ||
) |
Definition at line 2080 of file dsr-routing.cc.
References AddAckReqHeader(), ns3::dsr::MaintainBuffer::AllEqual(), ns3::Timer::CANCEL_ON_DESTROY, ns3::Packet::Copy(), ns3::dsr::MaintainBuffer::Enqueue(), ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetPacket(), ns3::dsr::MaintainBuffEntry::GetSrc(), m_addressForwardCnt, m_addressForwardTimer, m_maintainBuffer, m_maxMaintainTime, m_nodeTraversalTime, m_sendRetries, NetworkScheduleTimerExpire(), NS_LOG_DEBUG, ns3::dsr::MaintainBuffEntry::SetAckId(), ns3::dsr::MaintainBuffEntry::SetExpireTime(), and ns3::dsr::MaintainBuffEntry::SetPacket().
Referenced by CheckSendBuffer(), ForwardPacket(), NetworkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), SendPacketFromBuffer(), and SendRerrWhenBreaksLinkToNextHop().
void ns3::dsr::DsrRouting::SchedulePassivePacketRetry | ( | MaintainBuffEntry & | mb, |
bool | onlyPassive, | ||
uint8_t | protocol | ||
) |
Definition at line 2055 of file dsr-routing.cc.
References ns3::Timer::CANCEL_ON_DESTROY, ns3::dsr::MaintainBuffEntry::GetDst(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffEntry::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, and PassiveScheduleTimerExpire().
Referenced by CheckSendBuffer(), ForwardPacket(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), SendPacketFromBuffer(), and SendRerrWhenBreaksLinkToNextHop().
void ns3::dsr::DsrRouting::Scheduler | ( | uint32_t | priority | ) |
Definition at line 1492 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.
dst | The dst address of the route request |
Definition at line 2568 of file dsr-routing.cc.
References ns3::Timer::CANCEL_ON_DESTROY, ns3::dsr::RreqTable::GetRreqCnt(), ns3::Time::GetSeconds(), m_addressReqTimer, m_maxRequestPeriod, m_nonPropReqTimer, m_nonpropRequestTimeout, m_requestPeriod, m_rreqTable, NS_LOG_DEBUG, NS_LOG_FUNCTION, and RouteRequestTimerExpire().
Referenced by RouteRequestTimerExpire(), SendErrorRequest(), and SendInitialRequest().
Ipv4Address ns3::dsr::DsrRouting::SearchNextHop | ( | Ipv4Address | ipv4Address, |
std::vector< Ipv4Address > & | vec | ||
) |
Get the next hop of the route.
Definition at line 568 of file dsr-routing.cc.
References NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by AddRoute(), AddRoute_Link(), CheckSendBuffer(), PacketNewRoute(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), SendRerrWhenBreaksLinkToNextHop(), and SendUnreachError().
void ns3::dsr::DsrRouting::Send | ( | Ptr< Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | destination, | ||
uint8_t | protocol, | ||
Ptr< Ipv4Route > | route | ||
) |
Definition at line 1300 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::SendBuffer::Enqueue(), ns3::dsr::MaintainBuffer::Enqueue(), GetIDfromIP(), ns3::UniformRandomVariable::GetInteger(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::RreqTable::GetRreqCnt(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsr::RouteCache::LookupRoute(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, m_addressReqTimer, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_downTarget, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::NetworkKey::m_nextHop, m_nonPropReqTimer, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_routeCache, m_rreqTable, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, m_sendBufferTimeout, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, m_uniformRandomVariable, ns3::MilliSeconds(), ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PacketNewRoute(), ns3::Simulator::Schedule(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), SearchNextHop(), SendInitialRequest(), SendPacket(), 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(), ns3::dsr::DsrFsHeader::SetSourceId(), and ns3::dsr::RouteCache::UseExtends().
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 | ||
) |
Definition at line 2860 of file dsr-routing.cc.
References ns3::Packet::AddHeader(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_downTarget, m_ip, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), ns3::dsr::DsrOptionAckHeader::SetAckId(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrOptionAckHeader::SetRealDst(), and ns3::dsr::DsrOptionAckHeader::SetRealSrc().
void ns3::dsr::DsrRouting::SendBuffTimerExpire | ( | ) |
The send buffer timer expire.
Definition at line 798 of file dsr-routing.cc.
References ns3::Timer::Cancel(), CheckSendBuffer(), ns3::Timer::IsRunning(), m_sendBuffInterval, m_sendBuffTimer, and ns3::Timer::Schedule().
Referenced by CheckSendBuffer(), and DsrRouting().
void ns3::dsr::DsrRouting::SendErrorRequest | ( | DsrOptionRerrUnreachHeader & | rerr, |
uint8_t | protocol | ||
) |
Definition at line 2419 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(), ns3::Packet::AddPacketTag(), CancelRreqTimer(), ns3::dsr::RreqTable::CheckUniqueRreqId(), ns3::Packet::Copy(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::dsr::RouteCache::IsLinkCache(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsr::RouteCache::LookupRoute(), m_addressReqTimer, m_discoveryHopLimit, m_downTarget, m_mainAddress, m_nonPropReqTimer, m_requestId, m_routeCache, m_rreqTable, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PacketNewRoute(), ScheduleRreqRetry(), SearchNextHop(), SendPacketFromBuffer(), SendRequest(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), ns3::SocketIpTtlTag::SetTtl(), and ns3::dsr::RouteCache::UseExtends().
void ns3::dsr::DsrRouting::SendGratuitousReply | ( | Ipv4Address | replyTo, |
Ipv4Address | replyFrom, | ||
std::vector< Ipv4Address > & | nodeList, | ||
uint8_t | protocol | ||
) |
Push back the node addresses other than those between srcAddress and our own ip address
Definition at line 2747 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::GraReply::AddEntry(), ns3::Packet::AddHeader(), ns3::dsr::GraReply::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 | ||
) |
Definition at line 2372 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(), ns3::Packet::AddPacketTag(), ns3::dsr::RreqTable::CheckUniqueRreqId(), ns3::Packet::Copy(), GetIDfromIP(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::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 | ||
) |
Definition at line 1466 of file dsr-routing.cc.
References ns3::dsr::DSR_DATA_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::Ipv4::GetInterfaceForAddress(), ns3::Ipv4::GetNetDevice(), GetPriority(), m_ip, m_ipv4Route, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), ns3::Ipv4Route::SetOutputDevice(), and SetRoute().
Referenced by CheckSendBuffer(), ForwardPacket(), NetworkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), SendPacketFromBuffer(), and SendRerrWhenBreaksLinkToNextHop().
void ns3::dsr::DsrRouting::SendPacketFromBuffer | ( | DsrOptionSRHeader const & | sourceRoute, |
Ipv4Address | nextHop, | ||
uint8_t | protocol | ||
) |
Definition at line 1609 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::Packet::CopyData(), data, ns3::dsr::SendBuffer::Dequeue(), ns3::dsr::ErrorBuffer::Dequeue(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::dsr::MaintainBuffer::Enqueue(), ns3::dsr::SendBuffer::Find(), ns3::dsr::ErrorBuffer::Find(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), GetIDfromIP(), ns3::UniformRandomVariable::GetInteger(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst(), ns3::dsr::SendBuffEntry::GetPacket(), ns3::dsr::ErrorBuffEntry::GetPacket(), GetPriority(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage(), ns3::dsr::SendBuffer::GetSize(), ns3::dsr::ErrorBuffer::GetSize(), ns3::Packet::GetSize(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), ns3::dsr::RouteCache::IsLinkCache(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_downTarget, m_errorBuffer, m_ip, m_ipv4Route, m_mainAddress, m_maintainBuffer, m_maxMaintainTime, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_priorityQueue, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, m_sendBuffer, 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, ns3::Packet::RemoveAtStart(), ns3::Packet::RemoveHeader(), ns3::Simulator::Schedule(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), Scheduler(), SendPacket(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrFsHeader::SetSourceId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode(), and ns3::dsr::RouteCache::UseExtends().
Referenced by RouteRequestTimerExpire(), Send(), and SendErrorRequest().
bool ns3::dsr::DsrRouting::SendRealDown | ( | DsrNetworkQueueEntry & | newEntry | ) |
Definition at line 1597 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 | ||
) |
Definition at line 2809 of file dsr-routing.cc.
References ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::Ipv4L3Protocol::GetInterfaceForAddress(), ns3::Ipv4L3Protocol::GetNetDevice(), GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_downTarget, m_ipv4, m_mainAddress, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, Scheduler(), and ns3::Ipv4Route::SetOutputDevice().
Referenced by ScheduleCachedReply(), ScheduleInitialReply(), and SendGratuitousReply().
void ns3::dsr::DsrRouting::SendRequest | ( | Ptr< Packet > | packet, |
Ipv4Address | source | ||
) |
Definition at line 2709 of file dsr-routing.cc.
References ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), GetPriority(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_broadcast, m_downTarget, m_priorityQueue, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and Scheduler().
Referenced by RouteRequestTimerExpire(), ScheduleInterRequest(), SendErrorRequest(), and SendInitialRequest().
void ns3::dsr::DsrRouting::SendRequestAndIncrement | ( | Ptr< Packet > | packet, |
Ipv4Address | source, | ||
Ipv4Address | destination | ||
) |
|
private |
Send the route error message when the link breaks to the next hop.
Definition at line 664 of file dsr-routing.cc.
References ns3::Packet::Copy(), ns3::dsr::RouteCache::DeleteAllRoutesIncludeLink(), ns3::dsr::MaintainBuffer::Dequeue(), ns3::dsr::MaintainBuffer::Find(), ns3::dsr::MaintainBuffEntry::GetAckId(), ns3::dsr::DsrOptionField::GetDsrOptionsOffset(), ns3::dsr::MaintainBuffEntry::GetDst(), ns3::UniformRandomVariable::GetInteger(), ns3::dsr::MaintainBuffEntry::GetNextHop(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::MaintainBuffEntry::GetOurAdd(), ns3::dsr::MaintainBuffEntry::GetPacket(), ns3::dsr::DsrOptionSRHeader::GetSalvage(), ns3::dsr::MaintainBuffEntry::GetSegsLeft(), ns3::dsr::MaintainBuffer::GetSize(), ns3::dsr::MaintainBuffEntry::GetSrc(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::dsr::RouteCache::LookupRoute(), ns3::dsr::NetworkKey::m_ackId, ns3::dsr::PassiveKey::m_ackId, m_addressForwardCnt, ns3::dsr::NetworkKey::m_destination, ns3::dsr::PassiveKey::m_destination, m_mainAddress, m_maintainBuffer, m_maxSalvageCount, ns3::dsr::NetworkKey::m_nextHop, ns3::dsr::NetworkKey::m_ourAdd, m_passiveCnt, m_routeCache, ns3::dsr::PassiveKey::m_segsLeft, ns3::dsr::NetworkKey::m_source, ns3::dsr::PassiveKey::m_source, m_uniformRandomVariable, ns3::MilliSeconds(), NS_LOG_DEBUG, NS_LOG_FUNCTION, PacketNewRoute(), ns3::Packet::RemoveHeader(), ns3::Simulator::Schedule(), ScheduleNetworkPacketRetry(), SchedulePassivePacketRetry(), SearchNextHop(), SendPacket(), SendUnreachError(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionSRHeader::SetNumberAddress(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), and ns3::dsr::RouteCache::UseExtends().
Referenced by Start().
void ns3::dsr::DsrRouting::SendUnreachError | ( | Ipv4Address | errorHop, |
Ipv4Address | destination, | ||
Ipv4Address | originalDst, | ||
uint8_t | salvage, | ||
uint8_t | protocol | ||
) |
Definition at line 1161 of file dsr-routing.cc.
References ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::dsr::DSR_CONTROL_PACKET, ns3::dsr::DsrNetworkQueue::Enqueue(), ns3::dsr::ErrorBuffer::Enqueue(), GetIDfromIP(), ns3::Ipv4::GetInterfaceForAddress(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::Ipv4::GetNetDevice(), GetPriority(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::dsr::RouteCacheEntry::GetVector(), ns3::dsr::RouteCache::IsLinkCache(), ns3::dsr::RouteCache::LookupRoute(), m_addressReqTimer, m_errorBuffer, m_ip, m_ipv4Route, m_mainAddress, m_nonPropReqTimer, m_priorityQueue, m_routeCache, m_sendBufferTimeout, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PacketNewRoute(), Scheduler(), SearchNextHop(), SendInitialRequest(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc(), ns3::dsr::DsrOptionRerrHeader::SetErrorType(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst(), ns3::Ipv4Route::SetOutputDevice(), ns3::dsr::DsrFsHeader::SetPayloadLength(), SetRoute(), ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(), ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(), ns3::dsr::DsrFsHeader::SetSourceId(), ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode(), and ns3::dsr::RouteCache::UseExtends().
Referenced by NetworkScheduleTimerExpire(), and SendRerrWhenBreaksLinkToNextHop().
|
virtual |
This method allows a caller to set the current down target callback set for this L4 protocol
cb | current Callback for the L4 protocol |
Implements ns3::IpL4Protocol.
Definition at line 3110 of file dsr-routing.cc.
References m_downTarget.
Referenced by ns3::DsrHelper::Create(), and NotifyNewAggregate().
|
virtual |
Implements ns3::IpL4Protocol.
Definition at line 3116 of file dsr-routing.cc.
References NS_FATAL_ERROR.
Set the node.
node | the node to set |
Definition at line 451 of file dsr-routing.cc.
References m_node.
Referenced by ns3::DsrMainHelper::Install(), and NotifyNewAggregate().
void ns3::dsr::DsrRouting::SetRequestTable | ( | Ptr< dsr::RreqTable > | r | ) |
Set the node.
the | request table to set |
Definition at line 476 of file dsr-routing.cc.
References m_rreqTable.
Referenced by GetTypeId(), and Start().
Ptr< Ipv4Route > ns3::dsr::DsrRouting::SetRoute | ( | Ipv4Address | nextHop, |
Ipv4Address | srcAddress | ||
) |
Definition at line 602 of file dsr-routing.cc.
References m_ipv4Route, NS_LOG_FUNCTION, ns3::Ipv4Route::SetDestination(), ns3::Ipv4Route::SetGateway(), and ns3::Ipv4Route::SetSource().
Referenced by CheckSendBuffer(), PacketNewRoute(), PassiveScheduleTimerExpire(), RouteRequestTimerExpire(), SalvagePacket(), SendErrorRequest(), SendGratuitousReply(), SendPacket(), SendPacketFromBuffer(), and SendUnreachError().
void ns3::dsr::DsrRouting::SetRouteCache | ( | Ptr< dsr::RouteCache > | r | ) |
Set the route cache.
the | route cache to set |
Definition at line 463 of file dsr-routing.cc.
References m_routeCache.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 336 of file dsr-routing.cc.
References ns3::dsr::RouteCache::AddArpCache(), ns3::Ipv4L3Protocol::GetAddress(), ns3::Ipv4Interface::GetArpCache(), ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Ipv4L3Protocol::GetInterface(), ns3::Ipv4L3Protocol::GetInterfaceForAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4L3Protocol::GetNetDevice(), ns3::Ipv4L3Protocol::GetNInterfaces(), ns3::Object::GetObject(), ns3::Time::GetSeconds(), ns3::dsr::RouteCache::GetTxErrorCallback(), 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_DEBUG, NS_LOG_FUNCTION, PromiscReceive(), ns3::dsr::RouteCache::ScheduleTimer(), SendRerrWhenBreaksLinkToNextHop(), ns3::dsr::RouteCache::SetCacheTimeout(), ns3::dsr::RouteCache::SetCacheType(), ns3::dsr::RouteCache::SetCallback(), ns3::dsr::ErrorBuffer::SetErrorBufferTimeout(), ns3::dsr::GraReply::SetGraTableSize(), ns3::dsr::RreqTable::SetInitHopLimit(), ns3::dsr::RouteCache::SetInitStability(), ns3::dsr::MaintainBuffer::SetMaintainBufferTimeout(), ns3::dsr::RouteCache::SetMaxCacheLen(), ns3::dsr::RouteCache::SetMaxEntriesEachDst(), ns3::dsr::SendBuffer::SetMaxQueueLen(), ns3::dsr::ErrorBuffer::SetMaxQueueLen(), ns3::dsr::MaintainBuffer::SetMaxQueueLen(), ns3::dsr::RouteCache::SetMinLifeTime(), ns3::NetDevice::SetPromiscReceiveCallback(), SetRequestTable(), SetRouteCache(), ns3::dsr::RreqTable::SetRreqIdSize(), ns3::dsr::RreqTable::SetRreqTableSize(), ns3::dsr::SendBuffer::SetSendBufferTimeout(), ns3::dsr::RouteCache::SetStabilityDecrFactor(), ns3::dsr::RouteCache::SetStabilityIncrFactor(), ns3::dsr::RouteCache::SetSubRoute(), ns3::dsr::RreqTable::SetUniqueRreqIdSize(), ns3::dsr::RouteCache::SetUseExtends(), and ns3::ObjectBase::TraceConnectWithoutContext().
Referenced by NotifyNewAggregate().
bool ns3::dsr::DsrRouting::UpdateRouteEntry | ( | Ipv4Address | dst | ) |
Definition at line 524 of file dsr-routing.cc.
References m_routeCache, and ns3::dsr::RouteCache::UpdateRouteEntry().
void ns3::dsr::DsrRouting::UseExtends | ( | RouteCacheEntry::IP_VECTOR | rt | ) |
Definition at line 494 of file dsr-routing.cc.
References m_routeCache, and ns3::dsr::RouteCache::UseExtends().
|
private |
Definition at line 575 of file dsr-routing.h.
Referenced by AddAckReqHeader(), ForwardPacket(), and SalvagePacket().
|
private |
Definition at line 647 of file dsr-routing.h.
|
private |
Definition at line 629 of file dsr-routing.h.
Referenced by CancelNetworkPacketTimer(), CheckSendBuffer(), ForwardPacket(), NetworkScheduleTimerExpire(), PacketNewRoute(), ScheduleNetworkPacketRetry(), Send(), SendPacketFromBuffer(), and SendRerrWhenBreaksLinkToNextHop().
|
private |
Definition at line 627 of file dsr-routing.h.
Referenced by CancelNetworkPacketTimer(), IncreaseRetransTimer(), and ScheduleNetworkPacketRetry().
|
private |
Definition at line 623 of file dsr-routing.h.
Referenced by CancelRreqTimer(), PacketNewRoute(), ScheduleRreqRetry(), Send(), SendErrorRequest(), and SendUnreachError().
|
private |
Definition at line 583 of file dsr-routing.h.
Referenced by GetTypeId().
|
private |
Definition at line 585 of file dsr-routing.h.
Referenced by SendRequest(), and Start().
|
private |
Definition at line 587 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleInterRequest().
|
private |
Definition at line 603 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 645 of file dsr-routing.h.
|
private |
Definition at line 533 of file dsr-routing.h.
Referenced by GetTypeId(), RouteRequestTimerExpire(), SendErrorRequest(), and Start().
|
private |
Definition at line 527 of file dsr-routing.h.
Referenced by ForwardErrPacket(), ForwardPacket(), GetDownTarget(), Send(), SendAck(), SendErrorRequest(), SendInitialRequest(), SendPacketFromBuffer(), SendRealDown(), SendReply(), SendRequest(), and SetDownTarget().
|
protected |
Definition at line 492 of file dsr-routing.h.
Referenced by GetTypeId(), and Receive().
|
private |
Definition at line 557 of file dsr-routing.h.
Referenced by AddRoute(), AddRoute_Link(), SendPacketFromBuffer(), SendUnreachError(), and Start().
|
private |
Definition at line 621 of file dsr-routing.h.
Referenced by SendGratuitousReply().
|
private |
Definition at line 643 of file dsr-routing.h.
Referenced by SendGratuitousReply(), and Start().
|
private |
Definition at line 601 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 597 of file dsr-routing.h.
Referenced by GetTypeId(), and SendGratuitousReply().
|
private |
Definition at line 611 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
Definition at line 519 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardErrPacket(), NotifyNewAggregate(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), and SendUnreachError().
|
private |
Definition at line 515 of file dsr-routing.h.
Referenced by DoDispose(), NotifyNewAggregate(), SendReply(), and Start().
Definition at line 517 of file dsr-routing.h.
Referenced by CheckSendBuffer(), SalvagePacket(), SendGratuitousReply(), SendPacket(), SendPacketFromBuffer(), SendUnreachError(), and SetRoute().
|
private |
Definition at line 523 of file dsr-routing.h.
Referenced by AddRoute(), CheckSendBuffer(), ForwardErrPacket(), ForwardPacket(), NetworkScheduleTimerExpire(), PacketNewRoute(), PassiveScheduleTimerExpire(), PromiscReceive(), Receive(), RouteRequestTimerExpire(), SalvagePacket(), ScheduleInterRequest(), Send(), SendAck(), SendErrorRequest(), SendGratuitousReply(), SendInitialRequest(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRerrWhenBreaksLinkToNextHop(), SendUnreachError(), and Start().
|
private |
Definition at line 571 of file dsr-routing.h.
Referenced by CancelNetworkPacketTimer(), CancelPacketTimerNextHop(), CheckSendBuffer(), FindSamePackets(), ForwardPacket(), PacketNewRoute(), PassiveScheduleTimerExpire(), ScheduleNetworkPacketRetry(), Send(), SendPacketFromBuffer(), SendRerrWhenBreaksLinkToNextHop(), and Start().
|
private |
Definition at line 563 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 565 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 569 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 559 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 561 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardPacket(), GetTypeId(), PacketNewRoute(), ScheduleNetworkPacketRetry(), Send(), SendPacketFromBuffer(), and Start().
|
private |
Definition at line 547 of file dsr-routing.h.
Referenced by GetTypeId(), and NetworkScheduleTimerExpire().
|
private |
Definition at line 531 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 529 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 599 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleRreqRetry().
|
private |
Definition at line 581 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 567 of file dsr-routing.h.
|
private |
Definition at line 535 of file dsr-routing.h.
Referenced by GetTypeId(), SalvagePacket(), and SendRerrWhenBreaksLinkToNextHop().
|
private |
Definition at line 551 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 613 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
Definition at line 521 of file dsr-routing.h.
Referenced by DoDispose(), GetNode(), NotifyNewAggregate(), Receive(), and SetNode().
|
private |
Definition at line 549 of file dsr-routing.h.
Referenced by GetTypeId(), ScheduleCachedReply(), and ScheduleNetworkPacketRetry().
|
private |
Definition at line 625 of file dsr-routing.h.
Referenced by CancelRreqTimer(), PacketNewRoute(), ScheduleRreqRetry(), Send(), SendErrorRequest(), and SendUnreachError().
|
private |
Definition at line 539 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleRreqRetry().
|
private |
Definition at line 639 of file dsr-routing.h.
Referenced by GetTypeId(), PriorityScheduler(), and Start().
|
private |
List of DSR Options supported.
Definition at line 513 of file dsr-routing.h.
Referenced by GetOption(), and Insert().
|
private |
Definition at line 589 of file dsr-routing.h.
Referenced by GetTypeId(), and SchedulePassivePacketRetry().
|
private |
Definition at line 633 of file dsr-routing.h.
Referenced by CancelPassivePacketTimer(), PassiveScheduleTimerExpire(), and SchedulePassivePacketRetry().
|
private |
Definition at line 631 of file dsr-routing.h.
Referenced by CancelPassivePacketTimer(), CheckSendBuffer(), ForwardPacket(), PacketNewRoute(), PassiveScheduleTimerExpire(), Send(), SendPacketFromBuffer(), and SendRerrWhenBreaksLinkToNextHop().
|
private |
Definition at line 543 of file dsr-routing.h.
Referenced by PassiveScheduleTimerExpire().
|
private |
Definition at line 641 of file dsr-routing.h.
Referenced by CheckSendBuffer(), ForwardErrPacket(), IncreaseRetransTimer(), PriorityScheduler(), SalvagePacket(), SendAck(), SendPacket(), SendPacketFromBuffer(), SendReply(), SendRequest(), SendUnreachError(), and Start().
|
private |
Definition at line 573 of file dsr-routing.h.
Referenced by SendErrorRequest(), and SendInitialRequest().
|
private |
Definition at line 537 of file dsr-routing.h.
Referenced by GetTypeId(), and ScheduleRreqRetry().
|
private |
Definition at line 579 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 577 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 619 of file dsr-routing.h.
Referenced by GetTypeId(), and IncreaseRetransTimer().
|
private |
Definition at line 635 of file dsr-routing.h.
Referenced by AddAckReqHeader(), AddRoute(), AddRoute_Link(), CheckSendBuffer(), DeleteAllRoutesIncludeLink(), DoDispose(), GetRouteCache(), IsLinkCache(), LookupRoute(), NetworkScheduleTimerExpire(), PacketNewRoute(), RouteRequestTimerExpire(), SalvagePacket(), Send(), SendErrorRequest(), SendPacketFromBuffer(), SendRerrWhenBreaksLinkToNextHop(), SendUnreachError(), SetRouteCache(), UpdateRouteEntry(), and UseExtends().
|
private |
Definition at line 605 of file dsr-routing.h.
|
private |
Definition at line 545 of file dsr-routing.h.
Referenced by GetTypeId(), and RouteRequestTimerExpire().
|
private |
Definition at line 637 of file dsr-routing.h.
Referenced by CancelRreqTimer(), GetRequestTable(), Receive(), RouteRequestTimerExpire(), ScheduleRreqRetry(), Send(), SendErrorRequest(), SendInitialRequest(), and SetRequestTable().
|
private |
Definition at line 555 of file dsr-routing.h.
Referenced by CheckSendBuffer(), PacketNewRoute(), RouteRequestTimerExpire(), Send(), SendPacketFromBuffer(), and Start().
|
private |
Definition at line 553 of file dsr-routing.h.
Referenced by GetTypeId(), PacketNewRoute(), Send(), SendUnreachError(), and Start().
|
private |
Definition at line 595 of file dsr-routing.h.
Referenced by CheckSendBuffer(), GetTypeId(), and SendBuffTimerExpire().
|
private |
Definition at line 593 of file dsr-routing.h.
Referenced by CheckSendBuffer(), DsrRouting(), and SendBuffTimerExpire().
|
private |
Definition at line 541 of file dsr-routing.h.
Referenced by NetworkScheduleTimerExpire(), and ScheduleNetworkPacketRetry().
|
private |
Definition at line 607 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 609 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 617 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
private |
Definition at line 591 of file dsr-routing.h.
Referenced by GetTypeId(), and PassiveScheduleTimerExpire().
|
protected |
Definition at line 493 of file dsr-routing.h.
Referenced by GetTypeId().
|
private |
Provides uniform random variables.
Definition at line 650 of file dsr-routing.h.
Referenced by AssignStreams(), CancelPacketTimerNextHop(), DsrRouting(), PriorityScheduler(), ScheduleCachedReply(), ScheduleInterRequest(), Send(), SendPacketFromBuffer(), and SendRerrWhenBreaksLinkToNextHop().
|
private |
Definition at line 615 of file dsr-routing.h.
Referenced by GetTypeId(), and Start().
|
static |
Define the dsr protocol number.
Definition at line 105 of file dsr-routing.h.
Referenced by GetProtocolNumber(), and PromiscReceive().
|
private |
Definition at line 525 of file dsr-routing.h.