Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer4-1 Reti di calcolatori e Sicurezza -- Network Layer --- Part of these slides are adapted from the slides of the book: Computer Networking:

Similar presentations


Presentation on theme: "Network Layer4-1 Reti di calcolatori e Sicurezza -- Network Layer --- Part of these slides are adapted from the slides of the book: Computer Networking:"— Presentation transcript:

1 Network Layer4-1 Reti di calcolatori e Sicurezza -- Network Layer --- Part of these slides are adapted from the slides of the book: Computer Networking: A Top Down Approach Featuring the Internet, 2nd edition. Jim Kurose, Keith Ross Addison-Wesley, July (copyright J.F Kurose and K.W. Ross, All Rights Reserved)

2 Network Layer4-2 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing with scale m how a router works m advanced topics: IPv6, mobility r instantiation and implementation in the Internet Overview: r network layer services r routing principles: path selection (seminario) r hierarchical routing (seminario) r IP r Internet routing protocols reliable transfer (seminario) m intra-domain m inter-domain r what’s inside a router? r IPv6 (seminario) r Mobility (seminario)

3 Network Layer4-3 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

4 Network Layer4-4 Network: Funzionalità r Trasportare pacchetti (datagram) dal sender al receiver r I protocolli del livello network “girano” sia sugli host che sui router Funzionalità principali: r Determinazione del percorso dei pacchetti:. Routing r Switching: funzione che definisce le modalità di input/output dei pacchetti in un router r Call setup: attività di inizializzazione del percorso (solo in alcune architteture) (NO IP!.. Ma con QoS?) network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical

5 Network Layer4-5 Il modello del servizio Quale è il modello di servizio offerto dal livello network? r Viene assicurata una determinata banda di trasmissione? r loss-free delivery? r in-order delivery? r congestion feedback? ? ? ? virtual circuit -- datagram Due risposte possibili Servizi di rete

6 Network Layer4-6 Circuiti Virtuali r call setup: per ogni attivazione del circuto prima di poter trasmettere dati r Ogni pacchetto trasmesso deve avere un tag di identificazione del circuito (non importa l’indirizzo di destinazione) “ il cammino che viene stabilito tra il sender ed il receiver fornisce un comporta di tipo telefonico (a commutazione di circuito)”

7 Network Layer4-7 Circuito Virtuale (2) r Ogni router lungo il cammino deve mantenere le informazioni di stato per ogni connessione che passa attraverso il router. r Le risorse del router (bandwidth, buffer) devono essere allocate per il circuito virtuale.

8 Network Layer4-8 Circuito Virtuale (3) r Comportamento ideale di un circuto virtuale application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call 4. Call connected 5. Data flow begins 6. Receive data

9 Network Layer4-9 Circuito Virtuale (conclusioni) r Utilizzato in particolari applicazioni (ad esempio quando si vogliono avere dei collegamenti dedicati tra intranet aziendali) r ATM, frame-relay, X.25 utilizzano questo modello di servizio r Internet: no!!

10 Network Layer4-10 Reti Datagram: Internet r Nessuna azione di attivazione (call set up) r router: non mantengono informazioni di stato sulle connessioni m Network: non esiste la nozione di “connessione” r I pacchetti sono caratterizzati dall’indirizzo di destinazione (pacchetti di una connessione possono seguire un percorso differente) application transport network data link physical application transport network data link physical 1. Send data 2. Receive data

11 Network Layer4-11 Network: Network Architecture Internet ATM Service Model best effort CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes no Order no yes Timing no yes no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ?

12 Network Layer4-12 Datagram vs VC Internet r Scambio dei dati tra le applicazioni m Servizi “elastic” rispetto ai requisiti temporali r Host (computers) m Possono implementare politiche per il controllo della congestione, etc m Rete semplice ma applicazioni evolute r Eterogeneità : difficile prevedere una nozione uniforme di servizio ATM r Origine nella telefonia m Richiesta di affidabilità e grossi vincoli temporali r Host:terminali telefonici m La rete è di fatto complessa

13 Network Layer4-13 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles m Link state routing m Distance vector routing 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

14 Network Layer4-14 Routing Graph abstraction for routing algorithms: r graph nodes are routers r graph edges are physical links m link cost: delay, $ cost, or congestion level Goal: determine “good” path (sequence of routers) thru network from source to dest. Routing protocol A E D CB F r “good” path: m typically means minimum cost path m other def’s possible

15 Network Layer4-15 Caratteristiche del routing r Switching vs Routing m Switching: attività che seleziona una porta del router in base alle informazioni della tabella di routing m routing: attività di costruzione della tabella di routing

16 Network Layer4-16 Routing Algorithm classification Global or decentralized information? Global: r all routers have complete topology, link cost info r “link state” algorithms Decentralized: r router knows physically- connected neighbors, link costs to neighbors r iterative process of computation, exchange of info with neighbors r “distance vector” algorithms Static or dynamic? Static: r routes change slowly over time Dynamic: r routes change more quickly m periodic update m in response to link cost changes JUMP

17 Network Layer4-17 A Link-State Routing Algorithm Dijkstra’s algorithm r net topology, link costs known to all nodes m accomplished via “link state broadcast” m all nodes have same info r computes least cost paths from one node (‘source”) to all other nodes m gives routing table for that node r iterative: after k iterations, know least cost path to k dest.’s Notation:  c(i,j): link cost from node i to j. cost infinite if not direct neighbors  D(v): current value of cost of path from source to dest. V  p(v): predecessor node along path from source to v, that is next v  N: set of nodes whose least cost path definitively known

