E80N Introduction to Networks & The Internet Reading hapter 15 IP: Software To reate A Virtual Network Dr. hane L. Fullmer US Winter 2002 January 22 2002 E80N -- Lecture #6 1 January 22 2002 E80N -- Lecture #6 2 ommunication Protocol A common language computers use to exchange messages. Specifying exact format and meaning of each message Sending and receiving January 22 2002 E80N -- Lecture #6 3 human protocols: what s the time? I have a question Introductions specific msgs sent specific actions taken when msgs received or other events What s a protocol? network protocols: machines rather than humans all communication activity in Internet governed by protocols January 22 2002 E80N -- Lecture #6 4 Human Protocol Q: Other human protocol? What s a protocol? A B? omputer Protocol! " #%$ &'! (+* * * -. / / 0 1 2 1 3 4 5 3 6 71 5 5 3 +8+6 / 2 9 8+ :;3 * 7 <;= >?@ January 22 2002 E80N -- Lecture #6 5 Networks are complex! many pieces : hosts routers links of various media applications protocols hardware software Protocol Layers Question: Is there any hope of organizing structure of network? Or at least our discussion of networks? January 22 2002 E80N -- Lecture #6 6 1
- '( - '( Organization of air travel $ & $ ; $ # # # " +" ; +$ ; $ ;& #%$ #$ #$ "" a series of steps January 22 2002 E80N -- Lecture #6 7 Organization of air travel: a different view # $ + ; $ & #$ #$ # '# +$ "; $ & #$ "" $ Layers: each layer implements a service via its own internal-layer actions relying on services provided by layer below January 22 2002 E80N -- Lecture #6 8 Layered air travel: services # + # $ & #! ;$ +$ ''$ & # #$ " $ " # $ ; & + &$'$ & #$ #%$ # Distributed implementation of layer functionality * '. + - ( $ # + +$ ";;$ "; $ + * % & & #$ "" & #$ "" < A?=B?> @ A?@ = A =@ ='= AB' A?B $ * '. + - ( + + / ( 01 234 0562879:1 5; 01 23 4 056287 9:1 5; January 22 2002 E80N -- Lecture #6 9 01 23 4 056287 9:1 5; January 22 2002 10 Distributed implementation of layer functionality Layering Model ; $ & #$ $ + + / ( ; $ & #$ January 22 2002 11 + * < A?=B?D> @ A?@ = A = @ ='= AEB% A?DB % & Purpose is to divide and conquer complex software and hardware needed to implement services Partition services and functions needed in system into layers Each layer of service is provided by peer protocol entities Extensibility (new protocols and services easily added ommunication can be point-to-point or multipoint NODE A Layer-N Protocol Entity interface Layer-(N - 1 Protocol Entity Layer N packets (virtual communication protocol Layer-N Protocol Entity Layer-(N - 1 Protocol Entity NODE B January 22 2002 E80N -- Lecture #6 12 2
Why layering? Dealing with complex systems: explicit structure allows identification relationship of complex system s pieces layered reference model for discussion modularization eases maintenance updating of system change of implementation of layer s service transparent to rest of system e.g. change in gate procedure doesn t affect rest of system Is layering considered harmful? January 22 2002 E80N -- Lecture #6 13 Internet protocol stack application: supporting network applications ftp smtp http transport: host-host data transfer tcp udp network: routing of datagrams from source to destination ip routing protocols link: data transfer between neighboring network elements ppp ethernet physical: bits on the wire @ > A@ A < A =@<B?= A <'? A?= January 22 2002 E80N -- Lecture #6 14 > <?B% A@ > Layering: logical communication Each layer: distributed entities implement layer functions at each node entities perform actions exchange messages with peers! Layering: logical communication E.g.: transport take data from application add addressing reliability check info to form datagram send datagram to peer wait for peer to ack receipt analogy: post office " #$%&'($# " " #$%&'($# January 22 2002 E80N -- Lecture #6 15 January 22 2002 E80N -- Lecture #6 16 Layering: physical communication "! " Protocol layering and data Each layer takes data from above adds header information to create new data unit passes new data unit to layer below -/. -/0 -. -21-0 -. B +?= A'? >?DB A <@ A?< @ > A@ A < A = @<B?= A <'? A?= > <?B' A@ > @ > A@ A < A = @<B?= A <'? A?= > < *?B% A@ > -. -30 -. -21-0 -. 435 ''!%!6 5 ' 5 6 475 &!# 8 %#%69$% 4 : $% 4/5 January 22 2002 E80N -- Lecture #6 17 January 22 2002 E80N -- Lecture #6 18 3
Open Systems Interconnect (OSI Stack Proposed by the International Standards Organization Specifies the functions at each layer not the protocols that implement them Open Systems Interconnect APPLIATION PRESENTATION SESSION TRANSPORT NETWORK LINK End-user services (mail file transfer Formatting encryption compression of data Setup and management of end-to-end dialogue End-to-end delivery of messages to processes End-to-end transmission of packets in net Transmission of packets over a link Web access TP IP PPP SMA/D PHYSIAL Transmission of bit over physical media SONET January 22 2002 E80N -- Lecture #6 19 Source: Link 2 Semiconductor http://www.link2semiconductor.com/articles/dob010911_p.htm January 22 2002 E80N -- Lecture #6 20 Description of OSI layers Application layer: The application layer provides services to a calling computer program. An application layer might take care of all the downloads involved in transferring a web page (that is the text graphics and other files to a browser (the client program or application. Presentation layer: Takes care of any data format translations that might be needed to take the particular bits representing for example a number in the client computer and convert them to a "universal" number representation recognized by the communications system. Session layer: This layer is responsible for controlling exchange of information for example by having the client and server take turns transmitting data. January 22 2002 E80N -- Lecture #6 21 OSI Layers (continued Transport layer: The transport layer is responsible for getting messages from one computer to another. Network layer: The network layer is responsible for getting data across a communications network from one host computer to another. Data Link layer: The data link layer (often abbreviated to "link" layer or DLL gets data from one network node (e.g. a computer or router to another. Physical layer: The physical layer is the set of specifications that describe the actual medium of transmission. For example a physical layer specification might include the type of connectors and wire to be used in a cable linking two machines as well as the function of each wire and voltage levels that specify a "1" or "0" allowed rate of transmission and so on. January 22 2002 E80N -- Lecture #6 22 Basic Functionality: Internet Protocol (IP IP defines computer communication details. Specifying how packets are formed Specifying how routers forward each packet IP Forwarding omputers connecting to the Internet must follow the IP rules. January 22 2002 E80N -- Lecture #6 23 IP Software On Every Machine omputer hardware does not understand IP. onnecting a computer to the Internet does not mean it can use the Internet omputers need IP software before using the Internet. Windows Unix Mac OS January 22 2002 E80N -- Lecture #6 24 4
Internet Packets Are alled Datagrams IP Datagrams are packets that follow the IP specifications. Traveling across the Internet independent of sender The Illusion Of A Giant Network Any computer can send IP datagrams to any other computer providing they have IP software installed (Universal Service The Internet operates like a virtual network. January 22 2002 E80N -- Lecture #6 25 January 22 2002 E80N -- Lecture #6 26 The Virtual Network The Reality Of Internal Structure The Internet contains a complex physical structure users never see Interconnecting networks with routers Figure 15.1 The view of the Internet that IP software provides. Users and application programs treat the Internet like a single large network that allow arbitrary numbers of computers to communicate. January 22 2002 E80N -- Lecture #6 28 Internet Internal Structure Datagrams Travel In Packets IP datagram defines a standard for all Internet packets. Routers: Encloses the data before sending out the packet Data Encapsulation Figure 15.2 A small example of the physical structure that remains hidden inside the Internet. Each computer attaches to a single network; routers interconnect the networks. January 22 2002 E80N -- Lecture #6 30 5
/65 8 4 4 0 4 4 23 7-9 : ; : 8 D(4.E- 7 7 3<7 => 23 3(7? 4 8 9-0 3( - 7 7 0@42 ; 2 88 7 : 8 4 4 0 4 4-8 7 : 47-4 IP datagram format 7 -B : 8 '4. 0. * + -.. 7 3( / 4.. 3( %4 2 8 8 7 : /65 0 01 23 " 4 2 0 7 -- /5-7 4 7 -- 4 7-7 7 73 6 9 : ;. 4. 7 3( 7 4 A 7 3 : F 8 46 9. 7 : ; G B B 3< 73 8 H 0 4-4 2 8 %#% 716 6 H 8 0.: %$ % 5 5 &6# "4. 4 2 # ( % %"!# 4' B $%$'&(# ' 5 6 4/5 &# Every omputer Is Assigned A Unique Address Each computer attached to the Internet must be assigned a unique address. One computer must know the address of another before it can communicate January 22 2002 E80N -- Lecture #6 31 January 22 2002 E80N -- Lecture #6 32 Internet Addresses An Odd IP Address Syntax The unique number assigned to a computer is its Internet (IP address. Each computer (including routers need to have an IP address. omputer stores IP address in four binary units called bytes. one twenty-eight dot one fourteen dot one dot zero January 22 2002 E80N -- Lecture #6 33 January 22 2002 E80N -- Lecture #6 34 IP Addresses Are Not Random IP addresses are not random. omputers on the same network have the same prefix. January 22 2002 E80N -- Lecture #6 35 IP Addressing: introduction IP address: 32-bit identifier for host router interface interface: connection between host router and physical link router s typically have multiple interfaces host may have multiple interfaces IP addresses associated with interface not host router 223.1.1.4 223.1.2.9 223.1.3.1 223.1.3.2 = 11011111 00000001 00000001 00000001 223 1 1 1 January 22 2002 E80N -- Lecture #6 36 6
/ IP Addressing IP Addressing 223.1.1.4 IP address: network part (high order bits host part (low order bits What s a network? (from IP address perspective device interfaces with same network part of IP address can physically reach each other without intervening router 223.1.1.4 223.1.2.9 223.1.3.1 223.1.3.2 /5 4 1'0 4 /5 Ë4.% 4 1 9. 4 7 -- @ 7 H. E7? 4 1'7 -- ; How to find the networks? Detach each interface from router host create islands of isolated networks 0 4 0 - : 63 0 4 4. = 4 1 223.1.9.1 223.1.2.6 223.1.9.2 223.1.8.1 223.1.7.0 223.1.8.0 223.1.3.1 223.1.7.1 223.1.3.2 January 22 2002 E80N -- Lecture #6 37 January 22 2002 E80N -- Lecture #6 38 4 1 4 IP Addresses given notion of network let s re-examine IP addresses: * 4 1 4 ** 4 1 4 *** / 0 1 2334#576 1 1 892:;:;<=>33? @A B 3(2 0 7 "7 -- '(+*-.! " # "# $ # &% $" January 22 2002 E80N -- Lecture #6 39 IP addressing: IDR lassful addressing: inefficient use of address space address space exhaustion e.g. class B net allocated enough addresses for 65K hosts even if only 2K hosts in that network IDR: lassless InterDomain Routing network portion of address of arbitrary length address format: a.b.c.d/x where x is # bits in network portion of address 4 1 8 7 11001000 00010111 00010000 00000000 ED;D F ;G F HJIKF D;L7;G 4 8 7 January 22 2002 E80N -- Lecture #6 40 IP addresses: how to get one? Q: How does host get IP address? hard-coded by system admin in a file Wintel: control-panel->network->config->tcp/ip->properties (reboot UNIX: /etc/rc.config DHP: Dynamic Host onfiguration Protocol: dynamically get address: plug-and-play host broadcasts DHP discover msg DHP server responds with DHP offer msg host requests IP address: DHP request msg DHP server sends address: DHP ack msg IP addresses: how to get one? Network (network portion: get allocated portion of ISP s address space: ISP s block 11001000 00010111 00010000 00000000 200.23.16.0/20 Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23....... Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23 January 22 2002 E80N -- Lecture #6 41 January 22 2002 E80N -- Lecture #6 42 7
Œ Š Ž IP addressing: the last word... Q: How does an ISP get block of addresses? A: IANN: Internet orporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names resolves disputes January 22 2002 E80N -- Lecture #6 43 Hierarchical addressing: route aggregation D EGF HJIKLIMONPF M KPQRKLSLSLIHJTTUF V WXKLQ Q Ÿ Z[T\HU] ]PF MPF HJV ^ KOSJ_ HOI^`F TOHJabHOV ^cy]xiyod ^ F VUWeF V]OŸ IafKJ^`F Ÿ Vhg 8 9 :! #"! $%#! '&#" 8 9 :! #"! $(! '&#" 8 9 :! *"! #!&#" + -. / -. 01 2 3 4. 5 6'7 8 9 : ;! *"! "'#!&#" 5 67?. @. A? # B B 5 < 4 = > < = 4 January 22 2002 E80N -- Lecture #6 44 Hierarchical addressing: more specific routes D ikj[l m no[npqmfrjs mbsutgvow xum`yuxozo{ O{ zuw v }~`x~ v w#ƒ sj O{ s~o{ vo u 8 9 : #! #"#! $%#! '&*" 8 9 :! #"!! '&#" 8 9 : ;! #"! "! '&#" 8 9 :! #"#! $(#! '&*" + -. / -. 01 2 3 4. 5 6'7 # 5 6'7?. @. A? # B B : # ˆ 5 < 4 = > < = 4 A Trip Through The Internet A router must choose between two paths that both lead to the destination. hoosing the shortest path January 22 2002 E80N -- Lecture #6 45 January 22 2002 E80N -- Lecture #6 46 Getting a datagram from source to dest. IP datagram: 3 0. - /65 4 2 0 7 -- /5-7 -- - 7 7 datagram remains unchanged as it travels source to destination Œ addr fields of interest here routing table in A Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 223.1.1.4 223.1.2.9 223.1.3.1 223.1.3.2 Getting a datagram from source to dest. P * # # š œ œ' œr # #š œ œ š #ž Starting at A given IP datagram addressed to B: look up net. address of B find B is on same net. as A link layer will send datagram directly to B inside link-layer frame B and A are directly connected Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 223.1.1.4 223.1.2.9 223.1.3.1 223.1.3.2 January 22 2002 E80N -- Lecture #6 47 January 22 2002 E80N -- Lecture #6 48 8
Ž B œ A > š œ š? œ A @ Getting a datagram from source to dest. P * # # š œ œ' œh # #š œ # š #'ž Starting at A dest. E: look up network address of E E on different network A E not directly attached routing table: next hop router to E is 223.1.1.4 link layer sends datagram to router 223.1.1.4 inside link-layer frame datagram arrives at 223.1.1.4 continued.. Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 223.1.1.4 223.1.2.9 223.1.3.1 223.1.3.2 January 22 2002 E80N -- Lecture #6 49 Getting a datagram from source to dest. L Dest. next # # # #š œ œ œ # #š œ # š #'ž network router Nhops interface Arriving at 223.1.4 destined for look up network address of E E on same network as router s interface 223.1.2.9 router E directly attached link layer sends datagram to inside link-layer frame via interface 223.1.2.9 datagram arrives at!!! (hooray! 223.1.1-1 223.1.1.4 223.1.2-1 223.1.2.9 223.1.3-1 223.1.1.4 223.1.2.9 223.1.3.1 223.1.3.2 January 22 2002 E80N -- Lecture #6 50 /102 354 6798;:0 30<;0 =! "#$ %& #!' # (* +%! #-$&!. Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links link cost: delay $ cost or congestion level Routing good path: typically means minimum cost path other def s possible January 22 2002 E80N -- Lecture #6 51 Animation of Routing Algorithms Dijkstra s algorithm: http://ciips.ee.uwa.edu.au/~morris/year2/plds210/dijkstra.html Distance Vector algorithm: http://www-b2.is.tokushimau.ac.jp/~ikeda/suuri/dijkstra/dijkstraapp.shtml?demo3 http://www-mm.informatik.unimannheim.de/veranstaltungen/animation/routing/ripdvmrp/ January 22 2002 E80N -- Lecture #6 52 Routing Algorithm classification Global or decentralized information? Global: all routers have complete topology link cost info link state algorithms Decentralized: router knows physicallyconnected neighbors link costs to neighbors iterative process of computation exchange of info with neighbors distance vector algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes A Link-State Routing Algorithm Dijkstra s algorithm net topology link costs known to all nodes accomplished via link state broadcast all nodes have same info computes least cost paths from one node ( source to all other nodes gives routing table for that node iterative: after k iterations know least cost path to k dest. s Notation: c(ij: 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 January 22 2002 E80N -- Lecture #6 53 January 22 2002 E80N -- Lecture #6 54 9
( Dijkstra s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v = c(av 6 else D(v = infty 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(wv 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 January 22 2002 E80N -- Lecture #6 55 Step 0 1 2 3 4 5 Dijkstra s algorithm: example start N A AD ADE ADEB ADEB ADEBF D(Bp(B 2A 2A 2A D(p( D(Dp(D 5A 1A 4D 3E 3E D(Ep(E infinity 2D D(Fp(F infinity infinity 4E 4E 4E January 22 2002 E80N -- Lecture #6 56 Dijkstra s algorithm discussion Algorithm complexity: n nodes each iteration: need to check all nodes w not in N n*(n+1/2 comparisons: O(n**2 more efficient implementations possible: O(nlogn Oscillations possible: e.g. link cost = amount of carried traffic! #"! #" '%! #" % & $" January 22 2002 E80N -- Lecture #6 57 Distance Vector Routing Algorithm iterative: continues until no nodes exchange info. self-terminating: no signal to stop asynchronous: nodes need not exchange info/iterate in lock step! distributed: each node communicates only with directly-attached neighbors Distance Table data structure each node has its own row for each possible destination column for each directly-attached neighbor to node example: in node X for dest. Y via neighbor Z: X D (YZ distance from X to Y via Z as next hop Z c(xz + min {D (Yw} w January 22 2002 E80N -- Lecture #6 58 = = E D (D E D (AD E D (AB Distance Table: example D c(ed + min {D (w} w = = 2+2 = 4 D c(ed + min {D (Aw} w * ++- = = 2+3 = 5 B c(eb + min {D (Aw} w = = 8+6 = 14 * ++- cost to destination via E D ( A B D January 22 2002 E80N -- Lecture #6 59 destination A B D 1 7 6 4 14 8 9 11 5 5 4 2 Distance table gives routing table cost to destination via E D ( A B D destination A B 1 7 6 14 8 9 5 5 4 D 4 11 2 D D4.0/ 1#2436567689263;:=< 8 >!?6@ 2;/ 56A243;:=< 8 January 22 2002 E80N -- Lecture #6 60 destination A B Outgoing link to use cost A1 D5 D4 10
Distance Vector Routing: overview Iterative asynchronous: Each local iteration caused by: local link cost change message from neighbor: its least cost path change from neighbor Distributed: each node notifies neighbors only when its least cost path to any destination changes neighbors then notify their neighbors if necessary 367 5? 8 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 Distance Vector Algorithm: 2 3 < <45? 8 1 1 Initialization: 2 for all adjacent nodes v: 3 D X(*v = infty /* the * operator means "for all rows" */ X 4 D (vv = c(xv 5 for all destinations y X 6 send min D (yw to each neighbor /* w over all X s neighbors */ w January 22 2002 E80N -- Lecture #6 61 January 22 2002 E80N -- Lecture #6 62 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 11 12 if (c(xv 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 X (yv = D X (yv + d 16 17 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 w D V (Yw */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D X (YV = c(xv + newval 22 23 if we have a new min w D X (Ywfor any destination Y 24 send new value of min w D X (Yw to all neighbors 25 26 forever E80N -- Lecture #6 63 omparison of LS and DV algorithms Message complexity LS: with n nodes E links O(nE msgs sent each DV: exchange between neighbors only convergence time varies Speed of onvergence LS: O(n 2 algorithm requires O(nE msgs may have oscillations DV: convergence time varies may be routing loops Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes only its own table DV: DV node can advertise incorrect path cost each node s table used by others error propagate thru network count-to-infinity problem January 22 2002 E80N -- Lecture #6 64 IMP: Internet ontrol Message Protocol used by hosts routers gateways to communication network-level information error reporting: unreachable host network port protocol echo request/reply (used by ping network-layer above IP: IMP msgs carried in IP datagrams IMP message: type code plus first 8 bytes of IP datagram causing error Type ode 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 Summary Protocols and protocol stack Internet stack OSI stack IP addressing IP forwarding Routing Link State Distance Vector January 22 2002 E80N -- Lecture #6 65 January 22 2002 E80N -- Lecture #6 66 11
Glossary Protocol The rules two or more computers must follow to exchange messages Internet Protocol (IP Specification for the format of packets computers use when communicating across the Internet IP Datagram A packet of data sent across the Internet Glossary Virtual Network Appearance of a single seamless network system Internet Address (IP Address An unique number assigned to a computer attached to the Internet January 22 2002 E80N -- Lecture #6 67 January 22 2002 E80N -- Lecture #6 68 12