A Discrete-Event Network Simulator
API
ns3::Ipv6L3Protocol Class Reference

IPv6 layer implementation. More...

#include "ipv6-l3-protocol.h"

+ Inheritance diagram for ns3::Ipv6L3Protocol:
+ Collaboration diagram for ns3::Ipv6L3Protocol:

Public Types

enum  DropReason {
  DROP_TTL_EXPIRED = 1 , DROP_NO_ROUTE , DROP_INTERFACE_DOWN , DROP_ROUTE_ERROR ,
  DROP_UNKNOWN_PROTOCOL , DROP_UNKNOWN_OPTION , DROP_MALFORMED_HEADER , DROP_FRAGMENT_TIMEOUT
}
 Reason why a packet has been dropped. More...
 
typedef void(* DropTracedCallback) (const Ipv6Header &header, Ptr< const Packet > packet, DropReason reason, Ptr< Ipv6 > ipv6, uint32_t interface)
 TracedCallback signature for packet drop events. More...
 
typedef void(* SentTracedCallback) (const Ipv6Header &header, Ptr< const Packet > packet, uint32_t interface)
 TracedCallback signature for packet sent, forwarded or local-delivered events. More...
 
typedef void(* TxRxTracedCallback) (Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)
 TracedCallback signature for packet transmission or reception events. More...
 

Public Member Functions

 Ipv6L3Protocol ()
 Constructor. More...
 
 Ipv6L3Protocol (const Ipv6L3Protocol &)=delete
 
 ~Ipv6L3Protocol () override
 Destructor. More...
 
bool AddAddress (uint32_t i, Ipv6InterfaceAddress address, bool addOnLinkRoute=true) override
 Add an address on interface. More...
 
void AddAutoconfiguredAddress (uint32_t interface, Ipv6Address network, Ipv6Prefix mask, uint8_t flags, uint32_t validTime, uint32_t preferredTime, Ipv6Address defaultRouter=Ipv6Address::GetZero())
 Add an autoconfigured address with RA information. More...
 
uint32_t AddInterface (Ptr< NetDevice > device) override
 Add IPv6 interface for a device. More...
 
void AddMulticastAddress (Ipv6Address address)
 Adds a multicast address to the list of addresses to pass to local deliver. More...
 
void AddMulticastAddress (Ipv6Address address, uint32_t interface)
 Adds a multicast address to the list of addresses to pass to local deliver. More...
 
Ptr< SocketCreateRawSocket ()
 Create raw IPv6 socket. More...
 
void DeleteRawSocket (Ptr< Socket > socket)
 Remove raw IPv6 socket. More...
 
Ipv6InterfaceAddress GetAddress (uint32_t interfaceIndex, uint32_t addressIndex) const override
 Get an address. More...
 
Ptr< Icmpv6L4ProtocolGetIcmpv6 () const
 Get ICMPv6 protocol. More...
 
Ptr< Ipv6InterfaceGetInterface (uint32_t i) const
 Get an interface. More...
 
int32_t GetInterfaceForAddress (Ipv6Address addr) const override
 Get interface index which has specified IPv6 address. More...
 
int32_t GetInterfaceForDevice (Ptr< const NetDevice > device) const override
 Get interface index which is on a specified net device. More...
 
int32_t GetInterfaceForPrefix (Ipv6Address addr, Ipv6Prefix mask) const override
 Get interface index which match specified address/prefix. More...
 
uint16_t GetMetric (uint32_t i) const override
 Get metric for an interface. More...
 
uint16_t GetMtu (uint32_t i) const override
 Get MTU for an interface. More...
 
uint32_t GetNAddresses (uint32_t interface) const override
 Get number of address for an interface. More...
 
Ptr< NetDeviceGetNetDevice (uint32_t i) override
 Get device by index. More...
 
uint32_t GetNInterfaces () const override
 Get current number of interface on this stack. More...
 
Ptr< IpL4ProtocolGetProtocol (int protocolNumber) const override
 Get L4 protocol by protocol number. More...
 
Ptr< IpL4ProtocolGetProtocol (int protocolNumber, int32_t interfaceIndex) const override
 Get L4 protocol by protocol number for the specified interface. More...
 
Ptr< Ipv6RoutingProtocolGetRoutingProtocol () const override
 Get current routing protocol used. More...
 
void Insert (Ptr< IpL4Protocol > protocol) override
 Add a L4 protocol. More...
 
void Insert (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex) override
 Add a L4 protocol to a specific interface. More...
 
bool IsForwarding (uint32_t i) const override
 Is interface allows forwarding ? More...
 
bool IsRegisteredMulticastAddress (Ipv6Address address) const
 Checks if the address has been registered. More...
 
bool IsRegisteredMulticastAddress (Ipv6Address address, uint32_t interface) const
 Checks if the address has been registered for a specific interface. More...
 
bool IsUp (uint32_t i) const override
 Is specified interface up ? More...
 
Ipv6L3Protocoloperator= (const Ipv6L3Protocol &)=delete
 
bool ReachabilityHint (uint32_t ipInterfaceIndex, Ipv6Address address)
 Provides reachability hint for Neighbor Cache Entries from L4-L7 protocols. More...
 
void Receive (Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
 Receive method when a packet arrive in the stack. More...
 
void RegisterExtensions () override
 Register the IPv6 Extensions. More...
 
void RegisterOptions () override
 Register the IPv6 Options. More...
 
void Remove (Ptr< IpL4Protocol > protocol) override
 Remove a L4 protocol. More...
 
void Remove (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex) override
 Remove a L4 protocol from a specific interface. More...
 
bool RemoveAddress (uint32_t interfaceIndex, Ipv6Address address) override
 Remove a specified Ipv6 address from an interface. More...
 
bool RemoveAddress (uint32_t interfaceIndex, uint32_t addressIndex) override
 Remove an address from an interface. More...
 
void RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Address network, Ipv6Prefix mask, Ipv6Address defaultRouter)
 Remove an autoconfigured address. More...
 
void RemoveMulticastAddress (Ipv6Address address)
 Removes a multicast address from the list of addresses to pass to local deliver. More...
 
void RemoveMulticastAddress (Ipv6Address address, uint32_t interface)
 Removes a multicast address from the list of addresses to pass to local deliver. More...
 
virtual void ReportDrop (Ipv6Header ipHeader, Ptr< Packet > p, DropReason dropReason)
 Report a packet drop. More...
 
void Send (Ptr< Packet > packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr< Ipv6Route > route) override
 Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers. More...
 
void SetDefaultTclass (uint8_t tclass)
 Set the default TCLASS. More...
 
void SetDefaultTtl (uint8_t ttl)
 Set the default TTL. More...
 
void SetDown (uint32_t i) override
 set an interface down. More...
 
void SetForwarding (uint32_t i, bool val) override
 Enable or disable forwarding on interface. More...
 
void SetMetric (uint32_t i, uint16_t metric) override
 Set metric for an interface. More...
 
void SetNode (Ptr< Node > node)
 Set node associated with this stack. More...
 
void SetPmtu (Ipv6Address dst, uint32_t pmtu) override
 Set the Path MTU for the specified IPv6 destination address. More...
 
void SetRoutingProtocol (Ptr< Ipv6RoutingProtocol > routingProtocol) override
 Set routing protocol for this stack. More...
 
void SetUp (uint32_t i) override
 Set an interface up. More...
 
Ipv6Address SourceAddressSelection (uint32_t interface, Ipv6Address dest) override
 Choose the source address to use with destination address. More...
 