18 Network Layer4-18 Dijsktra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infinity 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

19 Network Layer4-19 Dijkstra’s algorithm: example Step start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity 4,E A E D CB F

20 Network Layer4-20 DA: Esempio A B G EF C H D Selected edge Candidate edge Not visited

21 Network Layer4-21 DA: Esempio A B G EF C H D Selected edge Candidate edge Not visited

22 Network Layer4-22 DA: Esempio A B G EF C H D Selected edge Candidate edge Not visited

23 Network Layer4-23 DA: Esempio A B G EF C H D Selected edge Candidate edge Not visited

24 Network Layer4-24 DA: Esempio A B G EF C H D Selected edge Candidate edge Not visited

25 Network Layer4-25 Dijkstra’s algorithm, discussion Algorithm complexity: n nodes r each iteration: need to check all nodes, w, not in N r n*(n+1)/2 comparisons: O(n**2) r more efficient implementations possible: O(nlogn) Oscillations possible: r e.g., link cost = amount of carried traffic A D C B 1 1+e e 0 e A D C B 2+e e 1 A D C B 0 2+e 1+e A D C B 2+e 0 e 0 1+e 1 initially … recompute routing … recompute

26 Network Layer4-26 Distance Vector Routing Algorithm iterative: r continues until no nodes exchange info. r self-terminating: no “signal” to stop asynchronous: r nodes need not exchange info/iterate in lock step! distributed: r each node communicates only with directly-attached neighbors Distance Table data structure r each node has its own r row for each possible destination r column for each directly- attached neighbor to node r example: in node X, for dest. Y via neighbor Z: D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = =

27 Network Layer4-27 Distance Table: example A E D CB D () A B C D A1764A1764 B D5542D5542 E cost to destination via destination D (C,D) E c(E,D) + min {D (C,w)} D w = = 2+2 = 4 D (A,D) E c(E,D) + min {D (A,w)} D w = = 2+3 = 5 D (A,B) E c(E,B) + min {D (A,w)} B w = = 8+6 = 14 loop!

28 Network Layer4-28 Distance table gives routing table D () A B C D A1764A1764 B D5542D5542 E cost to destination via destination ABCD ABCD A,1 D,5 D,4 Outgoing link to use, cost destination Distance table Routing table

29 Network Layer4-29 Routing: distribuito e asincrono r Algoritmo di Bellmann-Ford: vettore delle distanze (distance vector)

30 Network Layer4-30 Distance Vector Routing: overview Iterative, asynchronous: each local iteration caused by: r local link cost change r message from neighbor: its least cost path change from neighbor Distributed: r each node notifies neighbors only when its least cost path to any destination changes m neighbors then notify their neighbors if necessary wait for (change in local link cost of msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Each node:

31 Network Layer4-31 Distance Vector Algorithm: 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infinity /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ X X X w At all nodes, X:

32 Network Layer4-32 Distance Vector Algorithm (cont.): 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval if we have a new min D (Y,w)for any destination Y 24 send new value of min D (Y,w) to all neighbors forever w X X X X X w w

33 Network Layer4-33 Distance Vector Algorithm: example X Z Y

34 Network Layer4-34 Distance Vector Algorithm: example X Z Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y

35 Network Layer4-35 Distance Vector: link cost changes Link cost changes: r node detects local link cost change r updates distance table (line 15) r if cost change in least cost path, notify neighbors (lines 23,24) X Z Y 1 algorithm terminates “good news travels fast”

36 Network Layer4-36 Distance Vector: link cost changes Link cost changes: r good news travels fast r bad news travels slow - “count to infinity” problem! X Z Y 60 algorithm continues on!

37 Network Layer4-37 Distance Vector: poisoned reverse If Z routes through Y to get to X : r Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) r will this completely solve count to infinity problem? X Z Y 60 algorithm terminates

38 Network Layer4-38 Comparison of LS and DV algorithms Message complexity r LS: with n nodes, E links, O(nE) msgs sent each r DV: exchange between neighbors only m convergence time varies Speed of Convergence r LS: O(n 2 ) algorithm requires O(nE) msgs m may have oscillations r DV: convergence time varies m may be routing loops m count-to-infinity problem Robustness: what happens if router malfunctions? LS: m node can advertise incorrect link cost m each node computes only its own table DV: m DV node can advertise incorrect path cost m each node’s table used by others error propagate thru network

39 Network Layer4-39 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

40 Network Layer4-40 Routing r I meccanismi di routing che abbiamo studiato sono neccanismi ideali m Rete è piatta m Tutti i router sono identici r Buona astrazione ma … irrealistica!!!

41 Network Layer4-41 Internet Passato recente NSFNET backbone Stanford BARRNET regional Berkeley P ARC NCAR UA UNM Westnet regional UNL KU ISU MidNet regional …

42 Network Layer4-42 Internet Oggi Backbone service provider Peering point Peering point Large corporation Small corporation “ Consumer ” ISP “Consumer” ISP “ Consumer” ISP

43 Network Layer4-43 Internet scalabilità: 50 milioni di possibili host: r Non possono memorizzare tutte le possibili destinazioni nella tabella di routing! r Messaggi per la modifica delle tabelle di routing avrebbero un costo troppo elevato! Domini Amministrativi: r internet = rete di reti r Ogni rete ha una sua autorità (network admin) che ha il controllo complete sul proprio dominio

