Skip to content

Commit

Permalink
Release/v0.2.0
Browse files Browse the repository at this point in the history
* Based on arXiv:2103.04609v2
* Acquired VR traces for both 30 and 60 FPS streams
* Traces were obtained with a more powerful machine comprising an nVidia RTX 2080 Ti (with respect to the system used for v0.1.0, comprising an nVidia 950M)
* Updated VR model also to support user-defined frame rates
* Update frame size standard deviation distribution from linear (m\*x) to a power law (a\*x^b) to improve the fit
* Update examples and results-generating scripts
  • Loading branch information
mattia-lecci authored May 4, 2021
1 parent b01f683 commit 064b19e
Show file tree
Hide file tree
Showing 31 changed files with 251,000 additions and 60,068 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Examples of usage for the newly introduced features can be found in the ``exampl

This module comprises the following features:

* Adds `BurstyApplication` and `BurstSink` as ns-3 applications: they allow to model complex applications sending large data packets over UDP sockets, fragmenting them into bursts of smaller packets, and reassembling the packets at the receiver, if possible
* Adds `BurstyApplication` and `BurstSink` as ns-3 applications: they allow to model complex applications by sending large data packets over UDP sockets, fragmenting them into bursts of smaller packets, and reassembling the packets at the receiver, if possible
* A tracing system allows to obtain burst-level and fragment-level information at both the transmitter and receiver side
* Models a Virtual Reality traffic source
* 10 of the acquired VR traffic traces can be found in this repository and can be used directly in a simulation, using the `TraceFileBurstGenerator`
* 10 of the acquired VR traffic traces can be found in [model/BurstGeneratorTraces/](model/BurstGeneratorTraces/) and can be used directly in a simulation, using the `TraceFileBurstGenerator`
* Additional traffic models can be implemented by simply extending the `BurstGenerator` interface

Future releases will aim to:
* Improve, add, and diversify the real VR traffic traces
* Improve, add, and diversify the VR traffic traces, including realistic head movements in popular VR applications
* Model second-order statistics for VR traffic
* Include a head-rotation model, coupled with the VR traffic generator
* Optionally include sound traffic in the VR traffic generator, other than video traffic
Expand Down
14 changes: 9 additions & 5 deletions examples/sample-mixture-random-variable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

using namespace ns3;

int main (int argc, char *argv[])
int
main (int argc, char *argv[])
{
uint32_t nSamples = 1000000;

Expand All @@ -46,11 +47,13 @@ int main (int argc, char *argv[])
Ptr<MixtureRandomVariable> x = CreateObject<MixtureRandomVariable> ();

// setup weights cdf
std::vector<double> w {0.7, 1.0}; // p1 = 0.7, p2 = 0.3
std::vector<double> w{0.7, 1.0}; // p1 = 0.7, p2 = 0.3
// setup random variables
std::vector<Ptr<RandomVariableStream> > rvs;
rvs.push_back (CreateObjectWithAttributes<NormalRandomVariable> ("Mean", DoubleValue (5), "Variance", DoubleValue (1)));
rvs.push_back (CreateObjectWithAttributes<NormalRandomVariable> ("Mean", DoubleValue (10), "Variance", DoubleValue (4)));
std::vector<Ptr<RandomVariableStream>> rvs;
rvs.push_back (CreateObjectWithAttributes<NormalRandomVariable> ("Mean", DoubleValue (5),
"Variance", DoubleValue (1)));
rvs.push_back (CreateObjectWithAttributes<NormalRandomVariable> ("Mean", DoubleValue (10),
"Variance", DoubleValue (4)));

x->SetRvs (w, rvs);

Expand All @@ -59,4 +62,5 @@ int main (int argc, char *argv[])
std::cout << x->GetValue () << std::endl;
}

return 0;
}
17 changes: 10 additions & 7 deletions examples/sem-simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,18 @@ def plot_line_metric(campaign, parameter_space, result_parsing_function, runs, x
type=int,
default=1)
parser.add_argument("--numRuns",
help="The number of runs per simulation. Default: 5",
help="The number of runs per simulation. Default: 50",
type=int,
default=10)
default=50)
parser.add_argument("--campaignName",
help="MANDATORY parameter for the campaign name. Suggested: commit hash",
default=None)
parser.add_argument("--paramSet",
help="Parameter set",
help="MANDATORY parameter set",
default=None)
parser.add_argument("--frameRate",
help="Frame rate. Default: 60",
default=60)
args = parser.parse_args()