- Public Member Functions inherited from ns3::Ipv6
 Ipv6 ()
 Constructor. More...
 
 ~Ipv6 () override
 Destructor. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::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 (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () 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[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () 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 errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID of this class. More...
 
- Static Public Member Functions inherited from ns3::Ipv6
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Static Public Attributes

static const uint16_t PROT_NUMBER = 0x86DD
 The protocol number for IPv6 (0x86DD). More...
 
- Static Public Attributes inherited from ns3::Ipv6
static const uint32_t IF_ANY = 0xffffffff
 Any interface magic number. More...
 

Protected Member Functions

void DoDispose () override
 Dispose object. More...
 
void NotifyNewAggregate () override
 Notify other components connected to the node that a new stack member is now connected. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize ()
 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 ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Private Types

typedef std::list< Ptr< Ipv6AutoconfiguredPrefix > > Ipv6AutoconfiguredPrefixList
 Container of the IPv6 Autoconfigured addresses. More...
 
typedef std::list< Ptr< Ipv6AutoconfiguredPrefix > >::iterator Ipv6AutoconfiguredPrefixListI
 Iterator of the container of the IPv6 Autoconfigured addresses. More...
 
typedef std::vector< Ptr< Ipv6Interface > > Ipv6InterfaceList
 Container of the IPv6 Interfaces. More...
 
typedef std::map< Ptr< const NetDevice >, uint32_t > Ipv6InterfaceReverseContainer
 Container of NetDevices registered to IPv6 and their interface indexes. More...
 
typedef std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t > Ipv6RegisteredMulticastAddress_t
 Container of the IPv6 multicast addresses. More...
 
typedef std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::const_iterator Ipv6RegisteredMulticastAddressCIter_t
 Container Const Iterator of the IPv6 multicast addresses. More...
 
typedef std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::iterator Ipv6RegisteredMulticastAddressIter_t
 Container Iterator of the IPv6 multicast addresses. More...
 
typedef std::pair< Ipv6Address, uint64_t > Ipv6RegisteredMulticastAddressKey_t
 IPv6 multicast addresses / interface key. More...
 
typedef std::map< Ipv6Address, uint32_t > Ipv6RegisteredMulticastAddressNoInterface_t
 Container of the IPv6 multicast addresses. More...
 
typedef std::map< Ipv6Address, uint32_t >::const_iterator Ipv6RegisteredMulticastAddressNoInterfaceCIter_t
 Container Const Iterator of the IPv6 multicast addresses. More...
 
typedef std::map< Ipv6Address, uint32_t >::iterator Ipv6RegisteredMulticastAddressNoInterfaceIter_t
 Container Iterator of the IPv6 multicast addresses. More...
 
typedef std::map< L4ListKey_t, Ptr< IpL4Protocol > > L4List_t
 Container of the IPv6 L4 instances. More...
 
typedef std::pair< int, int32_t > L4ListKey_t
 Container of the IPv6 L4 keys: protocol number, interface index. More...
 
typedef std::list< Ptr< Ipv6RawSocketImpl > > SocketList
 Container of the IPv6 Raw Sockets. More...
 

Private Member Functions

uint32_t AddIpv6Interface (Ptr< Ipv6Interface > interface)
 Add an IPv6 interface to the stack. More...
 
Ipv6Header BuildHeader (Ipv6Address src, Ipv6Address dst, uint8_t protocol, uint16_t payloadSize, uint8_t hopLimit, uint8_t tclass)
 Construct an IPv6 header. More...
 
void CallTxTrace (const Ipv6Header &ipHeader, Ptr< Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)
 Make a copy of the packet, add the header and invoke the TX trace callback. More...
 
bool GetIpForward () const override
 Get IPv6 forwarding state. More...
 
bool GetMtuDiscover () const override
 Get IPv6 MTU discover state. More...
 
virtual bool GetSendIcmpv6Redirect () const
 Get the ICMPv6 Redirect sending state. More...
 
bool GetStrongEndSystemModel () const override
 Get the Strong End System Model status. More...
 
void IpForward (Ptr< const NetDevice > idev, Ptr< Ipv6Route > rtentry, Ptr< const Packet > p, const Ipv6Header &header)
 Forward a packet. More...
 
void IpMulticastForward (Ptr< const NetDevice > idev, Ptr< Ipv6MulticastRoute > mrtentry, Ptr< const Packet > p, const Ipv6Header &header)
 Forward a multicast packet. More...
 
void LocalDeliver (Ptr< const Packet > p, const Ipv6Header &ip, uint32_t iif)
 Deliver a packet. More...
 
void RouteInputError (Ptr< const Packet > p, const Ipv6Header &ipHeader, Socket::SocketErrno sockErrno)
 Fallback when no route is found. More...
 
void SendRealOut (Ptr< Ipv6Route > route, Ptr< Packet > packet, const Ipv6Header &ipHeader)
 Send packet with route. More...
 
void SetIpForward (bool forward) override
 Set IPv6 forwarding state. More...
 
void SetMtuDiscover (bool mtuDiscover) override
 Set IPv6 MTU discover state. More...
 
virtual void SetSendIcmpv6Redirect (bool sendIcmpv6Redirect)
 Set the ICMPv6 Redirect sending state. More...
 
void SetStrongEndSystemModel (bool model) override
 Set or unset the Strong End System Model. More...
 
void SetupLoopback ()
 Setup loopback interface. More...
 

Private Attributes

uint8_t m_defaultTclass
 Default TCLASS for outgoing packets. More...
 
uint8_t m_defaultTtl
 Default TTL for outgoing packets. More...
 
TracedCallback< const Ipv6Header &, Ptr< const Packet >, DropReason, Ptr< Ipv6 >, uint32_t > m_dropTrace
 Callback to trace drop packets. More...
 
Ipv6RoutingProtocol::ErrorCallback m_ecb
 Error callback. More...
 
Ipv6InterfaceList m_interfaces
 List of IPv6 interfaces. More...
 
bool m_ipForward
 Forwarding packets (i.e. More...
 
Ipv6RoutingProtocol::LocalDeliverCallback m_lcb
 Local delivery callback. More...
 
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_localDeliverTrace
 Trace of locally delivered packets. More...
 
Ipv6RoutingProtocol::MulticastForwardCallback m_mcb
 Multicast forward callback. More...
 
bool m_mtuDiscover
 MTU Discover (i.e. More...
 
Ipv6RegisteredMulticastAddress_t m_multicastAddresses
 List of multicast IP addresses of interest, divided per interface. More...
 
Ipv6RegisteredMulticastAddressNoInterface_t m_multicastAddressesNoInterface
 List of multicast IP addresses of interest for all the interfaces. More...
 
uint32_t m_nInterfaces
 Number of IPv6 interfaces managed by the stack. More...
 
Ptr< Nodem_node
 Node attached to stack. More...
 
Ptr< Ipv6PmtuCachem_pmtuCache
 Path MTU Cache. More...
 
Ipv6AutoconfiguredPrefixList m_prefixes
 List of IPv6 prefix received from RA. More...
 
L4List_t m_protocols
 List of transport protocol. More...
 
Ipv6InterfaceReverseContainer m_reverseInterfacesContainer
 Container of NetDevice / Interface index associations. More...
 
Ptr< Ipv6RoutingProtocolm_routingProtocol
 Routing protocol. More...
 
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > m_rxTrace
 Callback to trace RX (reception) packets. More...
 
bool m_sendIcmpv6Redirect
 Allow ICMPv6 Redirect sending state. More...
 
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_sendOutgoingTrace
 Trace of sent packets. More...
 
SocketList m_sockets
 List of IPv6 raw sockets. More...
 
bool m_strongEndSystemModel
 Rejects packets directed to an interface with wrong address (RFC 1222). More...
 
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > m_txTrace
 Callback to trace TX (transmission) packets. More...
 
Ipv6RoutingProtocol::UnicastForwardCallback m_ucb
 Unicast forward callback. More...
 
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_unicastForwardTrace
 Trace of unicast forwarded packets. More...
 

Friends

class ::Ipv6L3ProtocolTestCase
 Ipv6L3ProtocolTestCase test case. More...
 

Related Functions

(Note that these are not member functions.)

class Ipv6ExtensionLooseRouting
 Ipv6ExtensionLooseRouting. More...
 

Additional Inherited Members

Detailed Description

IPv6 layer implementation.

This class contains two distinct groups of trace sources. The trace sources 'Rx' and 'Tx' are called, respectively, immediately after receiving from the NetDevice and immediately before sending to a NetDevice for transmitting a packet. These are low level trace sources that include the Ipv6Header already serialized into the packet. In contrast, the Drop, SendOutgoing, UnicastForward, and LocalDeliver trace sources are slightly higher-level and pass around the Ipv6Header as an explicit parameter and not as part of the packet.

Definition at line 63 of file ipv6-l3-protocol.h.

Member Typedef Documentation

◆ DropTracedCallback

typedef void(* ns3::Ipv6L3Protocol::DropTracedCallback) (const Ipv6Header &header, Ptr< const Packet > packet, DropReason reason, Ptr< Ipv6 > ipv6, uint32_t interface)

TracedCallback signature for packet drop events.

Parameters
[in]headerthe Ipv6Header.
[in]packetthe packet.
[in]reasonthe reason the packet was dropped.
[in]ipv6the Ipv6 protocol
[in]interfacethe IP-level interface index
Deprecated:
The non-const Ptr<Ipv6> argument is deprecated and will be changed to Ptr<const Ipv6> in a future release.

Definition at line 423 of file ipv6-l3-protocol.h.

◆ Ipv6AutoconfiguredPrefixList

Container of the IPv6 Autoconfigured addresses.

Definition at line 544 of file ipv6-l3-protocol.h.

◆ Ipv6AutoconfiguredPrefixListI

Iterator of the container of the IPv6 Autoconfigured addresses.

Definition at line 549 of file ipv6-l3-protocol.h.

◆ Ipv6InterfaceList

Container of the IPv6 Interfaces.

Definition at line 519 of file ipv6-l3-protocol.h.

◆ Ipv6InterfaceReverseContainer

typedef std::map<Ptr<const NetDevice>, uint32_t> ns3::Ipv6L3Protocol::Ipv6InterfaceReverseContainer
private

Container of NetDevices registered to IPv6 and their interface indexes.

Definition at line 524 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddress_t

Container of the IPv6 multicast addresses.

Definition at line 797 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddressCIter_t

Container Const Iterator of the IPv6 multicast addresses.

Definition at line 809 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddressIter_t

Container Iterator of the IPv6 multicast addresses.

Definition at line 803 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddressKey_t

IPv6 multicast addresses / interface key.

Definition at line 791 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddressNoInterface_t

Container of the IPv6 multicast addresses.

Definition at line 814 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddressNoInterfaceCIter_t

typedef std::map<Ipv6Address, uint32_t>::const_iterator ns3::Ipv6L3Protocol::Ipv6RegisteredMulticastAddressNoInterfaceCIter_t
private

Container Const Iterator of the IPv6 multicast addresses.

Definition at line 826 of file ipv6-l3-protocol.h.

◆ Ipv6RegisteredMulticastAddressNoInterfaceIter_t

Container Iterator of the IPv6 multicast addresses.

Definition at line 820 of file ipv6-l3-protocol.h.

◆ L4List_t

Container of the IPv6 L4 instances.

Definition at line 539 of file ipv6-l3-protocol.h.

◆ L4ListKey_t

typedef std::pair<int, int32_t> ns3::Ipv6L3Protocol::L4ListKey_t
private

Container of the IPv6 L4 keys: protocol number, interface index.

Definition at line 534 of file ipv6-l3-protocol.h.

◆ SentTracedCallback

typedef void(* ns3::Ipv6L3Protocol::SentTracedCallback) (const Ipv6Header &header, Ptr< const Packet > packet, uint32_t interface)

TracedCallback signature for packet sent, forwarded or local-delivered events.

Parameters
[in]headerthe Ipv6Header.
[in]packetthe packet.
[in]interfacethe IP-level interface index

Definition at line 395 of file ipv6-l3-protocol.h.

◆ SocketList

Container of the IPv6 Raw Sockets.

Definition at line 529 of file ipv6-l3-protocol.h.

◆ TxRxTracedCallback

typedef void(* ns3::Ipv6L3Protocol::TxRxTracedCallback) (Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)

TracedCallback signature for packet transmission or reception events.

Parameters
[in]packetthe packet.
[in]ipv6the Ipv6 protocol
[in]interfacethe IP-level interface index
Deprecated:
The non-const Ptr<Ipv6> argument is deprecated and will be changed to Ptr<const Ipv6> in a future release.

Definition at line 408 of file ipv6-l3-protocol.h.

Member Enumeration Documentation

◆ DropReason

Reason why a packet has been dropped.

Enumerator
DROP_TTL_EXPIRED 

Packet TTL has expired.

DROP_NO_ROUTE 

No route to host.

DROP_INTERFACE_DOWN 

Interface is down so can not send packet.

DROP_ROUTE_ERROR 

Route error.

DROP_UNKNOWN_PROTOCOL 

Unknown L4 protocol.

DROP_UNKNOWN_OPTION 

Unknown option.

DROP_MALFORMED_HEADER 

Malformed header.

DROP_FRAGMENT_TIMEOUT 

Fragment timeout.

Definition at line 81 of file ipv6-l3-protocol.h.

Constructor & Destructor Documentation

◆ Ipv6L3Protocol() [1/2]

ns3::Ipv6L3Protocol::Ipv6L3Protocol ( )

Constructor.

Definition at line 122 of file ipv6-l3-protocol.cc.

References ns3::Object::AggregateObject(), IpForward(), IpMulticastForward(), LocalDeliver(), m_ecb, m_lcb, m_mcb, m_pmtuCache, m_ucb, ns3::MakeCallback(), NS_LOG_FUNCTION, and RouteInputError().

+ Here is the call graph for this function:

◆ ~Ipv6L3Protocol()

ns3::Ipv6L3Protocol::~Ipv6L3Protocol ( )
override

Destructor.

Definition at line 136 of file ipv6-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ Ipv6L3Protocol() [2/2]

ns3::Ipv6L3Protocol::Ipv6L3Protocol ( const Ipv6L3Protocol )
delete

Member Function Documentation

◆ AddAddress()

bool ns3::Ipv6L3Protocol::AddAddress ( uint32_t  i,
Ipv6InterfaceAddress  address,
bool  addOnLinkRoute = true 
)
overridevirtual

Add an address on interface.

Parameters
iinterface index
addressaddress to add
addOnLinkRouteadd on-link route to the network (default true)
Returns
true if the operation succeeded

Implements ns3::Ipv6.

Definition at line 435 of file ipv6-l3-protocol.cc.

References first::address, GetRoutingProtocol(), ns3::Ipv6Address::GetZero(), m_routingProtocol, and NS_LOG_FUNCTION.

Referenced by AddAutoconfiguredAddress().

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

◆ AddAutoconfiguredAddress()

void ns3::Ipv6L3Protocol::AddAutoconfiguredAddress ( uint32_t  interface,
Ipv6Address  network,
Ipv6Prefix  mask,
uint8_t  flags,
uint32_t  validTime,
uint32_t  preferredTime,
Ipv6Address  defaultRouter = Ipv6Address::GetZero() 
)

Add an autoconfigured address with RA information.

Parameters
interfaceinterface index
networknetwork prefix
masknetwork mask
flagsflags of the prefix information option (home agent, ...)
validTimevalid time of the prefix
preferredTimepreferred time of the prefix
defaultRouterdefault router address

Definition at line 321 of file ipv6-l3-protocol.cc.

References AddAddress(), first::address, ns3::Icmpv6OptionPrefixInformation::AUTADDRCONF, ns3::Ipv6Address::GetAny(), ns3::Ipv6Interface::GetDevice(), GetInterface(), GetRoutingProtocol(), ns3::Ipv6Address::IsAny(), m_node, m_prefixes, m_routingProtocol, ns3::Ipv6Address::MakeAutoconfiguredAddress(), NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Icmpv6OptionPrefixInformation::ONLINK, and ns3::Ipv6AutoconfiguredPrefix::StartPreferredTimer().

+ Here is the call graph for this function:

◆ AddInterface()

uint32_t ns3::Ipv6L3Protocol::AddInterface ( Ptr< NetDevice device)
overridevirtual

Add IPv6 interface for a device.

Parameters
devicenet device
Returns
interface index

Implements ns3::Ipv6.

Definition at line 199 of file ipv6-l3-protocol.cc.

References AddIpv6Interface(), ns3::CreateObject(), ns3::Object::GetObject(), m_ipForward, m_node, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, PROT_NUMBER, Receive(), ns3::TrafficControlLayer::Receive(), and ns3::Node::RegisterProtocolHandler().

+ Here is the call graph for this function:

◆ AddIpv6Interface()

uint32_t ns3::Ipv6L3Protocol::AddIpv6Interface ( Ptr< Ipv6Interface interface)
private

Add an IPv6 interface to the stack.

Parameters
interfaceinterface to add
Returns
index of newly added interface

Definition at line 224 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::GetDevice(), m_interfaces, m_nInterfaces, m_reverseInterfacesContainer, and NS_LOG_FUNCTION.

Referenced by AddInterface(), and SetupLoopback().

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

◆ AddMulticastAddress() [1/2]

void ns3::Ipv6L3Protocol::AddMulticastAddress ( Ipv6Address  address)

Adds a multicast address to the list of addresses to pass to local deliver.

Parameters
addressthe address.

Definition at line 1729 of file ipv6-l3-protocol.cc.

References first::address, m_multicastAddressesNoInterface, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ AddMulticastAddress() [2/2]

void ns3::Ipv6L3Protocol::AddMulticastAddress ( Ipv6Address  address,
uint32_t  interface 
)

Adds a multicast address to the list of addresses to pass to local deliver.

Parameters
addressthe address.
interfacethe incoming interface.

Definition at line 1714 of file ipv6-l3-protocol.cc.

References first::address, m_multicastAddresses, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ BuildHeader()

Ipv6Header ns3::Ipv6L3Protocol::BuildHeader ( Ipv6Address  src,
Ipv6Address  dst,
uint8_t  protocol,
uint16_t  payloadSize,
uint8_t  hopLimit,
uint8_t  tclass 
)
private

Construct an IPv6 header.

Parameters
srcsource IPv6 address
dstdestination IPv6 address
protocolL4 protocol
payloadSizepayload size
hopLimitHop limit
tclassTclass
Returns
newly created IPv6 header

Definition at line 1620 of file ipv6-l3-protocol.cc.

References NS_LOG_FUNCTION, ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), ns3::Ipv6Header::SetSource(), and ns3::Ipv6Header::SetTrafficClass().

Referenced by Send().

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

◆ CallTxTrace()

void ns3::Ipv6L3Protocol::CallTxTrace ( const Ipv6Header ipHeader,
Ptr< Packet packet,
Ptr< Ipv6 ipv6,
uint32_t  interface 
)
private

Make a copy of the packet, add the header and invoke the TX trace callback.

Parameters
ipHeaderthe IP header that will be added to the packet
packetthe packet
ipv6the Ipv6 protocol
interfacethe IP-level interface index

Note: If the TracedCallback API ever is extended, we could consider to check for connected functions before adding the header

Definition at line 1198 of file ipv6-l3-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::Copy(), and m_txTrace.

Referenced by SendRealOut().

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

◆ CreateRawSocket()

Ptr< Socket > ns3::Ipv6L3Protocol::CreateRawSocket ( )

Create raw IPv6 socket.

Returns
newly raw socket

Definition at line 883 of file ipv6-l3-protocol.cc.

References m_node, m_sockets, NS_LOG_FUNCTION, and ns3::Ipv6RawSocketImpl::SetNode().

+ Here is the call graph for this function:

◆ DeleteRawSocket()

void ns3::Ipv6L3Protocol::DeleteRawSocket ( Ptr< Socket socket)

Remove raw IPv6 socket.

Parameters
socketsocket to remove

Definition at line 893 of file ipv6-l3-protocol.cc.

References m_sockets, and NS_LOG_FUNCTION.

◆ DoDispose()

void ns3::Ipv6L3Protocol::DoDispose ( void  )
overrideprotectedvirtual

Dispose object.

Reimplemented from ns3::Object.

Definition at line 142 of file ipv6-l3-protocol.cc.

References ns3::Object::DoDispose(), m_interfaces, m_node, m_pmtuCache, m_prefixes, m_protocols, m_reverseInterfacesContainer, m_routingProtocol, m_sockets, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetAddress()

Ipv6InterfaceAddress ns3::Ipv6L3Protocol::GetAddress ( uint32_t  interfaceIndex,
uint32_t  addressIndex 
) const
overridevirtual

Get an address.

Parameters
interfaceIndexinterface index
addressIndexaddress index on the interface
Returns
Ipv6InterfaceAddress or assert if not found

Implements ns3::Ipv6.

Definition at line 468 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::GetAddress(), and NS_LOG_FUNCTION.

Referenced by Receive(), UanExperiment::SendPackets(), and SendRealOut().

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

◆ GetIcmpv6()

Ptr< Icmpv6L4Protocol > ns3::Ipv6L3Protocol::GetIcmpv6 ( ) const

Get ICMPv6 protocol.

Returns
Icmpv6L4Protocol pointer

Definition at line 908 of file ipv6-l3-protocol.cc.

References ns3::Object::GetObject(), GetProtocol(), ns3::Icmpv6L4Protocol::GetStaticProtocolNumber(), and NS_LOG_FUNCTION.

Referenced by IpForward(), LocalDeliver(), RouteInputError(), and SendRealOut().

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

◆ GetInterface()

Ptr< Ipv6Interface > ns3::Ipv6L3Protocol::GetInterface ( uint32_t  i) const

Get an interface.

Parameters
iinterface index
Returns
IPv6 interface pointer

Definition at line 236 of file ipv6-l3-protocol.cc.

References m_interfaces, and NS_LOG_FUNCTION.

Referenced by AddAutoconfiguredAddress(), GetNetDevice(), IpForward(), LocalDeliver(), RemoveAutoconfiguredAddress(), and SendRealOut().

+ Here is the caller graph for this function:

◆ GetInterfaceForAddress()

int32_t ns3::Ipv6L3Protocol::GetInterfaceForAddress ( Ipv6Address  addr) const
overridevirtual

Get interface index which has specified IPv6 address.

Parameters
addrIPv6 address
Returns
interface index or -1 if not found

Implements ns3::Ipv6.

Definition at line 255 of file ipv6-l3-protocol.cc.

References first::address, m_interfaces, max, and NS_LOG_FUNCTION.

Referenced by Send().

+ Here is the caller graph for this function:

◆ GetInterfaceForDevice()

int32_t ns3::Ipv6L3Protocol::GetInterfaceForDevice ( Ptr< const NetDevice device) const
overridevirtual

Get interface index which is on a specified net device.

Parameters
devicenet device
Returns
the interface index

Implements ns3::Ipv6.

Definition at line 307 of file ipv6-l3-protocol.cc.

References m_reverseInterfacesContainer, and NS_LOG_FUNCTION.

Referenced by IpForward(), Receive(), and Send().

+ Here is the caller graph for this function:

◆ GetInterfaceForPrefix()

int32_t ns3::Ipv6L3Protocol::GetInterfaceForPrefix ( Ipv6Address  addr,
Ipv6Prefix  mask 
) const
overridevirtual

Get interface index which match specified address/prefix.

Parameters
addrIPv6 address
maskIPv6 prefix (mask)
Returns
interface index or -1 if not found

Implements ns3::Ipv6.

Definition at line 278 of file ipv6-l3-protocol.cc.

References first::address, m_interfaces, and NS_LOG_FUNCTION.

◆ GetIpForward()

bool ns3::Ipv6L3Protocol::GetIpForward ( ) const
overrideprivatevirtual

Get IPv6 forwarding state.

Returns
forwarding state (enabled or not)

Implements ns3::Ipv6.

Definition at line 723 of file ipv6-l3-protocol.cc.

References m_ipForward, and NS_LOG_FUNCTION.

◆ GetMetric()

uint16_t ns3::Ipv6L3Protocol::GetMetric ( uint32_t  i) const
overridevirtual

Get metric for an interface.

Parameters
iindex
Returns
metric

Implements ns3::Ipv6.

Definition at line 525 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::GetMetric(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetMtu()

uint16_t ns3::Ipv6L3Protocol::GetMtu ( uint32_t  i) const
overridevirtual

Get MTU for an interface.

Parameters
iindex
Returns
MTU

Implements ns3::Ipv6.

Definition at line 533 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::GetDevice(), IPV6_MIN_MTU, m_mtuDiscover, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetMtuDiscover()

bool ns3::Ipv6L3Protocol::GetMtuDiscover ( ) const
overrideprivatevirtual

Get IPv6 MTU discover state.

Returns
MTU discover state (enabled or not)

Implements ns3::Ipv6.

Definition at line 737 of file ipv6-l3-protocol.cc.

References m_mtuDiscover, and NS_LOG_FUNCTION.

◆ GetNAddresses()

uint32_t ns3::Ipv6L3Protocol::GetNAddresses ( uint32_t  interface) const
overridevirtual

Get number of address for an interface.

Parameters
interfaceinterface index
Returns
number of address

Implements ns3::Ipv6.

Definition at line 460 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::GetNAddresses(), and NS_LOG_FUNCTION.

Referenced by Receive(), SendRealOut(), and SourceAddressSelection().

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

◆ GetNetDevice()

Ptr< NetDevice > ns3::Ipv6L3Protocol::GetNetDevice ( uint32_t  i)
overridevirtual

Get device by index.

Parameters
idevice index on this stack
Returns
NetDevice pointer

Implements ns3::Ipv6.

Definition at line 300 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::GetDevice(), GetInterface(), and NS_LOG_FUNCTION.

Referenced by IpMulticastForward(), and Send().

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

◆ GetNInterfaces()

uint32_t ns3::Ipv6L3Protocol::GetNInterfaces ( ) const
overridevirtual

Get current number of interface on this stack.

Returns
number of interface registered

Implements ns3::Ipv6.

Definition at line 248 of file ipv6-l3-protocol.cc.

References m_nInterfaces, and NS_LOG_FUNCTION.

Referenced by Receive(), and SendRealOut().

+ Here is the caller graph for this function:

◆ GetProtocol() [1/2]

Ptr< IpL4Protocol > ns3::Ipv6L3Protocol::GetProtocol ( int  protocolNumber) const
overridevirtual

Get L4 protocol by protocol number.

Parameters
protocolNumberprotocol number
Returns
corresponding IpL4Protocol or 0 if not found

Implements ns3::Ipv6.

Definition at line 849 of file ipv6-l3-protocol.cc.

References NS_LOG_FUNCTION.

Referenced by GetIcmpv6(), and LocalDeliver().

+ Here is the caller graph for this function:

◆ GetProtocol() [2/2]

Ptr< IpL4Protocol > ns3::Ipv6L3Protocol::GetProtocol ( int  protocolNumber,
int32_t  interfaceIndex 
) const
overridevirtual

Get L4 protocol by protocol number for the specified interface.

Parameters
protocolNumberprotocol number
interfaceIndexinterface index, -1 means "any" interface.
Returns
corresponding IpL4Protocol or 0 if not found

Implements ns3::Ipv6.

Definition at line 857 of file ipv6-l3-protocol.cc.

References m_protocols, and NS_LOG_FUNCTION.

◆ GetRoutingProtocol()

Ptr< Ipv6RoutingProtocol > ns3::Ipv6L3Protocol::GetRoutingProtocol ( ) const
overridevirtual

Get current routing protocol used.

Returns
routing protocol

Implements ns3::Ipv6.

Definition at line 192 of file ipv6-l3-protocol.cc.

References m_routingProtocol, and NS_LOG_FUNCTION.

Referenced by AddAddress(), AddAutoconfiguredAddress(), and RemoveAutoconfiguredAddress().

+ Here is the caller graph for this function:

◆ GetSendIcmpv6Redirect()

bool ns3::Ipv6L3Protocol::GetSendIcmpv6Redirect ( ) const
privatevirtual

Get the ICMPv6 Redirect sending state.

Returns
ICMPv6 Redirect sending state (enabled or not)

Definition at line 751 of file ipv6-l3-protocol.cc.

References m_sendIcmpv6Redirect, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetStrongEndSystemModel()

bool ns3::Ipv6L3Protocol::GetStrongEndSystemModel ( ) const
overrideprivatevirtual

Get the Strong End System Model status.

RFC1122 term for whether host rejects datagram with a dest. address on another interface

Returns
true for Strong End System Model activated

Implements ns3::Ipv6.

Definition at line 1846 of file ipv6-l3-protocol.cc.

References m_strongEndSystemModel, and NS_LOG_FUNCTION.

Referenced by Receive().

+ Here is the caller graph for this function:

◆ GetTypeId()

◆ Insert() [1/2]

void ns3::Ipv6L3Protocol::Insert ( Ptr< IpL4Protocol protocol)
overridevirtual

Add a L4 protocol.

Parameters
protocolL4 protocol

Implements ns3::Ipv6.

Definition at line 786 of file ipv6-l3-protocol.cc.

References ns3::IpL4Protocol::GetProtocolNumber(), m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ Insert() [2/2]

void ns3::Ipv6L3Protocol::Insert ( Ptr< IpL4Protocol protocol,
uint32_t  interfaceIndex 
)
overridevirtual

Add a L4 protocol to a specific interface.

This may be called multiple times for multiple interfaces for the same protocol. To insert for all interfaces, use the separate Insert (Ptr<IpL4Protocol> protocol) method.

Setting a protocol on a specific interface will overwrite the previously bound protocol.

Parameters
protocolL4 protocol.
interfaceIndexinterface index.

Implements ns3::Ipv6.

Definition at line 798 of file ipv6-l3-protocol.cc.

References ns3::IpL4Protocol::GetProtocolNumber(), m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ IpForward()

◆ IpMulticastForward()

void ns3::Ipv6L3Protocol::IpMulticastForward ( Ptr< const NetDevice idev,
Ptr< Ipv6MulticastRoute mrtentry,
Ptr< const Packet p,
const Ipv6Header header 
)
private

Forward a multicast packet.

Parameters
idevPointer to ingress network device
mrtentryroute
ppacket to forward
headerIPv6 header to add to the packet

Definition at line 1436 of file ipv6-l3-protocol.cc.

References ns3::Packet::Copy(), DROP_TTL_EXPIRED, ns3::Ipv6Address::GetAny(), ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetHopLimit(), ns3::Node::GetId(), GetNetDevice(), ns3::Ipv6Header::GetSource(), m_dropTrace, m_node, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, SendRealOut(), and ns3::Ipv6Header::SetHopLimit().

Referenced by Ipv6L3Protocol().

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

◆ IsForwarding()

bool ns3::Ipv6L3Protocol::IsForwarding ( uint32_t  i) const
overridevirtual

Is interface allows forwarding ?

Parameters
iinterface index
Returns
true if the interface is forwarding

Implements ns3::Ipv6.

Definition at line 646 of file ipv6-l3-protocol.cc.

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ IsRegisteredMulticastAddress() [1/2]

bool ns3::Ipv6L3Protocol::IsRegisteredMulticastAddress ( Ipv6Address  address) const

Checks if the address has been registered.

Parameters
addressthe address.
Returns
true if the address is registered.

Definition at line 1780 of file ipv6-l3-protocol.cc.

References first::address, m_multicastAddressesNoInterface, and NS_LOG_FUNCTION.

Referenced by Receive().

+ Here is the caller graph for this function:

◆ IsRegisteredMulticastAddress() [2/2]

bool ns3::Ipv6L3Protocol::IsRegisteredMulticastAddress ( Ipv6Address  address,
uint32_t  interface 
) const

Checks if the address has been registered for a specific interface.

Parameters
addressthe address.
interfacethe incoming interface.
Returns
true if the address is registered.

Definition at line 1769 of file ipv6-l3-protocol.cc.

References first::address, m_multicastAddresses, and NS_LOG_FUNCTION.

◆ IsUp()

bool ns3::Ipv6L3Protocol::IsUp ( uint32_t  i) const
overridevirtual

Is specified interface up ?

Parameters
iinterface index
Returns
true if the interface is up

Implements ns3::Ipv6.

Definition at line 555 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Interface::IsUp(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ LocalDeliver()

◆ NotifyNewAggregate()

void ns3::Ipv6L3Protocol::NotifyNewAggregate ( )
overrideprotectedvirtual

Notify other components connected to the node that a new stack member is now connected.

This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.

Reimplemented from ns3::Object.

Definition at line 758 of file ipv6-l3-protocol.cc.

References m_node, ns3::Object::NotifyNewAggregate(), NS_LOG_FUNCTION, and SetNode().

+ Here is the call graph for this function:

◆ operator=()

Ipv6L3Protocol& ns3::Ipv6L3Protocol::operator= ( const Ipv6L3Protocol )
delete

◆ ReachabilityHint()

bool ns3::Ipv6L3Protocol::ReachabilityHint ( uint32_t  ipInterfaceIndex,
Ipv6Address  address 
)

Provides reachability hint for Neighbor Cache Entries from L4-L7 protocols.

This function shall be called by L4-L7 protocols when an address is confirmed to be reachable (i.e., at least a packet send and a reply received). The net effect is to extend the NCE reachability time if the NCE is in REACHABLE state, and to mark the NCE as REACHABLE if it is in STALE, PROBE, or DELAY states. NCEs in INCOMPLETE state are not changed.

Note that the IP interface index might not be the same as the NetDevice index. The correct way to check the IP interface index is by using Ipv6::GetInterfaceForDevice ().

Parameters
ipInterfaceIndexIP interface index
addressreachable address
Returns
true if the NCE has been successfully updated.

Definition at line 1790 of file ipv6-l3-protocol.cc.

References first::address, ns3::NdiscCache::Entry::ClearWaitingPacket(), ns3::NdiscCache::GetInterface(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::NdiscCache::Entry::IsAutoGenerated(), ns3::NdiscCache::Entry::IsIncomplete(), ns3::NdiscCache::Entry::IsPermanent(), ns3::NdiscCache::Entry::IsProbe(), ns3::NdiscCache::Entry::IsReachable(), ns3::NdiscCache::Lookup(), m_interfaces, ns3::NdiscCache::Entry::MarkReachable(), ns3::Ipv6Interface::Send(), ns3::NdiscCache::Entry::StartReachableTimer(), and ns3::NdiscCache::Entry::UpdateReachableTimer().

+ Here is the call graph for this function:

◆ Receive()

void ns3::Ipv6L3Protocol::Receive ( Ptr< NetDevice device,
Ptr< const Packet p,
uint16_t  protocol,
const Address from,
const Address to,
NetDevice::PacketType  packetType 
)

◆ RegisterExtensions()

void ns3::Ipv6L3Protocol::RegisterExtensions ( )
overridevirtual

Register the IPv6 Extensions.

Does nothing if the Extensions have been already registered.

Implements ns3::Ipv6.

Definition at line 1641 of file ipv6-l3-protocol.cc.

References ns3::Object::AggregateObject(), ns3::Object::GetObject(), m_node, and ns3::Ipv6Extension::SetNode().

+ Here is the call graph for this function:

◆ RegisterOptions()

void ns3::Ipv6L3Protocol::RegisterOptions ( )
overridevirtual

Register the IPv6 Options.

Does nothing if the Options have been already registered.

Implements ns3::Ipv6.

Definition at line 1681 of file ipv6-l3-protocol.cc.

References ns3::Object::AggregateObject(), ns3::Object::GetObject(), and m_node.

+ Here is the call graph for this function:

◆ Remove() [1/2]

void ns3::Ipv6L3Protocol::Remove ( Ptr< IpL4Protocol protocol)
overridevirtual

Remove a L4 protocol.

Parameters
protocolL4 protocol to remove.

Implements ns3::Ipv6.

Definition at line 812 of file ipv6-l3-protocol.cc.

References ns3::IpL4Protocol::GetProtocolNumber(), m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ Remove() [2/2]

void ns3::Ipv6L3Protocol::Remove ( Ptr< IpL4Protocol protocol,
uint32_t  interfaceIndex 
)
overridevirtual

Remove a L4 protocol from a specific interface.

Parameters
protocolL4 protocol to remove.
interfaceIndexinterface index.

Implements ns3::Ipv6.

Definition at line 830 of file ipv6-l3-protocol.cc.

References ns3::IpL4Protocol::GetProtocolNumber(), m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ RemoveAddress() [1/2]

bool ns3::Ipv6L3Protocol::RemoveAddress ( uint32_t  interfaceIndex,
Ipv6Address  address 
)
overridevirtual

Remove a specified Ipv6 address from an interface.

Parameters
interfaceIndexinterface index
addressIpv6Address to be removed from the interface
Returns
true if the operation succeeded

Implements ns3::Ipv6.

Definition at line 494 of file ipv6-l3-protocol.cc.

References first::address, ns3::Ipv6Address::GetLoopback(), m_routingProtocol, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ RemoveAddress() [2/2]

bool ns3::Ipv6L3Protocol::RemoveAddress ( uint32_t  interfaceIndex,
uint32_t  addressIndex 
)
overridevirtual

Remove an address from an interface.

Parameters
interfaceIndexinterface index
addressIndexaddress index on the interface
Returns
true if the operation succeeded

Implements ns3::Ipv6.

Definition at line 476 of file ipv6-l3-protocol.cc.

References first::address, m_routingProtocol, and NS_LOG_FUNCTION.

Referenced by RemoveAutoconfiguredAddress().

+ Here is the caller graph for this function:

◆ RemoveAutoconfiguredAddress()

void ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress ( uint32_t  interface,
Ipv6Address  network,
Ipv6Prefix  mask,
Ipv6Address  defaultRouter 
)

Remove an autoconfigured address.

Typically it is used when an autoconfigured address expires.

Parameters
interfaceinterface index
networknetwork prefix
masknetwork mask
defaultRoutergateway

Definition at line 395 of file ipv6-l3-protocol.cc.

References ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6Interface::GetAddress(), ns3::Ipv6Address::GetAny(), ns3::Ipv6Interface::GetDevice(), GetInterface(), ns3::Ipv6Interface::GetNAddresses(), GetRoutingProtocol(), m_prefixes, ns3::Ipv6Address::MakeAutoconfiguredAddress(), NS_LOG_FUNCTION, and RemoveAddress().

+ Here is the call graph for this function:

◆ RemoveMulticastAddress() [1/2]

void ns3::Ipv6L3Protocol::RemoveMulticastAddress ( Ipv6Address  address)

Removes a multicast address from the list of addresses to pass to local deliver.

Parameters
addressthe address.

Definition at line 1757 of file ipv6-l3-protocol.cc.

References first::address, m_multicastAddressesNoInterface, and NS_LOG_FUNCTION.

◆ RemoveMulticastAddress() [2/2]

void ns3::Ipv6L3Protocol::RemoveMulticastAddress ( Ipv6Address  address,
uint32_t  interface 
)

Removes a multicast address from the list of addresses to pass to local deliver.

Parameters
addressthe address.
interfacethe incoming interface.

Definition at line 1743 of file ipv6-l3-protocol.cc.

References first::address, m_multicastAddresses, and NS_LOG_FUNCTION.

◆ ReportDrop()

void ns3::Ipv6L3Protocol::ReportDrop ( Ipv6Header  ipHeader,
Ptr< Packet p,
DropReason  dropReason 
)
virtual

Report a packet drop.

This function is used by Fragment Timeout handling to signal a fragment drop.

Parameters
ipHeaderthe IPv6 header of dropped packet
pthe packet (if available)
dropReasonthe drop reason

Definition at line 1708 of file ipv6-l3-protocol.cc.

References m_dropTrace.

◆ RouteInputError()

void ns3::Ipv6L3Protocol::RouteInputError ( Ptr< const Packet p,
const Ipv6Header ipHeader,
Socket::SocketErrno  sockErrno 
)
private

Fallback when no route is found.

Parameters
ppacket
ipHeaderIPv6 header
sockErrnoerror number

Definition at line 1599 of file ipv6-l3-protocol.cc.

References ns3::Packet::AddHeader(), ns3::Packet::Copy(), DROP_ROUTE_ERROR, ns3::Ipv6Header::GetDestination(), GetIcmpv6(), ns3::Ipv6Header::GetSource(), ns3::Icmpv6Header::ICMPV6_NO_ROUTE, ns3::Ipv6Address::IsMulticast(), m_dropTrace, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by Ipv6L3Protocol().

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

◆ Send()

void ns3::Ipv6L3Protocol::Send ( Ptr< Packet packet,
Ipv6Address  source,
Ipv6Address  destination,
uint8_t  protocol,
Ptr< Ipv6Route route 
)
overridevirtual

Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers.

All PMTU values are stored at this level, so packet size calculations should be done mathematically at higher levels.

Parameters
packetpacket to send
sourcesource address of packet
destinationaddress of packet
protocolnumber of packet
routeroute to take

Implements ns3::Ipv6.

Definition at line 938 of file ipv6-l3-protocol.cc.

References BuildHeader(), DROP_NO_ROUTE, ns3::SocketIpv6HopLimitTag::GetHopLimit(), GetInterfaceForAddress(), GetInterfaceForDevice(), GetNetDevice(), ns3::Packet::GetSize(), ns3::SocketIpv6TclassTag::GetTclass(), ns3::Ipv6Address::GetZero(), ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsLinkLocalMulticast(), m_defaultTclass, m_defaultTtl, m_dropTrace, m_routingProtocol, m_sendOutgoingTrace, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Packet::RemovePacketTag(), and SendRealOut().

+ Here is the call graph for this function:

◆ SendRealOut()

void ns3::Ipv6L3Protocol::SendRealOut ( Ptr< Ipv6Route route,
Ptr< Packet packet,
const Ipv6Header ipHeader 
)
private

◆ SetDefaultTclass()

void ns3::Ipv6L3Protocol::SetDefaultTclass ( uint8_t  tclass)

Set the default TCLASS.

Parameters
tclassTCLASS to set

Definition at line 931 of file ipv6-l3-protocol.cc.

References m_defaultTclass, and NS_LOG_FUNCTION.

◆ SetDefaultTtl()

void ns3::Ipv6L3Protocol::SetDefaultTtl ( uint8_t  ttl)

Set the default TTL.

Parameters
ttlTTL to set

Definition at line 924 of file ipv6-l3-protocol.cc.

References m_defaultTtl, and NS_LOG_FUNCTION.

◆ SetDown()

void ns3::Ipv6L3Protocol::SetDown ( uint32_t  i)
overridevirtual

set an interface down.

Parameters
iinterface index

Implements ns3::Ipv6.

Definition at line 591 of file ipv6-l3-protocol.cc.

References m_routingProtocol, NS_LOG_FUNCTION, and ns3::Ipv6Interface::SetDown().

+ Here is the call graph for this function:

◆ SetForwarding()

void ns3::Ipv6L3Protocol::SetForwarding ( uint32_t  i,
bool  val 
)
overridevirtual

Enable or disable forwarding on interface.

Parameters
iinterface index
valtrue = enable forwarding, false = disable

Implements ns3::Ipv6.

Definition at line 656 of file ipv6-l3-protocol.cc.

References NS_LOG_FUNCTION, and ns3::Ipv6Interface::SetForwarding().

+ Here is the call graph for this function:

◆ SetIpForward()

void ns3::Ipv6L3Protocol::SetIpForward ( bool  forward)
overrideprivatevirtual

Set IPv6 forwarding state.

Parameters
forwardIPv6 forwarding enabled or not

Implements ns3::Ipv6.

Definition at line 711 of file ipv6-l3-protocol.cc.

References m_interfaces, m_ipForward, and NS_LOG_FUNCTION.

◆ SetMetric()

void ns3::Ipv6L3Protocol::SetMetric ( uint32_t  i,
uint16_t  metric 
)
overridevirtual

Set metric for an interface.

Parameters
iindex
metric

Implements ns3::Ipv6.

Definition at line 517 of file ipv6-l3-protocol.cc.

References NS_LOG_FUNCTION, and ns3::Ipv6Interface::SetMetric().

+ Here is the call graph for this function:

◆ SetMtuDiscover()

void ns3::Ipv6L3Protocol::SetMtuDiscover ( bool  mtuDiscover)
overrideprivatevirtual

Set IPv6 MTU discover state.

Parameters
mtuDiscoverIPv6 MTU discover enabled or not

Implements ns3::Ipv6.

Definition at line 730 of file ipv6-l3-protocol.cc.

References m_mtuDiscover, and NS_LOG_FUNCTION.

◆ SetNode()

void ns3::Ipv6L3Protocol::SetNode ( Ptr< Node node)

Set node associated with this stack.

Parameters
nodenode to set

Definition at line 777 of file ipv6-l3-protocol.cc.

References m_node, NS_LOG_FUNCTION, and SetupLoopback().

Referenced by NotifyNewAggregate().

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

◆ SetPmtu()

void ns3::Ipv6L3Protocol::SetPmtu ( Ipv6Address  dst,
uint32_t  pmtu 
)
overridevirtual

Set the Path MTU for the specified IPv6 destination address.

Parameters
dstIpv6 destination address
pmtuthe Path MTU

Implements ns3::Ipv6.

Definition at line 548 of file ipv6-l3-protocol.cc.

References m_pmtuCache, and NS_LOG_FUNCTION.

◆ SetRoutingProtocol()

void ns3::Ipv6L3Protocol::SetRoutingProtocol ( Ptr< Ipv6RoutingProtocol routingProtocol)
overridevirtual

Set routing protocol for this stack.

Parameters
routingProtocolIPv6 routing protocol to set

Implements ns3::Ipv6.

Definition at line 184 of file ipv6-l3-protocol.cc.

References m_routingProtocol, and NS_LOG_FUNCTION.

◆ SetSendIcmpv6Redirect()

void ns3::Ipv6L3Protocol::SetSendIcmpv6Redirect ( bool  sendIcmpv6Redirect)
privatevirtual

Set the ICMPv6 Redirect sending state.

Parameters
sendIcmpv6RedirectICMPv6 Redirect sending enabled or not

Definition at line 744 of file ipv6-l3-protocol.cc.

References m_sendIcmpv6Redirect, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetStrongEndSystemModel()

void ns3::Ipv6L3Protocol::SetStrongEndSystemModel ( bool  model)
overrideprivatevirtual

Set or unset the Strong End System Model.

RFC1122 term for whether host rejects datagram with a dest. address on another interface

Parameters
modeltrue for Strong End System Model

Implements ns3::Ipv6.

Definition at line 1839 of file ipv6-l3-protocol.cc.

References m_strongEndSystemModel, and NS_LOG_FUNCTION.

◆ SetUp()

void ns3::Ipv6L3Protocol::SetUp ( uint32_t  i)
overridevirtual

Set an interface up.

Parameters
iinterface index

Implements ns3::Ipv6.

Definition at line 563 of file ipv6-l3-protocol.cc.

References m_routingProtocol, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Ipv6Interface::SetUp().

+ Here is the call graph for this function:

◆ SetupLoopback()

void ns3::Ipv6L3Protocol::SetupLoopback ( )
private

Setup loopback interface.

Definition at line 605 of file ipv6-l3-protocol.cc.

References ns3::Node::AddDevice(), AddIpv6Interface(), ns3::CreateObject(), ns3::Node::GetDevice(), ns3::Ipv6Address::GetLoopback(), ns3::Node::GetNDevices(), m_node, m_routingProtocol, ns3::MakeCallback(), NS_LOG_FUNCTION, PROT_NUMBER, Receive(), and ns3::Node::RegisterProtocolHandler().

Referenced by SetNode().

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

◆ SourceAddressSelection()

Ipv6Address ns3::Ipv6L3Protocol::SourceAddressSelection ( uint32_t  interface,
Ipv6Address  dest 
)
overridevirtual

Choose the source address to use with destination address.

Parameters
interfaceinterface index
destIPv6 destination address
Returns
IPv6 source address to use

Implements ns3::Ipv6.

Definition at line 664 of file ipv6-l3-protocol.cc.

References ns3::Ipv6Address::GetLoopback(), GetNAddresses(), ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsLinkLocalMulticast(), ns3::Ipv6Address::IsLocalhost(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ ::Ipv6L3ProtocolTestCase

friend class ::Ipv6L3ProtocolTestCase
friend

Ipv6L3ProtocolTestCase test case.

Definition at line 509 of file ipv6-l3-protocol.h.

◆ Ipv6ExtensionLooseRouting

friend class Ipv6ExtensionLooseRouting
friend

Ipv6ExtensionLooseRouting.

Definition at line 514 of file ipv6-l3-protocol.h.

Member Data Documentation

◆ m_defaultTclass

uint8_t ns3::Ipv6L3Protocol::m_defaultTclass
private

Default TCLASS for outgoing packets.

Definition at line 761 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), Send(), and SetDefaultTclass().

◆ m_defaultTtl

uint8_t ns3::Ipv6L3Protocol::m_defaultTtl
private

Default TTL for outgoing packets.

Definition at line 756 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), Send(), and SetDefaultTtl().

◆ m_dropTrace

TracedCallback<const Ipv6Header&, Ptr<const Packet>, DropReason, Ptr<Ipv6>, uint32_t> ns3::Ipv6L3Protocol::m_dropTrace
private

Callback to trace drop packets.

Deprecated:
The non-const Ptr<Ipv6> argument is deprecated and will be changed to Ptr<const Ipv6> in a future release.

Definition at line 586 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), IpForward(), IpMulticastForward(), LocalDeliver(), Receive(), ReportDrop(), RouteInputError(), Send(), and SendRealOut().

◆ m_ecb

Ipv6RoutingProtocol::ErrorCallback ns3::Ipv6L3Protocol::m_ecb
private

Error callback.

Definition at line 841 of file ipv6-l3-protocol.h.

Referenced by Ipv6L3Protocol(), and Receive().

◆ m_interfaces

Ipv6InterfaceList ns3::Ipv6L3Protocol::m_interfaces
private

◆ m_ipForward

bool ns3::Ipv6L3Protocol::m_ipForward
private

Forwarding packets (i.e.

router mode) state.

Definition at line 721 of file ipv6-l3-protocol.h.

Referenced by AddInterface(), GetIpForward(), and SetIpForward().

◆ m_lcb

Ipv6RoutingProtocol::LocalDeliverCallback ns3::Ipv6L3Protocol::m_lcb
private

Local delivery callback.

Definition at line 840 of file ipv6-l3-protocol.h.

Referenced by Ipv6L3Protocol(), and Receive().

◆ m_localDeliverTrace

TracedCallback<const Ipv6Header&, Ptr<const Packet>, uint32_t> ns3::Ipv6L3Protocol::m_localDeliverTrace
private

Trace of locally delivered packets.

Definition at line 593 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), and LocalDeliver().

◆ m_mcb

Ipv6RoutingProtocol::MulticastForwardCallback ns3::Ipv6L3Protocol::m_mcb
private

Multicast forward callback.

Definition at line 839 of file ipv6-l3-protocol.h.

Referenced by Ipv6L3Protocol(), and Receive().

◆ m_mtuDiscover

bool ns3::Ipv6L3Protocol::m_mtuDiscover
private

MTU Discover (i.e.

Path MTU) state.

Definition at line 726 of file ipv6-l3-protocol.h.

Referenced by GetMtu(), GetMtuDiscover(), and SetMtuDiscover().

◆ m_multicastAddresses

Ipv6RegisteredMulticastAddress_t ns3::Ipv6L3Protocol::m_multicastAddresses
private

List of multicast IP addresses of interest, divided per interface.

Definition at line 831 of file ipv6-l3-protocol.h.

Referenced by AddMulticastAddress(), IsRegisteredMulticastAddress(), and RemoveMulticastAddress().

◆ m_multicastAddressesNoInterface

Ipv6RegisteredMulticastAddressNoInterface_t ns3::Ipv6L3Protocol::m_multicastAddressesNoInterface
private

List of multicast IP addresses of interest for all the interfaces.

Definition at line 836 of file ipv6-l3-protocol.h.

Referenced by AddMulticastAddress(), IsRegisteredMulticastAddress(), and RemoveMulticastAddress().

◆ m_nInterfaces

uint32_t ns3::Ipv6L3Protocol::m_nInterfaces
private

Number of IPv6 interfaces managed by the stack.

Definition at line 751 of file ipv6-l3-protocol.h.

Referenced by AddIpv6Interface(), and GetNInterfaces().

◆ m_node

◆ m_pmtuCache

Ptr<Ipv6PmtuCache> ns3::Ipv6L3Protocol::m_pmtuCache
private

Path MTU Cache.

Definition at line 731 of file ipv6-l3-protocol.h.

Referenced by Ipv6L3Protocol(), DoDispose(), SendRealOut(), and SetPmtu().

◆ m_prefixes

Ipv6AutoconfiguredPrefixList ns3::Ipv6L3Protocol::m_prefixes
private

List of IPv6 prefix received from RA.

Definition at line 781 of file ipv6-l3-protocol.h.

Referenced by AddAutoconfiguredAddress(), DoDispose(), and RemoveAutoconfiguredAddress().

◆ m_protocols

L4List_t ns3::Ipv6L3Protocol::m_protocols
private

List of transport protocol.

Definition at line 736 of file ipv6-l3-protocol.h.

Referenced by DoDispose(), GetProtocol(), Insert(), and Remove().

◆ m_reverseInterfacesContainer

Ipv6InterfaceReverseContainer ns3::Ipv6L3Protocol::m_reverseInterfacesContainer
private

Container of NetDevice / Interface index associations.

Definition at line 746 of file ipv6-l3-protocol.h.

Referenced by AddIpv6Interface(), DoDispose(), and GetInterfaceForDevice().

◆ m_routingProtocol

Ptr<Ipv6RoutingProtocol> ns3::Ipv6L3Protocol::m_routingProtocol
private

◆ m_rxTrace

TracedCallback<Ptr<const Packet>, Ptr<Ipv6>, uint32_t> ns3::Ipv6L3Protocol::m_rxTrace
private

Callback to trace RX (reception) packets.

Deprecated:
The non-const Ptr<Ipv6> argument is deprecated and will be changed to Ptr<const Ipv6> in a future release.

Definition at line 578 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), and Receive().

◆ m_sendIcmpv6Redirect

bool ns3::Ipv6L3Protocol::m_sendIcmpv6Redirect
private

Allow ICMPv6 Redirect sending state.

Definition at line 786 of file ipv6-l3-protocol.h.

Referenced by GetSendIcmpv6Redirect(), IpForward(), and SetSendIcmpv6Redirect().

◆ m_sendOutgoingTrace

TracedCallback<const Ipv6Header&, Ptr<const Packet>, uint32_t> ns3::Ipv6L3Protocol::m_sendOutgoingTrace
private

Trace of sent packets.

Definition at line 589 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), and Send().

◆ m_sockets

SocketList ns3::Ipv6L3Protocol::m_sockets
private

List of IPv6 raw sockets.

Definition at line 776 of file ipv6-l3-protocol.h.

Referenced by CreateRawSocket(), DeleteRawSocket(), DoDispose(), and Receive().

◆ m_strongEndSystemModel

bool ns3::Ipv6L3Protocol::m_strongEndSystemModel
private

Rejects packets directed to an interface with wrong address (RFC 1222).

Definition at line 766 of file ipv6-l3-protocol.h.

Referenced by GetStrongEndSystemModel(), and SetStrongEndSystemModel().

◆ m_txTrace

TracedCallback<Ptr<const Packet>, Ptr<Ipv6>, uint32_t> ns3::Ipv6L3Protocol::m_txTrace
private

Callback to trace TX (transmission) packets.

Deprecated:
The non-const Ptr<Ipv6> argument is deprecated and will be changed to Ptr<const Ipv6> in a future release.

Definition at line 571 of file ipv6-l3-protocol.h.

Referenced by CallTxTrace(), and GetTypeId().

◆ m_ucb

Ipv6RoutingProtocol::UnicastForwardCallback ns3::Ipv6L3Protocol::m_ucb
private

Unicast forward callback.

Definition at line 838 of file ipv6-l3-protocol.h.

Referenced by Ipv6L3Protocol(), and Receive().

◆ m_unicastForwardTrace

TracedCallback<const Ipv6Header&, Ptr<const Packet>, uint32_t> ns3::Ipv6L3Protocol::m_unicastForwardTrace
private

Trace of unicast forwarded packets.

Definition at line 591 of file ipv6-l3-protocol.h.

Referenced by GetTypeId(), and IpForward().

◆ PROT_NUMBER


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