44 Network Layer4-44 Routing Gerarchico r I router vengono aggregati in regioni: “autonomous systems” (AS) r I routers nella stessa AS eseguono lo stesso protocollo di routing m “intra-AS” routing m Router in regioni differenti possono eseguire un protocollo diverso dal protocollo intra-AS routing r Router speciali in una AS r Eseguono il protocollo intra-AS routing con tutti gli altri router nella AS r Inoltre sono I responsabili del routing verso l’esterno della AS m Eseguono un protocollo inter-AS routing con gli altri gateway gateway router

45 Network Layer4-45 Intra-AS vs Inter-AS routing Gateway: inter-AS routing intra-AS routing inter-AS, intra-AS routing nel gateway A.c network layer link layer physical layer a b b a a C A B d A.a A.c C.b B.a c b c

46 Network Layer4-46 Intra-AS vs Inter-AS routing Host h2 a b b a a C A B d c A.a A.c C.b B.a c b Host h1 Intra-AS routing within AS A Inter-AS routing between A and B Intra-AS routing within AS B

47 Network Layer4-47 Routing Gerarchico r Rete viene suddivisa in regioni r Router di una regione hanno informazione completa su quella regione r Analogia: Prefissi telefonici

48 Network Layer4-48 Routing Gerarchico

49 Network Layer4-49 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol m IPv4 addressing m Moving a datagram from source to destination m Datagram format m IP fragmentation m ICMP: Internet Control Message Protocol m DHCP: Dynamic Host Configuration Protocol m NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

50 Network Layer4-50 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer

51 Network Layer4-51 IP Addressing: introduction r IP address: 32-bit identifier for host, router interface r interface: connection between host/router and physical link m router’s typically have multiple interfaces m host may have multiple interfaces m IP addresses associated with each interface =

52 Network Layer4-52 IP Addressing r IP address: m network part (high order bits) m host part (low order bits) r What’s a network ? ( from IP address perspective) m device interfaces with same network part of IP address m can physically reach each other without intervening router network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) LAN

53 Network Layer4-53 IP Addressing How to find the networks? r Detach each interface from router, host r create “islands of isolated networks Interconnected system consisting of six networks

54 Network Layer4-54 IP Address Classes r Class A: m For very large organizations m 16 million hosts allowed r Class B: m For large organizations m 65 thousand hosts allowed r Class C m For small organizations m 255 hosts allowed r Class D m Multicast addresses m No network/host hierarchy

55 Network Layer4-55 Indirizzamento per classe r Proprietà m unico m gerarchico: network + host r Dot Notation m m m NetworkHost A: NetworkHost B: NetworkHost C:

56 Network Layer4-56 IP addressing: CIDR r Indirizzamento via classi: m Uso poco efficiente dello spazio degli indirizzi: la classe B alloca indirizzi per 65K host anche se la rete ne richiede solamente 2k r CIDR: Classless InterDomain Routing m Reti IP hanno indirizzi di lunghezza arbitraria m formato: a.b.c.d/x, dove x è # di bit nella porzione dell’indirizzo che definisce la rete network part host part /23

57 Network Layer4-57 Cammino di un datagram IP datagram: A B E misc fields source IP addr dest IP addr data r Datagram non viene modificato durante il percorso r Ruolo basilare degli indirizzi IP Dest. Net. next router Nhops

58 Network Layer4-58 Cammino di un datagram A::send B: r lookup(IP(B)) nella tabella di routing di A r B è sulla stessa sottorete di A r Call link.services m B e A sono connessi direttamente Dest. Net. next router Nhops misc fields data A B E

59 Network Layer4-59 Cammino di un datagram Dest. Net. next router Nhops A:: r r E è un host di una rete differente r = r link invia il datagram al router r datagram r ….. misc fields data A B E

60 Network Layer4-60 Cammino di un datagram :: r look up nella tabella di routing r E è un host sulla medesima interfaccia del router ( ) r link invia il mediante l’interfaccia r datagram !!! (era ora!) misc fields data Dest. Net router Nhops interface A B E Routing Table

61 Network Layer4-61 IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment offset upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. how much overhead with TCP? r 20 bytes of TCP r 20 bytes of IP r = 40 bytes + app layer overhead

62 Network Layer4-62 IPv4 r Tipo del servizio: m Differenza tra datagram di controllo e datagram dei dati m Router usano questo campo per differenziare i livelli di servizio offerti r TTL = 0 allora il datagram deve essere abbandonato r Protocol (simile al numero di porta del trasporto) m 6 => TCP m 17 => UDP

63 Network Layer4-63 Checksum r Perchè la suite TCP/IP (IPv4) prevede checksum sia al livello del trasporto che al livello della rete? m Router non è richiesto fare questo calcolo m TCP potrebbe basarsi su di un livello di trasporto differente (esempio ATM)

64 Network Layer4-64 MTU r Quantità di dati che può trasportare un protocollo del livello link è denominata MTU (max.transfer size): m Link differenti possono avere, MTU distinte Ethernet MTU = 1500 bytes WAN MTU = 576 bytes r Datagram è incapsulato all’interno di un pacchetto del link m MTU limite alla dimensione del datagram

65 Network Layer4-65 Problema r In un percorso sulla rete un datagram può passare lungo link che hanno una differente struttura del MTU r Soluzione: Frammentare i dati del datagram in piu’ datagram

