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