Skip to content

Commit

Permalink
Align module to ns-3.37
Browse files Browse the repository at this point in the history
* Update wscript with CMakeLists.txt
* Update model example and bursty-app
* Update README with new ns3 commands
* Make example compliant only with 802.11ac
  • Loading branch information
MatteoDrago authored Jan 25, 2023
1 parent d12079f commit 8bd43fe
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 72 deletions.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
build_lib(
LIBNAME vr-app
SOURCE_FILES model/burst-generator.cc
model/burst-sink.cc
model/bursty-application.cc
model/my-random-variable-stream.cc
model/seq-ts-size-frag-header.cc
model/simple-burst-generator.cc
model/trace-file-burst-generator.cc
model/vr-burst-generator.cc
helper/bursty-helper.cc
helper/burst-sink-helper.cc
HEADER_FILES model/burst-generator.h
model/burst-sink.h
model/bursty-application.h
model/my-random-variable-stream.h
model/seq-ts-size-frag-header.h
model/simple-burst-generator.h
model/trace-file-burst-generator.h
model/vr-burst-generator.h
helper/bursty-helper.h
helper/burst-sink-helper.h
LIBRARIES_TO_LINK ${libcore}
${libapplications}
${libpoint-to-point}
${libinternet}
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ git clone https://github.com/signetlabdei/ns-3-vr-app ns-3-dev/contrib/vr-app
Configure and build ns-3 from the `ns-3-dev` folder:

```bash
./waf configure --enable-tests --enable-examples
./waf build
./ns3 configure --enable-tests --enable-examples
./ns3 build
```

This module does not provide Python bindings at the moment.
Expand Down
45 changes: 45 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
build_lib_example(
NAME sample-mixture-random-variable
SOURCE_FILES sample-mixture-random-variable.cc
LIBRARIES_TO_LINK ${libvr-app}
${libapplications}
)

build_lib_example(
NAME bursty-application-example
SOURCE_FILES bursty-application-example.cc
LIBRARIES_TO_LINK ${libvr-app}
${libapplications}
${libpoint-to-point}
${libinternet}
${libnetwork}
)

build_lib_example(
NAME vr-application-example
SOURCE_FILES vr-application-example.cc
LIBRARIES_TO_LINK ${libvr-app}
${libapplications}
${libpoint-to-point}
${libinternet}
${libnetwork}
)

build_lib_example(
NAME trace-file-burst-application-example
SOURCE_FILES trace-file-burst-application-example.cc
LIBRARIES_TO_LINK ${libvr-app}
${libapplications}
${libpoint-to-point}
${libinternet}
${libnetwork}
)

build_lib_example(
NAME vr-app-n-stas
SOURCE_FILES vr-app-n-stas.cc
LIBRARIES_TO_LINK ${libvr-app}
${libapplications}
${libcore}
${libwifi}
)
21 changes: 14 additions & 7 deletions examples/vr-app-n-stas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ main (int argc, char *argv[])

uint32_t fragmentSize = 1472; //bytes
uint32_t channelWidth = 160; // MHz
double frequency = 5; // GHz
bool sgi = true; // Use short guard interval

LogComponentEnableAll (LOG_PREFIX_ALL);
Expand All @@ -165,17 +166,25 @@ main (int argc, char *argv[])
NodeContainer wifiApNode;
wifiApNode.Create (1);

YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy;
phy.SetChannel (channel.Create ());

WifiHelper wifi;
wifi.SetStandard (WIFI_STANDARD_80211ac);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue ("VhtMcs9"),
"ControlMode", StringValue ("VhtMcs0"));
WifiMacHelper mac;

YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
YansWifiPhyHelper phy;
phy.SetChannel (channel.Create ());

if (frequency != 5)
{
NS_ABORT_MSG("Frequency=" << frequency << "GHz not supported by this wifi standard.");
}

phy.Set("ChannelSettings",
StringValue(std::string("{0, ") + std::to_string(channelWidth) + ", BAND_5GHZ, 0}"));

WifiMacHelper mac;
Ssid ssid = Ssid ("vr-app-n-stas");
mac.SetType ("ns3::StaWifiMac",
"Ssid", SsidValue (ssid));
Expand All @@ -190,9 +199,7 @@ main (int argc, char *argv[])
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);

Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (sgi));

// Setting mobility model
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
Expand Down
26 changes: 0 additions & 26 deletions examples/wscript

This file was deleted.

2 changes: 1 addition & 1 deletion model/bursty-application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ BurstyApplication::StopApplication ()
NS_LOG_FUNCTION (this);

CancelEvents ();
if (m_socket != 0)
if (m_socket)
{
m_socket->Close ();
}
Expand Down
36 changes: 0 additions & 36 deletions wscript

This file was deleted.

0 comments on commit 8bd43fe

Please sign in to comment.