1 / 34

Lecture 11: The Network Layer

Lecture 11: The Network Layer. ITCS 6166/8166 091 Spring 2007 Jamie Payton Department of Computer Science University of North Carolina at Charlotte February 14, 2007. Slides adapted from: Congestion slides for Computer Networks: A Systems Approach (Peterson and Davis)

anne-sharpe
Télécharger la présentation

Lecture 11: The Network Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 11:The Network Layer ITCS 6166/8166 091 Spring 2007 Jamie Payton Department of Computer Science University of North Carolina at Charlotte February 14, 2007 Slides adapted from: Congestion slides for Computer Networks: A Systems Approach (Peterson and Davis) Chapter 3 slides for Computer Networking: A Top Down Approach Featuring the Internet (Kurose and Ross)

  2. Announcements • Homework 2 • Due: Feb. 16 at 5 pm • Submit through WebCT • Homework 3 • Available! • Due: Feb. 21

  3. Homework 3 Helpful Tips • TCP timeout • Doubles after a packet loss • Simple form of congestion control • TCP congestion window • At the conceptual level • Doubles each RTT • In implementation • Window size increases by 1 MSS for every ACK

  4. The Network Layer • Function of network layer • Provide end-to-end connectivity • Addressing • Forwarding and Routing • Two network types • Connection-oriented • Virtual circuit networks • Connectionless • Datagram networks

  5. Network Layer Overview:Forwarding and Routing • Forwarding: move packets from router’s input to appropriate router output • Routing: determine route taken by packets from source to dest. • routing algorithms analogy: • routing: process of planning trip from source to destination • forwarding: process of getting through single interchange

  6. Network Layer Overview:Forwarding and Routing routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 1 0111 2 3

  7. Network Layer Overview:Network Service Models • Network service model defines characteristics of end-to-end transport Example services for individual datagrams: • guaranteed delivery • guaranteed delivery with less than 40 msec delay Example services for a flow of datagrams: • in-order datagram delivery • guaranteed minimum bandwidth to flow • restrictions on changes in inter-packet spacing

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

  9. Network Layer Overview:Connections • Have two types of networks • Connection-oriented • Connectionless • Similar to services in transport layer, but • service: host-to-host • no choice: network provides one or the other • implementation: in network core • Support different network service models

  10. Virtual Circuit Networks • Provide connection-oriented service through virtual circuits (VC) • Connection process • Connection setup • Data transfer • Connection teardown • Router maintains state for every connection • Possible services provided • In-order packet delivery • Guaranteed bandwidth • Guaranteed maximum jitter • Examples: ATM networks

  11. VC Implementation A VC consists of: • path from source to destination • VC numbers, one number for each link along path • entries in forwarding tables in routers along path • Packet belonging to VC carries VC number • VC number can be changed on each link. • New VC number comes from forwarding table

  12. VC number 22 32 12 3 1 2 interface number VC Forwarding Table Forwarding table in NW router: Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 3 22 2 63 1 18 3 7 2 17 1 97 3 87 … … … … Routers maintain connection state information!

  13. Datagram Networks • Provide connectionless network-layer transport through datagram networks • Packets are sent independently of each other • Each packet has full set of control information • Sent using destination address • Every switch needs to be able to handle any packet • No need for per-connection state • Services • “Best-effort” • Not in-order delivery • No guarantees on bandwidth, jitter • Used in the Internet!

  14. Internet Network Layer • Relies on: • Internet Protocol (IP) • Data format and transfer • Internet Control Message Protocol (ICMP) • Error handling • Routing protocols • Determines forwarding tables Network Layer

  15. IP Protocol • IP packet format • 20 byte header • + options • + data • IP header • Version • Source and destination addresses • Length • Upper layer protocol • Time-to-live (TTL) • Header checksum • Fields for “fragmentation”

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

  17. length =1500 length =1500 length =4000 length =1040 ID =x ID =x ID =x ID =x fragflag =0 fragflag =1 fragflag =1 fragflag =0 offset =0 offset =0 offset =370 offset =185 One large datagram becomes several smaller datagrams IP Fragmentation and Reassembly Example • 4000 byte datagram • MTU = 1500 bytes 1480 bytes in data field offset = 1480/8

  18. Overview of IP Addressing • A 32-bit globally unique identifier for an interface • Typically written in dotted-decimal notation: 192.168.0.1 • IP address assignment • In blocks of neighboring IP addresses: “subnets” • Notation: lowest address / prefix: 192.168.0.128/25 • Allocation of addresses is crucial for routing

  19. IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link routers typically have multiple interfaces host typically has one interface IP addresses associated with each interface 223.1.1.2 223.1.2.1 223.1.3.27 223.1.3.1 223.1.3.2 223.1.2.2 IP Addressing 223.1.1.1 223.1.2.9 223.1.1.4 223.1.1.3 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1

  20. IP address: subnet part (high order bits) host part (low order bits) What’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router Subnets 223.1.1.1 223.1.2.1 223.1.1.2 223.1.2.9 223.1.1.4 223.1.2.2 223.1.1.3 223.1.3.27 subnet 223.1.3.2 223.1.3.1 network consisting of 3 subnets

  21. Recipe To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet. 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 Subnets Subnet mask: /24

  22. host part subnet part 11001000 0001011100010000 00000000 200.23.16.0/23 IP Addressing: CIDR CIDR:Classless InterDomain Routing • subnet portion of address of arbitrary length • address format: a.b.c.d/x, where x is # bits in subnet portion of address

  23. 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->configuration->tcp/ip->properties • UNIX: /etc/rc.config • DHCP:Dynamic Host Configuration Protocol: dynamically get address from as server • “plug-and-play” (more in next chapter)

  24. IP Addresses: How to Get One? Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider 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

  25. 200.23.16.0/23 200.23.18.0/23 200.23.30.0/23 200.23.20.0/23 . . . . . . Hierarchical Addressing: Route Aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0 Organization 1 “Send me anything with addresses beginning 200.23.16.0/20” Organization 2 Fly-By-Night-ISP Internet Organization 7 “Send me anything with addresses beginning 199.31.0.0/16” ISPs-R-Us

  26. 200.23.16.0/23 200.23.18.0/23 200.23.30.0/23 200.23.20.0/23 . . . . . . Hierarchical Addressing ISPs-R-Us has a more specific route to Organization 1 Organization 0 “Send me anything with addresses beginning 200.23.16.0/20” Organization 2 Fly-By-Night-ISP Internet Organization 7 “Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23” ISPs-R-Us Organization 1

  27. IP Addressing Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers • allocates addresses • manages DNS • assigns domain names, resolves disputes

  28. Network Address Translation (NAT) • Limited number of IP addresses • Block of addresses reserved for “local” use • 10.*.*.* and 192.168.*.* • Network address translator • Connects local net through single outside IP address

  29. 3 1 2 4 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table S: 128.119.40.186, 80 D: 10.0.0.1, 3345 S: 128.119.40.186, 80 D: 138.76.29.7, 5001 NAT: Network Address Translation NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… …… 10.0.0.1 10.0.0.4 10.0.0.2 138.76.29.7 10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345 3: Reply arrives dest. address: 138.76.29.7, 5001

  30. Internet Network Layer • Relies on: • Internet Protocol (IP) • Data transfer • Internet Control Message Protocol (ICMP) • Error handling • Routing protocols • Determines forwarding tables Network Layer

  31. Used by hosts & routers to communicate network-level information Error reporting Unreachable host Unreachable Network Unreachable Port Unknown Protocol Echo request/reply Used by ping Network-layer “above” IP: ICMP msgs carried in IP datagrams ICMP message: Type Code First 8 bytes of IP datagram causing error ICMP: Internet Control Message Protocol

  32. ICMP Messages TypeCodedescription 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

  33. Internet Network Layer • Relies on: • Internet Protocol (IP) • Data transfer • Internet Control Message Protocol (ICMP) • Error handling • Routing protocols • Determines forwarding tables Network Layer

  34. Summary • Network Layer • Connection versus connectionless • Virtual Circuits vs. Datagram Networks • Network Layer Functions • Addressing • Next time: Forwarding and Routing

More Related