A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 http://dev.osll.ru/)
18  */
19 
20 // Interface between ns3 and the network animator
21 
22 #ifndef ANIMATION_INTERFACE__H
23 #define ANIMATION_INTERFACE__H
24 
25 #include <string>
26 #include <cstdio>
27 #include <map>
28 #include "ns3/ptr.h"
29 #include "ns3/net-device.h"
30 #include "ns3/node-container.h"
31 #include "ns3/nstime.h"
32 #include "ns3/log.h"
33 #include "ns3/node-list.h"
34 #include "ns3/random-variable-stream.h"
35 #include "ns3/simulator.h"
36 #include "ns3/config.h"
37 #include "ns3/animation-interface-helper.h"
38 #include "ns3/mac48-address.h"
39 #include "ns3/lte-ue-net-device.h"
40 #include "ns3/lte-enb-net-device.h"
41 #include "ns3/uan-phy-gen.h"
42 #include "ns3/rectangle.h"
43 
44 namespace ns3 {
45 
46 #define MAX_PKTS_PER_TRACE_FILE 100000
47 struct Rgb;
48 typedef struct
49 {
50  uint32_t fromNode;
51  uint32_t toNode;
53 
54 typedef struct
55 {
56  std::string fromNodeDescription;
57  std::string toNodeDescription;
58  std::string linkDescription;
60 
62 {
64  {
65  //Check if they are the same node pairs but flipped
66  if ( ((first.fromNode == second.fromNode) && (first.toNode == second.toNode)) ||
67  ((first.fromNode == second.toNode) && (first.toNode == second.fromNode)) )
68  {
69  return false;
70  }
71  std::ostringstream oss1;
72  oss1 << first.fromNode << first.toNode;
73  std::ostringstream oss2;
74  oss2 << second.fromNode << second.toNode;
75  return oss1.str () < oss2.str ();
76  }
77 
78 };
79 
81  std::string destination;
82  uint32_t fromNodeId;
83 };
84 
85 
86 typedef struct {
87  uint32_t nodeId;
88  std::string nextHop;
89 
91 
107 {
108 public:
109 
120  AnimationInterface (const std::string filename,
121  uint64_t maxPktsPerFile = MAX_PKTS_PER_TRACE_FILE,
122  bool usingXML = true);
123 
129 
141  AnimationInterface & EnableIpv4RouteTracking (std::string fileName, Time startTime, Time stopTime, Time pollInterval = Seconds (5));
142 
155  AnimationInterface & EnableIpv4RouteTracking (std::string fileName, Time startTime, Time stopTime, NodeContainer nc, Time pollInterval = Seconds (5));
156 
162  static bool IsInitialized (void);
163 
171  void SetStartTime (Time t);
172 
180  void SetStopTime (Time t);
181 
190  void SetMobilityPollInterval (Time t);
191 
199  void SetRandomPosition (bool setRandPos);
200 
206  typedef void (*AnimWriteCallback) (const char * str);
207 
215 
220  void ResetAnimWriteCallback ();
221 
230  static void SetConstantPosition (Ptr <Node> n, double x, double y, double z=0);
231 
240  static void SetBoundary (double minX, double minY, double maxX, double maxY);
241 
248  static void SetNodeDescription (Ptr <Node> n, std::string descr);
249 
256  void UpdateNodeDescription (Ptr <Node> n, std::string descr);
257 
264  void UpdateNodeDescription (uint32_t nodeId, std::string descr);
265 
272  void ShowNode (uint32_t nodeId, bool show = true);
273 
280  void ShowNode (Ptr <Node> n, bool show = true);
281 
288  static void SetNodeDescription (NodeContainer nc, std::string descr);
289 
298  static void SetNodeColor (Ptr <Node> n, uint8_t r, uint8_t g, uint8_t b);
299 
300 
309  void UpdateNodeColor (Ptr <Node> n, uint8_t r, uint8_t g, uint8_t b);
310 
319  void UpdateNodeColor (uint32_t nodeId, uint8_t r, uint8_t g, uint8_t b);
320 
321 
330  static void SetNodeColor (NodeContainer nc, uint8_t r, uint8_t g, uint8_t b);
331 
341  static void SetLinkDescription (uint32_t fromNode, uint32_t toNode,
342  std::string linkDescription,
343  std::string fromNodeDescription = "",
344  std::string toNodeDescription = "");
345 
355  static void SetLinkDescription (Ptr <Node> fromNode, Ptr <Node> toNode,
356  std::string linkDescription,
357  std::string fromNodeDescription = "",
358  std::string toNodeDescription = "");
359 
360 
368  void UpdateLinkDescription (uint32_t fromNode, uint32_t toNode,
369  std::string linkDescription);
370 
378  void UpdateLinkDescription (Ptr <Node> fromNode, Ptr <Node> toNode,
379  std::string linkDescription);
380 
388  AnimationInterface & AddSourceDestination (uint32_t fromNodeId, std::string destinationIpv4Address);
389 
395  bool IsStarted (void);
396 
403  void EnablePacketMetadata (bool enable);
404 
412  uint64_t GetTracePktCount ();
413 
421  double GetNodeEnergyFraction (Ptr <const Node> node) const;
422 
431  int64_t AssignStreams (int64_t stream);
432 
433 private:
434  FILE * m_f; // File handle for output (0 if none)
435  FILE * m_routingF; // File handle for routing table output (0 if None);
436  // Write specified amount of data to the specified handle
437  int WriteN (const char*, uint32_t, FILE * f);
438  bool m_xml; // True if xml format desired
440  std::string m_outputFileName;
442  uint64_t gAnimUid ; // Packet unique identifier used by Animtion
445  bool m_started;
450  std::string m_originalFileName;
452  std::string m_routingFileName;
455 
456  void TrackIpv4Route ();
457  void TrackIpv4RoutePaths ();
458  std::string GetIpv4RoutingTable (Ptr <Node> n);
459 
471  bool SetOutputFile (const std::string& fn);
472  bool SetRoutingOutputFile (const std::string& fn);
473 
481  void SetXMLOutput ();
482 
494  void StartAnimation (bool restart = false);
495 
500  void StopAnimation (bool onlyAnimation = false);
501 
502  void DevTxTrace (std::string context,
504  Ptr<NetDevice> tx,
505  Ptr<NetDevice> rx,
506  Time txTime,
507  Time rxTime);
508  void WifiPhyTxBeginTrace (std::string context,
510  void WifiPhyTxEndTrace (std::string context,
512  void WifiPhyTxDropTrace (std::string context,
514  void WifiPhyRxBeginTrace (std::string context,
516  void WifiPhyRxEndTrace (std::string context,
518  void WifiMacRxTrace (std::string context,
520  void WifiPhyRxDropTrace (std::string context,
522  void WimaxTxTrace (std::string context,
524  const Mac48Address &);
525  void WimaxRxTrace (std::string context,
527  const Mac48Address &);
528  void CsmaPhyTxBeginTrace (std::string context,
530  void CsmaPhyTxEndTrace (std::string context,
532  void CsmaPhyRxEndTrace (std::string context,
534  void CsmaMacRxTrace (std::string context,
536 
537  void LteTxTrace (std::string context,
539  const Mac48Address &);
540 
541  void LteRxTrace (std::string context,
543  const Mac48Address &);
544 
545  void LteSpectrumPhyTxStart (std::string context,
547  void LteSpectrumPhyRxStart (std::string context,
549 
550  void UanPhyGenTxTrace (std::string context,
552  void UanPhyGenRxTrace (std::string context,
554 
555  void RemainingEnergyTrace (std::string context, double previousEnergy, double currentEnergy);
556 
558 
559  // Write a string to the specified handle;
560  int WriteN (const std::string&, FILE * f);
561 
562  void OutputWirelessPacket (Ptr<const Packet> p, AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
563  void OutputCsmaPacket (Ptr<const Packet> p, AnimPacketInfo& pktInfo, AnimRxInfo pktrxInfo);
564  void MobilityAutoCheck ();
565 
566 
567  std::map<uint64_t, AnimPacketInfo> m_pendingWifiPackets;
568  void AddPendingWifiPacket (uint64_t AnimUid, AnimPacketInfo&);
569  bool WifiPacketIsPending (uint64_t AnimUid);
570 
571  std::map<uint64_t, AnimPacketInfo> m_pendingWimaxPackets;
572  void AddPendingWimaxPacket (uint64_t AnimUid, AnimPacketInfo&);
573  bool WimaxPacketIsPending (uint64_t AnimUid);
574 
575  std::map<uint64_t, AnimPacketInfo> m_pendingLtePackets;
576  void AddPendingLtePacket (uint64_t AnimUid, AnimPacketInfo&);
577  bool LtePacketIsPending (uint64_t AnimUid);
578 
579  std::map<uint64_t, AnimPacketInfo> m_pendingCsmaPackets;
580  void AddPendingCsmaPacket (uint64_t AnimUid, AnimPacketInfo&);
581  bool CsmaPacketIsPending (uint64_t AnimUid);
582 
583  std::map<uint64_t, AnimPacketInfo> m_pendingUanPackets;
584  void AddPendingUanPacket (uint64_t AnimUid, AnimPacketInfo&);
585  bool UanPacketIsPending (uint64_t AnimUid);
586 
588 
589  std::map<uint32_t, Vector> m_nodeLocation;
593  void WriteDummyPacket ();
594  bool NodeHasMoved (Ptr <Node> n, Vector newLocation);
595 
596  void PurgePendingWifi ();
597  void PurgePendingWimax ();
598  void PurgePendingLte ();
599  void PurgePendingCsma ();
600 
601  // Recalculate topology bounds
602  void RecalcTopoBounds (Vector v);
603  std::vector < Ptr <Node> > RecalcTopoBounds ();
604 
605  void ConnectCallbacks ();
606  void ConnectLte ();
607  void ConnectLteUe (Ptr <Node> n, Ptr <LteUeNetDevice> nd, uint32_t devIndex);
608  void ConnectLteEnb (Ptr <Node> n, Ptr <LteEnbNetDevice> nd, uint32_t devIndex);
609 
610 
611  std::map <std::string, uint32_t> m_macToNodeIdMap;
612  std::map <std::string, uint32_t> m_ipv4ToNodeIdMap;
613  void AddToIpv4AddressNodeIdTable (std::string, uint32_t);
614  std::vector <Ipv4RouteTrackElement> m_ipv4RouteTrackElements;
615  typedef std::vector <Ipv4RoutePathElement> Ipv4RoutePathElements;
616  void RecursiveIpv4RoutePathSearch (std::string fromIpv4, std::string toIpv4, Ipv4RoutePathElements &);
617  void WriteRoutePath (uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements);
618  bool IsInTimeWindow ();
619 
620  // Path helper
621  const std::vector<std::string> GetElementsFromContext (const std::string& context) const;
622  Ptr <Node> GetNodeFromContext (const std::string& context) const;
623  Ptr <NetDevice> GetNetDeviceFromContext (std::string context);
624 
625  typedef std::map <uint32_t, double> EnergyFractionMap;
626 
627  static std::map <uint32_t, Rgb> nodeColors;
628  static std::map <uint32_t, std::string> nodeDescriptions;
629  static std::map <P2pLinkNodeIdPair, LinkProperties, LinkPairCompare> linkProperties;
632 
633  void StartNewTraceFile ();
634 
635  std::string GetMacAddress (Ptr <NetDevice> nd);
636  std::string GetIpv4Address (Ptr <NetDevice> nd);
637  void WriteNonP2pLinkProperties (uint32_t id, std::string ipv4Address, std::string channelType);
638 
639  void WriteNodeUpdate (uint32_t nodeId);
640 
641  std::string GetNetAnimVersion ();
642 
643  // XML helpers
644  std::string GetPreamble (void);
645  // Topology element dimensions
646  double m_topoMinX;
647  double m_topoMinY;
648  double m_topoMaxX;
649  double m_topoMaxY;
651 
652  std::string GetPacketMetadata (Ptr<const Packet> p);
653 
654  std::string GetXMLOpen_anim (uint32_t lp);
655  std::string GetXMLOpen_topology (double minX, double minY, double maxX, double maxY);
656  std::string GetXMLOpenClose_node (uint32_t lp, uint32_t id, double locX, double locY);
657  std::string GetXMLOpenClose_node (uint32_t lp, uint32_t id, double locX, double locY, struct Rgb rgb);
658  std::string GetXMLOpenClose_nodeupdate (uint32_t id, bool visible = true);
659  std::string GetXMLOpenClose_link (uint32_t fromLp, uint32_t fromId, uint32_t toLp, uint32_t toId);
660  std::string GetXMLOpenClose_linkupdate (uint32_t fromId, uint32_t toId, std::string);
661  std::string GetXMLOpen_packet (uint32_t fromLp, uint32_t fromId, double fbTx, double lbTx, std::string auxInfo = "");
662  std::string GetXMLOpenClose_p (std::string pktType, uint32_t fId, double fbTx, double lbTx, uint32_t tId, double fbRx, double lbRx,
663  std::string metaInfo = "", std::string auxInfo = "");
664  std::string GetXMLOpenClose_rx (uint32_t toLp, uint32_t toId, double fbRx, double lbRx);
665  std::string GetXMLOpen_wpacket (uint32_t fromLp, uint32_t fromId, double fbTx, double lbTx, double range);
666  std::string GetXMLClose (std::string name) {return "</" + name + ">\n"; }
667  std::string GetXMLOpenClose_meta (std::string metaInfo);
668  std::string GetXMLOpenClose_NonP2pLinkProperties (uint32_t id, std::string ipv4Address, std::string channelType);
669  std::string GetXMLOpenClose_routing (uint32_t id, std::string routingInfo);
670  std::string GetXMLOpenClose_rp (uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements);
671 
672  void AppendXMLNodeDescription (std::ostream& ostream, uint32_t id) const;
673  void AppendXMLNodeColor (std::ostream& ostream, const Rgb& color) const;
674  void AppendXMLRemainingEnergy (std::ostream& ostream, uint32_t id) const;
675 
678 };
679 
685 struct Rgb
686 {
687  uint8_t r;
688  uint8_t g;
689  uint8_t b;
690 };
691 
703 class AnimByteTag : public Tag
704 {
705 public:
706 
712  static TypeId GetTypeId (void);
713 
719  virtual TypeId GetInstanceTypeId (void) const;
720 
726  virtual uint32_t GetSerializedSize (void) const;
727 
733  virtual void Serialize (TagBuffer i) const;
734 
740  virtual void Deserialize (TagBuffer i);
741 
747  virtual void Print (std::ostream &os) const;
748 
754  void Set (uint64_t AnimUid);
755 
761  uint64_t Get (void) const;
762 
763 private:
764  uint64_t m_AnimUid;
765 };
766 
767 }
768 #endif
769 
uint64_t GetAnimUidFromPacket(Ptr< const Packet >)
void Set(uint64_t AnimUid)
Set global Uid in tag.
std::string GetXMLOpenClose_nodeupdate(uint32_t id, bool visible=true)
uint64_t GetTracePktCount()
Get trace file packet count (This used only for testing)
void AddToIpv4AddressNodeIdTable(std::string, uint32_t)
bool WifiPacketIsPending(uint64_t AnimUid)
void CsmaMacRxTrace(std::string context, Ptr< const Packet > p)
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
std::string GetXMLOpen_anim(uint32_t lp)
bool CsmaPacketIsPending(uint64_t AnimUid)
std::vector< Ptr< Node > > RecalcTopoBounds()
void AddPendingWifiPacket(uint64_t AnimUid, AnimPacketInfo &)
bool LtePacketIsPending(uint64_t AnimUid)
std::string GetIpv4Address(Ptr< NetDevice > nd)
AnimationInterface & AddSourceDestination(uint32_t fromNodeId, std::string destinationIpv4Address)
Helper function to print the routing path from a source node to destination IP.
AnimRxInfo helper class.
void EnablePacketMetadata(bool enable)
Enable Packet metadata.
static TypeId GetTypeId(void)
Get Type Id.
std::string GetXMLOpenClose_NonP2pLinkProperties(uint32_t id, std::string ipv4Address, std::string channelType)
void CsmaPhyTxBeginTrace(std::string context, Ptr< const Packet > p)
static void SetNodeColor(Ptr< Node > n, uint8_t r, uint8_t g, uint8_t b)
Helper function to set the node color.
static bool IsInitialized(void)
Check if AnimationInterface is initialized.
std::string GetXMLClose(std::string name)
void WifiMacRxTrace(std::string context, Ptr< const Packet > p)
void OutputCsmaPacket(Ptr< const Packet > p, AnimPacketInfo &pktInfo, AnimRxInfo pktrxInfo)
std::map< std::string, uint32_t > m_macToNodeIdMap
void LteSpectrumPhyRxStart(std::string context, Ptr< const PacketBurst > pb)
Ptr< NetDevice > GetNetDeviceFromContext(std::string context)
void WifiPhyTxBeginTrace(std::string context, Ptr< const Packet > p)
std::map< uint64_t, AnimPacketInfo > m_pendingWimaxPackets
bool SetRoutingOutputFile(const std::string &fn)
std::string GetXMLOpenClose_rx(uint32_t toLp, uint32_t toId, double fbRx, double lbRx)
void LteTxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &)
void WimaxRxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &)
std::map< std::string, uint32_t > m_ipv4ToNodeIdMap
void RecursiveIpv4RoutePathSearch(std::string fromIpv4, std::string toIpv4, Ipv4RoutePathElements &)
virtual void Deserialize(TagBuffer i)
Deserialize function.
void ConnectLteEnb(Ptr< Node > n, Ptr< LteEnbNetDevice > nd, uint32_t devIndex)
std::string GetIpv4RoutingTable(Ptr< Node > n)
void SetStartTime(Time t)
Specify the time at which capture should start.
void SetStopTime(Time t)
Specify the time at which capture should stop.
a 3d vector
Definition: vector.h:31
void WifiPhyRxBeginTrace(std::string context, Ptr< const Packet > p)
void UpdateNodeColor(Ptr< Node > n, uint8_t r, uint8_t g, uint8_t b)
Helper function to update the node color.
double stopTime
void ResetAnimWriteCallback()
Reset the write callback function.
std::string GetXMLOpenClose_node(uint32_t lp, uint32_t id, double locX, double locY)
AnimWriteCallback m_writeCallback
void WifiPhyRxDropTrace(std::string context, Ptr< const Packet > p)
void UanPhyGenTxTrace(std::string context, Ptr< const Packet >)
static void SetConstantPosition(Ptr< Node > n, double x, double y, double z=0)
Helper function to set Constant Position for a given node.
void ConnectLteUe(Ptr< Node > n, Ptr< LteUeNetDevice > nd, uint32_t devIndex)
std::map< uint32_t, Vector > m_nodeLocation
virtual void Print(std::ostream &os) const
Print tag info.
static void SetLinkDescription(uint32_t fromNode, uint32_t toNode, std::string linkDescription, std::string fromNodeDescription="", std::string toNodeDescription="")
Helper function to set the description for a link.
static void SetBoundary(double minX, double minY, double maxX, double maxY)
Helper function to set the topology boundary rectangle.
void SetXMLOutput()
Specify that animation commands are to be written in XML format.
std::string GetXMLOpen_packet(uint32_t fromLp, uint32_t fromId, double fbTx, double lbTx, std::string auxInfo="")
void CsmaPhyRxEndTrace(std::string context, Ptr< const Packet > p)
void RemainingEnergyTrace(std::string context, double previousEnergy, double currentEnergy)
std::string GetXMLOpenClose_p(std::string pktType, uint32_t fId, double fbTx, double lbTx, uint32_t tId, double fbRx, double lbRx, std::string metaInfo="", std::string auxInfo="")
void SetRandomPosition(bool setRandPos)
Set random position if a Mobility Model does not exists for the node.
~AnimationInterface()
Destructor for the animator interface.
EnergyFractionMap m_nodeEnergyFraction
double startTime
double GetNodeEnergyFraction(Ptr< const Node > node) const
Get node's energy fraction (This used only for testing)
Ptr< Node > GetNodeFromContext(const std::string &context) const
void WriteNodeUpdate(uint32_t nodeId)
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
static void SetNodeDescription(Ptr< Node > n, std::string descr)
Helper function to set a brief description for a given node.
void UanPhyGenRxTrace(std::string context, Ptr< const Packet >)
std::map< uint64_t, AnimPacketInfo > m_pendingLtePackets
void StartAnimation(bool restart=false)
Writes the topology information and sets up the appropriate animation packet tx callback.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
std::vector< Ipv4RoutePathElement > Ipv4RoutePathElements
AnimationInterface & EnableIpv4RouteTracking(std::string fileName, Time startTime, Time stopTime, Time pollInterval=Seconds(5))
Enable tracking of the Ipv4 routing table for all Nodes.
void OutputWirelessPacket(Ptr< const Packet > p, AnimPacketInfo &pktInfo, AnimRxInfo pktrxInfo)
static std::map< uint32_t, Rgb > nodeColors
void WifiPhyTxDropTrace(std::string context, Ptr< const Packet > p)
std::map< uint32_t, double > EnergyFractionMap
std::map< uint64_t, AnimPacketInfo > m_pendingCsmaPackets
void CsmaPhyTxEndTrace(std::string context, Ptr< const Packet > p)
std::string GetPacketMetadata(Ptr< const Packet > p)
std::string GetXMLOpen_wpacket(uint32_t fromLp, uint32_t fromId, double fbTx, double lbTx, double range)
int WriteN(const char *, uint32_t, FILE *f)
void DevTxTrace(std::string context, Ptr< const Packet > p, Ptr< NetDevice > tx, Ptr< NetDevice > rx, Time txTime, Time rxTime)
tag a set of bytes in a packet
Definition: tag.h:36
void AddPendingUanPacket(uint64_t AnimUid, AnimPacketInfo &)
keep track of a set of node pointers.
void UpdateLinkDescription(uint32_t fromNode, uint32_t toNode, std::string linkDescription)
Helper function to update the description for a link.
void AppendXMLRemainingEnergy(std::ostream &ostream, uint32_t id) const
void AddPendingWimaxPacket(uint64_t AnimUid, AnimPacketInfo &)
bool NodeHasMoved(Ptr< Node > n, Vector newLocation)
static Rectangle * userBoundary
an EUI-48 address
Definition: mac48-address.h:41
virtual void Serialize(TagBuffer i) const
Serialize function.
bool UanPacketIsPending(uint64_t AnimUid)
const std::vector< std::string > GetElementsFromContext(const std::string &context) const
bool SetOutputFile(const std::string &fn)
Specify that animation commands are to be written to the specified output file.
Byte tag using by Anim to uniquely identify packets.
virtual TypeId GetInstanceTypeId(void) const
Get Instance Type Id.
void StopAnimation(bool onlyAnimation=false)
Closes the interface to the animator.
Vector UpdatePosition(Ptr< Node > n)
uint64_t Get(void) const
Get Uid in tag.
std::vector< Ipv4RouteTrackElement > m_ipv4RouteTrackElements
void MobilityCourseChangeTrace(Ptr< const MobilityModel > mob)
read and write tag data
Definition: tag-buffer.h:51
std::map< uint64_t, AnimPacketInfo > m_pendingWifiPackets
std::map< uint64_t, AnimPacketInfo > m_pendingUanPackets
std::string GetXMLOpenClose_linkupdate(uint32_t fromId, uint32_t toId, std::string)
std::string GetXMLOpenClose_routing(uint32_t id, std::string routingInfo)
std::string GetMacAddress(Ptr< NetDevice > nd)
#define MAX_PKTS_PER_TRACE_FILE
AnimationInterface(const std::string filename, uint64_t maxPktsPerFile=MAX_PKTS_PER_TRACE_FILE, bool usingXML=true)
Constructor.
std::string GetXMLOpenClose_rp(uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements)
void WifiPhyTxEndTrace(std::string context, Ptr< const Packet > p)
virtual uint32_t GetSerializedSize(void) const
Get Serialized Size.
Interface to network animator.
void WriteNonP2pLinkProperties(uint32_t id, std::string ipv4Address, std::string channelType)
void WifiPhyRxEndTrace(std::string context, Ptr< const Packet > p)
static std::map< P2pLinkNodeIdPair, LinkProperties, LinkPairCompare > linkProperties
void SetAnimWriteCallback(AnimWriteCallback cb)
Set a callback function to listen to AnimationInterface write events.
void SetMobilityPollInterval(Time t)
Set mobility poll interval:WARNING: setting a low interval can cause slowness.
void AddPendingLtePacket(uint64_t AnimUid, AnimPacketInfo &)
void AddPendingCsmaPacket(uint64_t AnimUid, AnimPacketInfo &)
void AppendXMLNodeDescription(std::ostream &ostream, uint32_t id) const
void AppendXMLNodeColor(std::ostream &ostream, const Rgb &color) const
void WriteRoutePath(uint32_t nodeId, std::string destination, Ipv4RoutePathElements rpElements)
A structure to store red, blue and green components for entities such as nodes.
std::string GetXMLOpenClose_meta(std::string metaInfo)
void ShowNode(uint32_t nodeId, bool show=true)
Helper function to show/hide a node.
bool IsStarted(void)
Is AnimationInterface started.
bool WimaxPacketIsPending(uint64_t AnimUid)
Vector GetPosition(Ptr< Node > n)
a unique identifier for an interface.
Definition: type-id.h:49
static std::map< uint32_t, std::string > nodeDescriptions
a 2d rectangle
Definition: rectangle.h:33
std::string GetXMLOpenClose_link(uint32_t fromLp, uint32_t fromId, uint32_t toLp, uint32_t toId)
std::string GetXMLOpen_topology(double minX, double minY, double maxX, double maxY)
void(* AnimWriteCallback)(const char *str)
typedef for WriteCallBack used for listening to AnimationInterface write messages ...
void LteRxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &)
void UpdateNodeDescription(Ptr< Node > n, std::string descr)
Helper function to update the description for a given node.
void LteSpectrumPhyTxStart(std::string context, Ptr< const PacketBurst > pb)
void WimaxTxTrace(std::string context, Ptr< const Packet > p, const Mac48Address &)
AnimPacketInfo helper class.