View | Details | Raw Unified | Return to bug 2825
Collapse All | Expand All

(-)a/src/wave/examples/vanet-routing-compare.cc (-17 / +4 lines)
 Lines 426-432    Link Here 
426
   * \param packet a received packet
426
   * \param packet a received packet
427
   * \return none
427
   * \return none
428
   */
428
   */
429
  void OnOffTrace (std::string context, Ptr<const Packet> packet);
429
  void BsmTrace (std::string context, Ptr<const Packet> packet);
430
430
431
  /**
431
  /**
432
   * \brief Returns the RoutingStats instance
432
   * \brief Returns the RoutingStats instance
 Lines 698-704    Link Here 
698
}
698
}
699
699
700
void
700
void
701
RoutingHelper::OnOffTrace (std::string context, Ptr<const Packet> packet)
701
RoutingHelper::BsmTrace (std::string context, Ptr<const Packet> packet)
702
{
702
{
703
  uint32_t pktBytes = packet->GetSize ();
703
  uint32_t pktBytes = packet->GetSize ();
704
  routingStats.IncTxBytes (pktBytes);
704
  routingStats.IncTxBytes (pktBytes);
 Lines 1271-1277    Link Here 
1271
  uint32_t m_mobility; ///< mobility
1271
  uint32_t m_mobility; ///< mobility
1272
  uint32_t m_nNodes; ///< number of nodes
1272
  uint32_t m_nNodes; ///< number of nodes
1273
  double m_TotalSimTime; ///< total sim time
1273
  double m_TotalSimTime; ///< total sim time
1274
  std::string m_rate; ///< rate
1275
  std::string m_phyModeB; ///< phy mode
1274
  std::string m_phyModeB; ///< phy mode
1276
  std::string m_trName; ///< trace file name
1275
  std::string m_trName; ///< trace file name
1277
  int m_nodeSpeed; ///< in m/s
1276
  int m_nodeSpeed; ///< in m/s
 Lines 1335-1341    Link Here 
1335
    m_mobility (1),
1334
    m_mobility (1),
1336
    m_nNodes (156),
1335
    m_nNodes (156),
1337
    m_TotalSimTime (300.01),
1336
    m_TotalSimTime (300.01),
1338
    m_rate ("2048bps"),
1339
    m_phyModeB ("DsssRate11Mbps"),
1337
    m_phyModeB ("DsssRate11Mbps"),
1340
    m_trName ("vanet-routing-compare"),
1338
    m_trName ("vanet-routing-compare"),
1341
    m_nodeSpeed (20),
1339
    m_nodeSpeed (20),
 Lines 1540-1549    Link Here 
1540
                                   "Log filename",
1538
                                   "Log filename",
1541
                                   ns3::StringValue ("low99-ct-unterstrass-1day.filt.7.adj.log"),
1539
                                   ns3::StringValue ("low99-ct-unterstrass-1day.filt.7.adj.log"),
1542
                                   ns3::MakeStringChecker ());
1540
                                   ns3::MakeStringChecker ());
1543
static ns3::GlobalValue g_rate ("VRCrate",
1544
                                "Data rate",
1545
                                ns3::StringValue ("2048bps"),
1546
                                ns3::MakeStringChecker ());
1547
static ns3::GlobalValue g_phyModeB ("VRCphyModeB",
1541
static ns3::GlobalValue g_phyModeB ("VRCphyModeB",
1548
                                    "PHY mode (802.11a)",
1542
                                    "PHY mode (802.11a)",
1549
                                    ns3::StringValue ("DsssRate11Mbps"),
1543
                                    ns3::StringValue ("DsssRate11Mbps"),
 Lines 1636-1643    Link Here 
1636
  // routing overhead
1630
  // routing overhead
1637
  std::ostringstream oss;
1631
  std::ostringstream oss;
1638
  oss.str ("");
1632
  oss.str ("");
1639
  oss << "/NodeList/*/ApplicationList/*/$ns3::OnOffApplication/Tx";
1633
  oss << "/NodeList/*/ApplicationList/*/$ns3::BsmApplication/Tx";
1640
  Config::Connect (oss.str (), MakeCallback (&RoutingHelper::OnOffTrace, m_routingHelper));
1634
  Config::Connect (oss.str (), MakeCallback (&RoutingHelper::BsmTrace, m_routingHelper));
1641
}
1635
}
1642
1636
1643
void
1637
void
 Lines 1940-1947    Link Here 
1940
  m_traceFile = stringValue.Get ();
1934
  m_traceFile = stringValue.Get ();
1941
  GlobalValue::GetValueByName ("VRClogFile", stringValue);
1935
  GlobalValue::GetValueByName ("VRClogFile", stringValue);
1942
  m_logFile = stringValue.Get ();
1936
  m_logFile = stringValue.Get ();
1943
  GlobalValue::GetValueByName ("VRCrate", stringValue);
1944
  m_rate = stringValue.Get ();
1945
  GlobalValue::GetValueByName ("VRCphyModeB", stringValue);
1937
  GlobalValue::GetValueByName ("VRCphyModeB", stringValue);
1946
  m_phyModeB = stringValue.Get ();
1938
  m_phyModeB = stringValue.Get ();
1947
  GlobalValue::GetValueByName ("VRCtrName", stringValue);
1939
  GlobalValue::GetValueByName ("VRCtrName", stringValue);
 Lines 1996-2002    Link Here 
1996
  g_phyMode.SetValue (StringValue (m_phyMode));
1988
  g_phyMode.SetValue (StringValue (m_phyMode));
1997
  g_traceFile.SetValue (StringValue (m_traceFile));
1989
  g_traceFile.SetValue (StringValue (m_traceFile));
1998
  g_logFile.SetValue (StringValue (m_logFile));
1990
  g_logFile.SetValue (StringValue (m_logFile));
1999
  g_rate.SetValue (StringValue (m_rate));
2000
  g_phyModeB.SetValue (StringValue (m_phyModeB));
1991
  g_phyModeB.SetValue (StringValue (m_phyModeB));
2001
  g_trName.SetValue (StringValue (m_trName));
1992
  g_trName.SetValue (StringValue (m_trName));
2002
  GlobalValue::GetValueByName ("VRCtrName", stringValue);
1993
  GlobalValue::GetValueByName ("VRCtrName", stringValue);
 Lines 2034-2040    Link Here 
2034
  cmd.AddValue ("traceFile", "Ns2 movement trace file", m_traceFile);
2025
  cmd.AddValue ("traceFile", "Ns2 movement trace file", m_traceFile);
2035
  cmd.AddValue ("logFile", "Log file", m_logFile);
2026
  cmd.AddValue ("logFile", "Log file", m_logFile);
2036
  cmd.AddValue ("mobility", "1=trace;2=RWP", m_mobility);
2027
  cmd.AddValue ("mobility", "1=trace;2=RWP", m_mobility);
2037
  cmd.AddValue ("rate", "Rate", m_rate);
2038
  cmd.AddValue ("phyModeB", "Phy mode 802.11b", m_phyModeB);
2028
  cmd.AddValue ("phyModeB", "Phy mode 802.11b", m_phyModeB);
2039
  cmd.AddValue ("speed", "Node speed (m/s)", m_nodeSpeed);
2029
  cmd.AddValue ("speed", "Node speed (m/s)", m_nodeSpeed);
2040
  cmd.AddValue ("pause", "Node pause (s)", m_nodePause);
2030
  cmd.AddValue ("pause", "Node pause (s)", m_nodePause);
 Lines 2116-2124    Link Here 
2116
void
2106
void
2117
VanetRoutingExperiment::ConfigureDefaults ()
2107
VanetRoutingExperiment::ConfigureDefaults ()
2118
{
2108
{
2119
  Config::SetDefault ("ns3::OnOffApplication::PacketSize",StringValue ("64"));
2120
  Config::SetDefault ("ns3::OnOffApplication::DataRate",  StringValue (m_rate));
2121
2122
  //Set Non-unicastMode rate to unicast mode
2109
  //Set Non-unicastMode rate to unicast mode
2123
  if (m_80211mode == 2)
2110
  if (m_80211mode == 2)
2124
    {
2111
    {
(-)a/src/wave/model/bsm-application.cc (-1 / +7 lines)
 Lines 43-48    Link Here 
43
    .SetParent<Application> ()
43
    .SetParent<Application> ()
44
    .SetGroupName ("Wave")
44
    .SetGroupName ("Wave")
45
    .AddConstructor<BsmApplication> ()
45
    .AddConstructor<BsmApplication> ()
46
    .AddTraceSource ("Tx", "A new packet is created and is sent",
47
                     MakeTraceSourceAccessor (&BsmApplication::m_txTrace),
48
                     "ns3::Packet::TracedCallback")
46
    ;
49
    ;
47
  return tid;
50
  return tid;
48
}
51
}
 Lines 242-248    Link Here 
242
      if (senderMoving != 0)
245
      if (senderMoving != 0)
243
        {
246
        {
244
          // send it!
247
          // send it!
245
          socket->Send (Create<Packet> (pktSize));
248
          Ptr<Packet> packet = Create<Packet> (pktSize);
249
          m_txTrace (packet);
250
251
          socket->Send (packet);
246
          // count it
252
          // count it
247
          m_waveBsmStats->IncTxPktCount ();
253
          m_waveBsmStats->IncTxPktCount ();
248
          m_waveBsmStats->IncTxByteCount (pktSize);
254
          m_waveBsmStats->IncTxByteCount (pktSize);
(-)a/src/wave/model/bsm-application.h (+3 lines)
 Lines 104-109    Link Here 
104
  virtual void DoDispose (void);
104
  virtual void DoDispose (void);
105
105
106
private:
106
private:
107
  /// Traced Callback: transmitted packets.
108
  TracedCallback<Ptr<const Packet> > m_txTrace;
109
107
  // inherited from Application base class.
110
  // inherited from Application base class.
108
  virtual void StartApplication (void);    ///< Called at time specified by Start
111
  virtual void StartApplication (void);    ///< Called at time specified by Start
109
  virtual void StopApplication (void);     ///< Called at time specified by Stop
112
  virtual void StopApplication (void);     ///< Called at time specified by Stop

Return to bug 2825