Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 Network Layer A note on the use of these ppt slides:

Similar presentations


Presentation on theme: "Chapter 4 Network Layer A note on the use of these ppt slides:"— Presentation transcript:

1 Chapter 4 Network Layer A note on the use of these ppt slides:
We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Modified by Melissa, Brigitte, and Amy Thanks and enjoy! JFK/KWR All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach Featuring the Internet, 2nd edition. Jim Kurose, Keith Ross Addison-Wesley, July 2002. Network Layer

2 Chapter 4 roadmap 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility Network Layer

3 4.4.1 IPv4 Addressing Roadmap
Definition of an IP Address Definition of a Network from the IP perspective Address Assignment ISPs Networks Hosts Classful Addressing Masking Subnetting Classful Addressing Alternative Hierarchial Addressing Quiz Network-layer service models Routing algorithms commonly used to determine paths between source and destination Use of hierarchy to address the problem of scale. Explore the network layer of the Internet Pieces of which are often collectively referred to as the IP layer named after the IP protocol which is actually only one piece of the network layer. Network Layer Network Layer 4-3 3

4 What is an IP Address? 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 each interface = 223 1 Network Layer Network Layer 4-4 5

5 IP Addressing 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 LAN network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) Network Layer Network Layer 4-5 6

6 IP Addressing How to find the networks?
How to find the networks? Detach each interface from router, host create “islands of isolated networks Interconnected system consisting of six networks Network Layer Network Layer 4-6 7

7 IP Addresses given notion of “network”, let’s re-examine IP addresses:
“class-full” addressing: 2^32 addresses = 4 billion addresses 32 bits network host A class 126 (27-2) 16,777,214 to 10 network host B 16,384 (214) 65,534 to 110 network host C 2,097,151 (221-1) 254 to 1110 multicast address D to Network Layer Network Layer 4-7 8

8 Address Assignment: To ISPs
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 Network Layer Network Layer 4-8 9

9 Address Assignment: To Networks
Q: How does network get network part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block /20 Organization /23 Organization /23 Organization /23 … … …. Organization /23 Network Layer Network Layer 4-9 10

10 Address Assignment: To Hosts
Q: How does host get IP address? hard-coded by system admin in a file Wintel: control-panel->network->configuration->tcp/ip->properties DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play” Network Layer Network Layer 4-10 11

11 Masking the Network Portion
= Class B Smith College = Network Layer Network Layer 4-11 12

12 Class B Sub-Netting: 2 bits
Original Mask New Mask 192 2 Bits Address Range Valid New Nets # Hosts per Net Invalid None Invalid None TOTAL = 2 nets 124 hosts Source: NetCom Systems < Network Layer Network Layer 4-12 13

13 Class B Sub-Netting: 3 bits
Original Mask New Mask 224 2 Bits Address Range Valid New Nets # Hosts per Net 000 0-Invalid None Invalid None TOTAL = 6 nets 180 hosts Source: NetCom Systems < Network Layer Network Layer 4-13 14

14 Class “B” Sub-Netting A Network or Host Address
cannot contain all 0’s or all 1’s. Source: NetCom Systems < Network Layer Network Layer 4-14 15

15 The “Classful” Alternative: CIDR
Classful 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 CIDR: Classless 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 network part host /23 Network Layer Network Layer 4-15 16

16 Hierarchical addressing: route aggregation
Hierarchical addressing allows efficient advertisement of routing information: Organization 0 /23 “Send me anything with addresses beginning /20” Organization 1 /23 Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16” ISPs-R-Us Network Layer Network Layer 4-16 17

17 Hierarchical addressing: more specific routes
ISPs-R-Us has a more specific route to Organization 1 Organization 0 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16 or /23” ISPs-R-Us Organization 1 /23 Network Layer Network Layer 4-17 18

18 IP Address Quiz What IP address is contained in 11/8?
What IP address matches /32? / /32 /24 Network Layer Network Layer 4-18 19

19 IP Address Quiz What IP address is contained in 86.32/12?
What IP address contains and ? 152.0/ /13 153.0/ Network Layer Network Layer 4-19 20

20 Web Resources “whois” demo General info + Quizzes
General info + Quizzes Network Layer Network Layer 4-20 21

21 Chapter 4 roadmap 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility Network Layer

22 Getting a datagram from source to dest.
forwarding table in A Dest. Net. next router Nhops IP datagram: misc fields source IP addr dest data A * datagram remains unchanged E Network Layer

