Laboratorio di reti
Transcript
Laboratorio di reti
Laboratorio di reti Routing: concetti di base Routing statico RIP Docente: Ing. Flavio Giovanelli Cefriel [email protected] © 2005 Outline Concetti base Routing metrics Configurare rotte statiche Algoritmi di routing Distance vector RIP Laboratorio di reti -2- © 2005 Routing Processo di determinazione di un percorso tra sorgente e destinatario Svolto dai routers o switch della rete Host y Host x SubNetwork 1 (e.g Ethernet, FDDI) Router (o Gateway) SubNetwork 5 Link (e.g. PPP, Frame Relay, ATM) Laboratorio di reti -3- © 2005 Routing: caratteristiche Centralizzato Processore centrale che sa tutto Telefonia Distribuito Scambio di informazioni tra i routers Internet Laboratorio di reti -4- © 2005 Routing: classificazione Statico o state independent Viene ignorato la stato attuale della rete Congestione, link danneggiati,... Rete telefonica e shortest path Dinamico o state dependent In base allo stato attuale della rete si sceglie un cammino Viene misurata e monitorata la rete: più overhaed – Topologia e traffico Routing flat o gerarchico Laboratorio di reti -5- © 2005 Routing: caratteristiche In reti a pacchetto: Hop by hop: ciascun router sceglie il link successivo Datagramma Circuito virtuale Source Route: nell’header vi è l’intero cammino A B C A B C Loose source Route: nell’header indicazione di alcuni router da attraversare Laboratorio di reti -6- © 2005 Routing: caratteristiche Stocastico: esistono più next hop per una destinazione Deterministico: singolo next hop per una destinazione Cammini multipli: esistono più cammini per una destinazione Singolo cammino: esiste un solo cammino per una destinazione Laboratorio di reti -7- © 2005 Architettura del router Routing Algorithm Layer-3 Routing Table Forwarding process Layer-2 Laboratorio di reti LAN IP header WAN -8- DATA MAC header © 2005 Routing Table Indirizzo rete Indirizzo destinazione next hop Interfaccia di uscita Costo link A pippo E0 6 B pluto E1 2 C paperino E2 4 E0 E1 E2 pluto Rete B Rete A pippo paperino Laboratorio di reti -9- Rete C © 2005 Forwarding Process Rete A Rete B IP S2 Int S1 IP A2 MAC A2 IP A1 MAC A1 IP S1 MAC S1 B2 B2 A2 B2 S2 B2 B2 A2 B2 IP S2 MAC S2 Rete B IP T2 Int T1 B2 S2 B2 IP T1 MAC T1 B2 B2 B2 T2 B2 B IP B2 Int B2 Laboratorio di reti B2 B2 B2 T2 B2 B2 B2 - 10 - IP T2 MAC T2 IP B2 MAC B2 IP B2 MAC B2 Rete © 2005 B Routing metrics Gli algoritmi di routing selezionano il cammino migliore in base al costo dei link Legame tra costo e traffic load Metrica statica Hop count Eventualmente pesi per indicarne la capacità Metriche dinamiche (ARPANET) Costo = f(lunghezza media coda del router) Costo = f(lunghezza media coda del router, capacità del link) Laboratorio di reti - 11 - © 2005 Routing statico Le entry della tabella di routing vengono immesse manualmente dall’amministratore di rete Non vengono influenzate da cambiamenti topologici o fisici della rete comando: RouterA(config)# ip route destination_net subnet_mask [outgoing_interface | next_hop] cost waycross(config)# ip route 172.16.3.0 255.255.255.0 172.16.4.1 130 Laboratorio di reti - 12 - © 2005 Administrative costs Laboratorio di reti - 13 - © 2005 ip route (1) administrative cost is 0 Laboratorio di reti - 14 - © 2005 ip route (2) administrative cost is 1 Laboratorio di reti - 15 - © 2005 Default route Default routes are used to route packets with destinations that do not match any of the other routes in the routing table. Routers are typically configured with a default route for Internet-bound traffic, since it is often impractical and unnecessary to maintain routes to all networks in the Internet. A default route is actually a special static route that uses this format: ip route 0.0.0.0 0.0.0.0 [next-hop-address | outgoing interface] Laboratorio di reti - 16 - © 2005 show ip route Laboratorio di reti - 17 - © 2005 Esercizio configurare il routing statico ROUTER Z S0/1 S0/0 197.10.10.98/30 Internet 197.10.10.97/30 ROUTER X ROUTER Y S0/0 S0/1 F0/1 S0/0 197.10.10.66/30 197.10.10.65/30 F0/1 197.10.10.0/26 Laboratorio di reti 197.10.10.128/25 - 18 - © 2005 Protocollo di Routing Definisce: Algoritmo di routing utilizzato Metrica e eventuali pesi Lunghezza, contenuto, frequenza di scambio dei pacchetti di update Varie categorie TCP/IP OSI Proprietari Laboratorio di reti - 19 - © 2005 Algoritmo di routing Correttezza Semplicità Basso processing time e overhead di traffico Robustezza Adattamento rapido a variazioni di topologia e traffico Stabilità Fairness Ottimalità Selezione del cammino ottimo come throughput e ritardo massimo Laboratorio di reti - 20 - © 2005 Distance vector e Link state routing Algoritmi dinamici e distribuiti I router vicini interagiscono tra loro scambiandosi informazioni Tabelle di instradamento In reti a pacchetto Si adattano alla situazione della rete Funzione costo del link Traffico nella rete Laboratorio di reti - 21 - © 2005 Distance vector Routing Table: lista di tuple <Destinazione, hop, costo, interfaccia> Costo = somma dei costi dei link sul shortest path per la destinazione Distance vector: informazioni di routing Ottenute da routing table Aggiornamento periodico della routing table I router vicini si scambiano i distance vector Merging tra le informazioni Distanza tra i router vicini Distance vector di ciascuno dei vicini Laboratorio di reti - 22 - © 2005 Distance vector Router A (address 3) Routing table A Router B (address 4) L1 Cost = 5 Destination Hops Cost Interface 1 5 10 3 2 3 39 2 3 0 6 0 4 1 6 3 Laboratorio di reti Distanc e vector A Routing table B Cost of L1 Destination Hops Cost 10 5 1 39 3 2 +1 + 6 0 3 6 1 4 - 23 - © 2005 Distance vector Inizializzazione routing table: costo per tutte le destinazioni infinito Scambio dei distance vector: merging delle informazioni Selezione del distance vector Costo minimo Distanza minima a parità di costo Aggiornamento della routing table Laboratorio di reti - 24 - © 2005 Distance vector Destination Hops Cost 15 3 1 44 5 2 11 2 3 11 3 4 A B 3 4 I1 Destination Hops Cost 4 1 20 3 2 25 3 3 43 4 4 20 Laboratorio di reti C Destination Hops Cost 30 6 1 25 4 2 5 1 3 20 3 4 1 i I3 I2 Destination Hops Cost Interface 1 2 3 4 4 4 2 4 19 26 8 15 1 3 2 1 Routing table i - 25 - © 2005 Distance vector Facilità di implementazione Elevata complessità Reazione rapida alle buone notizie Reazione lenta alle cattive notizie Loops e effetto bouncing Problemi se cade un link o un nodo Nessun nodo conosce la mappa della rete Laboratorio di reti - 26 - © 2005 Count to infinity Guasto di un nodo o di un link Aggiornamento delle tabelle di routing senza la conoscenza della topologia di rete Creazione di loops tra nodi e congestione Router 1 Network A Laboratorio di reti L1 Router 2 L2 - 27 - © 2005 Count to infinity Network A Tabella di R1 Dest A A A Hops Int L1 0 ∞ 2 Dest A Laboratorio di reti L1 -L2 DV di R2 Tabella di R2 Router 1 L2 Dest Hops Int A 1 L2 A ∞ A 3 L2 Router 2 DV di R1 Hops 1 Dest Dest AA - 28 - Hops Hops ∞ 2 © 2005 Patches al count to infinity Si aggiunge un campo al distance vector Path vector: cammino da cui proviene l’informazione Aumento delle dimensioni Routing table Distance vector: elevato overhead Split Horizon Hold down Triggered Updates Laboratorio di reti - 29 - © 2005 Split Horizon Se A è next hop per la rete X, B non manda il costo per raggiungere X ad A Poisoned reverse: la distanza è presente ma a costo infinito Update on X Network X A B Update on X Non vale se ho tre router che hanno count to infinity Time-out per stabilire route unreachable Laboratorio di reti - 30 - © 2005 Hold Down Router per T sec dopo un messaggio di unreachable per X, ignora ogni update per X Preserva i loop e i cammini scorretti Ignoro il cammino verso X mentre non è raggiungibile x Network X Laboratorio di reti Periodic Update with X Reachable Triggered Update with X Unreachable - 31 - © 2005 Triggered Updates Distance vector inviati con una certa frequenza Timer associato a ogni entry della routing table A ogni cambiamento della routing table Non si attende e si manda subito un distance vector ai router vicini Network X x Laboratorio di reti A B Triggered Update with X Unreachable (hop count =16) - 32 - © 2005 Routing Information Protocol (RIP) IGP Designed at Berkeley (‘82) Implements distance vector routing Uses the Bellman/Ford algorithm to compute the shortest path Uses hop count as route metric Upper limit of 16 hops Broadcasts routing updates every 30 seconds Receives routing messages at UDP port 520 Laboratorio di reti - 33 - © 2005 RIPv2 RFC 1388 1993 CIDR patches authentication Laboratorio di reti - 34 - © 2005 Configuring RIP Router(config)# router rip – Enables the RIP routing process Router(config-router)# network network-number – Associates a network with the RIP routing process Optional: Router(config-if)# ip rip triggered to send a triggered update when the network topology changes Laboratorio di reti - 35 - © 2005 Example Laboratorio di reti - 36 - © 2005 ip classless (1) Sometimes a router receives packets destined for an unknown subnet of a network that has directly connected subnets. In order for the Cisco IOS software to forward these packets to the best supernet route possible, use the ip classless global configuration command. A supernet route is a route that covers a greater range of subnets with a single entry. For example, an enterprise uses the entire subnet 10.10.0.0 /16, then a supernet route for 10.10.10.0 /24 would be 10.10.0.0 /16. The ip classless command is enabled by default in Cisco IOS Software Release 11.3 and later. To disable this feature, use the no form of this command. IP classless only affects the operation of the forwarding processes in IOS. IP classless does not affect the way the routing table is built. This is the essence of classful routing. If one part of a major network is known, but the subnet toward which the packet is destined within that major network is unknown, the packet is dropped. Laboratorio di reti - 37 - © 2005 ip classless (2) The most confusing aspect of this rule is that the router only uses the default route if the major network destination does not exist in the routing table. A router by default assumes that all subnets of a directly connected network should be present in the routing table. If a packet is received with an unknown destination address within an unknown subnet of a directly attached network, the router assumes that the subnet does not exist. So the router will drop the packet even if there is a default route. Configuring ip classless on the router resolves this problem by allowing the router to ignore the classful boundaries of the networks in its routing table and simply route to the default route. Laboratorio di reti - 38 - © 2005 Holddown timers The default holddown for RIP is 180 seconds The holddown timer can be decreased to speed up convergence but should be done with caution. The ideal setting would be to set the timer just longer that the longest possible update time for the internetwork To change the holddown timer: Router(config-router)# timers basic update invalid holddown flush [sleeptime] Laboratorio di reti - 39 - © 2005 More commands GAD(config-router)# update-timer seconds configures routing update intervals Laboratorio di reti - 40 - © 2005 Veryfing RIP configuration show ip route show interface interface show ip interface interface show running-config Laboratorio di reti - 41 - © 2005 Troubleshooting RIP update issues One highly effective command for finding RIP update issues is the debug ip rip command. The debug ip rip command displays RIP routing updates as they are sent and received. Other commands to troubleshoot RIP: show ip rip database show ip protocols {summary} show ip route debug ip rip {events} show ip interface brief Laboratorio di reti - 42 - © 2005 RIP load balancing (1) RIP is capable of load balancing over as many as six equal-cost paths, with four paths being default. RIP performs what is referred to as “round robin” load balancing. This means that RIP takes turns forwarding packets over the parallel paths. Laboratorio di reti - 43 - © 2005 RIP load balancing (2) Laboratorio di reti - 44 - © 2005 RIP and static routes (1) A router running RIP can receive a static route/default route via an update from another router running RIP. Another option is for the router to generate the static route/default route itself The administrator can override a static route with dynamic routing information by adjusting the administrative distance values. Each dynamic routing protocol has a default administrative distance (AD). A static route can be defined as less desirable than a dynamically learned route, as long as the AD of the static route is higher than that of the dynamic route. Laboratorio di reti - 45 - © 2005 RIP and static routes (2) Laboratorio di reti - 46 - © 2005 RIP and static routes (3) Static routes that point out an interface will be advertised via the RIP router that owns the static route, and propagated throughout the internetwork. This is because static routes that point to an interface are considered in the routing table to be connected and thus lose their static nature in the update. If a static route is assigned to an interface that is not defined in the RIP process, via a network command, RIP will not advertise the route unless a redistribute static command is specified in the RIP process. When an interface goes down, all static routes pointing out that interface are removed from the IP routing table. Likewise, when the software can no longer find a valid next hop for the address specified in the static route, then the static route is removed from the IP routing table. Laboratorio di reti - 47 - © 2005 Esercizio 2M 5 I router sono tutti configurati con RIP •quale percorso seguono i pacchetti? •come faccio ad obbligare i pacchetti a seguire il percorso GAD, 1, 5? Laboratorio di reti - 48 - © 2005