Network Layer. The Internet Network layer. IP datagram format



Similar documents
Based on Computer Networking, 4 th Edition by Kurose and Ross

Network layer: Overview. Network layer functions IP Routing and forwarding

Routing Protocols. Interconnected ASes. Hierarchical Routing. Hierarchical Routing

IP addressing and forwarding Network layer

Advanced Networking Routing: RIP, OSPF, Hierarchical routing, BGP

Datagram-based network layer: forwarding; routing. Additional function of VCbased network layer: call setup.

Internet Protocols Fall Lectures 7-8 Andreas Terzis

Chapter 4 Network Layer

Route Discovery Protocols

Chapter 4 Network Layer

8.2 The Internet Protocol

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

CS 78 Computer Networks. Internet Protocol (IP) our focus. The Network Layer. Interplay between routing and forwarding

Introduction to LAN/WAN. Network Layer (part II)

Internetworking and Internet-1. Global Addresses

Classful IP Addressing. Classless Addressing: CIDR. Routing & Forwarding: Logical View of a Router. IP Addressing: Basics

Introduction to TCP/IP

Network Layer: Network Layer and IP Protocol

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

CS 43: Computer Networks IP. Kevin Webb Swarthmore College November 5, 2013

Inter-domain Routing Basics. Border Gateway Protocol. Inter-domain Routing Basics. Inter-domain Routing Basics. Exterior routing protocols created to:

Border Gateway Protocol (BGP)

Lecture Computer Networks

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

The Network Layer. Raj Jain. Washington University in St. Louis

IP address format: Dotted decimal notation:

IP - The Internet Protocol

The Internet. Internet Technologies and Applications

Компјутерски Мрежи NAT & ICMP

Computer Networks. Main Functions

IP Multicasting. Applications with multiple receivers

Internet Protocol: IP packet headers. vendredi 18 octobre 13

Inter-domain Routing. Outline. Border Gateway Protocol

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

Introduction to IP v6

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

Transport and Network Layer

Future Internet Technologies

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ

IP Address Classes (Some are Obsolete) Computer Networking. Important Concepts. Subnetting Lecture 8 IP Addressing & Packets

Dynamic Routing Protocols II OSPF. Distance Vector vs. Link State Routing

CSE331: Introduction to Networks and Security. Lecture 8 Fall 2006

NETWORK LAYER/INTERNET PROTOCOLS

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Computer Networks. Lecture 3: IP Protocol. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

CSC458 Lecture 6. Homework #1 Grades. Inter-domain Routing IP Addressing. Administrivia. Midterm will Cover Following Topics

Subnetting,Supernetting, VLSM & CIDR

04 Internet Protocol (IP)

Module 7. Routing and Congestion Control. Version 2 CSE IIT, Kharagpur

Outline. Internet Routing. Alleviating the Problem. DV Algorithm. Routing Information Protocol (RIP) Link State Routing. Routing algorithms

Internetworking. Problem: There is more than one network (heterogeneity & scale)

Faculty of Engineering Computer Engineering Department Islamic University of Gaza Network Chapter# 19 INTERNETWORK OPERATION

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Border Gateway Protocol (BGP-4)

10CS64: COMPUTER NETWORKS - II

ITRI CCL. IP Routing Primer. Paul C. Huang, Ph.D. ITRI / CCL / N300. CCL/N300; Paul Huang 1999/6/2 1

Data Center Networks and Basic Switching Technologies

What is a DoS attack?

- Multicast - Types of packets

The Network Layer. Raj Jain. Washington University in St. Louis

Introduction to IP Multicast Routing

How To Understand Bg

Layer 3 Routing User s Manual

Internet Protocol (IP) IP - Network Layer. IP Routing. Advantages of Connectionless. CSCE 515: Computer Network Programming IP routing

IP addressing. Interface: Connection between host, router and physical link. IP address: 32-bit identifier for host, router interface

CS Computer Networks 1: Routing Algorithms

Internet Peering, IPv6, and NATs. Mike Freedman V Networks

Gary Hecht Computer Networking (IP Addressing, Subnet Masks, and Packets)

CHAPTER 10 IP MULTICAST

