104 #include "ns3/core-module.h"
105 #include "ns3/network-module.h"
106 #include "ns3/internet-module.h"
107 #include "ns3/mobility-module.h"
108 #include "ns3/wifi-module.h"
109 #include "ns3/aodv-module.h"
110 #include "ns3/olsr-module.h"
111 #include "ns3/dsdv-module.h"
112 #include "ns3/dsr-module.h"
113 #include "ns3/applications-module.h"
114 #include "ns3/itu-r-1411-los-propagation-loss-model.h"
115 #include "ns3/ocb-wifi-mac.h"
116 #include "ns3/wifi-80211p-helper.h"
117 #include "ns3/wave-mac-helper.h"
118 #include "ns3/flow-monitor-module.h"
119 #include "ns3/config-store-module.h"
120 #include "ns3/integer.h"
121 #include "ns3/wave-bsm-helper.h"
122 #include "ns3/wave-helper.h"
149 uint32_t GetRxBytes ();
155 uint32_t GetCumulativeRxBytes ();
161 uint32_t GetRxPkts ();
167 uint32_t GetCumulativeRxPkts ();
175 void IncRxBytes (uint32_t rxBytes);
188 void SetRxBytes (uint32_t rxBytes);
195 void SetRxPkts (uint32_t rxPkts);
201 uint32_t GetTxBytes ();
208 uint32_t GetCumulativeTxBytes ();
214 uint32_t GetTxPkts ();
220 uint32_t GetCumulativeTxPkts ();
227 void IncTxBytes (uint32_t txBytes);
240 void SetTxBytes (uint32_t txBytes);
247 void SetTxPkts (uint32_t txPkts);
262 m_cumulativeRxBytes (0),
264 m_cumulativeRxPkts (0),
266 m_cumulativeTxBytes (0),
268 m_cumulativeTxPkts (0)
503 .AddConstructor<RoutingHelper> ();
508 : m_TotalSimTime (300.01),
543 TypeId tid = TypeId::LookupByName (
"ns3::UdpSocketFactory");
544 Ptr<Socket> sink = Socket::CreateSocket (node, tid);
577 list.
Add (olsr, 100);
585 list.
Add (aodv, 100);
593 list.
Add (dsdv, 100);
630 addressAdhoc.
SetBase (
"10.1.0.0",
"255.255.0.0");
631 adhocTxInterfaces = addressAdhoc.
Assign (d);
646 for (uint32_t i = 0; i <
m_nSinks; i++)
664 static inline std::string
670 std::ostringstream oss;
677 oss <<
" received one packet from " << addr.
GetIpv4 ();
681 oss <<
" received one packet!";
690 while ((packet = socket->
Recv ()))
693 uint32_t RxRoutingBytes = packet->
GetSize ();
706 uint32_t pktBytes = packet->
GetSize ();
793 .AddConstructor<WifiPhyStats> ();
812 uint32_t pktSize = packet->
GetSize ();
861 void Simulate (
int argc,
char **argv);
1036 void LoadConfig (std::string configFilename);
1043 void SaveConfig (std::string configFilename);
1066 if (configFilename.compare (
"") != 0)
1313 m_CSVfileName (
"vanet-routing.output.csv"),
1314 m_CSVfileName2 (
"vanet-routing.output2.csv"),
1316 m_protocolName (
"protocol"),
1318 m_traceMobility (false),
1324 m_lossModelName (
""),
1325 m_phyMode (
"OfdmRate6MbpsBW10MHz"),
1329 m_logFile (
"low_ct-unterstrass-1day.filt.5.adj.log"),
1332 m_TotalSimTime (300.01),
1334 m_phyModeB (
"DsssRate11Mbps"),
1335 m_trName (
"vanet-routing-compare"),
1338 m_wavePacketSize (200),
1339 m_waveInterval (0.1),
1342 m_gpsAccuracyNs (40),
1343 m_txMaxDelayMs (10),
1344 m_routingTables (0),
1347 m_loadConfigFilename (
"load-config.txt"),
1348 m_saveConfigFilename (
""),
1352 m_txSafetyRange1 (50.0),
1353 m_txSafetyRange2 (100.0),
1354 m_txSafetyRange3 (150.0),
1355 m_txSafetyRange4 (200.0),
1356 m_txSafetyRange5 (250.0),
1357 m_txSafetyRange6 (300.0),
1358 m_txSafetyRange7 (350.0),
1359 m_txSafetyRange8 (400.0),
1360 m_txSafetyRange9 (450.0),
1361 m_txSafetyRange10 (500.0),
1362 m_txSafetyRanges (),
1364 m_cumulativeBsmCaptureStart (0)
1384 ns3::MakeUintegerChecker<uint32_t> ());
1386 "Number of sink nodes for routing non-BSM traffic",
1388 ns3::MakeUintegerChecker<uint32_t> ());
1390 "Trace mobility 1=yes;0=no",
1392 ns3::MakeUintegerChecker<uint32_t> ());
1396 ns3::MakeUintegerChecker<uint32_t> ());
1398 "Propagation Loss Model",
1400 ns3::MakeUintegerChecker<uint32_t> ());
1402 "Fast Fading Model",
1404 ns3::MakeUintegerChecker<uint32_t> ());
1406 "802.11 mode (0=802.11a;1=802.11p)",
1408 ns3::MakeUintegerChecker<uint32_t> ());
1410 "Mobility mode 0=random waypoint;1=mobility trace file",
1412 ns3::MakeUintegerChecker<uint32_t> ());
1414 "Number of nodes (vehicles)",
1416 ns3::MakeUintegerChecker<uint32_t> ());
1418 "Node speed (m/s) for RWP model",
1420 ns3::MakeUintegerChecker<uint32_t> ());
1422 "Node pause time (s) for RWP model",
1424 ns3::MakeUintegerChecker<uint32_t> ());
1426 "Size in bytes of WAVE BSM",
1428 ns3::MakeUintegerChecker<uint32_t> ());
1430 "Verbose 0=no;1=yes",
1432 ns3::MakeUintegerChecker<uint32_t> ());
1436 ns3::MakeUintegerChecker<uint32_t> ());
1438 "Dump routing tables at t=5 seconds 0=no;1=yes",
1440 ns3::MakeUintegerChecker<uint32_t> ());
1442 "Dump ASCII trace 0=no;1=yes",
1444 ns3::MakeUintegerChecker<uint32_t> ());
1446 "Generate PCAP files 0=no;1=yes",
1448 ns3::MakeUintegerChecker<uint32_t> ());
1450 "Simulation starte time for capturing cumulative BSM",
1452 ns3::MakeUintegerChecker<uint32_t> ());
1455 "BSM range for PDR inclusion",
1457 ns3::MakeDoubleChecker<double> ());
1460 "BSM range for PDR inclusion",
1462 ns3::MakeDoubleChecker<double> ());
1465 "BSM range for PDR inclusion",
1467 ns3::MakeDoubleChecker<double> ());
1470 "BSM range for PDR inclusion",
1472 ns3::MakeDoubleChecker<double> ());
1475 "BSM range for PDR inclusion",
1477 ns3::MakeDoubleChecker<double> ());
1479 "BSM range for PDR inclusion",
1481 ns3::MakeDoubleChecker<double> ());
1483 "BSM range for PDR inclusion",
1485 ns3::MakeDoubleChecker<double> ());
1487 "BSM range for PDR inclusion",
1489 ns3::MakeDoubleChecker<double> ());
1491 "BSM range for PDR inclusion",
1493 ns3::MakeDoubleChecker<double> ());
1495 "BSM range for PDR inclusion",
1497 ns3::MakeDoubleChecker<double> ());
1499 "Transmission power dBm",
1501 ns3::MakeDoubleChecker<double> ());
1503 "Total simulation time (s)",
1505 ns3::MakeDoubleChecker<double> ());
1507 "Interval (s) between WAVE BSMs",
1509 ns3::MakeDoubleChecker<double> ());
1511 "GPS sync accuracy (ns)",
1513 ns3::MakeDoubleChecker<double> ());
1515 "Tx May Delay (ms)",
1517 ns3::MakeDoubleChecker<double> ());
1519 "CSV filename (for time series data)",
1523 "CSV filename 2 (for overall simulation scenario results)",
1527 "PHY mode (802.11p)",
1531 "Mobility trace filename",
1532 ns3::StringValue (
"./src/wave/examples/low_ct-unterstrass-1day.filt.5.adj.mob"),
1543 "PHY mode (802.11a)",
1632 std::ostringstream oss;
1634 oss <<
"/NodeList/*/ApplicationList/*/$ns3::OnOffApplication/Tx";
1670 double averageRoutingGoodputKbps = 0.0;
1672 averageRoutingGoodputKbps = (((double) totalBytesTotal * 8.0) /
m_TotalSimTime) / 1000.0;
1678 uint32_t totalAppBytes = cumulativeWaveBsmBytes + cumulativeRoutingBytes;
1681 double mac_phy_oh = 0.0;
1682 if (totalPhyBytes > 0)
1684 mac_phy_oh = (double) (totalPhyBytes - totalAppBytes) / (double) totalPhyBytes;
1689 NS_LOG_UNCOND (
"BSM_PDR1=" << bsm_pdr1 <<
" BSM_PDR2=" << bsm_pdr2 <<
" BSM_PDR3=" << bsm_pdr3 <<
" BSM_PDR4=" << bsm_pdr4 <<
" BSM_PDR5=" << bsm_pdr5 <<
" BSM_PDR6=" << bsm_pdr6 <<
" BSM_PDR7=" << bsm_pdr7 <<
" BSM_PDR8=" << bsm_pdr8 <<
" BSM_PDR9=" << bsm_pdr9 <<
" BSM_PDR10=" << bsm_pdr10 <<
" Goodput=" << averageRoutingGoodputKbps <<
"Kbps MAC/PHY-oh=" << mac_phy_oh);
1695 out << bsm_pdr1 <<
","
1705 << averageRoutingGoodputKbps <<
","
1723 Simulator::Destroy ();
1740 WaveBsmHelper::GetNodesMoving ()[nodeId] = 1;
1746 *os <<
Simulator::Now () <<
" POS: x=" << pos.x <<
", y=" << pos.y
1747 <<
", z=" << pos.z <<
"; VEL:" << vel.x <<
", y=" << vel.y
1748 <<
", z=" << vel.z << std::endl;
1756 double kbps = (bytesTotal * 8.0) / 1000;
1757 double wavePDR = 0.0;
1760 if (wavePktsSent > 0)
1763 wavePDR = (double) wavePktsReceived / (
double) wavePktsSent;
1783 uint32_t totalAppBytes = cumulativeWaveBsmBytes + cumulativeRoutingBytes;
1786 double mac_phy_oh = 0.0;
1787 if (totalPhyBytes > 0)
1789 mac_phy_oh = (double) (totalPhyBytes - totalAppBytes) / (double) totalPhyBytes;
1796 NS_LOG_UNCOND (
"At t=" << (
Simulator::Now ()).GetSeconds () <<
"s BSM_PDR1=" << wavePDR1_2 <<
" BSM_PDR1=" << wavePDR2_2 <<
" BSM_PDR3=" << wavePDR3_2 <<
" BSM_PDR4=" << wavePDR4_2 <<
" BSM_PDR5=" << wavePDR5_2 <<
" BSM_PDR6=" << wavePDR6_2 <<
" BSM_PDR7=" << wavePDR7_2 <<
" BSM_PDR8=" << wavePDR8_2 <<
" BSM_PDR9=" << wavePDR9_2 <<
" BSM_PDR10=" << wavePDR10_2 <<
" Goodput=" << kbps <<
"Kbps" );
1801 << packetsReceived <<
","
1805 << wavePktsSent <<
","
1806 << wavePktsReceived <<
","
1808 << waveExpectedRxPktCount <<
","
1809 << waveRxPktInRangeCount <<
","
1810 << wavePDR1_2 <<
","
1811 << wavePDR2_2 <<
","
1812 << wavePDR3_2 <<
","
1813 << wavePDR4_2 <<
","
1814 << wavePDR5_2 <<
","
1815 << wavePDR6_2 <<
","
1816 << wavePDR7_2 <<
","
1817 << wavePDR8_2 <<
","
1818 << wavePDR9_2 <<
","
1819 << wavePDR10_2 <<
","
1829 for (
int index = 1; index <= 10; index++)
1838 for (
int index = 1; index <= 10; index++)
1860 GlobalValue::GetValueByName (
"VRCport", uintegerValue);
1862 GlobalValue::GetValueByName (
"VRCnSinks", uintegerValue);
1864 GlobalValue::GetValueByName (
"VRCtraceMobility", uintegerValue);
1866 GlobalValue::GetValueByName (
"VRCprotocol", uintegerValue);
1868 GlobalValue::GetValueByName (
"VRClossModel", uintegerValue);
1870 GlobalValue::GetValueByName (
"VRCfading", uintegerValue);
1872 GlobalValue::GetValueByName (
"VRC80211mode", uintegerValue);
1874 GlobalValue::GetValueByName (
"VRCmobility", uintegerValue);
1876 GlobalValue::GetValueByName (
"VRCnNodes", uintegerValue);
1878 GlobalValue::GetValueByName (
"VRCnodeSpeed", uintegerValue);
1880 GlobalValue::GetValueByName (
"VRCnodePause", uintegerValue);
1882 GlobalValue::GetValueByName (
"VRCwavePacketSize", uintegerValue);
1884 GlobalValue::GetValueByName (
"VRCverbose", uintegerValue);
1886 GlobalValue::GetValueByName (
"VRCscenario", uintegerValue);
1888 GlobalValue::GetValueByName (
"VRCroutingTables", uintegerValue);
1890 GlobalValue::GetValueByName (
"VRCasciiTrace", uintegerValue);
1892 GlobalValue::GetValueByName (
"VRCpcap", uintegerValue);
1894 GlobalValue::GetValueByName (
"VRCcumulativeBsmCaptureStart", uintegerValue);
1897 GlobalValue::GetValueByName (
"VRCtxSafetyRange1", doubleValue);
1899 GlobalValue::GetValueByName (
"VRCtxSafetyRange2", doubleValue);
1901 GlobalValue::GetValueByName (
"VRCtxSafetyRange3", doubleValue);
1903 GlobalValue::GetValueByName (
"VRCtxSafetyRange4", doubleValue);
1905 GlobalValue::GetValueByName (
"VRCtxSafetyRange5", doubleValue);
1907 GlobalValue::GetValueByName (
"VRCtxSafetyRange6", doubleValue);
1909 GlobalValue::GetValueByName (
"VRCtxSafetyRange7", doubleValue);
1911 GlobalValue::GetValueByName (
"VRCtxSafetyRange8", doubleValue);
1913 GlobalValue::GetValueByName (
"VRCtxSafetyRange9", doubleValue);
1915 GlobalValue::GetValueByName (
"VRCtxSafetyRange10", doubleValue);
1917 GlobalValue::GetValueByName (
"VRCtxp", doubleValue);
1919 GlobalValue::GetValueByName (
"VRCtotalTime", doubleValue);
1921 GlobalValue::GetValueByName (
"VRCwaveInterval", doubleValue);
1923 GlobalValue::GetValueByName (
"VRCgpsAccuracyNs", doubleValue);
1925 GlobalValue::GetValueByName (
"VRCtxMaxDelayMs", doubleValue);
1928 GlobalValue::GetValueByName (
"VRCCSVfileName", stringValue);
1930 GlobalValue::GetValueByName (
"VRCCSVfileName2", stringValue);
1932 GlobalValue::GetValueByName (
"VRCphyMode", stringValue);
1934 GlobalValue::GetValueByName (
"VRCtraceFile", stringValue);
1936 GlobalValue::GetValueByName (
"VRClogFile", stringValue);
1938 GlobalValue::GetValueByName (
"VRCrate", stringValue);
1940 GlobalValue::GetValueByName (
"VRCphyModeB", stringValue);
1942 GlobalValue::GetValueByName (
"VRCtrName", stringValue);
1997 GlobalValue::GetValueByName (
"VRCtrName", stringValue);
2005 double txDist1 = 50.0;
2006 double txDist2 = 100.0;
2007 double txDist3 = 150.0;
2008 double txDist4 = 200.0;
2009 double txDist5 = 250.0;
2010 double txDist6 = 300.0;
2011 double txDist7 = 350.0;
2012 double txDist8 = 350.0;
2013 double txDist9 = 350.0;
2014 double txDist10 = 350.0;
2022 cmd.
AddValue (
"txp",
"Transmit power (dB), e.g. txp=7.5",
m_txp);
2025 cmd.
AddValue (
"lossModel",
"1=Friis;2=ItuR1411Los;3=TwoRayGround;4=LogDistance",
m_lossModel);
2026 cmd.
AddValue (
"fading",
"0=None;1=Nakagami;(buildings=1 overrides)",
m_fading);
2043 cmd.
AddValue (
"txdist1",
"Expected BSM tx range, m", txDist1);
2044 cmd.
AddValue (
"txdist2",
"Expected BSM tx range, m", txDist2);
2045 cmd.
AddValue (
"txdist3",
"Expected BSM tx range, m", txDist3);
2046 cmd.
AddValue (
"txdist4",
"Expected BSM tx range, m", txDist4);
2047 cmd.
AddValue (
"txdist5",
"Expected BSM tx range, m", txDist5);
2048 cmd.
AddValue (
"txdist6",
"Expected BSM tx range, m", txDist6);
2049 cmd.
AddValue (
"txdist7",
"Expected BSM tx range, m", txDist7);
2050 cmd.
AddValue (
"txdist8",
"Expected BSM tx range, m", txDist8);
2051 cmd.
AddValue (
"txdist9",
"Expected BSM tx range, m", txDist9);
2052 cmd.
AddValue (
"txdist10",
"Expected BSM tx range, m", txDist10);
2057 cmd.
AddValue (
"pcap",
"Create PCAP files for all nodes",
m_pcap);
2062 cmd.
Parse (argc, argv);
2081 cmd.
Parse (argc, argv);
2108 Packet::EnablePrinting ();
2137 WaveBsmHelper::GetNodesMoving ().resize (
m_nNodes, 0);
2144 pos.
SetTypeId (
"ns3::RandomBoxPositionAllocator");
2145 pos.
Set (
"X",
StringValue (
"ns3::UniformRandomVariable[Min=0.0|Max=1500.0]"));
2146 pos.
Set (
"Y",
StringValue (
"ns3::UniformRandomVariable[Min=0.0|Max=300.0]"));
2148 pos.
Set (
"Z",
StringValue (
"ns3::UniformRandomVariable[Min=1.0|Max=2.0]"));
2153 std::stringstream ssSpeed;
2154 ssSpeed <<
"ns3::UniformRandomVariable[Min=0.0|Max=" <<
m_nodeSpeed <<
"]";
2155 std::stringstream ssPause;
2156 ssPause <<
"ns3::ConstantRandomVariable[Constant=" <<
m_nodePause <<
"]";
2166 WaveBsmHelper::GetNodesMoving ().resize (
m_nNodes, 1);
2197 NS_LOG_ERROR (
"Invalid propagation loss model specified. Values must be [1-4], where 1=Friis;2=ItuR1411Los;3=TwoRayGround;4=LogDistance");
2249 WaveHelper waveHelper = WaveHelper::Default ();
2285 wifiMac.
SetType (
"ns3::AdhocWifiMac");
2322 int chAccessMode = 0;
2387 m_traceFile =
"src/wave/examples/low99-ct-unterstrass-1day.filt.7.adj.mob";
2388 m_logFile =
"low99-ct-unterstrass-1day.filt.7.adj.log";
2404 out <<
"SimulationSecond," <<
2406 "PacketsReceived," <<
2408 "RoutingProtocol," <<
2409 "TransmissionPower," <<
2411 "WavePtksReceived," <<
2413 "ExpectedWavePktsReceived," <<
2414 "ExpectedWavePktsInCoverageReceived," <<
2440 <<
"AverageRoutingGoodputKbps,"
2447 main (
int argc,
char *argv[])
static ns3::GlobalValue g_gpsAccuracyNs("VRCgpsAccuracyNs","GPS sync accuracy (ns)", ns3::DoubleValue(40), ns3::MakeDoubleChecker< double >())
void AddPropagationLoss(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
static ns3::GlobalValue g_asciiTrace("VRCasciiTrace","Dump ASCII trace 0=no;1=yes", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
Ptr< const AttributeChecker > MakeStringChecker(void)
holds a vector of ns3::Application pointers.
Introspection did not find any typical Config paths.
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
helps to create wifi 802.11p objects of WifiNetDevice class
void experiment(bool enableCtsRts)
Run single 10 seconds experiment with enabled or disabled RTS/CTS mechanism.
The RoutingStats class manages collects statistics on routing data (application-data packet and byte ...
RoutingHelper()
Constructor.
Simulation virtual time values and global simulation resolution.
Manage ASCII trace files for device models.
Ipv4Address GetIpv4(void) const
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
std::string Get(void) const
static ns3::GlobalValue g_rate("VRCrate","Data rate", ns3::StringValue("2048bps"), ns3::MakeStringChecker())
NodeContainer m_adhocTxNodes
void WriteCsvHeader()
Write the header line to the CSV file1.
static ns3::GlobalValue g_80211mode("VRC80211mode","802.11 mode (0=802.11a;1=802.11p)", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
std::string m_CSVfileName
static ns3::GlobalValue g_nSinks("VRCnSinks","Number of sink nodes for routing non-BSM traffic", ns3::UintegerValue(10), ns3::MakeUintegerChecker< uint32_t >())
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
holds a vector of std::pair of Ptr and interface index.
void SetupRoutingMessages()
Set up generation of packets to be routed through the vehicular network.
std::string m_saveConfigFilename
Ptr< YansWifiChannel > Create(void) const
static ns3::GlobalValue g_pcap("VRCpcap","Generate PCAP files 0=no;1=yes", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
uint32_t m_wavePacketSize
void SetRemoteStationManager(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
virtual void ConfigureNodes()
Configure nodes.
virtual void ConfigureNodes()
Configure nodes.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold variables of type string.
void SetLogging(int log)
Enable/disable logging.
Make it easy to create and manage PHY objects for the yans model.
static ns3::GlobalValue g_txSafetyRange9("VRCtxSafetyRange9","BSM range for PDR inclusion", ns3::DoubleValue(450.0), ns3::MakeDoubleChecker< double >())
The WifiPhyStats class collects Wifi MAC/PHY statistics.
virtual void ParseCommandLineArguments(int argc, char **argv)
Process command line arguments.
static ns3::GlobalValue g_txSafetyRange3("VRCtxSafetyRange3","BSM range for PDR inclusion", ns3::DoubleValue(150.0), ns3::MakeDoubleChecker< double >())
void SetRxBytes(uint32_t rxBytes)
Sets the number of bytes received.
uint32_t GetCumulativeTxPkts()
Returns the cumulative number of packets transmitted.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
void PhyTxDrop(std::string context, Ptr< const Packet > packet)
Callback signiture for Phy/TxDrop.
static ns3::GlobalValue g_cumulativeBsmCaptureStart("VRCcumulativeBsmCaptureStart","Simulation starte time for capturing cumulative BSM", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
Helper class that adds DSR routing to nodes.
void SetupWaveMessages()
Set up generation of IEEE 1609 WAVE messages, as a Basic Safety Message (BSM).
uint32_t GetCumulativeRxBytes()
Returns the cumulative number of bytes received.
static ns3::GlobalValue g_port("VRCport","Port", ns3::UintegerValue(9), ns3::MakeUintegerChecker< uint32_t >())
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
virtual ~WifiPhyStats()
Destructor.
void IncRxPkts()
Increments the count of packets received.
void SetPcapDataLinkType(enum SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
aggregate IP/TCP/UDP functionality to existing Nodes.
Helper class that adds OLSR routing to nodes.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Vector GetPosition(void) const
Ipv4InterfaceContainer m_adhocTxInterfaces
virtual void ParseCommandLineArguments(int argc, char **argv)
Process command line arguments.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits. ...
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the mobility models (inc...
static ns3::GlobalValue g_txSafetyRange10("VRCtxSafetyRange10","BSM range for PDR inclusion", ns3::DoubleValue(500.0), ns3::MakeDoubleChecker< double >())
void Set(std::string name, const AttributeValue &v)
void IncTxBytes(uint32_t txBytes)
Increment the number of bytes transmitted.
uint32_t m_cumulativeRxBytes
hold a so-called 'global value'.
static ns3::GlobalValue g_wavePacketSize("VRCwavePacketSize","Size in bytes of WAVE BSM", ns3::UintegerValue(200), ns3::MakeUintegerChecker< uint32_t >())
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
void CommandSetup(int argc, char **argv)
Run the simulation.
helps to create WifiNetDevice objects
virtual void RunSimulation()
Run the simulation.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
virtual void ConfigureChannels()
Configure channels.
Vector GetVelocity(void) const
void ReceiveRoutingPacket(Ptr< Socket > socket)
Process a received routing packet.
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
NetDeviceContainer m_adhocTxDevices
void SetGlobalsFromConfig()
Set up the global variables from the configuration parameters.
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
a polymophic address class
static ns3::GlobalValue g_totalTime("VRCtotalTime","Total simulation time (s)", ns3::DoubleValue(300.01), ns3::MakeDoubleChecker< double >())
ConfigStoreHelper()
Constructor.
static TypeId GetTypeId(void)
Gets the class TypeId.
static ns3::GlobalValue g_txMaxDelayMs("VRCtxMaxDelayMs","Tx May Delay (ms)", ns3::DoubleValue(10), ns3::MakeDoubleChecker< double >())
virtual void ProcessOutputs()
Process outputs.
static ns3::GlobalValue g_txSafetyRange6("VRCtxSafetyRange6","BSM range for PDR inclusion", ns3::DoubleValue(300.0), ns3::MakeDoubleChecker< double >())
static ns3::GlobalValue g_mobility("VRCmobility","Mobility mode 0=random waypoint;1=mobility trace file", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
WaveBsmHelper m_waveBsmHelper
void SetRxPkts(uint32_t rxPkts)
Sets the number of packets received.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
void SetChannel(Ptr< YansWifiChannel > channel)
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void SetRemoteStationManager(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
void SetTxPkts(uint32_t txPkts)
Sets the number of packets transmitted.
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
void Install(void) const
Read the ns2 trace file and configure the movement patterns of all nodes contained in the global ns3:...
void SetupRoutingMessages(NodeContainer &c, Ipv4InterfaceContainer &adhocTxInterfaces)
Sets up routing messages on the nodes and their interfaces.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
virtual void ProcessOutputs()
Process outputs.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
Helper class which can read ns-2 movement files and configure nodes mobility.
uint32_t m_cumulativeTxBytes
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
static ns3::GlobalValue g_trName("VRCtrName","Trace name", ns3::StringValue("vanet-routing-compare"), ns3::MakeStringChecker())
static std::string PrintReceivedRoutingPacket(Ptr< Socket > socket, Ptr< Packet > packet)
uint32_t GetCumulativeRxPkts()
Returns the cumulative count of packets received.
void LoadConfig(std::string configFilename)
Loads a saved config-store raw text configuration from a given named file.
Hold an unsigned integer type.
helps to create WaveNetDevice objects
holds a vector of ns3::NetDevice pointers
static ns3::GlobalValue g_txSafetyRange1("VRCtxSafetyRange1","BSM range for PDR inclusion", ns3::DoubleValue(50.0), ns3::MakeDoubleChecker< double >())
virtual void RunSimulation()
Run the simulation.
virtual void SetStandard(enum WifiPhyStandard standard)
void SetupAdhocDevices()
Set up the adhoc devices.
std::string m_protocolName
static ns3::GlobalValue g_verbose("VRCverbose","Verbose 0=no;1=yes", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
void ConfigureDefaults()
Configure default attributes.
static ns3::GlobalValue g_logFile("VRClogFile","Log filename", ns3::StringValue("low_ct-unterstrass-1day.filt.5.adj.log"), ns3::MakeStringChecker())
static ns3::GlobalValue g_traceMobility("VRCtraceMobility","Trace mobility 1=yes;0=no", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
static ns3::GlobalValue g_routingTables("VRCroutingTables","Dump routing tables at t=5 seconds 0=no;1=yes", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
This class implements a tag that carries an address of a packet across the socket interface...
virtual void SetDefaultAttributeValues()
Sets default attribute values.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
virtual void ConfigureApplications()
Configure applications.
static ns3::GlobalValue g_waveInterval("VRCwaveInterval","Interval (s) between WAVE BSMs", ns3::DoubleValue(0.1), ns3::MakeDoubleChecker< double >())
static ns3::GlobalValue g_scenario("VRCscenario","Scenario", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
The WaveBsmHelper class manages IEEE 1609 WAVE (Wireless Access in Vehicular Environments) Basic Safe...
RoutingStats()
Constructor.
static ns3::GlobalValue g_nNodes("VRCnNodes","Number of nodes (vehicles)", ns3::UintegerValue(156), ns3::MakeUintegerChecker< uint32_t >())
void Run()
Run the simulation.
void SetupLogging()
Set up logging.
std::string m_protocolName
VanetRoutingExperiment()
Constructor.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
create non QoS-enabled MAC layers for a ns3::WifiNetDevice.
Parse command-line arguments.
std::string m_CSVfileName2
void Connect(std::string path, const CallbackBase &cb)
void SetupLogFile()
Set up log file.
void ConfigureDefaults(void)
WifiPhyStats()
Constructor.
static ns3::GlobalValue g_phyMode("VRCphyMode","PHY mode (802.11p)", ns3::StringValue("OfdmRate6MbpsBW10MHz"), ns3::MakeStringChecker())
std::string m_loadConfigFilename
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &macHelper, NodeContainer c) const
virtual void ConfigureChannels()
Configure channels.
static TypeId GetTypeId(void)
Get class TypeId.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr.
virtual ~RoutingHelper()
Destructor.
void SetupRoutingProtocol(NodeContainer &c)
Sets up the protocol protocol on the nodes.
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
virtual void ConfigureMobility()
Configure mobility.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
static void PrintRoutingTableAllAt(Time printTime, Ptr< OutputStreamWrapper > stream)
prints the routing tables of all nodes at a particular time.
The VanetRoutingExperiment class implements a wifi app that allows VANET routing experiments to be si...
void IncRxBytes(uint32_t rxBytes)
Increments the number of (application-data) bytes received, not including MAC/PHY overhead...
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
uint32_t GetRxPkts()
Returns the count of packets received.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionaly.
bool SetValue(const AttributeValue &value)
Set the value of this GlobalValue.
Ptr< Socket > SetupRoutingPacketReceive(Ipv4Address addr, Ptr< Node > node)
Sets up a routing packet for tranmission.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
void SetTxBytes(uint32_t txBytes)
Sets the number of bytes transmitted.
manage and create wifi channel objects for the yans model.
void OnOffTrace(std::string context, Ptr< const Packet > packet)
Trace the receipt of an on-off-application generated packet.
virtual void ConfigureDevices()
Configure devices.
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
RoutingStats routingStats
virtual void ConfigureApplications()
Configure applications.
void Add(const Ipv4RoutingHelper &routing, int16_t priority)
The ConfigStoreHelper class simplifies config-store raw text load and save.
void IncTxPkts()
Increment the count of packets transmitted.
void AssignIpAddresses(NetDeviceContainer &d, Ipv4InterfaceContainer &adhocTxInterfaces)
Assigns IPv4 addresses to net devices and their interfaces.
std::vector< double > m_txSafetyRanges
void PhyRxDrop(std::string context, Ptr< const Packet > packet)
Callback signiture for Phy/RxDrop.
static void CourseChange(std::ostream *os, std::string foo, Ptr< const MobilityModel > mobility)
int m_cumulativeBsmCaptureStart
void SetupScenario()
Set up a prescribed scenario.
static ns3::GlobalValue g_txSafetyRange7("VRCtxSafetyRange7","BSM range for PDR inclusion", ns3::DoubleValue(350.0), ns3::MakeDoubleChecker< double >())
uint32_t GetTxPkts()
Returns the number of packets transmitted.
std::string m_lossModelName
Helper class used to assign positions and mobility models to nodes.
static ns3::GlobalValue g_CSVfileName("VRCCSVfileName","CSV filename (for time series data)", ns3::StringValue("vanet-routing.output.csv"), ns3::MakeStringChecker())
Instantiate subclasses of ns3::Object.
uint32_t GetTxBytes()
Returns the number of bytes transmitted.
Ipv4 addresses are stored in host order in this class.
AttributeValue implementation for Address.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
virtual void ConfigureMobility()
Configure mobility.
uint32_t GetId(void) const
virtual void SetDefaultAttributeValues()
Sets default attribute values.
RoutingStats & GetRoutingStats()
Returns the RoutingStats instance.
virtual Ptr< Node > GetNode(void) const =0
Return the node this socket is associated with.
static ns3::GlobalValue g_protocol("VRCprotocol","Routing protocol", ns3::UintegerValue(2), ns3::MakeUintegerChecker< uint32_t >())
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Address GetAddress(void) const
Get the tag's address.
void Simulate(int argc, char **argv)
Enacts simulation of an ns-3 wifi application.
uint32_t m_cumulativeTxPkts
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
static ns3::GlobalValue g_txp("VRCtxp","Transmission power dBm", ns3::DoubleValue(7.5), ns3::MakeDoubleChecker< double >())
void CheckThroughput()
Checks the throughput and outputs summary to CSV file1.
ApplicationContainer Install(Ipv4InterfaceContainer i) const
Install an ns3::BsmApplication on each node of the input container configured with all the attributes...
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetDefault(std::string name, const AttributeValue &value)
static ns3::GlobalValue g_txSafetyRange2("VRCtxSafetyRange2","BSM range for PDR inclusion", ns3::DoubleValue(100.0), ns3::MakeDoubleChecker< double >())
Ptr< WaveBsmStats > GetWaveBsmStats()
Returns the WaveBsmStats instance.
static ns3::GlobalValue g_txSafetyRange5("VRCtxSafetyRange5","BSM range for PDR inclusion", ns3::DoubleValue(250.0), ns3::MakeDoubleChecker< double >())
static ns3::GlobalValue g_fading("VRCfading","Fast Fading Model", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
static ns3::GlobalValue g_nodeSpeed("VRCnodeSpeed","Node speed (m/s) for RWP model", ns3::UintegerValue(20), ns3::MakeUintegerChecker< uint32_t >())
virtual void ConfigureTracing()
Configure tracing.
static ns3::GlobalValue g_phyModeB("VRCphyModeB","PHY mode (802.11a)", ns3::StringValue("DsssRate11Mbps"), ns3::MakeStringChecker())
Ptr< WifiPhyStats > m_wifiPhyStats
Helper class that adds ns3::Ipv4ListRouting objects.
static ns3::GlobalValue g_txSafetyRange8("VRCtxSafetyRange8","BSM range for PDR inclusion", ns3::DoubleValue(400.0), ns3::MakeDoubleChecker< double >())
void Parse(int argc, char *argv[])
Parse the program arguments.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
virtual void ConfigureTracing()
Configure tracing.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
void EnableAsciiAll(std::string prefix)
Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes c...
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void Install(NodeContainer &c, NetDeviceContainer &d, Ipv4InterfaceContainer &i, double totalTime, int protocol, uint32_t nSinks, int routingTables)
Installs routing funcationality on nodes and their devices and interfaces.
virtual void ConfigureDevices()
Configure devices.
uint32_t GetRxBytes()
Returns the number of bytes received.
Helper class that adds AODV routing to nodes.
A base class which provides memory management and object aggregation.
static ns3::GlobalValue g_traceFile("VRCtraceFile","Mobility trace filename", ns3::StringValue("./src/wave/examples/low_ct-unterstrass-1day.filt.5.adj.mob"), ns3::MakeStringChecker())
void SetPropagationDelay(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
uint32_t GetTxBytes()
Returns the number of bytes that have been transmitted (this includes MAC/PHY overhead) ...
void PhyTxTrace(std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower)
Callback signiture for Phy/Tx trace.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
static ns3::GlobalValue g_CSVfileName2("VRCCSVfileName2","CSV filename 2 (for overall simulation scenario results)", ns3::StringValue("vanet-routing.output2.csv"), ns3::MakeStringChecker())
The WifiApp class enforces program flow for ns-3 wifi applications.
uint32_t GetCumulativeTxBytes()
Returns the cumulative number of bytes transmitted.
static ns3::GlobalValue g_lossModel("VRClossModel","Propagation Loss Model", ns3::UintegerValue(3), ns3::MakeUintegerChecker< uint32_t >())
This class can be used to hold variables of floating point type such as 'double' or 'float'...
The RoutingHelper class generates routing data between nodes (vehicles) and uses the RoutingStats cla...
void SaveConfig(std::string configFilename)
Saves a configuration to a given named config-store raw text configuration file.
Helper class that adds DSDV routing to nodes.
void Install(DsrHelper &dsrHelper, NodeContainer nodes)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
void SetupAdhocMobilityNodes()
Set up the adhoc mobility nodes.
virtual ~WifiApp()
Destructor.
a unique identifier for an interface.
static ns3::GlobalValue g_txSafetyRange4("VRCtxSafetyRange4","BSM range for PDR inclusion", ns3::DoubleValue(200.0), ns3::MakeDoubleChecker< double >())
Ptr< RoutingHelper > m_routingHelper
void SetConfigFromGlobals()
Set up configuration parameter from the global variables.
uint32_t m_cumulativeRxPkts
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
static void EnableLogComponents(void)
Helper to enable all WifiNetDevice log components with one statement.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
static ns3::GlobalValue g_nodePause("VRCnodePause","Node pause time (s) for RWP model", ns3::UintegerValue(0), ns3::MakeUintegerChecker< uint32_t >())
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Allocate a set of positions.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...