|
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 |
|
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); |
|
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 |
|
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), |
|
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"), |
|
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 |
|
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); |
|
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); |
|
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); |
|
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 |
{ |