Merge branch 'develop' into documentation

This commit is contained in:
bharnden 2019-07-02 08:42:01 -07:00 committed by GitHub
commit ec9fc37f8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 3167 additions and 3502 deletions

View file

@ -68,9 +68,7 @@ sudo ln -s /usr/local/share/emane /usr/share/emane
CORE supports custom developed EMANE models by way of dynamically loading user created python files that represent the model. Custom EMANE models should be placed within the path defined by **emane_models_dir** in the CORE configuration file. This path cannot end in **/emane**.
Here is an example model with documentation describing functionality:
[Example Model](examplemodel.html)
[Example Model](/daemon/examples/myemane/examplemodel.py)
## Single PC with EMANE

View file

@ -1,239 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>examplemodel.py</title>
<link rel="stylesheet" href="pycco.css">
</head>
<body>
<div id='container'>
<div id="background"></div>
<div class='section'>
<div class='docs'><h1>examplemodel.py</h1></div>
</div>
<div class='clearall'>
<div class='section' id='section-0'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-0'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">core.emane</span> <span class="kn">import</span> <span class="n">emanemanifest</span>
<span class="kn">from</span> <span class="nn">core.emane</span> <span class="kn">import</span> <span class="n">emanemodel</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-1'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-1'>#</a>
</div>
<h1>Custom EMANE Model</h1>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">class</span> <span class="nc">ExampleModel</span><span class="p">(</span><span class="n">emanemodel</span><span class="o">.</span><span class="n">EmaneModel</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-2'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-2'>#</a>
</div>
<h2>MAC Definition</h2>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-3'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-3'>#</a>
</div>
<p>Defines the emane model name that will show up in the GUI.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;emane_example&quot;</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-4'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-4'>#</a>
</div>
<p>Defines that mac library that the model will reference.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">mac_library</span> <span class="o">=</span> <span class="s2">&quot;rfpipemaclayer&quot;</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-5'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-5'>#</a>
</div>
<p>Defines the mac manifest file that will be parsed to obtain configuration options, that will be displayed
within the GUI.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">mac_xml</span> <span class="o">=</span> <span class="s2">&quot;/usr/share/emane/manifest/rfpipemaclayer.xml&quot;</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-6'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-6'>#</a>
</div>
<p>Allows you to override options that are maintained within the manifest file above.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">mac_defaults</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;pcrcurveuri&quot;</span><span class="p">:</span> <span class="s2">&quot;/usr/share/emane/xml/models/mac/rfpipe/rfpipepcr.xml&quot;</span><span class="p">,</span>
<span class="p">}</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-7'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-7'>#</a>
</div>
<p>Parses the manifest file and converts configurations into core supported formats.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">mac_config</span> <span class="o">=</span> <span class="n">emanemanifest</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">mac_xml</span><span class="p">,</span> <span class="n">mac_defaults</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-8'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-8'>#</a>
</div>
<h2>PHY Definition</h2>
<p><strong>NOTE: phy configuration will default to the universal model as seen below and the below section does not
have to be included.</strong></p>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-9'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-9'>#</a>
</div>
<p>Defines that phy library that the model will reference, used if you need to provide a custom phy.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">phy_library</span> <span class="o">=</span> <span class="bp">None</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-10'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-10'>#</a>
</div>
<p>Defines the phy manifest file that will be parsed to obtain configuration options, that will be displayed
within the GUI.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">phy_xml</span> <span class="o">=</span> <span class="s2">&quot;/usr/share/emane/manifest/emanephy.xml&quot;</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-11'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-11'>#</a>
</div>
<p>Allows you to override options that are maintained within the manifest file above or for the default universal
model.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">phy_defaults</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;subid&quot;</span><span class="p">:</span> <span class="s2">&quot;1&quot;</span><span class="p">,</span>
<span class="s2">&quot;propagationmodel&quot;</span><span class="p">:</span> <span class="s2">&quot;2ray&quot;</span><span class="p">,</span>
<span class="s2">&quot;noisemode&quot;</span><span class="p">:</span> <span class="s2">&quot;none&quot;</span>
<span class="p">}</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-12'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-12'>#</a>
</div>
<p>Parses the manifest file and converts configurations into core supported formats.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">phy_config</span> <span class="o">=</span> <span class="n">emanemanifest</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">phy_xml</span><span class="p">,</span> <span class="n">phy_defaults</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-13'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-13'>#</a>
</div>
<h2>Custom override options</h2>
<p><strong>NOTE: these options default to what's seen below and do not have to be included.</strong></p>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-14'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-14'>#</a>
</div>
<p>Allows you to ignore options within phy/mac, used typically if you needed to add a custom option for display
within the gui.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">config_ignore</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-15'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-15'>#</a>
</div>
<p>Allows you to override how options are displayed with the GUI, using the GUI format of
"name:1-2|othername:3-4". This will be parsed into tabs, split by "|" and account for items based on the indexed
numbers after ":" for including values in each tab.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">config_groups_override</span> <span class="o">=</span> <span class="bp">None</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-16'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-16'>#</a>
</div>
<p>Allows you to override the default config matrix list. This value by default is the mac_config + phy_config, in
that order.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">config_matrix_override</span> <span class="o">=</span> <span class="bp">None</span>
</pre></div>
</div>
</div>
<div class='clearall'></div>
</div>
</body>

View file

