esds/manual/manual.tex

96 lines
3 KiB
TeX
Raw Normal View History

2022-09-12 10:45:38 +02:00
\documentclass[11pt]{article}
% Packages
\usepackage{fullpage}
\usepackage{minted}
\usepackage{booktabs}
\usepackage{xspace}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{svg}
2022-09-12 13:22:46 +02:00
\usepackage[most]{tcolorbox}
% Packages setups
\graphicspath{{./assets}}
2022-09-12 10:45:38 +02:00
% Commands
\newcommand{\stateoff}{"\textit{off}"\xspace}
\newcommand{\stateon}{"\textit{on}"\xspace}
2022-09-12 11:28:20 +02:00
\newcommand{\version}{\InputIfFileExists{version}{}{version}}
2022-09-12 13:22:46 +02:00
\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}}
2022-09-12 10:45:38 +02:00
% Document
\begin{document}
% Title page
\makeatletter
\begin{titlepage}
\begin{center}
\Huge
2022-09-12 11:28:20 +02:00
\textbf{\fontsize{90}{60}\selectfont User Manual\\}
\vspace{0.6cm}
2022-09-12 13:22:46 +02:00
\textbf{\LARGE --- ESDS v\version --- \\}
2022-09-12 11:28:20 +02:00
{\Large \today}
\vspace{2cm}
2022-09-12 10:45:38 +02:00
{\includesvg[scale=0.8]{../icon.svg}}
2022-09-12 13:22:46 +02:00
\vspace{1.5cm}
2022-09-12 10:45:38 +02:00
\LARGE
\textbf{ESDS an Extensible Simulator for Distributed Systems\\}
2022-09-12 13:22:46 +02:00
\vspace{1cm}
2022-09-12 11:28:20 +02:00
\textit{Written by Loic Guegan and Issam Raïs}
2022-09-12 10:45:38 +02:00
\end{center}
\end{titlepage}
\pagebreak
\section{Architecture of ESDS}
\begin{figure}[!h]
\centering
\includegraphics[scale=0.5]{components.pdf}
\caption{Simulation architecture used by ESDS}
\label{architecture}
\end{figure}
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
in charge of implementing the simulation main loop. It instantiates the network (e.g bandwidths
2022-09-12 13:22:46 +02:00
andlatencies), collects and processes the events (e.g communications,turn on/off). On the
other hand, nodes are threads that implement the nodes behaviors.
\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).
2022-09-12 10:45:38 +02:00
\end{document}