66 Network Layer4-66 IP Fragmentation & Reassembly r network links have MTU (max.transfer size) - largest possible link-level frame. m different link types, different MTUs r large IP datagram divided (“fragmented”) within net m one datagram becomes several datagrams m “reassembled” only at final destination m IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly

67 Network Layer4-67 IP Fragmentation and Reassembly ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =1480 fragflag =1 length =1500 ID =x offset =2960 fragflag =0 length =1040 One large datagram becomes several smaller datagrams Example r 4000 byte datagram r MTU = 1500 bytes

68 Network Layer4-68 IP: Frammentazione & Riassemblaggio r F&R: Carico di lavoro sui router r Piccola frammentazione m MTU almeno 576 bytes MSS 536 bytes 20 bytes = header del segmento 20 bytes = header del datagram

69 Network Layer4-69 Network Protocols ICMP,

70 Network Layer4-70 ICMP: Internet Control Message Protocol r Protocollo utilizzato da host, router, gateway per scambiarsi in formazioni relative al livello network m errori: unreachable host, network, port, protocol m echo request/reply (ping) m traceroute

71 Network Layer4-71 ICMP: Internet Control Message Protocol r ICMP livello sopra IP: m ICMP msgs sono incapsulati in datagram IP r ICMP struttura dei messaggi: m Campo type, m Campo code m Contengono inoltre i primi 8 bytes del datagram IP che ha causato l’errore. Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

72 Network Layer4-72 ICMP: esempi di uso r Echo request reply m Controllo se un host è ancora “vivo” r Address mask request/reply m determinara subnet mask r Destination unreachable m Indirizzo non valido r TTL expired m … troppo lontano

73 Network Layer4-73 Ping r ICMP echo request/reply r Source sends ICMP echo request message to the destination address m Echo request packet contains sequence number and timestamp r Destination replies with an ICMP echo reply message containing the data in the original echo request message r Source can calculate round trip time (RTT) of packets r If no echo reply comes back then the destination is unreachable

74 Network Layer4-74 Ping (2) R1R2R3 AB Time Echo request Echo reply

75 Network Layer4-75 Traceroute r Traceroute records the route that packets take r A clever use of the TTL field r When a router receives a packet, it decrements TTL r If TTL=0, it sends an ICMP time exceeded message back to the sender r To determine the route, progressively increase TTL m Every time an ICMP time exceeded message is received, record the sender’s (router’s) address m Repeat until the destination host is reached or an error message occurs

76 Network Layer4-76 Traceroute (2) R1R2R3 AB TTL=1, Dest = B, port = invalid TTL=2, Dest = B TTL=3, Dest = B TTL=4, Dest = B Te (R1) Te (R2) Te (R3) Pu (B) Time Te = Time exceeded Pu = Port unreachable

77 Network Layer4-77 Come si ottiene l’indirizzo IP? Hosts r File di configurazione Win: control-panel->network->configuration->tcp/ip->properties Linux: /etc/rc.config r DHCP: Dynamic Host Configuration Protocol: ottiene l’indirizzo in modo dinamico: “plug-and-play” host broadcast “DHCP discover” msg DHCP server risponde “DHCP offer” msg –host invia la richiesta per IP address: “DHCP request” msg DHCP server invia l’indirizzo: “DHCP ack” msg

78 Network Layer4-78 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on” Support for mobile users who want to join network (more shortly) DHCP overview: m host broadcasts “DHCP discover” msg m DHCP server responds with “DHCP offer” msg m host requests IP address: “DHCP request” msg m DHCP server sends address: “DHCP ack” msg

79 Network Layer4-79 DHCP client-server scenario A B E DHCP server arriving DHCP client needs address in this network

80 Network Layer4-80 DHCP client-server scenario DHCP server: arriving client time DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs

81 Network Layer4-81 NAT: Network Address Translation local network (e.g., home network) /24 rest of Internet Datagrams with source or destination in this network have /24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: , different source port numbers

82 Network Layer4-82 NAT: Network Address Translation r Motivation: local network uses just one IP address as far as outside word is concerned: m no need to be allocated range of addresses from ISP: - just one IP address is used for all devices m can change addresses of devices in local network without notifying outside world m can change ISP without changing addresses of devices in local network m devices inside local net not explicitly addressable, visible by outside world (a security plus).

