This commit is contained in:
Bonnet Ronan 2022-12-15 08:52:46 +01:00
commit 8a1f53ac37
8 changed files with 310773 additions and 0 deletions

150
tp.md Normal file
View file

@ -0,0 +1,150 @@
# TP Réseau
## Question 1
__Réaliser un échange de données via TCP et UDP__
Choix arbitraire du port : 5678
### avec TCP
Sur la machine puits
```sh
tsock -p 5678
```
Sur la machine source
```sh
tsock -s getip102-03 5678
```
*Observation* :
* désequencement: pas de déséquencement car sur un même réseau local + TCP qui garantit l'ordre
* pertes: TCP garantit les pertes
### avec UDP
Sur la machine puits
```sh
tsock -p -u 5678
```
Sur la machine source
```sh
tsock -s -u getip102-03 5678
```
*Observation* :
* désequencement: pas de déséquencement
* pertes: pas de pertes sur des petits messages
#### Proposition d'experience pour montrer la non-fiabilité
```sh
tsock -p -u -t 10 5678
```
```sh
tsock -s -u -n 20 getip102-03 5678
```
> On peut aussi enlever l'affichage et augmenter le nombre de messages
*Observation* :
* pertes quand le buffer du puit est plein
## Question 2
__Même chose en changeant l'ordre du puit et de la source__
### avec TCP
Sur la machine source
```sh
tsock -s getip102-03 5678
```
Sur la machine puits
```sh
tsock -p 5678
```
*Observation* :
* La connexion échoue -> pas de données échangées
### avec UDP
Sur la machine source
```sh
tsock -s -u getip102-03 5678
```
Sur la machine puits
```sh
tsock -p -u 5678
```
*Observation* :
* Des données sont reçues quand la source envoi beaucoup de données, sinon on n'observe aucune donnée
## Question 3
__Capturer l'échange avec `tcpdump`__
Ici, on suppose que l'on va sur la machine hôte insa-20155
```sh
ssh tcpdump@insa-20155
```
Lancer tcpdump en tant que root
```sh
sudo tcpdump port 5678
```
### Observations
* Mettre en évidence que UDP est sans connexion
* Mettre en évidence que TCP est avec connexion
* Trouver les différentes phases de la connexion de TCP
#### Faire une expérience pour montrer que les frontières des trames ne sont pas conservées
remplacer 30 par un grand nombre.
```sh
tsock -s -l 30 getip102-03 5678
```
## Question 4
__Reprendre la Question 1 et capturer les trammes Ethernet avec `tcpdump`__
```sh
sudo tcpdump -xx port 5678
```
### Analyse des résultats
* trouver les adresses Ethernet et IP de la source et du puit
* Information sur le type de trame transmise (UDP ou TCP)
* trouver le numéro de port utilisé par le puit
* trouver le numéro de port utilisé par la source (D'où vient-il ?)
## Question 5
### Qu'est que le mode broadcast
### Trouver l'adresse broadcast physique du réseau
```sh
sudo tcpdump -xx broadcast
```

11
tsockpuits.1.log Normal file
View file

@ -0,0 +1,11 @@
PUITS: lg_buf_appli=30, port=5678, nb_buf_appli=infini, TP= tcp
PUITS: Reception n° 1 ( 30) [ 1aaaaaaaaaaaaaaaaaaaaaaaaa]
PUITS: Reception n° 2 ( 30) [ 2bbbbbbbbbbbbbbbbbbbbbbbbb]
PUITS: Reception n° 3 ( 30) [ 3ccccccccccccccccccccccccc]
PUITS: Reception n° 4 ( 30) [ 4ddddddddddddddddddddddddd]
PUITS: Reception n° 5 ( 30) [ 5eeeeeeeeeeeeeeeeeeeeeeeee]
PUITS: Reception n° 6 ( 30) [ 6fffffffffffffffffffffffff]
PUITS: Reception n° 7 ( 30) [ 7ggggggggggggggggggggggggg]
PUITS: Reception n° 8 ( 30) [ 8hhhhhhhhhhhhhhhhhhhhhhhhh]
PUITS: Reception n° 9 ( 30) [ 9iiiiiiiiiiiiiiiiiiiiiiiii]
PUITS: Reception n° 10 ( 30) [ 10jjjjjjjjjjjjjjjjjjjjjjjjj]

0
tsockpuits_UDP.1.log Normal file
View file

1
tsocksource_TCP.2.log Normal file
View file

@ -0,0 +1 @@
SOURCE: lg_buf_appli=30, port=5678, nb_buf_appli=10, TP= tcp -> insa-20155

11
tsocksource_UDP.1.log Normal file
View file

@ -0,0 +1,11 @@
SOURCE: lg_buf_appli=30, port=5678, nb_buf_appli=10, TP= udp -> insa-20155
SOURCE: Envoi n° 1 ( 30) [ 1aaaaaaaaaaaaaaaaaaaaaaaaa]
SOURCE: Envoi n° 2 ( 30) [ 2bbbbbbbbbbbbbbbbbbbbbbbbb]
SOURCE: Envoi n° 3 ( 30) [ 3ccccccccccccccccccccccccc]
SOURCE: Envoi n° 4 ( 30) [ 4ddddddddddddddddddddddddd]
SOURCE: Envoi n° 5 ( 30) [ 5eeeeeeeeeeeeeeeeeeeeeeeee]
SOURCE: Envoi n° 6 ( 30) [ 6fffffffffffffffffffffffff]
SOURCE: Envoi n° 7 ( 30) [ 7ggggggggggggggggggggggggg]
SOURCE: Envoi n° 8 ( 30) [ 8hhhhhhhhhhhhhhhhhhhhhhhhh]
SOURCE: Envoi n° 9 ( 30) [ 9iiiiiiiiiiiiiiiiiiiiiiiii]
SOURCE: Envoi n° 10 ( 30) [ 10jjjjjjjjjjjjjjjjjjjjjjjjj]

11
tsocksource_UDP.2.log Normal file
View file

@ -0,0 +1,11 @@
SOURCE: lg_buf_appli=30, port=5678, nb_buf_appli=10, TP= udp -> insa-20155
SOURCE: Envoi n° 1 ( 30) [ 1aaaaaaaaaaaaaaaaaaaaaaaaa]
SOURCE: Envoi n° 2 ( 30) [ 2bbbbbbbbbbbbbbbbbbbbbbbbb]
SOURCE: Envoi n° 3 ( 30) [ 3ccccccccccccccccccccccccc]
SOURCE: Envoi n° 4 ( 30) [ 4ddddddddddddddddddddddddd]
SOURCE: Envoi n° 5 ( 30) [ 5eeeeeeeeeeeeeeeeeeeeeeeee]
SOURCE: Envoi n° 6 ( 30) [ 6fffffffffffffffffffffffff]
SOURCE: Envoi n° 7 ( 30) [ 7ggggggggggggggggggggggggg]
SOURCE: Envoi n° 8 ( 30) [ 8hhhhhhhhhhhhhhhhhhhhhhhhh]
SOURCE: Envoi n° 9 ( 30) [ 9iiiiiiiiiiiiiiiiiiiiiiiii]
SOURCE: Envoi n° 10 ( 30) [ 10jjjjjjjjjjjjjjjjjjjjjjjjj]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
SOURCE: lg_buf_appli=30, port=5678, nb_buf_appli=20, TP= udp -> insa-20155
SOURCE: Envoi n° 1 ( 30) [ 1aaaaaaaaaaaaaaaaaaaaaaaaa]
SOURCE: Envoi n° 2 ( 30) [ 2bbbbbbbbbbbbbbbbbbbbbbbbb]
SOURCE: Envoi n° 3 ( 30) [ 3ccccccccccccccccccccccccc]
SOURCE: Envoi n° 4 ( 30) [ 4ddddddddddddddddddddddddd]
SOURCE: Envoi n° 5 ( 30) [ 5eeeeeeeeeeeeeeeeeeeeeeeee]
SOURCE: Envoi n° 6 ( 30) [ 6fffffffffffffffffffffffff]
SOURCE: Envoi n° 7 ( 30) [ 7ggggggggggggggggggggggggg]
SOURCE: Envoi n° 8 ( 30) [ 8hhhhhhhhhhhhhhhhhhhhhhhhh]
SOURCE: Envoi n° 9 ( 30) [ 9iiiiiiiiiiiiiiiiiiiiiiiii]
SOURCE: Envoi n° 10 ( 30) [ 10jjjjjjjjjjjjjjjjjjjjjjjjj]
SOURCE: Envoi n° 11 ( 30) [ 11kkkkkkkkkkkkkkkkkkkkkkkkk]
SOURCE: Envoi n° 12 ( 30) [ 12lllllllllllllllllllllllll]
SOURCE: Envoi n° 13 ( 30) [ 13mmmmmmmmmmmmmmmmmmmmmmmmm]
SOURCE: Envoi n° 14 ( 30) [ 14nnnnnnnnnnnnnnnnnnnnnnnnn]
SOURCE: Envoi n° 15 ( 30) [ 15ooooooooooooooooooooooooo]
SOURCE: Envoi n° 16 ( 30) [ 16ppppppppppppppppppppppppp]
SOURCE: Envoi n° 17 ( 30) [ 17qqqqqqqqqqqqqqqqqqqqqqqqq]
SOURCE: Envoi n° 18 ( 30) [ 18rrrrrrrrrrrrrrrrrrrrrrrrr]
SOURCE: Envoi n° 19 ( 30) [ 19sssssssssssssssssssssssss]
SOURCE: Envoi n° 20 ( 30) [ 20ttttttttttttttttttttttttt]