A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
icmpv6-l4-protocol.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2009 Strasbourg University
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7 * David Gross <gdavid.devel@gmail.com>
8 * Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
9 */
10
11#ifndef ICMPV6_L4_PROTOCOL_H
12#define ICMPV6_L4_PROTOCOL_H
13
14#include "icmpv6-header.h"
15#include "ip-l4-protocol.h"
16#include "ndisc-cache.h"
17
18#include "ns3/ipv6-address.h"
19#include "ns3/random-variable-stream.h"
20#include "ns3/traced-callback.h"
21
22#include <list>
23
24namespace ns3
25{
26
27class NetDevice;
28class Node;
29class Packet;
30class TraceContext;
31
32/**
33 * \ingroup ipv6
34 * \defgroup icmpv6 ICMPv6 protocol and associated headers.
35 */
36
37/**
38 * \ingroup icmpv6
39 *
40 * \brief An implementation of the ICMPv6 protocol.
41 */
43{
44 public:
45 /**
46 * \brief Get the type ID.
47 * \return the object TypeId
48 */
49 static TypeId GetTypeId();
50 TypeId GetInstanceTypeId() const override;
51
52 /**
53 * \brief ICMPv6 protocol number (58).
54 */
55 static const uint8_t PROT_NUMBER;
56
57 /**
58 * \brief Neighbor Discovery node constants: max multicast solicitations.
59 * \returns The max multicast solicitations number.
60 */
61 uint8_t GetMaxMulticastSolicit() const;
62
63 /**
64 * \brief Neighbor Discovery node constants: max unicast solicitations.
65 * \returns The max unicast solicitations number.
66 */
67 uint8_t GetMaxUnicastSolicit() const;
68
69 /**
70 * \brief Neighbor Discovery node constants: reachable time.
71 * \returns The Reachable time for an Neighbor cache entry.
72 */
73 Time GetReachableTime() const;
74
75 /**
76 * \brief Neighbor Discovery node constants: retransmission timer.
77 * \returns The Retransmission time for an Neighbor cache entry probe.
78 */
80
81 /**
82 * \brief Neighbor Discovery node constants : delay for the first probe.
83 * \returns The time before a first probe for an Neighbor cache entry.
84 */
86
87 /**
88 * \brief Get ICMPv6 protocol number.
89 * \return protocol number
90 */
91 static uint16_t GetStaticProtocolNumber();
92
93 /**
94 * \brief Constructor.
95 */
97
98 /**
99 * \brief Destructor.
100 */
101 ~Icmpv6L4Protocol() override;
102
103 /**
104 * \brief Set the node.
105 * \param node the node to set
106 */
107 void SetNode(Ptr<Node> node);
108
109 /**
110 * \brief Get the node.
111 * \return node
112 */
114
115 /**
116 * \brief This method is called by AggregateObject and completes the aggregation
117 * by setting the node in the ICMPv6 stack and adding ICMPv6 factory to
118 * IPv6 stack connected to the node.
119 */
120 void NotifyNewAggregate() override;
121
122 /**
123 * \brief Get the protocol number.
124 * \return protocol number
125 */
126 int GetProtocolNumber() const override;
127
128 /**
129 * \brief Get the version of the protocol.
130 * \return version
131 */
132 virtual int GetVersion() const;
133
134 /**
135 * \brief Send a packet via ICMPv6, note that packet already contains ICMPv6 header.
136 * \param packet the packet to send which contains ICMPv6 header
137 * \param src source address
138 * \param dst destination address
139 * \param ttl next hop limit
140 */
141 void SendMessage(Ptr<Packet> packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl);
142
143 /**
144 * \brief Helper function used during delayed solicitation. Calls SendMessage internally
145 * \param packet the packet to send which contains ICMPv6 header
146 * \param src source address
147 * \param dst destination address
148 * \param ttl next hop limit
149 */
150 void DelayedSendMessage(Ptr<Packet> packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl);
151
152 /**
153 * \brief Send a packet via ICMPv6.
154 * \param packet the packet to send
155 * \param dst destination address
156 * \param icmpv6Hdr ICMPv6 header (needed to calculate checksum
157 * after source address is determined by routing stuff
158 * \param ttl next hop limit
159 */
160 void SendMessage(Ptr<Packet> packet, Ipv6Address dst, Icmpv6Header& icmpv6Hdr, uint8_t ttl);
161
162 /**
163 * \brief Do the Duplication Address Detection (DAD).
164 * It consists in sending a NS with our IPv6 as target. If
165 * we received a NA with matched target address, we could not use
166 * the address, else the address pass from TENTATIVE to PERMANENT.
167 *
168 * \param target target address
169 * \param interface interface
170 */
171 void DoDAD(Ipv6Address target, Ptr<Ipv6Interface> interface);
172
173 /**
174 * \brief Send a Neighbor Advertisement.
175 * \param src source IPv6 address
176 * \param dst destination IPv6 address
177 * \param hardwareAddress our MAC address
178 * \param flags to set (4 = flag R, 2 = flag S, 3 = flag O)
179 */
180 void SendNA(Ipv6Address src, Ipv6Address dst, Address* hardwareAddress, uint8_t flags);
181
182 /**
183 * \brief Send a Echo Reply.
184 * \param src source IPv6 address
185 * \param dst destination IPv6 address
186 * \param id id of the packet
187 * \param seq sequence number
188 * \param data auxiliary data
189 */
190 void SendEchoReply(Ipv6Address src,
191 Ipv6Address dst,
192 uint16_t id,
193 uint16_t seq,
195
196 /**
197 * \brief Send a Neighbor Solicitation.
198 * \param src source IPv6 address
199 * \param dst destination IPv6 address
200 * \param target target IPv6 address
201 * \param hardwareAddress our mac address
202 */
203 virtual void SendNS(Ipv6Address src,
204 Ipv6Address dst,
205 Ipv6Address target,
206 Address hardwareAddress);
207
208 /**
209 * \brief Send an error Destination Unreachable.
210 * \param malformedPacket the malformed packet
211 * \param dst destination IPv6 address
212 * \param code code of the error
213 */
214 void SendErrorDestinationUnreachable(Ptr<Packet> malformedPacket,
215 Ipv6Address dst,
216 uint8_t code);
217
218 /**
219 * \brief Send an error Too Big.
220 * \param malformedPacket the malformed packet
221 * \param dst destination IPv6 address
222 * \param mtu the mtu
223 */
224 void SendErrorTooBig(Ptr<Packet> malformedPacket, Ipv6Address dst, uint32_t mtu);
225
226 /**
227 * \brief Send an error Time Exceeded.
228 * \param malformedPacket the malformed packet
229 * \param dst destination IPv6 address
230 * \param code code of the error
231 */
232 void SendErrorTimeExceeded(Ptr<Packet> malformedPacket, Ipv6Address dst, uint8_t code);
233
234 /**
235 * \brief Send an error Parameter Error.
236 * \param malformedPacket the malformed packet
237 * \param dst destination IPv6 address
238 * \param code code of the error
239 * \param ptr byte of p where the error is located
240 */
241 void SendErrorParameterError(Ptr<Packet> malformedPacket,
242 Ipv6Address dst,
243 uint8_t code,
244 uint32_t ptr);
245
246 /**
247 * \brief Send an ICMPv6 Redirection.
248 * \param redirectedPacket the redirected packet
249 * \param src IPv6 address to send the redirect from
250 * \param dst IPv6 address to send the redirect to
251 * \param redirTarget IPv6 target address for Icmpv6Redirection
252 * \param redirDestination IPv6 destination address for Icmpv6Redirection
253 * \param redirHardwareTarget L2 target address for Icmpv6OptionRdirected
254 */
255 void SendRedirection(Ptr<Packet> redirectedPacket,
256 Ipv6Address src,
257 Ipv6Address dst,
258 Ipv6Address redirTarget,
259 Ipv6Address redirDestination,
260 Address redirHardwareTarget);
261
262 /**
263 * \brief Forge a Neighbor Solicitation.
264 * \param src source IPv6 address
265 * \param dst destination IPv6 address
266 * \param target target IPv6 address
267 * \param hardwareAddress our mac address
268 * \return NS packet (with IPv6 header)
269 */
271 Ipv6Address dst,
272 Ipv6Address target,
273 Address hardwareAddress);
274
275 /**
276 * \brief Forge a Neighbor Advertisement.
277 * \param src source IPv6 address
278 * \param dst destination IPv6 address
279 * \param hardwareAddress our mac address
280 * \param flags flags (bitfield => R (4), S (2), O (1))
281 * \return NA packet (with IPv6 header)
282 */
284 Ipv6Address dst,
285 Address* hardwareAddress,
286 uint8_t flags);
287
288 /**
289 * \brief Forge a Router Solicitation.
290 * \param src source IPv6 address
291 * \param dst destination IPv6 address
292 * \param hardwareAddress our mac address
293 * \return RS packet (with IPv6 header)
294 */
296 Ipv6Address dst,
297 Address hardwareAddress);
298
299 /**
300 * \brief Forge an Echo Request.
301 * \param src source address
302 * \param dst destination address
303 * \param id ID of the packet
304 * \param seq sequence number
305 * \param data the data
306 * \return Echo Request packet (with IPv6 header)
307 */
309 Ipv6Address dst,
310 uint16_t id,
311 uint16_t seq,
313
314 /**
315 * \brief Receive method.
316 * \param p the packet
317 * \param header the IPv4 header
318 * \param interface the interface from which the packet is coming
319 * \returns the receive status
320 */
322 const Ipv4Header& header,
323 Ptr<Ipv4Interface> interface) override;
324
325 /**
326 * \brief Receive method.
327 * \param p the packet
328 * \param header the IPv6 header
329 * \param interface the interface from which the packet is coming
330 * \returns the receive status
331 */
333 const Ipv6Header& header,
334 Ptr<Ipv6Interface> interface) override;
335
336 /**
337 * \brief Function called when DAD timeout.
338 * \param interface the interface
339 * \param addr the IPv6 address
340 */
341 virtual void FunctionDadTimeout(Ipv6Interface* interface, Ipv6Address addr);
342
343 /**
344 * \brief Lookup in the ND cache for the IPv6 address
345 *
346 * \note Unlike other Lookup method, it does not send NS request!
347 *
348 * \param dst destination address
349 * \param device device
350 * \param cache the neighbor cache
351 * \param hardwareDestination hardware address
352 * \return true if the address is in the ND cache, the hardwareDestination is updated.
353 */
354 virtual bool Lookup(Ipv6Address dst,
355 Ptr<NetDevice> device,
356 Ptr<NdiscCache> cache,
357 Address* hardwareDestination);
358
359 /**
360 * \brief Lookup in the ND cache for the IPv6 address (similar as ARP protocol).
361 *
362 * It also send NS request to target and store the waiting packet.
363 * \param p the packet
364 * \param ipHeader IPv6 header
365 * \param dst destination address
366 * \param device device
367 * \param cache the neighbor cache
368 * \param hardwareDestination hardware address
369 * \return true if the address is in the ND cache, the hardwareDestination is updated.
370 */
371 virtual bool Lookup(Ptr<Packet> p,
372 const Ipv6Header& ipHeader,
373 Ipv6Address dst,
374 Ptr<NetDevice> device,
375 Ptr<NdiscCache> cache,
376 Address* hardwareDestination);
377
378 /**
379 * \brief Send a Router Solicitation.
380 * \param src link-local source address
381 * \param dst destination address (usually ff02::2 i.e., all-routers)
382 * \param hardwareAddress link-layer address (SHOULD be included if src is not ::)
383 */
384 void SendRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress);
385
386 /**
387 * \brief Create a neighbor cache.
388 * \param device the NetDevice
389 * \param interface the IPv6 interface
390 * \return a smart pointer of NdCache or 0 if problem
391 */
393
394 /**
395 * \brief Is the node must do DAD.
396 * \return true if node has to do DAD.
397 */
398 bool IsAlwaysDad() const;
399
400 /**
401 * Assign a fixed random variable stream number to the random variables
402 * used by this model. Return the number of streams (possibly zero) that
403 * have been assigned.
404 *
405 * \param stream first stream index to use
406 * \return the number of stream indices assigned by this model
407 */
408 int64_t AssignStreams(int64_t stream);
409
410 /**
411 * Get the DAD timeout
412 * \return the DAD timeout
413 */
414 Time GetDadTimeout() const;
415
416 /**
417 * Set DHCPv6 callback.
418 * Invoked when an RA is received with the M flag set.
419 * \param cb the callback function
420 */
425
426 protected:
427 /**
428 * \brief Dispose this object.
429 */
430 void DoDispose() override;
431
432 typedef std::list<Ptr<NdiscCache>> CacheList; //!< container of NdiscCaches
433
434 /**
435 * \brief Notify an ICMPv6 reception to upper layers (if requested).
436 * \param source the ICMP source
437 * \param icmp the ICMP header
438 * \param info information about the ICMP
439 * \param ipHeader the IP header carried by the ICMP
440 * \param payload the data carried by the ICMP
441 */
442 void Forward(Ipv6Address source,
443 Icmpv6Header icmp,
444 uint32_t info,
445 Ipv6Header ipHeader,
446 const uint8_t payload[8]);
447
448 /**
449 * \brief Receive Neighbor Solicitation method.
450 * \param p the packet
451 * \param src source address
452 * \param dst destination address
453 * \param interface the interface from which the packet is coming
454 */
455 void HandleNS(Ptr<Packet> p,
456 const Ipv6Address& src,
457 const Ipv6Address& dst,
458 Ptr<Ipv6Interface> interface);
459
460 /**
461 * \brief Receive Router Solicitation method.
462 * \param p the packet
463 * \param src source address
464 * \param dst destination address
465 * \param interface the interface from which the packet is coming
466 */
467 void HandleRS(Ptr<Packet> p,
468 const Ipv6Address& src,
469 const Ipv6Address& dst,
470 Ptr<Ipv6Interface> interface);
471
472 /**
473 * \brief Router Solicitation Timeout handler.
474 * \param src link-local source address
475 * \param dst destination address (usually ff02::2 i.e all-routers)
476 * \param hardwareAddress link-layer address (SHOULD be included if src is not ::)
477 */
478 virtual void HandleRsTimeout(Ipv6Address src, Ipv6Address dst, Address hardwareAddress);
479
480 /**
481 * \brief Receive Router Advertisement method.
482 * \param p the packet
483 * \param src source address
484 * \param dst destination address
485 * \param interface the interface from which the packet is coming
486 */
487 void HandleRA(Ptr<Packet> p,
488 const Ipv6Address& src,
489 const Ipv6Address& dst,
490 Ptr<Ipv6Interface> interface);
491
492 /**
493 * \brief Receive Echo Request method.
494 * \param p the packet
495 * \param src source address
496 * \param dst destination address
497 * \param interface the interface from which the packet is coming
498 */
500 const Ipv6Address& src,
501 const Ipv6Address& dst,
502 Ptr<Ipv6Interface> interface);
503
504 /**
505 * \brief Receive Neighbor Advertisement method.
506 * \param p the packet
507 * \param src source address
508 * \param dst destination address
509 * \param interface the interface from which the packet is coming
510 */
511 void HandleNA(Ptr<Packet> p,
512 const Ipv6Address& src,
513 const Ipv6Address& dst,
514 Ptr<Ipv6Interface> interface);
515
516 /**
517 * \brief Receive Redirection method.
518 * \param p the packet
519 * \param src source address
520 * \param dst destination address
521 * \param interface the interface from which the packet is coming
522 */
524 const Ipv6Address& src,
525 const Ipv6Address& dst,
526 Ptr<Ipv6Interface> interface);
527
528 /**
529 * \brief Receive Destination Unreachable method.
530 * \param p the packet
531 * \param src source address
532 * \param dst destination address
533 * \param interface the interface from which the packet is coming
534 */
536 const Ipv6Address& src,
537 const Ipv6Address& dst,
538 Ptr<Ipv6Interface> interface);
539
540 /**
541 * \brief Receive Time Exceeded method.
542 * \param p the packet
543 * \param src source address
544 * \param dst destination address
545 * \param interface the interface from which the packet is coming
546 */
548 const Ipv6Address& src,
549 const Ipv6Address& dst,
550 Ptr<Ipv6Interface> interface);
551
552 /**
553 * \brief Receive Packet Too Big method.
554 * \param p the packet
555 * \param src source address
556 * \param dst destination address
557 * \param interface the interface from which the packet is coming
558 */
560 const Ipv6Address& src,
561 const Ipv6Address& dst,
562 Ptr<Ipv6Interface> interface);
563
564 /**
565 * \brief Receive Parameter Error method.
566 * \param p the packet
567 * \param src source address
568 * \param dst destination address
569 * \param interface the interface from which the packet is coming
570 */
572 const Ipv6Address& src,
573 const Ipv6Address& dst,
574 Ptr<Ipv6Interface> interface);
575
576 /**
577 * \brief Link layer address option processing.
578 * \param lla LLA option
579 * \param src source address
580 * \param dst destination address
581 * \param interface the interface from which the packet is coming
582 */
584 const Ipv6Address& src,
585 const Ipv6Address& dst,
586 Ptr<Ipv6Interface> interface);
587
588 /**
589 * \brief Get the cache corresponding to the device.
590 * \param device the device
591 * \returns the NdiscCache associated with the device
592 */
594
595 // From IpL4Protocol
598 // From IpL4Protocol
601
602 /**
603 * \brief Always do DAD ?
604 */
606
607 /**
608 * \brief A list of cache by device.
609 */
611
612 /**
613 * \brief Neighbor Discovery node constants: max multicast solicitations.
614 */
616
617 /**
618 * \brief Neighbor Discovery node constants: max unicast solicitations.
619 */
621
622 /**
623 * \brief Initial multicast RS retransmission time [\RFC{7559}].
624 */
626
627 /**
628 * \brief Maximum time between multicast RS retransmissions [\RFC{7559}]. Zero means unbound.
629 */
631
632 /**
633 * \brief Maximum number of multicast RS retransmissions [\RFC{7559}]. Zero means unbound.
634 */
636
637 /**
638 * \brief Maximum duration of multicast RS retransmissions [\RFC{7559}]. Zero means unbound.
639 */
641
642 /**
643 * \brief Multicast RS retransmissions counter [\RFC{7559}].
644 *
645 * Zero indicate a first transmission, greater than zero means retransmissions.
646 */
648
649 /**
650 * \brief Previous multicast RS retransmissions timeout [\RFC{7559}].
651 */
653
654 /**
655 * \brief First multicast RS transmissions [\RFC{7559}].
656 */
658
659 /**
660 * \brief Neighbor Discovery node constants: reachable time.
661 */
663
664 /**
665 * \brief Neighbor Discovery node constants: retransmission timer.
666 */
668
669 /**
670 * \brief Neighbor Discovery node constants: delay for the first probe.
671 */
673
674 /**
675 * \brief The node.
676 */
678
679 /**
680 * \brief Random jitter before sending solicitations
681 */
683
684 /**
685 * \brief Random jitter for RS retransmissions
686 */
688
689 /**
690 * \brief DAD timeout
691 */
693
694 /**
695 * RS timeout handler event
696 */
698
700
701 /**
702 * The trace fired when a DAD fails, changing the address state to INVALID.
703 * Includes the address whose state has been changed.
704 */
706
707 /**
708 * The trace fired when a DAD completes and no duplicate address has
709 * been detected. The address state changes to PREFERRED.
710 * Includes the address whose state has been changed.
711 */
713
714 /**
715 * The DHCPv6 callback when the M flag is set in a Router Advertisement.
716 * Includes the interface on which the RA was received.
717 */
719};
720
721} /* namespace ns3 */
722
723#endif /* ICMPV6_L4_PROTOCOL_H */
a polymophic address class
Definition address.h:90
Callback template class.
Definition callback.h:422
An identifier for simulation events.
Definition event-id.h:45
ICMPv6 header.
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.
Time m_rsFirstTransmissionTime
First multicast RS transmissions [RFC 7559 ].
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.
std::list< Ptr< NdiscCache > > CacheList
container of NdiscCaches
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.
void SendEchoReply(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Send a Echo Reply.
void SetDhcpv6Callback(Callback< void, uint32_t > cb)
Set DHCPv6 callback.
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.
L4 Protocol abstract base class.
RxStatus
Rx status codes.
Packet header for IPv4.
Definition ipv4-header.h:23
Describes an IPv6 address.
Packet header for IPv6.
Definition ipv6-header.h:24
The IPv6 representation of a network interface.
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv4 header.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t data[writeSize]