Network Lyer Frgmentering och hopsättning Gols: understnd principles behind network lyer services: routing (pth selection) deling with scle how router works dvnced topics: IPv6, multicst instntition nd implementtion in the Internet Overview: lst time network lyer services IP ddressing routing principle: pth selection tody IP hierrchicl routing Internet routing protocols relible trnsfer intr-domin inter-domin wht s inside router? IPv6 multicst routing Ident Flgs Offset MTU vrierr i olik nät, två vl All pket tillräckligt små Frgmentering och hopsättning All frgment hr smm Ident Tpps ett frgment slängs ll Vrje frgment fullständigt IP-dtgrm Hopsättning hos mottgren Designt för ytterligre frgmentering Network 2 1 Network 2 4 The Internet Network lyer Host, router network lyer functions: Network lyer Routing protocols pth selection RIP, OSPF, BGP Trnsport lyer: TCP, UDP routing tble Link lyer physicl lyer IP protocol ddressing conventions dtgrm formt pcket hndling conventions ICMP protocol error reporting router signling IP Frgmenttion nd Ressembly =4000 ID =x frgflg =0 =0 One lrge dtgrm becomes severl smller dtgrms =1500 =1500 =1040 ID =x ID =x ID =x frgflg =1 frgflg =1 frgflg =0 =0 =1480 =2960 Network 2 2 Network 2 5 IP dtgrm formt IP protocol version number heder (32-bit words) type of dt mx number remining hops (decremented t ech router) upper lyer protocol to deliver pylod to 32 bits ver hed. type of len service 16-bit identifier flgs frgment time to upper Internet live lyer checksum 32 bit source IP ddress 32 bit destintion IP ddress Options (if ny) dt (vrible, typiclly TCP or UDP segment) totl dtgrm (bytes) for frgmenttion/ ressembly E.g. timestmp, record route tken, specify list of routers to visit. ICMP: Internet Control Messge Protocol used by hosts, routers, gtewys to communicte network-level informtion error reporting: unrechble host, network, port, protocol echo request/reply (used by ping) network-lyer bove IP: ICMP msgs crried in IP dtgrms ICMP messge: type, code plus first 8 bytes of IP dtgrm cusing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unrechble 3 1 dest host unrechble 3 2 dest protocol unrechble 3 3 dest port unrechble 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 dvertisement 10 0 router discovery 11 0 TTL expired 12 0 bd IP heder Network 2 3 Network 2 6 1
Sklbrhet 2 7 + 2 14 + 2 21 olik nätverksdresser i IP Det blir stor tbeller om vrje router sk hitt ll nätverk Hur får mn routing tt skl? Hierrchicl Routing Our routing study thus fr - ideliztion ll routers identicl network flt not true in prctice scle: with 50 million destintions: cn t store ll dest s in routing tbles! routing tble exchnge would swmp links! dministrtive utonomy internet = network of networks ech network dmin my wnt to control routing in its own network Network 2 7 Network 2 10 Forwrding lgortim Hierrchicl Routing Om direkt koppld till destintionens nätverk - skick direkt till destintion nnrs om destintionen finns i forwrding tbellen - skick till NextHop routern nnrs -skick till defult routern Forwrding tbell R2 NetworkNum NextHop 1 R3 2 R1 3 interfce 1 4 interfce 0 H1 Network 2 (Ethernet) R1 H4 H2 H3 Network 3 (FDDI) R2 Network 1 (Ethernet) H7 R3 H8 Network 4 (point-to-point) ggregte routers into regions, utonomous systems (AS) routers in sme AS run sme routing protocol intr-as routing protocol routers in different AS cn run different intr- AS routing protocol gtewy routers specil routers in AS run intr-as routing protocol with ll other routers in AS lso responsible for routing to destintions outside AS run inter-as routing protocol with other gtewy routers H5 H6 Network 2 8 Network 2 11 DHCP Intr-AS nd Inter-AS routing A new node needs n IP-ddress: hrd-coded by system dmin in file DHCP: Dynmic Host Configurtion Protocol: dynmiclly get ddress: plug-nd-ply host brodcsts DHCP discover msg DHCP server responds with DHCP offer msg host requests IP ddress: DHCP request msg DHCP server sends ddress: DHCP ck msg An exmple on scling of network dministrtion C C.b b d A A. b inter-as, intr-as routing in gtewy A.c A.c c B. B c Gtewys: perform inter-as routing mongst themselves b perform intr-as routers with other routers in their AS network lyer link lyer physicl lyer Network 2 9 Network 2 12 2
Intr-AS nd Inter-AS routing RIP ( Routing Informtion Protocol) Inter-AS C.b routing between A. A nd B b A.c C Host d h1 c A b Intr-AS routing within AS A B. Host c h2 b B Intr-AS routing within AS B Distnce vector lgorithm Included in BSD-UNIX Distribution in 1982 Distnce metric: # of hops (mx = 15 hops) Cn you guess why? Distnce vectors: exchnged every 30 sec vi Response Messge (lso clled dvertisement) Ech dvertisement: route to up to 25 destintion nets RIP v1 RFC 1058 RIP v2 RFC 1723 Network 2 13 Network 2 16 Routing in the Internet The Globl Internet consists of Autonomous Systems (AS) interconnected with ech other: Stub AS: smll corportion Multihomed AS: lrge corportion (no trnsit) Trnsit AS: provider Two-level routing: Intr-AS: dministrtor is responsible for choice Inter-AS: unique stndrd RIP: Link Filure nd Recovery If no dvertisement herd fter 180 sec --> neighbor/link declred ded routes vi neighbor invlidted new dvertisements sent to neighbors neighbors in turn send out new dvertisements (if tbles chnged) link filure info quickly propgtes to entire net poison reverse used to prevent ping-pong loops (infinite distnce = 16 hops) Network 2 14 Network 2 17 Intr-AS Routing RIP Tble processing Also known s Interior Gtewy Protocols (IGP) Most common IGPs: RIP: Routing Informtion Protocol OSPF: Open Shortest Pth First RIP routing tbles mnged by ppliction-level process clled route-d (demon) dvertisements sent in UDP pckets, periodiclly repeted IGRP: Interior Gtewy Routing Protocol (Cisco propr.) Network 2 15 Network 2 18 3
RIP Tble exmple (continued) Hierrchicl OSPF Router: giroflee.eurocom.fr Destintion Gtewy Flgs Ref Use Interfce -------------------- -------------------- ----- ----- ------ --------- 127.0.0.1 127.0.0.1 UH 0 26492 lo0 192.168.2. 192.168.2.5 U 2 13 f0 193.55.114. 193.55.114.6 U 3 58503 le0 192.168.3. 192.168.3.5 U 2 25 q0 224.0.0.0 193.55.114.6 U 3 0 le0 defult 193.55.114.129 UG 0 143454 Three ttched clss C networks (LANs) Router only knows routes to ttched LANs Defult router used to go up Route multicst ddress: 224.0.0.0 Loopbck interfce (for debugging) Two-level hierrchy: locl re, bckbone Link-stte dvertisements only in re ech nodes hs detiled re topology; only know direction (shortest pth) to nets in other res. Are border routers: summrize distnces to nets in own re, dvertise to other Are Border routers. Bckbone routers: run OSPF routing limited to bckbone. Boundry routers: connect to other ASs. Network 2 19 Network 2 22 OSPF (Open Shortest Pth First) open : publicly vilble, v2 RFC 2178 Uses Link Stte lgorithm LS pcket dissemintion Topology mp t ech node Route computtion using Dijkstr s lgorithm OSPF dvertisement crries one entry per neighbor router Advertisements disseminted to entire AS (vi flooding) IGRP (Interior Gtewy Routing Protocol) CISCO proprietry; successor of RIP (mid 80s) Distnce Vector, like RIP severl cost metrics (dely, bndwidth, relibility, lod etc) uses TCP to exchnge routing updtes Loop-free routing vi Distributed Updting Alg. (DUAL) bsed on diffused computtion Network 2 20 Network 2 23 OSPF dvnced fetures (not in RIP) Security: ll OSPF messges uthenticted (to prevent mlicious intrusion); TCP connections used Multiple sme-cost pths llowed (only one pth in RIP) For ech link, multiple cost metrics for different TOS (eg, stellite link cost set low for best effort; high for rel time) Integrted uni- nd multicst support: Multicst OSPF (MOSPF) uses sme topology dt bse s OSPF Hierrchicl OSPF in lrge domins. Internet AS Hierrchy Intr-AS border (exterior gtewy) routers Inter-AS interior (gtewy) routers Network 2 21 Network 2 24 4
Internet inter-as routing: BGP BGP (Border Gtewy Protocol): the de fcto stndrd Pth Vector protocol: similr to Distnce Vector protocol ech Border Gtewy brodcst to neighbors (peers) entire pth (I.e, sequence of ASs) to destintion E.g., Gtewy X my send its pth to dest. Z: Pth (X,Z) = X,Y1,Y2,Y3,,Z Why different Intr- nd Inter-AS routing? Policy: Intr-AS: single dmin, so no policy decisions needed Inter-AS: dmin wnts control over how its trffic routed, who routes through its net. Scle: hierrchicl routing sves tble size, reduced updte trffic Performnce: Intr-AS: cn focus on performnce Inter-AS: policy my dominte over performnce Network 2 25 Network 2 28 Internet inter-as routing: BGP Suppose: gtewy X send its pth to peer gtewy W W my or my not select pth offered by X cost, policy (don t route vi competitors AS), loop prevention resons. If W selects pth dvertised by X, then: Pth (W,Z) = w, Pth (X,Z) Note: X cn control incoming trffic by controlling its route dvertisements to peers: e.g., don t wnt to route trffic to Z -> don t dvertise ny routes to Z Hur får mn routing tt skl mer? Adressnvändning Adresser får inte t slut Klss C med 2 hosts (2/255 = 0.78%) Klss B med 256 hosts (256/65535 = 0.39%) Sklbilitet för routing Routingtbeller sklr ej IGP sklr ej Network 2 26 Network 2 29 Internet inter-as routing: BGP Subnetting BGP messges exchnged using TCP. BGP messges: OPEN: opens TCP connection to peer nd uthentictes sender UPDATE: dvertises new pth (or withdrws old) KEEPALIVE keeps connection live in bsence of UPDATES; lso ACKs OPEN request NOTIFICATION: reports errors in previous msg; lso used to close connection Subnät ny nivå till dress/routing hierrkin Subnätmsken definierr vribel del v hostdelen => subnät nummer Subnät syns br i ktuellt nätverk Network number Host number Clss B ddress 111111111111111111111111 00000000 Subnet msk (255.255.255.0) Network number Subnet ID Subnetted ddress Host ID Network 2 27 Network 2 30 5
Subnät exempel Clssless InterDomin Routing Subnet msk: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 128.96.34.1 H1 R1 Subnet msk: 255.255.255.128 128.96.34.130 Subnet number: 128.96.34.128 128.96.34.139 128.96.34.129 H2 R2 H3 128.96.33.1 128.96.33.14 Subnet msk: 255.255.255.0 Subnet number: 128.96.33.0 Forwrding tble t router R1 Subnet Number Subnet Msk Next Hop 128.96.34.0 255.255.255.128 interfce 0 128.96.34.128 255.255.255.128 interfce 1 128.96.33.0 255.255.255.0 R2 Del ut block v kontinuerlig nätverksnummer till närliggnde nätverk Representer block med (first_network_ddress, count), 130.239.40/21 Begräns storlekr till potens v 2 All routrr måste förstå CIDR Möjligt tt slå ihop dresser rekursivet Längst möjlig mtch i router Network 2 31 Network 2 34 Forwrding lgoritm D = destintion IP ddress for ech entry (SubnetNum, SubnetMsk, NextHop) D1 = SubnetMsk & D if D1 = SubnetNum if NextHop is n interfce deliver dtgrm directly to D else deliver dtgrm to NextHop Använd defult router om inget mtchr Inte nödvändigt med smmnhängnde 1 or Möjligt tt h fler subnät på ett fysiskt nätverk Subnät syns ej ifrån resten v Internet Hierrchicl ddressing: more specific routes ISPs-R-Us hs more specific route to Orgniztion 1 Orgniztion 0 200.23.16.0/23 Orgniztion 2 200.23.20.0/23 Orgniztion 7. 200.23.30.0/23 Orgniztion 1 200.23.18.0/23.. Fly-By-Night-ISP ISPs-R-Us Send me nything with ddresses beginning 200.23.16.0/20 Send me nything with ddresses beginning 199.31.0.0/16 or 200.23.18.0/23 Internet Network 2 32 Network 2 35 Supernetting Om ll som vill h klss B dresser får det blir det dåligt utnyttjnde Om ll istället får klss C dresser ökr routingtbellerns storlek Lösning: Supernetting - CIDR Clssless InterDomin Routing Subnetting och CIDR: sklbiliteten Subnetting Hjälper till tt lös sklbilitetsproblemet Ny fysisk nätverk kn läggs till utn tt nvänd ny Klss B eller C nätverksdresser Smlr ihop informtion CIDR Kortre routingtbeller Slår ihop routinginformtion Spr dresser Del ut block v kontinuerlig nätverksnummer istället för dresser för större nätverksklss Network 2 33 Network 2 36 6
Sklbr nätverk Interdomän routing för tt hitt rätt AS Färre AS än nätverk Intrdomän routing för tt hitt rätt nätverk i AS Färre nätverk i en domän än i hel Internet CIDR Slår ihop routing informtion Subnetting Subnät syns ej utåt ARP (näst lger) Hitt rätt host i ett nätverk (subnät) Sklbilitet viktigre än optiml väg Input Port Queuing Fbric slower tht input ports combined -> queueing my occur t input queues Hed-of-the-Line (HOL) blocking: queued dtgrm t front of queue prevents others in queue from moving forwrd queueing dely nd loss due to input buffer overflow! Network 2 37 Network 2 40 Router Architecture Overview Two key router functions: run routing lgorithms/protocol (RIP, OSPF, BGP) switching dtgrms from incoming to outgoing link Network 2 38 Three types of switching fbrics Vi memory First genertion routers: pcket copied by system s (single) CPU speed limited by memory bndwidth (2 bus crossings per dtgrm) Modern routers: input port processor performs lookup, copy into memory Vi bus dtgrm from input port memory to output port memory vi shred bus bus contention: Vi n interconection network switching overcome bus bndwidth speed limittions limited by Advnced design: frgmenting dtgrm into fixed cells, switch bus bndwidth cells through the fbric. Network 2 41 Input Port Functions Output Ports Physicl lyer: bit-level reception Dt link lyer: e.g., Ethernet see chpter 5 Decentrlized switching: given dtgrm dest., lookup output port using routing tble in input port memory gol: complete input port processing t line speed queuing: if dtgrms rrive fster thn forwrding rte into switch fbric Buffering required when dtgrms rrive from fbric fster thn the trnsmission rte Scheduling discipline chooses mong queued dtgrms for trnsmission Network 2 39 Network 2 42 7
Output port queueing Dul Stck Approch buffering when rrivl rte vi switch exceeeds ouput line speed queueing (dely) nd loss due to output port buffer overflow! Network 2 43 Network 2 46 IPv6 Initil motivtion: 32-bit ddress spce completely llocted by 2008 or 2018 or Additionl motivtion: heder formt helps speed processing/forwrding heder chnges to fcilitte QoS new nycst ddress: route to best of severl replicted servers IPv6 dtgrm formt: fixed- 40 byte heder no frgmenttion llowed Tunneling IPv6 inside IPv4 where needed Network 2 44 Network 2 47 Trnsition From IPv4 To IPv6 Multicst routing Not ll routers cn be upgrded simultneous no flg dys How will the network operte with mixed IPv4 nd IPv6 routers? Two proposed pproches: Dul Stck: some routers with dul stck (v6, v4) cn trnslte between formts Tunneling: IPv6 crried s pylod in IPv4 dtgrm mong IPv4 routers Unicst Enkelt, men bndbreddskrävnde Multicst Mindre ntl pket, men kräver support från nätverkslgret Network 2 45 Network 2 48 8
Multicst routing (forts) Problem Hur identifiers mottgrn v multicst-meddelnden? Hur dressers ett dtgrm till dem? Lösning ddress indirection, en identifierre för hel multicst grupp Clss D multicst-dresser Multicst routing - generellt Mål: Hitt ett träd med ll routrr Iblnd måste ndr routrr involvers Två vrinter: Group-shred tree, endst ett träd Source-bsed trees, ett träd för vrje sändre Network 2 49 Network 2 52 Multicst routing - frågor Hur strtr och slutr en grupp? Hur väljs gruppdress? Hur nsluter mn till befintlig grupp? Kn vem som helst nslut sig? Känner mn till vilk övrig som är nslutn? Hur smrbetr routrrn? Involverr IGMP Multicst routing i Internet DVMRP Distnce Vector Multicst Routing Protocol Source-bsed MOSPF Multicst OSPF Source-bsed CBT Core Bsed Trees Group-shred PIM Protocol Independent Multicst Dense mode liknr DVMRP Sprse mode group-shred Melln AS DVMRP Men inte helt lyckt Network 2 50 Network 2 53 IGMP Network Lyer: Summry Internet Group Mngement Protocol Melln host och först router Kn ej identifier ndr i gruppen Tre typer v meddelnden Membership query, membership report, leve group Körs över IP Receiver-driven Gols: understnd principles behind network lyer services: routing (pth selection) deling with scle how router works dvnced topics: IPv6, multicst instntition nd implementtion in the Internet Overview: network lyer services IP ddressing routing principle: pth selection IP hierrchicl routing Internet routing protocols relible trnsfer intr-domin inter-domin wht s inside router? IPv6 multicst routing Network 2 51 Network 2 54 9