mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Update manual
This commit is contained in:
parent
c75fbe854d
commit
47c71c85c9
6 changed files with 62 additions and 7 deletions
6
manual/assets/node.py
Normal file
6
manual/assets/node.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
def execute(api):
|
||||||
|
role=api.args # "sender" or "receiver" cf. platform.yaml
|
||||||
|
if role == "sender":
|
||||||
|
api.send("wlan0","MY MESSAGE",10,None)
|
||||||
|
else:
|
||||||
|
api.receive("wlan0")
|
3
manual/assets/output.txt
Normal file
3
manual/assets/output.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[t=0.000,src=n0] Send 10 bytes on wlan0
|
||||||
|
[t=0.016,src=n1] Receive 10 bytes on wlan0
|
||||||
|
[t=0.016,src=esds] Simulation ends
|
19
manual/assets/platform.yaml
Normal file
19
manual/assets/platform.yaml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
general:
|
||||||
|
interferences: on # Turns on interferences
|
||||||
|
|
||||||
|
nodes:
|
||||||
|
count: 2
|
||||||
|
implementations:
|
||||||
|
- all node.py
|
||||||
|
arguments: {
|
||||||
|
"0": "sender",
|
||||||
|
"1": "receiver"
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces:
|
||||||
|
wlan0:
|
||||||
|
type: "wireless"
|
||||||
|
links:
|
||||||
|
- all 50kbps 0s all # All nodes are reachable by each other
|
||||||
|
txperfs:
|
||||||
|
- all 50kbps 0s
|
Binary file not shown.
|
@ -9,12 +9,16 @@
|
||||||
\usepackage[utf8]{inputenc}
|
\usepackage[utf8]{inputenc}
|
||||||
\usepackage[T1]{fontenc}
|
\usepackage[T1]{fontenc}
|
||||||
\usepackage{svg}
|
\usepackage{svg}
|
||||||
\usepackage{listings}
|
\usepackage[most]{tcolorbox}
|
||||||
|
|
||||||
|
% Packages setups
|
||||||
|
\graphicspath{{./assets}}
|
||||||
|
|
||||||
% Commands
|
% Commands
|
||||||
\newcommand{\stateoff}{"\textit{off}"\xspace}
|
\newcommand{\stateoff}{"\textit{off}"\xspace}
|
||||||
\newcommand{\stateon}{"\textit{on}"\xspace}
|
\newcommand{\stateon}{"\textit{on}"\xspace}
|
||||||
\newcommand{\version}{\InputIfFileExists{version}{}{version}}
|
\newcommand{\version}{\InputIfFileExists{version}{}{version}}
|
||||||
|
\newcommand*{\addsource}[2]{\vspace{0.3cm}\begin{tcolorbox}[breakable,enhanced,arc=1.4mm,arc is angular,title=\textbf{\small#1}]\inputminted[fontsize=\scriptsize]{#2}{#1}\end{tcolorbox}}
|
||||||
|
|
||||||
% Document
|
% Document
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
@ -26,16 +30,16 @@
|
||||||
\Huge
|
\Huge
|
||||||
\textbf{\fontsize{90}{60}\selectfont User Manual\\}
|
\textbf{\fontsize{90}{60}\selectfont User Manual\\}
|
||||||
\vspace{0.6cm}
|
\vspace{0.6cm}
|
||||||
\textbf{\LARGE - ESDS v\version - \\}
|
\textbf{\LARGE --- ESDS v\version --- \\}
|
||||||
{\Large \today}
|
{\Large \today}
|
||||||
\vspace{2cm}
|
\vspace{2cm}
|
||||||
|
|
||||||
{\includesvg[scale=0.8]{../icon.svg}}
|
{\includesvg[scale=0.8]{../icon.svg}}
|
||||||
\vspace{2cm}
|
\vspace{1.5cm}
|
||||||
|
|
||||||
\LARGE
|
\LARGE
|
||||||
\textbf{ESDS an Extensible Simulator for Distributed Systems\\}
|
\textbf{ESDS an Extensible Simulator for Distributed Systems\\}
|
||||||
\vspace{0.5cm}
|
\vspace{1cm}
|
||||||
\textit{Written by Loic Guegan and Issam Raïs}
|
\textit{Written by Loic Guegan and Issam Raïs}
|
||||||
\end{center}
|
\end{center}
|
||||||
\end{titlepage}
|
\end{titlepage}
|
||||||
|
@ -54,10 +58,33 @@
|
||||||
ESDS simulator comprises two major components: 1) The Simulation Orchestrator(SO) 2) The Simulated
|
ESDS simulator comprises two major components: 1) The Simulation Orchestrator(SO) 2) The Simulated
|
||||||
Nodes (SN). This architecture is depicted in Figure \ref{architecture}. The SO is the main process
|
Nodes (SN). This architecture is depicted in Figure \ref{architecture}. The SO is the main process
|
||||||
in charge of implementing the simulation main loop. It instantiates the network (e.g bandwidths
|
in charge of implementing the simulation main loop. It instantiates the network (e.g bandwidths
|
||||||
andlatencies), collects and processes the events (e.g communications,turn on/off). The nodes on the
|
andlatencies), collects and processes the events (e.g communications,turn on/off). On the
|
||||||
other hand are threads that simulate the nodes behaviors.
|
other hand, nodes are threads that implement the nodes behaviors.
|
||||||
|
|
||||||
%\inputminted[autogobble]{yaml}{../example/platform.yaml}
|
\section{Running your first simulation}
|
||||||
|
|
||||||
|
To run a simulation, at least 2 files are required: 1) a platform file 2) a node implementation
|
||||||
|
source code. The platform file defines the simulated network platform and sets various simulation
|
||||||
|
parameters. The node implementation source code simply provide the logic of the simulated nodes.
|
||||||
|
|
||||||
|
\subsection{Platform file}
|
||||||
|
Platform files are written in YAML and contains 3 sections: 1) \textit{general} 2) \textit{nodes} 3) \textit{interfaces}.
|
||||||
|
The \textit{general} section is optional but all the others must be present. Here is a simple platform file to simulate 2 wireless nodes:
|
||||||
|
\addsource{assets/platform.yaml}{yaml}
|
||||||
|
|
||||||
|
\subsection{Node implementation file}
|
||||||
|
Nodes implementations are written using python. Here is the implementation of the node used in the previous platform.yaml file:
|
||||||
|
\addsource{assets/node.py}{python}
|
||||||
|
|
||||||
|
\subsection{Execution}
|
||||||
|
To execute our first simulation, the following command should be executed from the same folder
|
||||||
|
that contains \verb|platform.yaml| and \verb|node.py|:
|
||||||
|
\begin{verbatim}
|
||||||
|
> esds run platform.yaml
|
||||||
|
\end{verbatim}
|
||||||
|
Here is the output of the simulation:
|
||||||
|
\verbatiminput{assets/output.txt}
|
||||||
|
In this case, simulation tooks $0.016s$ and $10$ bytes were sent on the wlan0 interface from node 0 (src=n0) to node 1 (src=n1).
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue