IP: Network Lyer Overview Addressing Routing Overview Gols nd Tsks Routing Switching Issues Bsic ides TOC IP TOC IP Overview Gols nd Tsks Gols of Network Lyer Guide pckets from source to destintion Use network links efficiently (e.g., prefer shorter nd fster routes) Addressing Agree on ddressing scheme to identify nodes IP ddresses re loction-sed (similr to telephone numers) This structure reduces the informtion routers must keep Different types of ddresses Routing Routers exchnge informtion to lern network topology Routers then clculte good routes to the different destintions Routers store the results of these clcultions in routing tles Different routing lgorithms TOC IP Overview Gols nd Tsks Routing Definition Finding pth from source to destintion Types: Pth sed on S S S S Flow Type or Trffic Source/Destintion Destintion Internet TOC IP Overview Routing DD D D A (S (S D): D):,,,, B (S (S D): D):,,,, C (S (S D): D):,,,,,, Voice Voice (S (S D): D):,,,, Dt Dt (S (S D): D):,,,,,, (S (S D): D):,,,, (S (S D ): D ):,,,,,, (S (S D): D):,,,, (S (S D): D):,,,, Switching Definition Sending the its long the pth Approches Circuit (Telephone; Lightwve) Pcket Virtul Circuit (ATM) Dtgrm (Ethernet, IP) Notes A circuit or VC cn e link in n IP network An Ethernet LAN cn e link in n IP network Switching (cont.) Dtgrm v/s Virtul Circuit Dtgrm routing Ech pcket to e forwrded independently Virtul Circuit Ech pcket from sme flow uses sme route More stte (pick the right grnulrity) QoS sensitive networks use VC s nd signling Find route tht hs the resources ville for the connection. Reserve the resources efore sending dt pckets TOC IP Overview Switching TOC IP Overview Switching
Issues Sclility [gret in IP] Millions of nodes Routing tles should remin smll Updtes should e mngele Topology Chnges [good in IP] Routers compute new routes s topology chnges Chnges should not ffect most tles Performnce [poor in IP] utiliztion should e well-lnced [not in prctice] Updtes should e fst [not lwys] Idelly, some flows would hve gurnteed rte [no] Network should detect configurtion errors or other errors [no] Network should protect itself ginst ttcks [no] Bsic Ides Addressing Lyer : Locl scheme, typiclly flt not sclle Lyer : Loction sed nd hierrchicl sclle Temporry ddresses for moile nodes Network Address Trnsltion to reuse ddresses Routing Route is sed on destintion only (roughly: shortest pth) Network decomposed into domins Interdomin routing: Uses pth-vector lgorithm Intrdomin routing: Uses link stte or distnce vector lgorithm Vritions Multicst; PP; Ad Hoc; Sensors; Content Distriution Networks TOC IP Overview Issues Addressing Exmples Clss-Bsed Addressing CIDR: Clssless Interdomin Routing Assigning Addresses DHCP Network Address Trnsltion Exmples Flt Addressing Hierrchicl Addressing Internetworking Lyers nd TOC IP Addressing TOC IP Addressing Exmples Flt Addressing : : Address Ports : : c c : : : : : : : : : : : : : : : : c : : : : : : c : : c : : : : : c : : : : : : : : : : : : : Routing Tle: : : : : One per node Destintion Exit Port Addresses re ritrry; not sed on topology (e.g., Ethernet) N nodes N - entries in every routing tle; not sclle TOC IP Addressing Exmples Flt : : : : : : : : : : Hierchicl Addresses.:.: Defult: Defult:.....:.: Defult: Defult:.:.:.:.: Defult: Defult: c c...:.: c.:.: Defult: Defult: c.. Addresses re rrnged sed on topology (e.g., IP) Few entries in ech routing tle; sclle TOC IP Addressing Exmples Hierrchicl...:.: Defult: Defult:.:.: Defult: Defult:..
Internetworking Recll the sic internetworking scheme of IP: Lyers nd Ethernet Switch Router Ethernet Switch.*:.*: locl locl IP Defult: Defult: y.:.: tt Locl.:.: y. x. t.*:.*: locl locl.*:.*: Defult: Defult:.:.: x.:.: y. y z u.. dt. z. u x y.. dt d v w.. dt. v. w Appliction Trnsport Network A x Destintion Address B Next Hop C Locl ddress C Lyer ddress y Destintion Address B Locl to port p Locl ddress B Lyer ddress w Network C D y p v Appliction Trnsport Network B w TOC IP Addressing Exmples Internetworking TOC IP Addressing Exmples Lyers / Clss-Bsed Addresses Addresses Sclility Prolem Addresses Addressing reflects internet hierrchy its divided into prts: Clss A Clss B Clss C network network network host host host ~ million nets hosts TOC IP Addressing Clss TOC IP Addressing Clss - Addresses Sclility Prolem Exmple: n orgniztion initilly needs ddresses Allocte it clss C ddress Orgniztion grows to need ddresses Clss B ddress is llocted. (~K hosts) Tht s overkill - huge wste Only out clss B ddresses! Artificil Address crises Clssless Internet Domin Routing (CIDR) CIDR llows networks to e ssigned on ritrry it oundries. Address rnges cn e ssigned in chunks of k k= Ide - use ggregtion - provide routing for lrge numer of customers y dvertising one common prefix. This is possile ecuse nture of ddressing is hierrchicl Summriztion reduces the size of routing tles, ut mintins connectivity. Aggregtion Sclility nd survivility of the Internet TOC IP Addressing Clss - Sclility
CIDR (cont.) Suppose fifty computers in network re ssigned IP ddresses..9. -..9.9 They shre the prefix..9 Is this the longest prefix? Rnge is to How to write X? Convention:..9./ There re -= its for the computers = ddresses CIDR (cont.) Specify rnge of ddresses y prefix: X/Y The prefix common to the entire rnge is the first Y its of X. X: The first ddress in the rnge hs prefix X Y: -Y ddresses in the rnge Exmple../ Common prefix is its: Numer of ddresses: 9 = Prefix ggregtion Comine two ddress rnges../ nd../ gives../ Routers mtch to longest prefix CIDR Longest prefix mtch routing c,, d,,, Dest. c d Length of longest prefix mtch for given port CIDR (cont.) Exmple........ R......... Defult.... Defult... R R Defult... CIDR - Sunets H: IP Msk:... H: IP Msk:... IP H H IP e e e: e R H: Is H on sme sunet s I m? Yes if IP/ = IP/ R H: IP Msk:... e e H IP CIDR (cont.) Direct Delivery e e IP IP IP X H e ll e e: Who is IP? H e IP e R e e e: I m IP IP IP on on sme sunet Address Resolution Protocol = Lyer Lyer Address Lyer Lyer Address R e e H IP
CIDR (cont.) Indirect Delivery e e IP IP X IP e H H IP e e SH IP IP X R IP IP not on on sme sunet e e R e I m IP e H IP e e IP IP X ll e Who is IP? Note: Frgmenttion my e required t R Assigning IP ddress (Idelly) A host gets its IP ddress from the IP ddress lock of its orgniztion An orgniztion gets n IP ddress lock from its ISP s ddress lock An ISP gets its ddress lock from its own provider OR from one of the routing registries: ARIN: Americn Registry for Internet Numers RIPE: Reseux IP Europeens APNIC: Asi Pcific Network Informtion Center Ech Autonomous System (AS) is ssigned -it numer ( totl) Currently, AS s in use TOC IP Addressing Assigning Addresses DHCP Dynmic Host Configurtion Protocol Ide Temporry ddresses ssigned on demnd Advntges Enles to reuse ddresses You come to clssroom with lptop Dil-up users Automtes the ssignment of ddresses Disdvntge Cnnot e server (how to find ddress?) DHCP (cont.) Opertions DHCP server mintins list of ville ddresses Client requests n ddress Client sends DHCP discover messge ( me ll = [ ]) Server replies with DHCP offer Client sks for ddress; server provides one Client cn extend/relese the lese Server nd client cn test ddress TOC IP Addressing DHCP TOC IP Addressing DHCP NAT Overview Exmple How NAT works Overview Shortge of IP Addresses CIDR my not e enough IPv my tke long time until deployed NAT enles reuse of ddresses Privte Addresses:... -...... -... 9... - 9... See IETF RFC (99) TOC IP Addressing NAT TOC IP Addressing NAT Overview
Exmple Home Network One IP ddress (IP) is visile outside IP (typiclly DHCP) NAT How it works Trick: Use TCP port to distinguish computers There re k port numers, the first k re reserved [IP IPx TCP TCPn ] [IP IPx TCPm TCPn ] IP [IPx IP TCPn TCP ] IPx NAT IP IPc (DHCP with NAT) (DHCP with NAT) [IPx IP TCPn TCPm ] Note: Cn e extended to set of ddresses insted of only one (IP) In tht cse, some sttic ddresses cn e reserved for servers TOC IP Addressing NAT Exmple IP TOC IP Addressing NAT How IPc [TCP IP, TCPm] Routing Routing Su-Functions Hierrchicl Types of Protocol Routing Su-Functions Topology Updte: Chrcterize nd mintin connectivity Discover neighors Mesure distnce (one or more metric) Disseminte Route Computtion: Kind of pth: Multicst, Unicst Centrlized or Distriuted Algorithm Policy Hierrchy Switching: Forwrd the pckets t ech node TOC IP Routing TOC IP Routing Su-Functions Hierrchicl Routing The internet hs mny Administrtive Domins Hierrchicl Routing Border Routers B B RIP A C IGRP A BGP C OSPF TOC IP Routing Hierchicl TOC IP Routing Hierchicl
Hierrchicl Routing Interdomin & Intrdomin BGP InterDomin InterDomin B B IntrDomin RIP Types of Routing Protocol Overview Stte Distnce Vector Stte vs. Distnce Vector Pth Vector: Interdomin Routing IntrDomin IGRP A OSPF IntrDomin C TOC IP Routing Hierchicl TOC IP Routing Types Overview Topology chnges cn e detected y nery nodes These chnges must e reflected in the routes Mechnisms for disseminting informtion Stte: Communicte the nmes nd costs of neighors. Ech node mintins the entire topology. E.g. used in OSPF Distnce Vector: Communicte current distnce estimtes of node to every other node. E.g. used in RIP Pth Vector: Communicte current estimtes of preferred pths from node to every other node. E.g. used in BGP TOC IP Routing Types Overview Overview LINK STATE ) Exchnge Sttes ) Ech node computes BB A: [B, ], [C, ] the shortest pths to B: [A, ], [D, ] the others AA DD C: [A, ], [D, ] CC D: [B, ], [C, ] DISTANCE VECTOR BB BB BB AA DD AA DD AA DD CC CC CC PATH VECTOR B,D Don t like B BB D BB BB AA DD AA DD AA DD CC D CC CC C,D TOC IP Routing Types Overview Stte Protocols Overview Stte Advertisements Shortest Pth Algorithm: Dijkstr Overview. Every node lerns the topology of the network Flooding of Stte Pckets (LSP). An efficient shortest pth lgorithm computes routes to every other node. Node updtes Forwrding Tle TOC IP Routing Types Stte TOC IP Routing Types Stte - Overview
Stte Advertisements Stte Pckets Flooding Exmple Some Issues Stte Pckets Source Sequence Numer Age List of Neighors Every router sends Stte Pckets (LSPs) to ll of its neighors LSPs rrive nd wit in uffers to e ccepted If node j receives LSP from node k it compres the sequence numers. If this is the most recent one from k, send to N(j)-{k}. This wy ech router cn send its LSP to ll other routers Age strts out t. At ny router, vlue is decremented every seconds. At discrd. As long s sequence don t wrp this works Otherwise things cn get ugly TOC IP Routing Types Stte - LSA TOC IP Routing Types Stte LSA LSP LSP - Exmple LSP - Exmple TOC IP Routing Types Stte LSA Exmple TOC IP Routing Types Stte LSA Exmple LSP - Exmple LSP - Exmple TOC IP Routing Types Stte LSA Exmple TOC IP Routing Types Stte LSA Exmple
Some Issues Dijkstr Wht hppens if some routers re much fster t trnsmitting LSPs? Wht hppens if sequence numers wrp? Wht hppens when prtitioned network is reconstituted? Wht out security? Etc., etc. Mny lines of code Every node knows the grph All link weights re >= Gol t node : Find the shortest pths from to ll the other nodes. Ech node computes the sme shortest pths so they ll gree on the routes Strtegy t node : Find the shortest pths in order of incresing pth length TOC IP Routing Types Stte LSA Issues TOC IP Routing Types Stte - Dijkstr Dijkstr Dijkstr Nottion c(i,j) >= :cost of link from (I,j) D(,i): Shortest pth from to i. D(,x,i): Shortest pth from to i vi x Let P(k) e the set of nodes k-closest to D(,)= D(,,)= P()={,} IDEA: Given P(k) we cn find P(k+) efficiently: To get P(k+), oserve tht. This node cnnot e in P(k). It must e one hop wy from some node in P(k) Suppose were flse. We picked i Node i hs no edge into P(k) There must e node x, not in P(k) such tht x is one hop wy from P(k) nd D(,i)=D(,x)+D(x,i) But then, D(,x) < D(,i) nd we would hve picked x insted. Pick node(s) tht is one hop wy from P(k) tht is closest to. Keep iterting until ll nodes re in P P()={,} D(,)= P()={,,} D(,)= P()={,,,,} D(,)= D(,)= TOC IP Routing Types Stte - Dijkstr TOC IP Routing Types Stte - Dijkstr Dijkstr - Forwrding Tle Distnce Vector Protocol At node Outgoing Cost Bellmn Ford Why does it work? Counting to Infinity Bd News Trvel Slowly Asynchronous Bellmn Ford Oscilltions TOC IP Routing Types Stte - Dijkstr TOC IP Routing Types DV
Bellmn-Ford Communicte current distnce estimtes of node to every other node This is clled its distnce vector: D i = (D(i,),D(i,),,D(i,n)) Initilly, ssume tht D(i,j) = c(i,j) if there is link ij = otherwise The nodes do not need to lern the entire topology Just the distnce estimtes (vectors) of their neighors Periodiclly ech node sends its distnce vector to ll of its neighors TOC IP Routing Types DV Bellmn-Ford C(,) = Initilly i D i (,,,,,) (,,,,, ) (,,,,, ) (,,,,, ) (,,,,,) (,,,,,) Bellmn-Ford Updte: when receive estimtes D(i,d) = min jεn(i) {c(i,j) + D(j,d)} i D i (,,,,,) (,,,,, ) (,,,,, ) (,,,,, ) (,,,,,) (,,,,,) gets updtes from nd TOC IP Routing Types DV Bellmn-Ford D(,) = min{c(,) + D(,), c(,) + D(,)} = min{ +, + } = Bellmn-Ford Focus on destintion Here re the vlues of D(i,): i step Why does this compute shortest pths? Suppose in every tick ech node sends its distnce vector. Assume tht initil distnces re At time h, node i hs s n estimte of the shortest pth to node j tht hs <= h+ hops! D h+ (i,j) = min kεn(i) {D h (k,j) + c(i,k)} TOC IP Routing Types DV Bellmn-Ford TOC IP Routing Types DV Why Counting to Infinity Bd News Trvels Slowly All links cost A B C A B C A B C M Ping-Pong to Eternity D(,)=, D(,)=, D(,)= TOC IP Routing Types DV Counting to Infinity TOC IP Routing Types DV Bd News
Bd News Trvels Slowly Asynchronous Bellmn Ford M Node tkes out M Itertions to figure out tht D(,)=M In generl, nodes re using different nd possily inconsistent estimtes If no link chnges fter some time t, the lgorithm will eventully converge to the shortest pth No synchroniztion required t ll Fundmentl Cuse: After network chnge, think of the network protocol running from time. The initil conditions re ritrry Tricks exist to get round these prolems ut not fool proof TOC IP Routing Types DV Bd News TOC IP Routing Types DV Asynchronous Oscilltions costs must reflect link speed AND congestion Under oth LSP nd DV routing occurs over tree The costs of the links of this tree will increse The other links will not e congested Their costs will drop Routing protocol will shift trffic nd crete new tree This process of shifting nd reshifting cn e severe Wy out: Chnge congestion costs slowly (exponentil verging) Route dmpening TOC IP Routing Types DV Oscilltions Oscilltions - Exmple Hevy Lod High Dely Trffic Light Lod Low Dely Light Lod Low Dely Trffic Hevy Lod High Dely TOC IP Routing Types DV Oscilltions Stte vs. Distnce Vector No cler winner LS is roust since it ech node computes its own routes independently Suffers from the weknesses of the topology updte protocol. Inconsistency etc. Excellent choice for well engineered network within one dministrtive domin E. g. OSPF DV works well when the network is lrge since it requires no synchroniztion nd hs trivil topology updte lgorithm Suffers from convergence delys Very simple to implement t ech node Excellent choice for lrge networks E.g. RIP TOC IP Routing Types LS vs. DV