IP Addressing Introductory material.

RARP: Reverse Address Resolution Protocol

DHCP, ICMP, IPv6. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley DHCP. DHCP UDP IP Eth Phy

IP Routing Configuring RIP, OSPF, BGP, and PBR

Chapter 6 Configuring IP

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

IP Addressing. IP Addresses. Introductory material.

Protocol Specification & Design. The Internet and its Protocols. Course Outline (trivia) Introduction to the Subject Teaching Methods

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

Routing Protocols (RIP, OSPF, BGP)

Internet inter-as routing: BGP

Data Networking and Architecture. Delegates should have some basic knowledge of Internet Protocol and Data Networking principles.

Interconnecting Cisco Networking Devices Part 2

Exterior Gateway Protocols (BGP)

Routing in Small Networks. Internet Routing Overview. Agenda. Routing in Large Networks

: Interconnecting Cisco Networking Devices Part 2 v1.1

Textbook Required: Cisco Networking Academy Program CCNP: Building Scalable Internetworks v5.0 Lab Manual.

Answers to Sample Questions on Network Layer

CS335 Sample Questions for Exam #2

Telematics. 9th Tutorial - IP Model, IPv6, Routing

Router and Routing Basics

Internet Infrastructure Measurement: Challenges and Tools

OSPF Version 2 (RFC 2328) Describes Autonomous Systems (AS) topology. Propagated by flooding: Link State Advertisements (LSAs).

Transcription:

Network Layer Goals: understand principles behind network layer services: routing (path selection) dealing with scale how a router works advanced topics: IPv6, multicast instantiation and implementation in the Internet Overview: last time network layer services IP addressing routing principle: path selection today IP hierarchical routing Internet routing protocols reliable transfer intra-domain inter-domain what s inside a router? IPv6 multicast routing Network 2 1 The Internet Network layer Host, router network layer functions: Transport layer: TCP, UDP Network layer Routing protocols path selection RIP, OSPF, BGP routing table IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router signaling Link layer physical layer Network 2 2 IP datagram format IP protocol version number header length (32-bit words) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to 32 bits ver head. type of len service length 16-bit identifier flgs fragment offset time to upper Internet live layer checksum 32 bit source IP address 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) total datagram length (bytes) for fragmentation/ reassembly E.g. timestamp, record route taken, specify list of routers to visit. Network 2 3 1

Fragmentering och hopsättning Ident Flags Offset MTU varierar i olika nät, två val Alla paket tillräckligt små Fragmentering och hopsättning Alla fragment har samma Ident Tappas ett fragment slängs alla Varje fragment fullständigt IP-datagram Hopsättning hos mottagaren Designat för ytterligare fragmentering Network 2 4 IP Fragmentation and Reassembly length =4000 ID =x fragflag =0 offset =0 One large datagram becomes several smaller datagrams length =1500 length =1500 length =1040 ID =x ID =x ID =x fragflag =1 fragflag =1 fragflag =0 offset =0 offset =1480 offset =2960 Network 2 5 ICMP: Internet Control Message Protocol used by hosts, routers, gateways to communicate network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer above IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error 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 Network 2 6 2

Skalbarhet 2 7 + 2 14 + 2 21 olika nätverksadresser i IP Det blir stora tabeller om varje router ska hitta alla nätverk Hur får man routing att skala? Network 2 7 Forwarding algortim Om direkt kopplad till destinationens nätverk - skicka direkt till destination annars om destinationen finns i forwarding tabellen - skicka till NextHop routern annars -skicka till default routern Forwarding tabell R2 NetworkNum NextHop 1 R3 2 R1 3 interface 1 4 interface 0 H1 Network 2 (Ethernet) R1 H4 H2 H3 Network 3 (FDDI) R2 Network 1 (Ethernet) H7 R3 H8 Network 4 (point-to-point) H5 H6 Network 2 8 DHCP A new node needs an IP-address: hard-coded by system admin in a file DHCP: Dynamic Host Configuration Protocol: dynamically get address: plug-and-play host broadcasts DHCP discover msg DHCP server responds with DHCP offer msg host requests IP address: DHCP request msg DHCP server sends address: DHCP ack msg An example on scaling of network administration Network 2 9 3

