20#include "ns3/assert.h"
21#include "ns3/boolean.h"
22#include "ns3/double.h"
23#include "ns3/integer.h"
26#include "ns3/packet.h"
27#include "ns3/pointer.h"
28#include "ns3/string.h"
29#include "ns3/uinteger.h"
61 TypeId(
"ns3::Icmpv6L4Protocol")
63 .SetGroupName(
"Internet")
66 "Always do DAD check.",
72 "The jitter in ms a node is allowed to wait before sending any solicitation. Some "
73 "jitter aims to prevent collisions. By default, the model will wait for a duration "
74 "in ms defined by a uniform random-variable between 0 and SolicitationJitter",
75 StringValue(
"ns3::UniformRandomVariable[Min=0.0|Max=10.0]"),
78 .AddAttribute(
"MaxMulticastSolicit",
79 "Neighbor Discovery node constants: max multicast solicitations.",
83 .AddAttribute(
"MaxUnicastSolicit",
84 "Neighbor Discovery node constants: max unicast solicitations.",
88 .AddAttribute(
"ReachableTime",
89 "Neighbor Discovery node constants: reachable time.",
93 .AddAttribute(
"RetransmissionTime",
94 "Neighbor Discovery node constants: retransmission timer.",
98 .AddAttribute(
"DelayFirstProbe",
99 "Neighbor Discovery node constants: delay for the first probe.",
103 .AddAttribute(
"DadTimeout",
104 "Duplicate Address Detection (DAD) timeout",
108 .AddAttribute(
"RsRetransmissionJitter",
109 "Multicast RS retransmission randomization quantity",
110 StringValue(
"ns3::UniformRandomVariable[Min=-0.1|Max=0.1]"),
113 .AddAttribute(
"RsInitialRetransmissionTime",
114 "Multicast RS initial retransmission time.",
118 .AddAttribute(
"RsMaxRetransmissionTime",
119 "Multicast RS maximum retransmission time (0 means unbound).",
124 "RsMaxRetransmissionCount",
125 "Multicast RS maximum retransmission count (0 means unbound). "
126 "Note: RFC 7559 suggest a zero value (infinite). The default is 4 to avoid "
127 "non-terminating simulations.",
131 .AddAttribute(
"RsMaxRetransmissionDuration",
132 "Multicast RS maximum retransmission duration (0 means unbound).",
136 .AddTraceSource(
"DadFailure",
137 "Duplicate Address detected during DAD, the address is now INVALID",
139 "ns3::Ipv6Address::TracedCallback")
142 "Duplicate Address not detected during DAD, the address is now PREFERRED",
144 "ns3::Ipv6Address::TracedCallback");
274 interface->GetDevice()->GetAddress());
277 interface->SetNsDadUid(
target, p.first->GetUid());
306 p->CopyData(&type,
sizeof(type));
311 if (ipv6->IsForwarding(ipv6->GetInterfaceForDevice(interface->GetDevice())))
317 if (!ipv6->IsForwarding(ipv6->GetInterfaceForDevice(interface->GetDevice())))
399 auto buf =
new uint8_t[packet->GetSize()];
403 packet->CopyData(buf, packet->GetSize());
448 m_startDhcpv6(ipv6->GetInterfaceForDevice(interface->GetDevice()));
460 p->CopyData(&type,
sizeof(type));
466 ipv6->AddAutoconfiguredAddress(ipv6->GetInterfaceForDevice(interface->GetDevice()),
512 entry = cache->Lookup(src);
516 entry = cache->Add(src);
517 entry->SetRouter(
true);
518 entry->SetMacAddress(
lla.GetAddress());
519 entry->MarkReachable();
520 entry->StartReachableTimer();
524 std::list<NdiscCache::Ipv6PayloadHeaderPair>
waiting;
525 switch (
entry->m_state)
528 entry->StopNudTimer();
531 entry->StartReachableTimer();
535 cache->GetInterface()->Send(
it->first,
it->second, src);
537 entry->ClearWaitingPacket();
542 if (
entry->GetMacAddress() !=
lla.GetAddress())
544 entry->SetMacAddress(
lla.GetAddress());
546 entry->SetRouter(
true);
550 entry->StopNudTimer();
552 entry->StartReachableTimer();
557 if (
entry->GetMacAddress() !=
lla.GetAddress())
559 entry->SetMacAddress(
lla.GetAddress());
561 entry->SetRouter(
true);
565 entry->StopNudTimer();
569 cache->GetInterface()->Send(
it->first,
it->second, src);
571 entry->StartReachableTimer();
576 if (
entry->GetMacAddress() !=
lla.GetAddress())
578 entry->SetMacAddress(
lla.GetAddress());
580 entry->SetRouter(
true);
582 entry->StartReachableTimer();
587 if (
entry->GetMacAddress() !=
lla.GetAddress())
589 entry->SetMacAddress(
lla.GetAddress());
591 entry->SetRouter(
true);
620 packet->CopyData(&type,
sizeof(type));
626 packet->RemoveHeader(
lla);
629 entry = cache->Lookup(src);
632 entry = cache->Add(src);
633 entry->SetRouter(
false);
636 else if (
entry->GetMacAddress() !=
lla.GetAddress())
660 for (
i = 0;
i <
nb;
i++)
662 ifaddr = interface->GetAddress(
i);
677 if (packet->GetUid() ==
ifaddr.GetNsDadUid())
697 packet->CopyData(&type,
sizeof(type));
712 if (packet->GetSize() == 0)
722 entry = cache->Lookup(src);
727 NS_LOG_LOGIC(
"Icmpv6L4Protocol::HandleNS: NS without SLLAO and we do not have a "
731 entry = cache->Add(src);
732 entry->SetRouter(
false);
758 if (ipv6->IsForwarding(ipv6->GetInterfaceForDevice(interface->GetDevice())))
765 target.IsLinkLocal() ? interface->GetLinkLocalAddress().GetAddress() :
ifaddr.GetAddress(),
766 src.
IsAny() ? dst : src,
773 pkt->AddHeader(p.second);
785 NS_LOG_LOGIC(
"Forge RS (from " << src <<
" to " << dst <<
")");
797 rs.CalculatePseudoHeaderChecksum(src, dst, p->GetSize() +
rs.GetSerializedSize(),
PROT_NUMBER);
803 ipHeader.SetPayloadLength(p->GetSize());
824 req.CalculatePseudoHeaderChecksum(src,
826 p->GetSize() +
req.GetSerializedSize(),
833 ipHeader.SetPayloadLength(p->GetSize());
855 std::list<NdiscCache::Ipv6PayloadHeaderPair>
waiting;
869 for (
i = 0;
i <
nb;
i++)
871 ifaddr = interface->GetAddress(
i);
896 packet->CopyData(&type,
sizeof(type));
902 packet->RemoveHeader(
lla);
905 entry->StopNudTimer();
906 switch (
entry->m_state)
910 entry->StopNudTimer();
916 entry->StartReachableTimer();
920 cache->GetInterface()->Send(
it->first,
it->second, src);
922 entry->ClearWaitingPacket();
931 entry->SetRouter(
true);
944 entry->SetMacAddress(
lla.GetAddress());
947 entry->StartReachableTimer();
949 else if (
lla.GetAddress() !=
entry->GetMacAddress())
962 entry->SetMacAddress(
lla.GetAddress());
965 entry->MarkReachable(
lla.GetAddress());
966 entry->StartReachableTimer();
968 else if (
lla.GetAddress() !=
entry->GetMacAddress())
979 entry->SetMacAddress(
lla.GetAddress());
985 cache->GetInterface()->Send(
it->first,
it->second, src);
987 entry->ClearWaitingPacket();
988 entry->StartReachableTimer();
990 else if (
lla.GetAddress() !=
entry->GetMacAddress())
1002 entry->SetMacAddress(
lla.GetAddress());
1003 if (
lla.GetAddress() !=
entry->GetMacAddress())
1031 p->CopyData(&type,
sizeof(type));
1085 ipv6->GetInterfaceForAddress(dst));
1089 uint32_t ifIndex = ipv6->GetInterfaceForAddress(dst);
1110 if (pkt->GetSize() >
ipHeader.GetSerializedSize())
1132 if (pkt->GetSize() >
ipHeader.GetSerializedSize())
1152 pkt->RemoveHeader(
tooBig);
1155 if (pkt->GetSize() >
ipHeader.GetSerializedSize())
1181 if (pkt->GetSize() >
ipHeader.GetSerializedSize())
1199 packet->AddPacketTag(
tag);
1221 NS_ASSERT(ipv6 && ipv6->GetRoutingProtocol());
1229 route = ipv6->GetRoutingProtocol()->RouteOutput(packet, header, oif,
err);
1235 packet->AddPacketTag(
tag);
1238 icmpv6Hdr.CalculatePseudoHeaderChecksum(src,
1240 packet->GetSize() +
icmpv6Hdr.GetSerializedSize(),
1259 NS_LOG_LOGIC(
"Send NA ( from " << src <<
" to " << dst <<
" target " << src <<
")");
1260 na.SetIpv6Target(src);
1276 na.CalculatePseudoHeaderChecksum(src, dst, p->GetSize() +
na.GetSerializedSize(),
PROT_NUMBER);
1300 p->AddHeader(reply);
1324 NS_LOG_LOGIC(
"Send NS ( from " << src <<
" to " << dst <<
" target " <<
target <<
")");
1335 NS_LOG_LOGIC(
"Destination is Multicast, using DelayedSendMessage");
1365 if (ipv6->GetInterfaceForAddress(src) == -1)
1367 NS_LOG_INFO(
"Preventing RS from being sent or rescheduled because the source address "
1368 << src <<
" has been removed");
1373 NS_LOG_LOGIC(
"Send RS (from " << src <<
" to " << dst <<
")");
1375 rs.CalculatePseudoHeaderChecksum(src, dst, p->GetSize() +
rs.GetSerializedSize(),
PROT_NUMBER);
1383 NS_LOG_LOGIC(
"Destination is Multicast, using DelayedSendMessage");
1430 NS_LOG_LOGIC(
"Maximum number of multicast RS reached, giving up.");
1438 NS_LOG_LOGIC(
"Maximum RS retransmission time reached, giving up.");
1622 NS_LOG_LOGIC(
"Send NA ( from " << src <<
" to " << dst <<
")");
1628 na.SetIpv6Target(src);
1643 na.CalculatePseudoHeaderChecksum(src, dst, p->GetSize() +
na.GetSerializedSize(),
PROT_NUMBER);
1649 ipHeader.SetPayloadLength(p->GetSize());
1669 NS_LOG_LOGIC(
"Send NS ( from " << src <<
" to " << dst <<
" target " <<
target <<
")");
1678 ipHeader.SetPayloadLength(p->GetSize());
1691 if ((*i)->GetDevice() == device)
1697 NS_ASSERT_MSG(
false,
"Icmpv6L4Protocol can not find a NDIS Cache for device " << device);
1709 cache->SetDevice(device, interface,
this);
1733 if (
entry->IsReachable() ||
entry->IsDelay() ||
entry->IsPermanent() ||
1734 entry->IsAutoGenerated())
1739 else if (
entry->IsStale())
1741 entry->StartDelayTimer();
1774 if (
entry->IsReachable() ||
entry->IsDelay() ||
entry->IsPermanent() ||
1775 entry->IsAutoGenerated())
1782 else if (
entry->IsStale())
1785 entry->StartDelayTimer();
1805 entry->SetRouter(
false);
1809 addr = cache->GetInterface()->GetLinkLocalAddress().GetAddress();
1811 else if (cache->GetInterface()->GetNAddresses() ==
1815 cache->Remove(
entry);
1821 addr = cache->GetInterface()->GetAddressMatchingDestination(dst).GetAddress();
1827 entry->StartRetransmitTimer();
1844 for (
i = 0;
i <
nb;
i++)
1848 if (
ifaddr.GetAddress() == addr)
1857 NS_LOG_LOGIC(
"Can not find the address in the interface.");
1874 if (!ipv6->IsForwarding(ipv6->GetInterfaceForDevice(interface->
GetDevice())) &&
1892 NS_LOG_LOGIC(
"Did not schedule a Router Solicitation because the interface is in "
a polymophic address class
AttributeValue implementation for Boolean.
void Nullify()
Discard the implementation, set it to null.
bool IsNull() const
Check for null implementation.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsPending() const
This method is syntactic sugar for !IsExpired().
ICMPv6 Error Destination Unreachable header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
void SetId(uint16_t id)
Set the ID of the packet.
void SetSeq(uint16_t seq)
Set the sequence number.
uint32_t GetSerializedSize() const override
Get the serialized size.
An implementation of the ICMPv6 protocol.
Time GetRetransmissionTime() const
Neighbor Discovery node constants: retransmission timer.
int GetProtocolNumber() const override
Get the protocol number.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void Forward(Ipv6Address source, Icmpv6Header icmp, uint32_t info, Ipv6Header ipHeader, const uint8_t payload[8])
Notify an ICMPv6 reception to upper layers (if requested).
void ReceiveLLA(Icmpv6OptionLinkLayerAddress lla, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Link layer address option processing.
void SendErrorTimeExceeded(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Time Exceeded.
IpL4Protocol::RxStatus Receive(Ptr< Packet > p, const Ipv4Header &header, Ptr< Ipv4Interface > interface) override
Receive method.
void DoDispose() override
Dispose this object.
void SendErrorTooBig(Ptr< Packet > malformedPacket, Ipv6Address dst, uint32_t mtu)
Send an error Too Big.
uint8_t m_maxMulticastSolicit
Neighbor Discovery node constants: max multicast solicitations.
void NotifyNewAggregate() override
This method is called by AggregateObject and completes the aggregation by setting the node in the ICM...
Time m_reachableTime
Neighbor Discovery node constants: reachable time.
NdiscCache::Ipv6PayloadHeaderPair ForgeEchoRequest(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Forge an Echo Request.
Time m_rsMaxRetransmissionTime
Maximum time between multicast RS retransmissions [RFC 7559].
uint32_t m_rsMaxRetransmissionCount
Maximum number of multicast RS retransmissions [RFC 7559].
ns3::TracedCallback< const Ipv6Address & > m_dadSuccessAddressTrace
The trace fired when a DAD completes and no duplicate address has been detected.
virtual Ptr< NdiscCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
Create a neighbor cache.
~Icmpv6L4Protocol() override
Destructor.
IpL4Protocol::DownTargetCallback6 GetDownTarget6() const override
This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 ca...
void SetDownTarget6(IpL4Protocol::DownTargetCallback6 cb) override
This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 ca...
uint32_t m_rsRetransmissionCount
Multicast RS retransmissions counter [RFC 7559].
void DelayedSendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Helper function used during delayed solicitation.
Ptr< Node > GetNode()
Get the node.
void HandleTimeExceeded(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Time Exceeded method.
void HandleDestinationUnreachable(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Destination Unreachable method.
void HandlePacketTooBig(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Packet Too Big method.
Callback< void, uint32_t > m_startDhcpv6
The DHCPv6 callback when the M flag is set in a Router Advertisement.
Ptr< UniformRandomVariable > m_rsRetransmissionJitter
Random jitter for RS retransmissions.
bool IsAlwaysDad() const
Is the node must do DAD.
void HandleRA(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Router Advertisement method.
void SetDownTarget(IpL4Protocol::DownTargetCallback cb) override
This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 ca...
void SendErrorParameterError(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code, uint32_t ptr)
Send an error Parameter Error.
Time GetDadTimeout() const
Get the DAD timeout.
Time GetDelayFirstProbe() const
Neighbor Discovery node constants : delay for the first probe.
NdiscCache::Ipv6PayloadHeaderPair ForgeNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Forge a Neighbor Advertisement.
void HandleRS(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Router Solicitation method.
virtual void FunctionDadTimeout(Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
uint8_t m_maxUnicastSolicit
Neighbor Discovery node constants: max unicast solicitations.
void SendRedirection(Ptr< Packet > redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget)
Send an ICMPv6 Redirection.
Time m_dadTimeout
DAD timeout.
Ptr< Node > m_node
The node.
IpL4Protocol::DownTargetCallback6 m_downTarget
callback to Ipv6::Send
Ptr< NdiscCache > FindCache(Ptr< NetDevice > device)
Get the cache corresponding to the device.
void DoDAD(Ipv6Address target, Ptr< Ipv6Interface > interface)
Do the Duplication Address Detection (DAD).
virtual void HandleRsTimeout(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Router Solicitation Timeout handler.
bool m_alwaysDad
Always do DAD ?
void SendErrorDestinationUnreachable(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Destination Unreachable.
static const uint8_t PROT_NUMBER
ICMPv6 protocol number (58).
ns3::TracedCallback< const Ipv6Address & > m_dadFailureAddressTrace
The trace fired when a DAD fails, changing the address state to INVALID.
virtual void SendNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Send a Neighbor Solicitation.
void SendRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Send a Router Solicitation.
Time m_retransmissionTime
Neighbor Discovery node constants: retransmission timer.
uint8_t GetMaxUnicastSolicit() const
Neighbor Discovery node constants: max unicast solicitations.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void HandleEchoRequest(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Echo Request method.
void HandleParameterError(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Parameter Error method.
void HandleNS(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Solicitation method.
Time m_rsMaxRetransmissionDuration
Maximum duration of multicast RS retransmissions [RFC 7559].
void HandleRedirection(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Redirection method.
virtual bool Lookup(Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
Lookup in the ND cache for the IPv6 address.
Time m_rsPrevRetransmissionTimeout
Previous multicast RS retransmissions timeout [RFC 7559].
IpL4Protocol::DownTargetCallback GetDownTarget() const override
This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 ca...
EventId m_handleRsTimeoutEvent
RS timeout handler event.
virtual int GetVersion() const
Get the version of the protocol.
Ptr< RandomVariableStream > m_solicitationJitter
Random jitter before sending solicitations.
void SendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Send a packet via ICMPv6, note that packet already contains ICMPv6 header.
Time m_delayFirstProbe
Neighbor Discovery node constants: delay for the first probe.
Icmpv6L4Protocol()
Constructor.
void SendEchoReply(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Send a Echo Reply.
NdiscCache::Ipv6PayloadHeaderPair ForgeRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Forge a Router Solicitation.
NdiscCache::Ipv6PayloadHeaderPair ForgeNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Forge a Neighbor Solicitation.
void SendNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Send a Neighbor Advertisement.
Time m_rsInitialRetransmissionTime
Initial multicast RS retransmission time [RFC 7559].
static TypeId GetTypeId()
Get the type ID.
Time GetReachableTime() const
Neighbor Discovery node constants: reachable time.
CacheList m_cacheList
A list of cache by device.
uint8_t GetMaxMulticastSolicit() const
Neighbor Discovery node constants: max multicast solicitations.
void SetNode(Ptr< Node > node)
Set the node.
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
void HandleNA(Ptr< Packet > p, const Ipv6Address &src, const Ipv6Address &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Advertisement method.
ICMPv6 Neighbor Advertisement header.
ICMPv6 Neighbor Solicitation header.
uint32_t GetSerializedSize() const override
Get the serialized size.
ICMPv6 link-layer address option.
ICMPv6 redirected option.
ICMPv6 Error Parameter Error header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
void SetPtr(uint32_t ptr)
Set the pointer field.
ICMPv6 Router Advertisement header.
ICMPv6 Router Solicitation header.
ICMPv6 Redirection header.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
ICMPv6 Error Time Exceeded header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
ICMPv6 Error Too Big header.
void SetMtu(uint32_t mtu)
Set the MTU.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
Hold a signed integer type.
L4 Protocol abstract base class.
Callback< void, Ptr< Packet >, Ipv4Address, Ipv4Address, uint8_t, Ptr< Ipv4Route > > DownTargetCallback
callback to send packets over IPv4
Describes an IPv6 address.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
bool IsAny() const
If the IPv6 address is the "Any" address.
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.
Access to the IPv6 forwarding table, interfaces, and configuration.
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.
IPv6 address associated with an interface.
@ PREFERRED
Preferred address.
@ TENTATIVE_OPTIMISTIC
Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished.
@ INVALID
Invalid state (after a DAD failed)
@ TENTATIVE
Address is tentative, no packet can be sent unless DAD finished.
The IPv6 representation of a network interface.
uint32_t GetNAddresses() const
Get number of addresses on this IPv6 interface.
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
void Send(Ptr< Packet > p, const Ipv6Header &hdr, Ipv6Address dest)
Send a packet through this interface.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
IPv6 layer implementation.
static constexpr uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Describes an IPv6 prefix.
A record that holds information about a NdiscCache entry.
@ PROBE
Try to contact IPv6 address to know again its L2 address.
@ REACHABLE
Mapping exists between IPv6 and L2 addresses.
@ PERMANENT
Permanent Mapping exists between IPv6 and L2 addresses.
@ DELAY
Try to wait contact from remote host.
@ INCOMPLETE
No mapping between IPv6 and L2 addresses.
@ STATIC_AUTOGENERATED
Permanent entries generate by NeighborCacheHelper.
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv4 header.
void Flush()
Flush the cache.
virtual void NotifyNewAggregate()
Notify all Objects aggregated to this one of a new Object being aggregated.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
virtual void DoDispose()
Destructor implementation.
Smart pointer class similar to boost::intrusive_ptr.
virtual double GetValue()=0
Get the next random value drawn from the distribution.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
SocketErrno
Enumeration of the possible errors returned by a socket.
This class implements a tag that carries the socket-specific HOPLIMIT of a packet to the IPv6 layer.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
bool IsZero() const
Exactly equivalent to t == 0.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)