assert args.campaignName is not None, "Undefined parameter --campaignName"
Expand Down Expand Up @@ -262,17 +265,17 @@ def plot_line_metric(campaign, parameter_space, result_parsing_function, runs, x
if args.paramSet == "nStas":
param_combination = OrderedDict({
"appRate": "50Mbps",
"frameRate": 30,
"frameRate": args.frameRate,
"burstGeneratorType": ["model", "trace", "deterministic"],
"nStas": [2, 4, 6, 8],
"nStas": list(range(1, 8+1)),
"simulationTime": 10,
"RngRun": list(range(args.numRuns))
})

elif args.paramSet == "appRate":
param_combination = OrderedDict({
"appRate": [f"{rate}Mbps" for rate in range(5, 50+1, 5)],
"frameRate": 30,
"appRate": [f"{rate}Mbps" for rate in range(10, 50+1, 10)],
"frameRate": args.frameRate,
"burstGeneratorType": ["model", "trace", "deterministic"],
"nStas": 1,
"simulationTime": 10,
Expand Down
6 changes: 3 additions & 3 deletions examples/vr-app-n-stas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ main (int argc, char *argv[])
uint32_t nStas = 2; // the number of STAs around the AP
double distance = 1; // the distance from the AP [m]
std::string appRate = "50Mbps"; // the app target data rate
double frameRate = 30; // the app frame rate [FPS]
double frameRate = 60; // the app frame rate [FPS]
std::string burstGeneratorType = "model"; // type of burst generator {"model", "trace", "deterministic"}
double simulationTime = 10; // simulation time in seconds

Expand Down Expand Up @@ -249,8 +249,8 @@ main (int argc, char *argv[])
{
uint32_t dataRateMbps = uint32_t (DataRate (appRate).GetBitRate () / 1e6);
std::ostringstream filenameSs;
filenameSs << GetInputPath () << "src/applications/model/BurstGeneratorTraces/steam_init_"
<< dataRateMbps << "mbps_" << uint32_t (frameRate) << "fps_5min_usb_still.csv";
filenameSs << GetInputPath () << "src/applications/model/BurstGeneratorTraces/"
<< dataRateMbps << "mbps_" << uint32_t (frameRate) << "fps.csv";

NS_LOG_DEBUG ("Trace file generator with filename=" << filenameSs.str ());

Expand Down
2 changes: 1 addition & 1 deletion helper/burst-sink-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BurstSinkHelper::BurstSinkHelper (std::string protocol, Address address)
m_factory.Set ("Local", AddressValue (address));
}

void
void
BurstSinkHelper::SetAttribute (std::string name, const AttributeValue &value)
{
m_factory.Set (name, value);
Expand Down
10 changes: 6 additions & 4 deletions helper/bursty-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BurstyHelper::BurstyHelper (std::string protocol, Address address)
m_burstyApplicationFactory.Set ("Remote", AddressValue (address));
}

void
void
BurstyHelper::SetAttribute (std::string name, const AttributeValue &value)
{
m_burstyApplicationFactory.Set (name, value);
Expand All @@ -59,7 +59,7 @@ BurstyHelper::SetBurstGenerator (std::string type,
m_burstGeneratorFactory.Set (n4, v4);
}

void
void
BurstyHelper::SetBurstGeneratorAttribute (std::string name, const AttributeValue &value)
{
m_burstGeneratorFactory.Set (name, value);
Expand Down Expand Up @@ -115,12 +115,14 @@ BurstyHelper::AssignStreams (NodeContainer c, int64_t stream)
Ptr<BurstyApplication> app = DynamicCast<BurstyApplication> (node->GetApplication (j));
if (app)
{
Ptr<SimpleBurstGenerator> simpleGenerator = DynamicCast<SimpleBurstGenerator> (app->GetBurstGenerator ()); // TODO improve
Ptr<SimpleBurstGenerator> simpleGenerator =
DynamicCast<SimpleBurstGenerator> (app->GetBurstGenerator ()); // TODO improve
if (simpleGenerator)
{
currentStream += simpleGenerator->AssignStreams (currentStream);
}
Ptr<VrBurstGenerator> vrGenerator = DynamicCast<VrBurstGenerator> (app->GetBurstGenerator ()); // TODO improve
Ptr<VrBurstGenerator> vrGenerator =
DynamicCast<VrBurstGenerator> (app->GetBurstGenerator ()); // TODO improve
if (vrGenerator)
{
currentStream += vrGenerator->AssignStreams (currentStream);
Expand Down
25 changes: 12 additions & 13 deletions helper/bursty-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ class BurstyHelper
*/
ApplicationContainer Install (std::string nodeName) const;

/**
* Assign a fixed random variable stream number to the random variables
* used by this model. Return the number of streams (possibly zero) that
* have been assigned. The Install() method should have previously been
* called by the user.
*
* \param stream first stream index to use
* \param c NodeContainer of the set of nodes for which the BurstyApplication
* should be modified to use a fixed stream
* \return the number of stream indices assigned by this helper
*/
/**
* Assign a fixed random variable stream number to the random variables
* used by this model. Return the number of streams (possibly zero) that
* have been assigned. The Install() method should have previously been
* called by the user.
*
* \param stream first stream index to use
* \param c NodeContainer of the set of nodes for which the BurstyApplication
* should be modified to use a fixed stream
* \return the number of stream indices assigned by this helper
*/
int64_t AssignStreams (NodeContainer c, int64_t stream);

private:
Expand All @@ -147,10 +147,9 @@ class BurstyHelper
Ptr<Application> InstallPriv (Ptr<Node> node) const;

ObjectFactory m_burstyApplicationFactory; //!< BurstyApplication factory
ObjectFactory m_burstGeneratorFactory; //!< BurstGenerator factory
ObjectFactory m_burstGeneratorFactory; //!< BurstGenerator factory
};

} // namespace ns3

#endif /* BURSTY_HELPER_H */

Loading

0 comments on commit 064b19e

Please sign in to comment.