Hierarchical Routing Our routing study thus far - idealization all routers identical network flat not true in practice scale: with 50 million destinations: can t store all dest s in routing tables! routing table exchange would swamp links! administrative autonomy internet = network of networks each network admin may want to control routing in its own network Network 2 10 Hierarchical Routing aggregate routers into regions, autonomous systems (AS) routers in same AS run same routing protocol intra-as routing protocol routers in different AS can run different intra- AS routing protocol gateway routers special routers in AS run intra-as routing protocol with all other routers in AS also responsible for routing to destinations outside AS run inter-as routing protocol with other gateway routers Network 2 11 Intra-AS and Inter-AS routing a C.b b C d A A.a a b A.c c B.a a B c Gateways: perform inter-as routing amongst themselves b perform intra-as routers with other routers in their AS inter-as, intra-as routing in gateway A.c network layer link layer physical layer Network 2 12 4

Intra-AS and Inter-AS routing Inter-AS C.b routing between A.a A and B b a A.c C a Host d h1 c A b Intra-AS routing within AS A B.a Host c h2 a b B Intra-AS routing within AS B Network 2 13 Routing in the Internet The Global Internet consists of Autonomous Systems (AS) interconnected with each other: Stub AS: small corporation Multihomed AS: large corporation (no transit) Transit AS: provider Two-level routing: Intra-AS: administrator is responsible for choice Inter-AS: unique standard Network 2 14 Intra-AS Routing Also known as Interior Gateway Protocols (IGP) Most common IGPs: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco propr.) Network 2 15 5

RIP ( Routing Information Protocol) Distance vector algorithm Included in BSD-UNIX Distribution in 1982 Distance metric: # of hops (max = 15 hops) Can you guess why? Distance vectors: exchanged every 30 sec via Response Message (also called advertisement) Each advertisement: route to up to 25 destination nets RIP v1 RFC 1058 RIP v2 RFC 1723 Network 2 16 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) link failure info quickly propagates to entire net poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) Network 2 17 RIP Table processing RIP routing tables managed by application-level process called route-d (daemon) advertisements sent in UDP packets, periodically repeated Network 2 18 6

RIP Table example (continued) Router: giroflee.eurocom.fr Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 127.0.0.1 127.0.0.1 UH 0 26492 lo0 192.168.2. 192.168.2.5 U 2 13 fa0 193.55.114. 193.55.114.6 U 3 58503 le0 192.168.3. 192.168.3.5 U 2 25 qaa0 224.0.0.0 193.55.114.6 U 3 0 le0 default 193.55.114.129 UG 0 143454 Three attached class C networks (LANs) Router only knows routes to attached LANs Default router used to go up Route multicast address: 224.0.0.0 Loopback interface (for debugging) Network 2 19 OSPF (Open Shortest Path First) open : publicly available, v2 RFC 2178 Uses Link State algorithm LS packet dissemination Topology map at each node Route computation using Dijkstra s algorithm OSPF advertisement carries one entry per neighbor router Advertisements disseminated to entire AS (via flooding) Network 2 20 OSPF advanced features (not in RIP) Security: all OSPF messages authenticated (to prevent malicious intrusion); TCP connections used Multiple same-cost paths allowed (only one path in RIP) For each link, multiple cost metrics for different TOS (eg, satellite link cost set low for best effort; high for real time) Integrated uni- and multicast support: Multicast OSPF (MOSPF) uses same topology data base as OSPF Hierarchical OSPF in large domains. Network 2 21 7

Hierarchical OSPF Two-level hierarchy: local area, backbone Link-state advertisements only in area each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. Area border routers: summarize distances to nets in own area, advertise to other Area Border routers. Backbone routers: run OSPF routing limited to backbone. Boundary routers: connect to other ASs. Network 2 22 IGRP (Interior Gateway Routing Protocol) CISCO proprietary; successor of RIP (mid 80s) Distance Vector, like RIP several cost metrics (delay, bandwidth, reliability, load etc) uses TCP to exchange routing updates Loop-free routing via Distributed Updating Alg. (DUAL) based on diffused computation Network 2 23 Internet AS Hierarchy Intra-AS border (exterior gateway) routers Inter-AS interior (gateway) routers Network 2 24 8

