23 #include "ns3/uinteger.h"
24 #include "ns3/vector.h"
25 #include "ns3/boolean.h"
26 #include "ns3/callback.h"
27 #include "ns3/trace-source-accessor.h"
28 #include "ns3/object-vector.h"
29 #include "ns3/ipv6-routing-protocol.h"
30 #include "ns3/ipv6-route.h"
31 #include "ns3/mac16-address.h"
32 #include "ns3/mac64-address.h"
33 #include "ns3/traffic-control-layer.h"
49 #define IPV6_MIN_MTU 1280
63 .SetGroupName (
"Internet")
65 .AddAttribute (
"DefaultTtl",
66 "The TTL value set by default on all "
67 "outgoing packets generated on this node.",
70 MakeUintegerChecker<uint8_t> ())
71 .AddAttribute (
"DefaultTclass",
72 "The TCLASS value set by default on all "
73 "outgoing packets generated on this node.",
76 MakeUintegerChecker<uint8_t> ())
77 .AddAttribute (
"InterfaceList",
78 "The set of IPv6 interfaces associated to this IPv6 stack.",
81 MakeObjectVectorChecker<Ipv6Interface> ())
82 .AddAttribute (
"SendIcmpv6Redirect",
83 "Send the ICMPv6 Redirect when appropriate.",
88 .AddAttribute (
"StrongEndSystemModel",
89 "Reject packets for an address not configured on the interface they're coming from (RFC1222).",
93 .AddTraceSource (
"Tx",
94 "Send IPv6 packet to outgoing interface.",
96 "ns3::Ipv6L3Protocol::TxRxTracedCallback")
97 .AddTraceSource (
"Rx",
98 "Receive IPv6 packet from incoming interface.",
100 "ns3::Ipv6L3Protocol::TxRxTracedCallback")
101 .AddTraceSource (
"Drop",
104 "ns3::Ipv6L3Protocol::DropTracedCallback")
106 .AddTraceSource (
"SendOutgoing",
107 "A newly-generated packet by this node is "
108 "about to be queued for transmission",
110 "ns3::Ipv6L3Protocol::SentTracedCallback")
111 .AddTraceSource (
"UnicastForward",
112 "A unicast IPv6 packet was received by this node "
113 "and is being forwarded to another node",
115 "ns3::Ipv6L3Protocol::SentTracedCallback")
116 .AddTraceSource (
"LocalDeliver",
117 "An IPv6 packet was received by/for this node, "
118 "and it is being forward up the stack",
120 "ns3::Ipv6L3Protocol::SentTracedCallback")
166 (*it)->StopValidTimer ();
167 (*it)->StopPreferredTimer ();
201 Ipv6L3Protocol::PROT_NUMBER, device);
204 Ipv6L3Protocol::PROT_NUMBER, device);
206 interface->SetNode (
m_node);
207 interface->SetDevice (device);
208 interface->SetTrafficControl (tc);
210 tc->SetupDevice (device);
250 uint32_t
max = (*it)->GetNAddresses ();
252 for (j = 0; j <
max; j++)
254 if ((*it)->GetAddress (j).GetAddress () ==
address)
272 for (j = 0; j < (*it)->GetNAddresses (); j++)
274 if ((*it)->GetAddress (j).GetAddress ().CombinePrefix (mask) == address.
CombinePrefix (mask))
297 return (*iter).second;
305 NS_LOG_FUNCTION (
this << interface << network << mask << (uint32_t)flags << validTime << preferredTime);
310 if (flags & (1 << 6))
327 NS_FATAL_ERROR (
"Unknown method to make autoconfigured address for this kind of device.");
334 if ((*it)->GetInterface () ==
interface && (*it)->GetPrefix () == network && (*it)->GetMask () == mask)
336 (*it)->StopPreferredTimer ();
337 (*it)->StopValidTimer ();
338 (*it)->StartPreferredTimer ();
350 if (!defaultRouter.
IsAny())
385 NS_FATAL_ERROR (
"Unknown method to make autoconfigured address for this kind of device.");
389 for (i = 0; i <
max; i++)
401 if ((*it)->GetInterface () ==
interface && (*it)->GetPrefix () == network && (*it)->GetMask () == mask)
504 return interface->
GetDevice ()->GetMtu ();
518 return interface->
IsUp ();
531 if (interface->GetDevice ()->GetMtu () >= 1280)
542 NS_LOG_LOGIC (
"Interface " <<
int(i) <<
" is set to be down for IPv6. Reason: not respecting minimum IPv6 MTU (1280 octets)");
577 device = CreateObject<LoopbackNetDevice> ();
581 interface->SetDevice (device);
582 interface->SetNode (
m_node);
584 interface->AddAddress (ifaceAddr);
601 NS_LOG_LOGIC (
"Forwarding state: " << interface->IsForwarding ());
602 return interface->IsForwarding ();
627 NS_ASSERT_MSG (
false,
"No link-local address found on interface " << interface);
658 (*it)->SetForwarding (forward);
698 Ptr<Node> node = this->GetObject<Node> ();
764 NS_LOG_WARN (
"Trying to remove an non-existent protocol " <<
int(protocol->
GetProtocolNumber ()) <<
" on interface " <<
int(interfaceIndex));
784 L4List_t::const_iterator i;
785 if (interfaceIndex >= 0)
788 key = std::make_pair (protocolNumber, interfaceIndex);
796 key = std::make_pair (protocolNumber, -1);
858 NS_LOG_FUNCTION (
this << packet << source << destination << (uint32_t)protocol << route);
887 NS_LOG_LOGIC (
"Ipv6L3Protocol::Send case 1: passed in with a route");
898 NS_LOG_LOGIC (
"Ipv6L3Protocol::Send case 1: probably sent to machine on same IPv6 network");
908 NS_LOG_LOGIC (
"Ipv6L3Protocol::Send case 3: passed in with no route " << destination);
921 NS_ASSERT_MSG (index >= 0,
"Can not find an outgoing interface for a packet with src " << source <<
" and dst " << destination);
942 NS_LOG_FUNCTION (
this << device << p << protocol << from << to << packetType);
946 uint32_t
interface = GetInterfaceForDevice(device);
951 if (ipv6Interface->IsUp ())
957 NS_LOG_LOGIC (
"Dropping received packet-- interface is down");
988 std::list<NdiscCache::Entry *> entryList = ndiscCache->
LookupInverse (from);
989 std::list<NdiscCache::Entry *>::iterator iter;
990 for (iter = entryList.begin (); iter != entryList.end (); iter ++)
992 (*iter)->UpdateReachableTimer ();
1003 socket->
ForwardUp (packet, hdr, device);
1009 bool stopProcessing =
false;
1010 bool isDropped =
false;
1015 ipv6Extension = ipv6ExtensionDemux->GetExtension (nextHeader);
1019 ipv6Extension->Process (packet, 0, hdr, hdr.
GetDestinationAddress (), (uint8_t *)0, stopProcessing, isDropped, dropReason);
1048 if (isSolicited || isRegisteredGlobally || isRegisteredOnInterface)
1068 NS_LOG_LOGIC (
"For me (destination " << addr <<
" match)");
1088 NS_LOG_WARN (
"No route found for forwarding packet. Drop.");
1099 m_txTrace (packetCopy, ipv6, interface);
1113 int32_t
interface = GetInterfaceForDevice (dev);
1117 NS_LOG_LOGIC (
"Send via NetDevice ifIndex " << dev->GetIfIndex () <<
" Ipv6InterfaceIndex " << interface);
1120 std::list<Ipv6ExtensionFragment::Ipv6PayloadHeaderPair> fragments;
1126 targetMtu = dev->GetMtu ();
1129 if (packet->
GetSize () > targetMtu + 40)
1133 bool fromMe =
false;
1151 icmpv6->SendErrorTooBig (packet, ipHeader.
GetSourceAddress (), dev->GetMtu ());
1161 ipv6Fragment->GetFragments (packet, ipHeader, targetMtu, fragments);
1166 if (outInterface->
IsUp ())
1168 NS_LOG_LOGIC (
"Send to gateway " << route->GetGateway ());
1170 if (fragments.size () != 0)
1172 std::ostringstream oss;
1174 for (std::list<Ipv6ExtensionFragment::Ipv6PayloadHeaderPair>::const_iterator it = fragments.begin (); it != fragments.end (); it++)
1177 outInterface->
Send (it->first, it->second, route->GetGateway ());
1183 outInterface->
Send (packet, ipHeader, route->GetGateway ());
1188 NS_LOG_LOGIC (
"Dropping-- outgoing interface is down: " << route->GetGateway ());
1194 if (outInterface->
IsUp ())
1198 if (fragments.size () != 0)
1200 std::ostringstream oss;
1202 for (std::list<Ipv6ExtensionFragment::Ipv6PayloadHeaderPair>::const_iterator it = fragments.begin (); it != fragments.end (); it++)
1230 NS_LOG_WARN (
"Received a packet for 2001:db8::/32 (documentation class). Drop.");
1281 if (target.
IsAny ())
1289 if (icmpv6->Lookup (target, rtentry->GetOutputDevice (), 0, &hardwareTarget))
1291 icmpv6->SendRedirection (copy, linkLocal, src, target, dst, hardwareTarget);
1295 icmpv6->SendRedirection (copy, linkLocal, src, target, dst,
Address ());
1311 std::map<uint32_t, uint32_t> ttlMap = mrtentry->GetOutputTtlMap ();
1312 std::map<uint32_t, uint32_t>::iterator mapIter;
1314 for (mapIter = ttlMap.begin (); mapIter != ttlMap.end (); mapIter++)
1316 uint32_t interfaceId = mapIter->first;
1327 NS_LOG_LOGIC (
"Forward multicast via interface " << interfaceId);
1348 uint8_t nextHeaderPosition = 0;
1349 bool isDropped =
false;
1350 bool stopProcessing =
false;
1361 NS_LOG_WARN(
"Double Ipv6Header::IPV6_EXT_HOP_BY_HOP in packet, dropping packet");
1370 ipv6Extension = ipv6ExtensionDemux->GetExtension (nextHeader);
1374 uint8_t nextHeaderStep = 0;
1375 uint8_t curHeader = nextHeader;
1376 nextHeaderStep = ipv6Extension->Process (p, nextHeaderPosition, ip, dst, &nextHeader, stopProcessing, isDropped, dropReason);
1377 nextHeaderPosition += nextHeaderStep;
1389 "Zero-size IPv6 Option Header, aborting" << *packet );
1403 if (nextHeaderPosition == 0)
1447 while (ipv6Extension);
1453 NS_LOG_LOGIC (
"Route input failure-- dropping packet to " << ipHeader <<
" with errno " << sockErrno);
1467 NS_LOG_FUNCTION (
this << src << dst << (uint32_t)protocol << (uint32_t)payloadSize << (uint32_t)ttl << (uint32_t)tclass);
1482 ipv6ExtensionDemux->SetNode (
m_node);
1485 hopbyhopExtension->SetNode (
m_node);
1487 destinationExtension->SetNode (
m_node);
1489 fragmentExtension->SetNode (
m_node);
1495 ipv6ExtensionDemux->Insert (hopbyhopExtension);
1496 ipv6ExtensionDemux->Insert (destinationExtension);
1497 ipv6ExtensionDemux->Insert (fragmentExtension);
1498 ipv6ExtensionDemux->Insert (routingExtension);
1503 routingExtensionDemux->SetNode (
m_node);
1505 looseRoutingExtension->SetNode (
m_node);
1506 routingExtensionDemux->Insert (looseRoutingExtension);
1515 ipv6OptionDemux->SetNode (
m_node);
1518 pad1Option->SetNode (
m_node);
1520 padnOption->SetNode (
m_node);
1522 jumbogramOption->SetNode (
m_node);
1524 routerAlertOption->SetNode (
m_node);
1526 ipv6OptionDemux->Insert (pad1Option);
1527 ipv6OptionDemux->Insert (padnOption);
1528 ipv6OptionDemux->Insert (jumbogramOption);
1529 ipv6OptionDemux->Insert (routerAlertOption);
1545 NS_LOG_WARN (
"Not adding a non-multicast address " << address);
1559 NS_LOG_WARN (
"Not adding a non-multicast address " << address);
void SetNode(Ptr< Node > node)
Set the node associated with this socket.
std::pair< int, int32_t > L4ListKey_t
Container of the IPv6 L4 keys: protocol number, interface index.
bool IsAny() const
If the IPv6 address is the "Any" address.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
static bool IsMatchingType(const Address &address)
static Ipv6Address GetLoopback()
Get the loopback address.
Ipv6Header BuildHeader(Ipv6Address src, Ipv6Address dst, uint8_t protocol, uint16_t payloadSize, uint8_t hopLimit, uint8_t tclass)
Construct an IPv6 header.
void SetForwarding(uint32_t i, bool val)
Enable or disable forwarding on interface.
bool AddAddress(Ipv6InterfaceAddress iface)
Add an IPv6 address.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
std::map< Ipv6RegisteredMulticastAddressKey_t, uint32_t >::const_iterator Ipv6RegisteredMulticastAddressCIter_t
Container Const Iterator of the IPv6 multicast addresses.
virtual ~Ipv6L3Protocol()
Destructor.
SocketErrno
Enumeration of the possible errors returned by a socket.
void SetUp()
Enable this interface.
AttributeValue implementation for Boolean.
Ipv6L3Protocol()
Constructor.
bool IsLinkLocalMulticast() const
If the IPv6 address is link-local multicast (ff02::/16).
virtual void SetPmtu(Ipv6Address dst, uint32_t pmtu)
Set the Path MTU for the specified IPv6 destination address.
This class implements a tag that carries the socket-specific HOPLIMIT of a packet to the IPv6 layer...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< NetDevice > GetNetDevice(uint32_t i)
Get device by index.
bool AddAddress(uint32_t i, Ipv6InterfaceAddress address)
Add an address on interface.
Ptr< Ipv6RoutingProtocol > m_routingProtocol
Routing protocol.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Access to the IPv6 forwarding table, interfaces, and configuration.
Introspection did not find any typical Config paths.
static Mac16Address ConvertFrom(const Address &address)
std::map< Ipv6Address, uint32_t >::const_iterator Ipv6RegisteredMulticastAddressNoInterfaceCIter_t
Container Const Iterator of the IPv6 multicast addresses.
static bool IsMatchingType(const Address &address)
Ptr< Ipv6RoutingProtocol > GetRoutingProtocol() const
Get current routing protocol used.
uint32_t AddIpv6Interface(Ptr< Ipv6Interface > interface)
Add an IPv6 interface to the stack.
virtual void Send(Ptr< Packet > packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr< Ipv6Route > route)
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers...
IPv6 layer implementation.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Demultiplexes IPv6 extensions.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
bool IsAllRoutersMulticast() const
If the IPv6 address is "all routers multicast" (ff02::2/8).
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
void SetNode(Ptr< Node > node)
Set the node.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
PacketType
Packet types are used as they are in Linux.
U * PeekPointer(const Ptr< U > &p)
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
static Ipv6Address MakeAutoconfiguredAddress(Mac16Address addr, Ipv6Address prefix)
Make the autoconfigured IPv6 address with Mac16Address.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
IPv6 address associated with an interface.
uint32_t GetNAddresses(uint32_t interface) const
Get number of address for an interface.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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.
bool IsEqual(const Ipv6Address &other) const
Comparison operation between two Ipv6Addresses.
bool IsDocumentation() const
If the IPv6 address is a documentation address (2001:DB8::/32).
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Global address (2000::/3)
virtual void DoDispose(void)
Destructor implementation.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual void Receive(Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
Called by NetDevices, incoming packet.
virtual bool GetSendIcmpv6Redirect() const
Get the ICMPv6 Redirect sending state.
bool IsAllNodesMulticast() const
If the IPv6 address is "all nodes multicast" (ff02::1/8).
virtual void DoDispose()
Dispose object.
void SetMetric(uint32_t i, uint16_t metric)
Set metric for an interface.
virtual int GetProtocolNumber(void) const =0
Returns the protocol number of this protocol.
bool ForwardUp(Ptr< const Packet > p, Ipv6Header hdr, Ptr< NetDevice > device)
Forward up to receive method.
uint32_t AddInterface(Ptr< NetDevice > device)
Add IPv6 interface for a device.
Ptr< Node > m_node
Node attached to stack.
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_localDeliverTrace
Trace of locally delivered packets.
std::pair< Ipv6Address, uint64_t > Ipv6RegisteredMulticastAddressKey_t
IPv6 multicast addresses / interface key.
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 IsUp() const
Is the interface UP ?
void AddMulticastAddress(Ipv6Address address)
Adds a multicast address to the list of addresses to pass to local deliver.
a polymophic address class
virtual void SetIpForward(bool forward)
Set IPv6 forwarding state.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
virtual void NotifyNewAggregate()
Notify other components connected to the node that a new stack member is now connected.
bool IsUp(uint32_t i) const
Is specified interface up ?
DropReason
Reason why a packet has been dropped.
uint32_t m_nInterfaces
Number of IPv6 interfaces managed by the stack.
void SetDefaultTclass(uint8_t tclass)
Set the default TCLASS.
Ipv6Address GetAddress() const
Get the IPv6 address.
void Send(Ptr< Packet > p, const Ipv6Header &hdr, Ipv6Address dest)
Send a packet through this interface.
NS_ASSERT_MSG(false,"Ipv4AddressGenerator::MaskToIndex(): Impossible")
bool m_strongEndSystemModel
Rejects packets directed to an interface with wrong address (RFC 1222).
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
void SetMetric(uint16_t metric)
Set the metric.
void RemoveAtStart(uint32_t size)
Remove size bytes from the start of the current packet.
int32_t GetInterfaceForPrefix(Ipv6Address addr, Ipv6Prefix mask) const
Get interface index which match specified address/prefix.
uint8_t GetTclass(void) const
Get the tag's Tclass.
Ptr< Socket > CreateRawSocket()
Create raw IPv6 socket.
#define IPV6_MIN_MTU
Minimum IPv6 MTU, as defined by RFC 2460
Link-local address (fe80::/64)
Hold an unsigned integer type.
L4List_t m_protocols
List of transport protocol.
void SetDefaultTtl(uint8_t ttl)
Set the default TTL.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
void IpMulticastForward(Ptr< const NetDevice > idev, Ptr< Ipv6MulticastRoute > mrtentry, Ptr< const Packet > p, const Ipv6Header &header)
Forward a multicast packet.
void RemoveMulticastAddress(Ipv6Address address)
Removes a multicast address from the list of addresses to pass to local deliver.
indicates whether the socket has a priority set.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void SetUp(uint32_t i)
Set an interface up.
An implementation of the ICMPv6 protocol.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
virtual enum RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > incomingInterface)=0
Called from lower-level layers to send the packet up in the stack.
virtual void ReportDrop(Ipv6Header ipHeader, Ptr< Packet > p, DropReason dropReason)
Report a packet drop.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
static TypeId GetTypeId()
Get the type ID of this class.
Ipv6InterfaceList m_interfaces
List of IPv6 interfaces.
bool m_ipForward
Forwarding packets (i.e.
uint32_t GetNInterfaces() const
Get current number of interface on this stack.
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_unicastForwardTrace
Trace of unicast forwarded packets.
static Mac48Address ConvertFrom(const Address &address)
uint16_t GetMetric(uint32_t i) const
Get metric for an interface.
uint32_t GetNDevices(void) const
void SetForwarding(bool forward)
Set forwarding enabled or not.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
bool IsInSameSubnet(Ipv6Address b) const
Checks if the address is in the same subnet.
std::list< Ptr< Ipv6AutoconfiguredPrefix > >::iterator Ipv6AutoconfiguredPrefixListI
Iterator of the container of the IPv6 Autoconfigured addresses.
Ipv6RegisteredMulticastAddress_t m_multicastAddresses
List of multicast IP addresses of interest, divided per interface.
Ipv6AutoconfiguredPrefixList m_prefixes
List of IPv6 prefix received from RA.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LocalDeliver(Ptr< const Packet > p, Ipv6Header const &ip, uint32_t iif)
Deliver a packet.
void DeleteRawSocket(Ptr< Socket > socket)
Remove raw IPv6 socket.
virtual bool GetIpForward() const
Get IPv6 forwarding state.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
Ipv6Address SourceAddressSelection(uint32_t interface, Ipv6Address dest)
Choose the source address to use with destination address.
void IpForward(Ptr< const NetDevice > idev, Ptr< Ipv6Route > rtentry, Ptr< const Packet > p, const Ipv6Header &header)
Forward a packet.
void RemoveAtEnd(uint32_t size)
Remove size bytes from the end of the current packet.
Ipv6InterfaceAddress GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const
Get an address.
uint8_t m_defaultTtl
Default TTL for outgoing packets.
indicates whether the socket has IPV6_TCLASS set.
TracedCallback< const Ipv6Header &, Ptr< const Packet >, DropReason, Ptr< Ipv6 >, uint32_t > m_dropTrace
Callback to trace drop packets.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > m_rxTrace
Callback to trace RX (reception) packets.
int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const
Get interface index which is on a specified net device.
Interface is down so can not send packet.
void SetNode(Ptr< Node > node)
Set node associated with this stack.
Ipv6InterfaceReverseContainer m_reverseInterfacesContainer
Container of NetDevice / Interface index associations.
bool IsRegisteredMulticastAddress(Ipv6Address address) const
Checks if the address has been registered.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
bool IsForwarding(uint32_t i) const
Is interface allows forwarding ?
void RemoveAutoconfiguredAddress(uint32_t interface, Ipv6Address network, Ipv6Prefix mask, Ipv6Address defaultRouter)
Remove an autoconfigured address.
void SendRealOut(Ptr< Ipv6Route > route, Ptr< Packet > packet, Ipv6Header const &ipHeader)
Send packet with route.
void RegisterProtocolHandler(ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false)
void UpdateReachableTimer()
Update the reachable timer.
void SetupLoopback()
Setup loopback interface.
std::list< NdiscCache::Entry * > LookupInverse(Address dst)
Lookup in the cache for a MAC address.
virtual void RegisterExtensions()
Register the IPv6 Extensions.
uint8_t GetHopLimit(void) const
Get the tag's Hop Limit.
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
Describes an IPv6 address.
uint16_t GetMetric() const
Get the metric.
void SetRoutingProtocol(Ptr< Ipv6RoutingProtocol > routingProtocol)
Set routing protocol for this stack.
Ipv6InterfaceAddress::Scope_e GetScope() const
Get address scope.
NdiscCache::Entry * Lookup(Ipv6Address dst)
Lookup in the cache.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
virtual Ptr< IpL4Protocol > GetProtocol(int protocolNumber) const
Get L4 protocol by protocol number.
uint32_t GetId(void) const
Ptr< Icmpv6L4Protocol > GetIcmpv6() const
Get ICMPv6 protocol.
static Mac64Address ConvertFrom(const Address &address)
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
virtual void Insert(Ptr< IpL4Protocol > protocol)
Add a L4 protocol.
Ipv6RegisteredMulticastAddressNoInterface_t m_multicastAddressesNoInterface
List of multicast IP addresses of interest for all the interfaces.
uint16_t GetMtu(uint32_t i) const
Get MTU for an interface.
bool m_sendIcmpv6Redirect
Allow ICMPv6 Redirect sending state.
virtual void RegisterOptions()
Register the IPv6 Options.
TracedCallback< const Ipv6Header &, Ptr< const Packet >, uint32_t > m_sendOutgoingTrace
Trace of sent packets.
Describes an IPv6 prefix.
void SetDown(uint32_t i)
set an interface down.
Ptr< T > CreateObject(void)
Create an object by type, with varying number of constructor parameters.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
A record that holds information about a NdiscCache entry.
bool m_mtuDiscover
MTU Discover (i.e.
int32_t GetInterfaceForAddress(Ipv6Address addr) const
Get interface index which has specified IPv6 address.
virtual void NotifyNewAggregate(void)
Notify all Objects aggregated to this one of a new Object being aggregated.
bool RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex)
Remove an address from an interface.
Container for a set of ns3::Object pointers.
Ptr< Ipv6PmtuCache > m_pmtuCache
Path MTU Cache.
static bool IsMatchingType(const Address &address)
virtual bool GetMtuDiscover(void) const
Get IPv6 MTU discover state.
TracedCallback< Ptr< const Packet >, Ptr< Ipv6 >, uint32_t > m_txTrace
Callback to trace TX (transmission) packets.
virtual void SetMtuDiscover(bool mtuDiscover)
Set IPv6 MTU discover state.
Ipv6Address CombinePrefix(Ipv6Prefix const &prefix)
Combine this address with a prefix.
uint8_t m_defaultTclass
Default TCLASS for outgoing packets.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetDown()
Disable this interface.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
SocketList m_sockets
List of IPv6 raw sockets.
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Ptr< Ipv6Interface > GetInterface(uint32_t i) const
Get an interface.
void AddHeader(const Header &header)
Add header to this packet.
virtual void Remove(Ptr< IpL4Protocol > protocol)
Remove a L4 protocol.
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.
virtual void SetSendIcmpv6Redirect(bool sendIcmpv6Redirect)
Set the ICMPv6 Redirect sending state.
void RouteInputError(Ptr< const Packet > p, const Ipv6Header &ipHeader, Socket::SocketErrno sockErrno)
Fallback when no route is found.