@ -1,344 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>sample.py</title>
<link rel="stylesheet" href="pycco.css">
</head>
<body>
<div id='container'>
<div id="background"></div>
<div class='section'>
<div class='docs'><h1>sample.py</h1></div>
</div>
<div class='clearall'>
<div class='section' id='section-0'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-0'>#</a>
</div>
<p>Sample user-defined service.</p>
</div>
<div class='code'>
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">core.service</span> <span class="kn">import</span> <span class="n">CoreService</span>
<span class="kn">from</span> <span class="nn">core.service</span> <span class="kn">import</span> <span class="n">ServiceMode</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-1'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-1'>#</a>
</div>
<h1>Custom CORE Service</h1>
</div>
<div class='code'>
<div class="highlight"><pre><span class="k">class</span> <span class="nc">MyService</span><span class="p">(</span><span class="n">CoreService</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-2'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-2'>#</a>
</div>
<h2>Service Attributes</h2>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-3'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-3'>#</a>
</div>
<p>Name used as a unique ID for this service and is required, no spaces.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;MyService&quot;</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-4'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-4'>#</a>
</div>
<p>Allows you to group services within the GUI under a common name.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">group</span> <span class="o">=</span> <span class="s2">&quot;Utility&quot;</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-5'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-5'>#</a>
</div>
<p>Executables this service depends on to function, if executable is not on the path, service will not be loaded.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">executables</span> <span class="o">=</span> <span class="p">()</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-6'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-6'>#</a>
</div>
<p>Services that this service depends on for startup, tuple of service names.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">dependencies</span> <span class="o">=</span> <span class="p">()</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-7'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-7'>#</a>
</div>
<p>Directories that this service will create within a node.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">dirs</span> <span class="o">=</span> <span class="p">()</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-8'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-8'>#</a>
</div>
<p>Files that this service will generate, without a full path this file goes in the node&rsquo;s directory.
e.g. /tmp/pycore.12345/n1.conf/myfile</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">configs</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;myservice1.sh&quot;</span><span class="p">,</span> <span class="s2">&quot;myservice2.sh&quot;</span><span class="p">)</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-9'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-9'>#</a>
</div>
<p>Commands used to start this service, any non-zero exit code will cause a failure.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">startup</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;sh </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">configs</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s2">&quot;sh </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">configs</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-10'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-10'>#</a>
</div>
<p>Commands used to validate that a service was started, any non-zero exit code will cause a failure.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">validate</span> <span class="o">=</span> <span class="p">()</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-11'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-11'>#</a>
</div>
<p>Validation mode, used to determine startup success.</p>
<ul>
<li>NON_BLOCKING - runs startup commands, and validates success with validation commands</li>
<li>BLOCKING - runs startup commands, and validates success with the startup commands themselves</li>
<li>TIMER - runs startup commands, and validates success by waiting for &ldquo;validation_timer&rdquo; alone</li>
</ul>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">validation_mode</span> <span class="o">=</span> <span class="n">ServiceMode</span><span class="o">.</span><span class="n">NON_BLOCKING</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-12'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-12'>#</a>
</div>
<p>Time in seconds for a service to wait for validation, before determining success in TIMER/NON_BLOCKING modes.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">validation_timer</span> <span class="o">=</span> <span class="mi">5</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-13'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-13'>#</a>
</div>
<p>Period in seconds to wait before retrying validation, only used in NON_BLOCKING mode.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">validation_period</span> <span class="o">=</span> <span class="mf">0.5</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-14'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-14'>#</a>
</div>
<p>Shutdown commands to stop this service.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">shutdown</span> <span class="o">=</span> <span class="p">()</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-15'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-15'>#</a>
</div>
<h2>On Load</h2>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">on_load</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-16'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-16'>#</a>
</div>
<p>Provides a way to run some arbitrary logic when the service is loaded, possibly to help facilitate
dynamic settings for the environment.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">pass</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-17'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-17'>#</a>
</div>
<h2>Get Configs</h2>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">get_configs</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">node</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-18'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-18'>#</a>
</div>
<p>Provides a way to dynamically generate the config files from the node a service will run.
Defaults to the class definition and can be left out entirely if not needed.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">configs</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-19'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-19'>#</a>
</div>
<h2>Generate Config</h2>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">generate_config</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">node</span><span class="p">,</span> <span class="n">filename</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-20'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-20'>#</a>
</div>
<p>Returns a string representation for a file, given the node the service is starting on the config filename
that this information will be used for. This must be defined, if &ldquo;configs&rdquo; are defined.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="n">cfg</span> <span class="o">=</span> <span class="s2">&quot;#!/bin/sh</span><span class="se">\n</span><span class="s2">&quot;</span>
<span class="k">if</span> <span class="n">filename</span> <span class="o">==</span> <span class="bp">cls</span><span class="o">.</span><span class="n">configs</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">cfg</span> <span class="o">+=</span> <span class="s2">&quot;# auto-generated by MyService (sample.py)</span><span class="se">\n</span><span class="s2">&quot;</span>
<span class="k">for</span> <span class="n">ifc</span> <span class="ow">in</span> <span class="n">node</span><span class="o">.</span><span class="n">netifs</span><span class="p">():</span>
<span class="n">cfg</span> <span class="o">+=</span> <span class="s1">&#39;echo &quot;Node </span><span class="si">%s</span><span class="s1"> has interface </span><span class="si">%s</span><span class="s1">&quot;</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">ifc</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">filename</span> <span class="o">==</span> <span class="bp">cls</span><span class="o">.</span><span class="n">configs</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
<span class="n">cfg</span> <span class="o">+=</span> <span class="s2">&quot;echo hello&quot;</span>
<span class="k">return</span> <span class="n">cfg</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-21'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-21'>#</a>
</div>
<h2>Get Startup</h2>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">get_startup</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">node</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-22'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-22'>#</a>
</div>
<p>Provides a way to dynamically generate the startup commands from the node a service will run.
Defaults to the class definition and can be left out entirely if not needed.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">startup</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-23'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-23'>#</a>
</div>
<h2>Get Validate</h2>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">get_validate</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">node</span><span class="p">):</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-24'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-24'>#</a>
</div>
<p>Provides a way to dynamically generate the validate commands from the node a service will run.
Defaults to the class definition and can be left out entirely if not needed.</p>
</div>
<div class='code'>
<div class="highlight"><pre> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">validate</span>
</pre></div>
</div>
</div>
<div class='clearall'></div>
</div>
</body>

9
docs/experimental.md Normal file
View file