83 Network Layer4-83 NAT: Network Address Translation Implementation: NAT router must: m outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)... remote clients/servers will respond using (NAT IP address, new port #) as destination addr. m remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair m incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

84 Network Layer4-84 NAT: Network Address Translation S: , 3345 D: , : host sends datagram to , 80 NAT translation table WAN side addr LAN side addr , , 3345 …… S: , 80 D: , S: , 5001 D: , : NAT router changes datagram source addr from , 3345 to , 5001, updates table S: , 80 D: , : Reply arrives dest. address: , : NAT router changes datagram dest addr from , 5001 to , 3345

85 Network Layer4-85 NAT: Network Address Translation r 16-bit port-number field: m 60,000 simultaneous connections with a single LAN-side address! r NAT is controversial: m routers should only process up to layer 3 m violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications m address shortage should instead be solved by IPv6

86 Network Layer4-86 Hierarchical addressing: route aggregation “Send me anything with addresses beginning /20” / / /23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning /16” /23 Organization Hierarchical addressing allows efficient advertisement of routing information:

87 Network Layer4-87 Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 “Send me anything with addresses beginning /20” / / /23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning /16 or /23” /23 Organization

88 Network Layer4-88 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet m Intra-AS routing: RIP and OSPF m Inter-AS routing: BGP 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

89 Network Layer4-89 Routing in the Internet r The Global Internet consists of Autonomous Systems (AS) interconnected with each other: m Stub AS: small corporation: one connection to other AS’s m Multihomed AS: large corporation (no transit): multiple connections to other AS’s m Transit AS: provider, hooking many AS’s together r Two-level routing: m Intra-AS: administrator responsible for choice of routing algorithm within network m Inter-AS: unique standard for inter-AS routing: BGP

90 Network Layer4-90 Internet AS Hierarchy Intra-AS border (exterior gateway) routers Inter-AS interior (gateway) routers

91 Network Layer4-91 Intra-AS Routing r Also known as Interior Gateway Protocols (IGP) r Most common Intra-AS routing protocols: m RIP: Routing Information Protocol m OSPF: Open Shortest Path First m IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

92 Network Layer4-92 RIP ( Routing Information Protocol) r Distance vector algorithm r Included in BSD-UNIX Distribution in 1982 r Distance metric: # of hops (max = 15 hops) m Can you guess why? r Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) r Each advertisement: list of up to 25 destination nets within AS

93 Network Layer4-93 RIP: Example Destination Network Next Router Num. of hops to dest. wA2 yB2 zB7 x--1 ….…..... w xy z A C D B Routing table in D

94 Network Layer4-94 RIP: Example Destination Network Next Router Num. of hops to dest. wA2 yB2 zB A7 5 x--1 ….…..... Routing table in D w xy z A C D B Dest Next hops w - - x - - z C 4 …. …... Advertisement from A to D

95 Network Layer4-95 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead m routes via neighbor invalidated m new advertisements sent to neighbors m neighbors in turn send out new advertisements (if tables changed) m link failure info quickly propagates to entire net m poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

96 Network Layer4-96 RIP Table processing r RIP routing tables managed by application-level process called route-d (daemon) r advertisements sent in UDP packets, periodically repeated physical link network forwarding (IP) table Transprt (UDP) routed physical link network (IP) Transprt (UDP) routed forwarding table

97 Network Layer4-97 RIP Table example (continued) Router: giroflee.eurocom.fr r Three attached class C networks (LANs) r Router only knows routes to attached LANs r Default router used to “go up” r Route multicast address: r Loopback interface (for debugging) Destination Gateway Flags Ref Use Interface UH lo U 2 13 fa U le U 2 25 qaa U 3 0 le0 default UG

98 Network Layer4-98 OSPF (Open Shortest Path First) r “open”: publicly available r Uses Link State algorithm m LS packet dissemination m Topology map at each node m Route computation using Dijkstra’s algorithm r OSPF advertisement carries one entry per neighbor router r Advertisements disseminated to entire AS (via flooding) m Carried in OSPF messages directly over IP (rather than TCP or UDP

99 Network Layer4-99 OSPF “advanced” features (not in RIP) r Security: all OSPF messages authenticated (to prevent malicious intrusion) r Multiple same-cost paths allowed (only one path in RIP) r For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) r Integrated uni- and multicast support: m Multicast OSPF (MOSPF) uses same topology data base as OSPF r Hierarchical OSPF in large domains.

100 Network Layer4-100 Hierarchical OSPF

101 Network Layer4-101 Hierarchical OSPF r Two-level hierarchy: local area, backbone. m Link-state advertisements only in area m each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. r Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. r Backbone routers: run OSPF routing limited to backbone. r Boundary routers: connect to other AS’s.

102 Network Layer4-102 Inter-AS routing in the Internet: BGP

103 Network Layer4-103 Internet inter-AS routing: BGP r BGP (Border Gateway Protocol): the de facto standard r Path Vector protocol: m similar to Distance Vector protocol m each Border Gateway broadcast to neighbors (peers) entire path (i.e., sequence of AS’s) to destination m BGP routes to networks (ASs), not individual hosts m E.g., Gateway X may send its path to dest. Z: Path (X,Z) = X,Y1,Y2,Y3,…,Z

104 Network Layer4-104 Internet inter-AS routing: BGP Suppose: gateway X send its path to peer gateway W r W may or may not select path offered by X m cost, policy (don’t route via competitors AS), loop prevention reasons. r If W selects path advertised by X, then: Path (W,Z) = w, Path (X,Z) r Note: X can control incoming traffic by controlling it route advertisements to peers: m e.g., don’t want to route traffic to Z -> don’t advertise any routes to Z

105 Network Layer4-105 BGP: controlling who routes to you r A,B,C are provider networks r X,W,Y are customer (of provider networks) r X is dual-homed: attached to two networks m X does not want to route from B via X to C m.. so X will not advertise to B a route to C

106 Network Layer4-106 BGP: controlling who routes to you r A advertises to B the path AW r B advertises to W the path BAW r Should B advertise to C the path BAW? m No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers m B wants to force C to route to w via A m B wants to route only to/from its customers!

107 Network Layer4-107 BGP operation Q: What does a BGP router do? r Receiving and filtering route advertisements from directly attached neighbor(s). r Route selection. m To route to destination X, which path )of several advertised) will be taken? r Sending route advertisements to neighbors.

