A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
animation-interface.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Author: George F. Riley<riley@ece.gatech.edu>
5 * Author: John Abraham <john.abraham@gatech.edu>
6 * Contributions: Eugene Kalishenko <ydginster@gmail.com> (Open Source and Linux Laboratory
7 * http://wiki.osll.ru/doku.php/start)
8 */
9
10// Interface between ns3 and the network animator
11
12#ifndef ANIMATION_INTERFACE__H
13#define ANIMATION_INTERFACE__H
14
15#include "ns3/config.h"
16#include "ns3/ipv4-l3-protocol.h"
17#include "ns3/ipv4.h"
18#include "ns3/log.h"
19#include "ns3/lte-enb-net-device.h"
20#include "ns3/lte-ue-net-device.h"
21#include "ns3/mac48-address.h"
22#include "ns3/net-device.h"
23#include "ns3/node-container.h"
24#include "ns3/node-list.h"
25#include "ns3/nstime.h"
26#include "ns3/ptr.h"
27#include "ns3/random-variable-stream.h"
28#include "ns3/rectangle.h"
29#include "ns3/simulator.h"
30#include "ns3/uan-phy-gen.h"
31#include "ns3/wifi-phy.h"
32
33#include <cstdio>
34#include <map>
35#include <string>
36
37namespace ns3
38{
39
40#define MAX_PKTS_PER_TRACE_FILE 100000
41#define PURGE_INTERVAL 5
42#define NETANIM_VERSION "netanim-3.109"
43#define CHECK_STARTED_INTIMEWINDOW \
44 { \
45 if (!m_started || !IsInTimeWindow()) \
46 { \
47 return; \
48 } \
49 }
50#define CHECK_STARTED_INTIMEWINDOW_TRACKPACKETS \
51 { \
52 if (!m_started || !IsInTimeWindow() || !m_trackPackets) \
53 { \
54 return; \
55 } \
56 }
57
58struct NodeSize;
59class WifiPsdu;
60
61/**
62 * @defgroup netanim Network Animation
63 *
64 * This section documents the API of the ns-3 netanim module. For a generic functional description,
65 * please refer to the ns-3 manual.
66 */
67
68/**
69 * @ingroup netanim
70 *
71 * @brief Interface to network animator
72 *
73 * Provides functions that facilitate communications with an
74 * external or internal network animator.
75 */
77{
78 public:
79 /**
80 * @brief Constructor
81 * @param filename The Filename for the trace file used by the Animator
82 *
83 */
84 AnimationInterface(const std::string filename);
85
86 /**
87 * Counter Types
88 */
94
95 /**
96 * @brief typedef for WriteCallBack used for listening to AnimationInterface
97 * write messages
98 *
99 */
100 typedef void (*AnimWriteCallback)(const char* str);
101
102 /**
103 * @brief Destructor for the animator interface.
104 *
105 */
107
108 /**
109 * @brief Enable tracking of Ipv4 L3 Protocol Counters such as Tx, Rx, Drop
110 *
111 * @param startTime Start Time for capturing values
112 * @param stopTime Stop Time for capturing values
113 * @param pollInterval The periodic interval at which the counters are written to the trace file
114 * Default: 1s
115 */
116 void EnableIpv4L3ProtocolCounters(Time startTime,
118 Time pollInterval = Seconds(1));
119
120 /**
121 * @brief Enable tracking of Queue Counters such as Enqueue, Dequeue, Queue Drops
122 *
123 * @param startTime Start Time for capturing values
124 * @param stopTime Stop Time for capturing values
125 * @param pollInterval The periodic interval at which the counters are written to the trace file
126 * Default: 1s
127 */
128 void EnableQueueCounters(Time startTime, Time stopTime, Time pollInterval = Seconds(1));
129
130 /**
131 * @brief Enable tracking of Wifi Mac Counters such as Tx, TxDrop, Rx, RxDrop
132 *
133 * @param startTime Start Time for capturing values
134 * @param stopTime Stop Time for capturing values
135 * @param pollInterval The periodic interval at which the counters are written to the trace file
136 * Default: 1s
137 */
138 void EnableWifiMacCounters(Time startTime, Time stopTime, Time pollInterval = Seconds(1));
139
140 /**
141 * @brief Enable tracking of Wifi Phy Counters such as TxDrop, RxDrop
142 *
143 * @param startTime Start Time for capturing values
144 * @param stopTime Stop Time for capturing values
145 * @param pollInterval The periodic interval at which the counters are written to the trace file
146 * Default: 1s
147 */
148 void EnableWifiPhyCounters(Time startTime, Time stopTime, Time pollInterval = Seconds(1));
149
150 /**
151 * @brief Enable tracking of the Ipv4 routing table for all Nodes
152 *
153 * @param fileName Trace file for storing routing table information
154 * @param startTime Start time for capture
155 * @param stopTime End time for capture
156 * @param pollInterval The periodic interval at which routing table information is polled
157 * Default: 5s
158 *
159 * @returns reference to this AnimationInterface object
160 */
161 AnimationInterface& EnableIpv4RouteTracking(std::string fileName,
162 Time startTime,
164 Time pollInterval = Seconds(5));
165
166 /**
167 * @brief Enable tracking of the Ipv4 routing table for a set of Nodes
168 *
169 * @param fileName Trace file for storing routing table information
170 * @param startTime Start time for capture
171 * @param stopTime End time for capture
172 * @param nc A NodeContainer containing nodes for which Routing table has to be tracked
173 * @param pollInterval The periodic interval at which routing table information is polled
174 * Default: 5s
175 *
176 * @returns reference to this AnimationInterface object
177 */
178 AnimationInterface& EnableIpv4RouteTracking(std::string fileName,
179 Time startTime,
181 NodeContainer nc,
182 Time pollInterval = Seconds(5));
183
184 /**
185 * @brief Check if AnimationInterface is initialized
186 *
187 * @returns true if AnimationInterface was already initialized
188 *
189 */
190 static bool IsInitialized();
191
192 /**
193 * @brief Specify the time at which capture should start
194 *
195 * @param t The time at which AnimationInterface should begin capture of traffic info
196 *
197 */
198 void SetStartTime(Time t);
199
200 /**
201 * @brief Specify the time at which capture should stop
202 *
203 * @param t The time at which AnimationInterface should stop capture of traffic info
204 *
205 */
206 void SetStopTime(Time t);
207
208 /**
209 * @brief Set Max packets per trace file
210 * @param maxPktsPerFile The maximum number of packets per trace file.
211 AnimationInterface will create trace files with the following
212 filenames : filename, filename-1, filename-2..., filename-N
213 where each file contains packet info for 'maxPktsPerFile' number of packets
214 *
215 */
216 void SetMaxPktsPerTraceFile(uint64_t maxPktsPerFile);
217
218 /**
219 * @brief Set mobility poll interval:WARNING: setting a low interval can
220 * cause slowness
221 *
222 * @param t Time interval between fetching mobility/position information
223 * Default: 0.25s
224 *
225 */
227
228 /**
229 * @brief Set a callback function to listen to AnimationInterface write events
230 *
231 * @param cb Address of callback function
232 *
233 */
235
236 /**
237 * @brief Reset the write callback function
238 *
239 */
241
242 /**
243 * @brief Helper function to set Constant Position for a given node
244 * @param n Ptr to the node
245 * @param x X coordinate of the node
246 * @param y Y coordinate of the node
247 * @param z Z coordinate of the node
248 *
249 */
250 static void SetConstantPosition(Ptr<Node> n, double x, double y, double z = 0);
251
252 /**
253 * @brief Helper function to update the description for a given node
254 * @param n Ptr to the node
255 * @param descr A string to briefly describe the node
256 *
257 */
258 void UpdateNodeDescription(Ptr<Node> n, std::string descr);
259
260 /**
261 * @brief Helper function to update the description for a given node
262 * @param nodeId Id of the node
263 * @param descr A string to briefly describe the node
264 *
265 */
266 void UpdateNodeDescription(uint32_t nodeId, std::string descr);
267
268 /**
269 * @brief Helper function to update the image of a node
270 * @param nodeId Id of the node
271 * @param resourceId Id of the image resource that was previously added
272 *
273 */
274 void UpdateNodeImage(uint32_t nodeId, uint32_t resourceId);
275
276 /**
277 * @brief Helper function to update the size of a node
278 * @param n Ptr to the node
279 * @param width Width of the node
280 * @param height Height of the node
281 *
282 */
283 void UpdateNodeSize(Ptr<Node> n, double width, double height);
284
285 /**
286 * @brief Helper function to update the size of a node
287 * @param nodeId Id of the node
288 * @param width Width of the node
289 * @param height Height of the node
290 *
291 */
292 void UpdateNodeSize(uint32_t nodeId, double width, double height);
293
294 /**
295 * @brief Helper function to update the node color
296 * @param n Ptr to the node
297 * @param r Red component value (0-255)
298 * @param g Green component value (0-255)
299 * @param b Blue component value (0-255)
300 *
301 */
302 void UpdateNodeColor(Ptr<Node> n, uint8_t r, uint8_t g, uint8_t b);
303
304 /**
305 * @brief Helper function to update the node color
306 * @param nodeId Id of the node
307 * @param r Red component value (0-255)
308 * @param g Green component value (0-255)
309 * @param b Blue component value (0-255)
310 *
311 */
312 void UpdateNodeColor(uint32_t nodeId, uint8_t r, uint8_t g, uint8_t b);
313
314 /**
315 * @brief Helper function to update a node's counter referenced by the nodeCounterId
316 * @param nodeCounterId The counter Id obtained from AddNodeCounter
317 * @param nodeId Node Id of the node
318 * @param counter Current value of the counter
319 *
320 */
321 void UpdateNodeCounter(uint32_t nodeCounterId, uint32_t nodeId, double counter);
322
323 /**
324 * @brief Helper function to set the background image
325 * @param fileName File name of the background image
326 * @param x X coordinate of the image
327 * @param y Y coordinate of the image
328 * @param scaleX X scale of the image
329 * @param scaleY Y scale of the image
330 * @param opacity Opacity of the background: A value between 0.0 and 1.0. 0.0 is transparent,
331 * 1.0 is opaque
332 *
333 */
334 void SetBackgroundImage(std::string fileName,
335 double x,
336 double y,
337 double scaleX,
338 double scaleY,
339 double opacity);
340
341 /**
342 * @brief Helper function to update the description for a link
343 * @param fromNode Node Id of the "from Node" of the p2p link
344 * @param toNode Node Id of the "to Node" of the p2p link
345 * @param linkDescription Description of the link such as link bandwidth
346 *
347 */
348 void UpdateLinkDescription(uint32_t fromNode, uint32_t toNode, std::string linkDescription);
349
350 /**
351 * @brief Helper function to update the description for a link
352 * @param fromNode Ptr to the "from Node" of the p2p link
353 * @param toNode Ptr to the "to Node" of the p2p link
354 * @param linkDescription Description of the link such as link bandwidth
355 *
356 */
357 void UpdateLinkDescription(Ptr<Node> fromNode, Ptr<Node> toNode, std::string linkDescription);
358
359 /**
360 * @brief Helper function to print the routing path from a source node to destination IP
361 * @param fromNodeId The source node
362 * @param destinationIpv4Address The destination Ipv4 Address
363 *
364 * @returns reference to this AnimationInterface object
365 */
367 std::string destinationIpv4Address);
368
369 /**
370 * @brief Is AnimationInterface started
371 *
372 * @returns true if AnimationInterface was started
373 */
374 bool IsStarted() const;
375
376 /**
377 * @brief Do not trace packets. This helps reduce the trace file size if AnimationInterface is
378 * solely used for tracking mobility, routing paths and counters
379 */
380 void SkipPacketTracing();
381
382 /**
383 *
384 * @brief Enable Packet metadata
385 * @param enable if true enables writing the packet metadata to the XML trace file
386 * if false disables writing the packet metadata
387 *
388 */
389 void EnablePacketMetadata(bool enable = true);
390
391 /**
392 *
393 * @brief Get trace file packet count (This used only for testing)
394 *
395 * @returns Number of packets recorded in the current trace file
396 */
397 uint64_t GetTracePktCount() const;
398
399 /**
400 *
401 * @brief Setup a node counter
402 * @param counterName A string to identify the counter
403 * @param counterType The type of the counter, such as uint32, double etc
404 *
405 * @returns The id of the counter to be used as a reference for future
406 */
407 uint32_t AddNodeCounter(std::string counterName, CounterType counterType);
408
409 /**
410 *
411 * @brief Add a resource such as the path to an image file
412 * @param resourcePath Absolute Path to an image/resource
413 *
414 * @returns a number identifying the resource
415 */
416 uint32_t AddResource(std::string resourcePath);
417
418 /**
419 *
420 * @brief Get node's energy fraction (This used only for testing)
421 * @param node
422 *
423 * @returns current node's remaining energy (between [0, 1])
424 */
425 double GetNodeEnergyFraction(Ptr<const Node> node) const;
426
427 private:
428 /**
429 * AnimPacketInfo class
430 */
432
433 {
434 public:
436 /**
437 * Constructor
438 *
439 * @param pInfo anim packet info
440 */
441 AnimPacketInfo(const AnimPacketInfo& pInfo);
442 /**
443 * Constructor
444 *
445 * @param tx_nd transmit device
446 * @param fbTx fb transmit
447 * @param txNodeId transmit node ID
448 */
449 AnimPacketInfo(Ptr<const NetDevice> tx_nd, const Time fbTx, uint32_t txNodeId = 0);
450 Ptr<const NetDevice> m_txnd; ///< transmit device
451 uint32_t m_txNodeId; ///< node ID
452 double m_fbTx; ///< fb transmit
453 double m_lbTx; ///< lb transmit
454 double m_fbRx; ///< fb receive
455 double m_lbRx; ///< lb receive
456 Ptr<const NetDevice> m_rxnd; ///< receive device
457 /**
458 * Process receive begin
459 * @param nd the device
460 * @param fbRx
461 */
462 void ProcessRxBegin(Ptr<const NetDevice> nd, const double fbRx);
463 };
464
465 /// RGB structure
466 struct Rgb
467 {
468 uint8_t r; ///< r
469 uint8_t g; ///< g
470 uint8_t b; ///< b
471 }; ///< RGB structure
472
473 /// P2pLinkNodeIdPair structure
475 {
476 uint32_t fromNode; ///< from node
477 uint32_t toNode; ///< to node
478 }; ///< P2P link node id pair
479
480 /// LinkProperties structure
482 {
483 std::string fromNodeDescription; ///< from node description
484 std::string toNodeDescription; ///< to node description
485 std::string linkDescription; ///< link description
486 }; ///< link properties
487
488 /// LinkPairCompare structure
490 {
491 /**
492 * comparison operator
493 *
494 * @param first
495 * @param second
496 * @return true if equal
497 */
499 {
500 // Check if they are the same node pairs but flipped
501 if (((first.fromNode == second.fromNode) && (first.toNode == second.toNode)) ||
502 ((first.fromNode == second.toNode) && (first.toNode == second.fromNode)))
503 {
504 return false;
505 }
506 std::ostringstream oss1;
507 oss1 << first.fromNode << first.toNode;
508 std::ostringstream oss2;
509 oss2 << second.fromNode << second.toNode;
510 return oss1.str() < oss2.str();
511 }
512 };
513
514 /// Ipv4RouteTrackElement structure
516 {
517 std::string destination; ///< destination
518 uint32_t fromNodeId; ///< from node ID
519 }; ///< IPv4 route track element
520
521 /// Ipv4RoutePathElement structure
523 {
524 uint32_t nodeId; ///< node ID
525 std::string nextHop; ///< next hop
526 }; ///< IPv4 route path element
527
528 /// ProtocolType enumeration
538
539 /// NodeSize structure
540 struct NodeSize
541 {
542 double width; ///< width
543 double height; ///< height
544 }; ///< node size
545
546 typedef std::map<P2pLinkNodeIdPair, LinkProperties, LinkPairCompare>
547 LinkPropertiesMap; ///< LinkPropertiesMap typedef
548 typedef std::map<uint32_t, std::string> NodeDescriptionsMap; ///< NodeDescriptionsMap typedef
549 typedef std::map<uint32_t, Rgb> NodeColorsMap; ///< NodeColorsMap typedef
550 typedef std::map<uint64_t, AnimPacketInfo>
551 AnimUidPacketInfoMap; ///< AnimUidPacketInfoMap typedef
552 typedef std::map<uint32_t, double> EnergyFractionMap; ///< EnergyFractionMap typedef
553 typedef std::vector<Ipv4RoutePathElement>
554 Ipv4RoutePathElements; ///< Ipv4RoutePathElements typedef
555 typedef std::multimap<uint32_t, std::string> NodeIdIpv4Map; ///< NodeIdIpv4Map typedef
556 typedef std::multimap<uint32_t, std::string> NodeIdIpv6Map; ///< NodeIdIpv6Map typedef
557 typedef std::pair<uint32_t, std::string> NodeIdIpv4Pair; ///< NodeIdIpv4Pair typedef
558 typedef std::pair<uint32_t, std::string> NodeIdIpv6Pair; ///< NodeIdIpv6Pair typedef
559
560 // Node Counters
561 typedef std::map<uint32_t, uint64_t> NodeCounterMap64; ///< NodeCounterMap64 typedef
562
563 /// AnimXmlElement class
565 {
566 public:
567 /**
568 * Constructor
569 *
570 * @param tagName tag name
571 * @param emptyElement empty element?
572 */
573 AnimXmlElement(std::string tagName, bool emptyElement = true);
574 template <typename T>
575 /**
576 * Add attribute function
577 * @param attribute the attribute name
578 * @param value the attribute value
579 * @param xmlEscape true to escape
580 */
581 void AddAttribute(std::string attribute, T value, bool xmlEscape = false);
582 /**
583 * Set text function
584 * @param text the text for the element
585 */
586 void SetText(std::string text);
587 /**
588 * Append child function
589 * @param e the element to add as a child
590 */
592 /**
593 * Get text for the element function
594 * @param autoClose auto close the element
595 * @returns the text
596 */
597 std::string ToString(bool autoClose = true);
598
599 private:
600 std::string m_tagName; ///< tag name
601 std::string m_text; ///< element string
602 std::vector<std::string> m_attributes; ///< list of attributes
603 std::vector<std::string> m_children; ///< list of children
604 };
605
606 // ##### State #####
607
608 FILE* m_f; ///< File handle for output (0 if none)
609 FILE* m_routingF; ///< File handle for routing table output (0 if None);
610 Time m_mobilityPollInterval; ///< mobility poll interval
611 std::string m_outputFileName; ///< output file name
612 uint64_t gAnimUid; ///< Packet unique identifier used by AnimationInterface
614 bool m_started; ///< started
615 bool m_enablePacketMetadata; ///< enable packet metadata
616 Time m_startTime; ///< start time
617 Time m_stopTime; ///< stop time
618 uint64_t m_maxPktsPerFile; ///< maximum packets per file
619 std::string m_originalFileName; ///< original file name
620 Time m_routingStopTime; ///< routing stop time
621 std::string m_routingFileName; ///< routing file name
622 Time m_routingPollInterval; ///< routing poll interval
623 NodeContainer m_routingNc; ///< routing node container
624 Time m_ipv4L3ProtocolCountersStopTime; ///< IPv4 L3 protocol counters stop time
625 Time m_ipv4L3ProtocolCountersPollInterval; ///< IPv4 L3 protocol counters poll interval
626 Time m_queueCountersStopTime; ///< queue counters stop time
627 Time m_queueCountersPollInterval; ///< queue counters poll interval
628 Time m_wifiMacCountersStopTime; ///< wifi MAC counters stop time
629 Time m_wifiMacCountersPollInterval; ///< wifi MAC counters poll interval
630 Time m_wifiPhyCountersStopTime; ///< wifi Phy counters stop time
631 Time m_wifiPhyCountersPollInterval; ///< wifi Phy counters poll interval
632 static Rectangle* userBoundary; ///< user boundary
633 bool m_trackPackets; ///< track packets
634
635 // Counter ID
636 uint32_t m_remainingEnergyCounterId; ///< remaining energy counter ID
637
638 uint32_t m_ipv4L3ProtocolTxCounterId; ///< IPv4 L3 protocol transmit counter ID
639 uint32_t m_ipv4L3ProtocolRxCounterId; ///< IPv4 L3 protocol receive counter ID
640 uint32_t m_ipv4L3ProtocolDropCounterId; ///< IPv4 protocol drop counter ID
641
642 uint32_t m_queueEnqueueCounterId; ///< queue enqueue counter ID
643 uint32_t m_queueDequeueCounterId; ///< queue dequeue counter ID
644 uint32_t m_queueDropCounterId; ///< queue drop counter ID
645
646 uint32_t m_wifiMacTxCounterId; ///< wifi MAC transmit counter ID
647 uint32_t m_wifiMacTxDropCounterId; ///< wifi MAC transmit drop counter ID
648 uint32_t m_wifiMacRxCounterId; ///< wifi MAC receive counter ID
649 uint32_t m_wifiMacRxDropCounterId; ///< wifi MAC receive drop counter ID
650
651 uint32_t m_wifiPhyTxDropCounterId; ///< wifi Phy transmit drop counter ID
652 uint32_t m_wifiPhyRxDropCounterId; ///< wifi Phy receive drop counter ID
653
655 AnimUidPacketInfoMap m_pendingWimaxPackets; ///< pending wimax packets
656 AnimUidPacketInfoMap m_pendingLrWpanPackets; ///< pending LR-WPAN packets
660
661 std::map<uint32_t, Vector> m_nodeLocation; ///< node location
662 std::map<std::string, uint32_t> m_macToNodeIdMap; ///< MAC to node ID map
663 std::map<std::string, uint32_t> m_ipv4ToNodeIdMap; ///< IPv4 to node ID map
664 std::map<std::string, uint32_t> m_ipv6ToNodeIdMap; ///< IPv6 to node ID map
665 NodeIdIpv4Map m_nodeIdIpv4Map; ///< node ID to IPv4 map
666 NodeIdIpv6Map m_nodeIdIpv6Map; ///< node ID to IPv6 map
667
668 NodeColorsMap m_nodeColors; ///< node colors
671 EnergyFractionMap m_nodeEnergyFraction; ///< node energy fraction
672 uint64_t m_currentPktCount; ///< current packet count
673 std::vector<Ipv4RouteTrackElement> m_ipv4RouteTrackElements; ///< IPv route track elements
674 std::map<uint32_t, NodeSize> m_nodeSizes; ///< node sizes
675 std::vector<std::string> m_resources; ///< resources
676 std::vector<std::string> m_nodeCounters; ///< node counters
677
678 /* Value-added custom counters */
679 NodeCounterMap64 m_nodeIpv4Drop; ///< node IPv4 drop
680 NodeCounterMap64 m_nodeIpv4Tx; ///< node IPv4 transmit
681 NodeCounterMap64 m_nodeIpv4Rx; ///< node IPv4 receive
682 NodeCounterMap64 m_nodeQueueEnqueue; ///< node queue enqueue
683 NodeCounterMap64 m_nodeQueueDequeue; ///< node queue dequeue
684 NodeCounterMap64 m_nodeQueueDrop; ///< node queue drop
685 NodeCounterMap64 m_nodeWifiMacTx; ///< node wifi MAC transmit
686 NodeCounterMap64 m_nodeWifiMacTxDrop; ///< node wifi MAC transmit drop
687 NodeCounterMap64 m_nodeWifiMacRx; ///< node wifi MAC receive
688 NodeCounterMap64 m_nodeWifiMacRxDrop; ///< node wifi MAC receive drop
689 NodeCounterMap64 m_nodeWifiPhyTxDrop; ///< node wifi Phy transmit drop
690 NodeCounterMap64 m_nodeWifiPhyRxDrop; ///< node wifi Phy receive drop
691 NodeCounterMap64 m_nodeLrWpanMacTx; ///< node LR-WPAN MAC transmit
692 NodeCounterMap64 m_nodeLrWpanMacTxDrop; ///< node LR-WPAN MAC transmit drop
693 NodeCounterMap64 m_nodeLrWpanMacRx; ///< node LR-WPAN MAC receive
694 NodeCounterMap64 m_nodeLrWpanMacRxDrop; ///< node LR-WPAN MAC receive drop
695
696 /**
697 * Get elements from context
698 * @param context the context string
699 * @returns the elements
700 */
701 const std::vector<std::string> GetElementsFromContext(const std::string& context) const;
702 /**
703 * Get node from context
704 * @param context the context string
705 * @returns the node
706 */
707 Ptr<Node> GetNodeFromContext(const std::string& context) const;
708 /**
709 * Get net device from context
710 * @param context the context string
711 * @returns the device
712 */
713 Ptr<NetDevice> GetNetDeviceFromContext(std::string context);
714
715 // ##### General #####
716 /**
717 * Start animation function
718 *
719 * @param restart
720 */
721 void StartAnimation(bool restart = false);
722 /**
723 * Set output file function
724 *
725 * @param fn the file name
726 * @param routing
727 */
728 void SetOutputFile(const std::string& fn, bool routing = false);
729 /**
730 * Stop animation function
731 *
732 * @param onlyAnimation
733 */
734 void StopAnimation(bool onlyAnimation = false);
735 /**
736 * Counter type to string function
737 * @param counterType the counter type
738 * @returns the string
739 */
740 std::string CounterTypeToString(CounterType counterType);
741 /**
742 * Get packet metadata function
743 * @param p the packet
744 * @returns the meta data
745 */
747 /**
748 * Add byte tag function
749 * @param animUid the UID
750 * @param p the packet
751 */
752 void AddByteTag(uint64_t animUid, Ptr<const Packet> p);
753 /**
754 * WriteN function
755 * @param data the data t write
756 * @param count the number of bytes to write
757 * @param f the file to write to
758 * @returns the number of bytes written
759 */
760 int WriteN(const char* data, uint32_t count, FILE* f);
761 /**
762 * WriteN function
763 * @param st the string to output
764 * @param f the file to write to
765 * @returns the number of bytes written
766 */
767 int WriteN(const std::string& st, FILE* f);
768 /**
769 * Get MAC address function
770 * @param nd the device
771 * @returns the MAC address
772 */
773 std::string GetMacAddress(Ptr<NetDevice> nd);
774 /**
775 * Get IPv4 address
776 * @param nd the device
777 * @returns the IPv4 address
778 */
779 std::string GetIpv4Address(Ptr<NetDevice> nd);
780 /**
781 * Get IPv6 address
782 * @param nd the device
783 * @returns the IPv6 address
784 */
785 std::string GetIpv6Address(Ptr<NetDevice> nd);
786 /**
787 * Get IPv4 addresses
788 * @param nd the device
789 * @returns the IPv4 address list
790 */
791 std::vector<std::string> GetIpv4Addresses(Ptr<NetDevice> nd);
792 /**
793 * Get IPv6 addresses
794 * @param nd the device
795 * @returns the IPv6 address list
796 */
797 std::vector<std::string> GetIpv6Addresses(Ptr<NetDevice> nd);
798
799 /**
800 * Get netanim version function
801 * @returns the net anim version string
802 */
803 std::string GetNetAnimVersion();
804 /// Mobility auto check function
805 void MobilityAutoCheck();
806 /**
807 * Is packet pending function
808 * @param animUid the UID
809 * @param protocolType the protocol type
810 * @returns true if a packet is pending
811 */
812 bool IsPacketPending(uint64_t animUid, ProtocolType protocolType);
813 /**
814 * Purge pending packets function
815 * @param protocolType the protocol type
816 */
817 void PurgePendingPackets(ProtocolType protocolType);
818 /**
819 * Protocol type to pending packets function
820 * @param protocolType the protocol type
821 * @returns AnimUidPacketInfoMap *
822 */
824 /**
825 * Protocol type to string function
826 * @param protocolType the protocol type
827 * @returns the protocol type string
828 */
829 std::string ProtocolTypeToString(ProtocolType protocolType);
830 /**
831 * Add pending packet function
832 * @param protocolType the protocol type
833 * @param animUid the UID
834 * @param pktInfo the packet info
835 */
836 void AddPendingPacket(ProtocolType protocolType, uint64_t animUid, AnimPacketInfo pktInfo);
837 /**
838 * Get anim UID from packet function
839 * @param p the packet
840 * @returns the UID
841 */
843 /**
844 * Add to IPv4 address node ID table function
845 * @param ipv4Address the IPv4 address
846 * @param nodeId the node ID
847 */
848 void AddToIpv4AddressNodeIdTable(std::string ipv4Address, uint32_t nodeId);
849 /**
850 * Add to IPv4 address node ID table function
851 * @param ipv4Addresses the list of IPv4 addresses
852 * @param nodeId the node ID
853 */
854 void AddToIpv4AddressNodeIdTable(std::vector<std::string> ipv4Addresses, uint32_t nodeId);
855 /**
856 * Add to IPv6 address node ID table function
857 * @param ipv6Address the IPv6 address
858 * @param nodeId the node ID
859 */
860 void AddToIpv6AddressNodeIdTable(std::string ipv6Address, uint32_t nodeId);
861 /**
862 * Add to IPv6 address node ID table function
863 * @param ipv6Addresses the list of IPv6 addresses
864 * @param nodeId the node ID
865 */
866 void AddToIpv6AddressNodeIdTable(std::vector<std::string> ipv6Addresses, uint32_t nodeId);
867 /**
868 * Is in time window function
869 * @returns true if in the time window
870 */
871 bool IsInTimeWindow();
872 /// Check maximum packets per trace file function
874
875 /// Track wifi phy counters function
877 /// Track wifi MAC counters function
879 /// Track IPv4 L3 protocol counters function
881 /// Track queue counters function
882 void TrackQueueCounters();
883 // ##### Routing #####
884 /// Track IPv4 router function
885 void TrackIpv4Route();
886 /// Track IPv4 route paths function
887 void TrackIpv4RoutePaths();
888 /**
889 * Get IPv4 routing table function
890 * @param n the node
891 * @returns the IPv4 routing table
892 */
893 std::string GetIpv4RoutingTable(Ptr<Node> n);
894 /**
895 * Recursive IPv4 route path search function
896 * @param from the source node
897 * @param to the destination node
898 * @param rpElements the IPv4 routing path elements
899 */
900 void RecursiveIpv4RoutePathSearch(std::string from,
901 std::string to,
902 Ipv4RoutePathElements& rpElements);
903 /**
904 * Write route path function
905 * @param nodeId the node ID
906 * @param destination the destination
907 * @param rpElements the IPv4 routing path elements
908 */
909 void WriteRoutePath(uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements);
910
911 // ##### Trace #####
912 /**
913 * Enqueue trace function
914 * @param context the context
915 * @param p the packet
916 */
917 void EnqueueTrace(std::string context, Ptr<const Packet>);
918 /**
919 * Dequeue trace function
920 * @param context the context
921 * @param p the packet
922 */
923 void DequeueTrace(std::string context, Ptr<const Packet>);
924 /**
925 * Queue trace function
926 * @param context the context
927 * @param p the packet
928 */
929 void QueueDropTrace(std::string context, Ptr<const Packet>);
930 /**
931 * IPv4 transmit trace function
932 * @param context the context
933 * @param p the packet
934 * @param ipv4 the IP
935 * @param interfaceIndex the interface index
936 */
937 void Ipv4TxTrace(std::string context,
939 Ptr<Ipv4> ipv4,
940 uint32_t interfaceIndex);
941 /**
942 * IPv4 receive trace function
943 * @param context the context
944 * @param p the packet
945 * @param ipv4 the IP
946 * @param interfaceIndex the interface index
947 */
948 void Ipv4RxTrace(std::string context,
950 Ptr<Ipv4> ipv4,
951 uint32_t interfaceIndex);
952 /**
953 * IPv4 drop trace function
954 * @param context the context
955 * @param ipv4Header the IPv4 header
956 * @param p the packet
957 * @param dropReason the reason for the drop
958 * @param ipv4 the IP
959 * @param interfaceIndex the interface index
960 */
961 void Ipv4DropTrace(std::string context,
962 const Ipv4Header& ipv4Header,
965 Ptr<Ipv4> ipv4,
966 uint32_t interfaceIndex);
967
968 /**
969 * wifi MAC transmit trace function
970 * @param context the context
971 * @param p the packet
972 */
973 void WifiMacTxTrace(std::string context, Ptr<const Packet> p);
974 /**
975 * wifi MAC transmit drop trace function
976 * @param context the context
977 * @param p the packet
978 */
979 void WifiMacTxDropTrace(std::string context, Ptr<const Packet> p);
980 /**
981 * wifi MAC receive trace function
982 * @param context the context
983 * @param p the packet
984 */
985 void WifiMacRxTrace(std::string context, Ptr<const Packet> p);
986 /**
987 * wifi MAC receive drop trace function
988 * @param context the context
989 * @param p the packet
990 */
991 void WifiMacRxDropTrace(std::string context, Ptr<const Packet> p);
992 /**
993 * wifi Phy transmit drop trace function
994 * @param context the context
995 * @param p the packet
996 */
997 void WifiPhyTxDropTrace(std::string context, Ptr<const Packet> p);
998 /**
999 * wifi Phy receive drop trace function
1000 * @param context the context
1001 * @param p the packet
1002 * @param reason the reason
1003 */
1004 void WifiPhyRxDropTrace(std::string context,
1006 WifiPhyRxfailureReason reason);
1007 /**
1008 * LR-WPAN MAC transmit trace function
1009 * @param context the context
1010 * @param p the packet
1011 */
1012 void LrWpanMacTxTrace(std::string context, Ptr<const Packet> p);
1013 /**
1014 * LR-WPAN MAC transmit drop trace function
1015 * @param context the context
1016 * @param p the packet
1017 */
1018 void LrWpanMacTxDropTrace(std::string context, Ptr<const Packet> p);
1019 /**
1020 * LR-WPAN MAC receive trace function
1021 * @param context the context
1022 * @param p the packet
1023 */
1024 void LrWpanMacRxTrace(std::string context, Ptr<const Packet> p);
1025 /**
1026 * LR-WPAN MAC receive drop trace function
1027 * @param context the context
1028 * @param p the packet
1029 */
1030 void LrWpanMacRxDropTrace(std::string context, Ptr<const Packet> p);
1031 /**
1032 * Device transmit trace function
1033 * @param context the context
1034 * @param p the packet
1035 * @param tx the transmit device
1036 * @param rx the receive device
1037 * @param txTime the transmit time
1038 * @param rxTime the receive time
1039 */
1040 void DevTxTrace(std::string context,
1042 Ptr<NetDevice> tx,
1043 Ptr<NetDevice> rx,
1044 Time txTime,
1045 Time rxTime);
1046 /**
1047 * wifi Phy transmit PSDU begin trace function
1048 * @param context the context
1049 * @param psduMap the PSDU map
1050 * @param txVector the TXVECTOR
1051 * @param txPowerW the tx power in Watts
1052 */
1053 void WifiPhyTxBeginTrace(std::string context,
1054 WifiConstPsduMap psduMap,
1055 WifiTxVector txVector,
1056 double txPowerW);
1057 /**
1058 * wifi Phy receive begin trace function
1059 *
1060 * @param context the context
1061 * @param p the packet
1062 * @param rxPowersW the receive power per channel band in Watts
1063 */
1064 void WifiPhyRxBeginTrace(std::string context,
1066 RxPowerWattPerChannelBand rxPowersW);
1067 /**
1068 * LR-WPAN Phy receive begin trace function
1069 *
1070 * @param context the context
1071 * @param p the packet
1072 */
1073 void LrWpanPhyTxBeginTrace(std::string context, Ptr<const Packet> p);
1074 /**
1075 * LR-WPAN Phy receive begin trace function
1076 *
1077 * @param context the context
1078 * @param p the packet
1079 */
1080 void LrWpanPhyRxBeginTrace(std::string context, Ptr<const Packet> p);
1081 /**
1082 * WIMax transmit trace function
1083 * @param context the context
1084 * @param p the packet
1085 * @param m the MAC address
1086 */
1087 void WimaxTxTrace(std::string context, Ptr<const Packet> p, const Mac48Address& m);
1088 /**
1089 * WIMax receive trace function
1090 * @param context the context
1091 * @param p the packet
1092 * @param m the MAC address
1093 */
1094 void WimaxRxTrace(std::string context, Ptr<const Packet> p, const Mac48Address& m);
1095 /**
1096 * CSMA Phy transmit begin trace function
1097 * @param context the context
1098 * @param p the packet
1099 */
1100 void CsmaPhyTxBeginTrace(std::string context, Ptr<const Packet> p);
1101 /**
1102 * CSMA Phy transmit end trace function
1103 *
1104 * @param context the context
1105 * @param p the packet
1106 */
1107 void CsmaPhyTxEndTrace(std::string context, Ptr<const Packet> p);
1108 /**
1109 * CSMA Phy receive end trace function
1110 *
1111 * @param context the context
1112 * @param p the packet
1113 */
1114 void CsmaPhyRxEndTrace(std::string context, Ptr<const Packet> p);
1115 /**
1116 * CSMA MAC receive trace function
1117 *
1118 * @param context the context
1119 * @param p the packet
1120 */
1121 void CsmaMacRxTrace(std::string context, Ptr<const Packet> p);
1122 /**
1123 * LTE transmit trace function
1124 * @param context the context
1125 * @param p the packet
1126 * @param m the MAC address
1127 */
1128 void LteTxTrace(std::string context, Ptr<const Packet> p, const Mac48Address& m);
1129 /**
1130 * LTE receive trace function
1131 * @param context the context
1132 * @param p the packet
1133 * @param m the MAC address
1134 */
1135 void LteRxTrace(std::string context, Ptr<const Packet> p, const Mac48Address& m);
1136 /**
1137 * LTE Spectrum Phy transmit start function
1138 * @param context the context
1139 * @param pb the packet burst
1140 */
1141 void LteSpectrumPhyTxStart(std::string context, Ptr<const PacketBurst> pb);
1142 /**
1143 * LTE Spectrum Phy receive start function
1144 * @param context the context
1145 * @param pb the packet burst
1146 */
1147 void LteSpectrumPhyRxStart(std::string context, Ptr<const PacketBurst> pb);
1148 /**
1149 * UAN Phy gen transmit trace function
1150 * @param context the context
1151 * @param p the packet
1152 */
1153 void UanPhyGenTxTrace(std::string context, Ptr<const Packet>);
1154 /**
1155 * UAN Phy gen receive trace function
1156 * @param context the context
1157 * @param p the packet
1158 */
1159 void UanPhyGenRxTrace(std::string context, Ptr<const Packet>);
1160 /**
1161 * Remaining energy trace function
1162 * @param context the context
1163 * @param previousEnergy The previous energy
1164 * @param currentEnergy The current energy
1165 */
1166 void RemainingEnergyTrace(std::string context, double previousEnergy, double currentEnergy);
1167 /**
1168 * Generic wireless transmit trace function
1169 * @param context the context
1170 * @param p the packet
1171 * @param protocolType the protocol type
1172 */
1173 void GenericWirelessTxTrace(std::string context,
1175 ProtocolType protocolType);
1176 /**
1177 * Generic wireless receive trace function
1178 * @param context the context
1179 * @param p the packet
1180 * @param protocolType the protocol type
1181 */
1182 void GenericWirelessRxTrace(std::string context,
1184 ProtocolType protocolType);
1185
1186 /// Connect callbacks function
1187 void ConnectCallbacks();
1188 /// Connect LTE function
1189 void ConnectLte();
1190 /**
1191 * Connect LTE ue function
1192 * @param n the node
1193 * @param nd the device
1194 * @param devIndex the device index
1195 */
1196 void ConnectLteUe(Ptr<Node> n, Ptr<LteUeNetDevice> nd, uint32_t devIndex);
1197 /**
1198 * Connect LTE ENB function
1199 * @param n the node
1200 * @param nd the device
1201 * @param devIndex the device index
1202 */
1204
1205 // ##### Mobility #####
1206 /**
1207 * Get position function
1208 * @param n the node
1209 * @returns the position vector
1210 */
1211 Vector GetPosition(Ptr<Node> n);
1212 /**
1213 * Update position function
1214 * @param n the node
1215 * @returns the position vector
1216 */
1217 Vector UpdatePosition(Ptr<Node> n);
1218 /**
1219 * Update position function
1220 * @param n the node
1221 * @param v the vector
1222 * @returns the position vector
1223 */
1224 Vector UpdatePosition(Ptr<Node> n, Vector v);
1225 /**
1226 * Update position function
1227 * @param ndev the device
1228 * @returns the position vector
1229 */
1230 Vector UpdatePosition(Ptr<NetDevice> ndev);
1231 /**
1232 * Node has moved function
1233 * @param n the node
1234 * @param newLocation the new location vector
1235 * @returns true if the node has moved
1236 */
1237 bool NodeHasMoved(Ptr<Node> n, Vector newLocation);
1238 /**
1239 * Get moved nodes function
1240 * @returns the list of moved nodes
1241 */
1242 std::vector<Ptr<Node>> GetMovedNodes();
1243 /**
1244 * Mobility course change trace function
1245 * @param mob the mobility model
1246 */
1248
1249 // ##### XML Helpers #####
1250
1251 /**
1252 * Write non P2P link properties function
1253 * @param id the ID
1254 * @param ipv4Address the IP address
1255 * @param channelType the channel type
1256 */
1257 void WriteNonP2pLinkProperties(uint32_t id, std::string ipv4Address, std::string channelType);
1258 /**
1259 * Write node update function
1260 * @param nodeId the node ID
1261 */
1263 /**
1264 * Output wireless packet transmit info
1265 * @param p the packet
1266 * @param pktInfo the packet info
1267 * @param animUid the UID
1268 */
1269 void OutputWirelessPacketTxInfo(Ptr<const Packet> p, AnimPacketInfo& pktInfo, uint64_t animUid);
1270 /**
1271 * Output wireless packet receive info
1272 * @param p the packet
1273 * @param pktInfo the packet info
1274 * @param animUid the UID
1275 */
1276 void OutputWirelessPacketRxInfo(Ptr<const Packet> p, AnimPacketInfo& pktInfo, uint64_t animUid);
1277 /**
1278 * Output CSMA packet function
1279 * @param p the packet
1280 * @param pktInfo the packet info
1281 */
1283 /// Write link properties function
1284 void WriteLinkProperties();
1285 /// Write IPv4 Addresses function
1286 void WriteIpv4Addresses();
1287 /// Write IPv6 Addresses function
1288 void WriteIpv6Addresses();
1289 /// Write nodes function
1290 void WriteNodes();
1291 /// Write node colors function
1292 void WriteNodeColors();
1293 /// Write node sizes function
1294 void WriteNodeSizes();
1295 /// Write node energies function
1296 void WriteNodeEnergies();
1297 /**
1298 * Write XML anim function
1299 * @param routing the routing
1300 */
1301 void WriteXmlAnim(bool routing = false);
1302 /**
1303 * Write XML update node position function
1304 * @param nodeId the node ID
1305 * @param x the X position
1306 * @param y the Y position
1307 */
1308 void WriteXmlUpdateNodePosition(uint32_t nodeId, double x, double y);
1309 /**
1310 * Write XML update node color function
1311 * @param nodeId the node ID
1312 * @param r the red color
1313 * @param g the green color
1314 * @param b the blue color
1315 */
1316 void WriteXmlUpdateNodeColor(uint32_t nodeId, uint8_t r, uint8_t g, uint8_t b);
1317 /**
1318 * Write XML update node description function
1319 * @param nodeId the node ID
1320 */
1322 /**
1323 * Write XML update node size function
1324 * @param nodeId the node ID
1325 * @param width the width
1326 * @param height the height
1327 */
1328 void WriteXmlUpdateNodeSize(uint32_t nodeId, double width, double height);
1329 /**
1330 * Write XML add resource function
1331 * @param resourceId the resource ID
1332 * @param resourcePath the resource path
1333 */
1334 void WriteXmlAddResource(uint32_t resourceId, std::string resourcePath);
1335 /**
1336 * Write XML add node counter function
1337 * @param counterId the counter ID
1338 * @param counterName the counter name
1339 * @param counterType the counter type
1340 */
1341 void WriteXmlAddNodeCounter(uint32_t counterId,
1342 std::string counterName,
1343 CounterType counterType);
1344 /**
1345 * Write XML update node image function
1346 * @param nodeId the node ID
1347 * @param resourceId the resource ID
1348 */
1349 void WriteXmlUpdateNodeImage(uint32_t nodeId, uint32_t resourceId);
1350 /**
1351 * Write XML update node counter function
1352 * @param counterId the counter ID
1353 * @param nodeId the node ID
1354 * @param value the node counter value
1355 */
1356 void WriteXmlUpdateNodeCounter(uint32_t counterId, uint32_t nodeId, double value);
1357 /**
1358 * Write XML node function
1359 * @param id the ID
1360 * @param sysId the system ID
1361 * @param locX the x location
1362 * @param locY the y location
1363 */
1364 void WriteXmlNode(uint32_t id, uint32_t sysId, double locX, double locY);
1365 /**
1366 * Write XML link counter function
1367 * @param fromId the from device
1368 * @param toLp the to device
1369 * @param toId the to ID
1370 */
1371 void WriteXmlLink(uint32_t fromId, uint32_t toLp, uint32_t toId);
1372 /**
1373 * Write XML update link counter function
1374 * @param fromId the from device
1375 * @param toId the to device
1376 * @param linkDescription the link description
1377 */
1378 void WriteXmlUpdateLink(uint32_t fromId, uint32_t toId, std::string linkDescription);
1379 /**
1380 * Write XMLP function
1381 * @param pktType the packet type
1382 * @param fId the FID
1383 * @param fbTx the FB transmit
1384 * @param lbTx the LB transmit
1385 * @param tId the TID
1386 * @param fbRx the FB receive
1387 * @param lbRx the LB receive
1388 * @param metaInfo the meta info
1389 */
1390 void WriteXmlP(std::string pktType,
1391 uint32_t fId,
1392 double fbTx,
1393 double lbTx,
1394 uint32_t tId,
1395 double fbRx,
1396 double lbRx,
1397 std::string metaInfo = "");
1398 /**
1399 * Write XMLP function
1400 * @param animUid the UID
1401 * @param pktType the packet type
1402 * @param fId the FID
1403 * @param fbTx the FB transmit
1404 * @param lbTx the LB transmit
1405 */
1406 void WriteXmlP(uint64_t animUid, std::string pktType, uint32_t fId, double fbTx, double lbTx);
1407 /**
1408 * Write XMLP Ref function
1409 * @param animUid the UID
1410 * @param fId the FID
1411 * @param fbTx the FB transmit
1412 * @param metaInfo the meta info
1413 */
1414 void WriteXmlPRef(uint64_t animUid, uint32_t fId, double fbTx, std::string metaInfo = "");
1415 /**
1416 * Write XML close function
1417 * @param name the name
1418 * @param routing true if routing
1419 */
1420 void WriteXmlClose(std::string name, bool routing = false);
1421 /**
1422 * Write XML non P2P link properties function
1423 * @param id the ID
1424 * @param ipAddress the IP address
1425 * @param channelType the channel type
1426 */
1427 void WriteXmlNonP2pLinkProperties(uint32_t id, std::string ipAddress, std::string channelType);
1428 /**
1429 * Write XML routing function
1430 * @param id the ID
1431 * @param routingInfo the routing info
1432 */
1433 void WriteXmlRouting(uint32_t id, std::string routingInfo);
1434 /**
1435 * Write XMLRP function
1436 * @param nodeId the node ID
1437 * @param destination the destination
1438 * @param rpElements the route path elements
1439 */
1440 void WriteXmlRp(uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements);
1441 /**
1442 * Write XML update background function
1443 * @param fileName the file name
1444 * @param x the X value
1445 * @param y the Y value
1446 * @param scaleX the X scale
1447 * @param scaleY the Y scale
1448 * @param opacity the opacity
1449 */
1450 void WriteXmlUpdateBackground(std::string fileName,
1451 double x,
1452 double y,
1453 double scaleX,
1454 double scaleY,
1455 double opacity);
1456 /**
1457 * Write XML Ipv4 addresses function
1458 * @param nodeId the node ID
1459 * @param ipv4Addresses the list of Ipv4 addresses
1460 */
1461 void WriteXmlIpv4Addresses(uint32_t nodeId, std::vector<std::string> ipv4Addresses);
1462 /**
1463 * Write XML Ipv6 addresses function
1464 * @param nodeId the node ID
1465 * @param ipv6Addresses the list of Ipv6 addresses
1466 */
1467 void WriteXmlIpv6Addresses(uint32_t nodeId, std::vector<std::string> ipv6Addresses);
1468};
1469
1470/**
1471 * @ingroup netanim
1472 *
1473 * @brief Byte tag using by Anim to uniquely identify packets
1474 *
1475 * When Anim receives a Tx Notification we tag the packet with a unique global uint64_t identifier
1476 * before recording Tx information
1477 * When Anim receives Rx notifications the tag is used to retrieve Tx information recorded earlier
1478 */
1479
1480class AnimByteTag : public Tag
1481{
1482 public:
1483 /**
1484 * @brief Get Type Id
1485 * @returns Type Id
1486 */
1487 static TypeId GetTypeId();
1488
1489 /**
1490 * @brief Get Instance Type Id
1491 * @returns Type Id
1492 */
1493 TypeId GetInstanceTypeId() const override;
1494
1495 /**
1496 * @brief Get Serialized Size
1497 * @returns Serialized Size (i.e size of uint64_t)
1498 */
1499 uint32_t GetSerializedSize() const override;
1500
1501 /**
1502 * @brief Serialize function
1503 * @param i Tag Buffer
1504 */
1505 void Serialize(TagBuffer i) const override;
1506
1507 /**
1508 * @brief Deserialize function
1509 * @param i Tag Buffer
1510 */
1511 void Deserialize(TagBuffer i) override;
1512
1513 /**
1514 * @brief Print tag info
1515 * @param os Reference of ostream object
1516 */
1517 void Print(std::ostream& os) const override;
1518
1519 /**
1520 * @brief Set global Uid in tag
1521 * @param AnimUid global Uid
1522 */
1523 void Set(uint64_t AnimUid);
1524
1525 /**
1526 * @brief Get Uid in tag
1527 * @returns Uid in tag
1528 */
1529 uint64_t Get() const;
1530
1531 private:
1532 uint64_t m_AnimUid; ///< the UID
1533};
1534
1535} // namespace ns3
1536#endif
Byte tag using by Anim to uniquely identify packets.
TypeId GetInstanceTypeId() const override
Get Instance Type Id.
void Serialize(TagBuffer i) const override
Serialize function.
void Print(std::ostream &os) const override
Print tag info.
uint32_t GetSerializedSize() const override
Get Serialized Size.
uint64_t Get() const
Get Uid in tag.
static TypeId GetTypeId()
Get Type Id.
void Deserialize(TagBuffer i) override
Deserialize function.
uint64_t m_AnimUid
the UID
void Set(uint64_t AnimUid)
Set global Uid in tag.
Ptr< const NetDevice > m_txnd
transmit device
void ProcessRxBegin(Ptr< const NetDevice > nd, const double fbRx)
Process receive begin.
Ptr< const NetDevice > m_rxnd
receive device
void AppendChild(AnimXmlElement e)
Append child function.
std::vector< std::string > m_children
list of children
void SetText(std::string text)
Set text function.
std::vector< std::string > m_attributes
list of attributes
std::string ToString(bool autoClose=true)
Get text for the element function.
AnimXmlElement(std::string tagName, bool emptyElement=true)
Constructor.
void AddAttribute(std::string attribute, T value, bool xmlEscape=false)
Add attribute function.
Interface to network animator.
FILE * m_f
File handle for output (0 if none)
Time m_wifiMacCountersPollInterval
wifi MAC counters poll interval
void CsmaPhyRxEndTrace(std::string context, Ptr< const Packet > p)
CSMA Phy receive end trace function.
void WriteNodeSizes()
Write node sizes function.
uint32_t AddNodeCounter(std::string counterName, CounterType counterType)
Setup a node counter.
void TrackQueueCounters()
Track queue counters function.
void SetMobilityPollInterval(Time t)
Set mobility poll interval:WARNING: setting a low interval can cause slowness.
uint32_t m_wifiMacRxCounterId
wifi MAC receive counter ID
bool IsPacketPending(uint64_t animUid, ProtocolType protocolType)
Is packet pending function.
bool NodeHasMoved(Ptr< Node > n, Vector newLocation)
Node has moved function.
void LrWpanPhyTxBeginTrace(std::string context, Ptr< const Packet > p)
LR-WPAN Phy receive begin trace function.
uint32_t m_queueDropCounterId
queue drop counter ID
void WimaxTxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &m)
WIMax transmit trace function.
void LrWpanPhyRxBeginTrace(std::string context, Ptr< const Packet > p)
LR-WPAN Phy receive begin trace function.
Time m_routingPollInterval
routing poll interval
void OutputCsmaPacket(Ptr< const Packet > p, AnimPacketInfo &pktInfo)
Output CSMA packet function.
uint64_t GetAnimUidFromPacket(Ptr< const Packet >)
Get anim UID from packet function.
EnergyFractionMap m_nodeEnergyFraction
node energy fraction
void GenericWirelessTxTrace(std::string context, Ptr< const Packet > p, ProtocolType protocolType)
Generic wireless transmit trace function.
std::map< uint32_t, Rgb > NodeColorsMap
NodeColorsMap typedef.
void LteRxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &m)
LTE receive trace function.
std::string ProtocolTypeToString(ProtocolType protocolType)
Protocol type to string function.
NodeCounterMap64 m_nodeLrWpanMacRx
node LR-WPAN MAC receive
std::string m_routingFileName
routing file name
NodeCounterMap64 m_nodeIpv4Tx
node IPv4 transmit
std::map< std::string, uint32_t > m_ipv6ToNodeIdMap
IPv6 to node ID map.
void MobilityAutoCheck()
Mobility auto check function.
void WriteXmlRouting(uint32_t id, std::string routingInfo)
Write XML routing function.
void WifiPhyRxDropTrace(std::string context, Ptr< const Packet > p, WifiPhyRxfailureReason reason)
wifi Phy receive drop trace function
void WifiMacRxDropTrace(std::string context, Ptr< const Packet > p)
wifi MAC receive drop trace function
NodeCounterMap64 m_nodeQueueDrop
node queue drop
void ConnectLteUe(Ptr< Node > n, Ptr< LteUeNetDevice > nd, uint32_t devIndex)
Connect LTE ue function.
void DequeueTrace(std::string context, Ptr< const Packet >)
Dequeue trace function.
void ConnectCallbacks()
Connect callbacks function.
void WriteRoutePath(uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements)
Write route path function.
AnimUidPacketInfoMap * ProtocolTypeToPendingPackets(ProtocolType protocolType)
Protocol type to pending packets function.
void RemainingEnergyTrace(std::string context, double previousEnergy, double currentEnergy)
Remaining energy trace function.
void Ipv4DropTrace(std::string context, const Ipv4Header &ipv4Header, Ptr< const Packet > p, Ipv4L3Protocol::DropReason dropReason, Ptr< Ipv4 > ipv4, uint32_t interfaceIndex)
IPv4 drop trace function.
NodeColorsMap m_nodeColors
node colors
std::multimap< uint32_t, std::string > NodeIdIpv6Map
NodeIdIpv6Map typedef.
void UpdateNodeCounter(uint32_t nodeCounterId, uint32_t nodeId, double counter)
Helper function to update a node's counter referenced by the nodeCounterId.
void WifiPhyRxBeginTrace(std::string context, Ptr< const Packet > p, RxPowerWattPerChannelBand rxPowersW)
wifi Phy receive begin trace function
void LrWpanMacRxDropTrace(std::string context, Ptr< const Packet > p)
LR-WPAN MAC receive drop trace function.
void LteSpectrumPhyTxStart(std::string context, Ptr< const PacketBurst > pb)
LTE Spectrum Phy transmit start function.
NodeCounterMap64 m_nodeLrWpanMacTx
node LR-WPAN MAC transmit
void WriteXmlAddNodeCounter(uint32_t counterId, std::string counterName, CounterType counterType)
Write XML add node counter function.
void WriteXmlPRef(uint64_t animUid, uint32_t fId, double fbTx, std::string metaInfo="")
Write XMLP Ref function.
NodeCounterMap64 m_nodeWifiPhyTxDrop
node wifi Phy transmit drop
void WriteLinkProperties()
Write link properties function.
void WriteIpv4Addresses()
Write IPv4 Addresses function.
const std::vector< std::string > GetElementsFromContext(const std::string &context) const
Get elements from context.
void WriteXmlAddResource(uint32_t resourceId, std::string resourcePath)
Write XML add resource function.
void OutputWirelessPacketTxInfo(Ptr< const Packet > p, AnimPacketInfo &pktInfo, uint64_t animUid)
Output wireless packet transmit info.
void LteSpectrumPhyRxStart(std::string context, Ptr< const PacketBurst > pb)
LTE Spectrum Phy receive start function.
void SetOutputFile(const std::string &fn, bool routing=false)
Set output file function.
NodeCounterMap64 m_nodeWifiMacTx
node wifi MAC transmit
std::map< uint32_t, std::string > NodeDescriptionsMap
NodeDescriptionsMap typedef.
AnimUidPacketInfoMap m_pendingWimaxPackets
pending wimax packets
void LteTxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &m)
LTE transmit trace function.
void EnableIpv4L3ProtocolCounters(Time startTime, Time stopTime, Time pollInterval=Seconds(1))
Enable tracking of Ipv4 L3 Protocol Counters such as Tx, Rx, Drop.
int WriteN(const char *data, uint32_t count, FILE *f)
WriteN function.
std::map< std::string, uint32_t > m_macToNodeIdMap
MAC to node ID map.
Ptr< Node > GetNodeFromContext(const std::string &context) const
Get node from context.
std::map< uint32_t, Vector > m_nodeLocation
node location
Ptr< NetDevice > GetNetDeviceFromContext(std::string context)
Get net device from context.
FILE * m_routingF
File handle for routing table output (0 if None);.
void UpdateNodeImage(uint32_t nodeId, uint32_t resourceId)
Helper function to update the image of a node.
void TrackWifiPhyCounters()
Track wifi phy counters function.
AnimUidPacketInfoMap m_pendingUanPackets
pending UAN packets
void TrackIpv4RoutePaths()
Track IPv4 route paths function.
double GetNodeEnergyFraction(Ptr< const Node > node) const
Get node's energy fraction (This used only for testing)
bool IsInTimeWindow()
Is in time window function.
void CsmaPhyTxBeginTrace(std::string context, Ptr< const Packet > p)
CSMA Phy transmit begin trace function.
bool m_enablePacketMetadata
enable packet metadata
void PurgePendingPackets(ProtocolType protocolType)
Purge pending packets function.
void SetMaxPktsPerTraceFile(uint64_t maxPktsPerFile)
Set Max packets per trace file.
uint64_t m_maxPktsPerFile
maximum packets per file
uint32_t m_ipv4L3ProtocolRxCounterId
IPv4 L3 protocol receive counter ID.
NodeCounterMap64 m_nodeIpv4Rx
node IPv4 receive
~AnimationInterface()
Destructor for the animator interface.
void AddToIpv4AddressNodeIdTable(std::string ipv4Address, uint32_t nodeId)
Add to IPv4 address node ID table function.
NodeIdIpv4Map m_nodeIdIpv4Map
node ID to IPv4 map
Time m_queueCountersPollInterval
queue counters poll interval
std::map< P2pLinkNodeIdPair, LinkProperties, LinkPairCompare > LinkPropertiesMap
LinkPropertiesMap typedef.
std::vector< std::string > GetIpv6Addresses(Ptr< NetDevice > nd)
Get IPv6 addresses.
void UpdateLinkDescription(uint32_t fromNode, uint32_t toNode, std::string linkDescription)
Helper function to update the description for a link.
void Ipv4RxTrace(std::string context, Ptr< const Packet > p, Ptr< Ipv4 > ipv4, uint32_t interfaceIndex)
IPv4 receive trace function.
NodeCounterMap64 m_nodeQueueEnqueue
node queue enqueue
void WriteXmlUpdateNodeCounter(uint32_t counterId, uint32_t nodeId, double value)
Write XML update node counter function.
std::vector< std::string > GetIpv4Addresses(Ptr< NetDevice > nd)
Get IPv4 addresses.
Time m_wifiPhyCountersPollInterval
wifi Phy counters poll interval
uint32_t m_queueDequeueCounterId
queue dequeue counter ID
NodeCounterMap64 m_nodeWifiMacRx
node wifi MAC receive
void AddToIpv6AddressNodeIdTable(std::string ipv6Address, uint32_t nodeId)
Add to IPv6 address node ID table function.
AnimationInterface & AddSourceDestination(uint32_t fromNodeId, std::string destinationIpv4Address)
Helper function to print the routing path from a source node to destination IP.
NodeCounterMap64 m_nodeIpv4Drop
node IPv4 drop
Time m_ipv4L3ProtocolCountersStopTime
IPv4 L3 protocol counters stop time.
uint32_t m_queueEnqueueCounterId
queue enqueue counter ID
void AddByteTag(uint64_t animUid, Ptr< const Packet > p)
Add byte tag function.
Time m_ipv4L3ProtocolCountersPollInterval
IPv4 L3 protocol counters poll interval.
void WriteNonP2pLinkProperties(uint32_t id, std::string ipv4Address, std::string channelType)
Write non P2P link properties function.
void StopAnimation(bool onlyAnimation=false)
Stop animation function.
std::vector< Ipv4RoutePathElement > Ipv4RoutePathElements
Ipv4RoutePathElements typedef.
void UanPhyGenTxTrace(std::string context, Ptr< const Packet >)
UAN Phy gen transmit trace function.
void WifiMacTxDropTrace(std::string context, Ptr< const Packet > p)
wifi MAC transmit drop trace function
uint32_t m_ipv4L3ProtocolTxCounterId
IPv4 L3 protocol transmit counter ID.
Time m_queueCountersStopTime
queue counters stop time
std::string CounterTypeToString(CounterType counterType)
Counter type to string function.
ProtocolType
ProtocolType enumeration.
std::string GetMacAddress(Ptr< NetDevice > nd)
Get MAC address function.
std::vector< Ptr< Node > > GetMovedNodes()
Get moved nodes function.
uint32_t m_wifiMacTxCounterId
wifi MAC transmit counter ID
void SkipPacketTracing()
Do not trace packets.
NodeCounterMap64 m_nodeWifiMacRxDrop
node wifi MAC receive drop
NodeDescriptionsMap m_nodeDescriptions
node description
void WriteXmlAnim(bool routing=false)
Write XML anim function.
std::map< uint32_t, double > EnergyFractionMap
EnergyFractionMap typedef.
void SetStartTime(Time t)
Specify the time at which capture should start.
uint32_t AddResource(std::string resourcePath)
Add a resource such as the path to an image file.
AnimationInterface(const std::string filename)
Constructor.
std::string GetIpv6Address(Ptr< NetDevice > nd)
Get IPv6 address.
void WriteNodeEnergies()
Write node energies function.
std::map< uint32_t, uint64_t > NodeCounterMap64
NodeCounterMap64 typedef.
static Rectangle * userBoundary
user boundary
void CsmaMacRxTrace(std::string context, Ptr< const Packet > p)
CSMA MAC receive trace function.
void WifiPhyTxBeginTrace(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
wifi Phy transmit PSDU begin trace function
void UanPhyGenRxTrace(std::string context, Ptr< const Packet >)
UAN Phy gen receive trace function.
LinkPropertiesMap m_linkProperties
link properties
void WriteXmlUpdateNodeDescription(uint32_t nodeId)
Write XML update node description function.
void UpdateNodeSize(Ptr< Node > n, double width, double height)
Helper function to update the size of a node.
std::map< uint32_t, NodeSize > m_nodeSizes
node sizes
std::pair< uint32_t, std::string > NodeIdIpv6Pair
NodeIdIpv6Pair typedef.
void(* AnimWriteCallback)(const char *str)
typedef for WriteCallBack used for listening to AnimationInterface write messages
void ConnectLte()
Connect LTE function.
bool m_trackPackets
track packets
std::string GetNetAnimVersion()
Get netanim version function.
void WriteXmlNonP2pLinkProperties(uint32_t id, std::string ipAddress, std::string channelType)
Write XML non P2P link properties function.
AnimationInterface & EnableIpv4RouteTracking(std::string fileName, Time startTime, Time stopTime, Time pollInterval=Seconds(5))
Enable tracking of the Ipv4 routing table for all Nodes.
void WriteXmlClose(std::string name, bool routing=false)
Write XML close function.
uint64_t gAnimUid
Packet unique identifier used by AnimationInterface.
void CheckMaxPktsPerTraceFile()
Check maximum packets per trace file function.
NodeCounterMap64 m_nodeLrWpanMacTxDrop
node LR-WPAN MAC transmit drop
NodeIdIpv6Map m_nodeIdIpv6Map
node ID to IPv6 map
void TrackIpv4Route()
Track IPv4 router function.
void EnableWifiPhyCounters(Time startTime, Time stopTime, Time pollInterval=Seconds(1))
Enable tracking of Wifi Phy Counters such as TxDrop, RxDrop.
AnimUidPacketInfoMap m_pendingWifiPackets
pending wifi packets
void EnablePacketMetadata(bool enable=true)
Enable Packet metadata.
Time m_routingStopTime
routing stop time
void SetStopTime(Time t)
Specify the time at which capture should stop.
void MobilityCourseChangeTrace(Ptr< const MobilityModel > mob)
Mobility course change trace function.
void EnableWifiMacCounters(Time startTime, Time stopTime, Time pollInterval=Seconds(1))
Enable tracking of Wifi Mac Counters such as Tx, TxDrop, Rx, RxDrop.
void WriteXmlP(std::string pktType, uint32_t fId, double fbTx, double lbTx, uint32_t tId, double fbRx, double lbRx, std::string metaInfo="")
Write XMLP function.
uint32_t m_wifiMacTxDropCounterId
wifi MAC transmit drop counter ID
void WriteXmlRp(uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements)
Write XMLRP function.
AnimUidPacketInfoMap m_pendingLrWpanPackets
pending LR-WPAN packets
void WifiMacTxTrace(std::string context, Ptr< const Packet > p)
wifi MAC transmit trace function
void ResetAnimWriteCallback()
Reset the write callback function.
void WimaxRxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &m)
WIMax receive trace function.
void LrWpanMacTxDropTrace(std::string context, Ptr< const Packet > p)
LR-WPAN MAC transmit drop trace function.
void LrWpanMacRxTrace(std::string context, Ptr< const Packet > p)
LR-WPAN MAC receive trace function.
std::vector< std::string > m_nodeCounters
node counters
void WriteXmlNode(uint32_t id, uint32_t sysId, double locX, double locY)
Write XML node function.
AnimWriteCallback m_writeCallback
write callback
NodeCounterMap64 m_nodeWifiMacTxDrop
node wifi MAC transmit drop
uint64_t m_currentPktCount
current packet count
std::string GetIpv4RoutingTable(Ptr< Node > n)
Get IPv4 routing table function.
void Ipv4TxTrace(std::string context, Ptr< const Packet > p, Ptr< Ipv4 > ipv4, uint32_t interfaceIndex)
IPv4 transmit trace function.
std::pair< uint32_t, std::string > NodeIdIpv4Pair
NodeIdIpv4Pair typedef.
void EnqueueTrace(std::string context, Ptr< const Packet >)
Enqueue trace function.
uint64_t GetTracePktCount() const
Get trace file packet count (This used only for testing)
void WriteXmlUpdateNodeColor(uint32_t nodeId, uint8_t r, uint8_t g, uint8_t b)
Write XML update node color function.
Vector UpdatePosition(Ptr< Node > n)
Update position function.
std::string m_outputFileName
output file name
void WriteIpv6Addresses()
Write IPv6 Addresses function.
void AddPendingPacket(ProtocolType protocolType, uint64_t animUid, AnimPacketInfo pktInfo)
Add pending packet function.
NodeCounterMap64 m_nodeWifiPhyRxDrop
node wifi Phy receive drop
void WriteXmlIpv4Addresses(uint32_t nodeId, std::vector< std::string > ipv4Addresses)
Write XML Ipv4 addresses function.
Vector GetPosition(Ptr< Node > n)
Get position function.
AnimUidPacketInfoMap m_pendingLtePackets
pending LTE packets
void SetBackgroundImage(std::string fileName, double x, double y, double scaleX, double scaleY, double opacity)
Helper function to set the background image.
void WriteNodes()
Write nodes function.
NodeCounterMap64 m_nodeLrWpanMacRxDrop
node LR-WPAN MAC receive drop
Time m_wifiMacCountersStopTime
wifi MAC counters stop time
void WriteNodeColors()
Write node colors function.
void RecursiveIpv4RoutePathSearch(std::string from, std::string to, Ipv4RoutePathElements &rpElements)
Recursive IPv4 route path search function.
static bool IsInitialized()
Check if AnimationInterface is initialized.
void LrWpanMacTxTrace(std::string context, Ptr< const Packet > p)
LR-WPAN MAC transmit trace function.
void WriteXmlUpdateBackground(std::string fileName, double x, double y, double scaleX, double scaleY, double opacity)
Write XML update background function.
void CsmaPhyTxEndTrace(std::string context, Ptr< const Packet > p)
CSMA Phy transmit end trace function.
void WriteXmlUpdateNodeSize(uint32_t nodeId, double width, double height)
Write XML update node size function.
uint32_t m_remainingEnergyCounterId
remaining energy counter ID
void WriteXmlUpdateNodeImage(uint32_t nodeId, uint32_t resourceId)
Write XML update node image function.
uint32_t m_wifiMacRxDropCounterId
wifi MAC receive drop counter ID
void TrackWifiMacCounters()
Track wifi MAC counters function.
void WriteNodeUpdate(uint32_t nodeId)
Write node update function.
std::string m_originalFileName
original file name
void UpdateNodeDescription(Ptr< Node > n, std::string descr)
Helper function to update the description for a given node.
void UpdateNodeColor(Ptr< Node > n, uint8_t r, uint8_t g, uint8_t b)
Helper function to update the node color.
static void SetConstantPosition(Ptr< Node > n, double x, double y, double z=0)
Helper function to set Constant Position for a given node.
NodeCounterMap64 m_nodeQueueDequeue
node queue dequeue
void WifiPhyTxDropTrace(std::string context, Ptr< const Packet > p)
wifi Phy transmit drop trace function
uint32_t m_wifiPhyRxDropCounterId
wifi Phy receive drop counter ID
void WriteXmlUpdateLink(uint32_t fromId, uint32_t toId, std::string linkDescription)
Write XML update link counter function.
void ConnectLteEnb(Ptr< Node > n, Ptr< LteEnbNetDevice > nd, uint32_t devIndex)
Connect LTE ENB function.
void GenericWirelessRxTrace(std::string context, Ptr< const Packet > p, ProtocolType protocolType)
Generic wireless receive trace function.
std::string GetPacketMetadata(Ptr< const Packet > p)
Get packet metadata function.
uint32_t m_wifiPhyTxDropCounterId
wifi Phy transmit drop counter ID
std::vector< Ipv4RouteTrackElement > m_ipv4RouteTrackElements
IPv route track elements.
std::multimap< uint32_t, std::string > NodeIdIpv4Map
NodeIdIpv4Map typedef.
void EnableQueueCounters(Time startTime, Time stopTime, Time pollInterval=Seconds(1))
Enable tracking of Queue Counters such as Enqueue, Dequeue, Queue Drops.
uint32_t m_ipv4L3ProtocolDropCounterId
IPv4 protocol drop counter ID.
Time m_wifiPhyCountersStopTime
wifi Phy counters stop time
Time m_mobilityPollInterval
mobility poll interval
void OutputWirelessPacketRxInfo(Ptr< const Packet > p, AnimPacketInfo &pktInfo, uint64_t animUid)
Output wireless packet receive info.
std::map< std::string, uint32_t > m_ipv4ToNodeIdMap
IPv4 to node ID map.
AnimUidPacketInfoMap m_pendingCsmaPackets
pending CSMA packets
std::vector< std::string > m_resources
resources
void TrackIpv4L3ProtocolCounters()
Track IPv4 L3 protocol counters function.
void WriteXmlUpdateNodePosition(uint32_t nodeId, double x, double y)
Write XML update node position function.
void StartAnimation(bool restart=false)
Start animation function.
void DevTxTrace(std::string context, Ptr< const Packet > p, Ptr< NetDevice > tx, Ptr< NetDevice > rx, Time txTime, Time rxTime)
Device transmit trace function.
std::string GetIpv4Address(Ptr< NetDevice > nd)
Get IPv4 address.
void WifiMacRxTrace(std::string context, Ptr< const Packet > p)
wifi MAC receive trace function
bool IsStarted() const
Is AnimationInterface started.
void WriteXmlIpv6Addresses(uint32_t nodeId, std::vector< std::string > ipv6Addresses)
Write XML Ipv6 addresses function.
NodeContainer m_routingNc
routing node container
void SetAnimWriteCallback(AnimWriteCallback cb)
Set a callback function to listen to AnimationInterface write events.
void QueueDropTrace(std::string context, Ptr< const Packet >)
Queue trace function.
void WriteXmlLink(uint32_t fromId, uint32_t toLp, uint32_t toId)
Write XML link counter function.
std::map< uint64_t, AnimPacketInfo > AnimUidPacketInfoMap
AnimUidPacketInfoMap typedef.
Packet header for IPv4.
Definition ipv4-header.h:23
DropReason
Reason why a packet has been dropped.
an EUI-48 address
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
a 2d rectangle
Definition rectangle.h:24
read and write tag data
Definition tag-buffer.h:41
tag a set of bytes in a packet
Definition tag.h:28
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Time stopTime
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
Definition first.py:1
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
Definition phy-entity.h:45
uint8_t data[writeSize]
Ipv4RoutePathElement structure IPv4 route path element.
Ipv4RouteTrackElement structure IPv4 route track element.
NodeSize structure node size.
RGB structure RGB structure.