Internet inter-as routing: BGP BGP (Border Gateway Protocol): the de facto standard Path Vector protocol: similar to Distance Vector protocol each Border Gateway broadcast to neighbors (peers) entire path (I.e, sequence of ASs) to destination E.g., Gateway X may send its path to dest. Z: Path (X,Z) = X,Y1,Y2,Y3,,Z Network 2 25 Internet inter-as routing: BGP Suppose: gateway X send its path to peer gateway W W may or may not select path offered by X cost, policy (don t route via competitors AS), loop prevention reasons. If W selects path advertised by X, then: Path (W,Z) = w, Path (X,Z) Note: X can control incoming traffic by controlling its route advertisements to peers: e.g., don t want to route traffic to Z -> don t advertise any routes to Z Network 2 26 Internet inter-as routing: BGP BGP messages exchanged using TCP. BGP messages: OPEN: opens TCP connection to peer and authenticates sender UPDATE: advertises new path (or withdraws old) KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request NOTIFICATION: reports errors in previous msg; also used to close connection Network 2 27 9

Why different Intra- and Inter-AS routing? Policy: Intra-AS: single admin, so no policy decisions needed Inter-AS: admin wants control over how its traffic routed, who routes through its net. Scale: hierarchical routing saves table size, reduced update traffic Performance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance Network 2 28 Hur får man routing att skala mer? Adressanvändning Adresser får inte ta slut Klass C med 2 hosts (2/255 = 0.78%) Klass B med 256 hosts (256/65535 = 0.39%) Skalabilitet för routing Routingtabeller skalar ej IGP skalar ej Network 2 29 Subnetting Subnät ny nivå till adress/routing hierarkin Subnätmasken definierar variabel del av hostdelen => subnät nummer Subnät syns bara i aktuellt nätverk Network number Host number Class B address 111111111111111111111111 00000000 Subnet mask (255.255.255.0) Network number Subnet ID Subnetted address Host ID Network 2 30 10

Subnät exempel Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 128.96.34.1 H1 R1 Subnet mask: 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 mask: 255.255.255.0 Subnet number: 128.96.33.0 Forwarding table at router R1 Subnet Number Subnet Mask Next Hop 128.96.34.0 255.255.255.128 interface 0 128.96.34.128 255.255.255.128 interface 1 128.96.33.0 255.255.255.0 R2 Network 2 31 Forwarding algoritm D = destination IP address for each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to D else deliver datagram to NextHop Använd default router om inget matchar Inte nödvändigt med sammanhängande 1 or Möjligt att ha flera subnät på ett fysiskt nätverk Subnät syns ej ifrån resten av Internet Network 2 32 Supernetting Om alla som vill ha klass B adresser får det blir det dåligt utnyttjande Om alla istället får klass C adresser ökar routingtabellernas storlek Lösning: Supernetting - CIDR Classless InterDomain Routing Network 2 33 11

Classless InterDomain Routing Dela ut block av kontinuerliga nätverksnummer till närliggande nätverk Representera block med (first_network_address, count), 130.239.40/21 Begränsa storlekar till potens av 2 Alla routrar måste förstå CIDR Möjligt att slå ihop adresser rekursivet Längsta möjliga match i router Network 2 34 Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 Organization 0 200.23.16.0/23 Organization 2 200.23.20.0/23 Organization 7. 200.23.30.0/23 Organization 1 200.23.18.0/23.. Fly-By-Night-ISP ISPs-R-Us Send me anything with addresses beginning 200.23.16.0/20 Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23 Internet Network 2 35 Subnetting och CIDR: skalabiliteten Subnetting Hjälper till att lösa skalabilitetsproblemet Nya fysiska nätverk kan läggas till utan att använda nya Klass B eller C nätverksadresser Samlar ihop information CIDR Kortare routingtabeller Slår ihop routinginformation Spar adresser Dela ut block av kontinuerliga nätverksnummer istället för adresser för större nätverksklass Network 2 36 12