23 Getting a datagram from source to dest.
Amelia’s Forwarding Table misc fields Dest. Net. next router Nhops data Starting at Amelia, send IP datagram addressed to Marga: Amelia look up net. address of Marga in forwarding table Marga is on same net. as Amelia Marga link layer will send datagram directly to Marga inside link-layer frame Network Layer

24 Getting a datagram from source to dest.
Amelia’s Forwarding Table misc fields Dest. Net. next router Nhops data Starting at Amelia, dest. to Sonya : look up network address of Sonya in forwarding table Amelia Sonya on different network i.e. not directly attached routing table: next hop router to Sonya is Sonya link layer sends datagram to router inside link-layer frame datagram arrives at continued….. Network Layer

25 Getting a datagram from source to dest.
forwarding table in router Dest. Net router Nhops interface misc fields data Arriving at , destined for Amelia look up network address of Sonya in forwarding table Sonya on same network as router’s interface router, Sonya directly attached Sonya link layer sends datagram to inside link-layer frame via interface Sonya receives datagram Network Layer

26 Smith Routers Quad Cutter Science Center Neilson Stoddard Seelye UMass
MHC Network Layer

27 32 bit destination IP address
IP datagram format IP protocol version number 32 bits total datagram length header length head. len type of service ver length fragmentation “type” of data fragment offset 16-bit identifier flgs max number remaining hops (decremented at each router) time to live upper layer Internet checksum 32 bit source IP address 32 bit destination IP address upper layer protocol Options (if any) E.g. record route taken, specify list of routers to visit. data (variable length, typically a TCP or UDP segment) Network Layer

28 Recall IP datagram format
head. len type of service ver length fragment offset 16-bit identifier flgs time to live upper layer Internet checksum misc fields source IP addr dest data source IP address destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) Network Layer

29 How Much Overhead with TCP?
Consider All overhead up till now: application transport network link physical • Application Layer • Transport Layer • Network Layer *Consider application layer at end, start with transport layer Network Layer

30 acknowledgement number
Transport Layer source port # dest port # 32 bits data (variable length) sequence number acknowledgement number Receive window Urg data pnter checksum F S R P A U head len not used Options (none) 20 bytes of TCP, no options included Network Layer

31 destination IP address
Network Layer head. len type of service ver 20 bytes minimum for IP Datagram Also, no Options Note: our TCP segment header information follows our IP datagram header information length fragment offset 16-bit identifier flgs time to live upper layer Internet checksum source IP address destination IP address Options (none) data (our TCP segment) Network Layer

32 Total TCP Overhead application 20 bytes of TCP header transport
network link physical 20 bytes of TCP header 20 bytes IP Datagram header = 40 bytes + application layer overhead Network Layer

33 IP Fragmentation & Reassembly
network links have MTU (max.transfer size) different link types, different MTUs fragmentation: in: one large datagram out: 3 smaller datagrams large IP datagram divided (“fragmented”) data header one datagram becomes several datagrams “reassembled” only at final destination IP header bits used to identify, the order of fragments reassembly Network Layer

34 IP Fragmentation and Reassembly
Recall the IP Datagram included: ID, Flag, and offset information for fragmentation. ID =7 offset =0 fragflag length =4000 =1 =1500 =1480 =2960 =1040 One large datagram becomes several smaller datagrams Example 4000 byte datagram MTU = 1500 bytes Applet: Network Layer

35 Quiz: Four Questions Q:   Suppose an application generates chunks of 60 bytes of data every second, and each chunk gets encapsulated in a TCP segment and then an IP datagram. What percentage of each datagram will contain application data?  A. 40% B. 20% C. 80% D. 60% Ans: D or 60%, this because we will gain 40bytes more from TCP and IP datagram segments, thus our whole chunk of information is 100bytes, therefore the application we started with or 60bytes is 60/100 or 60%. Network Layer

36 Are you Challenged Yet? Q: Consider sending a 1300 byte datagram into a link that has an MTU of 500 bytes.  Three fragments are created with offsets 0, Three fragments are created, with offsets 0, 460 and 920. Three fragments are created with offsets 0, 480 and 960.   None of the above ANS: C Network Layer

37 You have a 50% Chance! Q: With a datagram network layer, each packet
   Q: With a datagram network layer, each packet carries the address of the destination host.  (Note: If your answer is incorrect we will have to redo the entire lecture) True False Ans: True Network Layer

