* Added the documentation
This commit is contained in:
parent
c65d47ade0
commit
b4f9775b13
2 changed files with 338 additions and 0 deletions
36
doc/readme.css
Normal file
36
doc/readme.css
Normal file
|
@ -0,0 +1,36 @@
|
|||
p.code { border: 2px dashed rgb(153, 153, 153);
|
||||
padding: 5px;
|
||||
background: rgb(204, 204, 204) none repeat scroll 0% 50%;
|
||||
-moz-background-clip: initial;
|
||||
-moz-background-origin: initial;
|
||||
-moz-background-inline-policy: initial;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
div.page { border: 2px dashed rgb(153, 153, 153);
|
||||
padding: 10px;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
background-color: rgb(255, 255, 255);
|
||||
opacity: 1;
|
||||
width: 60%;
|
||||
font-family: Arial,Helvetica,sans-serif;
|
||||
}
|
||||
|
||||
body { background-color: rgb(51, 51, 51);
|
||||
}
|
||||
|
||||
span.code { border: 1px dashed rgb(153, 153, 153);
|
||||
background-color: rgb(204, 204, 204);
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
dt { font-weight: bold; }
|
||||
|
||||
.code_var { font-weight: bold; font-family: monospace; }
|
||||
|
||||
.code_type { font-family: monospace; font-style: italic; }
|
302
doc/readme.html
Normal file
302
doc/readme.html
Normal file
|
@ -0,0 +1,302 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html style="direction: ltr;" lang="fr-fr">
|
||||
<head>
|
||||
|
||||
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="readme.css">
|
||||
<title>Programmation Répartie - TP2</title>
|
||||
|
||||
|
||||
<meta content="Glenn ROLLAND" name="author">
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body style="direction: ltr;">
|
||||
|
||||
<div style="text-align: justify;" class="page code code">
|
||||
<h1>Programmation répartie - TP2</h1>
|
||||
|
||||
<h2><a name="1._Description"></a>1.
|
||||
Description</h2>
|
||||
|
||||
<p>Le but de ce TP est de concevoir une implémentation
|
||||
des protocoles ABCAST et CBCAST. </p>
|
||||
|
||||
<p> Il possède les
|
||||
caractéristiques
|
||||
suivantes :</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Il est distribué
|
||||
sous la licence <a href="http://www.gnu.org/copyleft/gpl.html">GNU
|
||||
General Public License</a></li>
|
||||
|
||||
<li>Il est
|
||||
écrit en C++, </li>
|
||||
|
||||
<li>Il implémente ABCAST,</li>
|
||||
|
||||
<li>Il implémente CBCAST.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>Cette implémentation utilise trois <span style="font-style: italic;">threads</span>, un
|
||||
"envoyeur de bas
|
||||
niveau" (<span style="font-weight: bold;">LowSender</span>),
|
||||
un "recepteur de bas niveau" (<span style="font-weight: bold;">LowReceiver</span>)
|
||||
et un
|
||||
"recepteur de haut niveau" (<span style="font-weight: bold;">HighReceiver</span>).</p>
|
||||
|
||||
<h3>1.1.
|
||||
Auteurs</h3>
|
||||
|
||||
<p>Cet exercice a
|
||||
été entièrement
|
||||
réalisé par Glenn ROLLAND <<a href="mailto:glenux@fr.st">glenux@fr.st</a>>
|
||||
à l'occasion de travaux pratiques du cours de <span style="font-style: italic;">Programmation Répartie</span>
|
||||
du Master 2 Ingénierie Informatique
|
||||
-
|
||||
Systèmes, Réseaux et Internet.</p>
|
||||
|
||||
<h3>1.2. Implémentation des protocoles</h3>
|
||||
|
||||
<p>J'ai choisi d'écrire un protocole unique <span style="font-weight: bold;">Multi-BroadCast Protocol</span>
|
||||
(MBCP) utilisable aussi bien pour envoyer les datagrammes d'ABCAST que
|
||||
de CBCAST.</p>
|
||||
|
||||
<h4>1.2.1. Structures des datagrammes</h4>
|
||||
|
||||
<span class="code_var">Le datagramme MBCP</span> se
|
||||
décompose de la façon
|
||||
suivante:
|
||||
<pre>+------+-----------+---------+<br>| Type | Timestamp | Message |<br>+------+-----------+---------+<br></pre>
|
||||
|
||||
<p>Dans ce datagrame:</p>
|
||||
|
||||
<p><span class="code_var" style="font-weight: bold;">Type</span>
|
||||
est de type <span class="code_type">unsigned char</span>
|
||||
et peu prendre les valeurs suivantes:
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
|
||||
<dt style="font-weight: bold;">'A'</dt>
|
||||
|
||||
<dd>Indique l'utilisation du protocole ABCAST</dd>
|
||||
|
||||
<dt style="font-weight: bold;">'C'</dt>
|
||||
|
||||
<dd>indique l'utilisation du protocole CBCAST</dd>
|
||||
|
||||
<dt style="font-weight: bold;">une autre valeur</dt>
|
||||
|
||||
<dd>indique un protocole inconnu</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
<p><span class="code_var" style="font-weight: bold;">Timestamp</span>
|
||||
peut varier en fonction de <span class="code_var">Type</span>. </p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Si <span class="code_var" style="font-weight: bold;">Type</span> == 'A', alors
|
||||
la structure de <span class="code_var">Timestamp</span>
|
||||
est la suivante:<br>
|
||||
|
||||
<pre>+------------+-------------+<br>| Site index | Clock value |<br>+------------+-------------+</pre>
|
||||
|
||||
</li>
|
||||
|
||||
<li>Si <span class="code_var">Type</span>
|
||||
== 'C', alors la structure de <span class="code_var">Timestamp</span>
|
||||
est la suivante:<br>
|
||||
|
||||
<pre>+------------+------------+-------------+<br>| Site_index | Clock_size | Clock_value |<br>+------------+------------+-------------+</pre>
|
||||
|
||||
</li>
|
||||
|
||||
<li>Si <span class="code_var">Type</span>
|
||||
est différent, alors on considère le paquet
|
||||
illisible.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p><span class="code_var">Site_index</span>
|
||||
est de type <span class="code_type">unsigned short</span>
|
||||
(16 bits).<br>
|
||||
|
||||
Il indique l'index du site emetteur. La numérotation des
|
||||
index débute à zéro.</p>
|
||||
|
||||
<p><span class="code_var">Clock_size</span>
|
||||
est de type <span class="code_type">unsigned short</span>
|
||||
(16 bits).<br>
|
||||
|
||||
Ce champ indique la taille de l'horloge (si celle-ci est vectorielle).</p>
|
||||
|
||||
<p><span class="code_var">Clock_value</span>
|
||||
peut varier en fonction de Type.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Si <span class="code_var">Type</span>
|
||||
== 'A', alors <span class="code_var">Clock_value</span>
|
||||
est de type <span class="code_type">unsigned short</span>
|
||||
(16 bits)</li>
|
||||
|
||||
<li>Si <span class="code_var">Type</span>
|
||||
== 'C', alors <span class="code_var">Clock_value</span>
|
||||
est un tableau de valeurs <span class="code_type">unsigned
|
||||
short</span> (16 bits * <span class="code_var">Clock_size</span>)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p><span class="code_var">Message</span>
|
||||
possède la structure suivante:</p>
|
||||
|
||||
<pre>+--------------+--------------+<br>| Message_size | Message_data |<br>+--------------+--------------+<br></pre>
|
||||
|
||||
<p><span class="code_var">Message_size</span>
|
||||
est de type <span class="code_type">unsigned short</span>
|
||||
(16 bits). Cette valeur indique la taille du message.</p>
|
||||
|
||||
<p><span class="code_var">Message_data</span>
|
||||
est un tableau de valeurs <span class="code_type">char</span>
|
||||
(8 bits * <span class="code_var">Message_size</span>).
|
||||
Ce champ contient le message (qui peut être une estampille).</p>
|
||||
|
||||
<dl>
|
||||
|
||||
</dl>
|
||||
|
||||
<h2><a99 name="2._Pré-requis">2.
|
||||
Pré-requis</a99></h2>
|
||||
|
||||
<p>Cet exercice nécessite:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>un système compatible unix, </li>
|
||||
|
||||
<li>le compilateur GNU GCC
|
||||
(version ≥
|
||||
2.95)</li>
|
||||
|
||||
<li>une version récente des GNU Autotools.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>3.
|
||||
Se procurer le sources</h2>
|
||||
|
||||
<p>Vous
|
||||
pouvez télécharger la dernière archive
|
||||
des
|
||||
sources, ou bien directement leur version la plus récente
|
||||
sur le dépôt Subversion du projet.</p>
|
||||
|
||||
<h3>3.1. L'archive compressée</h3>
|
||||
|
||||
<p>Elle est disponible à l'adresse :<br>
|
||||
|
||||
<a href="http://glenux2.free.fr/pub/projets/Programmation_Repartie/TP2/archives/">http://glenux2.free.fr/pub/projets/Programmation_Repartie/TP2/archives/</a><br>
|
||||
|
||||
</p>
|
||||
|
||||
<h3>3.2. Le
|
||||
dépôt Subversion</h3>
|
||||
|
||||
<p>Afin d'obtenir les sources les
|
||||
plus à jour, vous pouvez utiliser le logiciel de
|
||||
contrôle de sources Subversion </p>
|
||||
|
||||
<p class="code">$ svn
|
||||
checkout \<br>
|
||||
|
||||
http://repository.glenux.ath.cx/svn/Cours/M2/Programmation_Repartie/TP2/
|
||||
\<br>
|
||||
|
||||
prog-repartie-tp2</p>
|
||||
|
||||
<p>Il n'y a pas de mot de passe,
|
||||
il suffit donc de presser la touche
|
||||
"Entrée" pour l'utilisateur "anonymous", si ce dernier vous
|
||||
est
|
||||
demandé.</p>
|
||||
|
||||
<h2>4. Utiliser le logiciel</h2>
|
||||
|
||||
<h3>4.1. Compilation</h3>
|
||||
|
||||
<p>Si vous avez choisi l'archive, commencez par la
|
||||
décompressez.</p>
|
||||
|
||||
<p class="code">$ tar -xzvf prog-repartie-tp2.tar.gz</p>
|
||||
|
||||
<p>Rendez vous ensuite dans le
|
||||
dossier qui vient d'être créé lors de
|
||||
la décompression.</p>
|
||||
|
||||
<p class="code">$ cd prog-repartie-tp2</p>
|
||||
|
||||
<p>Puis lancez la compilation du logiciel:</p>
|
||||
|
||||
<p class="code">$ ./autogen.sh<br>
|
||||
|
||||
$ ./configure<br>
|
||||
|
||||
$ make</p>
|
||||
|
||||
<h3>4.3. Utilisation</h3>
|
||||
|
||||
<p>On supposera que les machines <span style="font-style: italic;">weber</span>, <span style="font-style: italic;">beethoven</span> et <span style="font-style: italic;">mozart </span>font partie
|
||||
du même groupe, que leur ports respectifs pour la
|
||||
reception sont <span style="font-style: italic;">2300</span>,
|
||||
<span style="font-style: italic;">2330</span>, et <span style="font-style: italic;">2360</span>.</p>
|
||||
|
||||
<h4>4.3.1. ABCAST</h4>
|
||||
|
||||
<p>Pour la machine <span style="font-style: italic;">weber</span>, on lancera:</p>
|
||||
|
||||
<p class="code">$ ./dabcast -A -p 2300 -g weber:2300 -g
|
||||
beethoven:2330 -g mozart:2360 -i 1</p>
|
||||
|
||||
<p>Pour la machine <span style="font-style: italic;">beethoven</span>:</p>
|
||||
|
||||
<p class="code">$ ./dabcast -A -p 2330 -g weber:2300 -g
|
||||
beethoven:2330 -g mozart:2360 -i 2</p>
|
||||
|
||||
<p>Pour la machine <span style="font-style: italic;">mozart</span>: </p>
|
||||
|
||||
<p class="code">$ ./dabcast -A -p 2360 -g weber:2300 -g
|
||||
beethoven:2330 -g mozart:2360 -i 3</p>
|
||||
|
||||
<h4>4.3.2. CBCAST</h4>
|
||||
|
||||
<p>On supposera que les machines <span style="font-weight: bold;">weber</span>, <span style="font-weight: bold;">beethoven</span> et <span style="font-weight: bold;">mozart</span> font partie
|
||||
du même groupe, que leur ports respectifs pour la
|
||||
reception sont <span style="font-weight: bold;">2300</span>,
|
||||
<span style="font-weight: bold;">2330</span>, et <span style="font-weight: bold;">2360</span>.</p>
|
||||
|
||||
<p>Pour la machine <span style="font-style: italic;">weber</span>, on lancera:</p>
|
||||
|
||||
<p class="code">$ ./dabcast -C -p 2300 -g weber:2300 -g
|
||||
beethoven:2330 -g mozart:2360 -i 1</p>
|
||||
|
||||
<p>Pour la machine <span style="font-style: italic;">beethoven</span>:</p>
|
||||
|
||||
<p class="code">$ ./dabcast -C -p 2330 -g weber:2300 -g
|
||||
beethoven:2330 -g mozart:2360 -i 2</p>
|
||||
|
||||
<p>Pour la machine <span style="font-style: italic;">mozart</span>: </p>
|
||||
|
||||
<p class="code">$ ./dabcast -C -p 2360 -g weber:2300 -g
|
||||
beethoven:2330 -g mozart:2360 -i 3</p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue