Problematiche di Routing



next up previous
Next: Configurazione routing statico Up: Introduzione Previous: Introduzione

Il protocollo IP è alla base della suite TCP/IP. E' un protocollo a commutazione di pacchetto (packet switch) che non garantisce nè il percorso effettuato per raggiungere una data destinazione, nè la ricezione ordinata dei singoli pacchetti.

Il routing dei datagram IP si basa su un semplice algoritmo di scelta del router successivo (next hop) che ciascun router esegue sui pacchetti ricevuti e non destinati ad esso stesso.

La scelta del router successivo viene fatta in base all'indirizzo di destinazione del pacchetto e di una tabella di routing mantenuta sul router.

Questa tabella è essenzialmente formata da una serie di entrate, ciascuna delle quali associa l'indirizzo di una rete all'indirizzo di un router adiacente cui vanno inviati tutti i pacchetti destinati a quella rete.

La tabella può contenere anche indirizzi di singoli host e righe di default.

Ciascun router ripete questo algoritmo finche` il pacchetto non arriva alla rete di destinazione.

Nel caso di una rete locale, il nodo destinatario è collegato direttamente al nodo sorgente. In questo caso il datagram IP viene inviato direttamente verso la sua destinazione, senza passare attraverso un router.

La tabella di routing su un host Unix per una rete locale non collegata a Internet, contiene solo due route statiche In Unix, la tabella di routing si configura con il comando ifconfig

Se invece il nodo cui il datagram è destinato si trova su una rete diversa dalla LAN, il protocollo IP deve instradarlo verso un router che permette di avvicinarsi alla rete di destinazione.

Questo è un esempio della tabella di routing statico su una delle macchine Unix di DSnet:


Routing tables
Destination          Gateway              Flags    Refcnt Use        Interface

default          195.32.0.254       UG          2  4089933  ln0
127.0.0.1        127.0.0.1          UH          1        0  lo0
195.32           195.32.0.2         U          62 14121145  ln0

195.32.1.89      195.32.0.250       UGHDM       0    38686  ln0
195.32.1.161     195.32.0.250       UGHDM       0     2838  ln0
195.32.1.193     195.32.0.198       UGHD        0       48  ln0
195.32.2.6       195.32.0.250       UGHDM       0    85976  ln0
195.32.2.22      195.32.0.250       UGHDM       0     3639  ln0
195.32.2.25      195.32.0.250       UGHDM       0    11177  ln0
195.32.2.37      195.32.0.250       UGHDM       0    19269  ln0
195.32.2.89      195.32.0.248       UGHDM       0    26308  ln0
195.32.2.100     195.32.0.248       UGHD        1       39  ln0
195.32.2.119     195.32.0.33        UGHD        0       47  ln0
195.32.2.170     195.32.0.250       UGHDM       1      133  ln0
195.32.2.181     195.32.0.250       UGHDM       0     2395  ln0
195.32.2.182     195.32.0.250       UGHDM       0    40408  ln0
195.32.2.218     195.32.0.248       UGHDM       0     5169  ln0
195.32.3.3       195.32.0.250       UGHDM       0     7858  ln0
195.32.3.23      195.32.0.250       UGHD        0     5775  ln0
195.32.3.52      195.32.0.248       UGHDM       0     1113  ln0
195.32.3.53      195.32.0.250       UGHDM       0    51428  ln0
195.32.3.79      195.32.0.248       UGHDM       0    10154  ln0
195.32.3.115     195.32.0.248       UGHDM       0    11503  ln0
195.32.3.132     195.32.0.248       UGHD        0        4  ln0
195.32.3.150     195.32.0.250       UGHDM       0    19055  ln0
195.32.4.2       195.32.0.248       UGHD        0      124  ln0
195.32.4.3       195.32.0.250       UGHDM       0    12879  ln0
195.32.4.22      195.32.0.198       UGHD        0       29  ln0
195.32.4.62      195.32.0.248       UGHDM       0     4388  ln0
195.32.4.94      195.32.0.198       UGHD        0      182  ln0
195.32.4.125     195.32.0.198       UGHDM       0     2748  ln0
195.32.4.131     195.32.0.247       UGHD        0    15567  ln0
195.32.4.161     195.32.0.248       UGHDM       0     7421  ln0
195.32.4.254     195.32.0.250       UGHDM       0    30058  ln0
195.32.5.15      195.32.0.248       UGHDM       0     1544  ln0
195.32.5.39      195.32.0.250       UGHD        0     1537  ln0
195.32.5.43      195.32.0.250       UGHDM       0      570  ln0
195.32.5.58      195.32.0.248       UGHDM       0     4182  ln0
195.32.5.80      195.32.0.250       UGHDM       0    13498  ln0
195.32.5.83      195.32.0.250       UGHDM       0     1822  ln0
195.32.5.88      195.32.0.250       UGHDM       0      701  ln0
195.32.6         195.32.0.253       UGDM        0     5966  ln0
195.32.7         195.32.0.247       UGD         0      219  ln0
195.32.9.2       195.32.0.197       UGHD        0     1716  ln0
195.32.9.18      195.32.0.197       UGHD        0     1178  ln0
195.250.224.15   195.32.0.251       UGHD        0       12  ln0
195.250.224.16   195.32.0.251       UGHD        0       17  ln0
195.250.224.18   195.32.0.251       UGHD        0       16  ln0
195.250.224.23   195.32.0.251       UGHD        0       31  ln0
195.250.224.24   195.32.0.251       UGHD        0       53  ln0
195.250.224.26   195.32.0.251       UGHD        0       26  ln0
195.250.224.27   195.32.0.251       UGHD        0       14  ln0
195.250.224.28   195.32.0.251       UGHD        0       25  ln0
195.250.224.30   195.32.0.251       UGHD        0       47  ln0
195.250.224.130  195.32.0.251       UGHD        0      344  ln0
195.250.224.194  195.32.0.253       UGHD        0      363  ln0
195.250.225.65   195.32.0.250       UGHDM       0     3144  ln0
195.250.230.191  195.32.0.248       UGHD        0       39  ln0
195.250.230.215  195.32.0.250       UGHD        0       11  ln0

Come si vede la tabella di routing contiene informazioni solo a livello locale.

Se il routing fallisce perchè non si riesce a instradare correttamente un pacchetto, viene inviato un errore (messaggio ICMP) di "network unreachable" o "host unreachable" al nodo mittente del datagram IP

I comandi ping e traceroute sono molto utili per verificare il funzionamento del routing tra due host. Usano entrambi il protocollo ICMP

Esempio di traceroute


traceroute www.mit.edu
traceroute to DANDELION-PATCH.MIT.EDU (18.181.0.31), 30 hops max, 40 byte packets
 1  garisenda (195.32.0.254)  3 ms  3 ms  2 ms
 2  sansiro-s0-0 (195.250.255.206)  27 ms  45 ms  34 ms
 3  Serial3-7.GW1.MLN2.ALTER.NET (146.188.33.85)  42 ms  72 ms  66 ms
 4  Serial3-7.GW1.MLN2.ALTER.NET (146.188.33.85)  90 ms  41 ms  30 ms
 5  Fddi0-0.CR1.MLN2.Alter.Net (146.188.31.33)  63 ms  31 ms  94 ms
 6  217.Hssi5-0.CR1.LND2.Alter.Net (146.188.3.33)  768 ms  99 ms  107 ms
 7  311.Atm1-0.BR2.LND2.Alter.Net (146.188.3.106)  78 ms  100 ms  148 ms
 8  215.ATM4-0-0.CR2.TCO1.Alter.Net (137.39.103.86)  171 ms  167 ms  170 ms
 9  316.ATM4-0-0.BR1.TCO1.Alter.Net (137.39.74.74)  177 ms  158 ms  202 ms
10  137.39.23.14 (137.39.23.14)  171 ms  158 ms  161 ms
11  cambridge1-br1.bbnplanet.net (4.0.5.42)  167 ms  174 ms  253 ms
12  cambridge2-br2.bbnplanet.net (4.0.1.202)  255 ms  203 ms  175 ms
13  ihtfp.mit.edu (192.233.33.3)  234 ms  174 ms  194 ms
14  W20-RTR-FDDI.MIT.EDU (18.168.0.8)  237 ms  205 ms  263 ms
15  DANDELION-PATCH.MIT.EDU (18.181.0.31)  185 ms *  213 ms

Esempio di Ping

ping www.cs.unibo.it
PING leporello.cs.unibo.it (130.136.2.254): 56 data bytes
64 bytes from 130.136.2.254: icmp_seq=0 ttl=244 time=260 ms
64 bytes from 130.136.2.254: icmp_seq=1 ttl=244 time=144 ms
64 bytes from 130.136.2.254: icmp_seq=2 ttl=244 time=265 ms
64 bytes from 130.136.2.254: icmp_seq=3 ttl=244 time=196 ms
64 bytes from 130.136.2.254: icmp_seq=4 ttl=244 time=308 ms
64 bytes from 130.136.2.254: icmp_seq=5 ttl=244 time=175 ms
64 bytes from 130.136.2.254: icmp_seq=6 ttl=244 time=218 ms
64 bytes from 130.136.2.254: icmp_seq=7 ttl=244 time=186 ms
64 bytes from 130.136.2.254: icmp_seq=8 ttl=244 time=192 ms
64 bytes from 130.136.2.254: icmp_seq=9 ttl=244 time=530 ms


----leporello.cs.unibo.it PING Statistics----
10 packets transmitted, 10 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 144/247/530 ms

SOFTWARE PROGETTO DSNET
Mercoledi' 13 maggio 1998