@ -0,0 +1,9 @@
# Experimental Features
Below are current features that are considered experimental and will likely have issues.
# NS3
Experimental support for scripting CORE nodes with NS3.
[NS# Overview](ns3.md)

121
docs/grpc.md Normal file
View file

@ -0,0 +1,121 @@
# Using the gRPC API
By default the gRPC API is currently not turned on by default. There are a couple ways that this can be enabled
to use.
## Enabling gRPC
### HTTP Proxy
Since gRPC is HTTP2 based, proxy configurations can cause issue. Clear out your proxy when running if needed.
### Daemon Options
The gRPC API is enabled through options provided to the **core-daemon**.
```shell
usage: core-daemon [-h] [-f CONFIGFILE] [-p PORT] [-n NUMTHREADS] [--ovs]
[--grpc] [--grpc-port GRPCPORT]
[--grpc-address GRPCADDRESS]
CORE daemon v.5.3.0 instantiates Linux network namespace nodes.
optional arguments:
-h, --help show this help message and exit
-f CONFIGFILE, --configfile CONFIGFILE
read config from specified file; default =
/etc/core/core.conf
-p PORT, --port PORT port number to listen on; default = 4038
-n NUMTHREADS, --numthreads NUMTHREADS
number of server threads; default = 1
--ovs enable experimental ovs mode, default is false
--grpc enable grpc api, default is false
--grpc-port GRPCPORT grpc port to listen on; default 50051
--grpc-address GRPCADDRESS
grpc address to listen on; default localhost
```
### Enabling in Service Files
Modify service files to append the --grpc options as desired.
For sysv services /etc/init.d/core-daemon
```shell
CMD="PYTHONPATH=/usr/lib/python3.6/site-packages python3 /usr/bin/$NAME --grpc"
```
For systemd service /lib/systemd/system/core-daemon.service
```shell
ExecStart=@PYTHON@ @bindir@/core-daemon --grpc
```
### Enabling from Command Line
```shell
sudo core-daemon --grpc
```
## Python Client
A python client wrapper is provided at **core.api.grpc.client.CoreGrpcClient**.
Below is a small example using it.
```python
import logging
from builtins import range
from core.api.grpc import client, core_pb2
def log_event(event):
logging.info("event: %s", event)
def main():
core = client.CoreGrpcClient()
with core.context_connect():
# create session
response = core.create_session()
logging.info("created session: %s", response)
# handle events session may broadcast
session_id = response.session_id
core.events(session_id, log_event)
# change session state
response = core.set_session_state(session_id, core_pb2.SessionState.CONFIGURATION)
logging.info("set session state: %s", response)
# create switch node
switch = core_pb2.Node(type=core_pb2.NodeType.SWITCH)
response = core.add_node(session_id, switch)
logging.info("created switch: %s", response)
switch_id = response.node_id
# helper to create interfaces
interface_helper = client.InterfaceHelper(ip4_prefix="10.83.0.0/16")
for i in range(2):
# create node
position = core_pb2.Position(x=50 + 50 * i, y=50)
node = core_pb2.Node(position=position)
response = core.add_node(session_id, node)
logging.info("created node: %s", response)
node_id = response.node_id
# create link
interface_one = interface_helper.create_interface(node_id, 0)
response = core.add_link(session_id, node_id, switch_id, interface_one)
logging.info("created link: %s", response)
# change session state
response = core.set_session_state(session_id, core_pb2.SessionState.INSTANTIATION)
logging.info("set session state: %s", response)
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
main()
```

View file

@ -2,9 +2,13 @@
## Introduction
CORE (Common Open Research Emulator) is a tool for building virtual networks. As an emulator, CORE builds a representation of a real computer network that runs in real time, as opposed to simulation, where abstract models are used. The live-running emulation can be connected to physical networks and routers. It provides an environment for running real applications and protocols, taking advantage of virtualization provided by the Linux operating system.
CORE (Common Open Research Emulator) is a tool for building virtual networks. As an emulator, CORE builds a
representation of a real computer network that runs in real time, as opposed to simulation, where abstract models are
used. The live-running emulation can be connected to physical networks and routers. It provides an environment for
running real applications and protocols, taking advantage of virtualization provided by the Linux operating system.
CORE is typically used for network and protocol research, demonstrations, application and platform testing, evaluating networking scenarios, security studies, and increasing the size of physical test networks.
CORE is typically used for network and protocol research, demonstrations, application and platform testing, evaluating
networking scenarios, security studies, and increasing the size of physical test networks.
### Key Features
* Efficient and scalable
@ -14,22 +18,31 @@ CORE is typically used for network and protocol research, demonstrations, applic
## Topics
* [Architecture](architecture.md)
* [Installation](install.md)
* [Usage](usage.md)
* [Python Scripting](scripting.md)
* [Node Types](machine.md)
* [CTRLNET](ctrlnet.md)
* [Services](services.md)
* [EMANE](emane.md)
* [NS3](ns3.md)
* [Performance](performance.md)
* [Developers Guide](devguide.md)
| Topic | Description|
|-------|------------|
|[Architecture](architecture.md)|Overview of the architecture|
|[Installation](install.md)|Installing from source, packages, & other dependencies|
|[Using the GUI](usage.md)|Details on the different node types and options in the GUI|
|[Python Scripting](scripting.md)|How to write python scripts for creating a CORE session|
|[gRPC API](grpc.md)|How to enable and use the gRPC API|
|[Node Types](machine.md)|Overview of node types supported within CORE|
|[CTRLNET](ctrlnet.md)|How to use control networks to communicate with nodes from host|
|[Services](services.md)|Overview of provided services and creating custom ones|
|[EMANE](emane.md)|Overview of EMANE integration and integrating custom EMANE models|
|[Performance](performance.md)|Notes on performance when using CORE|
|[Developers Guide](devguide.md)|Overview of topics when developing CORE|
|[Experimental](experimental.md)|Experimental features for use with or within CORE|
## Credits
The CORE project was derived from the open source IMUNES project from the University of Zagreb in 2004. In 2006, changes for CORE were released back to that project, some items of which were adopted. Marko Zec <zec@fer.hr> is the primary developer from the University of Zagreb responsible for the IMUNES (GUI) and VirtNet (kernel) projects. Ana Kukec and Miljenko Mikuc are known contributors.
The CORE project was derived from the open source IMUNES project from the University of Zagreb in 2004. In 2006,
changes for CORE were released back to that project, some items of which were adopted. Marko Zec <zec@fer.hr> is the
primary developer from the University of Zagreb responsible for the IMUNES (GUI) and VirtNet (kernel) projects. Ana
Kukec and Miljenko Mikuc are known contributors.
Jeff Ahrenholz has been the primary Boeing developer of CORE, and has written this manual. Tom Goff designed the Python framework and has made significant contributions. Claudiu Danilov, Rod Santiago, Kevin Larson, Gary Pei, Phil Spagnolo, and Ian Chakeres have contributed code to CORE. Dan Mackley helped develop the CORE API, originally to interface with a simulator. Jae Kim and Tom Henderson have supervised the project and provided direction.
Jeff Ahrenholz has been the primary Boeing developer of CORE, and has written this manual. Tom Goff designed the
Python framework and has made significant contributions. Claudiu Danilov, Rod Santiago, Kevin Larson, Gary Pei,
Phil Spagnolo, and Ian Chakeres have contributed code to CORE. Dan Mackley helped develop the CORE API, originally to
interface with a simulator. Jae Kim and Tom Henderson have supervised the project and provided direction.
Copyright (c) 2005-2018, the Boeing Company.

View file

@ -1,4 +1,3 @@
# CORE Installation
* Table of Contents
@ -6,78 +5,129 @@
# Overview
This section will describe how to set up a CORE machine. Note that the easiest way to install CORE is using a binary package on Ubuntu or Fedora/CentOS (deb or rpm) using the distribution's package manager to automatically install dependencies.
This section will describe how to install CORE from source or from a pre-built package.
Ubuntu and Fedora/CentOS Linux are the recommended distributions for running CORE. However, these distributions are not strictly required. CORE will likely work on other flavors of Linux as well.
# Required Hardware
The primary dependencies are Tcl/Tk (8.5 or newer) for the GUI, and Python 2.7 for the CORE daemon.
Any computer capable of running Linux should be able to run CORE. Since the physical machine will be hosting numerous
virtual machines, as a general rule you should select a machine having as much RAM and CPU resources as possible.
CORE files are installed to the following directories, when the installation prefix is */usr*.
# Operating System
CORE requires a Linux operating system because it uses virtualization provided by the kernel. It does not run on
Windows or Mac OS X operating systems (unless it is running within a virtual machine guest.) The virtualization
technology that CORE currently uses is Linux network namespaces.
Ubuntu and Fedora/CentOS Linux are the recommended distributions for running CORE. However, these distributions are
not strictly required. CORE will likely work on other flavors of Linux as well, assuming dependencies are met.
**NOTE: CORE Services determine what run on each node. You may require other software packages depending on the
services you wish to use. For example, the HTTP service will require the apache2 package.**
# Installed Files
CORE files are installed to the following directories, when the installation prefix is **/usr**.
Install Path | Description
-------------|------------
/usr/bin/core-gui|GUI startup command
/usr/bin/core-daemon|Daemon startup command
/usr/bin/|Misc. helper commands/scripts
/usr/bin/{core-cleanup, coresendmsg, core-manage}|Misc. helper commands/scripts
/usr/lib/core|GUI files
/usr/lib/python2.7/dist-packages/core|Python modules for daemon/scripts
/etc/core/|Daemon configuration files
/usr/lib/python{2.7,3}/dist-packages/core|Python modules for daemon/scripts
/etc/core/|Daemon and log configuration files
~/.core/|User-specific GUI preferences and scenario files
/usr/share/core/|Example scripts and scenarios
/usr/share/man/man1/|Command man pages
/etc/init.d/core-daemon|SysV startup script for daemon
/etc/systemd/system/core-daemon.service|Systemd startup script for daemon
## Prerequisites
# Pre-Req Python Requirements
A Linux operating system is required. The GUI uses the Tcl/Tk scripting toolkit, and the CORE daemon requires Python. Details of the individual software packages required can be found in the installation steps.
## Ubuntu 19.04
## Required Hardware
Ubuntu 19.04 can provide all the packages needed at the system level and can be installed as follows:
Any computer capable of running Linux should be able to run CORE. Since the physical machine will be hosting numerous virtual machines, as a general rule you should select a machine having as much RAM and CPU resources as possible.
```shell
# python 2
sudo apt install python-configparser python-enum34 python-future python-grpcio python-lxml
# python 3
sudo apt install python3-configparser python3-enum34 python3-future python3-grpcio python3-lxml
```
## Required Software
## Other Distros
CORE requires a Linux operating system because it uses virtualization provided by the kernel. It does not run on Windows or Mac OS X operating systems (unless it is running within a virtual machine guest.) The virtualization technology that CORE currently uses is Linux network namespaces.
The newly added gRPC API which depends on python library grpcio is not commonly found within system repos.
To account for this it would be recommended to install the python dependencies using the **requirements.txt** found in
the latest release.
The CORE GUI requires the X.Org X Window system (X11), or can run over a remote X11 session. For specific Tcl/Tk, Python, and other libraries required to run CORE.
```shell
# will need to pip3 for python3 usage
sudo pip install -r requirements.txt
```
**NOTE: CORE *Services* determine what run on each node. You may require other software packages depending on the services you wish to use. For example, the *HTTP* service will require the *apache2* package.**
# Pre-Req Installing OSPF MDR
## Installing from Packages
Virtual networks generally require some form of routing in order to work (e.g. to automatically populate routing
tables for routing packets from one subnet to another.) CORE builds OSPF routing protocol configurations by
default when the blue router node type is used.
The easiest way to install CORE is using the pre-built packages. The package managers on Ubuntu or Fedora/CentOS will automatically install dependencies for you. You can obtain the CORE packages from [CORE GitHub](https://github.com/coreemu/core/releases).
* [OSPF MANET Designated Routers](http://www.nrl.navy.mil/itd/ncs/products/ospf-manet) (MDR) - the Quagga routing
suite with a modified version of OSPFv3, optimized for use with mobile wireless networks. The **mdr** node type
(and the MDR service) requires this variant of Quagga.
### Installing from Packages on Ubuntu
## Ubuntu <= 16.04 and Fedora/CentOS
Install Quagga for routing. If you plan on working with wireless networks, we recommend installing [OSPF MDR](http://www.nrl.navy.mil/itd/ncs/products/ospf-manet) (replace *amd64* below with *i386* if needed to match your architecture):
There is a built package which can be used.
```shell
wget https://downloads.pf.itd.nrl.navy.mil/ospf-manet/quagga-0.99.21mr2.2/quagga-mr_0.99.21mr2.2_amd64.deb
sudo dpkg -i quagga-mr_0.99.21mr2.2_amd64.deb
```
Or, for the regular Ubuntu version of Quagga:
## Ubuntu >= 18.04
Requires building from source, from the latest nightly snapshot.
```shell
sudo apt-get install quagga
wget https://downloads.pf.itd.nrl.navy.mil/ospf-manet/nightly_snapshots/quagga-svnsnap.tgz
tar xzf quagga-svnsnap.tgz
cd quagga
./configure --enable-user=root --enable-group=root --with-cflags=-ggdb \
--sysconfdir=/usr/local/etc/quagga --enable-vtysh \
--localstatedir=/var/run/quagga
make
sudo make install
```
Install the CORE deb packages for Ubuntu from command line.
Note that the configuration directory */usr/local/etc/quagga* shown for Quagga above could be */etc/quagga*,
if you create a symbolic link from */etc/quagga/Quagga.conf -> /usr/local/etc/quagga/Quagga.conf* on the host.
The *quaggaboot.sh* script in a Linux network namespace will try and do this for you if needed.
If you try to run quagga after installing from source and get an error such as:
```shell
sudo dpkg -i python-core_*.deb
sudo dpkg -i core-gui_*.deb
error while loading shared libraries libzebra.so.0
```
Start the CORE daemon as root, the systemd installation will auto start the daemon, but you can use the commands below if need be.
this is usually a sign that you have to run ```sudo ldconfig```` to refresh the cache file.
# Installing from Packages
The easiest way to install CORE is using the pre-built packages. The package managers on Ubuntu or Fedora/CentOS
will help in automatically installing most dependencies for you.
You can obtain the CORE packages from [CORE Releases](https://github.com/coreemu/core/releases).
## Ubuntu
Ubuntu package defaults to using systemd for running as a service.
```shell
# systemd
sudo systemctl start core-daemon
# sysv
sudo service core-daemon start
# python2
sudo apt install ./core_python_$VERSION_amd64.deb
# python3
sudo apt install ./core_python3_$VERSION_amd64.deb
```
Run the CORE GUI as a normal user:
@ -86,48 +136,35 @@ Run the CORE GUI as a normal user:
core-gui
```
After running the *core-gui* command, a GUI should appear with a canvas for drawing topologies. Messages will print out on the console about connecting to the CORE daemon.
After running the *core-gui* command, a GUI should appear with a canvas for drawing topologies.
Messages will print out on the console about connecting to the CORE daemon.
### Installing from Packages on Fedora/CentOS
## Fedora/CentOS
The commands shown here should be run as root. The *x86_64* architecture is shown in the examples below, replace with *i686* is using a 32-bit architecture.
**CentOS 7 Only: in order to install *tkimg* package you must build from source.**
Make sure the system is up to date.
**NOTE: tkimg is not required for the core-gui, but if you get an error message about it you can install the package
on CentOS <= 6, or build from source otherwise**
```shell
yum update
# python2
yum install ./core_python_$VERSION_x86_64.rpm
# python3
yum install ./core_python3_$VERSION_x86_64.rpm
```
**Optional (Fedora 17+): Fedora 17 and newer have an additional prerequisite providing the required netem kernel modules (otherwise skip this step and have the package manager install it for you.)**
Disabling SELINUX:
```shell
yum install kernel-modules-extra
# change the following in /etc/sysconfig/selinux
SELINUX=disabled
# add the following to the kernel line in /etc/grub.conf
selinux=0
# Fedora 15 and newer, disable sandboxd
# reboot in order for this change to take effect
chkconfig sandbox off
```
Install Quagga for routing. If you plan on working with wireless networks, we recommend installing [OSPF MDR](http://www.nrl.navy.mil/itd/ncs/products/ospf-manet):
```shell
wget https://downloads.pf.itd.nrl.navy.mil/ospf-manet/quagga-0.99.21mr2.2/quagga-0.99.21mr2.2-1.el6.x86_64.rpm
sudo yum install quagga-0.99.21mr2.2-1.el6.x86_64.rpm
```
Or, for the regular Fedora/CentOS version of Quagga:
```shell
yum install quagga
```
Install the CORE RPM packages and automatically resolve dependencies:
```shell
yum install python-core_*.rpm
yum install core-gui_*.rpm
```
Turn off SELINUX by setting *SELINUX=disabled* in the */etc/sysconfig/selinux* file, and adding *selinux=0* to the kernel line in your */etc/grub.conf* file; on Fedora 15 and newer, disable sandboxd using ```chkconfig sandbox off```; you need to reboot in order for this change to take effect
Turn off firewalls:
```shell
@ -145,7 +182,7 @@ iptables -F
ip6tables -F
```
Start the CORE daemon as root.
Start the CORE daemon.
```shell
# systemd
@ -164,159 +201,88 @@ core-gui
After running the *core-gui* command, a GUI should appear with a canvas for drawing topologies. Messages will print out on the console about connecting to the CORE daemon.
### Installing from Source
# Building and Installing from Source
This option is listed here for developers and advanced users who are comfortable patching and building source code. Please consider using the binary packages instead for a simplified install experience.
This option is listed here for developers and advanced users who are comfortable patching and building source code.
Please consider using the binary packages instead for a simplified install experience.
To build CORE from source on Ubuntu, first install these development packages. These packages are not required for normal binary package installs.
## Download and Extract Source Code
You can obtain the CORE source from the [CORE GitHub](https://github.com/coreemu/core) page. Choose either a stable release version or the development snapshot available in the *nightly_snapshots* directory.
You can obtain the CORE source from the [CORE GitHub](https://github.com/coreemu/core) page.
#### Install Requirements
## Install grpcio-tools
##### Ubuntu 18.04 Requirements
Python module grpcio-tools is currently needed to generate code from the CORE protobuf file during the build.
```shell
sudo apt install automake pkg-config gcc libev-dev bridge-utils ebtables python-dev python-sphinx python-setuptools python-lxml python-enum34 tk libtk-img
# python2
pip2 install grpcio-tools
# python3
pip3 install grpcio-tools
```
##### Ubuntu 16.04 Requirements
## Distro Requirements
### Ubuntu 18.04 Requirements
```shell
sudo apt-get install automake bridge-utils ebtables python-dev libev-dev python-sphinx python-setuptools python-enum34 python-lxml libtk-img
sudo apt install automake pkg-config gcc libev-dev bridge-utils ebtables python-dev python-setuptools tk libtk-img
```
##### CentOS 7 with Gnome Desktop Requirements
### Ubuntu 16.04 Requirements
```shell
sudo yum -y install automake gcc python-devel libev-devel python-sphinx tk python-lxml python-enum34
sudo apt-get install automake bridge-utils ebtables python-dev libev-dev python-setuptools libtk-img
```
#### Download and Extract Source Code
### CentOS 7 with Gnome Desktop Requirements
##### Download
You can obtain the CORE source code from the [CORE GitHub](https://github.com/coreemu/core) page.
##### Extract
```shell
tar xzf core-*.tar.gz
cd core-*
sudo yum -y install automake gcc python-devel libev-devel tk
```
#### Traditional Autotools Build
## Build and Install
```shell
./bootstrap.sh
./configure
# use python2 or python3 depending on desired version
PYTHON=$VERSION ./configure
make
sudo make install
```
#### Build Documentation
# Building Documentation
Building documentation requires python-sphinx not noted above.
```shell
# install python2 sphinx
sudo apt install python-sphinx
sudo yum install python-sphinx
# install python3 sphinx
sudo apt install python3-sphinx
sudo yum install python3-sphinx
./bootstrap.sh
./configure
# use python2 or python3 depending on desired version
PYTHON=$VERSION ./configure
make doc
```
#### Build Packages
Install fpm: http://fpm.readthedocs.io/en/latest/installing.html
Build package commands, DESTDIR is used for gui packaging only
# Building Packages
Build package commands, DESTDIR is used to make install into and then for packaging by fpm.
**NOTE: clean the DESTDIR if re-using the same directory**
* Install [fpm](http://fpm.readthedocs.io/en/latest/installing.html)
```shell
./bootstrap.sh
./configure
# use python2 or python3 depending on desired version
PYTHON=$VERSION ./configure
make
mkdir /tmp/core-gui
make fpm DESTDIR=/tmp/core-gui
```
This will produce:
* CORE GUI rpm/deb files
* core-gui_$VERSION_$ARCH
* CORE ns3 rpm/deb files
* python-core-ns3_$VERSION_$ARCH
* CORE python rpm/deb files for SysV and systemd service types
* python-core-sysv_$VERSION_$ARCH
* python-core-systemd_$VERSION_$ARCH
### Quagga Routing Software
Virtual networks generally require some form of routing in order to work (e.g. to automatically populate routing tables for routing packets from one subnet to another.) CORE builds OSPF routing protocol configurations by default when the blue router node type is used. The OSPF protocol is available from the [Quagga open source routing suit](http://www.quagga.net).
Quagga is not specified as a dependency for the CORE packages because there are two different Quagga packages that you may use:
* [Quagga](http://www.quagga.net) - the standard version of Quagga, suitable for static wired networks, and usually available via your distribution's package manager.
* [OSPF MANET Designated Routers](http://www.nrl.navy.mil/itd/ncs/products/ospf-manet) (MDR) - the Quagga routing suite with a modified version of OSPFv3, optimized for use with mobile wireless networks. The *mdr* node type (and the MDR service) requires this variant of Quagga.
If you plan on working with wireless networks, we recommend installing OSPF MDR; otherwise install the standard version of Quagga using your package manager or from source.
#### Installing Quagga from Packages
To install the standard version of Quagga from packages, use your package manager (Linux).
Ubuntu users:
```shell
sudo apt-get install quagga
mkdir /tmp/core-build
make fpm DESTDIR=/tmp/core-build
```
Fedora/CentOS users:
```shell
sudo yum install quagga
```
To install the Quagga variant having OSPFv3 MDR, first download the appropriate package, and install using the package manager.
Ubuntu users:
```shell
wget https://downloads.pf.itd.nrl.navy.mil/ospf-manet/quagga-0.99.21mr2.2/quagga-mr_0.99.21mr2.2_amd64.deb
sudo dpkg -i quagga-mr_0.99.21mr2.2_amd64.deb
```
Replace *amd64* with *i686* if using a 32-bit architecture.
Fedora/CentOS users:
```shell
wget https://downloads.pf.itd.nrl.navy.mil/ospf-manet/quagga-0.99.21mr2.2/quagga-0.99.21mr2.2-1.el6.x86_64.rpm
sudo yum install quagga-0.99.21mr2.2-1.el6.x86_64.rpm
````
Replace *x86_64* with *i686* if using a 32-bit architecture.
#### Compiling Quagga for CORE
To compile Quagga to work with CORE on Linux:
```shell
wget https://downloads.pf.itd.nrl.navy.mil/ospf-manet/quagga-0.99.21mr2.2/quagga-0.99.21mr2.2.tar.gz
tar xzf quagga-0.99.21mr2.2.tar.gz
cd quagga-0.99
./configure --enable-user=root --enable-group=root --with-cflags=-ggdb \\
--sysconfdir=/usr/local/etc/quagga --enable-vtysh \\
--localstatedir=/var/run/quagga
make
sudo make install
```
Note that the configuration directory */usr/local/etc/quagga* shown for Quagga above could be */etc/quagga*, if you create a symbolic link from */etc/quagga/Quagga.conf -> /usr/local/etc/quagga/Quagga.conf* on the host. The *quaggaboot.sh* script in a Linux network namespace will try and do this for you if needed.
If you try to run quagga after installing from source and get an error such as:
```shell
error while loading shared libraries libzebra.so.0
```
this is usually a sign that you have to run ```sudo ldconfig```` to refresh the cache file.
### VCORE
CORE is capable of running inside of a virtual machine, using software such as VirtualBox, VMware Server or QEMU. However, CORE itself is performing machine virtualization in order to realize multiple emulated nodes, and running CORE virtually adds additional contention for the physical resources. **For performance reasons, this is not recommended.** Timing inside of a VM often has problems. If you do run CORE from within a VM, it is recommended that you view the GUI with remote X11 over SSH, so the virtual machine does not need to emulate the video card with the X11 application.
A CORE virtual machine is provided for download, named VCORE. This is the perhaps the easiest way to get CORE up and running as the machine is already set up for you. This may be adequate for initially evaluating the tool but keep in mind the performance limitations of running within VirtualBox or VMware. To install the virtual machine, you first need to obtain VirtualBox from http://www.virtualbox.org, or VMware Server or Player from http://www.vmware.com (this commercial software is distributed for free.) Once virtualization software has been installed, you can import the virtual machine appliance using the *vbox* file for VirtualBox or the *vmx* file for VMware. See the documentation that comes with VCORE for login information.
This will produce and RPM and Deb package for the currently configured python version.

View file

@ -1,190 +0,0 @@
/*--------------------- Layout and Typography ----------------------------*/
body {
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
font-size: 16px;
line-height: 24px;
color: #252519;
margin: 0; padding: 0;
background: #f5f5ff;
}
a {
color: #261a3b;
}
a:visited {
color: #261a3b;
}
p {
margin: 0 0 15px 0;
}
h1, h2, h3, h4, h5, h6 {
margin: 40px 0 15px 0;
}
h2, h3, h4, h5, h6 {
margin-top: 0;
}
#container {
background: white;
}
#container, div.section {
position: relative;
}
#background {
position: absolute;
top: 0; left: 580px; right: 0; bottom: 0;
background: #f5f5ff;
border-left: 1px solid #e5e5ee;
z-index: 0;
}
#jump_to, #jump_page {
background: white;
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
font: 10px Arial;
text-transform: uppercase;
cursor: pointer;
text-align: right;
}
#jump_to, #jump_wrapper {
position: fixed;
right: 0; top: 0;
padding: 5px 10px;
}
#jump_wrapper {
padding: 0;
display: none;
}
#jump_to:hover #jump_wrapper {
display: block;
}
#jump_page {
padding: 5px 0 3px;
margin: 0 0 25px 25px;
}
#jump_page .source {
display: block;
padding: 5px 10px;
text-decoration: none;
border-top: 1px solid #eee;
}
#jump_page .source:hover {
background: #f5f5ff;
}
#jump_page .source:first-child {
}
div.docs {
float: left;
max-width: 500px;
min-width: 500px;
min-height: 5px;
padding: 10px 25px 1px 50px;
vertical-align: top;
text-align: left;
}
.docs pre {
margin: 15px 0 15px;
padding-left: 15px;
}
.docs p tt, .docs p code {
background: #f8f8ff;
border: 1px solid #dedede;
font-size: 12px;
padding: 0 0.2em;
}
.octowrap {
position: relative;
}
.octothorpe {
font: 12px Arial;
text-decoration: none;
color: #454545;
position: absolute;
top: 3px; left: -20px;
padding: 1px 2px;
opacity: 0;
-webkit-transition: opacity 0.2s linear;
}
div.docs:hover .octothorpe {
opacity: 1;
}
div.code {
margin-left: 580px;
padding: 14px 15px 16px 50px;
vertical-align: top;
}
.code pre, .docs p code {
font-size: 12px;
}
pre, tt, code {
line-height: 18px;
font-family: Monaco, Consolas, "Lucida Console", monospace;
margin: 0; padding: 0;
}
div.clearall {
clear: both;
}
/*---------------------- Syntax Highlighting -----------------------------*/
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
body .hll { background-color: #ffffcc }
body .c { color: #408080; font-style: italic } /* Comment */
body .err { border: 1px solid #FF0000 } /* Error */
body .k { color: #954121 } /* Keyword */
body .o { color: #666666 } /* Operator */
body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
body .cp { color: #BC7A00 } /* Comment.Preproc */
body .c1 { color: #408080; font-style: italic } /* Comment.Single */
body .cs { color: #408080; font-style: italic } /* Comment.Special */
body .gd { color: #A00000 } /* Generic.Deleted */
body .ge { font-style: italic } /* Generic.Emph */
body .gr { color: #FF0000 } /* Generic.Error */
body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
body .gi { color: #00A000 } /* Generic.Inserted */
body .go { color: #808080 } /* Generic.Output */
body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
body .gs { font-weight: bold } /* Generic.Strong */
body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
body .gt { color: #0040D0 } /* Generic.Traceback */
body .kc { color: #954121 } /* Keyword.Constant */
body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
body .kp { color: #954121 } /* Keyword.Pseudo */
body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
body .kt { color: #B00040 } /* Keyword.Type */
body .m { color: #666666 } /* Literal.Number */
body .s { color: #219161 } /* Literal.String */
body .na { color: #7D9029 } /* Name.Attribute */
body .nb { color: #954121 } /* Name.Builtin */
body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
body .no { color: #880000 } /* Name.Constant */
body .nd { color: #AA22FF } /* Name.Decorator */
body .ni { color: #999999; font-weight: bold } /* Name.Entity */
body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
body .nf { color: #0000FF } /* Name.Function */
body .nl { color: #A0A000 } /* Name.Label */
body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
body .nt { color: #954121; font-weight: bold } /* Name.Tag */
body .nv { color: #19469D } /* Name.Variable */
body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
body .w { color: #bbbbbb } /* Text.Whitespace */
body .mf { color: #666666 } /* Literal.Number.Float */
body .mh { color: #666666 } /* Literal.Number.Hex */
body .mi { color: #666666 } /* Literal.Number.Integer */
body .mo { color: #666666 } /* Literal.Number.Oct */
body .sb { color: #219161 } /* Literal.String.Backtick */
body .sc { color: #219161 } /* Literal.String.Char */
body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
body .s2 { color: #219161 } /* Literal.String.Double */
body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
body .sh { color: #219161 } /* Literal.String.Heredoc */
body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
body .sx { color: #954121 } /* Literal.String.Other */
body .sr { color: #BB6688 } /* Literal.String.Regex */
body .s1 { color: #219161 } /* Literal.String.Single */
body .ss { color: #19469D } /* Literal.String.Symbol */
body .bp { color: #954121 } /* Name.Builtin.Pseudo */
body .vc { color: #19469D } /* Name.Variable.Class */
body .vg { color: #19469D } /* Name.Variable.Global */
body .vi { color: #19469D } /* Name.Variable.Instance */
body .il { color: #666666 } /* Literal.Number.Integer.Long */

View file

@ -17,8 +17,8 @@ Here are the basic elements of a CORE Python script:
```python
from core.emulator.coreemu import CoreEmu
from core.emulator.emudata import IpPrefixes
from core.enumerations import EventTypes
from core.enumerations import NodeTypes
from core.emulator.enumerations import EventTypes
from core.emulator.enumerations import NodeTypes
# ip generator for example
prefixes = IpPrefixes(ip4_prefix="10.83.0.0/16")
@ -34,7 +34,7 @@ session.set_state(EventTypes.CONFIGURATION_STATE)
switch = session.add_node(_type=NodeTypes.SWITCH)
# create nodes
for _ in xrange(options.nodes):
for _ in range(2):
node = session.add_node()
interface = prefixes.create_interface(node)
session.add_link(node.id, switch.id, interface_one=interface)

View file

@ -20,7 +20,7 @@ shutdown commands, and meta-data associated with a node.
using the **init**, **upstart**, or **systemd** frameworks. These
lightweight nodes use configured CORE *services*.
### Default Services and Node Types
## Default Services and Node Types
Here are the default node types and their services:
@ -61,7 +61,7 @@ recommended that you do not change the default built-in node types. The
**nodes.conf** file can be copied between CORE machines to save your custom
types.
### Customizing a Service
## Customizing a Service
A service can be fully customized for a particular node. From the node's
configuration dialog, click on the button next to the service name to invoke
@ -124,51 +124,65 @@ an error to be displayed in the Check Emulation Light.
To start, stop, and restart services during run-time, right-click a
node and use the *Services...* menu.
### Creating new Services
## New Services
Services can save time required to configure nodes, especially if a number
of nodes require similar configuration procedures. New services can be
introduced to automate tasks.
### Leveraging UserDefined
The easiest way to capture the configuration of a new process into a service
is by using the **UserDefined** service. This is a blank service where any
aspect may be customized. The UserDefined service is convenient for testing
ideas for a service before adding a new service type.
To introduce new service types, a **myservices/** directory exists in the
user's CORE configuration directory, at **~/.core/myservices/**. A detailed
**README.txt** file exists in that directory to outline the steps necessary
for adding a new service. First, you need to create a small Python file that
defines the service; then the **custom_services_dir** entry must be set
in the **/etc/core/core.conf** configuration file. A sample is provided in
the **myservices/** directory.
### Creating New Service
**NOTE:**
1. Modify the [Example Service File](/daemon/examples/myservices/sample.py)
to do what you want. It could generate config/script files, mount per-node
directories, start processes/scripts, etc. sample.py is a Python file that
defines one or more classes to be imported. You can create multiple Python
files that will be imported. Add any new filenames to the __init__.py file.
2. Put these files in a directory such as /home/username/.core/myservices
Note that the last component of this directory name **myservices** should not
be named something like **services** which conflicts with an existing Python
name (the syntax 'from myservices import *' is used).
3. Add a **custom_services_dir = /home/username/.core/myservices** entry to the
/etc/core/core.conf file.
**NOTE:**
The directory name used in **custom_services_dir** should be unique and
should not correspond to
any existing Python module name. For example, don't use the name **subprocess**
or **services**.
4. Restart the CORE daemon (core-daemon). Any import errors (Python syntax)
should be displayed in the /var/log/core-daemon.log log file (or on screen).
5. Start using your custom service on your nodes. You can create a new node
type that uses your service, or change the default services for an existing
node type, or change individual nodes.
If you have created a new service type that may be useful to others, please
consider contributing it to the CORE project.
Here is an example service with documentation describing functionality:
[Example Service](exampleservice.html)
## Available Services
### Available Services
#### BIRD Internet Routing Daemon
### BIRD Internet Routing Daemon
The [BIRD Internet Routing Daemon](https://bird.network.cz/) is a routing daemon; i.e., a software responsible for managing kernel packet forwarding tables. It aims to develop a dynamic IP routing daemon with full support of all modern routing protocols, easy to use configuration interface and powerful route filtering language, primarily targeted on (but not limited to) Linux and other UNIX-like systems and distributed under the GNU General Public License. BIRD has a free implementation of several well known and common routing and router-supplemental protocols, namely RIP, RIPng, OSPFv2, OSPFv3, BGP, BFD, and NDP/RA. BIRD supports IPv4 and IPv6 address families, Linux kernel and several BSD variants (tested on FreeBSD, NetBSD and OpenBSD). BIRD consists of bird daemon and birdc interactive CLI client used for supervision.
In order to be able to use the BIRD Internet Routing Protocol, you must first install the project on your machine.
##### BIRD Package Install
#### BIRD Package Install
```shell
sudo apt-get install bird
```
##### BIRD Source Code Install
#### BIRD Source Code Install
You can download BIRD source code from it's [official repository.](https://gitlab.labs.nic.cz/labs/bird/)
```shell
./configure
@ -182,7 +196,7 @@ The installation will place the bird directory inside */etc* where you will also
In order to be able to do use the Bird Internet Routing Protocol, you must modify *bird.conf* due to the fact that the given configuration file is not configured beyond allowing the bird daemon to start, which means that nothing else will happen if you run it. Keeran Marquis has a very detailed example on [Configuring BGP using Bird on Ubuntu](https://blog.marquis.co/configuring-bgp-using-bird-on-ubuntu-14-04lts/) which can be used as a building block to implement your custom routing daemon.
#### FRRouting
### FRRouting
FRRouting is a routing software package that provides TCP/IP based routing services with routing protocols support such as BGP, RIP, OSPF, IS-IS and more. FRR also supports special BGP Route Reflector and Route Server behavior. In addition to traditional IPv4 routing protocols, FRR also supports IPv6 routing protocols. With an SNMP daemon that supports the AgentX protocol, FRR provides routing protocol MIB read-only access (SNMP Support).
FRR currently supports the following protocols:
@ -202,7 +216,7 @@ FRR currently supports the following protocols:
* EIGRP (alpha)
* NHRP (alpha)
##### FRRouting Package Install
#### FRRouting Package Install
```shell
sudo apt install curl
curl -s https://deb.frrouting.org/frr/keys.asc | sudo apt-key add -
@ -211,7 +225,7 @@ echo deb https://deb.frrouting.org/frr $(lsb_release -s -c) $FRRVER | sudo tee -
sudo apt update && sudo apt install frr frr-pythontools
```
##### FRRouting Source Code Install
#### FRRouting Source Code Install
Building FRR from source is the best way to ensure you have the latest features and bug fixes. Details for each supported platform, including dependency package listings, permissions, and other gotchas, are in the developers documentation.
FRRs source is available on the project [GitHub page](https://github.com/FRRouting/frr).
@ -242,7 +256,7 @@ make && sudo make install
If everything finishes successfully, FRR should be installed.
#### Docker
### Docker
Docker service allows running docker containers within CORE nodes.
The running of Docker within a CORE node allows for additional extensibility to
the CORE services. This allows network applications and protocols to be easily
@ -252,7 +266,7 @@ This service will add a new group to the services list. This will have a service
This requires a recent version of Docker. This was tested using a PPA on Ubuntu with version 1.2.0. The version in the standard Ubuntu repo is to old for this purpose (we need --net host).
##### Docker Installation
#### Docker Installation
To use Docker services, you must first install the Docker python image. This is used to interface with Docker from the python service.
```shell
@ -279,8 +293,7 @@ This image will be listed in the services after we restart the core-daemon:
sudo service core-daemon restart
```
#### NRL Services
### NRL Services
The Protean Protocol Prototyping Library (ProtoLib) is a cross-platform library that allows applications to be built while supporting a variety of platforms including Linux, Windows, WinCE/PocketPC, MacOS, FreeBSD, Solaris, etc as well as the simulation environments of NS2 and Opnet. The goal of the Protolib is to provide a set of simple, cross-platform C++ classes that allow development of network protocols and applications that can run on different platforms and in network simulation environments. While Protolib provides an overall framework for developing working protocol implementations, applications, and simulation modules, the individual classes are designed for use as stand-alone components when possible. Although Protolib is principally for research purposes, the code has been constructed to provide robust, efficient performance and adaptability to real applications. In some cases, the code consists of data structures, etc useful in protocol implementations and, in other cases, provides common, cross-platform interfaces to system services and functions (e.g., sockets, timers, routing tables, etc).
Currently the Naval Research Laboratory uses this library to develop a wide variety of protocols.The NRL Protolib currently supports the following protocols:
@ -296,14 +309,14 @@ Currently the Naval Research Laboratory uses this library to develop a wide vari
#### NRL Installation
In order to be able to use the different protocols that NRL offers, you must first download the support library itself. You can get the source code from their [official nightly snapshots website](https://downloads.pf.itd.nrl.navy.mil/protolib/nightly_snapshots/).
##### Multi-Generator (MGEN)
#### Multi-Generator (MGEN)
Download MGEN from the [NRL MGEN nightly snapshots](https://downloads.pf.itd.nrl.navy.mil/mgen/nightly_snapshots/), unpack it and copy the protolib library into the main folder *mgen*. Execute the following commands to build the protocol.
```shell
cd mgen/makefiles
make -f Makefile.{os} mgen
```
##### Neighborhood Discovery Protocol (NHDP)
#### Neighborhood Discovery Protocol (NHDP)
Download NHDP from the [NRL NHDP nightly snapshots](https://downloads.pf.itd.nrl.navy.mil/nhdp/nightly_snapshots/).
```shell
sudo apt-get install libpcap-dev libboost-all-dev
@ -320,31 +333,30 @@ cd nhdp/unix
make -f Makefile.{os}
```
##### Simplified Multicast Forwarding (SMF)
#### Simplified Multicast Forwarding (SMF)
Download SMF from the [NRL SMF nightly snapshot](https://downloads.pf.itd.nrl.navy.mil/smf/nightly_snapshots/) , unpack it and place the protolib library inside the *smf* main folder.
```shell
cd mgen/makefiles
make -f Makefile.{os}
```
##### Optimized Link State Routing Protocol (OLSR)
#### Optimized Link State Routing Protocol (OLSR)
To install the OLSR protocol, download their source code from their [nightly snapshots](https://downloads.pf.itd.nrl.navy.mil/olsr/nightly_snapshots/nrlolsr-svnsnap.tgz). Unpack it and place the previously downloaded protolib library inside the *nrlolsr* main directory. Then execute the following commands:
```shell
cd ./unix
make -f Makefile.{os}
```
#### Quagga Routing Suite
### Quagga Routing Suite
Quagga is a routing software suite, providing implementations of OSPFv2, OSPFv3, RIP v1 and v2, RIPng and BGP-4 for Unix platforms, particularly FreeBSD, Linux, Solaris and NetBSD. Quagga is a fork of GNU Zebra which was developed by Kunihiro Ishiguro.
The Quagga architecture consists of a core daemon, zebra, which acts as an abstraction layer to the underlying Unix kernel and presents the Zserv API over a Unix or TCP stream to Quagga clients. It is these Zserv clients which typically implement a routing protocol and communicate routing updates to the zebra daemon.
##### Quagga Package Install
#### Quagga Package Install
```shell
sudo apt-get install quagga
```
##### Quagga Source Install
#### Quagga Source Install
First, download the source code from their [official webpage](https://www.quagga.net/).
```shell
sudo apt-get install gawk
@ -356,48 +368,45 @@ make
sudo make install
```
#### Software Defined Networking
### Software Defined Networking
Ryu is a component-based software defined networking framework. Ryu provides software components with well defined API that make it easy for developers to create new network management and control applications. Ryu supports various protocols for managing network devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow, Ryu supports fully 1.0, 1.2, 1.3, 1.4, 1.5 and Nicira Extensions. All of the code is freely available under the Apache 2.0 license.
```shell
```
##### Installation
###### Prerequisites
#### Installation
##### Prerequisites
```shell
sudo apt-get install gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev
```
###### Ryu Package Install
##### Ryu Package Install
```shell
pip install ryu
```
###### Ryu Source Install
##### Ryu Source Install
```shell
git clone git://github.com/osrg/ryu.git
cd ryu; pip install .
```
#### Security Services
### Security Services
The security services offer a wide variety of protocols capable of satisfying the most use cases available. Security services such as IP security protocols, for providing security at the IP layer, as well as the suite of protocols designed to provide that security, through authentication and encryption of IP network packets. Virtual Private Networks (VPNs) and Firewalls are also available for use to the user.
##### Installation
#### Installation
```shell
sudo apt-get install ipsec-tools racoon openvpn
```
#### UCARP
### UCARP
UCARP allows a couple of hosts to share common virtual IP addresses in order to provide automatic failover. It is a portable userland implementation of the secure and patent-free Common Address Redundancy Protocol (CARP, OpenBSD's alternative to the patents-bloated VRRP).
Strong points of the CARP protocol are: very low overhead, cryptographically signed messages, interoperability between different operating systems and no need for any dedicated extra network link between redundant hosts.
##### Installation
#### Installation
```shell
sudo apt-get install ucarp
```
#### Utilities Services
### Utilities Services
The following services are provided as utilities:
* Default Routing
* Default Muticast Routing
@ -411,13 +420,13 @@ The following services are provided as utilities:
* RADVD
* ATD
##### Installation
#### Installation
To install the functionality of the previously metioned services you can run the following command:
```shell
sudo apt-get install isc-dhcp-server apache2 libpcap-dev radvd at
```
#### XORP routing suite
### XORP routing suite
XORP is an open networking platform that supports OSPF, RIP, BGP, OLSR, VRRP, PIM, IGMP (Multicast) and other routing protocols. Most protocols support IPv4 and IPv6 where applicable. It is known to work on various Linux distributions and flavors of BSD.
XORP started life as a project at the ICSI Center for Open Networking (ICON) at the International Computer Science Institute in Berkeley, California, USA, and spent some time with the team at XORP, Inc. It is now maintained and improved on a volunteer basis by a core of long-term XORP developers and some newer contributors.
@ -437,7 +446,7 @@ User-level XORP uses multi-process architecture with one process per routing pro
The lower-level subsystem can use traditional UNIX kernel forwarding, or Click modular router. The modularity and independency of the lower-level from the user-level subsystem allows for its easily replacement with other solutions including high-end hardware-based forwarding engines.
##### Installation
#### Installation
In order to be able to install the XORP Routing Suite, you must first install scons in order to compile it.
```shell
sudo apt-get install scons
@ -450,5 +459,3 @@ sudo apt-get install libssl-dev ncurses-dev
scons
scons install
```