blob: e689bd8c9bbc3c989794806fc47c2a43ef0144ba [file] [log] [blame]
<!DOCTYPE html><html lang="en-us" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Source Themes Academic 4.8.0">
<meta name="author" content="Fraunhofer FOKUS">
<meta name="description" content="The ns-3 is a discrete-event network simulator that was developed as a replacement for the popular network simulator 2 (ns-2) and mainly focuses upon improving the core architecture, software integration, models, and educational components for real-world network devices and protocols.">
<link rel="alternate" hreflang="en-us" href="https://www.eclipse.org/mosaic/docs/simulators/network_simulator_ns3/">
<meta name="theme-color" content="#68145C">
<script src="/mosaic/js/mathjax-config.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css" integrity="sha512-MCWBwPSput2UWNwyznVFLbD2iUc1e5VsdD1zahsWVzkDSUzyHhMZ4kCS3wgYSRm0mU+glwD/Q9lSJrDPwbUL2A==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/all.min.css" integrity="sha512-ZYg+hQvLlM0W9C3P6vTpes5LmJ66G2EsroxDNzwD6qiulckldb29eD9I672HL2X+LH5nRhY1sQqZLJGB+aUUPg==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" integrity="sha512-H9jrZiiopUdsLpg94A333EfumgUBpO9MdbxStdeITo+KEIMaNfHNvwyjjDJb+ERPaRS6DpyRlKbvPUasNItRyw==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-light.min.css" crossorigin="anonymous" title="hl-light">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-light.min.css" crossorigin="anonymous" title="hl-dark" disabled>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.css" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js" integrity="sha512-TmDwFLhg3UA4ZG0Eb4MIyT1O1Mb+Oww5kFG0uHqXsdbyZz9DcvYQhKpGgNkamAI6h2lGGZq2X8ftOJvF/XjTUg==" crossorigin="anonymous" async></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.1.0/es5/tex-chtml.min.js" integrity="sha512-uwL1UtpYdWra2iqJlAW8Ts0s9Os6IxWLDJDF/BnWdhDmT7DEMFba3GPsFwmV3QiTNcUyl2GB5vsgycB/MOvo9g==" crossorigin="anonymous" async></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i%7CRoboto+Mono&display=swap">
<link rel="stylesheet" href="/mosaic/css/academic.css">
<link rel="manifest" href="/mosaic/index.webmanifest">
<link rel="icon" type="image/png" href="/mosaic/images/icon_hu6bdfb97c7e23190c70e41ca0e15a9fce_30436_32x32_fill_lanczos_center_2.png">
<link rel="apple-touch-icon" type="image/png" href="/mosaic/images/icon_hu6bdfb97c7e23190c70e41ca0e15a9fce_30436_192x192_fill_lanczos_center_2.png">
<link rel="canonical" href="https://www.eclipse.org/mosaic/docs/simulators/network_simulator_ns3/">
<meta property="twitter:card" content="summary">
<meta property="og:site_name" content="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility">
<meta property="og:url" content="https://www.eclipse.org/mosaic/docs/simulators/network_simulator_ns3/">
<meta property="og:title" content="Network Simulator ns-3 | Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility">
<meta property="og:description" content="The ns-3 is a discrete-event network simulator that was developed as a replacement for the popular network simulator 2 (ns-2) and mainly focuses upon improving the core architecture, software integration, models, and educational components for real-world network devices and protocols."><meta property="og:image" content="https://www.eclipse.org/mosaic/images/logo.svg">
<meta property="twitter:image" content="https://www.eclipse.org/mosaic/images/logo.svg"><meta property="og:locale" content="en-us">
<meta property="article:published_time" content="2019-05-05T00:00:00&#43;01:00">
<meta property="article:modified_time" content="2019-05-05T00:00:00&#43;01:00">
<title>Network Simulator ns-3 | Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility</title>
</head>
<body id="top" data-spy="scroll" data-offset="70" data-target="#TableOfContents" class=" page-mosaic page-docs page-simulators page-network_simulator_ns3 ">
<aside class="search-results" id="search">
<div class="container">
<section class="search-header">
<div class="row no-gutters justify-content-between mb-3">
<div class="col-10 col-md-3">
<div class="logo" style="background-image: url(/mosaic/img/logos/mosaic/EclipseMOSAIC-Logo-RGB-positiv.svg)"></div>
</div>
<div class="col-2 col-md-4 col-search-close">
<a class="js-search" href="#"><i class="fas fa-times-circle text-muted" aria-hidden="true"></i></a>
</div>
</div>
<div id="search-box">
<input name="q" id="search-query" placeholder="Search..." autocapitalize="off"
autocomplete="off" autocorrect="off" spellcheck="false" type="search">
</div>
</section>
<section class="section-search-results">
<div id="search-hits">
</div>
</section>
</div>
</aside>
<nav class="navbar navbar-expand-lg navbar-light compensate-for-scrollbar" id="navbar-main">
<div class="container">
<div class="d-none d-lg-inline-flex">
<a style="visibility:visible;" class="navbar-brand" href="/mosaic/"><img src="/mosaic/images/logo.svg" alt="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility"></a>
</div>
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbar-content-mobile" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span><i class="fas fa-bars"></i></span>
</button>
<div class="navbar-brand-mobile-wrapper d-inline-flex d-lg-none">
<a class="navbar-brand" href="/mosaic/"><img src="/mosaic/images/logo.svg" alt="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility"></a>
</div>
<div id="navbar-content" class="navbar-collapse main-menu-item collapse justify-content-start">
<ul class="navbar-nav d-md-inline-flex">
<li class="nav-item">
<a class="nav-link " href="/mosaic/about/"><span>About</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/news/"><span>News</span></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/mosaic/docs/"><span>Documentation</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/tutorials/"><span>Tutorials</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/download/"><span>Download</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/community/"><span>Community</span></a>
</li>
</ul>
</div>
<ul class="nav-icons navbar-nav flex-row ml-auto d-flex pl-md-2">
<li class="nav-item">
<a class="nav-link js-search" href="#" aria-label="Search"><i class="fas fa-search" aria-hidden="true"></i></a>
</li>
<li class="nav-item ">
<a href="https://github.com/eclipse/mosaic" target="blank">
<i class="fab fa-github" aria-hidden="true"></i>
</a>
</li>
</ul>
<div id="navbar-content-mobile" class="navbar-collapse main-menu-item collapse justify-content-start d-lg-none">
<ul class="navbar-nav d-inline-flex">
<li class="nav-item">
<a class="nav-link " href="/mosaic/about/"><span>About</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/news/"><span>News</span></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/mosaic/docs/"><span>Documentation</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/tutorials/"><span>Tutorials</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/download/"><span>Download</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/community/"><span>Community</span></a>
</li>
</ul>
</div>
</div>
</nav>
<div class="docs container">
<div class="row flex-xl-nowrap">
<div class="docs-sidebar col-12 col-md-3 col-xl-3">
<div class="docs-version">
<a class="" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The documentation corresponds to the latest version of Eclipse MOSAIC 21.1-SNAPSHOT." href="https://github.com/eclipse/mosaic">
<i class="fab fa-github"></i>&nbsp;Eclipse MOSAIC 21.1-SNAPSHOT
</a>
</div>
<form class="docs-search d-flex align-items-center">
<button class="btn docs-toggle d-md-none p-0 mr-3" type="button" data-bs-toggle="collapse" data-bs-target="#docs-nav" aria-controls="docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
<span><i class="fas fa-bars"></i></span>
</button>
<input name="q" type="search" class="form-control" placeholder="Search..." autocomplete="off">
</form>
<nav class="collapse docs-links" id="docs-nav">
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/getting_started/">Getting Started</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/getting_started/">Download</a>
</li>
<li >
<a href="/mosaic/docs/getting_started/run_mosaic/">Run Eclipse MOSAIC</a>
</li>
<li >
<a href="/mosaic/docs/getting_started/results/">Simulation Results</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/visualization/">Visualization</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/visualization/">WebSocket Visualizer</a>
</li>
<li >
<a href="/mosaic/docs/visualization/filevis/">File Output</a>
</li>
<li >
<a href="/mosaic/docs/visualization/statistics/">Statistics Output</a>
</li>
<li >
<a href="/mosaic/docs/visualization/itef/">ITEF</a>
</li>
<li >
<a href="/mosaic/docs/visualization/phabmap/">PHABMap</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/simulators/">Simulators</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/simulators/">Overview</a>
</li>
<li >
<a href="/mosaic/docs/simulators/application_simulator/">Application - Simulator</a>
</li>
<li >
<a href="/mosaic/docs/simulators/application_mapping/">Application - Mapping</a>
</li>
<li >
<a href="/mosaic/docs/simulators/traffic_simulator_sumo/">Traffic - Eclipse SUMO</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_omnetpp/">Network - OMNeT&#43;&#43;</a>
</li>
<li class="active">
<a href="/mosaic/docs/simulators/network_simulator_ns3/">Network - ns-3</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_sns/">Network - SNS</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_cell/">Network - Cell</a>
</li>
<li >
<a href="/mosaic/docs/simulators/environment_simulator/">Environment Simulator</a>
</li>
<li >
<a href="/mosaic/docs/simulators/battery_simulator/">Battery Simulator</a>
</li>
<li >
<a href="/mosaic/docs/simulators/vms_simulator/">VMS Simulator</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/building_scenarios/">Building Scenarios</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/building_scenarios/">Simulation Scenarios</a>
</li>
<li >
<a href="/mosaic/docs/building_scenarios/scenario_convert/">Scenario Convert</a>
</li>
<li >
<a href="/mosaic/docs/building_scenarios/scenario_configuration/">Additional Scenario Configuration</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/develop_applications/">Create Applications</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/develop_applications/">Basics</a>
</li>
<li >
<a href="/mosaic/docs/develop_applications/communication/">V2X Communication</a>
</li>
<li >
<a href="/mosaic/docs/develop_applications/event_scheduler/">Event Scheduling</a>
</li>
<li >
<a href="/mosaic/docs/develop_applications/road_traffic/">Scenario Database</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/mosaic_configuration/">MOSAIC Configuration</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/mosaic_configuration/">Configuration Files</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/scenario_config/">Scenario Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/mapping_ambassador_config/">Mapping Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/environment_config/">Environment Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/sns_config/">SNS Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/cell_config/">Cell Basic Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/cell_network_config/">Cell Network Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/cell_region_config/">Cell Region Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/sumo_config/">SUMO Configuration</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/extending_mosaic/">Extending Eclipse MOSAIC</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/extending_mosaic/">Core Concepts</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/simulator_coupling/">Simulator Coupling</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/interactions/">Interactions</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/application_ambassador_details/">Application Ambassador</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/sumo_ambassador_details/">Sumo Ambassador</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/omnetpp_details/">OMNeT&#43;&#43; Federate</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/delay_models/">Delay Models</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/api_docs/">API Documentation</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/api_docs/">Javadoc</a>
</li>
</ul>
</div>
<div class="nav-bottom">
<img src="/mosaic/img/logos/mosaic/EclipseMOSAIC-Medallion-RGB-single-navy.svg">
</div>
</nav>
</div>
<div class="docs-toc d-none d-xl-block col-xl-2">
<ul class="nav toc-top">
<li><a href="#" id="back_to_top" class="docs-toc-title">Contents</a></li>
</ul>
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#ns3-ambassador-folder-structure">ns3-ambassador folder structure</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#installation-in-docker-environment">Installation in Docker environment</a></li>
<li><a href="#configuration">Configuration</a></li>
</ul>
</li>
</ul>
</nav>
</div>
<style>
@media (min-width:1140px) {
.docs-sidebar {
flex: 0 1 320px;
}
.docs-toc {
flex: 0 1 280px;
}
main.docs-content.no-docs-toc {
padding-bottom: 0 !important;
max-width: calc(100% - 320px) !important;
flex: 0 1 calc(100% - 320px);
width: 100%;
}
main.docs-content {
padding-bottom: 0 !important;
max-width: calc(100% - 600px) !important;
flex: 0 1 calc(100% - 600px);
width: 100%;
}
}
@media (max-width: 770px) {
main.docs-content {
max-width: 100% !important;
width: 100%;
}
}
@media (min-width: 771px) and(max-width: 1139px) {
main.docs-content.no-docs-toc {
padding-bottom: 0 !important;
max-width: calc(100% - 320px) !important;
width: 100%;
}
}
</style>
<main class="docs-content col-12 col-md-9 col-xl-auto py-md-3 pl-md-4" role="main">
<article class="article">
<div class="docs-article-container">
<h1>Network Simulator ns-3</h1>
<div class="article-style">
<p>The ns-3 is a discrete-event network simulator that was developed as a replacement for the popular
network simulator 2 (ns-2) and mainly focuses upon improving the core architecture, software integration,
models, and educational components for real-world network devices and protocols. It simulates both
unicast and multicast protocols and is used extensively in research on mobile ad-hoc networks.</p>
<p>Regardless, ns-2 still remains in active use and will continue to be maintained in the near future. For
Eclipse MOSAIC coupling, only ns-3 will be available.</p>
<p>Like other network simulators, ns-3 has a relatively steep learning curve, especially compared to GUI-
based simulators. If you have no prior experience with ns-3, we recommend familiarizing yourself with
the ns-3 simulation environment and the ns-3 simulation basics first. The ns-3 documentation can be
found under: <a href="https://www.nsnam.org/documentation" target="_blank">https://www.nsnam.org/documentation</a></p>
<p>To take your first steps with ns-3, you might want to download 2 the latest version, build a copy of ns-3 (it
uses the Python-based build-system waf) and take a look at the examples, that are shipped within most
of the ns-3 source code repositories and packages. You might also examine the simulation output and try
to adjust it.</p>
<p>Typically, a ns-3 user will work under a Linux environment. For those running under Windows, there do
exist environments which simulate the Linux environment to various degrees. The ns-3 project has in the
past (but not presently) supported the Cygwin environment for these users (see <a href="http://www.cygwin.com" target="_blank">http://www.cygwin.com</a>
for details on downloading). MiniGW is presently not officially supported, however there are also
some people who managed to use it with ns-3. For detailed information of how to set up ns-3, please refer
to their Wiki: <a href="https://www.nsnam.org/wiki/Installation" target="_blank">https://www.nsnam.org/wiki/Installation</a></p>
<p>For more information on how to set up ns-3 with Eclipse MOSAIC, please just refer to the following section. We
prepared an installation script, which manages most of the required work.</p>
<div class="alert alert-warning">
<div>
<p>As stated above, ns-3 is primarily developed on and for GNU/Linux platforms.
Since Windows is such a widely used platform and Cygwin is not a perfect emulation
of any Linux, we highly recommended for non-Linux users to consider the installation of a
Linux virtual machine with a virtual machine environment, such as
<a href="https://www.vmware.com/products/workstation-player.html" target="_blank">VMware</a> or <a href="https://www.virtualbox.org/" target="_blank">VirtualBox</a>.</p>
</div>
</div>
<table>
<thead>
<tr>
<th style="text-align:left"></th>
<th style="text-align:left">Software information</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>Developer(s)</strong></td>
<td style="text-align:left">Tom Henderson, Mathieu Lacage, George Riley, Mitch Watrous, Gustavo Carneiro, Tommaso Pecorella and others</td>
</tr>
<tr>
<td style="text-align:left"><strong>Written in</strong></td>
<td style="text-align:left">C++ (core) and Python (bindings)</td>
</tr>
<tr>
<td style="text-align:left"><strong>Operating system</strong></td>
<td style="text-align:left">GNU/Linux FreeBSD Mac OS X</td>
</tr>
<tr>
<td style="text-align:left"><strong>License</strong></td>
<td style="text-align:left">Free software: GNU GPLv2</td>
</tr>
<tr>
<td style="text-align:left"><strong>Website</strong></td>
<td style="text-align:left"><a href="http://www.nsnam.org/" target="_blank">http://www.nsnam.org/</a></td>
</tr>
<tr>
<td style="text-align:left"><strong>Supported version(s)</strong></td>
<td style="text-align:left">3.28</td>
</tr>
<tr>
<td style="text-align:left"><strong>Dependencies</strong></td>
<td style="text-align:left">libprotobuf 3.3.0</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">libxml2</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">libsqlite3</td>
</tr>
<tr>
<td style="text-align:left"><strong>Deployed in MOSAIC all-in-one</strong></td>
<td style="text-align:left">no (and need a patch to link)</td>
</tr>
</tbody>
</table>
<h3 id="ns3-ambassador-folder-structure">ns3-ambassador folder structure</h3>
<pre><code class="language-plaintext">└─ &lt;scenario_name&gt;
└─ ns3
├─ ns3_config.json ................. Ambassador configuration file
├─ configTechnologies.xml ...........ns-3 federate configuration file
└─ confWifi.xml .....................ns-3 federate configuration file
</code></pre>
<h3 id="installation">Installation</h3>
<p>Eclipse MOSAIC offers support for the current stable release of ns-3 (3.28), that was released in March 2018. Older
versions of ns-3 (prior to 3.28) are not supported. However, also for newer versions we cannot guarantee
the correct operation. The coupling to Eclipse MOSAIC is designed in a manner of minimal code changes on the
ns-3 simulator itself to keep the update capabilities for future versions.</p>
<h4 id="prerequisites">Prerequisites</h4>
<p>For GNU/Linux platforms, the minimal requirements to run basic simulations are a <strong>gcc</strong> or <strong>clang</strong> compiler
and a <strong>Python</strong> interpreter. At least you need the following packages to be installed:</p>
<p><em><strong>Minimum requirement:</strong></em></p>
<pre><code>gcc
g++
python
python-dev
</code></pre>
<p>For a complete list of required packages for different distributions, please refer to the ns-3 installation
guide: <a href="https://www.nsnam.org/wiki/Installation" target="_blank">https://www.nsnam.org/wiki/Installation</a></p>
<p>Please make sure the following libraries are installed before running the installation script:</p>
<ul>
<li>libxml2</li>
<li>libsqlite3</li>
<li>libprotobuf 3.3.0</li>
</ul>
<h4 id="run-the-installation-script">Run the installation script</h4>
<div class="alert alert-warning">
<div>
<p>ns-3 requires several packages to be installed on your computer. You will
need to ensure, that all required libraries are present on your system before proceeding. You
may need superuser permissions to install packages.</p>
</div>
</div>
<div class="alert alert-warning">
<div>
<p>If your local protobuf version does not fit the required one, the installation
may fail with an error. In that case, you can run the install script with the <code>-p</code> flag. This will
rebuild the protobuf files during installation and allow it to proceed correctly.</p>
</div>
</div>
<p>To ease the installation of ns-3 for Eclipse MOSAIC, the installation process has been delegated to an installation
script, that can be found in the associated ns-3 federate folder.</p>
<p><strong>ns3-ambassador federate folder structure:</strong></p>
<pre><code class="language-plaintext">└─ mosaic/bin/fed/ns3
└─ ns3
├─ Dockerfile.sh ....................Dockerfile for ns-3 federate
└─ ns3_installer.sh ................ Installation script for ns-3
</code></pre>
<p><strong>The ns-3 installation script accomplishes the following tasks:</strong></p>
<ol>
<li>Download ns-3 tarball from the official sources</li>
<li>Download the ns-3 federate for Eclipse MOSAIC.</li>
<li>Apply a patch to ns-3 in order to make it work with Eclipse MOSAIC.</li>
<li>Add the ns-3 federate to the waf build system.</li>
<li>Configure and build the patched ns-3 with the ns-3 federate.</li>
</ol>
<p><strong>In order to start the simulation, the following steps need to be performed:</strong></p>
<ol>
<li>Set up the <code>confWifi.xml</code>-file in the scenario folder (see section
<a href="/mosaic/docs/simulators/network_simulator_ns3/#configuration">
Configuration
</a>
). An example confWifi.xml - file is shipped with the Tiergarten scenario.</li>
<li>For reasonable result logging, the logger-configuration in <code>mosaic/etc/logback.xml</code> has to be adapted to support the ns-3 ambassador and federate.</li>
<li>At last ns-3 has to be activated in the <code>mosaic_config.xml</code> and the simulation can be started.</li>
</ol>
<h3 id="installation-in-docker-environment">Installation in Docker environment</h3>
<div class="alert alert-note">
<div>
<p>This is an experimental feature. Please refer to our mailing list if you experience any problems.</p>
</div>
</div>
<p>This guide gives instructions to execute the ns-3 federate inside a docker container. If you already installed
ns-3 on your machine following the steps before, you can skip this section.</p>
<p>Docker is a new approach to execute software. More precisely, it &ldquo;wraps software in a complete filesystem
that contains everything it needs to run: code, runtime, system tools, and system libraries&rdquo;. As a result, the
software is executed within a container and its execution does not rely on the environment the container is running in.</p>
<p>In context of Eclipse MOSAIC, this approach allows to execute ns-3 within a docker container. The user does not
need to manually install ns-3 and can even run ns-3 on Windows hosts.</p>
<ol>
<li>Install Docker ≥ 1.13 on your machine.</li>
<li>To get everything to work, please make sure to execute the following steps depending on your operating system:
<ul>
<li>Windows - In the settings, share the drive where Eclipse MOSAIC is installed on. You may need to restart docker in the reset tab.</li>
<li>Linux - Make sure your user account belongs to the unix-group <code>docker</code>. You may need to restart your machine.</li>
</ul>
</li>
<li>Switch to the location of the Dockerfile in <code>&lt;mosaic&gt;/bin/fed/ns3</code></li>
<li>Execute the following command on command line:<br>
<code>docker build -t ns3-federate</code>.<br>
This could take a while to finish.</li>
<li>Enter the name of the docker image <code>etc/runtime.json</code> in the <code>ns3</code>-section into the property <code>dockerImage</code>:</li>
</ol>
<pre><code class="language-json">&quot;federates&quot;: [
...
{
&quot;id&quot;: &quot;ns3&quot;,
&quot;dockerImage&quot;: &quot;ns3-federate&quot;,
...
},
...
]
</code></pre>
<p>You can test the installation of your docker image with the Tiergarten scenario, by activating ns3 in the <code>scenario_config.json</code>.</p>
<h3 id="configuration">Configuration</h3>
<p>The whole ns-3 specific configuration is done via the <code>confWifi.xml</code> and <code>configTechnologies.xml</code> files.</p>
<p><strong>confWifi.xml:</strong></p>
<pre><code class="language-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
&lt;wifi&gt;
&lt;!-- IPv4 address generator --&gt;
&lt;ipConfiguration&gt;
&lt;ip address=&quot;192.168.0.0&quot; mask=&quot;255.255.0.0&quot;/&gt;
&lt;/ipConfiguration&gt;
&lt;!-- Calculate a propagation delay --&gt;
&lt;propagationDelayModel&gt;
&lt;delay model= &quot;ns3::NonePropagationDelayModel&quot;/&gt;
&lt;/propagationDelayModel&gt;
&lt;!-- Modelize the propagation loss through a transmission medium --&gt;
&lt;propagationLossModel&gt;
&lt;loss model= &quot;ns3::FriisPropagationLossModel&quot;/&gt;
&lt;/propagationLossModel&gt;
&lt;wifiConfiguration&gt;
&lt;!-- Create non QoS-enabled MAC layers --&gt;
&lt;wifiMac property=&quot;type&quot; value=&quot;ns3::AdhocWifiMac&quot;/&gt;
&lt;!-- Wifi PHY mode --&gt;
&lt;wifiManager property=&quot;phyMode&quot; value=&quot;OfdmRate54Mbps&quot;/&gt;
&lt;!-- Wifi manager --&gt;
&lt;wifiManager property=&quot;type&quot; value=&quot;ns3::ConstantRateWifiManager&quot;/&gt;
&lt;!-- The energy of a received signal should be higher than this threshold (dbm) to allow the PHY layer to detect the signal --&gt;
&lt;wifiPhy property=&quot;EnergyDetectionThreshold&quot; value=&quot;-81.0&quot;/&gt;
&lt;!-- The energy of a received signal should be higher than this threshold (dbm) to allow the PHY layer to declare CCA BUSY state --&gt;
&lt;wifiPhy property=&quot;CcaMode1Threshold&quot; value=&quot;-99.0&quot;/&gt;
&lt;!-- Transmission gain (dB) --&gt;
&lt;wifiPhy property=&quot;TxGain&quot; value=&quot;0.0&quot;/&gt;
&lt;!-- Reception gain (dB) --&gt;
&lt;wifiPhy property=&quot;RxGain&quot; value=&quot;0.0&quot;/&gt;
&lt;!-- Number of transmission power levels available between TxPowerStart and TxPowerEnd included --&gt;
&lt;wifiPhy property=&quot;TxPowerLevels&quot; value=&quot;1&quot;/&gt;
&lt;!-- Maximum available transmission level (dbm) --&gt;
&lt;wifiPhy property=&quot;TxPowerEnd&quot; value=&quot;17.0&quot;/&gt;
&lt;!-- Minimum available transmission level (dbm) --&gt;
&lt;wifiPhy property=&quot;TxPowerStart&quot; value=&quot;17.0&quot;/&gt;
&lt;!-- Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver --&gt;
&lt;wifiPhy property=&quot;RxNoiseFigure&quot; value=&quot;0.0&quot;/&gt;
&lt;!-- Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1) --&gt;
&lt;wifiPhy property=&quot;ChannelNumber&quot; value=&quot;1&quot;/&gt;
&lt;/wifiConfiguration&gt;
&lt;/wifi&gt;
</code></pre>
<p>The IP configuration information includes the network address and network mask. The ns-3 propagation
module defines two generic interfaces, namely <strong>PropagationLossModel</strong> and <strong>PropagationDelayModel</strong>,
for the modelling of propagation loss respectively propagation delay.</p>
<p>In the default <code>confWifi.xml</code>, the Wi-Fi device uses the ns-3 standard propagation delay model
<code>ns3::ConstantSpeedPropagationDelayModel</code> and the ns-3 standard propagation loss model
<code>ns3::FriisPropagationLossModel</code>. Radio propagation models in ns-3 can easily be exchanged with
the ns-3 class registration system (see the ns-3 documentation for details). The Wi-Fi configuration
includes additional parameters, like sending power and antenna gain.</p>
<p><strong>configTechnologies.xml:</strong></p>
<pre><code class="language-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
&lt;ns3Configuration&gt;
&lt;installers&gt;
&lt;installer type=&quot;ns3::WifiVehicleInstaller&quot; name=&quot;WifiVehicle&quot; file=&quot;confWifi.xml&quot; default=&quot;true&quot; /&gt;
&lt;installer type=&quot;ns3::MobilityModelInstaller&quot; name=&quot;Mobility&quot; default=&quot;true&quot; /&gt;
&lt;/installers&gt;
&lt;/ns3Configuration&gt;
</code></pre>
<p>The configuration manager of the ns-3 federate defines, which installer should be loaded for the Wi-Fi
device (refering to the <code>confWifi.xml</code>) and the mobility model. Usually, you don’t need to take any
changes and simply use the default configuration file, that ships with the ns-3 federate.</p>
</div>
<div class="article-widget">
<div class="post-nav prev-next-pages col-12">
<div class="row">
<div class="post-nav-item col-6">
<div class="meta-nav">Previous</div>
<a href="/mosaic/docs/simulators/network_simulator_omnetpp/" rel="next">Network Simulator OMNeT&#43;&#43;</a>
</div>
<div class="post-nav-item col-6 align-self-end">
<div class="meta-nav">Next</div>
<a href="/mosaic/docs/simulators/network_simulator_sns/" rel="prev">Simple Network Simulator (SNS)</a>
</div>
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div class="row">
<div class="col-sm-4 mb-3 mb-md-0">
<b>Eclipse MOSAIC</b>
<ul>
<li>
<a href="/mosaic/download/" title="Download Eclipse MOSAIC" >
Download Eclipse MOSAIC
</a>
</li>
<li>
<a href="/mosaic/docs/" title="Documentation" >
Documentation
</a>
</li>
<li>
<a href="/mosaic/tutorials/" title="Tutorials" >
Tutorials
</a>
</li>
<li>
<a href="/mosaic/community/#projects" title="Projects" >
Projects
</a>
</li>
<li>
<a href="/mosaic/publications/" title="Publications" >
Publications
</a>
</li>
</ul>
</div>
<div class="col-sm-4 mb-3 mb-md-0">
<b>Community</b>
<ul>
<li>
<a href="/mosaic/community/" title="Eclipse MOSAIC Community" >
Eclipse MOSAIC Community
</a>
</li>
<li>
<a href="/mosaic/contribution/" title="How to contribute" >
How to contribute
</a>
</li>
<li>
<a href="https://github.com/eclipse/mosaic" title="Github" target="_blank" rel="noopener">
Github
</a>
</li>
<li>
<a href="/mosaic/get_in_contact/" title="Contact &amp; Mailing list" >
Contact & Mailing list
</a>
</li>
</ul>
</div>
<div class="col-sm-4 mb-3 mb-md-0">
<b>Eclipse Foundation</b>
<ul>
<li>
<a href="https://www.eclipse.org/" title="About Eclipse Foundation" target="_blank" rel="noopener">
About Eclipse Foundation
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal/privacy.php" title="Privacy Policy" target="_blank" rel="noopener">
Privacy Policy
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal/termsofuse.php" title="Website terms of use" target="_blank" rel="noopener">
Website terms of use
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal/copyright.php" title="Copyright" target="_blank" rel="noopener">
Copyright
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal" title="Legal" target="_blank" rel="noopener">
Legal
</a>
</li>
</ul>
</div>
</div>
<div class="row justify-content-center mt-3 position-relative">
<p class="powered-by text-center font-italic mb-0 pb-0">
Powered by the
<a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic theme</a> for
<a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a>.
<br>
Header image &#169; fanjianhua/ iStock
</p>
</div>
</footer>
</article>
</main>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.6.0/umd/popper.min.js" integrity="sha512-BmM0/BQlqh02wuK5Gz9yrbe7VyIVwOzD1o40yi1IsTjriX/NGF37NyXHfmFzIlMmoSIBXgqDiG1VNU6kB5dBbA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.4/imagesloaded.pkgd.min.js" integrity="sha512-S5PZ9GxJZO16tT9r3WJp/Safn31eu8uWrzglMahDT4dsmgqWonRY9grk3j+3tfuPr9WJNsfooOR7Gi7HL5W2jw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" integrity="sha512-Zq2BOxyhvnRFXu0+WE6ojpZLOU2jdnqbrM1hmVdGzyeCa1DgM3X5Q4A/Is9xA1IkbUeDd7755dNNI/PzSf2Pew==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js" integrity="sha512-uURl+ZXMBrF4AwGaWmEetzrd+J5/8NRkWAvJx5sbPSSuOb0bZLqf+tOzniObO00BjHa/dD7gub9oCGMLPQHtQA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.4.8/mermaid.min.js" integrity="sha512-1tS1YUns336Mtxl+vkaLcADPwE1CPNVy3WEf7nrI7DGMMb6/FAVBgL2IzAWVBkB6vVuK94s2zVoiXcw1QZ9S1g==" crossorigin="anonymous" title="mermaid"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js" integrity="sha512-1LdB3V708w6G4QRl7NsVdTr7MDibyRXr9stQZ+EGjEE0ZPMZkA//ir7kCWmFyxdAJNIRXdR/ZeJmCV0boyiCXw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/java.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/json.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/xml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/shell.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/dos.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin="anonymous"></script>
<script>const code_highlighting = true;</script>
<script>const isSiteThemeDark = false;</script>
<script>
const search_config = {"indexURI":"/mosaic/index.json","minLength":1,"threshold":0.3};
const i18n = {"no_results":"No results found","placeholder":"Search...","results":"results found"};
const content_type = {
'post': "Posts",
'project': "Projects",
'publication' : "Publications",
'talk' : "Talks"
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.1/anchor.min.js" integrity="sha512-aZotBPy6dqn8yVaLJwSrkJ+QxuxV695A4dgodAMvTU5JyNi5mhrr+LeaD3GSS+lx1SMFKNs0tu5ZMJEgNZQP2Q==" crossorigin="anonymous"></script>
<script>
anchors.add();
</script>
<script id="search-hit-fuse-template" type="text/x-template">
<div class="search-hit" id="summary-{{key}}">
<div class="search-hit-content">
<div class="search-hit-name">
<a href="{{relpermalink}}">{{title}}</a>
<div class="article-metadata search-hit-type">{{type}}</div>
<p class="search-hit-description">{{snippet}}</p>
</div>
</div>
</div>
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.2.1/fuse.min.js" integrity="sha512-o38bmzBGX+hD3JHWUFCDA09btWaqrNmoJ3RXLlrysA7PP01Kgs4UlE4MhelE1v5dJR3+cxlR4qQlotsW7jKsnw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha512-mhbv5DqBMgrWL+32MmsDOt/OAvqr/cHimk6B8y/bx/xS88MVkYGPiVv2ixKVrkywF2qHplNRUvFsAHUdxZ3Krg==" crossorigin="anonymous"></script>
<script type="application/javascript" src="/mosaic/js/academic.min.0992ad8b8d033c3858bb90b03966346a.js"></script>
<script type="application/javascript" src="/mosaic/js/mosaic-wg-cards.js"></script>
<script type="application/javascript" src="/mosaic/js/mosaic-docs.js"></script>
<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new window.bootstrap.Tooltip(tooltipTriggerEl)
})
</script>
<div id="modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Cite</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<pre><code class="tex hljs"></code></pre>
</div>
<div class="modal-footer">
<a class="btn btn-outline-primary my-1 js-copy-cite" href="#" target="_blank">
<i class="fas fa-copy"></i> Copy
</a>
<a class="btn btn-outline-primary my-1 js-download-cite" href="#" target="_blank">
<i class="fas fa-download"></i> Download
</a>
<div id="modal-error"></div>
</div>
</div>
</div>
</div>
</body>
</html>