25 #include "ns3/assert.h"
26 #include "ns3/packet.h"
28 #include "ns3/boolean.h"
29 #include "ns3/ipv6-routing-protocol.h"
30 #include "ns3/ipv6-route.h"
31 #include "ns3/pointer.h"
32 #include "ns3/string.h"
74 .AddConstructor<Icmpv6L4Protocol> ()
75 .AddAttribute (
"DAD",
"Always do DAD check.",
78 MakeBooleanChecker ())
79 .AddAttribute (
"SolicitationJitter",
"The jitter in ms a node is allowed to wait before sending any solicitation . Some jitter aims to prevent collisions. By default, the model will wait for a duration in ms defined by a uniform random-variable between 0 and SolicitationJitter",
80 StringValue (
"ns3::UniformRandomVariable[Min=0.0|Max=10.0]"),
82 MakePointerChecker<RandomVariableStream> ())
127 Ptr<Node> node = this->GetObject<Node> ();
136 ipv6->AggregateObject (rawFactory);
210 p->CopyData (&type,
sizeof(type));
215 if (ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())))
221 if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())))
265 const uint8_t payload[8])
267 NS_LOG_FUNCTION (
this << source << icmp << info << ipHeader << payload);
287 uint8_t* buf =
new uint8_t[packet->
GetSize ()];
329 ipv6->AddAutoconfiguredAddress (ipv6->GetInterfaceForDevice (interface->
GetDevice ()), prefixHdr.GetPrefix (), prefixHdr.GetPrefixLength (),
330 prefixHdr.GetFlags (), prefixHdr.GetValidTime (), prefixHdr.GetPreferredTime (), defaultRouter);
366 entry = cache->
Lookup (src);
370 entry = cache->
Add (src);
373 entry->MarkReachable ();
374 entry->StartReachableTimer ();
378 std::list<Ptr<Packet> > waiting;
379 if (entry->IsIncomplete ())
381 entry->StopRetransmitTimer ();
383 waiting = entry->MarkReachable (lla.
GetAddress ());
384 entry->StopReachableTimer ();
385 entry->StartReachableTimer ();
391 entry->ClearWaitingPacket ();
395 if (entry->GetMacAddress () != lla.
GetAddress ())
399 entry->SetRouter (
true);
403 if (!entry->IsReachable ())
405 entry->StopProbeTimer ();
406 entry->StopDelayTimer ();
407 waiting = entry->MarkReachable (lla.
GetAddress ());
408 if (entry->IsProbe ())
415 entry->StopReachableTimer ();
416 entry->StartReachableTimer ();
439 packet->
CopyData (&type,
sizeof(type));
448 entry = cache->
Lookup (src);
451 entry = cache->
Add (src);
475 for (i = 0; i < nb; i++)
510 packet->
CopyData (&type,
sizeof(type));
520 entry = cache->
Lookup (src);
523 entry = cache->
Add (src);
543 if (ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())))
548 hardwareAddress = interface->
GetDevice ()->GetAddress ();
563 NS_LOG_LOGIC (
"Send RS ( from " << src <<
" to " << dst <<
")");
569 ipHeader.SetSourceAddress (src);
570 ipHeader.SetDestinationAddress (dst);
572 ipHeader.SetPayloadLength (p->
GetSize ());
573 ipHeader.SetHopLimit (255);
607 std::list<Ptr<Packet> > waiting;
610 entry = cache->
Lookup (target);
621 for (i = 0; i < nb; i++)
646 packet->
CopyData (&type,
sizeof(type));
765 entry = cache->
Lookup (redirTarget);
768 entry = cache->
Add (redirTarget);
771 entry->SetMacAddress (llOptionHeader.
GetAddress ());
776 if (entry->IsIncomplete () || entry->GetMacAddress () != llOptionHeader.
GetAddress ())
779 if (entry->GetMacAddress () != llOptionHeader.
GetAddress ())
781 entry->SetMacAddress (llOptionHeader.
GetAddress ());
795 if (redirTarget.
IsEqual (redirDestination))
797 ipv6->GetRoutingProtocol ()->NotifyAddRoute (redirDestination,
Ipv6Prefix (128),
Ipv6Address (
"::"), ipv6->GetInterfaceForAddress (dst));
801 uint32_t ifIndex = ipv6->GetInterfaceForAddress (dst);
802 ipv6->GetRoutingProtocol ()->NotifyAddRoute (redirDestination,
Ipv6Prefix (128), redirTarget, ifIndex);
838 Forward (src, timeexceeded, timeexceeded.
GetCode (), ipHeader, payload);
899 NS_ASSERT (ipv6 != 0 && ipv6->GetRoutingProtocol () != 0);
906 header.SetDestinationAddress (dst);
907 route = ipv6->GetRoutingProtocol ()->RouteOutput (packet, header, oif, err);
928 NS_LOG_FUNCTION (
this << src << dst << hardwareAddress << static_cast<uint32_t> (flags));
933 NS_LOG_LOGIC (
"Send NA ( from " << src <<
" to " << dst <<
" target " << src <<
")");
934 na.SetIpv6Target (src);
950 na.CalculatePseudoHeaderChecksum (src, dst, p->
GetSize () + na.GetSerializedSize (),
PROT_NUMBER);
984 NS_LOG_LOGIC (
"Send NS ( from " << src <<
" to " << dst <<
" target " << target <<
")");
987 ns.CalculatePseudoHeaderChecksum (src, dst, p->
GetSize () + ns.GetSerializedSize (),
PROT_NUMBER);
995 NS_LOG_LOGIC (
"Destination is Multicast, using DelayedSendMessage");
1013 NS_LOG_LOGIC (
"Send RS ( from " << src <<
" to " << dst <<
")");
1015 rs.CalculatePseudoHeaderChecksum (src, dst, p->
GetSize () + rs.GetSerializedSize (),
PROT_NUMBER);
1023 NS_LOG_LOGIC (
"Destination is Multicast, using DelayedSendMessage");
1032 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1035 NS_LOG_LOGIC (
"Send Destination Unreachable ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1038 if (malformedPacketSize <= 1280 - 48)
1056 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1062 if (malformedPacketSize <= 1280 - 48)
1079 NS_LOG_FUNCTION (
this << malformedPacket << dst << static_cast<uint32_t> (code));
1081 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1084 NS_LOG_LOGIC (
"Send Time Exceeded ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1087 if (malformedPacketSize <= 1280 - 48)
1103 NS_LOG_FUNCTION (
this << malformedPacket << dst << static_cast<uint32_t> (code) << ptr);
1105 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1108 NS_LOG_LOGIC (
"Send Parameter Error ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1111 if (malformedPacketSize <= 1280 - 48 )
1128 NS_LOG_FUNCTION (
this << redirectedPacket << dst << redirTarget << redirDestination << redirHardwareTarget);
1129 uint32_t llaSize = 0;
1131 uint32_t redirectedPacketSize = redirectedPacket->
GetSize ();
1134 NS_LOG_LOGIC (
"Send Redirection ( to " << dst <<
" target " << redirTarget <<
" destination " << redirDestination <<
" )");
1138 if ((redirectedPacketSize % 8) != 0)
1140 Ptr<Packet> pad = Create<Packet> (8 - (redirectedPacketSize % 8));
1151 if (redirectedPacketSize <= (1280 - 56 - llaSize))
1153 redirectedOptionHeader.
SetPacket (redirectedPacket);
1158 redirectedOptionHeader.
SetPacket (fragment);
1169 redirectionHeader.
SetTarget (redirTarget);
1179 NS_LOG_FUNCTION (
this << src << dst << hardwareAddress << (uint32_t)flags);
1185 NS_LOG_LOGIC (
"Send NA ( from " << src <<
" to " << dst <<
")");
1208 ipHeader.SetSourceAddress (src);
1209 ipHeader.SetDestinationAddress (dst);
1211 ipHeader.SetPayloadLength (p->
GetSize ());
1212 ipHeader.SetHopLimit (255);
1233 NS_LOG_LOGIC (
"Send NS ( from " << src <<
" to " << dst <<
" target " << target <<
")");
1239 ipHeader.SetSourceAddress (src);
1240 ipHeader.SetDestinationAddress (dst);
1242 ipHeader.SetPayloadLength (p->
GetSize ());
1243 ipHeader.SetHopLimit (255);
1256 if ((*i)->GetDevice () == device)
1281 NS_LOG_FUNCTION (
this << dst << device << cache << hardwareDestination);
1312 NS_LOG_FUNCTION (
this << p << dst << device << cache << hardwareDestination);
1394 for (i = 0; i < nb; i++)
1418 if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())) && addr.
IsLinkLocal ())
void DelayedSendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Helper function used during delayed solicitation.
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.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
Doxygen introspection did not find any typical Config paths.
uint16_t GetId() const
Get the ID of the packet.
static const uint8_t MAX_ANYCAST_DELAY_TIME
Neighbor Discovery node constants : max anycast delay.
uint32_t GetNsDadUid() const
Get the latest DAD probe packet UID.
keep track of time values and allow control of global simulation resolution
bool Lookup(Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
Lookup in the ND cache for the IPv6 address.
#define NS_LOG_FUNCTION(parameters)
void MarkIncomplete(Ptr< Packet > p)
Changes the state to this entry to INCOMPLETE.
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
Doxygen introspection did not find any typical Config paths.
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
Doxygen introspection did not find any typical Config paths.
Doxygen introspection did not find any typical Config paths.
void SendNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Send a Neighbor Adverstisement.
void HandleNS(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Solicitation method.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
Address GetMacAddress() const
Get the MAC address of this entry.
NdiscCache::Entry * Add(Ipv6Address to)
Add an entry.
static const uint8_t MAX_INITIAL_RTR_ADVERTISEMENTS
Neighbor Discovery router constants : max initial RA transmission.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
Ipv6Address GetTarget() const
Get the IPv6 target address.
Access to the IPv6 forwarding table, interfaces, and configuration.
hold variables of type string
virtual uint32_t GetSerializedSize() const
Get the serialized size.
static const uint8_t MAX_FINAL_RTR_ADVERTISEMENTS
Neighbor Discovery router constants : max final RA transmission.
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...
Doxygen introspection did not find any typical Config paths.
IPv6 layer implementation.
Ptr< Node > m_node
The node.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Doxygen introspection did not find any typical Config paths.
void SendRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Send a Router Solicitation.
Doxygen introspection did not find any typical Config paths.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
uint64_t GetUid(void) const
A packet is allocated a new uid when it is created empty or with zero-filled payload.
bool IsNull(void) const
Check for null implementation.
#define NS_ASSERT(condition)
virtual void ReceiveIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv4Address payloadSource, Ipv4Address payloadDestination, const uint8_t payload[8])
Called from lower-level layers to send the ICMP packet up in the stack.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
IPv6 address associated with an interface.
void SetPtr(uint32_t ptr)
Set the pointer field.
static const uint8_t PROT_NUMBER
ICMPv6 protocol number (58).
virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6(void) const
This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 ca...
bool GetFlagS() const
Get the S flag.
uint32_t GetSize(void) const
Invalid state (after a DAD failed)
bool IsEqual(const Ipv6Address &other) const
Comparison operation between two Ipv6Addresses.
virtual ~Icmpv6L4Protocol()
Destructor.
static const uint8_t RTR_SOLICITATION_INTERVAL
Neighbor Discovery host constants : RS interval.
void StopReachableTimer()
Stop the reachable timer.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
static const uint8_t MAX_RTR_SOLICITATIONS
Neighbor Discovery host constants : max RS transmission.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void SetMtu(uint32_t mtu)
Set the MTU.
void SetNode(Ptr< Node > node)
Set the node.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer...
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
SocketErrno
Enumeration of the possible errors returned by a socket.
virtual int GetProtocolNumber() const
Get the protocol number.
std::list< Ptr< Packet > > MarkReachable(Address mac)
Changes the state to this entry to REACHABLE.
Icmpv6L4Protocol()
Constructor.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
virtual double GetValue(void)=0
Returns a random double from the underlying distribution.
a polymophic address class
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
static void FunctionDadTimeout(Ptr< Icmpv6L4Protocol > icmpv6, Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
virtual enum IpL4Protocol::RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > interface)
Receive method.
void SendErrorTooBig(Ptr< Packet > malformedPacket, Ipv6Address dst, uint32_t mtu)
Send an error Too Big.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Ptr< Ipv6Interface > GetInterface() const
Get the Ipv6Interface associated with this cache.
void NotifyNewAggregate()
This method is called by AddAgregate and completes the aggregation by setting the node in the ICMPv6 ...
bool IsDelay() const
Is the entry DELAY.
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
bool GetFlagR() const
Get the R flag.
The IPv6 representation of a network interface.
Doxygen introspection did not find any typical Config paths.
void HandleRedirection(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Redirection method.
Ipv6Address GetAddress() const
Get the IPv6 address.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
static const uint32_t MAX_RA_DELAY_TIME
Neighbor Discovery router constants : max delay between RA.
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 SendErrorParameterError(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code, uint32_t ptr)
Send an error Parameter Error.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
void SetTtl(uint8_t ttl)
Set the tag's TTL.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
void HandleTimeExceeded(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Time Exceeded method.
void Flush()
Flush the cache.
void SendErrorTimeExceeded(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Time Exceeded.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
bool IsAlwaysDad() const
Is the node must do DAD.
T * PeekPointer(const Ptr< T > &p)
uint8_t GetLength(void) const
static const uint32_t REACHABLE_TIME
Neighbor Discovery node constants : reachable time.
Doxygen introspection did not find any typical Config paths.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
static const double MIN_RANDOM_FACTOR
Neighbor Discovery node constants : min random factor.
Ptr< NdiscCache > FindCache(Ptr< NetDevice > device)
Get the cache corresponding to the device.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
Ptr< Packet > ForgeNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Forge a Neighbor Advertisement.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
Ptr< RandomVariableStream > m_solicitationJitter
Random jitter before sending solicitations.
bool GetFlagO() const
Get the O flag.
void HandleRS(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Router Solicitation method.
void Send(Ptr< Packet > p, Ipv6Address dest)
Send a packet through this interface.
#define NS_LOG_LOGIC(msg)
void StopProbeTimer()
Stop probe timer.
Ptr< Packet > ForgeNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Forge a Neighbor Solicitation.
void StartRetransmitTimer()
Start retransmit timer.
uint16_t GetSeq() const
Get the sequence number.
void SetNsDadUid(Ipv6Address address, uint32_t uid)
Update NS DAD packet UID of an interface address.
void ClearWaitingPacket()
Clear the waiting packet list.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void HandleEchoRequest(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Echo Request method.
void HandleParameterError(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Parameter Error method.
virtual void NotifyNewAggregate(void)
This method is invoked whenever two sets of objects are aggregated together.
Ptr< Packet > Copy(void) const
static const uint8_t MAX_MULTICAST_SOLICIT
Neighbor Discovery node constants : max multicast solicitations.
bool IsProbe() const
Is the entry PROBE.
void SendErrorDestinationUnreachable(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Destination Unreachable.
void SendEchoReply(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Send a Echo Reply.
static TypeId GetTypeId()
Interface ID.
static const uint8_t MAX_NEIGHBOR_ADVERTISEMENT
Neighbor Discovery node constants : max NA transmission.
virtual IpL4Protocol::DownTargetCallback GetDownTarget(void) const
This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 ca...
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
Ipv6InterfaceAddress::State_e GetState() const
Get the address state.
Doxygen introspection did not find any typical Config paths.
void AddWaitingPacket(Ptr< Packet > p)
Add a packet (or replace old value) in the queue.
void StartDelayTimer()
Start delay timer.
IpL4Protocol::DownTargetCallback6 m_downTarget
callback to Ipv6::Send
static const uint8_t MAX_INITIAL_RTR_ADVERT_INTERVAL
Neighbor Discovery router constants : max initial RA initial interval.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address.
void StartReachableTimer()
Start the reachable timer.
bool m_alwaysDad
Always do DAD ?
bool IsIncomplete() const
Is the entry INCOMPLETE.
L4 Protocol abstract base class.
void SendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Send a packet via ICMPv6, note that packet already contains ICMPv6 header.
virtual void SetDownTarget(IpL4Protocol::DownTargetCallback cb)
This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 ca...
Ptr< Packet > ForgeRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Forge a Router Solicitation.
void Remove(NdiscCache::Entry *entry)
Delete an entry.
static const uint8_t MIN_DELAY_BETWEEN_RAS
Neighbor Discovery router constants : min delay between RA.
void SetFlagR(bool r)
Set the R flag.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SendRedirection(Ptr< Packet > redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget)
Send an ICMPv6 Redirection.
std::list< Ptr< Packet > > MarkStale(Address mac)
Changes the state to this entry to STALE.
void SetMacAddress(Address mac)
Set the MAC address of this entry.
static const double MAX_RANDOM_FACTOR
Neighbor Discovery node constants : max random factor.
Doxygen introspection did not find any typical Config paths.
void SetFlagS(bool s)
Set the S flag.
CacheList m_cacheList
A list of cache by device.
void DoDAD(Ipv6Address target, Ptr< Ipv6Interface > interface)
Do the Duplication Address Detection (DAD).
virtual void SetDownTarget6(IpL4Protocol::DownTargetCallback6 cb)
This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 ca...
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
Describes an IPv6 address.
NdiscCache::Entry * Lookup(Ipv6Address dst)
Lookup in the cache.
void HandleRA(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Router Advertisement method.
void ReceiveLLA(Icmpv6OptionLinkLayerAddress lla, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Link layer address option processing.
void MarkDelay()
Change the state to this entry to DELAY.
virtual int GetVersion() const
Get the version of the protocol.
uint32_t GetSerializedSize(void) const
static const uint32_t RETRANS_TIMER
Neighbor Discovery node constants : retransmission timer.
void SetDestination(Ipv6Address destination)
Set the IPv6 destination address.
void StopRetransmitTimer()
Stop retransmit timer.
Ptr< Packet > ForgeEchoRequest(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Forge an Echo Request.
void StopDelayTimer()
Stop delay timer.
void SetDevice(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
Set the device and interface.
Describes an IPv6 prefix.
virtual void DoDispose()
Dispose this object.
void Nullify(void)
Discard the implementation, set it to null.
Ipv6Address GetDestination() const
Get the IPv6 destination address.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
static const uint8_t MAX_RTR_SOLICITATION_DELAY
Neighbor Discovery host constants : max RS delay.
A record that holds information about an NdiscCache entry.
Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished...
void HandleNA(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Advertisement method.
void SetRouter(bool router)
Set the node type.
Doxygen introspection did not find any typical Config paths.
static const uint8_t DELAY_FIRST_PROBE_TIME
Neighbor Discovery node constants : delay for the first probe.
void SetSeq(uint16_t seq)
Set the sequence number.
Address GetAddress() const
Get the hardware address.
void HandlePacketTooBig(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Packet Too Big method.
bool IsReachable() const
Is the entry REACHABLE.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t GetMtu() const
Get the MTU field.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
Ptr< T > GetObject(void) const
Doxygen introspection did not find any typical Config paths.
a unique identifier for an interface.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
Ipv6InterfaceAddress GetAddressMatchingDestination(Ipv6Address dst)
Get an address which is in the same network prefix as destination.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetFlagO(bool o)
Set the O flag.
Ptr< NetDevice > GetDevice() const
Get the NetDevice associated with this cache.
TypeId SetParent(TypeId tid)
void Dispose(void)
Run the DoDispose methods of this object and all the objects aggregated to it.
void SendNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Send a Neighbor Solicitation.
Address is tentative, no packet can be sent unless DAD finished.
bool IsStale() const
Is the entry STALE.
void AddHeader(const Header &header)
Add header to this packet.
Ptr< NdiscCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
Create a neighbor cache.
void SetId(uint16_t id)
Set the ID of the packet.
void HandleDestinationUnreachable(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Destination Unreachable method.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.
void SetAddress(Address addr)
Set the hardware address.
static const uint8_t MAX_UNICAST_SOLICIT
Neighbor Discovery node constants : max unicast solicitations.