Update user manual

This commit is contained in:
Loic Guegan 2023-06-29 11:10:26 +02:00
parent c1ac340350
commit 0177500584
5 changed files with 37 additions and 16 deletions

View file

@ -10,8 +10,8 @@ L=np.full((n,n),0) # Latency 0s
s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False}})
##### Instantiate nodes with their implementation
s.create_node("node",args="sender") # Use node.py for the first node with "sender" as argument
s.create_node("node",args="receiver") # Now the second node
s.create_node("node",interfaces=["wlan0"],args="sender") # Use node.py for the first node, specify the vailable communication interfaces and use "sender" as argument
s.create_node("node",interfaces=["wlan0"],args="receiver") # Now the second node
##### Run the simulation
s.run(interferences=True)

View file

@ -1,3 +1,3 @@
[t=0.000,src=n0] Send 10 bytes on wlan0
[t=0.002,src=n1] Receive 10 bytes on wlan0
[t=0.000,src=n0,grp=def] Send 10 bytes on wlan0
[t=0.002,src=n1,grp=def] Receive 10 bytes on wlan0
[t=0.002,src=esds] Simulation ends

View file

@ -12,6 +12,7 @@ nodes:
interfaces:
wlan0:
type: "wireless"
nodes: all # All nodes are connected to this network
links:
- all 50kbps 0s all # All nodes are reachable by each other
txperfs:

Binary file not shown.

View file

@ -5,6 +5,7 @@
\usepackage{minted}
\usepackage{booktabs}
\usepackage{xspace}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{makecell}
\usepackage[utf8]{inputenc}
@ -60,11 +61,11 @@
\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
The ESDS simulator comprises two major components: 1) The Simulation Orchestrator (SO) 2) The Simulated
Nodes (SN). This architecture is depicted on Figure~\ref{architecture}. The SO is the main process
in charge of implementing the simulation main loop. It instantiates the network (e.g bandwidths and
latencies), collects and processes the events (e.g communications,turn on/off). On the other hand,
nodes are threads that implement the node behaviors.
latencies matrices), collects and processes the events (e.g communications,turn on/off). On the other hand,
the SNs are threads that implement the node behaviors by following so called \textit{node API}.
\section{Getting started}
@ -87,6 +88,10 @@ Nodes implementations are written using python. Here is the implementation of th
the last \verb|platform.yaml| file:
\addsource{assets/node.py}{python}
More details about implementations of nodes are availablein the
\href{https://gitlab.com/manzerbredes/esds/-/raw/main/example/sender.py}{\textit{example code}} and the
\href{https://gitlab.com/manzerbredes/esds/-/raw/main/example/sender.py}{\textit{ESDS implementation of the SNs interface}}.
\subsection{Execution}
\label{sec:firstsimulation:execution}
@ -199,6 +204,15 @@ implementations:
- 1-@ receiver.py
\end{tabminted}
\\ \cmidrule{1-3}
\textbf{groups} & Specify the group to use in the nodes log reports. Useful to filter logs. By default, nodes are in the \textit{def} group. &
\begin{tabminted}{yaml}
groups:
- 0 groupA
- 1-@ groupB
\end{tabminted}
\\ \cmidrule{1-3}
\textbf{arguments} & Define the arguments that will be passed to each node implementation (keys of each element uses \textbf{the range syntax}). &
\begin{tabminted}{yaml}
@ -212,8 +226,8 @@ arguments:
\label{keywords:nodes}
\end{table}
Several entries in the platform file use a \textbf{range syntax} to map informations (node
implementations, links etc.) to node $ids$. Indeed, when running a simulation with $p$ nodes, each
Several entries in the platform file use a \textbf{range syntax} to bind data (node
implementations, links etc.) to node $ids$. For a simulation with $p$ nodes, each
node will have an allocated $id$ such that $id \in [0,1,...,p-1]$. Here are examples of valid range
syntax for a simulation that uses 5 nodes:
\begin{itemize}
@ -242,8 +256,15 @@ available keywords.
type: "wireless"
\end{tabminted}
\\ \cmidrule{1-3}
\textbf{nodes} & Specify the nodes that have access the current network/interface (uses the \textbf{range syntax}) &
\begin{tabminted}{yaml}
nodes: 2-@
\end{tabminted}
\\ \cmidrule{1-3}
\textbf{links} & List all the links between nodes on the interface (uses \textbf{the range syntax}). &
\textbf{links} & List all the links between nodes on the interface (uses the \textbf{range syntax}). &
\begin{tabminted}{yaml}
links:
# Link node 0 to node 1:
@ -255,7 +276,7 @@ links:
\textbf{txprefs} & Define the transmission performance of each wireless node (keys of each element uses \textbf{the range syntax}). This keyword is only available for wireless interfaces. &
\begin{tabminted}{yaml}
txprefs:
txperfs:
- 0 10kbps 0s
- 1 10kbps 5s
\end{tabminted}
@ -266,10 +287,9 @@ txprefs:
\label{keywords:interfaces}
\end{table}
In esds, txprefs (or transmission preferences) corresponds to the transmission performance of the
wireless interface. It is used to compute the transmission duration of the wireless
communication. When using custom orchestrator instantiation, the txprefs can be assigned on the
diagonal components of the bandwidth and latency matrices.
In esds, txperfs (or transmission performance) corresponds to the transmission performance on the
wireless interface. It is used to compute the transmission duration of wireless communications.
When using custom orchestrator instantiation, the txperfs parameter of a given node can be assigned by fixing the diagonal components of the bandwidth and latency matrices.
\end{document}