108 Network Layer4-108 BGP messages r BGP messages exchanged using TCP. r BGP messages: m OPEN: opens TCP connection to peer and authenticates sender m UPDATE: advertises new path (or withdraws old) m KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request m NOTIFICATION: reports errors in previous msg; also used to close connection

109 Network Layer4-109 Why different Intra- and Inter-AS routing ? Policy: r Inter-AS: admin wants control over how its traffic routed, who routes through its net. r Intra-AS: single admin, so no policy decisions needed Scale: r hierarchical routing saves table size, reduced update traffic Performance: r Intra-AS: can focus on performance r Inter-AS: policy may dominate over performance

110 Network Layer4-110 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

111 Network Layer4-111 Router Architecture Overview Two key router functions: r run routing algorithms/protocol (RIP, OSPF, BGP) r switching datagrams from incoming to outgoing link

112 Network Layer4-112 Input Port Functions Decentralized switching: r given datagram dest., lookup output port using routing table in input port memory r goal: complete input port processing at ‘line speed’ r queuing: if datagrams arrive faster than forwarding rate into switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5

113 Network Layer4-113 Input Port Queuing r Fabric slower that input ports combined -> queueing may occur at input queues r Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward r queueing delay and loss due to input buffer overflow!

114 Network Layer4-114 Three types of switching fabrics

115 Network Layer4-115 Switching Via Memory First generation routers: r packet copied by system’s (single) CPU r speed limited by memory bandwidth (2 bus crossings per datagram) Input Port Output Port Memory System Bus Modern routers: r input port processor performs lookup, copy into memory r Cisco Catalyst 8500

116 Network Layer4-116 Switching Via a Bus r datagram from input port memory to output port memory via a shared bus r bus contention: switching speed limited by bus bandwidth r 1 Gbps bus, Cisco 1900: sufficient speed for access and enterprise routers (not regional or backbone)

117 Network Layer4-117 Switching Via An Interconnection Network r overcome bus bandwidth limitations r Banyan networks, other interconnection nets initially developed to connect processors in multiprocessor r Advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric. r Cisco 12000: switches Gbps through the interconnection network

118 Network Layer4-118 Output Ports r Buffering required when datagrams arrive from fabric faster than the transmission rate r Scheduling discipline chooses among queued datagrams for transmission

119 Network Layer4-119 Output port queueing r buffering when arrival rate via switch exceeds output line speed r queueing (delay) and loss due to output port buffer overflow!

120 Network Layer4-120 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

121 Network Layer4-121 IPv6 r Initial motivation: 32-bit address space completely allocated by r Additional motivation: m header format helps speed processing/forwarding m header changes to facilitate QoS m new “anycast” address: route to “best” of several replicated servers r IPv6 datagram format: m fixed-length 40 byte header m no fragmentation allowed

122 Network Layer4-122 IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data

123 Network Layer4-123 Other Changes from IPv4 r Checksum: removed entirely to reduce processing time at each hop r Options: allowed, but outside of header, indicated by “Next Header” field r ICMPv6: new version of ICMP m additional message types, e.g. “Packet Too Big” m multicast group management functions

124 Network Layer4-124 Transition From IPv4 To IPv6 r Not all routers can be upgraded simultaneous m no “flag days” m How will the network operate with mixed IPv4 and IPv6 routers? r Two proposed approaches: m Dual Stack: some routers with dual stack (v6, v4) can “translate” between formats m Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

125 Network Layer4-125 Dual Stack Approach A B E F IPv6 C D IPv4 Flow: X Src: A Dest: F data Flow: ?? Src: A Dest: F data Src:A Dest: F data A-to-B: IPv6 Src:A Dest: F data B-to-C: IPv4 B-to-C: IPv4 B-to-C: IPv6

126 Network Layer4-126 Tunneling A B E F IPv6 tunnel Logical view: Physical view: A B E F IPv6 C D IPv4 Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F data Src:B Dest: E A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4

127 Network Layer4-127 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

128 Network Layer4-128 Multicast: one sender to many receivers r Multicast: act of sending datagram to multiple receivers with single “transmit” operation m analogy: one teacher to many students r Question: how to achieve multicast Multicast via unicast r source sends N unicast datagrams, one addressed to each of N receivers multicast receiver (red) not a multicast receiver (red) routers forward unicast datagrams

129 Network Layer4-129 Multicast: one sender to many receivers r Multicast: act of sending datagram to multiple receivers with single “transmit” operation m analogy: one teacher to many students r Question: how to achieve multicast Network multicast r Router actively participate in multicast, making copies of packets as needed and forwarding towards multicast receivers Multicast routers (red) duplicate and forward multicast datagrams

130 Network Layer4-130 Multicast: one sender to many receivers r Multicast: act of sending datagram to multiple receivers with single “transmit” operation m analogy: one teacher to many students r Question: how to achieve multicast Application-layer multicast r end systems involved in multicast copy and forward unicast datagrams among themselves

131 Network Layer4-131 Internet Multicast Service Model multicast group concept: use of indirection m hosts addresses IP datagram to multicast group m routers forward multicast datagrams to hosts that have “joined” that multicast group multicast group

132 Network Layer4-132 Multicast groups  class D Internet addresses reserved for multicast:  host group semantics: oanyone can “join” (receive) multicast group oanyone can send to multicast group ono network-layer identification to hosts of members  needed: infrastructure to deliver mcast-addressed datagrams to all hosts that have joined that multicast group

