IPv6 layer implementation. More...
#include "ipv6-l3-protocol.h"
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. | |
typedef void(* | SentTracedCallback) (const Ipv6Header &header, Ptr< const Packet > packet, uint32_t interface) |
TracedCallback signature for packet sent, forwarded or local-delivered events. | |
typedef void(* | TxRxTracedCallback) (Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface) |
TracedCallback signature for packet transmission or reception events. | |
Public Member Functions | |
Ipv6L3Protocol () | |
Constructor. | |
Ipv6L3Protocol (const Ipv6L3Protocol &)=delete | |
~Ipv6L3Protocol () override | |
Destructor. | |
bool | AddAddress (uint32_t i, Ipv6InterfaceAddress address, bool addOnLinkRoute=true) override |
Add an address on interface. | |
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. | |
uint32_t | AddInterface (Ptr< NetDevice > device) override |
Add IPv6 interface for a device. | |
void | AddMulticastAddress (Ipv6Address address) |
Adds a multicast address to the list of addresses to pass to local deliver. | |
void | AddMulticastAddress (Ipv6Address address, uint32_t interface) |
Adds a multicast address to the list of addresses to pass to local deliver. | |
Ptr< Socket > | CreateRawSocket () |
Create raw IPv6 socket. | |
void | DeleteRawSocket (Ptr< Socket > socket) |
Remove raw IPv6 socket. | |
Ipv6InterfaceAddress | GetAddress (uint32_t interfaceIndex, uint32_t addressIndex) const override |
Get an address. | |
Ptr< Icmpv6L4Protocol > | GetIcmpv6 () const |
Get ICMPv6 protocol. | |
Ptr< Ipv6Interface > | GetInterface (uint32_t i) const |
Get an interface. | |
int32_t | GetInterfaceForAddress (Ipv6Address addr) const override |
Get interface index which has specified IPv6 address. | |
int32_t | GetInterfaceForDevice (Ptr< const NetDevice > device) const override |
Get interface index which is on a specified net device. | |
int32_t | GetInterfaceForPrefix (Ipv6Address addr, Ipv6Prefix mask) const override |
Get interface index which match specified address/prefix. | |
uint16_t | GetMetric (uint32_t i) const override |
Get metric for an interface. | |
uint16_t | GetMtu (uint32_t i) const override |
Get MTU for an interface. | |
uint32_t | GetNAddresses (uint32_t interface) const override |
Get number of address for an interface. | |
Ptr< NetDevice > | GetNetDevice (uint32_t i) override |
Get device by index. | |
uint32_t | GetNInterfaces () const override |
Get current number of interface on this stack. | |
Ptr< IpL4Protocol > | GetProtocol (int protocolNumber) const override |
Get L4 protocol by protocol number. | |
Ptr< IpL4Protocol > | GetProtocol (int protocolNumber, int32_t interfaceIndex) const override |
Get L4 protocol by protocol number for the specified interface. | |
Ptr< Ipv6RoutingProtocol > | GetRoutingProtocol () const override |
Get current routing protocol used. | |
void | Insert (Ptr< IpL4Protocol > protocol) override |
Add a L4 protocol. | |
void | Insert (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex) override |
Add a L4 protocol to a specific interface. | |
bool | IsForwarding (uint32_t i) const override |
Is interface allows forwarding ? | |
bool | IsRegisteredMulticastAddress (Ipv6Address address) const |
Checks if the address has been registered. | |
bool | IsRegisteredMulticastAddress (Ipv6Address address, uint32_t interface) const |
Checks if the address has been registered for a specific interface. | |
bool | IsUp (uint32_t i) const override |
Is specified interface up ? | |
Ipv6L3Protocol & | operator= (const Ipv6L3Protocol &)=delete |
bool | ReachabilityHint (uint32_t ipInterfaceIndex, Ipv6Address address) |
Provides reachability hint for Neighbor Cache Entries from L4-L7 protocols. | |
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. | |
void | RegisterExtensions () override |
Register the IPv6 Extensions. | |
void | RegisterOptions () override |
Register the IPv6 Options. | |
void | Remove (Ptr< IpL4Protocol > protocol) override |
Remove a L4 protocol. | |
void | Remove (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex) override |
Remove a L4 protocol from a specific interface. | |
bool | RemoveAddress (uint32_t interfaceIndex, Ipv6Address address) override |
Remove a specified Ipv6 address from an interface. | |
bool | RemoveAddress (uint32_t interfaceIndex, uint32_t addressIndex) override |
Remove an address from an interface. | |
void | RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Address network, Ipv6Prefix mask, Ipv6Address defaultRouter) |
Remove an autoconfigured address. | |
void | RemoveMulticastAddress (Ipv6Address address) |
Removes a multicast address from the list of addresses to pass to local deliver. | |
void | RemoveMulticastAddress (Ipv6Address address, uint32_t interface) |
Removes a multicast address from the list of addresses to pass to local deliver. | |
virtual void | ReportDrop (Ipv6Header ipHeader, Ptr< Packet > p, DropReason dropReason) |
Report a packet drop. | |
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. | |
void | SetDefaultTclass (uint8_t tclass) |
Set the default TCLASS. | |
void | SetDefaultTtl (uint8_t ttl) |
Set the default TTL. | |
void | SetDown (uint32_t i) override |
set an interface down. | |
void | SetForwarding (uint32_t i, bool val) override |
Enable or disable forwarding on interface. | |
void | SetMetric (uint32_t i, uint16_t metric) override |
Set metric for an interface. | |
void | SetNode (Ptr< Node > node) |
Set node associated with this stack. | |
void | SetPmtu (Ipv6Address dst, uint32_t pmtu) override |
Set the Path MTU for the specified IPv6 destination address. | |
void | SetRoutingProtocol (Ptr< Ipv6RoutingProtocol > routingProtocol) override |
Set routing protocol for this stack. | |
void | SetUp (uint32_t i) override |
Set an interface up. | |
Ipv6Address | SourceAddressSelection (uint32_t interface, Ipv6Address dest) override |
Choose the source address to use with destination address. | |
Public Member Functions inherited from ns3::Ipv6 | |
Ipv6 () | |
Constructor. | |
~Ipv6 () override | |
Destructor. | |
virtual bool | AddAddress (uint32_t interface, Ipv6InterfaceAddress address, bool addOnLinkRoute=true)=0 |
Add an address on the specified IPv6 interface. | |
virtual uint32_t | AddInterface (Ptr< NetDevice > device)=0 |
Add a NetDevice interface. | |
virtual Ipv6InterfaceAddress | GetAddress (uint32_t interface, uint32_t addressIndex) const =0 |
Get IPv6 address on specified IPv6 interface. | |
virtual int32_t | GetInterfaceForAddress (Ipv6Address address) const =0 |
Return the interface number of the interface that has been assigned the specified IP address. | |
virtual int32_t | GetInterfaceForDevice (Ptr< const NetDevice > device) const =0 |
Get the interface index of the specified NetDevice. | |
virtual int32_t | GetInterfaceForPrefix (Ipv6Address address, Ipv6Prefix mask) const =0 |
Return the interface number of first interface found that has an IPv6 address within the prefix specified by the input address and mask parameters. | |
virtual uint16_t | GetMetric (uint32_t interface) const =0 |
Get metric for the specified IPv6 interface. | |
virtual uint16_t | GetMtu (uint32_t interface) const =0 |
Get MTU for the specified IPv6 interface. | |
virtual uint32_t | GetNAddresses (uint32_t interface) const =0 |
Get number of addresses on specified IPv6 interface. | |
virtual Ptr< NetDevice > | GetNetDevice (uint32_t interface)=0 |
Get the NetDevice of the specified interface number. | |
virtual uint32_t | GetNInterfaces () const =0 |
Get number of interfaces. | |
virtual Ptr< IpL4Protocol > | GetProtocol (int protocolNumber) const =0 |
Get L4 protocol by protocol number. | |
virtual Ptr< IpL4Protocol > | GetProtocol (int protocolNumber, int32_t interfaceIndex) const =0 |
Get L4 protocol by protocol number for the specified interface. | |
virtual Ptr< Ipv6RoutingProtocol > | GetRoutingProtocol () const =0 |
Get the routing protocol to be used by this IPv6 stack. | |
virtual void | Insert (Ptr< IpL4Protocol > protocol)=0 |
Add a L4 protocol. | |
virtual void | Insert (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex)=0 |
Add a L4 protocol to a specific interface. | |
virtual bool | IsForwarding (uint32_t interface) const =0 |
If the specified IPv6 interface has forwarding enabled. | |
virtual bool | IsUp (uint32_t interface) const =0 |
If the specified interface index is in "up" state. | |
virtual void | RegisterExtensions ()=0 |
Register the IPv6 Extensions. | |
virtual void | RegisterOptions ()=0 |
Register the IPv6 Options. | |
virtual void | Remove (Ptr< IpL4Protocol > protocol)=0 |
Remove a L4 protocol. | |
virtual void | Remove (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex)=0 |
Remove a L4 protocol from a specific interface. | |
virtual bool | RemoveAddress (uint32_t interface, Ipv6Address address)=0 |
Remove the given address on named Ipv6 interface. | |
virtual bool | RemoveAddress (uint32_t interface, uint32_t addressIndex)=0 |
Remove an address on specified IPv6 interface. | |
virtual void | Send (Ptr< Packet > packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr< Ipv6Route > route)=0 |
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers. | |
virtual void | SetDown (uint32_t interface)=0 |
Set the interface into the "down" state. | |
virtual void | SetForwarding (uint32_t interface, bool val)=0 |
Set forwarding on specified IPv6 interface. | |
virtual void | SetMetric (uint32_t interface, uint16_t metric)=0 |
Set metric on specified Ipv6 interface. | |
virtual void | SetPmtu (Ipv6Address dst, uint32_t pmtu)=0 |
Set the Path MTU for the specified IPv6 destination address. | |
virtual void | SetRoutingProtocol (Ptr< Ipv6RoutingProtocol > routingProtocol)=0 |
Register a new routing protocol to be used by this IPv6 stack. | |
virtual void | SetUp (uint32_t interface)=0 |
Set the interface into the "up" state. | |
virtual Ipv6Address | SourceAddressSelection (uint32_t interface, Ipv6Address dest)=0 |
Choose the source address to use with destination address. | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID of this class. | |
Static Public Member Functions inherited from ns3::Ipv6 | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Attributes | |
static const uint16_t | PROT_NUMBER = 0x86DD |
The protocol number for IPv6 (0x86DD). | |
Static Public Attributes inherited from ns3::Ipv6 | |
static const uint32_t | IF_ANY = 0xffffffff |
Any interface magic number. | |
Protected Member Functions | |
void | DoDispose () override |
Dispose object. | |
void | NotifyNewAggregate () override |
Notify other components connected to the node that a new stack member is now connected. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoDispose () |
Destructor implementation. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Private Types | |
typedef std::list< Ptr< Ipv6AutoconfiguredPrefix > > | Ipv6AutoconfiguredPrefixList |
Container of the IPv6 Autoconfigured addresses. | |
typedef std::list< Ptr< Ipv6AutoconfiguredPrefix > >::iterator | Ipv6AutoconfiguredPrefixListI |
Iterator of the container of the IPv6 Autoconfigured addresses. | |
typedef std::vector< Ptr< Ipv6Interface > > | Ipv6InterfaceList |
Container of the IPv6 Interfaces. | |
typedef std::map< Ptr< const NetDevice >, uint32_t > | Ipv6InterfaceReverseContainer |
Container of NetDevices registered to IPv6 and their interface indexes. | |
typedef std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t > | Ipv6RegisteredMulticastAddress_t |
Container of the IPv6 multicast addresses. | |
typedef std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::const_iterator | Ipv6RegisteredMulticastAddressCIter_t |
Container Const Iterator of the IPv6 multicast addresses. | |
typedef std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::iterator | Ipv6RegisteredMulticastAddressIter_t |
Container Iterator of the IPv6 multicast addresses. | |
typedef std::pair< Ipv6Address, uint64_t > | Ipv6RegisteredMulticastAddressKey_t |
IPv6 multicast addresses / interface key. | |
typedef std::map< Ipv6Address, uint32_t > | Ipv6RegisteredMulticastAddressNoInterface_t |
Container of the IPv6 multicast addresses. | |
typedef std::map< Ipv6Address, uint32_t >::const_iterator | Ipv6RegisteredMulticastAddressNoInterfaceCIter_t |
Container Const Iterator of the IPv6 multicast addresses. | |
typedef std::map< Ipv6Address, uint32_t >::iterator | Ipv6RegisteredMulticastAddressNoInterfaceIter_t |
Container Iterator of the IPv6 multicast addresses. | |
typedef std::map< L4ListKey_t, Ptr< IpL4Protocol > > | L4List_t |
Container of the IPv6 L4 instances. | |
typedef std::pair< int, int32_t > | L4ListKey_t |
Container of the IPv6 L4 keys: protocol number, interface index. | |
typedef std::list< Ptr< Ipv6RawSocketImpl > > | SocketList |
Container of the IPv6 Raw Sockets. | |
Private Member Functions | |
uint32_t | AddIpv6Interface (Ptr< Ipv6Interface > interface) |
Add an IPv6 interface to the stack. | |
Ipv6Header | BuildHeader (Ipv6Address src, Ipv6Address dst, uint8_t protocol, uint16_t payloadSize, uint8_t hopLimit, uint8_t tclass) |
Construct an IPv6 header. | |
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. | |
bool | GetIpForward () const override |
Get IPv6 forwarding state. | |
bool | GetMtuDiscover () const override |
Get IPv6 MTU discover state. | |
virtual bool | GetSendIcmpv6Redirect () const |
Get the ICMPv6 Redirect sending state. | |
void | IpForward (Ptr< const NetDevice > idev, Ptr< Ipv6Route > rtentry, Ptr< const Packet > p, const Ipv6Header &header) |
Forward a packet. | |
void | IpMulticastForward (Ptr< const NetDevice > idev, Ptr< Ipv6MulticastRoute > mrtentry, Ptr< const Packet > p, const Ipv6Header &header) |
Forward a multicast packet. | |
void | LocalDeliver (Ptr< const Packet > p, const Ipv6Header &ip, uint32_t iif) |
Deliver a packet. | |
void | RouteInputError (Ptr< const Packet > p, const Ipv6Header &ipHeader, Socket::SocketErrno sockErrno) |
Fallback when no route is found. | |
void | SendRealOut (Ptr< Ipv6Route > route, Ptr< Packet > packet, const Ipv6Header &ipHeader) |
Send packet with route. | |
void | SetIpForward (bool forward) override |
Set IPv6 forwarding state. | |
void | SetMtuDiscover (bool mtuDiscover) override |
Set IPv6 MTU discover state. | |
virtual void | SetSendIcmpv6Redirect (bool sendIcmpv6Redirect) |
Set the ICMPv6 Redirect sending state. | |
void | SetupLoopback () |
Setup loopback interface. | |
Private Attributes | |
uint8_t | m_defaultTclass |
Default TCLASS for outgoing packets. | |
uint8_t | m_defaultTtl |
Default TTL for outgoing packets. | |
TracedCallback< const Ipv6Header &, Ptr< const Packet >, DropReason, Ptr< Ipv6 >, uint32_t > | m_dropTrace |
Callback to trace drop packets. | |
Ipv6RoutingProtocol::ErrorCallback | m_ecb |
Error callback. | |
Ipv6InterfaceList | m_interfaces |
List of IPv6 interfaces. | |
bool | m_ipForward |
Forwarding packets (i.e. | |
Ipv6RoutingProtocol::LocalDeliverCallback | m_lcb |
Local delivery callback. | |
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > | m_localDeliverTrace |
Trace of locally delivered packets. | |
Ipv6RoutingProtocol::MulticastForwardCallback | m_mcb |
Multicast forward callback. | |
bool | m_mtuDiscover |
MTU Discover (i.e. | |
Ipv6RegisteredMulticastAddress_t | m_multicastAddresses |
List of multicast IP addresses of interest, divided per interface. | |
Ipv6RegisteredMulticastAddressNoInterface_t | m_multicastAddressesNoInterface |
List of multicast IP addresses of interest for all the interfaces. | |
uint32_t | m_nInterfaces |
Number of IPv6 interfaces managed by the stack. | |
Ptr< Node > | m_node |
Node attached to stack. | |
Ptr< Ipv6PmtuCache > | m_pmtuCache |
Path MTU Cache. | |
Ipv6AutoconfiguredPrefixList | m_prefixes |
List of IPv6 prefix received from RA. | |
L4List_t | m_protocols |
List of transport protocol. | |
Ipv6InterfaceReverseContainer | m_reverseInterfacesContainer |
Container of NetDevice / Interface index associations. | |
Ptr< Ipv6RoutingProtocol > | m_routingProtocol |
Routing protocol. | |
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > | m_rxTrace |
Callback to trace RX (reception) packets. | |
bool | m_sendIcmpv6Redirect |
Allow ICMPv6 Redirect sending state. | |
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > | m_sendOutgoingTrace |
Trace of sent packets. | |
SocketList | m_sockets |
List of IPv6 raw sockets. | |
bool | m_strongEndSystemModel |
Rejects packets directed to an interface with wrong address (RFC 1222). | |
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > | m_txTrace |
Callback to trace TX (transmission) packets. | |
Ipv6RoutingProtocol::UnicastForwardCallback | m_ucb |
Unicast forward callback. | |
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > | m_unicastForwardTrace |
Trace of unicast forwarded packets. | |
Friends | |
class | ::Ipv6L3ProtocolTestCase |
Ipv6L3ProtocolTestCase test case. | |
Related Functions | |
(Note that these are not member functions.) | |
class | Ipv6ExtensionLooseRouting |
Ipv6ExtensionLooseRouting. | |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
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.
ns3::Ipv6L3Protocol is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 456 bytes (on a 64-bit architecture).
Definition at line 62 of file ipv6-l3-protocol.h.
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.
[in] | header | the Ipv6Header. |
[in] | packet | the packet. |
[in] | reason | the reason the packet was dropped. |
[in] | ipv6 | the Ipv6 protocol |
[in] | interface | the IP-level interface index |
Ptr<Ipv6>
argument is deprecated and will be changed to Ptr<const Ipv6>
in a future release. Definition at line 422 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 Autoconfigured addresses.
Definition at line 543 of file ipv6-l3-protocol.h.
|
private |
Iterator of the container of the IPv6 Autoconfigured addresses.
Definition at line 548 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 Interfaces.
Definition at line 518 of file ipv6-l3-protocol.h.
|
private |
Container of NetDevices registered to IPv6 and their interface indexes.
Definition at line 523 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 multicast addresses.
Definition at line 793 of file ipv6-l3-protocol.h.
|
private |
Container Const Iterator of the IPv6 multicast addresses.
Definition at line 805 of file ipv6-l3-protocol.h.
|
private |
Container Iterator of the IPv6 multicast addresses.
Definition at line 799 of file ipv6-l3-protocol.h.
|
private |
IPv6 multicast addresses / interface key.
Definition at line 787 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 multicast addresses.
Definition at line 810 of file ipv6-l3-protocol.h.
|
private |
Container Const Iterator of the IPv6 multicast addresses.
Definition at line 822 of file ipv6-l3-protocol.h.
|
private |
Container Iterator of the IPv6 multicast addresses.
Definition at line 816 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 L4 instances.
Definition at line 538 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 L4 keys: protocol number, interface index.
Definition at line 533 of file ipv6-l3-protocol.h.
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.
[in] | header | the Ipv6Header. |
[in] | packet | the packet. |
[in] | interface | the IP-level interface index |
Definition at line 394 of file ipv6-l3-protocol.h.
|
private |
Container of the IPv6 Raw Sockets.
Definition at line 528 of file ipv6-l3-protocol.h.
typedef void(* ns3::Ipv6L3Protocol::TxRxTracedCallback) (Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface) |
TracedCallback signature for packet transmission or reception events.
[in] | packet | the packet. |
[in] | ipv6 | the Ipv6 protocol |
[in] | interface | the IP-level interface index |
Ptr<Ipv6>
argument is deprecated and will be changed to Ptr<const Ipv6>
in a future release. Definition at line 407 of file ipv6-l3-protocol.h.
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 80 of file ipv6-l3-protocol.h.
ns3::Ipv6L3Protocol::Ipv6L3Protocol | ( | ) |
Constructor.
Definition at line 128 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().
|
override |
|
delete |
|
overridevirtual |
Add an address on interface.
i | interface index |
address | address to add |
addOnLinkRoute | add on-link route to the network (default true) |
Implements ns3::Ipv6.
Definition at line 443 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
Referenced by 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.
interface | interface index |
network | network prefix |
mask | network mask |
flags | flags of the prefix information option (home agent, ...) |
validTime | valid time of the prefix |
preferredTime | preferred time of the prefix |
defaultRouter | default router address |
Definition at line 329 of file ipv6-l3-protocol.cc.
References AddAddress(), 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, and ns3::Icmpv6OptionPrefixInformation::ONLINK.
Add IPv6 interface for a device.
device | net device |
Implements ns3::Ipv6.
Definition at line 205 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().
|
private |
Add an IPv6 interface to the stack.
interface | interface to add |
Definition at line 230 of file ipv6-l3-protocol.cc.
References m_interfaces, m_nInterfaces, m_reverseInterfacesContainer, and NS_LOG_FUNCTION.
Referenced by AddInterface(), and SetupLoopback().
void ns3::Ipv6L3Protocol::AddMulticastAddress | ( | Ipv6Address | address | ) |
Adds a multicast address to the list of addresses to pass to local deliver.
address | the address. |
Definition at line 1746 of file ipv6-l3-protocol.cc.
References m_multicastAddressesNoInterface, NS_LOG_FUNCTION, and NS_LOG_WARN.
void ns3::Ipv6L3Protocol::AddMulticastAddress | ( | Ipv6Address | address, |
uint32_t | interface | ||
) |
Adds a multicast address to the list of addresses to pass to local deliver.
address | the address. |
interface | the incoming interface. |
Definition at line 1731 of file ipv6-l3-protocol.cc.
References m_multicastAddresses, NS_LOG_FUNCTION, and NS_LOG_WARN.
|
private |
Construct an IPv6 header.
src | source IPv6 address |
dst | destination IPv6 address |
protocol | L4 protocol |
payloadSize | payload size |
hopLimit | Hop limit |
tclass | Tclass |
Definition at line 1637 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().
|
private |
Make a copy of the packet, add the header and invoke the TX trace callback.
ipHeader | the IP header that will be added to the packet |
packet | the packet |
ipv6 | the Ipv6 protocol |
interface | the 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 1208 of file ipv6-l3-protocol.cc.
References m_txTrace.
Create raw IPv6 socket.
Definition at line 894 of file ipv6-l3-protocol.cc.
References m_node, m_sockets, and NS_LOG_FUNCTION.
Remove raw IPv6 socket.
socket | socket to remove |
Definition at line 904 of file ipv6-l3-protocol.cc.
References m_sockets, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Dispose object.
Reimplemented from ns3::Object.
Definition at line 148 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.
|
overridevirtual |
Get an address.
interfaceIndex | interface index |
addressIndex | address index on the interface |
Implements ns3::Ipv6.
Definition at line 476 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
Referenced by UanExperiment::SendPackets(), and SourceAddressSelection().
Ptr< Icmpv6L4Protocol > ns3::Ipv6L3Protocol::GetIcmpv6 | ( | ) | const |
Get ICMPv6 protocol.
Definition at line 919 of file ipv6-l3-protocol.cc.
References GetProtocol(), ns3::Icmpv6L4Protocol::GetStaticProtocolNumber(), and NS_LOG_FUNCTION.
Referenced by IpForward(), LocalDeliver(), and RouteInputError().
Ptr< Ipv6Interface > ns3::Ipv6L3Protocol::GetInterface | ( | uint32_t | i | ) | const |
Get an interface.
i | interface index |
Definition at line 242 of file ipv6-l3-protocol.cc.
References m_interfaces, and NS_LOG_FUNCTION.
Referenced by AddAutoconfiguredAddress(), GetNetDevice(), IpForward(), LocalDeliver(), and RemoveAutoconfiguredAddress().
|
overridevirtual |
Get interface index which has specified IPv6 address.
addr | IPv6 address |
Implements ns3::Ipv6.
Definition at line 261 of file ipv6-l3-protocol.cc.
References m_interfaces, max, and NS_LOG_FUNCTION.
Referenced by Send().
|
overridevirtual |
Get interface index which is on a specified net device.
device | net device |
Implements ns3::Ipv6.
Definition at line 315 of file ipv6-l3-protocol.cc.
References m_reverseInterfacesContainer, and NS_LOG_FUNCTION.
Referenced by IpForward(), Receive(), and Send().
|
overridevirtual |
Get interface index which match specified address/prefix.
addr | IPv6 address |
mask | IPv6 prefix (mask) |
Implements ns3::Ipv6.
Definition at line 285 of file ipv6-l3-protocol.cc.
References m_interfaces, and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Get IPv6 forwarding state.
Implements ns3::Ipv6.
Definition at line 732 of file ipv6-l3-protocol.cc.
References m_ipForward, and NS_LOG_FUNCTION.
|
overridevirtual |
Get metric for an interface.
i | index |
Implements ns3::Ipv6.
Definition at line 533 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
Get MTU for an interface.
i | index |
Implements ns3::Ipv6.
Definition at line 541 of file ipv6-l3-protocol.cc.
References IPV6_MIN_MTU, m_mtuDiscover, and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Get IPv6 MTU discover state.
Implements ns3::Ipv6.
Definition at line 746 of file ipv6-l3-protocol.cc.
References m_mtuDiscover, and NS_LOG_FUNCTION.
Get number of address for an interface.
interface | interface index |
Implements ns3::Ipv6.
Definition at line 468 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
Referenced by SourceAddressSelection().
Get device by index.
i | device index on this stack |
Implements ns3::Ipv6.
Definition at line 308 of file ipv6-l3-protocol.cc.
References ns3::Ipv6Interface::GetDevice(), GetInterface(), and NS_LOG_FUNCTION.
Referenced by IpMulticastForward(), and Send().
|
overridevirtual |
Get current number of interface on this stack.
Implements ns3::Ipv6.
Definition at line 254 of file ipv6-l3-protocol.cc.
References m_nInterfaces, and NS_LOG_FUNCTION.
|
overridevirtual |
Get L4 protocol by protocol number.
protocolNumber | protocol number |
Implements ns3::Ipv6.
Definition at line 858 of file ipv6-l3-protocol.cc.
References GetProtocol(), and NS_LOG_FUNCTION.
Referenced by GetIcmpv6(), GetProtocol(), and LocalDeliver().
|
overridevirtual |
Get L4 protocol by protocol number for the specified interface.
protocolNumber | protocol number |
interfaceIndex | interface index, -1 means "any" interface. |
Implements ns3::Ipv6.
Definition at line 866 of file ipv6-l3-protocol.cc.
References m_protocols, and NS_LOG_FUNCTION.
|
overridevirtual |
Get current routing protocol used.
Implements ns3::Ipv6.
Definition at line 198 of file ipv6-l3-protocol.cc.
References m_routingProtocol, and NS_LOG_FUNCTION.
Referenced by AddAutoconfiguredAddress(), and RemoveAutoconfiguredAddress().
|
privatevirtual |
Get the ICMPv6 Redirect sending state.
Definition at line 760 of file ipv6-l3-protocol.cc.
References m_sendIcmpv6Redirect, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
static |
Get the type ID of this class.
Definition at line 61 of file ipv6-l3-protocol.cc.
References GetSendIcmpv6Redirect(), m_defaultTclass, m_defaultTtl, m_dropTrace, m_interfaces, m_localDeliverTrace, m_rxTrace, m_sendOutgoingTrace, m_strongEndSystemModel, m_txTrace, m_unicastForwardTrace, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeObjectVectorAccessor(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::TypeId::SetParent(), and SetSendIcmpv6Redirect().
|
overridevirtual |
Add a L4 protocol.
protocol | L4 protocol |
Implements ns3::Ipv6.
Definition at line 795 of file ipv6-l3-protocol.cc.
References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.
|
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.
protocol | L4 protocol. |
interfaceIndex | interface index. |
Implements ns3::Ipv6.
Definition at line 807 of file ipv6-l3-protocol.cc.
References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.
|
private |
Forward a packet.
idev | Pointer to ingress network device |
rtentry | route |
p | packet to forward |
header | IPv6 header to add to the packet |
Definition at line 1359 of file ipv6-l3-protocol.cc.
References DROP_ROUTE_ERROR, DROP_TTL_EXPIRED, ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetHopLimit(), GetIcmpv6(), ns3::Node::GetId(), GetInterface(), GetInterfaceForDevice(), ns3::Ipv6Interface::GetLinkLocalAddress(), ns3::Ipv6Header::GetSource(), ns3::Icmpv6Header::ICMPV6_HOPLIMIT, ns3::Ipv6Address::IsAny(), ns3::Ipv6Address::IsDocumentation(), ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsMulticast(), m_dropTrace, m_node, m_sendIcmpv6Redirect, m_unicastForwardTrace, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, SendRealOut(), and ns3::Ipv6Header::SetHopLimit().
Referenced by Ipv6L3Protocol().
|
private |
Forward a multicast packet.
idev | Pointer to ingress network device |
mrtentry | route |
p | packet to forward |
header | IPv6 header to add to the packet |
Definition at line 1452 of file ipv6-l3-protocol.cc.
References 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().
|
overridevirtual |
Is interface allows forwarding ?
i | interface index |
Implements ns3::Ipv6.
Definition at line 654 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION, and NS_LOG_LOGIC.
bool ns3::Ipv6L3Protocol::IsRegisteredMulticastAddress | ( | Ipv6Address | address | ) | const |
Checks if the address has been registered.
address | the address. |
Definition at line 1797 of file ipv6-l3-protocol.cc.
References m_multicastAddressesNoInterface, and NS_LOG_FUNCTION.
bool ns3::Ipv6L3Protocol::IsRegisteredMulticastAddress | ( | Ipv6Address | address, |
uint32_t | interface | ||
) | const |
Checks if the address has been registered for a specific interface.
address | the address. |
interface | the incoming interface. |
Definition at line 1786 of file ipv6-l3-protocol.cc.
References m_multicastAddresses, and NS_LOG_FUNCTION.
|
overridevirtual |
Is specified interface up ?
i | interface index |
Implements ns3::Ipv6.
Definition at line 563 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
|
private |
Deliver a packet.
p | packet delivered |
ip | IPv6 header |
iif | input interface packet was received |
Definition at line 1487 of file ipv6-l3-protocol.cc.
References DROP_UNKNOWN_PROTOCOL, ns3::Ipv6Header::GetDestination(), GetIcmpv6(), GetInterface(), ns3::Ipv6Header::GetNextHeader(), ns3::Object::GetObject(), GetProtocol(), ns3::Ipv6Header::GetSerializedSize(), ns3::Ipv6Header::GetSource(), ns3::Icmpv6Header::ICMPV6_PORT_UNREACHABLE, ns3::Icmpv6Header::ICMPV6_UNKNOWN_NEXT_HEADER, ns3::Ipv6Header::IPV6_EXT_FRAGMENTATION, ns3::Ipv6Header::IPV6_EXT_HOP_BY_HOP, ns3::Ipv6Address::IsMulticast(), m_dropTrace, m_localDeliverTrace, m_node, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::IpL4Protocol::RX_CSUM_FAILED, ns3::IpL4Protocol::RX_ENDPOINT_CLOSED, ns3::IpL4Protocol::RX_ENDPOINT_UNREACH, and ns3::IpL4Protocol::RX_OK.
Referenced by Ipv6L3Protocol().
|
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 767 of file ipv6-l3-protocol.cc.
References m_node, ns3::Object::NotifyNewAggregate(), NS_LOG_FUNCTION, and SetNode().
|
delete |
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 ().
ipInterfaceIndex | IP interface index |
address | reachable address |
Definition at line 1808 of file ipv6-l3-protocol.cc.
References ns3::NdiscCache::Entry::ClearWaitingPacket(), ns3::NdiscCache::Entry::GetMacAddress(), ns3::NdiscCache::Entry::IsAutoGenerated(), ns3::NdiscCache::Entry::IsIncomplete(), ns3::NdiscCache::Entry::IsPermanent(), ns3::NdiscCache::Entry::IsProbe(), ns3::NdiscCache::Entry::IsReachable(), m_interfaces, ns3::NdiscCache::Entry::MarkReachable(), ns3::NdiscCache::Entry::StartReachableTimer(), and ns3::NdiscCache::Entry::UpdateReachableTimer().
void ns3::Ipv6L3Protocol::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.
This method removes IPv6 header and forward up to L4 protocol.
device | network device |
p | the packet |
protocol | next header value |
from | address of the correspondent |
to | address of the destination |
packetType | type of the packet |
Definition at line 1037 of file ipv6-l3-protocol.cc.
References ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6Header::GetDestination(), ns3::Node::GetId(), GetInterfaceForDevice(), ns3::Ipv6Header::GetNextHeader(), ns3::Ipv6Header::GetPayloadLength(), ns3::Ipv6Header::GetSource(), ns3::Ipv6Address::IsAllNodesMulticast(), ns3::Ipv6Address::IsAllRoutersMulticast(), ns3::Ipv6Address::IsMulticast(), m_node, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, and ns3::NdiscCache::Entry::UpdateReachableTimer().
Referenced by AddInterface(), and SetupLoopback().
|
overridevirtual |
Register the IPv6 Extensions.
Does nothing if the Extensions have been already registered.
Implements ns3::Ipv6.
Definition at line 1658 of file ipv6-l3-protocol.cc.
References ns3::Object::AggregateObject(), ns3::Object::GetObject(), and m_node.
|
overridevirtual |
Register the IPv6 Options.
Does nothing if the Options have been already registered.
Implements ns3::Ipv6.
Definition at line 1698 of file ipv6-l3-protocol.cc.
References ns3::Object::AggregateObject(), ns3::Object::GetObject(), and m_node.
|
overridevirtual |
Remove a L4 protocol.
protocol | L4 protocol to remove. |
Implements ns3::Ipv6.
Definition at line 821 of file ipv6-l3-protocol.cc.
References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.
|
overridevirtual |
Remove a L4 protocol from a specific interface.
protocol | L4 protocol to remove. |
interfaceIndex | interface index. |
Implements ns3::Ipv6.
Definition at line 839 of file ipv6-l3-protocol.cc.
References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.
|
overridevirtual |
Remove a specified Ipv6 address from an interface.
interfaceIndex | interface index |
address | Ipv6Address to be removed from the interface |
Implements ns3::Ipv6.
Definition at line 502 of file ipv6-l3-protocol.cc.
References ns3::Ipv6Address::GetLoopback(), NS_LOG_FUNCTION, and NS_LOG_WARN.
|
overridevirtual |
Remove an address from an interface.
interfaceIndex | interface index |
addressIndex | address index on the interface |
Implements ns3::Ipv6.
Definition at line 484 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
Referenced by 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.
interface | interface index |
network | network prefix |
mask | network mask |
defaultRouter | gateway |
Definition at line 403 of file ipv6-l3-protocol.cc.
References ns3::Ipv6Address::GetAny(), GetInterface(), GetRoutingProtocol(), m_prefixes, ns3::Ipv6Address::MakeAutoconfiguredAddress(), NS_LOG_FUNCTION, and RemoveAddress().
void ns3::Ipv6L3Protocol::RemoveMulticastAddress | ( | Ipv6Address | address | ) |
Removes a multicast address from the list of addresses to pass to local deliver.
address | the address. |
Definition at line 1774 of file ipv6-l3-protocol.cc.
References m_multicastAddressesNoInterface, and NS_LOG_FUNCTION.
void ns3::Ipv6L3Protocol::RemoveMulticastAddress | ( | Ipv6Address | address, |
uint32_t | interface | ||
) |
Removes a multicast address from the list of addresses to pass to local deliver.
address | the address. |
interface | the incoming interface. |
Definition at line 1760 of file ipv6-l3-protocol.cc.
References m_multicastAddresses, and NS_LOG_FUNCTION.
|
virtual |
Report a packet drop.
This function is used by Fragment Timeout handling to signal a fragment drop.
ipHeader | the IPv6 header of dropped packet |
p | the packet (if available) |
dropReason | the drop reason |
Definition at line 1725 of file ipv6-l3-protocol.cc.
References m_dropTrace.
|
private |
Fallback when no route is found.
p | packet |
ipHeader | IPv6 header |
sockErrno | error number |
Definition at line 1616 of file ipv6-l3-protocol.cc.
References 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().
|
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.
packet | packet to send |
source | source address of packet |
destination | address of packet |
protocol | number of packet |
route | route to take |
Implements ns3::Ipv6.
Definition at line 949 of file ipv6-l3-protocol.cc.
References BuildHeader(), DROP_NO_ROUTE, ns3::SocketIpv6HopLimitTag::GetHopLimit(), GetInterfaceForAddress(), GetInterfaceForDevice(), GetNetDevice(), 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, and SendRealOut().
|
private |
Send packet with route.
route | route |
packet | packet to send |
ipHeader | IPv6 header to add to the packet |
Definition at line 1222 of file ipv6-l3-protocol.cc.
References ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetSerializedSize(), ns3::Ipv6Header::GetSource(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::PeekPointer().
Referenced by IpForward(), IpMulticastForward(), and Send().
void ns3::Ipv6L3Protocol::SetDefaultTclass | ( | uint8_t | tclass | ) |
Set the default TCLASS.
tclass | TCLASS to set |
Definition at line 942 of file ipv6-l3-protocol.cc.
References m_defaultTclass, and NS_LOG_FUNCTION.
void ns3::Ipv6L3Protocol::SetDefaultTtl | ( | uint8_t | ttl | ) |
Set the default TTL.
ttl | TTL to set |
Definition at line 935 of file ipv6-l3-protocol.cc.
References m_defaultTtl, and NS_LOG_FUNCTION.
|
overridevirtual |
set an interface down.
i | interface index |
Implements ns3::Ipv6.
Definition at line 599 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
Enable or disable forwarding on interface.
i | interface index |
val | true = enable forwarding, false = disable |
Implements ns3::Ipv6.
Definition at line 664 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Set IPv6 forwarding state.
forward | IPv6 forwarding enabled or not |
Implements ns3::Ipv6.
Definition at line 719 of file ipv6-l3-protocol.cc.
References m_interfaces, m_ipForward, and NS_LOG_FUNCTION.
|
overridevirtual |
Set metric for an interface.
i | index |
metric |
Implements ns3::Ipv6.
Definition at line 525 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Set IPv6 MTU discover state.
mtuDiscover | IPv6 MTU discover enabled or not |
Implements ns3::Ipv6.
Definition at line 739 of file ipv6-l3-protocol.cc.
References m_mtuDiscover, and NS_LOG_FUNCTION.
Set node associated with this stack.
node | node to set |
Definition at line 786 of file ipv6-l3-protocol.cc.
References m_node, NS_LOG_FUNCTION, and SetupLoopback().
Referenced by NotifyNewAggregate().
|
overridevirtual |
Set the Path MTU for the specified IPv6 destination address.
dst | Ipv6 destination address |
pmtu | the Path MTU |
Implements ns3::Ipv6.
Definition at line 556 of file ipv6-l3-protocol.cc.
References m_pmtuCache, and NS_LOG_FUNCTION.
|
overridevirtual |
Set routing protocol for this stack.
routingProtocol | IPv6 routing protocol to set |
Implements ns3::Ipv6.
Definition at line 190 of file ipv6-l3-protocol.cc.
References m_routingProtocol, and NS_LOG_FUNCTION.
|
privatevirtual |
Set the ICMPv6 Redirect sending state.
sendIcmpv6Redirect | ICMPv6 Redirect sending enabled or not |
Definition at line 753 of file ipv6-l3-protocol.cc.
References m_sendIcmpv6Redirect, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
overridevirtual |
Set an interface up.
i | interface index |
Implements ns3::Ipv6.
Definition at line 571 of file ipv6-l3-protocol.cc.
References NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
private |
Setup loopback interface.
Definition at line 613 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, and Receive().
Referenced by SetNode().
|
overridevirtual |
Choose the source address to use with destination address.
interface | interface index |
dest | IPv6 destination address |
Implements ns3::Ipv6.
Definition at line 672 of file ipv6-l3-protocol.cc.
References GetAddress(), ns3::Ipv6Address::GetLoopback(), GetNAddresses(), ns3::Ipv6InterfaceAddress::GLOBAL, ns3::Ipv6Address::IsAny(), ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsLinkLocalMulticast(), ns3::Ipv6Address::IsLocalhost(), ns3::Ipv6InterfaceAddress::LINKLOCAL, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
|
friend |
Ipv6L3ProtocolTestCase test case.
Definition at line 508 of file ipv6-l3-protocol.h.
|
friend |
Definition at line 513 of file ipv6-l3-protocol.h.
|
private |
Default TCLASS for outgoing packets.
Definition at line 757 of file ipv6-l3-protocol.h.
Referenced by GetTypeId(), Send(), and SetDefaultTclass().
|
private |
Default TTL for outgoing packets.
Definition at line 752 of file ipv6-l3-protocol.h.
Referenced by GetTypeId(), Send(), and SetDefaultTtl().
|
private |
Callback to trace drop packets.
Ptr<Ipv6>
argument is deprecated and will be changed to Ptr<const Ipv6>
in a future release. Definition at line 585 of file ipv6-l3-protocol.h.
Referenced by GetTypeId(), IpForward(), IpMulticastForward(), LocalDeliver(), ReportDrop(), RouteInputError(), and Send().
|
private |
|
private |
List of IPv6 interfaces.
Definition at line 737 of file ipv6-l3-protocol.h.
Referenced by AddIpv6Interface(), DoDispose(), GetInterface(), GetInterfaceForAddress(), GetInterfaceForPrefix(), GetTypeId(), ReachabilityHint(), and SetIpForward().
|
private |
Forwarding packets (i.e.
router mode) state.
Definition at line 717 of file ipv6-l3-protocol.h.
Referenced by AddInterface(), GetIpForward(), and SetIpForward().
|
private |
Local delivery callback.
Definition at line 836 of file ipv6-l3-protocol.h.
Referenced by Ipv6L3Protocol().
|
private |
Trace of locally delivered packets.
Definition at line 592 of file ipv6-l3-protocol.h.
Referenced by GetTypeId(), and LocalDeliver().
|
private |
Multicast forward callback.
Definition at line 835 of file ipv6-l3-protocol.h.
Referenced by Ipv6L3Protocol().
|
private |
MTU Discover (i.e.
Path MTU) state.
Definition at line 722 of file ipv6-l3-protocol.h.
Referenced by GetMtu(), GetMtuDiscover(), and SetMtuDiscover().
|
private |
List of multicast IP addresses of interest, divided per interface.
Definition at line 827 of file ipv6-l3-protocol.h.
Referenced by AddMulticastAddress(), IsRegisteredMulticastAddress(), and RemoveMulticastAddress().
|
private |
List of multicast IP addresses of interest for all the interfaces.
Definition at line 832 of file ipv6-l3-protocol.h.
Referenced by AddMulticastAddress(), IsRegisteredMulticastAddress(), and RemoveMulticastAddress().
|
private |
Number of IPv6 interfaces managed by the stack.
Definition at line 747 of file ipv6-l3-protocol.h.
Referenced by AddIpv6Interface(), and GetNInterfaces().
Node attached to stack.
Definition at line 712 of file ipv6-l3-protocol.h.
Referenced by AddAutoconfiguredAddress(), AddInterface(), CreateRawSocket(), DoDispose(), IpForward(), IpMulticastForward(), LocalDeliver(), NotifyNewAggregate(), Receive(), RegisterExtensions(), RegisterOptions(), SetNode(), and SetupLoopback().
|
private |
Path MTU Cache.
Definition at line 727 of file ipv6-l3-protocol.h.
Referenced by Ipv6L3Protocol(), DoDispose(), and SetPmtu().
|
private |
List of IPv6 prefix received from RA.
Definition at line 777 of file ipv6-l3-protocol.h.
Referenced by AddAutoconfiguredAddress(), DoDispose(), and RemoveAutoconfiguredAddress().
|
private |
List of transport protocol.
Definition at line 732 of file ipv6-l3-protocol.h.
Referenced by DoDispose(), GetProtocol(), Insert(), and Remove().
|
private |
Container of NetDevice / Interface index associations.
Definition at line 742 of file ipv6-l3-protocol.h.
Referenced by AddIpv6Interface(), DoDispose(), and GetInterfaceForDevice().
|
private |
Routing protocol.
Definition at line 767 of file ipv6-l3-protocol.h.
Referenced by AddAutoconfiguredAddress(), DoDispose(), GetRoutingProtocol(), Send(), SetRoutingProtocol(), and SetupLoopback().
Callback to trace RX (reception) packets.
Ptr<Ipv6>
argument is deprecated and will be changed to Ptr<const Ipv6>
in a future release. Definition at line 577 of file ipv6-l3-protocol.h.
Referenced by GetTypeId().
|
private |
Allow ICMPv6 Redirect sending state.
Definition at line 782 of file ipv6-l3-protocol.h.
Referenced by GetSendIcmpv6Redirect(), IpForward(), and SetSendIcmpv6Redirect().
|
private |
Trace of sent packets.
Definition at line 588 of file ipv6-l3-protocol.h.
Referenced by GetTypeId(), and Send().
|
private |
List of IPv6 raw sockets.
Definition at line 772 of file ipv6-l3-protocol.h.
Referenced by CreateRawSocket(), DeleteRawSocket(), and DoDispose().
|
private |
Rejects packets directed to an interface with wrong address (RFC 1222).
Definition at line 762 of file ipv6-l3-protocol.h.
Referenced by GetTypeId().
Callback to trace TX (transmission) packets.
Ptr<Ipv6>
argument is deprecated and will be changed to Ptr<const Ipv6>
in a future release. Definition at line 570 of file ipv6-l3-protocol.h.
Referenced by CallTxTrace(), and GetTypeId().
|
private |
Unicast forward callback.
Definition at line 834 of file ipv6-l3-protocol.h.
Referenced by Ipv6L3Protocol().
|
private |
Trace of unicast forwarded packets.
Definition at line 590 of file ipv6-l3-protocol.h.
Referenced by GetTypeId(), and IpForward().
|
static |
The protocol number for IPv6 (0x86DD).
Definition at line 74 of file ipv6-l3-protocol.h.
Referenced by ns3::NoBackhaulEpcHelper::AddEnb(), AddInterface(), ns3::EpcTftClassifier::Classify(), EpcTftClassifierTestCase::DoRun(), ns3::NdiscCache::Entry::FunctionDelayTimeout(), ns3::NdiscCache::Entry::FunctionProbeTimeout(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::LteNetDevice::Receive(), ns3::SixLowPanNetDevice::ReceiveFromDevice(), ns3::EpcPgwApplication::RecvFromTunDevice(), ns3::Ipv6Interface::Send(), ns3::LteEnbNetDevice::Send(), ns3::LteUeNetDevice::Send(), and SetupLoopback().