Skalbara nätverk Interdomän routing för att hitta rätt AS Färre AS än nätverk Intradomän routing för att hitta rätt nätverk i AS Färre nätverk i en domän än i hela Internet CIDR Slår ihop routing information Subnetting Subnät syns ej utåt ARP (nästa lager) Hitta rätt host i ett nätverk (subnät) Skalabilitet viktigare än optimal väg Network 2 37 Router Architecture Overview Two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) switching datagrams from incoming to outgoing link Network 2 38 Input Port Functions Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5 Decentralized switching: given datagram dest., lookup output port using routing table in input port memory goal: complete input port processing at line speed queuing: if datagrams arrive faster than forwarding rate into switch fabric Network 2 39 13

Input Port Queuing Fabric slower that input ports combined -> queueing may occur at input queues Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward queueing delay and loss due to input buffer overflow! Network 2 40 Three types of switching fabrics Via memory First generation routers: packet copied by system s (single) CPU speed limited by memory bandwidth (2 bus crossings per datagram) Modern routers: input port processor performs lookup, copy into memory Via bus datagram from input port memory to output port memory via a shared bus bus contention: Via an interconection network switching overcome bus bandwidth speed limitations limited by Advanced design: fragmenting datagram into fixed length cells, switch bus bandwidth cells through the fabric. Network 2 41 Output Ports Buffering required when datagrams arrive from fabric faster than the transmission rate Scheduling discipline chooses among queued datagrams for transmission Network 2 42 14

Output port queueing buffering when arrival rate via switch exceeeds ouput line speed queueing (delay) and loss due to output port buffer overflow! Network 2 43 IPv6 Initial motivation: 32-bit address space completely allocated by 2008 or 2018 or Additional motivation: header format helps speed processing/forwarding header changes to facilitate QoS new anycast address: route to best of several replicated servers IPv6 datagram format: fixed-length 40 byte header no fragmentation allowed Network 2 44 Transition From IPv4 To IPv6 Not all routers can be upgraded simultaneous no flag days How will the network operate with mixed IPv4 and IPv6 routers? Two proposed approaches: Dual Stack: some routers with dual stack (v6, v4) can translate between formats Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Network 2 45 15

Dual Stack Approach Network 2 46 Tunneling IPv6 inside IPv4 where needed Network 2 47 Multicast routing Unicast Enkelt, men bandbreddskrävande Multicast Mindre antal paket, men kräver support från nätverkslagret Network 2 48 16

Multicast routing (forts) Problem Hur identifieras mottagarna av multicast-meddelanden? Hur adresseras ett datagram till dem? Lösning address indirection, en identifierare för hel multicast grupp Class D multicast-adresser Network 2 49 Multicast routing - frågor Hur startar och slutar en grupp? Hur väljs gruppadress? Hur ansluter man till befintlig grupp? Kan vem som helst ansluta sig? Känner man till vilka övriga som är anslutna? Hur samarbetar routrarna? Involverar IGMP Network 2 50 IGMP Internet Group Management Protocol Mellan host och första router Kan ej identifiera andra i gruppen Tre typer av meddelanden Membership query, membership report, leave group Körs över IP Receiver-driven Network 2 51 17

Multicast routing - generellt Mål: Hitta ett träd med alla routrar Ibland måste andra routrar involveras Två varianter: Group-shared tree, endast ett träd Source-based trees, ett träd för varje sändare Network 2 52 Multicast routing i Internet DVMRP Distance Vector Multicast Routing Protocol Source-based MOSPF Multicast OSPF Source-based CBT Core Based Trees Group-shared PIM Protocol Independent Multicast Dense mode liknar DVMRP Sparse mode group-shared Mellan AS DVMRP Men inte helt lyckat Network 2 53 Network Layer: Summary Goals: understand principles behind network layer services: routing (path selection) dealing with scale how a router works advanced topics: IPv6, multicast instantiation and implementation in the Internet Overview: network layer services IP addressing routing principle: path selection IP hierarchical routing Internet routing protocols reliable transfer intra-domain inter-domain what s inside a router? IPv6 multicast routing Network 2 54 18