133 Network Layer4-133 Joining a mcast group: two-step process r local: host informs local mcast router of desire to join group: IGMP (Internet Group Management Protocol) r wide area: local router interacts with other routers to receive mcast datagram flow m many protocols (e.g., DVMRP, MOSPF, PIM) IGMP wide-area multicast routing

134 Network Layer4-134 IGMP: Internet Group Management Protocol r host: sends IGMP report when application joins mcast group m IP_ADD_MEMBERSHIP socket option m host need not explicitly “unjoin” group when leaving r router: sends IGMP query at regular intervals m host belonging to a mcast group must reply to query query report

135 Network Layer4-135 IGMP IGMP version 1 r router: Host Membership Query msg broadcast on LAN to all hosts r host: Host Membership Report msg to indicate group membership m randomized delay before responding m implicit leave via no reply to Query r RFC 1112 IGMP v2: additions include r group-specific Query r Leave Group msg m last host replying to Query can send explicit Leave Group msg m router performs group- specific query to see if any hosts left in group m RFC 2236 IGMP v3: under development as Internet draft

136 Multicast Routing: Problem Statement r Goal: find a tree (or trees) connecting routers having local mcast group members m tree: not all paths between routers used m source-based: different tree from each sender to rcvrs m shared-tree: same tree used by all group members Shared tree Source-based trees

137 Approaches for building mcast trees Approaches: r source-based tree: one tree per source m shortest path trees m reverse path forwarding r group-shared tree: group uses one tree m minimal spanning (Steiner) m center-based trees …we first look at basic approaches, then specific protocols adopting these approaches

138 Shortest Path Tree r mcast forwarding tree: tree of shortest path routes from source to all receivers m Dijkstra’s algorithm R1 R2 R3 R4 R5 R6 R i router with attached group member router with no attached group member link used for forwarding, i indicates order link added by algorithm LEGEND S: source

139 Reverse Path Forwarding if (mcast datagram received on incoming link on shortest path back to center) then flood datagram onto all outgoing links else ignore datagram  rely on router’s knowledge of unicast shortest path from it to sender  each router has simple forwarding behavior:

140 Reverse Path Forwarding: example result is a source-specific reverse SPT –may be a bad choice with asymmetric links R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member datagram will be forwarded LEGEND S: source datagram will not be forwarded

141 Reverse Path Forwarding: pruning r forwarding tree contains subtrees with no mcast group members m no need to forward datagrams down subtree m “prune” msgs sent upstream by router with no downstream group members R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member prune message LEGEND S: source links with multicast forwarding P P P

142 Shared-Tree: Steiner Tree r Steiner Tree: minimum cost tree connecting all routers with attached group members r problem is NP-complete r excellent heuristics exists r not used in practice: m computational complexity m information about entire network needed m monolithic: rerun whenever a router needs to join/leave

143 Center-based trees r single delivery tree shared by all r one router identified as “center” of tree r to join: m edge router sends unicast join-msg addressed to center router m join-msg “processed” by intermediate routers and forwarded towards center m join-msg either hits existing tree branch for this center, or arrives at center m path taken by join-msg becomes new branch of tree for this router

144 Center-based trees: an example Suppose R6 chosen as center: R1 R2 R3 R4 R5 R6 R7 router with attached group member router with no attached group member path order in which join messages generated LEGEND

145 Internet Multicasting Routing: DVMRP r DVMRP: distance vector multicast routing protocol, RFC1075 r flood and prune: reverse path forwarding, source-based tree m RPF tree based on DVMRP’s own routing tables constructed by communicating DVMRP routers m no assumptions about underlying unicast m initial datagram to mcast group flooded everywhere via RPF m routers not wanting group: send upstream prune msgs

146 DVMRP: continued… r soft state: DVMRP router periodically (1 min.) “forgets” branches are pruned: m mcast data again flows down unpruned branch m downstream router: reprune or else continue to receive data r routers can quickly regraft to tree m following IGMP join at leaf r odds and ends m commonly implemented in commercial routers m Mbone routing done using DVMRP

147 Tunneling Q: How to connect “islands” of multicast routers in a “sea” of unicast routers?  mcast datagram encapsulated inside “normal” (non-multicast- addressed) datagram  normal IP datagram sent thru “tunnel” via regular IP unicast to receiving mcast router  receiving mcast router unencapsulates to get mcast datagram physical topology logical topology

148 PIM: Protocol Independent Multicast r not dependent on any specific underlying unicast routing algorithm (works with all) r two different multicast distribution scenarios : Dense:  group members densely packed, in “close” proximity.  bandwidth more plentiful Sparse:  # networks with group members small wrt # interconnected networks  group members “widely dispersed”  bandwidth not plentiful

149 Consequences of Sparse-Dense Dichotomy: Dense r group membership by routers assumed until routers explicitly prune r data-driven construction on mcast tree (e.g., RPF) r bandwidth and non- group-router processing profligate Sparse : r no membership until routers explicitly join r receiver- driven construction of mcast tree (e.g., center-based) r bandwidth and non-group- router processing conservative

150 PIM- Dense Mode flood-and-prune RPF, similar to DVMRP but  underlying unicast protocol provides RPF info for incoming datagram  less complicated (less efficient) downstream flood than DVMRP reduces reliance on underlying routing algorithm  has protocol mechanism for router to detect it is a leaf-node router

