From 070dc8612880fd5abe01a485a62e273bb16cb25f Mon Sep 17 00:00:00 2001 From: dado Date: Sun, 18 May 2025 21:12:45 +0200 Subject: [PATCH] icmp --- networking/016-icmp.md | 30 +++++++++++++++++++ ...nsport-layer.md => 017-transport-layer.md} | 0 2 files changed, 30 insertions(+) create mode 100644 networking/016-icmp.md rename networking/{016-transport-layer.md => 017-transport-layer.md} (100%) diff --git a/networking/016-icmp.md b/networking/016-icmp.md new file mode 100644 index 0000000..9db1035 --- /dev/null +++ b/networking/016-icmp.md @@ -0,0 +1,30 @@ +# ICMP (Internet Control Message Protocol) + +ICMP è un protocollo fondamentale nel networking, utilizzato sia in IPv4 che in IPv6 (ICMPv6). Appartenente al livello 3 del modello ISO/OSI (Network Layer) e non trasporta dati applicativi ma viene impiegato per trasmettere messaggi sullo stato di rete e per segnalare errori. + +## Funzionalità principali + +1. **Segnalazione degli errori:** quando un router rileva un problema (ad esempio, la destinazione non è raggiungibile, non è in grado di inoltrare il pacchetto o il TTL, Time To Live, è scaduta), genera un pacchetto ICMP per informare il mittente dell'errore verificatosi. Questi messaggi aiutano a diagnosticare e risolvere problemi di rete +2. **Meccanismo Query-Response:** ICMP supporta operazioni di richiesta e risposta, essenziali per le diagnostiche di rete. Un tipico esempio è l'uso dei messaggi `Echo Request` ed `Echo Reply` che costituiscono la base del comando `ping`. + +## Il comando ping + +Il comando `ping` è uno strumento diagnostico che sfrutta ICMP per testare la connessione di rete. Invia un pacchetto `ICMP Echo Request` a un indirizzo IP specificato e attende una risposta `Echo Reply` + +```bash +> ping 1.1.1.1 +PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. +64 bytes from 1.1.1.1: icmp_seq=1 ttl=54 time=65.9 ms +64 bytes from 1.1.1.1: icmp_seq=2 ttl=54 time=242 ms +64 bytes from 1.1.1.1: icmp_seq=3 ttl=54 time=164 ms +64 bytes from 1.1.1.1: icmp_seq=4 ttl=54 time=192 ms +^C +--- 1.1.1.1 ping statistics --- +4 packets transmitted, 4 received, 0% packet loss, time 3001ms +rtt min/avg/max/mdev = 65.939/166.214/242.448/64.330 ms +``` + +Nell'output: + +- *ttl* (Time To Live) mostra il valore residuo del campo TTL, che diminuisce ad ogni hop +- *time* indica il tempo impiegato per il percorso andata e ritorno (round-trip time, *rtt*) \ No newline at end of file diff --git a/networking/016-transport-layer.md b/networking/017-transport-layer.md similarity index 100% rename from networking/016-transport-layer.md rename to networking/017-transport-layer.md