38 Don’t Forget Brigitte’s Lecture
Q:The network portion of an IP address is the same for all the hosts on the same IP network.  True False Ans: True Network Layer

39 Chapter 4 roadmap 4.1 Introduction and Network Service Models
4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility Network Layer

40 The Internet Network layer (recap)
Host, router network layer functions: Transport layer: TCP, UDP IP protocol addressing conventions datagram format packet handling conventions Routing protocols path selection RIP, OSPF, BGP Network layer forwarding table ICMP protocol error reporting router “signaling” Network layer protocol, commonly known as IP. Network-layer addressing Fields in the datagram Actions taken by routers and end systems on a datagram based on values in these fields. There are 2 versions of Internet Protocol which we will be studying in this class: v4 (today) v6 (chapter 4.7) Path determination component that determines the route a datagram follows from source to destination. In sec 4.2 we saw that routing protocols compute the forwarding tables that are used to route packets through the network. Path determination component in 4.5 Facility to report errors in datagrams Respond to requests for certain network-layer information. Internet Control Message Protocol (ICMP) at the end of this section Link layer physical layer Network Layer Network Layer 4-30 4

41 ICMP: Internet Control Message Protocol
ICMP is used by the following for communication in the network-layer: Hosts Routers Gateways RFC 792 Typically used for error reporting Unreachable host, network, port protocol Echo request/reply (in ping) telnet server IP router telnet client telnet client TCP software Network Layer

42 32 bit destination IP address
IP datagram format 32 bits head. len type of service ver length fragment offset 16-bit identifier flgs time to live upper layer Internet checksum 32 bit source IP address 32 bit destination IP address Options (if any) how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead data (variable length, typically a TCP or UDP segment) Network Layer

43 ICMP: Internet Control Message Protocol
ICMP messages are carried in IP datagrams, so they are architecturally below IP. ICMP message contain: Type and code field First eight bytes of IP datagram that caused the ICMP message generation Not only for error messaging ping traceroute Type Code description echo reply (ping) dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header Network Layer

44 DHCP: Dynamic Host Configuration Protocol
DHCP assigns IP addresses to hosts dynamically. client-server protocol client = newly arriving host wanting to obtain network config info (including IP address) If DHCP server exists, all is good If DHCP server does not exist, DHCP relay agent (typically router) is needed. DHCP relay agent knows address of a DHCP server for that network Client-server protocol (cont) Renew its lease time Allows reuse of addresses Support for mobile users who want to join networks (continued later) Network Layer

45 DHCP client-server scenario
server B arriving DHCP client needs address in this network E Network Layer

46 DHCP: Dynamic Host Configuration Protocol
Overview of DHCP protocol steps DHCP server discovery First task = find DHCP server Send DHCP discover message DHCP server offer(s) DHCP offer message sent back to client address lease time – valid time of IP address (may be renewed) Overview of DHCP protocol steps DHCP request New client will choose among offers and respond with a request message New client echoes config parameters to server it chooses DHCP ACK Server responds with an acknowledgement, confirming configuration parameters Network Layer

47 DHCP: Dynamic Host Configuration Protocol
Network Layer

48 DHCP client-server scenario
DHCP server: arriving client DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs time DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs Network Layer

49 DHCP: Dynamic Host Configuration Protocol
Network Layer

50 NAT: Network Address Translation
rest of Internet local network (e.g., home network) /24 All datagrams leaving local network have same single source NAT IP address: , different source port numbers Datagrams with source or destination in this network have /24 address for source, destination (as usual) Network Layer

51 NAT: Network Address Translation
Motivation: local network uses just one IP address as far as outside word is concerned: no need to be allocated range of addresses from ISP: - just one IP address is used for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus). Network Layer

52 NAT: Network Address Translation
Implementation: NAT router must: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Network Layer

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

54 NAT: Network Address Translation
16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: routers should only process up to layer 3 violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications address shortage should instead be solved by IPv6 Network Layer

55 NAT Manipulation in the IP datagram
translation original head. len type of service head. len type of service ver ver length length fragment offset fragment offset 16-bit identifier flgs 16-bit identifier flgs time to live upper layer Internet checksum time to live upper layer Internet checksum :3345 :5001 Options (if any) Options (if any) data (variable length, typically a TCP or UDP segment) data (variable length, typically a TCP or UDP segment) Network Layer


Download ppt "Chapter 4 Network Layer A note on the use of these ppt slides:"

Similar presentations


Ads by Google