151 PIM - Sparse Mode r center-based approach r router sends join msg to rendezvous point (RP) m intermediate routers update state and forward join r after joining via RP, router can switch to source-specific tree m increased performance: less concentration, shorter paths R1 R2 R3 R4 R5 R6 R7 join all data multicast from rendezvous point rendezvous point

152 PIM - Sparse Mode sender(s): r unicast data to RP, which distributes down RP-rooted tree r RP can extend mcast tree upstream to source r RP can send stop msg if no attached receivers m “no one is listening!” R1 R2 R3 R4 R5 R6 R7 join all data multicast from rendezvous point rendezvous point

153 Network Layer4-153 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.5 Routing in the Internet 4.6 What’s Inside a Router? 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility

154 Network Layer4-154 What is mobility? r spectrum of mobility, from the network perspective: no mobility high mobility mobile user, using same access point mobile user, passing through multiple access point while maintaining ongoing connections ( like cell phone) mobile user, connecting/ disconnecting from network using DHCP.

155 Network Layer4-155 Mobility: Vocabulary home network: permanent “home” of mobile (e.g., /24) Permanent address: address in home network, can always be used to reach mobile e.g., home agent: entity that will perform mobility functions on behalf of mobile, when mobile is remote wide area network correspondent

156 Network Layer4-156 Mobility: more vocabulary Care-of-address: address in visited network. (e.g., 79, ) wide area network visited network: network in which mobile currently resides (e.g., /24) Permanent address: remains constant ( e.g., ) home agent: entity in visited network that performs mobility functions on behalf of mobile. correspondent: wants to communicate with mobile

157 Network Layer4-157 How do you contact a mobile friend: r search all phone books? r call her parents? r expect her to let you know where he/she is? I wonder where Alice moved to? Consider friend frequently changing addresses, how do you find her?

158 Network Layer4-158 Mobility: approaches r Let routing handle it: routers advertise permanent address of mobile-nodes-in-residence via usual routing table exchange. m routing tables indicate where each mobile located m no changes to end-systems r Let end-systems handle it: m indirect routing: communication from correspondent to mobile goes through home agent, then forwarded to remote m direct routing: correspondent gets foreign address of mobile, sends directly to mobile

159 Network Layer4-159 Mobility: approaches r Let routing handle it: routers advertise permanent address of mobile-nodes-in-residence via usual routing table exchange. m routing tables indicate where each mobile located m no changes to end-systems r let end-systems handle it: m indirect routing: communication from correspondent to mobile goes through home agent, then forwarded to remote m direct routing: correspondent gets foreign address of mobile, sends directly to mobile not scalable to millions of mobiles

160 Network Layer4-160 Mobility: registration End result: r Foreign agent knows about mobile r Home agent knows location of mobile wide area network home network visited network 1 mobile contacts foreign agent on entering visited network 2 foreign agent contacts home agent home: “this mobile is resident in my network”

161 Network Layer4-161 Mobility via Indirect Routing wide area network home network visited network correspondent addresses packets using home address of mobile home agent intercepts packets, forwards to foreign agent foreign agent receives packets, forwards to mobile mobile replies directly to correspondent

162 Network Layer4-162 Indirect Routing: comments r Mobile uses two addresses: m permanent address: used by correspondent (hence mobile location is transparent to correspondent) m care-of-address: used by home agent to forward datagrams to mobile r foreign agent functions may be done by mobile itself r triangle routing: correspondent-home-network- mobile m inefficient when correspondent, mobile are in same network

163 Network Layer4-163 Forwarding datagrams to remote mobile Permanent address: Care-of address: dest: packet sent by correspondent dest: dest: packet sent by home agent to foreign agent: a packet within a packet dest: foreign-agent-to-mobile packet

164 Network Layer4-164 Indirect Routing: moving between networks r suppose mobile user moves to another network m registers with new foreign agent m new foreign agent registers with home agent m home agent update care-of-address for mobile m packets continue to be forwarded to mobile (but with new care-of-address) r Mobility, changing foreign networks transparent: on going connections can be maintained!

165 Network Layer4-165 Mobility via Direct Routing wide area network home network visited network correspondent requests, receives foreign address of mobile correspondent forwards to foreign agent foreign agent receives packets, forwards to mobile mobile replies directly to correspondent 3

166 Network Layer4-166 Mobility via Direct Routing: comments r overcome triangle routing problem r non-transparent to correspondent: correspondent must get care-of-address from home agent m What happens if mobile changes networks?

167 Network Layer4-167 Mobile IP r RFC 3220 r has many features we’ve seen: m home agents, foreign agents, foreign-agent registration, care-of-addresses, encapsulation (packet-within-a-packet) r three components to standard: m agent discovery m registration with home agent m indirect routing of datagrams

168 Network Layer4-168 Mobile IP: agent discovery r agent advertisement: foreign/home agents advertise service by broadcasting ICMP messages (typefield = 9) R bit: registration required H,F bits: home and/or foreign agent

169 Network Layer4-169 Mobile IP: registration example

170 Network Layer4-170 Network Layer: summary Next stop: the Data link layer! What we’ve covered: r network layer services r routing principles: link state and distance vector r hierarchical routing r IP r Internet routing protocols RIP, OSPF, BGP r what’s inside a router? r IPv6 r mobility


Download ppt "Network Layer4-1 Reti di calcolatori e Sicurezza -- Network Layer --- Part of these slides are adapted from the slides of the book: Computer Networking:"

Similar presentations


Ads by Google