Sunteți pe pagina 1din 98
Prof. PATTAVINA - Reti di Telecomunicazioni FoOMDAHENT! bi RETI Interconnessione di LAN Interconnessione di AN 1 Sommario m= Livello di interconnessione m= Bridge = Spanning tree Interconnessione dil LAN 2 Interconnessione di LAN Bridge, Router, Gateway + Bridge, Router, Gateway interconnettono reti di diverse: + tipologie (ad es. reti locali e geografiche) * tecnologie (ad es. Ethernet e token-ring) + architetture di rete (ad. es. SNA e TCP/IP) — Tutti estendono una LAN in una X-LAN * | Bridge operano a livello 2 (MAC Bridge) > Layer 2 Switch + hanno algoritmi di instradamento molto semplici (routing isolato) + si utilizzano normalmente per interconnessioni local + | Router operano a livello 3 (IP Datagramm Routing) > Layer 3 Switch + hanno algoritmi di instradamento sofisticati (routing coordinato) + siutilizzano normalmente per interconnessioni geografiche + | Gateway operano a livello 7 > Layer 7 Switch * si utilizzano per interconnettere - a livelio applicativo - architetture di rete diverse (ad es. SNA e TCP/IP) Interconnessione di LAN 3 Interconnessione di LAN Bridge, Router, Gateway Applicazione Presentazione Sessione Trasporto Rete Data Link Bridge —» (Layer 2) Switch | — Fisico Repeater ————_ Hub SS Tendenza evolutiva a(N/O|Rlaloaln Interconnessione di LAN 4 Evoluzione delle LAN = Oggi, l’evoluzione delle LAN é legata a: + ulteriore incremento della necessita (disponibilita ?) di banda: * Dopo Fast Ethernet a 100 Mbit/s e Gigabit Ethernet a 1000 Mb/s > Gigabit Ethernet a 10 Gbit/s + Matrici di commutazione a Terabit per second (Tbit/s) + introduzione di nuove funzionalita: Multicast * Qos Autoconfigurazione + Security Policy Networking Content-based Networking + diminuzione dei costi di produzione: + economie di scala + integrazione hardware Intorconnassione di LAN 5 Evoluzione delle LAN = Oggi, l’evoluzione delle LAN é legata anche all’Internetworking di due o pili reti LAN per crearne una plu grande + Campus Area Network + Metropolitan Area Network + Regional Area Network m Internetworking significa collegare reti con... + dimensioni diverse (LAN e WAN) + tecnologie diverse (Ethernet e Token-Ring) + architetture di rete diverse (SNA e TCP/IP) Imerconnessions di LAN 6 Interconessione Layer n Layer n Switch = Un Internetworking Device (dispositivo di internetworking) * ha due o pit interface + inoltra il traffico ricevuto da una qualsiasi delle interface verso una o pill delle altre interfaccie = Un dispositivo di internetworking di livello n ‘+ implementa uno stack di livello n-1 su ciascuna delle interfacce * @capace di stabilire autonomamente comunicazioni di livello n-1 ‘+ legge e comprende tutte le intestazioni fino al livello n * ricostruisce gli header fino al livello n-1 su tutte le interface d’uscita + basa le proprie decisioni di instradamento sul contenuto dell'intestazione di livello n + pud modificare (leggermente) l'intestazione di livello n Intarconnessione di LAN Interconessione Layer1 7 Applicazione | Applicazione (7 6 Presentazione | Presentazione 6 5 Sessione | __ Sessione 5 4 Trasporo | Trasporto 4 Rete Data Link Fisico 1 Spezzone 1 Spezzone 2 Imerconnessione i LAN Layer 1 m | Repeater interconnettono a livello fisico due 0 pili spezzoni di rete + le funzionalita sono essenzialmente di livello fisico + amplificazione e rigenerazione del segnale; temporizzazione dei segnalis eventuale Fragment Extension (net caso di Ethernet); funzioni di test = Gli Hub sono Repeater multiporta su doppino 10BaseT 225 La banda disponibite (ad esempio 100 Mb/s) é condivisa da tutte te stazioni, che appartengono al ‘medesimo dontinio di collisione Interconnessione di LAN 9 Interconessione Layer 1 ™ Le LAN nascono con topologia logica a bus 0 anello, ma con il cablaggio strutturato adottano topologia fisica a stella/albero * i concentratori (HUB) trasformano: + i bus in stelle nel caso di Ethernet + gli anelli in stelle nel caso di Token Ring e FDD! + Collapsed Backbone + con Ia topologia stellare gerarchica il backbone collassa nel centro stella ‘+ semplicita di gestione + applicabilita a tutte le LAN: Ethernet, TokenRing, FDDI + Fault-Tolerance Percorsoprimario 7) S Petors secondaro — centro stella ridondato y [Concentratore| bob dob db Interconnessione di LAN Interconessione Layer 1 m Un Collision Domain é quella porzione di rete Ethernet CSMA/CD nella quale, se due stazioni trasmettono simultaneamente, le due trame collidono m_ | Repeater e gli Hub NON separano i domini di collisione ‘ ma servono solo a superare le limitazioni fisiche ed elettriche per cid che riguarda l'estensione delle reti locali = Quindi + Spezzoni di rete (al limite due singole stazioni) connessi da Repeater (0 Hub) ‘sono nello sono nello stesso dominio di collisione + Spezzoni di rete (al limite due singole stazioni) connessi da apparati di interconnessione di livello superiore al livello 1 (bridge, switch, router) sono in domini di collisione diversi Interconnessione di LAN " Interconessione Layer2 7 ~~ Appilicazione Applicazione 7 6 = Presentazione Presentazione 6 5 Sessione Sessione 5 Trasporto Bridge o Trasporto 4 4 Layer 2 Switch §=—H——_— 3 Rete moti Rete 3 2 © Datalink —DataLink| DataLink|| Datalink (2 4 Fisico Fisico | Fisico |) Fisico 1 Dominio di collisione 1 Deminio di collisione 2 Interconnessione di LAN. e Interconessione Layer2 1&1 Bridge eseguono (in software) filtering ed eventuale forwarding (sulla porta corretta) delle Trame di L2 (Data Link) tra gli spezzoni LAN a loro connessi © operano a livello 2 hanno algoritmi di instradamento molto semplici «si utilizzano normaimente per interconnessioni locali (non geografiche) * separano i Collision Domains > Banda Dedicata in ogni CD + unico Broadcast Domain mI Layer 2 Switch (0 Switch) sono dei Bridge multiporta che eseguono commutazione (filtering e forwarding) in hardware * velocita di commutazione elevate ‘la terminologia é marketing Interconnessione di LAN 18 Interconessione Layer 2 Bridge: Banda Dedicata sui segmenti Interoonnessione di LAN 4 Interconessione Layer 2 L2 Switch: Banda Dedicata su End-Sys Osgni stazione pud utilizzare tutta la banda disponibile (ad esempio 100 Mb/s) sul collegamento con lo switch. Ogni stazione e la corrispondente porta dello switch formano un dominio di collisione diverso Interconnessione di LAN Interconessione Layer 2 ™ Un Broadcast Domain é quella porzione di rete in cui, se una stazione trasmette una trama all'indirizzo di broadcast MAC (f-ff-f1-ff-ff-ff), tutte le altre stazioni ricevono quella trama mI Bridge ei Layer 2 Switch + separano solo i domini di collisione, + manon quelli di broadcast = Quindi « Spezzoni di rete connessi da Bridge (o Layer 2 Switch) sono nello stesso dominio di broadcast + Spezzoni di rete connessi da apparati di interconnessione di livello superiore al livello 2 (Router e Layer 3 Switch) sono in domini di broadcast diversi Intorconnessione di LAN Interconessione Layer 3 7 Applicazione | Applicazione (7 6 Presentazione Presentazione |§ 5 Sessione Router o Sessione 5 ~——_—__ Layer 3 Switch} ——__—___~- 4 Trasporto rot Trasporto = 4. 3 Rete Rete Rete 3 2 Data Link Data Link) DataLink|! Datalink [2 1 Fisico “Fisica | Fisico | Fsico = |4 Subnet 1 (dominio di broadcast 1) Subnet 2 (dominio di broadcast 2) Interconnessions di LAN 7 Interconessione Layer 3 m =| Router eseguono in software il routing (sull’interfaccia corretta) dei Datagrammi IP (L3 Network) tra le reti a loro interconnesse * Operano a livello 3 + rimuovono lintestazione di livello 2 + esaminano Vintestazione di livello 3 per eseguire I'instradamento + modificano l'intestazione di livello 3 — ads. decrementare il campo TTL, Time To Live, nel caso di pacchetti IP + inseriscono una nuova intestazione di livello 2 « Hanno algoritmi di instradamento sofisticati + Siutilizzano normalmente per interconnessioni geografiche * troppo lenti o troppo costosi per I'interconnessione di reti locali = [Layer 3 Switch sono dei Router multiporta che eseguono routing dei datagrammi IP in hardware « velocita di commutazione elevate + la terminologia é marketing Interconnessione di LAN 18 Interconessione Layer 3 co {it 1® address i} HI IP address 4 “Unnumbered, HP adckess Unnumbered HI IP address R1 MAC address 12-DSAP ‘HI MAC address 12-SSAP R2MAC address &3-DSAP Te (3-SSAP ESS ttois Pacchetto L3 igo, | Intoroonnessione ck LAN 19 Interconessione Layer 4 7 Appliicazione | Applicazione 7 6 Presentazione Layer 4 Switch Presentazione 6 5 Sessione rere a Sessione 5 4° Trasporto TCP/UDP] TCP/UDP|| —frasporto | \4 3 Rete x Rete 3 2 Data Link Data Link] Data Link |) Data Link 2 1 Fisico “Fisico |. Fisico || Fisico 4 Client side Server side Interconnessione di LAN 20 Interconessione Layer 4 ™ Parlare di dispositivo di interconnessione di livello 4 non é propriamente corretto © illivello 4 @ il primo livello completamente end-to-end della pila OSI e dello stack TCP/IP ad oggi, gli unici dispositivi che presentano alcune funzionalita di livello 4 sono i router (0 i layer 3 switch) m I Layer 4 Switch sono dei Router multiporta, che eseguono routing dei datagrammi IP in Hardware, basando le loro decisioni di instradamento sull’osservazione di alcuni campi dell’intestazione di livello 4 + esisteranno solo per la pila TCPAP: modificano il contenuto delle intestazioni di livello 3 e livello 4 * permettono di realizzare politiche di routing (per porta TCP) . Interconnessione di LAN 2 Interconessione Layer 7 Layer 7 Switch 7 Applicazione | Applicazione 7 os jt 4 Trasporto. =| TCP/UDP) TCP/UDP] Trasporto | 4 | = | 3 Rete © Rete : Rete 3 2 Datalink = Data Link) Data Link J Data link 2 4 Fisico | _Fisico | Fisico | Fisico 1 Client side Server side Interoonnessiocee di LAN me Interconessione Layer 7 = Gli Application Gateway eseguono in software delle elaborazioni sul traffico (i pacchetti dati), operando a livello 7 « interconnettono architetture di rete diverse (ad es. SNA e TCP/IP) * sono specifici delle applicazioni e quindi sono complessi, lenti € costosi + Esempio classico: Gateway per la posta elettronica (X.400 / SMTP) m | Layer 7 Switch sono Application Gateway, che eseguono in Hardware delle elaborazioni sul traffico (i pacchetti dati), basando le loro operazioni sulPosservazione di alcuni campi dell’intestazione di livello 7 ‘« filtrano il traffico in funzione degli applicativi ‘* realizzano Statefull-Inspection per garantire QoS agli applicativi che prevedono una fase di segnalazione prima del trasferimento dati fanno load-balancing tra server dello stesso tipo * Sono realizzati in buona parte in hardware e quindi superano le limitazioni prestazionali degli Application Gateway tradizionali + Esempio classico: HTTP Server Load Balancer per server molto carichi . Interconnessione di LAN Interconessione Layer 7 Server Load Balancing Virtual Server™ “ Interconnessione dil LAN 24 Sommario @ Livello di interconnessione = Bridge = Spanning tree Interconnessione di LAN 25 Necessita di interconnessione m Storicamente | limiti LAN erano + Topologici: massimo ritardo e numero di stazioni cllegabili + necesita di avere LAN estese oltre i limiti degli standard e quindi anche con piu sistemi collegabili * Prestazionali: massimo throughput + ridurre le collisioni creando diversi Coll « Tecnologici: standard diversi + necessita di collegare LAN a tecnologie differenti = = Soluzione storica: i Bridge ion Domain Interconnessione di LAN 26 Bridge + Trasmette solo trame che devono transitare da LAN1 a LAN2 ‘+ mantengono separati i traffici interni ai Collision Domain * funzione di filtraggio « Permettono di interconnettere standard diversi * con lo stesso MAC 0 MAC diversi Livetti Livelli ‘Superiori BRIDGE Superiori Interconnessione di LAN ar Bridge Esempio di utilizzo = Transparent Bridge « ambito Ethernet (Standard 802.1D) * sono trasparenti > i sistemi comunicanti tramite T-Bridge ignorano la loro esistenza + hanno proprie tabelle di instradamento + costruite tramite processo di Backward Learning isolato + funziona su topologie ad albero (ricavate con aigoritmo di Spanning Tree) ® Source Route Bridge + ambito Token Ring * non hanno tabelle di instradamento * Ie tabelle vengono mantenute dagli end-system, che specificano a ogni trama la sequenza di bridge da attraversare > il path per linstradamento verso destinazione Interconnessione di LAN 2 Bridge Tre operazioni fondamentali ee e LAN#2 1m Filtering in modalita Store and Forward: . + Px trame Portaa |_| Forwarding | * processing p] LANSt Da * eventualmente Tx = + stato porta * forward, learning, listening, blocking = = Calcolo autonomo delle tabelle di instradamento, tramite processo Backward Learning * realizza il meccanismo di routing isolato = Partecipazione allo Spannig Tree Algorithm * pera risoluzione delle possibili maglie Intorconnessione di LAN 20 Bridge Architettura m= Fisica ROM Epo, * Memorie: ROM (OS) & = —— RAM (tab. Insiradam. + buffer tame) am m= Logica + LLC & MAC Entity Imre Tre] pa et + Ricevee trasmette trame * MAC Relay Imeege Teg |p 2 * filtrae ritrasmette trame * apprende le informazioni di instradamento e filtraggio + Bridge Protocol “t * calcolo e configurazione topologia LAN (algo. Span. Tree) * Bridge Management Interconnessione di LAN 2 Bridge Funzioni | MAC Relay Entity Processo di Bridging Processo di Spanning Tree Bridge Protocol Entity Interconnessione dil LAN 32 Bridge Instradamento = Le tabelle di instradamento hanno entry statiche e dinamiche + Le entry dinamiche sono ricavate e aggiornate tramite un meccanismo di routing isolato - Backward Learning * si basa sull’osservazione degli indiri: MAC sorgenti = Backward Learning * funziona solo su reti con topologia ad albero le topologie magliate sono trasformate in topologie ad albero tramite to Spanning Tree Algorithm Interconnessione di LAN. 33 Bridge Instradamento m= Tabella di Instradamento a + tuple statiche, dinamiche MAC1 Porta2_| Timeout = Backward Learning L_MACS5 Porta 1_| Timeout + solo su entry dinamiche + crea (0 solo aggiorna) una nuova entry dinamica: * quando riceve un pacchetto proveniente da un indirizzo sorgente MAC su una porta in stato learning 0 forwarding se non esiste gia una entry statica per I'indirizzo sorgente + oppure aggiorna sofamente il suo time-out — se esiste gia una entry dinamica per il MAC-Addr. sorgente letto ‘+ quando si raggiunge la capacita massima della tabella di instradamento, la entry pili vecchia viene rimossa Interconnessione di LAN 34 Esempio di filtering database Comando per la visualizzazione del filtering database Switch-1> show cam dynamic * = Static Entry. + = Permanent Entry. Porte switch modulare: alloggiamento del modulo/porta all’interno 00-00-86-1a-a6-44 007 86-2a-a\ del modulo 00-00-c9-10-b3-0f£ 00-00-£8-31-1c-3b 00-00-£8-31-£7-a0 00-01-e7-00-e3-80 00-02-a5-84-a7-a6 00-02-b3-1e-b4-aa 00-02-b3-1e-da-da 00-02-b3-1e-dc-fd Interconnessione di LAN 36 Processo di Bridging: Forwarding Indirizzo di destinazioné presente nel filtering Tl destinatario & sulla LAN di ricezione del pacchetto? Tnoltra il pacchetto su tutte le porte eccetto la porta x “FLOODING” Inoltra il pacchetto sulla porta appropriata Interconnessione di LAN 36 Processo di Bridging: Lear Lindirizzo MAC sorgente contenuto nel pacchetto si trova nel filtering database? ‘Aggiunge lindirizzo MAC nel filtering database, associa la porta di ricezione, azzera 'ageing-time Ta porta di ricezione @ la stessa che é presente nellentrydel filtering database? Aggiorna la porta di ricezione associata all‘indirizzo MAC Interconnessione di LAN 37 Inoltro di trama unknown e popolazione del filtering database Stazione 1 |08-00-2b-16-50-a0 Ageing time 0 [Port | MAC adress 08-00-2b-16-50-a0 Stazione 3 08-00-5a-10-40-e1 Stazione 5 Stazione 4 08-00-2b-c4-e6-aa 08-00-5a-00-00-06 Inverconnessione di LAN 38 Inoltro di trama known e popolazione del filtering database Stazione 2 08-00-2b-20-10-56) Inoltro selettivo solo sulla porta 1 3 | 08-00-2b-c4-e6-aa 0 Port | MAC adress Ageing time 1 | 08-00-2b-16-50-20 5 LANB Stazione 5 08-00-2b-c4-e6-aa Interconnessione di LAN 39 Limitazione del traffico Stazione 2 08-00-2b-20-10-56 Stazione 1 LANC 08-00-2b-16-50-a0 2 Pacchetto scartato 08-00-2b-c4-e6-aa 13 08-00-2b-20-10-56 0 Stazione 3 08-00-5a-10-40-e1 Stazione 5 Stazione 4 08-00-2b-c4-e6-aa 08-00-5a-00-00-06 Interconnessione dil LAN 40 Spostamento Stazione 5 e aggiornamento Stazione 5 G8-00-2b-c4-e6-aa Stazione 1 Stazione 2 }08-00-2b-16-50-a0 08-00-2b-20-10-56 Pacchetto seartato | vort | MAC adress 08-00-2b-16-50-a0) 08-00-2b-c4-e6-2a @8-06-2b-26-10-56| Stazione 4 ‘68-00-Sa-00-00-06 | Interoonnessione di LAN 4a Spostamento Stazione 2 e inoltro errato Stazione 1 b-16-50-a0 Port | MAC ad t Pacchetto per if Stazione 2 ° — inoltrato sulla porta sbagliata } 1 08-00-2b-16-S0-aD- 2 3 08-06-2b-c4-06-aa 08-00-2b-20-10-56| 08-00-5a-10-40-e1 Stazione 3 08-00-Sa-10-40-e1 Stazione 5 Stazione 4 08-00-2b-c4-e6-aa | | 08-00-5a-00-00-06 Stazione 2 08-00-2b-20-10-56 LANC Interconnessione dil LAN Sommario m= Livello di interconnessione = Bridge m= Spanning tree Interconnessione di LAN Spanning Tree Alghoritm = Bridge Backward Learning funziona bene purché la topologia della X-LAN sia ad albero « in presenza di maglie in pochi attimi si bloccano tutti i sistemi connessi alla rete per il fenomeno del broadcast storm + creare un loop pud essere pili semplice di quanto non si creda + 2 sufficiente sbagliare una permutazione in un patch panel e non basta accorgersene subito m II Bridge deve partecipare allo Spanning Tree Algorithm + Per trasformare dinamicamente (periodicamente) la topologia a magiia in un una topologia ad albero + Tutti i bridge devono partecipare (specifiche IEEE 802.1D) « Opera periodicamente (~ ogni secondo) + L’algoritmo opera nei seguenti 3 passi + Root Bridge selection * Root Port selection (one per bridge) * Designated/Blocking Port selection (one per LAN) Interoonnessione di LAN Problemi con i percorsi chiusi Completa saturazione della rete in pochi secondi: broadcast storm Bp=32768 a6) ero Ss 3 2 |g ? LAN2 Bp=32768 00-80-0C-02-10-03 Bp=32768 08-00-2B-51-11-21 LAN 4 Interconnessione dil LAN 45, Soluzione: inare i percorsi chiusi p=32768 =: (er) -00-0C-19-15-04 LAN 7 LAN 2 Bp=32768 B2 _)} 00-00-0C-20-A0-30 Bp=32768 00-00-0C-02-10-03 LAN 5 Bp=32768 08-00-28-51-11-21 Bp=28672 08-00-2B-AA-S0-30 LAN 4 Interconnessione i LAN. 48 Risultato delio Spanning Tree Protocol Bp=28672 “oe 2B-AA-50-30 Designated Port Root Bridge , Port Costo : C= an Designated Port LAN LAN 5 Bp=32768 2 Root Port 00-00-0C-10-15- »(B1) vane a) ' (es 00-00 06-12.10-09 ! . Designated Port Coste 10 LAN1 Root Port | NS Designated Port 1, Root Port 2 TAN 2 Bp=32768 B3 Bp=32768 B2 )o0-00-00-20-A0-30 08-00-2B-51-11-21 51 Costo 10 ST Sesto 10 ' ~— Designated Port {Root Path Cost 20 Root Path Cost 10 1(10 di B1+ 10 di B2) LAN3 a7 Interconnessione di LAN Reti di Telecomunicazioni /P protocol IP protocot 1 Internet = Different kinds of networks have been developed independently one from the others (different makers, protocols, architectures) m= Internet has the task is the interconnection of any kind of network based on arbitrary internal protocols e address mechanism 1P protocol 2 Internet = = Whatis Internet IP protocot 3 Internet = Interworking across networks IP protocol 4 TCP/IP protocol architecture Related protocols = TCP/IP protocol stack Telnet | HTTP| FTP | SMTP] BGP | SNMP| RIP TOP UDP ICMP_| OSPF IP ARP _[RARP Network access Violation of layered architecture principles Trarsprt ayer eel oe] Network layer —— 7 1P protocol Internet Protocoi Functions m= Internet Protocol (IP) + Connectionless network layer protocol used in Internet + Interacts with its user (TCP/UDP) by two primitives: Send, Deliver + Send: IP is instructed on the information delivery requested * Deliver: IP passes to higher layers the information received from the remote host + IP PDU are called IP datagrams: higher layer data + IP header + Delivery of IP datagrams is not guaranteed + Performs datagram routing among networks + Performs error detection and notification + Lifetime guarantee: the IP operates so that the IP datagram is discarded if not delivered by a given time-to-live IP protocol Internet Protocol Addressing = Classfull addressing ‘An Internet address is made of four bytes (32 bits) that define a host’s connection toa network. Class! Type: Netid Hostid 10000000 00001011 a ae 128.11.3.31 00000011 00011111) IP protocol Internet Protocol Classfull addressing = IP address + Includes 32 bit in the form x.y.z.w where xy,Z,w= + Characterizes a node interface not the node itself + Assigned on a worldwide basis = Five classes of IP addresses + A: large nets: network 7 bit (x=1 + B:medium-large nets: network 14 bit (x=128,...,191), host 16 bit + C:many networks of small size: network 21 bit (x=192,...,223), host 8 bit + D: multicast applications (x=224,....289) « E: reserved for future use .40,...255) IP protocol 126), host 24 bit byte 1 1 byte2 ot byte3 ot byed | ‘on 78 i t 3 A Host t 3 Host asia at Host ‘Multicast addross Reserved for future use Class A Chass B Class C Clase D IP addressing = ClassA XK KKK 12K KKK © 1B. XX XK XK 15K KKK 42K KKK = Class B 128,.215.xx% + 129.188.xx.xx © 134.107.xxx © 131.175.x9% = ClassC © 192.5.48.xx © 192.11.0.xx @ 192.11.255.xx Sample addresses IBM AT&T. XEROX HP CAN-INET (Canadian research network) INTEL. MOTOROLA Microsoft CILEA Purdue University Lucent Technologies (AT&T Bell Labs) IP addressing Examples 123.50.16.90 141.14.22.9 123.0.0.0 141,14.0.0 123.70.9.111 141.14.67.80 205.67.71.23 205. IP protoco! IP addressing Special addresses m Network address Netid Hostid Specific All Os 123.50.16.90 123.65.7.34 (@) Class A 141.14.228 o*e 221.45.71.64 221.45.71.126 141.14.45.9 141.14.67.64 221.45.71.20 9 o (b) Class B (©) Class C IP protocol IP addressing Special addresses = Direct broadcast Netid Hostid, Specific All Is 221.45.71.64 221.45.71.126 Class C The direct broadcast address is used by a router to send 4 message to every host on a local network. Every host/router receives and processes the packet with a direct broadcast address, Destination IP address: 221.45.71.255 Hostid: 255 IP protocol IP addressing Special addresses m Limited broadcast Netid and hostid Allis ‘Destination IP address: 258.255.255.255 221.45.71.64 221.45.71.20 Cc] 221.45.71.126 - ‘A limited broadcast address is used by a host to send a packet to every host on the same network, However, the packet is blocked by routers to confice the packet 10 the focal network, IP protoco! 18 IP addressing Special addresses m= Unknown source IP address Netid and hostid All Os Bootstrap server A.host which does not know its IP address uses the IP address 0.0.0.0 as the source address and 255.255.255.255 as the destination address to send a message to a bootstrap server. IP protocol 4 IP addressing Special addresses = Loopback address Netid and hostid 127.X.Y.Z 21.45.7112 ‘A packet with a loopback address ‘will not reach the network. IP protocol Internet Protocol IP addressing «Network numbers assigned by a Network Information Center (NIC) ® Host field subdivided into two fields + Subnet + Host Subnetting simplifies routing implementation Class B address before subnetting o12 78 15.16 2324 31 slo] : : Netid Host-id = Class B address after subnetting 012 78 15162122 31 sae Net-id ubnet-id Host-id IP protocol Internet Protocol IP addressing = Parameter netmask enables the identification of host field + Contains 1 for fields network, subnet, 0 for field host (subnet's 1s need not be adjacent) + Netmask 255.255.252.0 (fffffc00): the host field is denoted by last 10 bit of IP address {® protocol Internet Protocol IP addressing = Aphysical network is identified by a unique IP subnet address 431.175.16.254 aa1a7sa4 = Example — + Three subnets: 191.175.21, 751648) 101.175.16208 soniyea.iae 131.175.16 and 131.175.3 | __ + Router has as many IP addresses as 131.17532 the number of subnets to interconnect 131.178.3.28, 191.175.3.88 1 protocol Internet Protocol IP addressing 134.18,10.88 7538.5. 3 129.8.0.0 222.13.16.40. ‘To the rest of the Internet IP protocol 1° IP addressing Subnetting with netmasks = Example * Class B network 131.175 partitioned into 256 subnets each with 256 addresses « Five subnets shown + Two Ethernets: 131.175.21, 131.175.3 (netmask 255.255.255.0) + One Token ring 131.175.45 (netmask 255.255.255.0) * One point-to-point link: 131.175.7.124 "4178214 1917521, Subnet 200 (netmask 255.255.255.252), Subratat * One generic subnetwork ‘ fan +31.175200284 (131.175.200) for access aiiyseszsq N29 otro 77za to the rest of Internet Two routers cannot be 191.1763253__|-— connected directly: co 19117548200 sdiveoa 2 i at least a subnet soh08178 ee Oo in between onne 191.1759.144 Subnel? 424 [—, Subnet rnazeasan IP protocol 20 IP addressing Private addresses Private addresses: usable by everybody but they are not addressed by the Internet « Three blocks © 1: 10.0.0.0 - 10,255.255.255 — 1 full address block of class A ‘+ Ue 172.16.0.0 -172.31.255.255, — 16 adjacent address blocks of class B + H:192.168.0.0 ~192.168.255.255 — 256 adjacent address blocks of class C 1P protcen 21 IP addressing Subnetworks 4.142.105 mi221 14114220 . 14114796 414.798 a ‘To the rest of Network the Intemet 141.14.0.0 . 41. 14.2.105 o 141.1896 1142.45 Tooth rest of the Internet Site 141.14.0.0 IP addressing Masking Mask N 141.14.0.0 141 - 14] Neid 255.255.0.0 a. Without subnetting [141-14 ‘Net Mask 141.14.2.0 ‘Subnerwork address a acetate acon, IP address 255.255.255.0 1b. With subnetting b. With subnetting IP protocol IP addressing Masking frees [10001101 00001110 09000010 00010101 ] aitiee 10001101 00001110 00000010 00010101 Mask 11111111 11111111 00000000 90000000 141.14.0.0 10001101 90001110 I 00000000 _ 00000000 a. Without subnetting 141.14.2.21 address {10001101 00001110 00000010 00010101 Mask = 11111111 11111111 11111111 00000000 Sitboetsierk 141.14.2.0 ubnetwo: ‘addrese | 10001101 00001110 _ 00000010 b. With subnet IP protoco! 24 IP addre: ig Special addresses Subnetid Hostid ‘Any All 0s Subnetwork address Any All 1s Broadcast to all hosts in a specific subnet All Os Any ‘Subnetid all Os Allis Any Subnetid all 1s 1P protocol 25 IP addressing = Organization with class A address needs at least 1000 subnetworks Example 1 Mask 255.0.0.0 Netid Hostid 7 11111111] 00000000 00000000 60000000 a. Without subnetting Mask 255.255.192.0 ] Netid Subnetid Hostid VNVL1EIL i 1000000 00000000 b. With subnetting IP protocol IP addressing Example 1 Special addresses, Special addresses (hostid all 0s) (hostid all 1s) manner [0.64.0 K.064.1 e¢8 — x.0.127.254 | X.0.127.255 andsubnet [ X.0.128.0 |] X.0.1281 eee x.0.191.254 [ x.0.191.255 . ° . . . . aorandsubnet [7X 255.128.0 ] X.255.128.1 © ee — X.255.191.254 [X.255.191.255 5! ‘Special addresses (subnetid all 1s) IP protocol ar IP addressing Example 1 X.0.128.2 — X.0.191.254 28.1 To the rest of the Internet IP protoco! 2B IP addressing Example 2 m Organization with class B address needs at least 12 subnetworks: Mask 11421112 255.255.0.0 Netid Hostid 11111111 | 00000000 00000000 Mask 255.255.240.0 a, Without subnetting Netid Subnetid Hostid Ailittil 11111111 [£fef0000 _ 00000000 b. With subnetting 1P protocol IP addressing Example 2 Specia) addresses Special addresses (hostid all Os) (hostid all 1s) Special adkiresses (subnetid all Os) X.¥.0.0 X.Y.0.1 eee X.Y15.254_X.¥.15.255 | Ist subnet X.Y.16.1 coe X.Y.31.254 2nd subnet X.¥.32.1 eos X.Y.47.254 X.¥.224.1 eee = X.Y.230.254 X..240.1 . X.Y.255.254 _ X.¥:255.255 ‘Special addresses {subnetid ait 1s) 30 IP protocol To the rest of the Internet IP addressing Example 2 ‘Subnetwork X.¥32.2 X32.) X¥32.0 X.¥47.254 ‘Subnetwork X.¥204.2 X.¥.239.254 IP protocol 3t IP addressing = Organization with class C address needs at least 5 subnetworks 255.255.255.0 | Mask Example 3 Netid Hostid 11111111 ALUMI 11007111 00000000 Mask a. Without subnetting Netid 255.255.255.224 | Subnetid Hostid M1111 11111 d1i1111 b. With subnetting IP protocol IP addressing Example 3 Special addresses Special addresses hostid afl Os hostid all 1s Special addresses subnetid all Os XYZ1 eee X.Y.Z30 1st subnet XYZ33 eee X.Y.Z.62 2nd subnet X.YZ.65 ooo X.Y.Z.94 th subnet X.Y.Z.193 woe xyz [L XVZ225 wee XY Z254 Special addresses subnetid all 1s {P protocol = IP addressing Example 3 To the rest of the Internet ‘Subaetwork XYZ X¥Z193 jm IP protocol IP addressing Variable length subnetting aE oe 255.255.255.192 t—__| Router IP protocol 5 IP addressing Supermetwork First class C address Second class C address XY32.254 X.¥33.1 To the rest of the Internet Supernetwork X.Y.32.0 X.¥.35.254 eo. et x. : X.¥35.253" ° °° x.¥342 : XY35.1 X.¥34.254 Fourth class C address Third class C address IP protoco! 36 IP addressing Supemet mask Netid Hostid Wu 1411111 11411111 [00000000 Netid 4y Subnetid Hostid wii W111 TWLTAL a. Subneting 4 subnets out of Tnetwork, Netid Hostid UNI til ADL 00000000 Supernetid ¥ Hostid 11111111 11111111" 11111 Joo 00000000 'b Supernetting 1 supernet out of 4 networks 1P protocot a7 IP addressing Supernetwork m Range of addresses in a supernet is identified by « Lowest address and supernet mask or + Lowest address and number of addresses in the range X.¥320_, 1024 « Example X.Y.334 X.Y.39.12 XXAXXKAK _yyyyyyyy 00100001 00000100] [xxxxxxxx__yyyyyyyy 00100111 _ 00001100 TIL11111 LELL1E1L 11111100 00000000 111111 11111111 1111J108 — 00000000 XXXXXXxX _yyyyVyY 00100000 00000000} [xxxxxxxx__yyyyyyyy 00100100 00000000) X¥320 X.Y360 1 protocol 38 IP addressing Supernetwork m= Reduction of table entries using supernet mask Default Network Next hop mask address address 255.255.255.0 | X.¥.32.0] 255.255.255.0 | X.Y.33.0] 255.255.255.0 | X.¥.34.0] 255.255.255.0 | X.Y¥.35.0] a. Routing table without supernet mask Default Network Next hop mask address _ address 255.255.252.0 | X.¥.32.0} ; : | b. Routing table with supernet mask 1P protoeol 38 IP addressing Classless addressing w Classless Inter-Domain Routing (CIDR) + Gives flexibility in allocating unassigned IP addresses + Granularity is not restricted to that of classes A, B or + xy.z.w/n means that a set of adjacent addresses is allocated with + First address: x.y.2.w + 232-n addresses in total + Example: 134.76.96.0/19 means 8192 adjacent network addresses from 134.76.96.0 * Routing by longest prefix match m Private addresses expressed in CIDR notation + £10.0.0.08 172.16.0.012 + MM: 192,168.0.0/16 m= Subnetting can be used as well with CIDR addressing IP protocol 40 Internet Protocol IP Datagram 20.6536 byt08 20-60 bytes VER | HLEN | Service ype “Tota length avis | atic Bits Tobie Ieensiicaton Flags] Fragmentation offset Te bie 3s ‘Time to live Proocot Header checksum B bits Sits 16 bits Source IP address Destination IP address IP protocol 4 Internet Protocol! IP Datagram m Header format « Version: IP protocol version (now 4) + HLEN: length of header in units of 32 bit + Service type: as requested by higher layer protocol (e.g. priority) Total length: IP datagram total length in bytes (including data) Identification: identifies fragments of a unique IP datagram —p. po not fragment + Flags (only two bits defined) M: More fragments * More flag: other fragments are expected + Do not fragment flag . vet oa 8 ww 4 a + Fragment offset: offset oor] muew|type aiseriee] _Tauliongh ' of the fragment in identification Flags Fragment offset 2 muitiples of 8 bytes oe eee Trenatace |? yey D: Minimize delay R: Maximize reliability ‘Sones IP aasrone 4 aie T. Maximize theoughpot_€:Micimize cost Som stds T [o[ti Ric Precedence TOS bits Options ae passing IP protocol 42 Internet Protocol IP Datagram m= Header format (cont.) + Time to live: counter enabling discard of "lost" IP datagrams + Protocol: higher layer protocol used to fill data field « Header checksum: protection for datagram header « Source and destination address: IP source and destination * Options + Security * Source routing — Strict: complete path 7 ~ Loose: partial set o 4 8 1619 24 31 * Record route fersion| HLEN [Type of service Total length 2 + Timestamp: time of Identiicason Face Fragmentotoer | 2 router crossing Time To tive] Protocol Header checksum ar + Padding to fill units of Source P acess 4 sai 32 bit for the header Destination IP aderess ae ‘Qotions = Pacding IP protocol 2 Internet Protocol Features = Maximum length of !P datagram (header + payload): 65535 byte = Time-to-live in the header specifies the maximum lifetime of the IP datagram + Measurements in time units requires global Internet timekeeping + Maximum value: 255 s * Decreased one or more time in each router + Inpractice a count of the maximum number of hops is used + Each router decrements the current value by one unit * IP datagram discarded if its time-to-live counter goes down to zero IP protocol “4 Internet Protocol Fragmentation and reassembly | Oftset = 0000/8 = 0 1,399 Offset = 0000/8 = 0 | Offset = 1,400/8 = 175 2,799 Byte 0000 Byte 3,999 Offset = 2,800/8 = 350 2,800 3,999 Internet Protocol Fragmentation and reassembly Ta00) 00 TEST Fragment 2.2 a. Bytes 0000-3,999 275 Original datagram Fragment 2.1 Fragment 3 { protoool 43 Internet Protocol Fragmentation and reassembly a IP splits too tong datagrams into several fragments * Anew IP header, derived from the original one, is added to each fragment + Each fragment is treated as an independent IP datagram and delivered autonomously to the destination + Fragment out-of-sequence and loss may occur m= Reassembly takes place at the destination based on + Identification of all the fragments of an IP datagram (unique identification number) + Fragment numbering ‘+ More Flag = 0 in the last fragment, 1 in all the other fragments * Offset Field = distance in number of 64 bit units from the first bit of the datagram + Timer associated to the reassembly process (fragment losses may occur) + All received fragments discarded if at least one fragment is missing by the timer expiration IF protocol Internet Protocol Fragmentation and reassembly = IP datagram is transported by a frame * Amaximum transfer unit for the frame may apply that can require IP datgram fragmentation + IP datagram reassembly required at destination M Maximum length of data that can be encapsulated in a frame Frame IP protocol Internet Protocol Control! protocols = Control protocols in addition to IP used to transport data + Intemet Control Message Protocol (ICMP): RFC 792 ‘+ Transfers messages from routers/hosts to hosts + ICMP messages are carried by IP datagrams + Address Resolution Protocol (ARP): RFC 826 + Used by a station to map a layer 3 address to a layer 2 address + Reverse Address Resolution Protocol (RARP): RFC 903 + Used by diskless stations to discover their IP address + BOOTP: RFC 951 + Used by a station to get the basic iP numbers (address, mask, etc.) * Dynamic Host Configuration Protocol (DHCP): RFC 2131 * Same as BOOTP with dynamic address handling IP protocol 49 Internet Protocol ICMP message types Control protocols + Destinaton unreachable: may be = returned o . 1 x * By arouter due to ae Coes Cressi ‘ “roe depenier ala — Host unreachability = Conflict on Don't fragment Presser se request sorts + By the destination host due to = Higher layer user (port) ‘byes rigal stag unreachable Destination unreachable, time exceeded, perameter problem, + Time exceeded: may be returned source quench, redirect + By a router (lifetime exceeded) + By the destination host (reassembly not completed by time limit) + Parameter problem: illegal value in header + Source quench: request by router/destination host to source to reduce its rate due to congestion + Redirect: sent by a router to the source host to notify a wrong routing and suggest a better one, whose IP address is inserted in 2nd word of message 1 protoco! 50 Internet Protocol Control! protocols = ICMP message types (cont.) 0 a 6 x + Timestamp request sent to gate | eeonenmer |. ask for timestamping apna tineciamo mans information 7 + Timestamp reply: carries back woes arrival time of request and ° . “ n departure time of reply Te, ‘code ‘Checksum 1 * ~~ using source routing the cent Sequence number 2 ot delay characteristics of a |}__sssesonsnns ds ie tmestanp ‘ network can be measured “Transmit mestamp s ‘Timestamp reply IP protocol 31 Internet Protocol Control protocols = ICMP message types (cont.) * Address mask request: the Bit host requests the address © 8 6 He mask to be used ee | oe — 1 ti + Address mask reply: the router provides upon request the address mask for the host ‘Address mask request, echo, echo reply A 1 x + Echo request: sent to check if Type Code fot a destination is alive sent Sees unter | + 244 rats mask 3 + Echo reply: answer to echo request ‘Aadeess mask reply IP protec 52 Internet Protocol Control protocols m Address Resolution Protocol (ARP): RFC 826 + Used by a station to map a layer 3 address (IP) to a layer 2 address (typically Ethemet) + Requesting station broadcasts an ARP packet onto its network + Addressed station with that IP address responds with its layer 2 address m ARP cache + Host keeps a cache of recently used (or “seen”) address mappings + Anew host broadcasts its address mapping IP protocol Control Protocols ARP a ARP packet format Hardware Type Protocol Type Hardware Protocol Operation length iength Request 1. Reply 2 Sender hardware address (For example, 6 bytes for Ethernet) ‘Sender protocol address (For exumple, 4 bytes for IP) “Target hardware address (For example, 6 bytes for Ethernet) (tis not filled in a request) Target protocol address (For example, 4 bytes for IP) IP protocol Control Protocols ARP {Lam looking for the physical address of a node whose IP address is: 141.23.56.23, System A, System B a, ARP request is broadcast ‘am the node you are jooking for and my physical address is: AAGER4598343 System A SaenB b. ARP reply is unicast 1P protocet z Control Protocols ARP = Encapsulation of ARP packet ARP request or reply packet Type: 0x0806 Preamble Destination Source and SFD address address _["¥P*| Data crc Bhytes, Gbytes Gbyes Dbyes a byes IP protocol 56 Control Protocols ARP ‘Target IP address: Destination address in the IP datagram Sender Receiver Host Case 1. A host has a packet to send to another host on the same network. ‘Target IP address: IP address of the default router ‘Sender Hos] Receiver IP protocol s7 Control Protocols ARP “Target IP address: TP address of the appropriate router found ia the routing table Sender lis Router Receiver [SS] Router Case 3. A router receives a packet to be sent to host on another network. i must first be delivered to the appropriate router. ‘Target IP address Destination address in the [P datagram, ‘Sender Router Receiver eee Case 4, A romter receives a packet to be sent to a host on the same network, 1 protocol 58 Control Protocols ARP m Proxy ARP 141.23.56.21 141.23.56.22 141.23.56.23 ‘The proxy ARP router replies to any ARP request received for destinations 141.23.56.21, 141.23.56.22, and 141.23.56.23. Proxy ARP router IP protocol 89 Internet Protocol Control protocols m Reverse ARP (RARP): RFC 903 + Used by diskless stations to discover their IP address + Aswith ARP, a RARP request is broadcasted over the subnetwork + ARARP server is needed in each network + With multiple RARP servers, collisions are avoided + By random delaying answers + By having primary server answer only to 1st request, secondary server respond only to 2nd repeated request, etc. IP protocol 60 Control Protocols RARP. m_ RARP packet format Hardware type Protocol type Hardware Protocol Operation length Iength Request 5. Reply 4 Sender hardware address. (Forexampl. 6 byte for Ethernet) (yceers t ‘Sender protocol address (Forerample. 4 bytes for IP) (Geis not fied for request) Target hardware address (For example, 6 bytes for Ethernet) tis not filled for request) ‘Target protocol address (For example, 4 bytes for IP) LL ‘tis not filled for request) 1 protocol et Control Protocols RARP ‘My physical address is A4GEA4578236. Lam ooking for my IP address. a. RARP request is broadcast Your JP address is: 141.1456.21 b. RARP reply is unicast 1P protocol 62 Control Protocols RARP = Encapsulation of RARP packet RARP request or reply packet Type: 0x8035 a Preamble] Destination | Source es Pace | fee] ow exe Bytes Sbyes Gbyex 2byes ayer 1P protocol Internet Protocol Example of operations Interaction between users in systems A and B An address identifies a station-to-network connection : IA for A, IB for B A instructs its local IP to send data to IB IP layer in A . + Determines routing for address IB (indirect), which requires Ethernet network + Finds MAC layer address to be used in A as destination (look-up table or ARP) + * Passes the IP datagram to MAC layer providing MAC layer address just found MAC layer in A sends a CSMAICD frame carrying IP datagram Ter layers Deer TOP. oe To? r = = us map| ue us Mac war fe By ya yaa A - fe go AP protocol ont Network 2 Network 3 Internet Protocol Example of operations m= Interaction between users in systems A and B (cont.) + MAC layer in R, * Strips MAC header/trailer and delivers the IP datagram to the IP layer IP layer in the router R, * Determines routing for address IB (indirect), which requires network X25 + Modifies slightly the IP datagram header * Transfers datagram using X.25 PLP and LAP-B protocols J _______{ir = = _+—{_» _}+—[_ ae feared mr[ ue -}—{ us LL ac fears tne func > —-[ un | —-frrseabrvecal»—-Byscomsca—{ Pras paieas Network 1 Network 2 Neto 3 Po Internet Protocol Example of operations Interaction between users in systems A and B (cont.) + IP layer in the router R, * Determines routing for address 1B (direct), which requires the token ring network * Modifies slightly the /P datagram header + Determines the destination MAC layer address: now it is the station B MAC layer address * Passes the IP datagram to MAC layer in the router for its transmission por layers ue MAC Poel Network 1 Network 2 Network 3 e internet Protocol Example of operations m Interaction between users in systems A and B (cont.) + MAC layer inB + Receives the frame and strips header and trailer * Passes the IP datagram to the higher layer « IP layer inB + Passes the IP payload to addressed destination TCP port mp] uc ac | MAC pyscal prysical IP protocol 67 Internet addressing NAT. Tabella di waduzione NAT Lato WAN Lato LAN, 138.76.29.7, 5001 | 10.00. 00.1, 3345 _ oye a oa = Network Address Translation table (RFC2663, RFC 3022) , « Enables saving of Internet addresses: * One IP address can support up to 2" simultaneous communications + Exploits the port number to identify the “connection” « Does not enable “peer-to-peer” connections tor incoming connections (a non-private IP numbers is always needed) IP protoco! Internet Protocol IPv6 @ Limitations of IPv4 + Inefficient two-level address structure (address space sparsely used in a subnet) + Unique net number assigned to each IP network whether used or not « Numbering scheme cannot accommodate fast growing network number = IETF defined IPvé6 in the frame of the definition of IPng (RFC 1752 - The recommendation for the IP next generation protocol) of 1995. RFC 1883 (1995) updated by « RFC 2460 (1998) m= =IPv6 enhancements + Extended address space: 128 bit addresses + Improved option mechanism: additional fields between IPv6 header and TPDU + Address autoconfiguration: dynamic assignment of IPv6 addresses + Support for resource allocation: definition of flows + Security: features to support authentication ad privacy supported 1P protocol 69 Internet Protocol IPv6 Packet m= Header format * Version: IP protocol version (next: 6) « Traffic class: identifies traffic types + Flow label: used to request special handling by routers + Payload length: length of variable part * : ; 4 ni x x of IP datagram, i.e. extension header’ ta ae 1 and TPDU Payload wrgth Neheader | Hop amit | 2 + Next header: identifies the type of : header immediately following the IP\ Some 1 aress : header ow © Hop limit: remaining number of 7 ete routers to be crossed before DestnatonPaderess : discard » + Source address Eanson eases a + Destination address m No header checksum is supported IP protocol 70 Internet Protocol IPV6 Packet = Extension headers . . * Hop-by-hop options header: requests for special hop-by-hop IP packet processing Routing header: extended routing capability (similar to |Pv4 source routing) Fragment header: fragmentation and reassembly information * Contains identification, fragment offset and more fragments bit, as with IPv4 + Fragmentation enabled only to source hosts Authentication header: provides packet integrity and authentication Encapsulating security payload header: provides privacy Destination options header: optional information for the destination node Optional rs 1Pv6_ | Extension Extension re header ~ header Rou IP protocol 7m Reti di Telecomunicazioni Routing in Internet Routing in Intervet 1 Internet Protocol Routing = Routing protocois defines an algorithm to select the path + Ametric and a metric weighting to label the inter-router path + The transfer mode (type, content, frequency) of the update information = Possible routing metrics + Delay + Hop count + Bandwidth/Carried load * Reliability = Routing types « Direct + Destination and source host net-id are the same + Subnetwork mask used ¢ Indirect + Destination and source host net-id are different + Host determines which subnetwork and which router to use outing in ntenrot 2 Internet Protocol Routing = Direct routing Direct delivery To the rest of the Internet Routes Routing in itonret Internet Protocol Routing = Indirect routing Indirect delivery Indirect detivery pa (destination) Direct detivery Routing in Intervet Routing Next hop routing outing table for host 8 Routing able for RI Routing table for R2 Destination] Route ei| Route Destination] Rowe | Hos B | Ri,R2, Host B Host | _R2. How Hox B Hoss} ints ‘a. Routing tables based on route Hoa B Routing tble for host A Routing table for R) Rating table for RZ Destination] Next Hop [ Destination] Next Hop. | Destination] Next Hop } Host B Ri | (fost B R2 Host B =} ' Routing tabfes based on next hop outing in irterrat 5 Routing Network specific routing Routing table for host § based on host-specific routing [Destination Routing table for host $ based on network-specific routing Destination] Next Hop N2 RI outing in Intent 6 Routing Host specific routing Routing table for host A Destination | Next Hop Host B N2 NB Routing in Intonret Routing Default routing Routing table for host A Destination | Next Hop N2 RI Routing in intencet Routing Routing table ‘Mask Destination | Next-hop Flags Reference Use Taterface address address count 124.0.0.0 145.6.7.23 UG 4 20 m2 = Flags + U (Up): destination is up and running « G (Gateway): destination is another network « H (Host): destination is a host « D (Redirection): entry added by an ICMP redirection message ¢ M (Modified): entry modified by an ICMP redirection message = Ref count: number of users of that entry at any moment m= Use: number of packets transmitted for the specified destination outing in intenret 8 Internet Protocol Routing = Autonomous system * Set of subnetworks connected by homogeneous routers with possibly a unique administrative entity (typically within a unique administrative domain) = Routing protocols + Interior Gateway Protocols (IGP) + Routing Information Protocol (RIP) + Open Shortest Path First (OSPF) + Exterior Gateway Protocols (EGP) + Border Gateway Protocol (BGP) Routing in intenret Interior Gateway Protocols RIP = Routing Information Protocol (RIP) Relies on UDP transport protocol (well known port 520) + Based on distance-vector routing * Bellman-Ford algorithm to compute the shortest path + Distance metric: hop count Max distance: 16 hops ¢ Routing broadcast updates every 30s a Pros « Easy implementation m= Cons * High complexity: O(n?)-O(n?) « Routing loops ¢ Slow convergence (count-to-infinity) outing in ntenet " RIP Slow convergence m It takes an average of 15 s to update the immediate neighbour 0 seconds 15 seconds nX 15. seconds = To limit the slow convergence, the maximum diameter of an AS is 15 (16 means destination unreachable) | Total hop count should be less than 16 | Peising in ntenret 2 RIP Count-to-infinity Routing table Routing table D-DD Routing table Roating table oR o SS Routing in intonrat 13 RIP Upgrades m Triggered update + Upon a distance change, the new routing table is sent immediately without waiting for the expiration of 30 s interval m= Split horizon RIP messages RIP messages 4] Nel ti? @elne a [St ib RIP messages Nett i6 | | Net? 16 Interior Gateway Protocols OSPF Open Shortest Path First: RFC 1583; v2 RFC 2328 (replacing RFC 2178) OSPF messages carried as payload of IP packets Link state routing algorithm + Adopts shortest path routing (Dijkstra algorithm) + Distance metric: any (delay, cost, data rate, ete.) configurable by system administrator « Each node computes the minimum spanning tree m= Connection types and networks supported « Point-to-point lines Multiaccess networks with broadcasting (most LANs) or without broadcasting (most WANs) = Routing table updates « Periodically: link state packets are broadcasted by a router to signal up/down condition of outgoing links and their current cost + Non-periodically: due to link state variation outing n intent 15 Interior Gateway Protocols OSPF (cont.) = Open Shortest Path First: other features © Type of service routing Dynamic load balancing by using multiple routes if routes have same length (given metric) * Authentication « ‘na multiaccess LAN, only one router (designated router) broadcasts routing information after agreement with other routers Routing in Intonrot 16 Interior Gateway Protocols OSPF = A large Autonomous System can be split into numbered Areas of smaller size « Routers inside an area flood the area with their routing information « Border routers summarize the area routing information and forward to other areas « Inan AS one area is the “backbone” and their routers are backbone routers « Each area has an identification in the AS (the backbone has ID=0) Autonomous system outing in Intencet 7 outing in Intonrot 18 OSPF Example m= Network tree as seen by router R, and corresponding routing table Na |Destination.| Next hop Ny LBs Ne | Pe Ny 7 Je Roa NS Bs jo Ne | Re 3 HRs 7 He Rs 7 Ha RL? Hy Re 4 Routing in iatenret Exterior Gateway Protocols BGP = Border Gateway Protocol version 4 (BGP-4): RFC 1771 + Means to allow router in different AS to exchange information + Protocol based on messages transported by TCP messages, using well known port 179 Uses a path vector algorithm Each routing table entry contains + Destination network + Next router + Path to reach the destination, i.e. the series of ASs to cross Count-to-infinity and routing loops not occurring, since the paths are specified by means of all the routers crossed + Message types + Open: to activate neighborhood + Update: to update routing information on reachable networks + Notification: to notify procedure errors + Keepalive: to signal router activity in absence of updates . Routing in intenrat Exterior Gateway Protocols BGP = Border Gateway Protocol version 4 (cont.) + Three functional procedures * Neighbor acquisition — One router sends Opento another, specifying AS ID, hold time, authentication — The other router, accepting, responds with Keepalive * Neighbor reachability — Used by routers to maintain neighboring — The two routers periodically issue Keepalive before expiration of Hold time + Network reachability — Each souter maintains a db of reachable subnets and the preferred route to each of them — Upon changing in the db, a router broadcasts Update to all neighbor BGP routers outing in ntenret 2 Exterior Gateway Protocols BGP = Example AS2 . L Ni_R2_AS2, ASI Ni_R3_AS3,AS2, ASI AS3 Flouting in Intenret 22 Exterior Gateway Protocols BGP m= The worldwide network consists of BGP routers (a subset of all network routers) and "links" between them w Routing table construction/update * Initially two routers exchange the entire BGP routing table + Incremental updates sent out as the routing tables change + BGP does not require a periodic refresh of the entire routing table = BGP update message consists of Withdrawn networks + New reachable networks, each specified by * Destination network * AS path vector (sequence of ID of crossed ASs) + IP address of next hop router for the path = Routing table content * BGP maintains a routing table with all feasible paths, but advertises only primary path + BGP metric is an arbitrary unit, assigned by network administrator ‘Routing in Intenret Exterior Gateway Protocols BGP ™ Routes to F received by node B C « A-E-D-F from A + D-F from D ee + C-D-F from C 6 — path: B-D-F = Upon failure of node D and expiration of hold time + AB-C-G-F from A et + C-G-F from F ~ path: B-C-G-F >. outing in intenret Reti di Telecomunicazioni Protocolli di trasporto ‘Transport protoco's 1 Protocolli di trasporto Funzione = Svolgono funzione di collegamento logico piti che fisico om (cep Fate ef

8.105 10101011 09000010 ——> 171.2 0000111 1010 ——> 14.10 A5aS8i08 00000000 00010001 ——* 0 and 17 171.2.14.10 99000000 00001111 ——+ 15 7 0000100 00111111 ——> 108° AME Gs |e 13 99090900 90001101 ——» 13 1087 13 99000900 99002113, ——=» tects) 00001 9 —> oe ecksum 15 All 0s 01010100 01000101 ——> T an: OrooOTT Oloro100 ——> § and 91001001 01001110 ——* Land N 01000111 00000000 ———+ G and 0 (padding) 10010110 11101011 ——+ Sum 01101001 00010100 ———> Checksum ‘Transport protocols S UDP Esempio di trasferimento dati Daytime Daytime client server Tranepor protocols 16 UDP Esempio di trasferimento dati my w oy IP header 193.19.26.7 ‘Transpo protocols 7 Protocoili di trasporto TCP Application layer Transport Sayer Network layer Data tink layer Underlying LAN or WAN technology Physical layer Transport profocals 18 Protocolli TELNET (Client) Transport protocols 19 TCP Formato del segmento 32 bit ‘Transport protocols 20 TCP Formato def segmento ™ Unico formato di pacchetto per tutte le PDU del TCP. = TCP header * Porta sorgente/porta destinazione: processi sorgente e destinazione il cui indirizzo IP @ contenuto nel pacchetto IP + Alcuni numert di porta sono predefiniti (well-known ports) « Numero di sequenza (32 bit) utilizzato per ack end-to-end + Indica il numero progressivo del primo byte del campo dati * Numero iniziale di sequenza definito per ogni direzione « Numero di riscontro: x = successivo byte atteso. (si possono inviare ACK cumuiativi} « Finestra: implementa una finestra ad apertura variabile + Valore del credito di trasmissione y (numero di bytes) assegnato al TCP remoto dopo l’ACK corrente (da x a x+y-1) ‘Transport protocols 21 TCP Formato del segmento = TGP header (cont) + Cade bits + URG: sono presenti dati urgenti, come specificato dat puntatore URG * ACK: numero di ack valido (ACK=1) o ignora numero di ack (ACK=0) + PSH: ordine al TCP remoto di consegnare i dati TCP memorizzati senza tenere conto deffo stato det buffer di ricezione RST: indicazione dj resettare la connessione o Indicazione di messaggio REJ con numero di ack che indica il messaggio rigettato ‘SYN: utilizzato per instaurare una connessione; insieme al bit ACK distingue tra Connection request (ACK=0) e Connection accepted (ACK=1) + FIN: usato per richiedere Ia fine di una connessione TCP Transport proforots 22 TCP Formato de! segmento = TCP header (cont.) + Checksum * Protege da consegna errata da parte di IP * Verifica TCP header + TCP data + pseudoheader (IP source, IP destination, TCP prot. number, byte count for TCP segment) ‘+ Urgent pointer: offset (bytes) dal numero di sequenza corrente dove terminano i dati urgenti + Options: si pus specificare la dimensione massima del segmento + Padding: garantisce che il TCP header & multiplo di 32 bit Transport protoco's TCP Pseudoheader ‘32-bit source TP address 32-bit destination IP address ito [PRET 6 i TCP otal eng Source pot Destination pr 7 ‘Sequence number a) Aeknomkdgnen arte 7 HLEN | Reserved Control Window size ‘Urgent pointer Checksum Data and Option re et ee eee eee) 28 Transport protocols TCP Encapsulation = Il messaggio dell’applicazione pud essere frammentato in pit segmenti TCP Transport protocols 2 TCP Frammentazione = Maximum Segment Size (MSS) Quantita massima di dati che trova posto in un segmento TCP. « Dipende dall’implementazione TCP * Tipici vatori di configurazione: 1500 byte, 536 byte, 512 byte = Numero di sequenza di un segmento: numero del primo byte nel segmento m= Esempio di trasferimento di 500 000 byte con MSS=1800 byte File ve Dati peril primosegmento Dati per il seconde segmento | —__1_____, J — 1.—— 1 | [ 4 Se eof O00: )eeas |e 1999; A 499.999 ‘Transport protocols 28 TCP Gestione della connessione = Connessione TCP identificata univocamente da 4 numeri (2 socket) + 2numeri di porta TCP * 2indirizzi IP = Connessione TCP instaurata per mezzo del “three-way handshake” + Sipossono verificare collisioni (full duplex operation) * Siinstaura una sola connessione se gli end-point sono gli stessi II rilascio pud essere iniziato da una qualunque delle due entita TCP + Attuato mediante two-way handshake iniziato da entrambe le estremita + Bit FIN bit alto in una direzione e bit ACK alto nell'altra direzione e viceversa “Transpon protocols a TCP Gestione della connessione B SYN, ACK, SNe=y, AN=X+1 A B SNex+1, ANey+1 om sn-x El SYN SN=y SYN, ACK ‘SN=y, AN=x+1 20 ‘Transport protocols Gestione detla connessione Esempio Sender Receiver Segment 1: SYN Segment 3: ACK 89: 1201, ack: 4801 + Time ‘Time “Tranepon proeook 29 Gestione della connessione Esempio ‘Sender Receiver Time ‘Time Transpor protacols x TCP Sequenza di stati tato server L'applicazione del server i er at di ascol Riceve ACK, non. £2 un sock scolto invia alcun oggetto LAST _ACK 4 TEN” ast) EISTEN | - Riceve SYN Invia FIN invia SYN & AK Riceve FIN, invia ACK Riceve ACK, non invia alcun oggetto Transport protocols a TCP Sequenza di stati lato client plicazione dient inizia una connessione TCP Attende 30 secondi Invia SYN TIME_WAIT. Riceve FIN, Riceve SYN & ACK, invia ACK invia ACK Sin wart 2 LISHED Invia FIN Riceve ACK, arene non invia alcun FO_WAIT.1 Tapplicazione client oagetto inizia a chiudere la connessione Transport pratocols 32 TCP Esempio con applicazione Telnet Host A Host B Lutente digita "c ACK del'host per ricevuta giver di torn T Tempo “Transport protocols TCP Esempio Host A mp Host B m= Riscontro perso eB a Seg=92 : ee Timeout 3 : ipereoh : Se, : 4 92 7 8 i Pete aaey i pceen08 ¥ + Tempo Tempo ‘Transport protocols, TCP Esempio Host A Host 6 = Il segmento 100 non viene ritrasmesso peq92 timeout interval sequs2 timeout interval “Transport protocols 35 Il riscontro cumulativo evita la ritrasmissione del primo segmento Seq-92 timeout interval ‘Transport protocols 36. TCP Nomenclatura m Dal livello di collegamento dati al livello di trasporto + Trama— segmento * Tempo di propagazione 2t —> Round trip time (RTT) * Errore di trama — perdita di segmento/riscontro * Numerazione trame + numerazione byte del segmento m= Natura del protocollo TCP + Ritrasmissione basata su scadenza del timeout * Riscontri (positivi) umulativi come nel Go-back-N + Segmenti ricevuti fuori sequenza possono essere memorizzati e non scartati, come nel Selective Repeat + Proposta modifica (RFC2881) che prevede it riscontro selettivo anche fuori sequenza = Misto dei due protocolli GBN e SR Transport protocols 37 TCP Stima di RTT a RTT deve essere stimato per impostare il timeout RTT misurato per un segmento (RTT,,,,) al ricevimento det rispettive riscontro con frequenza uguale a RTT stesso « Nonsi valuta RTT per i segmenti che vengono ritrasmessi = Stima corrente data da RTT sp = (1 @)RTT es + &- RITigse = Stima della variabilita di RTT RIT gop = (1- BRT Tey + B-|RTTiast ~ RTTest| Valore tipico o=0.125, B=0.25 Timeout Teury = RTTo51 + 4-RTT dey “Transpon protocots 98 TCP Stima di RTT 350 € oso RTT campionato 3 = E 2 \ RTT stimato 150 9,0} py 1 8 15 22 29 36 43 50 57 64 71 78 85 92 98 106 Tempo (secondi) “Transport protocots 29 TCP Caratteristiche = Timeout utilizzato come meccanismo di controllo di congestione + Raddoppiato ad ogni ritrasmissione algoritmo di Karn) + Resettato al valore TO,.,,alla ricezione del riscontro positive & Modifica rispetto ai protocolli di linea: ritrasmissione veloce + Ritrasmissione di un segmento alla ricezione di ack duplicati senza attendere la scadenza del timeout * 3.ack duplicati sono interpretati come perdita di un segmento (NACK implicito) ‘Transport protocols TCP Controllo di flusso I ricevitore controlla il fiusso mediante la finestra di ricezione + Condizione di non-saturazione LastByteRevd — Lastbyte Read < RevBuffer « Valore corrente della finestra di ricezione RevWindow = RevBuffer —(LastByteRcvd — LastByteRead) « Condizione rispettata in trasmissione LastByteSent ~ LastByteAcked < RevWindow Receiver buffer FromIP > i aaa A Receiver window “Transport protoco’s TCP Controlio della congestione m= End-to-end + Larete non fomisce alcun contributo + Derivato dall’osservazione del flusso di pacchetti = Assistito dalla rete + | router forniscono informazioni esplicite sullo stato dei buffer Host 8 oe Host A. Si Feedback di rete via receiver Feedback diretto dalla rete wat, 3st Transport TCP Controllo della congestione ™ Variabile che consente il controlic della congestione: Finestra di congestione=massima quantita di dati inviati ma non ancora riscontrati m= = Meccanismo LastByteSent — LastByteAcked < min(CongWin, RevWindow) m= CongWin determinate in base a © Ack duplicato (3 volte) « Timeout = Algoritmo di controllo di congestione basato su + Incremento additivo + Per ogni ack ricevuto CongWin aumenta di un MSS ogni tempo di RTT + Decremento mottiplicativo + CongWin dimezzato ad ogni perdita di pacchetto per ack duplicato « Reazione a eventi di timeout * CongWin resetiata al valore iniziale Transport protocols 3 TCP Controlio della congestione m= SSThreshold separa le regione di slow start e di congestion avoidance + SSThreshoid iniziale= 65 KByte + Dopo una perdita: SSThreshold=max(2,CongWin/2) m= Slow start: aumento esponenziale + All‘inizio della connessione CongWin=MSS = velocita = MSS/RTT * GongWin raddoppia ogni RTT (+1 MSS per ogni ack ricevuto) fino alla prima perdita m= Congestion avoidance: aumento lineare « CongWin aumenta di 1 MSS alla ricezione degli ack sull'intera CongWin inviata m Reazione a un evento di timeout + Sjattua slow start con con CongWin=MSS- m Reazione a un ack duplicato ricevuto 3 volte + TCP Tahoe: Slow start con CongWin=MSS + TCP Reno (oggi pitt utilizzato) + CongWin é dimezzata + Aumento lineare Transport protocols “6 TCP Controllo della congestione 14 ao nee TCP serie 2 Reno e 124-—— fe S Ber Oe Soglia Po Se ge 8 & 3 8 64 fh __-_ x gs By a © iz 24 OTT ITT TT 012 3 45 6 7 8 9 10 11 12 13 14 15 Numero di trasmissioni “Traneport protools va TCP Esempio ge 45 = 5 % 40 2 35 8 o_ 30 Bg 20 315 & g ' 2 5 = ao 0 2 4 6 B 10 12 14 16 18 20 22 24 26 Ciclo di trasmissione “ranspon protools 46 TCP Gestione finestra Sender Receiver 54: 1001, 4000 byes 4000 Baler 10003000 ] | a TD — Tie Segment 2 v ¥ Time ine ‘Transport protocols a TCP Segmento perso senior Receiver ‘Segment 3 OR Seyment 3. eransmitted Timeout Ok Time Tine Transport protocols 48 TCP Segmento perso Segment 1 8295 1301, 200 bes Segment 2 3°95 1401, 200 bytes Seginen rf $89: 1601. 200 byacx ‘OK OK vile ios ‘Time-out $29: 1601, 200 bytes OK ‘Transport protocols ° TCP Riscontro perso . Receiver 1401, 200 bytes ly : \cknowledgment lost a OK OK OK ‘Time ™ Transport protocols . YY APG 15 | bt intano TEL-PX OR LEGSER2

S-ar putea să vă placă și