A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches

An implementation of the ICMPv6 protocol. More...

#include "icmpv6-l4-protocol.h"

+ Inheritance diagram for ns3::Icmpv6L4Protocol:
+ Collaboration diagram for ns3::Icmpv6L4Protocol:

Public Member Functions

 Icmpv6L4Protocol ()
 Constructor.
 
 ~Icmpv6L4Protocol () override
 Destructor.
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
virtual Ptr< NdiscCacheCreateCache (Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
 Create a neighbor cache.
 
void DelayedSendMessage (Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
 Helper function used during delayed solicitation.
 
void DoDAD (Ipv6Address target, Ptr< Ipv6Interface > interface)
 Do the Duplication Address Detection (DAD).
 
NdiscCache::Ipv6PayloadHeaderPair ForgeEchoRequest (Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
 Forge an Echo Request.
 
NdiscCache::Ipv6PayloadHeaderPair ForgeNA (Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
 Forge a Neighbor Advertisement.
 
NdiscCache::Ipv6PayloadHeaderPair ForgeNS (Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
 Forge a Neighbor Solicitation.
 
NdiscCache::Ipv6PayloadHeaderPair ForgeRS (Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
 Forge a Router Solicitation.
 
virtual void FunctionDadTimeout (Ipv6Interface *interface, Ipv6Address addr)
 Function called when DAD timeout.
 
Time GetDadTimeout () const
 Get the DAD timeout.
 
Time GetDelayFirstProbe () const
 Neighbor Discovery node constants : delay for the first probe.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
uint8_t GetMaxMulticastSolicit () const
 Neighbor Discovery node constants: max multicast solicitations.
 
uint8_t GetMaxUnicastSolicit () const
 Neighbor Discovery node constants: max unicast solicitations.
 
Ptr< NodeGetNode ()
 Get the node.
 
int GetProtocolNumber () const override
 Get the protocol number.
 
Time GetReachableTime () const
 Neighbor Discovery node constants: reachable time.
 
Time GetRetransmissionTime () const
 Neighbor Discovery node constants: retransmission timer.
 
virtual int GetVersion () const
 Get the version of the protocol.
 
bool IsAlwaysDad () const
 Is the node must do DAD.
 
virtual bool Lookup (Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
 Lookup in the ND cache for the IPv6 address.
 
virtual bool Lookup (Ptr< Packet > p, const Ipv6Header &ipHeader, Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
 Lookup in the ND cache for the IPv6 address (similar as ARP protocol).
 
void NotifyNewAggregate () override
 This method is called by AggregateObject and completes the aggregation by setting the node in the ICMPv6 stack and adding ICMPv6 factory to IPv6 stack connected to the node.
 
IpL4Protocol::RxStatus Receive (Ptr< Packet > p, const Ipv4Header &header, Ptr< Ipv4Interface > interface) override
 Receive method.
 
IpL4Protocol::RxStatus Receive (Ptr< Packet > p, const Ipv6Header &header, Ptr< Ipv6Interface > interface) override
 Receive method.
 
void SendEchoReply (Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
 Send a Echo Reply.
 
void SendErrorDestinationUnreachable (Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
 Send an error Destination Unreachable.
 
void SendErrorParameterError (Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code, uint32_t ptr)
 Send an error Parameter Error.
 
void SendErrorTimeExceeded (Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
 Send an error Time Exceeded.
 
void SendErrorTooBig (Ptr< Packet > malformedPacket, Ipv6Address dst, uint32_t mtu)
 Send an error Too Big.
 
void SendMessage (Ptr< Packet > packet, Ipv6Address dst, Icmpv6Header &icmpv6Hdr, uint8_t ttl)
 Send a packet via ICMPv6.
 
void SendMessage (Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
 Send a packet via ICMPv6, note that packet already contains ICMPv6 header.
 
void SendNA (Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
 Send a Neighbor Advertisement.
 
virtual void SendNS (Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
 Send a Neighbor Solicitation.
 
void SendRedirection (Ptr< Packet > redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget)
 Send an ICMPv6 Redirection.
 
void SendRS (Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
 Send a Router Solicitation.
 
void SetDhcpv6Callback (Callback< void, uint32_t > cb)
 Set DHCPv6 callback.
 
void SetNode (Ptr< Node > node)
 Set the node.
 
- 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< ObjectGetObject () 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< ObjectGetObject (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.
 
SimpleRefCountoperator= (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 uint16_t GetStaticProtocolNumber ()
 Get ICMPv6 protocol number.
 
static TypeId GetTypeId ()
 Get the type ID.
 
- 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 = 58
 ICMPv6 protocol number (58).
 

Protected Types

typedef std::list< Ptr< NdiscCache > > CacheList
 container of NdiscCaches
 

Protected Member Functions

void DoDispose () override
 Dispose this object.
 
Ptr< NdiscCacheFindCache (Ptr< NetDevice > device)
 Get the cache corresponding to the device.
 
void Forward (Ipv6Address source, Icmpv6Header icmp, uint32_t info, Ipv6Header ipHeader, const uint8_t payload[8])
 Notify an ICMPv6 reception to upper layers (if requested).
 
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)
 
void HandleDestinationUnreachable (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Destination Unreachable method.
 
void HandleEchoRequest (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Echo Request method.
 
void HandleNA (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Neighbor Advertisement method.
 
void HandleNS (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Neighbor Solicitation method.
 
void HandlePacketTooBig (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Packet Too Big method.
 
void HandleParameterError (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Parameter Error method.
 
void HandleRA (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Router Advertisement method.
 
void HandleRedirection (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Redirection method.
 
void HandleRS (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Router Solicitation method.
 
virtual void HandleRsTimeout (Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
 Router Solicitation Timeout handler.
 
void HandleTimeExceeded (Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Receive Time Exceeded method.
 
void ReceiveLLA (Icmpv6OptionLinkLayerAddress lla, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
 Link layer address option processing.
 
void SetDownTarget (IpL4Protocol::DownTargetCallback cb) override
 This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 case)
 
void SetDownTarget6 (IpL4Protocol::DownTargetCallback6 cb) override
 This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 case)
 
- 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

bool m_alwaysDad
 Always do DAD ?
 
CacheList m_cacheList
 A list of cache by device.
 
ns3::TracedCallback< const Ipv6Address & > m_dadFailureAddressTrace
 The trace fired when a DAD fails, changing the address state to INVALID.
 
ns3::TracedCallback< const Ipv6Address & > m_dadSuccessAddressTrace
 The trace fired when a DAD completes and no duplicate address has been detected.
 
Time m_dadTimeout
 DAD timeout.
 
Time m_delayFirstProbe
 Neighbor Discovery node constants: delay for the first probe.
 
IpL4Protocol::DownTargetCallback6 m_downTarget
 callback to Ipv6::Send
 
EventId m_handleRsTimeoutEvent
 RS timeout handler event.
 
uint8_t m_maxMulticastSolicit
 Neighbor Discovery node constants: max multicast solicitations.
 
uint8_t m_maxUnicastSolicit
 Neighbor Discovery node constants: max unicast solicitations.
 
Ptr< Nodem_node
 The node.
 
Time m_reachableTime
 Neighbor Discovery node constants: reachable time.
 
Time m_retransmissionTime
 Neighbor Discovery node constants: retransmission timer.
 
Time m_rsFirstTransmissionTime
 First multicast RS transmissions [RFC 7559 ].
 
Time m_rsInitialRetransmissionTime
 Initial multicast RS retransmission time [RFC 7559 ].
 
uint32_t m_rsMaxRetransmissionCount
 Maximum number of multicast RS retransmissions [RFC 7559 ].
 
Time m_rsMaxRetransmissionDuration
 Maximum duration of multicast RS retransmissions [RFC 7559 ].
 
Time m_rsMaxRetransmissionTime
 Maximum time between multicast RS retransmissions [RFC 7559 ].
 
Time m_rsPrevRetransmissionTimeout
 Previous multicast RS retransmissions timeout [RFC 7559 ].
 
uint32_t m_rsRetransmissionCount {0}
 Multicast RS retransmissions counter [RFC 7559 ].
 
Ptr< UniformRandomVariablem_rsRetransmissionJitter
 Random jitter for RS retransmissions.
 
Ptr< RandomVariableStreamm_solicitationJitter
 Random jitter before sending solicitations.
 
Callback< void, uint32_tm_startDhcpv6
 The DHCPv6 callback when the M flag is set in a Router Advertisement.
 

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...
 

Detailed Description

An implementation of the ICMPv6 protocol.

Definition at line 42 of file icmpv6-l4-protocol.h.

Member Typedef Documentation

◆ CacheList

typedef std::list<Ptr<NdiscCache> > ns3::Icmpv6L4Protocol::CacheList
protected

container of NdiscCaches

Definition at line 432 of file icmpv6-l4-protocol.h.

Constructor & Destructor Documentation

◆ Icmpv6L4Protocol()

ns3::Icmpv6L4Protocol::Icmpv6L4Protocol ( )

Constructor.

Definition at line 154 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

◆ ~Icmpv6L4Protocol()

ns3::Icmpv6L4Protocol::~Icmpv6L4Protocol ( )
override

Destructor.

Definition at line 160 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::Icmpv6L4Protocol::AssignStreams ( int64_t stream)

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

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

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

Definition at line 183 of file icmpv6-l4-protocol.cc.

References m_rsRetransmissionJitter, m_solicitationJitter, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

◆ CreateCache()

Ptr< NdiscCache > ns3::Icmpv6L4Protocol::CreateCache ( Ptr< NetDevice > device,
Ptr< Ipv6Interface > interface )
virtual

Create a neighbor cache.

Parameters
devicethe NetDevice
interfacethe IPv6 interface
Returns
a smart pointer of NdCache or 0 if problem

Definition at line 1702 of file icmpv6-l4-protocol.cc.

References ns3::CreateObject(), ns3::NdiscCache::Flush(), m_cacheList, ns3::MakeCallback(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DelayedSendMessage()

void ns3::Icmpv6L4Protocol::DelayedSendMessage ( Ptr< Packet > packet,
Ipv6Address src,
Ipv6Address dst,
uint8_t ttl )

Helper function used during delayed solicitation.

Calls SendMessage internally

Parameters
packetthe packet to send which contains ICMPv6 header
srcsource address
dstdestination address
ttlnext hop limit

Definition at line 1203 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, and SendMessage().

Referenced by SendNS(), and SendRS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDAD()

void ns3::Icmpv6L4Protocol::DoDAD ( Ipv6Address target,
Ptr< Ipv6Interface > interface )

Do the Duplication Address Detection (DAD).

It consists in sending a NS with our IPv6 as target. If we received a NA with matched target address, we could not use the address, else the address pass from TENTATIVE to PERMANENT.

Parameters
targettarget address
interfaceinterface
Todo
disable multicast loopback to prevent NS probing to be received by the sender

Definition at line 255 of file icmpv6-l4-protocol.cc.

References ForgeNS(), ns3::Object::GetObject(), ns3::RandomVariableStream::GetValue(), m_alwaysDad, m_node, m_solicitationJitter, ns3::Ipv6Address::MakeSolicitedAddress(), ns3::MilliSeconds(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::Ipv6Interface::Send().

Referenced by ns3::Ipv6Interface::AddAddress().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::Icmpv6L4Protocol::DoDispose ( )
overrideprotectedvirtual

Dispose this object.

Reimplemented from ns3::Object.

Definition at line 166 of file icmpv6-l4-protocol.cc.

References ns3::Object::DoDispose(), m_cacheList, m_downTarget, m_node, NS_LOG_FUNCTION, and ns3::Callback< R, UArgs >::Nullify().

+ Here is the call graph for this function:

◆ FindCache()

Ptr< NdiscCache > ns3::Icmpv6L4Protocol::FindCache ( Ptr< NetDevice > device)
protected

Get the cache corresponding to the device.

Parameters
devicethe device
Returns
the NdiscCache associated with the device

Definition at line 1684 of file icmpv6-l4-protocol.cc.

References m_cacheList, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by HandleNA(), HandleNS(), HandleRedirection(), HandleRS(), Lookup(), Lookup(), and ReceiveLLA().

+ Here is the caller graph for this function:

◆ ForgeEchoRequest()

NdiscCache::Ipv6PayloadHeaderPair ns3::Icmpv6L4Protocol::ForgeEchoRequest ( Ipv6Address src,
Ipv6Address dst,
uint16_t id,
uint16_t seq,
Ptr< Packet > data )

Forge an Echo Request.

Parameters
srcsource address
dstdestination address
idID of the packet
seqsequence number
datathe data
Returns
Echo Request packet (with IPv6 header)

Definition at line 809 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), data, ns3::Icmpv6Echo::GetSerializedSize(), NS_LOG_FUNCTION, PROT_NUMBER, ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetHopLimit(), ns3::Icmpv6Echo::SetId(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), ns3::Icmpv6Echo::SetSeq(), and ns3::Ipv6Header::SetSource().

+ Here is the call graph for this function:

◆ ForgeNA()

NdiscCache::Ipv6PayloadHeaderPair ns3::Icmpv6L4Protocol::ForgeNA ( Ipv6Address src,
Ipv6Address dst,
Address * hardwareAddress,
uint8_t flags )

Forge a Neighbor Advertisement.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
hardwareAddressour mac address
flagsflags (bitfield => R (4), S (2), O (1))
Returns
NA packet (with IPv6 header)

Definition at line 1611 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Create(), ns3::Ipv6Address::GetAny(), ns3::Icmpv6NA::GetSerializedSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, ns3::Ipv6Header::SetDestination(), ns3::Icmpv6NA::SetFlagO(), ns3::Icmpv6NA::SetFlagR(), ns3::Icmpv6NA::SetFlagS(), ns3::Ipv6Header::SetHopLimit(), ns3::Icmpv6NA::SetIpv6Target(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), and ns3::Ipv6Header::SetSource().

Referenced by HandleNS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForgeNS()

NdiscCache::Ipv6PayloadHeaderPair ns3::Icmpv6L4Protocol::ForgeNS ( Ipv6Address src,
Ipv6Address dst,
Ipv6Address target,
Address hardwareAddress )

Forge a Neighbor Solicitation.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
targettarget IPv6 address
hardwareAddressour mac address
Returns
NS packet (with IPv6 header)

Definition at line 1655 of file icmpv6-l4-protocol.cc.

References ns3::Create(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), and ns3::Ipv6Header::SetSource().

Referenced by DoDAD().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForgeRS()

NdiscCache::Ipv6PayloadHeaderPair ns3::Icmpv6L4Protocol::ForgeRS ( Ipv6Address src,
Ipv6Address dst,
Address hardwareAddress )

Forge a Router Solicitation.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
hardwareAddressour mac address
Returns
RS packet (with IPv6 header)

Definition at line 777 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Create(), ns3::Icmpv6RS::GetSerializedSize(), ns3::Ipv6Address::IsAny(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), and ns3::Ipv6Header::SetSource().

+ Here is the call graph for this function:

◆ Forward()

void ns3::Icmpv6L4Protocol::Forward ( Ipv6Address source,
Icmpv6Header icmp,
uint32_t info,
Ipv6Header ipHeader,
const uint8_t payload[8] )
protected

Notify an ICMPv6 reception to upper layers (if requested).

Parameters
sourcethe ICMP source
icmpthe ICMP header
infoinformation about the ICMP
ipHeaderthe IP header carried by the ICMP
payloadthe data carried by the ICMP
Todo
assuming the ICMP is carrying a extensionless IP packet

Definition at line 359 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::GetCode(), ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetHopLimit(), ns3::Ipv6Header::GetNextHeader(), ns3::Object::GetObject(), ns3::Ipv6Header::GetSource(), ns3::Icmpv6Header::GetType(), m_node, NS_LOG_FUNCTION, and PROT_NUMBER.

Referenced by HandleDestinationUnreachable(), HandlePacketTooBig(), HandleParameterError(), and HandleTimeExceeded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FunctionDadTimeout()

void ns3::Icmpv6L4Protocol::FunctionDadTimeout ( Ipv6Interface * interface,
Ipv6Address addr )
virtual

Function called when DAD timeout.

Parameters
interfacethe interface
addrthe IPv6 address

Definition at line 1834 of file icmpv6-l4-protocol.cc.

References ns3::Ipv6Interface::GetAddress(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6Address::GetAllRoutersMulticast(), ns3::Ipv6Interface::GetDevice(), ns3::Ipv6Interface::GetNAddresses(), ns3::Object::GetObject(), ns3::Ipv6InterfaceAddress::GetState(), ns3::Ipv6InterfaceAddress::INVALID, ns3::Ipv6Address::IsLinkLocal(), m_dadSuccessAddressTrace, m_node, m_rsRetransmissionCount, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv6InterfaceAddress::PREFERRED, ns3::Simulator::Schedule(), ns3::Seconds(), SendRS(), and ns3::Ipv6Interface::SetState().

Referenced by ns3::Ipv6Interface::AddAddress().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDadTimeout()

Time ns3::Icmpv6L4Protocol::GetDadTimeout ( ) const

Get the DAD timeout.

Returns
the DAD timeout

Definition at line 1955 of file icmpv6-l4-protocol.cc.

References m_dadTimeout.

◆ GetDelayFirstProbe()

Time ns3::Icmpv6L4Protocol::GetDelayFirstProbe ( ) const

Neighbor Discovery node constants : delay for the first probe.

Returns
The time before a first probe for an Neighbor cache entry.

Definition at line 1949 of file icmpv6-l4-protocol.cc.

References m_delayFirstProbe.

◆ GetDownTarget()

IpL4Protocol::DownTargetCallback ns3::Icmpv6L4Protocol::GetDownTarget ( ) const
overrideprotectedvirtual

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

Returns
current Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 1911 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

◆ GetDownTarget6()

IpL4Protocol::DownTargetCallback6 ns3::Icmpv6L4Protocol::GetDownTarget6 ( ) const
overrideprotectedvirtual

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

Returns
current Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 1918 of file icmpv6-l4-protocol.cc.

References m_downTarget, and NS_LOG_FUNCTION.

◆ GetInstanceTypeId()

TypeId ns3::Icmpv6L4Protocol::GetInstanceTypeId ( ) const
overridevirtual

Get the most derived TypeId for this Object.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 148 of file icmpv6-l4-protocol.cc.

References GetTypeId(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetMaxMulticastSolicit()

uint8_t ns3::Icmpv6L4Protocol::GetMaxMulticastSolicit ( ) const

Neighbor Discovery node constants: max multicast solicitations.

Returns
The max multicast solicitations number.

Definition at line 1925 of file icmpv6-l4-protocol.cc.

References m_maxMulticastSolicit.

◆ GetMaxUnicastSolicit()

uint8_t ns3::Icmpv6L4Protocol::GetMaxUnicastSolicit ( ) const

Neighbor Discovery node constants: max unicast solicitations.

Returns
The max unicast solicitations number.

Definition at line 1931 of file icmpv6-l4-protocol.cc.

References m_maxUnicastSolicit.

◆ GetNode()

Ptr< Node > ns3::Icmpv6L4Protocol::GetNode ( )

Get the node.

Returns
node

Definition at line 220 of file icmpv6-l4-protocol.cc.

References m_node, and NS_LOG_FUNCTION.

◆ GetProtocolNumber()

int ns3::Icmpv6L4Protocol::GetProtocolNumber ( ) const
overridevirtual

Get the protocol number.

Returns
protocol number

Implements ns3::IpL4Protocol.

Definition at line 234 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, and PROT_NUMBER.

◆ GetReachableTime()

Time ns3::Icmpv6L4Protocol::GetReachableTime ( ) const

Neighbor Discovery node constants: reachable time.

Returns
The Reachable time for an Neighbor cache entry.

Definition at line 1937 of file icmpv6-l4-protocol.cc.

References m_reachableTime.

◆ GetRetransmissionTime()

Time ns3::Icmpv6L4Protocol::GetRetransmissionTime ( ) const

Neighbor Discovery node constants: retransmission timer.

Returns
The Retransmission time for an Neighbor cache entry probe.

Definition at line 1943 of file icmpv6-l4-protocol.cc.

References m_retransmissionTime.

◆ GetStaticProtocolNumber()

uint16_t ns3::Icmpv6L4Protocol::GetStaticProtocolNumber ( )
static

Get ICMPv6 protocol number.

Returns
protocol number

Definition at line 227 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION_NOARGS, and PROT_NUMBER.

Referenced by ns3::Ipv6Interface::AddAddress(), ns3::Ipv6Interface::DoSetup(), ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::Ipv6L3Protocol::GetIcmpv6(), ns3::Ipv6Interface::Send(), and ns3::Ipv6RawSocketImpl::SendTo().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::Icmpv6L4Protocol::GetTypeId ( )
static

◆ GetVersion()

int ns3::Icmpv6L4Protocol::GetVersion ( ) const
virtual

Get the version of the protocol.

Returns
version

Definition at line 241 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

◆ HandleDestinationUnreachable()

void ns3::Icmpv6L4Protocol::HandleDestinationUnreachable ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Destination Unreachable method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 1097 of file icmpv6-l4-protocol.cc.

References Forward(), ns3::Icmpv6Header::GetCode(), ns3::Ipv6Header::GetSerializedSize(), and NS_LOG_FUNCTION.

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleEchoRequest()

void ns3::Icmpv6L4Protocol::HandleEchoRequest ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Echo Request method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 391 of file icmpv6-l4-protocol.cc.

References ns3::Create(), ns3::Icmpv6Echo::GetId(), ns3::Icmpv6Echo::GetSeq(), ns3::Ipv6Address::IsMulticast(), NS_LOG_FUNCTION, and SendEchoReply().

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleNA()

void ns3::Icmpv6L4Protocol::HandleNA ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Neighbor Advertisement method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 839 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Entry::ClearWaitingPacket(), ns3::NdiscCache::Entry::DELAY, FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Icmpv6NA::GetFlagO(), ns3::Icmpv6NA::GetFlagR(), ns3::Icmpv6NA::GetFlagS(), ns3::Icmpv6NA::GetIpv6Target(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::Ipv6InterfaceAddress::GetState(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET, ns3::NdiscCache::Entry::INCOMPLETE, ns3::Ipv6InterfaceAddress::INVALID, m_dadFailureAddressTrace, ns3::NdiscCache::Entry::m_state, ns3::NdiscCache::Entry::MarkReachable(), ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, ns3::NdiscCache::Entry::PERMANENT, ns3::NdiscCache::Entry::PROBE, ns3::NdiscCache::Entry::REACHABLE, ns3::NdiscCache::Entry::SetMacAddress(), ns3::NdiscCache::Entry::SetRouter(), ns3::NdiscCache::Entry::STALE, ns3::NdiscCache::Entry::StartReachableTimer(), ns3::NdiscCache::Entry::STATIC_AUTOGENERATED, ns3::NdiscCache::Entry::StopNudTimer(), ns3::Ipv6InterfaceAddress::TENTATIVE, and ns3::Ipv6InterfaceAddress::TENTATIVE_OPTIMISTIC.

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleNS()

void ns3::Icmpv6L4Protocol::HandleNS ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Neighbor Solicitation method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 643 of file icmpv6-l4-protocol.cc.

References FindCache(), ForgeNA(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6Address::GetAny(), ns3::Icmpv6NS::GetIpv6Target(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::Ipv6InterfaceAddress::GetNsDadUid(), ns3::Object::GetObject(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE, ns3::Ipv6Address::IsAny(), ns3::Ipv6Address::IsLinkLocal(), m_node, ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv6L3Protocol::PROT_NUMBER, and ns3::NdiscCache::Entry::SetRouter().

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandlePacketTooBig()

void ns3::Icmpv6L4Protocol::HandlePacketTooBig ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Packet Too Big method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 1142 of file icmpv6-l4-protocol.cc.

References Forward(), ns3::Ipv6Header::GetDestination(), ns3::Icmpv6TooBig::GetMtu(), ns3::Object::GetObject(), ns3::Ipv6Header::GetSerializedSize(), m_node, and NS_LOG_FUNCTION.

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleParameterError()

void ns3::Icmpv6L4Protocol::HandleParameterError ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Parameter Error method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 1168 of file icmpv6-l4-protocol.cc.

References Forward(), ns3::Icmpv6Header::GetCode(), ns3::Ipv6Header::GetSerializedSize(), and NS_LOG_FUNCTION.

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleRA()

void ns3::Icmpv6L4Protocol::HandleRA ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Router Advertisement method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming
Todo
case of multiple prefix on single interface

Definition at line 415 of file icmpv6-l4-protocol.cc.

References ns3::EventId::Cancel(), ns3::Icmpv6RA::GetFlagM(), ns3::Icmpv6RA::GetLifeTime(), ns3::Object::GetObject(), ns3::Ipv6Address::GetZero(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE, ns3::Icmpv6Header::ICMPV6_OPT_MTU, ns3::Icmpv6Header::ICMPV6_OPT_PREFIX, ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsPending(), m_handleRsTimeoutEvent, m_node, m_rsRetransmissionCount, m_startDhcpv6, NS_LOG_FUNCTION, and ReceiveLLA().

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleRedirection()

void ns3::Icmpv6L4Protocol::HandleRedirection ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Redirection method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 1015 of file icmpv6-l4-protocol.cc.

References FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Icmpv6Redirection::GetDestination(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::Object::GetObject(), ns3::Icmpv6Redirection::GetTarget(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET, ns3::NdiscCache::Entry::IsIncomplete(), m_node, ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, ns3::NdiscCache::Entry::SetMacAddress(), and ns3::NdiscCache::Entry::SetRouter().

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleRS()

void ns3::Icmpv6L4Protocol::HandleRS ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Router Solicitation method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 600 of file icmpv6-l4-protocol.cc.

References FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6Address::GetAny(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::Object::GetObject(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE, m_node, ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::NdiscCache::Entry::SetRouter().

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleRsTimeout()

void ns3::Icmpv6L4Protocol::HandleRsTimeout ( Ipv6Address src,
Ipv6Address dst,
Address hardwareAddress )
protectedvirtual

Router Solicitation Timeout handler.

Parameters
srclink-local source address
dstdestination address (usually ff02::2 i.e all-routers)
hardwareAddresslink-layer address (SHOULD be included if src is not ::)

Definition at line 1414 of file icmpv6-l4-protocol.cc.

References m_rsInitialRetransmissionTime, m_rsMaxRetransmissionCount, m_rsMaxRetransmissionDuration, m_rsRetransmissionCount, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and SendRS().

Referenced by SendRS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleTimeExceeded()

void ns3::Icmpv6L4Protocol::HandleTimeExceeded ( Ptr< Packet > p,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Receive Time Exceeded method.

Parameters
pthe packet
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 1119 of file icmpv6-l4-protocol.cc.

References Forward(), ns3::Icmpv6Header::GetCode(), ns3::Ipv6Header::GetSerializedSize(), and NS_LOG_FUNCTION.

Referenced by Receive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsAlwaysDad()

bool ns3::Icmpv6L4Protocol::IsAlwaysDad ( ) const

Is the node must do DAD.

Returns
true if node has to do DAD.

Definition at line 248 of file icmpv6-l4-protocol.cc.

References m_alwaysDad, and NS_LOG_FUNCTION.

◆ Lookup() [1/2]

bool ns3::Icmpv6L4Protocol::Lookup ( Ipv6Address dst,
Ptr< NetDevice > device,
Ptr< NdiscCache > cache,
Address * hardwareDestination )
virtual

Lookup in the ND cache for the IPv6 address.

Note
Unlike other Lookup method, it does not send NS request!
Parameters
dstdestination address
devicedevice
cachethe neighbor cache
hardwareDestinationhardware address
Returns
true if the address is in the ND cache, the hardwareDestination is updated.

Definition at line 1715 of file icmpv6-l4-protocol.cc.

References FindCache(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::NdiscCache::Entry::IsAutoGenerated(), ns3::NdiscCache::Entry::IsDelay(), ns3::NdiscCache::Entry::IsPermanent(), ns3::NdiscCache::Entry::IsReachable(), ns3::NdiscCache::Entry::IsStale(), ns3::NdiscCache::Entry::MarkDelay(), NS_LOG_FUNCTION, and ns3::NdiscCache::Entry::StartDelayTimer().

+ Here is the call graph for this function:

◆ Lookup() [2/2]

bool ns3::Icmpv6L4Protocol::Lookup ( Ptr< Packet > p,
const Ipv6Header & ipHeader,
Ipv6Address dst,
Ptr< NetDevice > device,
Ptr< NdiscCache > cache,
Address * hardwareDestination )
virtual

Lookup in the ND cache for the IPv6 address (similar as ARP protocol).

It also send NS request to target and store the waiting packet.

Parameters
pthe packet
ipHeaderIPv6 header
dstdestination address
devicedevice
cachethe neighbor cache
hardwareDestinationhardware address
Returns
true if the address is in the ND cache, the hardwareDestination is updated.

Definition at line 1751 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Entry::AddWaitingPacket(), FindCache(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::NdiscCache::Entry::IsAutoGenerated(), ns3::NdiscCache::Entry::IsDelay(), ns3::Ipv6Address::IsLinkLocal(), ns3::NdiscCache::Entry::IsPermanent(), ns3::NdiscCache::Entry::IsReachable(), ns3::NdiscCache::Entry::IsStale(), ns3::Ipv6Address::MakeSolicitedAddress(), ns3::NdiscCache::Entry::MarkDelay(), ns3::NdiscCache::Entry::MarkIncomplete(), NS_LOG_FUNCTION, SendNS(), ns3::NdiscCache::Entry::SetRouter(), ns3::NdiscCache::Entry::StartDelayTimer(), and ns3::NdiscCache::Entry::StartRetransmitTimer().

+ Here is the call graph for this function:

◆ NotifyNewAggregate()

void ns3::Icmpv6L4Protocol::NotifyNewAggregate ( )
overridevirtual

This method is called by AggregateObject and completes the aggregation by setting the node in the ICMPv6 stack and adding ICMPv6 factory to IPv6 stack connected to the node.

Reimplemented from ns3::Object.

Definition at line 192 of file icmpv6-l4-protocol.cc.

References ns3::Object::GetObject(), ns3::Callback< R, UArgs >::IsNull(), m_downTarget, m_node, ns3::MakeCallback(), ns3::Object::NotifyNewAggregate(), NS_LOG_FUNCTION, ns3::Ipv6::Send(), SetDownTarget6(), and SetNode().

+ Here is the call graph for this function:

◆ Receive() [1/2]

IpL4Protocol::RxStatus ns3::Icmpv6L4Protocol::Receive ( Ptr< Packet > p,
const Ipv4Header & header,
Ptr< Ipv4Interface > interface )
overridevirtual

Receive method.

Parameters
pthe packet
headerthe IPv4 header
interfacethe interface from which the packet is coming
Returns
the receive status

Implements ns3::IpL4Protocol.

Definition at line 286 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, and ns3::IpL4Protocol::RX_ENDPOINT_UNREACH.

◆ Receive() [2/2]

◆ ReceiveLLA()

void ns3::Icmpv6L4Protocol::ReceiveLLA ( Icmpv6OptionLinkLayerAddress lla,
const Ipv6Address & src,
const Ipv6Address & dst,
Ptr< Ipv6Interface > interface )
protected

Link layer address option processing.

Parameters
llaLLA option
srcsource address
dstdestination address
interfacethe interface from which the packet is coming

Definition at line 500 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Entry::ClearWaitingPacket(), ns3::NdiscCache::Entry::DELAY, FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::NdiscCache::Entry::INCOMPLETE, ns3::NdiscCache::Entry::m_state, ns3::NdiscCache::Entry::MarkReachable(), ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, ns3::NdiscCache::Entry::PERMANENT, ns3::NdiscCache::Entry::PROBE, ns3::NdiscCache::Entry::REACHABLE, ns3::NdiscCache::Entry::SetMacAddress(), ns3::NdiscCache::Entry::SetRouter(), ns3::NdiscCache::Entry::STALE, ns3::NdiscCache::Entry::StartReachableTimer(), ns3::NdiscCache::Entry::STATIC_AUTOGENERATED, and ns3::NdiscCache::Entry::StopNudTimer().

Referenced by HandleRA().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendEchoReply()

void ns3::Icmpv6L4Protocol::SendEchoReply ( Ipv6Address src,
Ipv6Address dst,
uint16_t id,
uint16_t seq,
Ptr< Packet > data )

Send a Echo Reply.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
idid of the packet
seqsequence number
dataauxiliary data

Definition at line 1282 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), data, ns3::Icmpv6Echo::GetSerializedSize(), NS_LOG_FUNCTION, PROT_NUMBER, SendMessage(), ns3::Icmpv6Echo::SetId(), and ns3::Icmpv6Echo::SetSeq().

Referenced by HandleEchoRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendErrorDestinationUnreachable()

void ns3::Icmpv6L4Protocol::SendErrorDestinationUnreachable ( Ptr< Packet > malformedPacket,
Ipv6Address dst,
uint8_t code )

Send an error Destination Unreachable.

Parameters
malformedPacketthe malformed packet
dstdestination IPv6 address
codecode of the error

Definition at line 1445 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, NS_LOG_LOGIC, SendMessage(), ns3::Icmpv6Header::SetCode(), and ns3::Icmpv6DestinationUnreachable::SetPacket().

+ Here is the call graph for this function:

◆ SendErrorParameterError()

void ns3::Icmpv6L4Protocol::SendErrorParameterError ( Ptr< Packet > malformedPacket,
Ipv6Address dst,
uint8_t code,
uint32_t ptr )

Send an error Parameter Error.

Parameters
malformedPacketthe malformed packet
dstdestination IPv6 address
codecode of the error
ptrbyte of p where the error is located

Definition at line 1520 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, NS_LOG_LOGIC, SendMessage(), ns3::Icmpv6Header::SetCode(), ns3::Icmpv6ParameterError::SetPacket(), and ns3::Icmpv6ParameterError::SetPtr().

+ Here is the call graph for this function:

◆ SendErrorTimeExceeded()

void ns3::Icmpv6L4Protocol::SendErrorTimeExceeded ( Ptr< Packet > malformedPacket,
Ipv6Address dst,
uint8_t code )

Send an error Time Exceeded.

Parameters
malformedPacketthe malformed packet
dstdestination IPv6 address
codecode of the error

Definition at line 1496 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, NS_LOG_LOGIC, SendMessage(), ns3::Icmpv6Header::SetCode(), and ns3::Icmpv6TimeExceeded::SetPacket().

+ Here is the call graph for this function:

◆ SendErrorTooBig()

void ns3::Icmpv6L4Protocol::SendErrorTooBig ( Ptr< Packet > malformedPacket,
Ipv6Address dst,
uint32_t mtu )

Send an error Too Big.

Parameters
malformedPacketthe malformed packet
dstdestination IPv6 address
mtuthe mtu

Definition at line 1471 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION, NS_LOG_LOGIC, SendMessage(), ns3::Icmpv6Header::SetCode(), ns3::Icmpv6TooBig::SetMtu(), and ns3::Icmpv6TooBig::SetPacket().

+ Here is the call graph for this function:

◆ SendMessage() [1/2]

void ns3::Icmpv6L4Protocol::SendMessage ( Ptr< Packet > packet,
Ipv6Address dst,
Icmpv6Header & icmpv6Hdr,
uint8_t ttl )

Send a packet via ICMPv6.

Parameters
packetthe packet to send
dstdestination address
icmpv6HdrICMPv6 header (needed to calculate checksum after source address is determined by routing stuff
ttlnext hop limit

Definition at line 1213 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Object::GetObject(), ns3::Icmpv6Header::GetSerializedSize(), m_downTarget, m_node, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, PROT_NUMBER, ns3::Ipv6Header::SetDestination(), and ns3::SocketIpv6HopLimitTag::SetHopLimit().

+ Here is the call graph for this function:

◆ SendMessage() [2/2]

void ns3::Icmpv6L4Protocol::SendMessage ( Ptr< Packet > packet,
Ipv6Address src,
Ipv6Address dst,
uint8_t ttl )

Send a packet via ICMPv6, note that packet already contains ICMPv6 header.

Parameters
packetthe packet to send which contains ICMPv6 header
srcsource address
dstdestination address
ttlnext hop limit

Definition at line 1190 of file icmpv6-l4-protocol.cc.

References ns3::Object::GetObject(), m_downTarget, m_node, NS_ASSERT, NS_LOG_FUNCTION, and PROT_NUMBER.

Referenced by DelayedSendMessage(), SendEchoReply(), SendErrorDestinationUnreachable(), SendErrorParameterError(), SendErrorTimeExceeded(), SendErrorTooBig(), SendNA(), SendNS(), SendRedirection(), and SendRS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendNA()

void ns3::Icmpv6L4Protocol::SendNA ( Ipv6Address src,
Ipv6Address dst,
Address * hardwareAddress,
uint8_t flags )

Send a Neighbor Advertisement.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
hardwareAddressour MAC address
flagsto set (4 = flag R, 2 = flag S, 3 = flag O)

Definition at line 1251 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Create(), ns3::Ipv6Address::GetAny(), ns3::Icmpv6NA::GetSerializedSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, SendMessage(), ns3::Icmpv6NA::SetFlagO(), ns3::Icmpv6NA::SetFlagR(), ns3::Icmpv6NA::SetFlagS(), and ns3::Icmpv6NA::SetIpv6Target().

+ Here is the call graph for this function:

◆ SendNS()

void ns3::Icmpv6L4Protocol::SendNS ( Ipv6Address src,
Ipv6Address dst,
Ipv6Address target,
Address hardwareAddress )
virtual

Send a Neighbor Solicitation.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
targettarget IPv6 address
hardwareAddressour mac address

Definition at line 1304 of file icmpv6-l4-protocol.cc.

References ns3::Create(), DelayedSendMessage(), ns3::Ipv6Address::GetAllNodesMulticast(), ns3::Ipv6Address::GetAny(), ns3::RandomVariableStream::GetValue(), ns3::Ipv6Address::IsMulticast(), m_solicitationJitter, ns3::MilliSeconds(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, ns3::Simulator::Schedule(), and SendMessage().

Referenced by Lookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendRedirection()

void ns3::Icmpv6L4Protocol::SendRedirection ( Ptr< Packet > redirectedPacket,
Ipv6Address src,
Ipv6Address dst,
Ipv6Address redirTarget,
Ipv6Address redirDestination,
Address redirHardwareTarget )

Send an ICMPv6 Redirection.

Parameters
redirectedPacketthe redirected packet
srcIPv6 address to send the redirect from
dstIPv6 address to send the redirect to
redirTargetIPv6 target address for Icmpv6Redirection
redirDestinationIPv6 destination address for Icmpv6Redirection
redirHardwareTargetL2 target address for Icmpv6OptionRdirected

Definition at line 1548 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Create(), ns3::Address::GetLength(), ns3::Icmpv6OptionLinkLayerAddress::GetSerializedSize(), ns3::Icmpv6Redirection::GetSerializedSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, SendMessage(), ns3::Icmpv6OptionLinkLayerAddress::SetAddress(), ns3::Icmpv6Redirection::SetDestination(), ns3::Icmpv6OptionRedirected::SetPacket(), and ns3::Icmpv6Redirection::SetTarget().

+ Here is the call graph for this function:

◆ SendRS()

void ns3::Icmpv6L4Protocol::SendRS ( Ipv6Address src,
Ipv6Address dst,
Address hardwareAddress )

Send a Router Solicitation.

Parameters
srclink-local source address
dstdestination address (usually ff02::2 i.e., all-routers)
hardwareAddresslink-layer address (SHOULD be included if src is not ::)

Definition at line 1346 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Create(), DelayedSendMessage(), ns3::Object::GetObject(), ns3::Icmpv6RS::GetSerializedSize(), ns3::RandomVariableStream::GetValue(), HandleRsTimeout(), ns3::Ipv6Address::IsAny(), ns3::Ipv6Address::IsMulticast(), m_handleRsTimeoutEvent, m_node, m_rsInitialRetransmissionTime, m_rsMaxRetransmissionTime, m_rsPrevRetransmissionTimeout, m_rsRetransmissionCount, m_rsRetransmissionJitter, m_solicitationJitter, ns3::MilliSeconds(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PROT_NUMBER, ns3::Simulator::Schedule(), and SendMessage().

Referenced by FunctionDadTimeout(), and HandleRsTimeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDhcpv6Callback()

void ns3::Icmpv6L4Protocol::SetDhcpv6Callback ( Callback< void, uint32_t > cb)
inline

Set DHCPv6 callback.

Invoked when an RA is received with the M flag set.

Parameters
cbthe callback function

Definition at line 421 of file icmpv6-l4-protocol.h.

References m_startDhcpv6.

◆ SetDownTarget()

void ns3::Icmpv6L4Protocol::SetDownTarget ( IpL4Protocol::DownTargetCallback cb)
overrideprotectedvirtual

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

Parameters
cbcurrent Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 1898 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

◆ SetDownTarget6()

void ns3::Icmpv6L4Protocol::SetDownTarget6 ( IpL4Protocol::DownTargetCallback6 cb)
overrideprotectedvirtual

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

Parameters
cbcurrent Callback for the L4 protocol

Implements ns3::IpL4Protocol.

Definition at line 1904 of file icmpv6-l4-protocol.cc.

References m_downTarget, and NS_LOG_FUNCTION.

Referenced by NotifyNewAggregate().

+ Here is the caller graph for this function:

◆ SetNode()

void ns3::Icmpv6L4Protocol::SetNode ( Ptr< Node > node)

Set the node.

Parameters
nodethe node to set

Definition at line 213 of file icmpv6-l4-protocol.cc.

References m_node, and NS_LOG_FUNCTION.

Referenced by NotifyNewAggregate().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_alwaysDad

bool ns3::Icmpv6L4Protocol::m_alwaysDad
protected

Always do DAD ?

Definition at line 605 of file icmpv6-l4-protocol.h.

Referenced by DoDAD(), GetTypeId(), and IsAlwaysDad().

◆ m_cacheList

CacheList ns3::Icmpv6L4Protocol::m_cacheList
protected

A list of cache by device.

Definition at line 610 of file icmpv6-l4-protocol.h.

Referenced by CreateCache(), DoDispose(), and FindCache().

◆ m_dadFailureAddressTrace

ns3::TracedCallback<const Ipv6Address&> ns3::Icmpv6L4Protocol::m_dadFailureAddressTrace
protected

The trace fired when a DAD fails, changing the address state to INVALID.

Includes the address whose state has been changed.

Definition at line 705 of file icmpv6-l4-protocol.h.

Referenced by GetTypeId(), and HandleNA().

◆ m_dadSuccessAddressTrace

ns3::TracedCallback<const Ipv6Address&> ns3::Icmpv6L4Protocol::m_dadSuccessAddressTrace
protected

The trace fired when a DAD completes and no duplicate address has been detected.

The address state changes to PREFERRED. Includes the address whose state has been changed.

Definition at line 712 of file icmpv6-l4-protocol.h.

Referenced by FunctionDadTimeout(), and GetTypeId().

◆ m_dadTimeout

Time ns3::Icmpv6L4Protocol::m_dadTimeout
protected

DAD timeout.

Definition at line 692 of file icmpv6-l4-protocol.h.

Referenced by GetDadTimeout(), and GetTypeId().

◆ m_delayFirstProbe

Time ns3::Icmpv6L4Protocol::m_delayFirstProbe
protected

Neighbor Discovery node constants: delay for the first probe.

Definition at line 672 of file icmpv6-l4-protocol.h.

Referenced by GetDelayFirstProbe(), and GetTypeId().

◆ m_downTarget

IpL4Protocol::DownTargetCallback6 ns3::Icmpv6L4Protocol::m_downTarget
protected

◆ m_handleRsTimeoutEvent

EventId ns3::Icmpv6L4Protocol::m_handleRsTimeoutEvent
protected

RS timeout handler event.

Definition at line 697 of file icmpv6-l4-protocol.h.

Referenced by HandleRA(), and SendRS().

◆ m_maxMulticastSolicit

uint8_t ns3::Icmpv6L4Protocol::m_maxMulticastSolicit
protected

Neighbor Discovery node constants: max multicast solicitations.

Definition at line 615 of file icmpv6-l4-protocol.h.

Referenced by GetMaxMulticastSolicit(), and GetTypeId().

◆ m_maxUnicastSolicit

uint8_t ns3::Icmpv6L4Protocol::m_maxUnicastSolicit
protected

Neighbor Discovery node constants: max unicast solicitations.

Definition at line 620 of file icmpv6-l4-protocol.h.

Referenced by GetMaxUnicastSolicit(), and GetTypeId().

◆ m_node

◆ m_reachableTime

Time ns3::Icmpv6L4Protocol::m_reachableTime
protected

Neighbor Discovery node constants: reachable time.

Definition at line 662 of file icmpv6-l4-protocol.h.

Referenced by GetReachableTime(), and GetTypeId().

◆ m_retransmissionTime

Time ns3::Icmpv6L4Protocol::m_retransmissionTime
protected

Neighbor Discovery node constants: retransmission timer.

Definition at line 667 of file icmpv6-l4-protocol.h.

Referenced by GetRetransmissionTime(), and GetTypeId().

◆ m_rsFirstTransmissionTime

Time ns3::Icmpv6L4Protocol::m_rsFirstTransmissionTime
protected

First multicast RS transmissions [RFC 7559 ].

Definition at line 657 of file icmpv6-l4-protocol.h.

◆ m_rsInitialRetransmissionTime

Time ns3::Icmpv6L4Protocol::m_rsInitialRetransmissionTime
protected

Initial multicast RS retransmission time [RFC 7559 ].

Definition at line 625 of file icmpv6-l4-protocol.h.

Referenced by GetTypeId(), HandleRsTimeout(), and SendRS().

◆ m_rsMaxRetransmissionCount

uint32_t ns3::Icmpv6L4Protocol::m_rsMaxRetransmissionCount
protected

Maximum number of multicast RS retransmissions [RFC 7559 ].

Zero means unbound.

Definition at line 635 of file icmpv6-l4-protocol.h.

Referenced by GetTypeId(), and HandleRsTimeout().

◆ m_rsMaxRetransmissionDuration

Time ns3::Icmpv6L4Protocol::m_rsMaxRetransmissionDuration
protected

Maximum duration of multicast RS retransmissions [RFC 7559 ].

Zero means unbound.

Definition at line 640 of file icmpv6-l4-protocol.h.

Referenced by GetTypeId(), and HandleRsTimeout().

◆ m_rsMaxRetransmissionTime

Time ns3::Icmpv6L4Protocol::m_rsMaxRetransmissionTime
protected

Maximum time between multicast RS retransmissions [RFC 7559 ].

Zero means unbound.

Definition at line 630 of file icmpv6-l4-protocol.h.

Referenced by GetTypeId(), and SendRS().

◆ m_rsPrevRetransmissionTimeout

Time ns3::Icmpv6L4Protocol::m_rsPrevRetransmissionTimeout
protected

Previous multicast RS retransmissions timeout [RFC 7559 ].

Definition at line 652 of file icmpv6-l4-protocol.h.

Referenced by SendRS().

◆ m_rsRetransmissionCount

uint32_t ns3::Icmpv6L4Protocol::m_rsRetransmissionCount {0}
protected

Multicast RS retransmissions counter [RFC 7559 ].

Zero indicate a first transmission, greater than zero means retransmissions.

Definition at line 647 of file icmpv6-l4-protocol.h.

Referenced by FunctionDadTimeout(), HandleRA(), HandleRsTimeout(), and SendRS().

◆ m_rsRetransmissionJitter

Ptr<UniformRandomVariable> ns3::Icmpv6L4Protocol::m_rsRetransmissionJitter
protected

Random jitter for RS retransmissions.

Definition at line 687 of file icmpv6-l4-protocol.h.

Referenced by AssignStreams(), GetTypeId(), and SendRS().

◆ m_solicitationJitter

Ptr<RandomVariableStream> ns3::Icmpv6L4Protocol::m_solicitationJitter
protected

Random jitter before sending solicitations.

Definition at line 682 of file icmpv6-l4-protocol.h.

Referenced by AssignStreams(), DoDAD(), GetTypeId(), SendNS(), and SendRS().

◆ m_startDhcpv6

Callback<void, uint32_t> ns3::Icmpv6L4Protocol::m_startDhcpv6
protected

The DHCPv6 callback when the M flag is set in a Router Advertisement.

Includes the interface on which the RA was received.

Definition at line 718 of file icmpv6-l4-protocol.h.

Referenced by HandleRA(), and SetDhcpv6Callback().

◆ PROT_NUMBER

const uint8_t ns3::Icmpv6L4Protocol::PROT_NUMBER = 58
static

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