A Discrete-Event Network Simulator
API

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. More...
 
virtual ~Icmpv6L4Protocol ()
 Destructor. More...
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
virtual Ptr< NdiscCacheCreateCache (Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
 Create a neighbor cache. More...
 
void DelayedSendMessage (Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
 Helper function used during delayed solicitation. More...
 
void DoDAD (Ipv6Address target, Ptr< Ipv6Interface > interface)
 Do the Duplication Address Detection (DAD). More...
 
NdiscCache::Ipv6PayloadHeaderPair ForgeEchoRequest (Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
 Forge an Echo Request. More...
 
NdiscCache::Ipv6PayloadHeaderPair ForgeNA (Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
 Forge a Neighbor Advertisement. More...
 
NdiscCache::Ipv6PayloadHeaderPair ForgeNS (Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
 Forge a Neighbor Solicitation. More...
 
NdiscCache::Ipv6PayloadHeaderPair ForgeRS (Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
 Forge a Router Solicitation. More...
 
void FunctionDadTimeout (Ipv6Interface *interface, Ipv6Address addr)
 Function called when DAD timeout. More...
 
Time GetDelayFirstProbe () const
 Neighbor Discovery node constants : delay for the first probe. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
uint8_t GetMaxMulticastSolicit () const
 Neighbor Discovery node constants: max multicast solicitations. More...
 
uint8_t GetMaxUnicastSolicit () const
 Neighbor Discovery node constants: max unicast solicitations. More...
 
Ptr< NodeGetNode ()
 Get the node. More...
 
virtual int GetProtocolNumber () const
 Get the protocol number. More...
 
Time GetReachableTime () const
 Neighbor Discovery node constants: reachable time. More...
 
Time GetRetransmissionTime () const
 Neighbor Discovery node constants: retransmission timer. More...
 
virtual int GetVersion () const
 Get the version of the protocol. More...
 
bool IsAlwaysDad () const
 Is the node must do DAD. More...
 
bool Lookup (Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
 Lookup in the ND cache for the IPv6 address. More...
 
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). More...
 
void NotifyNewAggregate ()
 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. More...
 
virtual enum IpL4Protocol::RxStatus Receive (Ptr< Packet > p, Ipv6Header const &header, Ptr< Ipv6Interface > interface)
 Receive method. More...
 
virtual enum IpL4Protocol::RxStatus Receive (Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > interface)
 Receive method. More...
 
void SendEchoReply (Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
 Send a Echo Reply. More...
 
void SendErrorDestinationUnreachable (Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
 Send an error Destination Unreachable. More...
 
void SendErrorParameterError (Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code, uint32_t ptr)
 Send an error Parameter Error. More...
 
void SendErrorTimeExceeded (Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
 Send an error Time Exceeded. More...
 
void SendErrorTooBig (Ptr< Packet > malformedPacket, Ipv6Address dst, uint32_t mtu)
 Send an error Too Big. More...
 
void SendMessage (Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
 Send a packet via ICMPv6, note that packet already contains ICMPv6 header. More...
 
void SendMessage (Ptr< Packet > packet, Ipv6Address dst, Icmpv6Header &icmpv6Hdr, uint8_t ttl)
 Send a packet via ICMPv6. More...
 
void SendNA (Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
 Send a Neighbor Adverstisement. More...
 
virtual void SendNS (Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
 Send a Neighbor Solicitation. More...
 
void SendRedirection (Ptr< Packet > redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget)
 Send an ICMPv6 Redirection. More...
 
void SendRS (Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
 Send a Router Solicitation. More...
 
void SetNode (Ptr< Node > node)
 Set the node. More...
 
- Public Member Functions inherited from ns3::IpL4Protocol
virtual ~IpL4Protocol ()
 
virtual void ReceiveIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv4Address payloadSource, Ipv4Address payloadDestination, const uint8_t payload[8])
 Called from lower-level layers to send the ICMP packet up in the stack. More...
 
virtual void ReceiveIcmp (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv6Address payloadSource, Ipv6Address payloadDestination, const uint8_t payload[8])
 Called from lower-level layers to send the ICMPv6 packet up in the stack. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static uint16_t GetStaticProtocolNumber ()
 Get ICMPv6 protocol number. More...
 
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::IpL4Protocol
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Static Public Attributes

static const uint8_t PROT_NUMBER = 58
 ICMPv6 protocol number (58). More...
 

Protected Types

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

Protected Member Functions

virtual void DoDispose ()
 Dispose this object. More...
 
Ptr< NdiscCacheFindCache (Ptr< NetDevice > device)
 Get the cache corresponding to the device. More...
 
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). More...
 
virtual IpL4Protocol::DownTargetCallback GetDownTarget (void) const
 This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 case) More...
 
virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6 (void) const
 This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 case) More...
 
void HandleDestinationUnreachable (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Destination Unreachable method. More...
 
void HandleEchoRequest (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Echo Request method. More...
 
void HandleNA (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Neighbor Advertisement method. More...
 
void HandleNS (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Neighbor Solicitation method. More...
 
void HandlePacketTooBig (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Packet Too Big method. More...
 
void HandleParameterError (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Parameter Error method. More...
 
void HandleRA (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Router Advertisement method. More...
 
void HandleRedirection (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Redirection method. More...
 
void HandleRS (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Router Solicitation method. More...
 
void HandleTimeExceeded (Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Receive Time Exceeded method. More...
 
void ReceiveLLA (Icmpv6OptionLinkLayerAddress lla, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
 Link layer address option processing. More...
 
virtual void SetDownTarget (IpL4Protocol::DownTargetCallback cb)
 This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 case) More...
 
virtual void SetDownTarget6 (IpL4Protocol::DownTargetCallback6 cb)
 This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 case) More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Protected Attributes

bool m_alwaysDad
 Always do DAD ? More...
 
CacheList m_cacheList
 A list of cache by device. More...
 

Private Attributes

Time m_delayFirstProbe
 Neighbor Discovery node constants: delay for the first probe. More...
 
IpL4Protocol::DownTargetCallback6 m_downTarget
 callback to Ipv6::Send More...
 
uint8_t m_maxMulticastSolicit
 Neighbor Discovery node constants: max multicast solicitations. More...
 
uint8_t m_maxUnicastSolicit
 Neighbor Discovery node constants: max unicast solicitations. More...
 
Ptr< Nodem_node
 The node. More...
 
Time m_reachableTime
 Neighbor Discovery node constants: reachable time. More...
 
Time m_retransmissionTime
 Neighbor Discovery node constants: retransmission timer. More...
 
Ptr< RandomVariableStreamm_solicitationJitter
 Random jitter before sending solicitations. More...
 

Additional Inherited Members

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

Detailed Description

An implementation of the ICMPv6 protocol.


Config Paths

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

  • "/NodeList/[i]/$ns3::Icmpv6L4Protocol"

Attributes

  • DAD: Always do DAD check.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
  • SolicitationJitter: The jitter in ms a node is allowed to wait before sending any solicitation. Some jitter aims to prevent collisions. By default, the model will wait for a duration in ms defined by a uniform random-variable between 0 and SolicitationJitter
  • MaxMulticastSolicit: Neighbor Discovery node constants: max multicast solicitations.
    • Set with class: ns3::IntegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 3
    • Flags: construct write read
  • MaxUnicastSolicit: Neighbor Discovery node constants: max unicast solicitations.
    • Set with class: ns3::IntegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 3
    • Flags: construct write read
  • ReachableTime: Neighbor Discovery node constants: reachable time.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +3e+10ns
    • Flags: construct write read
  • RetransmissionTime: Neighbor Discovery node constants: retransmission timer.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1e+09ns
    • Flags: construct write read
  • DelayFirstProbe: Neighbor Discovery node constants: delay for the first probe.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +5e+09ns
    • Flags: construct write read

Attributes defined in parent class ns3::IpL4Protocol

  • ProtocolNumber: The IP protocol number.

No TraceSources are defined for this type.
Size of this type is 104 bytes (on a 64-bit architecture).

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

Member Typedef Documentation

◆ CacheList

container of NdiscCaches

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

Constructor & Destructor Documentation

◆ Icmpv6L4Protocol()

ns3::Icmpv6L4Protocol::Icmpv6L4Protocol ( )

Constructor.

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

References NS_LOG_FUNCTION.

◆ ~Icmpv6L4Protocol()

ns3::Icmpv6L4Protocol::~Icmpv6L4Protocol ( )
virtual

Destructor.

Definition at line 113 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 134 of file icmpv6-l4-protocol.cc.

References 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
devicethet NetDevice
interfacethe IPv6 interface
Returns
a smart pointer of NdCache or 0 if problem

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

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

+ 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 960 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 197 of file icmpv6-l4-protocol.cc.

References ForgeNS(), ns3::Ipv6Interface::GetDevice(), 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(), ns3::Ipv6Interface::Send(), and ns3::Ipv6Interface::SetNsDadUid().

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 ( void  )
protectedvirtual

Dispose this object.

Reimplemented from ns3::Object.

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

References ns3::Object::Dispose(), ns3::Object::DoDispose(), m_cacheList, m_downTarget, m_node, NS_LOG_FUNCTION, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::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 1313 of file icmpv6-l4-protocol.cc.

References m_cacheList, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by HandleNA(), HandleNS(), HandleRedirection(), HandleRS(), 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 644 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), data, ns3::Icmpv6Echo::GetSerializedSize(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, PROT_NUMBER, ns3::Ipv6Header::SetDestinationAddress(), ns3::Ipv6Header::SetHopLimit(), ns3::Icmpv6Echo::SetId(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), ns3::Icmpv6Echo::SetSeq(), and ns3::Ipv6Header::SetSourceAddress().

+ 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 1250 of file icmpv6-l4-protocol.cc.

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

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 1290 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Icmpv6NS::GetSerializedSize(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and PROT_NUMBER.

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 615 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Icmpv6RS::GetSerializedSize(), ns3::Packet::GetSize(), ns3::Ipv6Address::IsAny(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and PROT_NUMBER.

+ 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 286 of file icmpv6-l4-protocol.cc.

References ns3::Icmpv6Header::GetCode(), ns3::Ipv6Header::GetDestinationAddress(), ns3::Ipv6Header::GetHopLimit(), ns3::Ipv6Header::GetNextHeader(), ns3::Object::GetObject(), ns3::Ipv6Header::GetSourceAddress(), ns3::Icmpv6Header::GetType(), m_node, NS_LOG_FUNCTION, PROT_NUMBER, and ns3::IpL4Protocol::ReceiveIcmp().

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

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

◆ FunctionDadTimeout()

◆ 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 1553 of file icmpv6-l4-protocol.cc.

References m_delayFirstProbe.

◆ GetDownTarget()

IpL4Protocol::DownTargetCallback ns3::Icmpv6L4Protocol::GetDownTarget ( void  ) const
protectedvirtual

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 1515 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

◆ GetDownTarget6()

IpL4Protocol::DownTargetCallback6 ns3::Icmpv6L4Protocol::GetDownTarget6 ( void  ) const
protectedvirtual

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 1522 of file icmpv6-l4-protocol.cc.

References m_downTarget, and NS_LOG_FUNCTION.

◆ GetInstanceTypeId()

TypeId ns3::Icmpv6L4Protocol::GetInstanceTypeId ( void  ) const
virtual

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.

Reimplemented from ns3::Object.

Definition at line 101 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 1529 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 1535 of file icmpv6-l4-protocol.cc.

References m_maxUnicastSolicit.

◆ GetNode()

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

Get the node.

Returns
node

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

References m_node, and NS_LOG_FUNCTION.

◆ GetProtocolNumber()

int ns3::Icmpv6L4Protocol::GetProtocolNumber ( void  ) const
virtual

Get the protocol number.

Returns
protocol number

Implements ns3::IpL4Protocol.

Definition at line 179 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 1541 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 1547 of file icmpv6-l4-protocol.cc.

References m_retransmissionTime.

◆ GetStaticProtocolNumber()

uint16_t ns3::Icmpv6L4Protocol::GetStaticProtocolNumber ( void  )
static

Get ICMPv6 protocol number.

Returns
protocol number

Definition at line 173 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 ( void  )
static

◆ GetVersion()

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

Get the version of the protocol.

Returns
version

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

References NS_LOG_FUNCTION.

◆ HandleDestinationUnreachable()

void ns3::Icmpv6L4Protocol::HandleDestinationUnreachable ( Ptr< Packet p,
Ipv6Address const &  src,
Ipv6Address const &  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 877 of file icmpv6-l4-protocol.cc.

References ns3::Packet::Copy(), ns3::Packet::CopyData(), Forward(), ns3::Icmpv6Header::GetCode(), ns3::Icmpv6DestinationUnreachable::GetPacket(), ns3::Ipv6Header::GetSerializedSize(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, and ns3::Packet::RemoveHeader().

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,
Ipv6Address const &  src,
Ipv6Address const &  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 309 of file icmpv6-l4-protocol.cc.

References ns3::Packet::CopyData(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Icmpv6Echo::GetId(), ns3::Ipv6Interface::GetLinkLocalAddress(), ns3::Icmpv6Echo::GetSeq(), ns3::Packet::GetSize(), ns3::Ipv6Address::IsMulticast(), NS_LOG_FUNCTION, ns3::Packet::RemoveHeader(), 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,
Ipv6Address const &  src,
Ipv6Address const &  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 666 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Entry::ClearWaitingPacket(), ns3::Packet::CopyData(), FindCache(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6Interface::GetAddress(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6Interface::GetDevice(), ns3::Icmpv6NA::GetFlagO(), ns3::Icmpv6NA::GetFlagR(), ns3::Icmpv6NA::GetFlagS(), ns3::NdiscCache::GetInterface(), ns3::Icmpv6NA::GetIpv6Target(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::Ipv6Interface::GetNAddresses(), ns3::Ipv6InterfaceAddress::GetState(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET, ns3::Ipv6InterfaceAddress::INVALID, ns3::NdiscCache::Entry::IsIncomplete(), ns3::NdiscCache::Entry::IsPermanent(), ns3::NdiscCache::Entry::IsProbe(), ns3::NdiscCache::Entry::IsReachable(), ns3::NdiscCache::Lookup(), ns3::NdiscCache::Entry::MarkReachable(), ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, ns3::Packet::RemoveHeader(), ns3::Ipv6Interface::Send(), ns3::NdiscCache::Entry::SetMacAddress(), ns3::NdiscCache::Entry::SetRouter(), ns3::Ipv6Interface::SetState(), ns3::NdiscCache::Entry::StartReachableTimer(), 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()

◆ HandlePacketTooBig()

void ns3::Icmpv6L4Protocol::HandlePacketTooBig ( Ptr< Packet p,
Ipv6Address const &  src,
Ipv6Address const &  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 912 of file icmpv6-l4-protocol.cc.

References ns3::Packet::Copy(), ns3::Packet::CopyData(), Forward(), ns3::Ipv6Header::GetDestinationAddress(), ns3::Icmpv6TooBig::GetMtu(), ns3::Object::GetObject(), ns3::Icmpv6TooBig::GetPacket(), m_node, NS_LOG_FUNCTION, and ns3::Packet::RemoveHeader().

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,
Ipv6Address const &  src,
Ipv6Address const &  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 932 of file icmpv6-l4-protocol.cc.

References ns3::Packet::Copy(), ns3::Packet::CopyData(), Forward(), ns3::Icmpv6Header::GetCode(), ns3::Icmpv6ParameterError::GetPacket(), NS_LOG_FUNCTION, and ns3::Packet::RemoveHeader().

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,
Ipv6Address const &  src,
Ipv6Address const &  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 325 of file icmpv6-l4-protocol.cc.

References ns3::Packet::Copy(), ns3::Packet::CopyData(), ns3::Ipv6Interface::GetDevice(), 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, m_node, NS_LOG_FUNCTION, ReceiveLLA(), and ns3::Packet::RemoveHeader().

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,
Ipv6Address const &  src,
Ipv6Address const &  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 805 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Add(), ns3::Packet::Copy(), ns3::Packet::CopyData(), FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Icmpv6Redirection::GetDestination(), ns3::Ipv6Interface::GetDevice(), ns3::Object::GetObject(), ns3::Icmpv6Redirection::GetTarget(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET, ns3::NdiscCache::Lookup(), m_node, NS_LOG_FUNCTION, ns3::Packet::RemoveHeader(), 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,
Ipv6Address const &  src,
Ipv6Address const &  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 449 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Add(), ns3::Packet::CopyData(), FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6Address::GetAny(), ns3::Ipv6Interface::GetDevice(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::Object::GetObject(), ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE, ns3::NdiscCache::Lookup(), m_node, ns3::NdiscCache::Entry::MarkStale(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::RemoveHeader(), and ns3::NdiscCache::Entry::SetRouter().

Referenced by Receive().

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

◆ HandleTimeExceeded()

void ns3::Icmpv6L4Protocol::HandleTimeExceeded ( Ptr< Packet p,
Ipv6Address const &  src,
Ipv6Address const &  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 896 of file icmpv6-l4-protocol.cc.

References ns3::Packet::Copy(), ns3::Packet::CopyData(), Forward(), ns3::Icmpv6Header::GetCode(), ns3::Icmpv6TimeExceeded::GetPacket(), NS_LOG_FUNCTION, and ns3::Packet::RemoveHeader().

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 191 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 
)

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 1342 of file icmpv6-l4-protocol.cc.

References FindCache(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::NdiscCache::Entry::IsDelay(), ns3::NdiscCache::Entry::IsPermanent(), ns3::NdiscCache::Entry::IsReachable(), ns3::NdiscCache::Entry::IsStale(), ns3::NdiscCache::Lookup(), 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 
)

◆ NotifyNewAggregate()

void ns3::Icmpv6L4Protocol::NotifyNewAggregate ( void  )
virtual

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 141 of file icmpv6-l4-protocol.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::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]

◆ Receive() [2/2]

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

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 219 of file icmpv6-l4-protocol.cc.

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

◆ ReceiveLLA()

void ns3::Icmpv6L4Protocol::ReceiveLLA ( Icmpv6OptionLinkLayerAddress  lla,
Ipv6Address const &  src,
Ipv6Address const &  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 384 of file icmpv6-l4-protocol.cc.

References ns3::NdiscCache::Add(), FindCache(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6Interface::GetDevice(), ns3::NdiscCache::GetInterface(), ns3::NdiscCache::Lookup(), NS_LOG_FUNCTION, ns3::Ipv6Interface::Send(), and ns3::NdiscCache::Entry::SetRouter().

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 1027 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), data, ns3::Icmpv6Echo::GetSerializedSize(), ns3::Packet::GetSize(), 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 1101 of file icmpv6-l4-protocol.cc.

References ns3::Packet::CreateFragment(), ns3::Packet::GetSize(), 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 1174 of file icmpv6-l4-protocol.cc.

References ns3::Packet::CreateFragment(), ns3::Packet::GetSize(), 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 1150 of file icmpv6-l4-protocol.cc.

References ns3::Packet::CreateFragment(), ns3::Packet::GetSize(), 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 1125 of file icmpv6-l4-protocol.cc.

References ns3::Packet::CreateFragment(), ns3::Packet::GetSize(), 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  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 948 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddPacketTag(), 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:

◆ SendMessage() [2/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 966 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Object::GetObject(), ns3::Icmpv6Header::GetSerializedSize(), ns3::Packet::GetSize(), m_downTarget, m_node, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, PROT_NUMBER, and ns3::SocketIpv6HopLimitTag::SetHopLimit().

+ Here is the call graph for this function:

◆ SendNA()

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

Send a Neighbor Adverstisement.

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

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

References ns3::Packet::AddHeader(), ns3::Ipv6Address::GetAny(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, and SendMessage().

+ 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 1041 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), DelayedSendMessage(), ns3::Ipv6Address::GetAllNodesMulticast(), ns3::Ipv6Address::GetAny(), ns3::Packet::GetSize(), 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 1199 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddAtEnd(), ns3::Packet::AddHeader(), ns3::Icmpv6Header::CalculatePseudoHeaderChecksum(), ns3::Packet::CreateFragment(), ns3::Address::GetLength(), ns3::Icmpv6Redirection::GetSerializedSize(), ns3::Icmpv6OptionLinkLayerAddress::GetSerializedSize(), ns3::Packet::GetSize(), 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 1071 of file icmpv6-l4-protocol.cc.

References ns3::Packet::AddHeader(), DelayedSendMessage(), ns3::Packet::GetSize(), ns3::RandomVariableStream::GetValue(), ns3::Ipv6Address::IsAny(), ns3::Ipv6Address::IsMulticast(), m_solicitationJitter, ns3::MilliSeconds(), NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, ns3::Simulator::Schedule(), and SendMessage().

Referenced by FunctionDadTimeout().

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

◆ SetDownTarget()

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

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 1502 of file icmpv6-l4-protocol.cc.

References NS_LOG_FUNCTION.

◆ SetDownTarget6()

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

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 1508 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 161 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 519 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 524 of file icmpv6-l4-protocol.h.

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

◆ m_delayFirstProbe

Time ns3::Icmpv6L4Protocol::m_delayFirstProbe
private

Neighbor Discovery node constants: delay for the first probe.

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

Referenced by GetDelayFirstProbe(), and GetTypeId().

◆ m_downTarget

IpL4Protocol::DownTargetCallback6 ns3::Icmpv6L4Protocol::m_downTarget
private

◆ m_maxMulticastSolicit

uint8_t ns3::Icmpv6L4Protocol::m_maxMulticastSolicit
private

Neighbor Discovery node constants: max multicast solicitations.

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

Referenced by GetMaxMulticastSolicit(), and GetTypeId().

◆ m_maxUnicastSolicit

uint8_t ns3::Icmpv6L4Protocol::m_maxUnicastSolicit
private

Neighbor Discovery node constants: max unicast solicitations.

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

Referenced by GetMaxUnicastSolicit(), and GetTypeId().

◆ m_node

◆ m_reachableTime

Time ns3::Icmpv6L4Protocol::m_reachableTime
private

Neighbor Discovery node constants: reachable time.

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

Referenced by GetReachableTime(), and GetTypeId().

◆ m_retransmissionTime

Time ns3::Icmpv6L4Protocol::m_retransmissionTime
private

Neighbor Discovery node constants: retransmission timer.

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

Referenced by GetRetransmissionTime(), and GetTypeId().

◆ m_solicitationJitter

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

Random jitter before sending solicitations.

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

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

◆ PROT_NUMBER

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

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