Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,

Similar presentations


Presentation on theme: "Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,"— Presentation transcript:

1 Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley, July 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

2 Network Layer4-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 m IPv4 addressing m Moving a datagram from source to destination m Datagram format m IP fragmentation m ICMP: Internet Control Message Protocol m DHCP: Dynamic Host Configuration Protocol m 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

3 Network Layer4-3 Network Layer IPv4 Addressing Roadmap Definition of an IP Address Definition of a Network from the IP perspective Address Assignment mISPs mNetworks mHosts Classful Addressing Masking Subnetting Classful Addressing Alternative Hierarchial Addressing Quiz

4 Network Layer4-4 Network Layer What is an IP Address? IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link m router’s typically have multiple interfaces m host may have multiple interfaces m IP addresses associated with each interface =

5 Network Layer4-5 Network Layer IP Addressing IP address: m network part (high order bits) m host part (low order bits) What’s a network ? ( from IP address perspective) m device interfaces with same network part of IP address m can physically reach each other without intervening router network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) LAN

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

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

8 Network Layer4-8 Network Layer Address Assignment: To ISPs Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers m allocates addresses m manages DNS m assigns domain names, resolves disputes

9 Network Layer4-9 Network Layer 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

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

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

12 Network Layer4-12 Network Layer Class B Sub-Netting: 2 bits Original Mask New Mask Bits Address Range Valid New Nets # Hosts per Net 0 00-Invalid 0-63None Invalid None 0 0 TOTAL = 2 nets124 hosts Source: NetCom Systems

13 Network Layer4-13 Network Layer Class B Sub-Netting: 3 bits Original Mask New Mask Bits Address Range Valid New Nets # Hosts per Net 0000-Invalid 0-31None Invalid None 0 0 TOTAL = 6 nets180 hosts Source: NetCom Systems

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

15 Network Layer4-15 Network Layer The “Classful” Alternative: CIDR Classful addressing: m inefficient use of address space, address space exhaustion m e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network network part host part /23 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

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

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

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

19 Network Layer4-19 Network Layer IP Address Quiz What IP address is contained in 86.32/12? What IP address contains and ? 152.0/ / /

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

21 Network Layer4-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 m IPv4 addressing m Moving a datagram from source to destination m Datagram format m IP fragmentation m ICMP: Internet Control Message Protocol m DHCP: Dynamic Host Configuration Protocol m 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

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

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

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

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

26 Network Layer4-26 Smith Routers Cutter Stoddard Quad Science Center Neilson Seelye MHCUMass

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

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

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

30 Network Layer4-30 Transport Layer source port # dest port # 32 bits data (variable length) sequence number acknowledgement number Receive window Urg data pnter checksum F SR PAU head len not used Options (none) r 20 bytes of TCP, no options included

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

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

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

34 Network Layer4-34 IP Fragmentation and Reassembly ID =7 offset =0 fragflag =0 length =4000 ID =7 offset =0 fragflag =1 length =1500 ID =7 offset =1480 fragflag =1 length =1500 ID =7 offset =2960 fragflag =0 length =1040 One large datagram becomes several smaller datagrams Example r 4000 byte datagram r MTU = 1500 bytes Applet:http://wps.aw.com/wps/media/objects/221/227091/applets/ip/ipfra gmentation.htmlhttp://wps.aw.com/wps/media/objects/221/227091/applets/ip/ipfra gmentation.html Recall the IP Datagram included: ID, Flag, and offset information for fragmentation.

35 Network Layer4-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%.

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

37 Network Layer4-37 You have a 50% Chance! 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

38 Network Layer4-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

39 Network Layer4-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 m IPv4 addressing m Moving a datagram from source to destination m Datagram format m IP fragmentation m ICMP: Internet Control Message Protocol m DHCP: Dynamic Host Configuration Protocol m 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

40 Network Layer Network Layer The Internet Network layer (recap) forwarding table Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer

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

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

43 Network Layer4-43 ICMP: Internet Control Message Protocol r ICMP messages are carried in IP datagrams, so they are architecturally below IP. r ICMP message contain: o Type and code field o First eight bytes of IP datagram that caused the ICMP message generation r Not only for error messaging o ping o traceroute 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

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

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

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

47 Network Layer4-47 DHCP: Dynamic Host Configuration Protocol

48 Network Layer4-48 DHCP client-server scenario DHCP server: arriving client time 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 DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs

49 Network Layer4-49 DHCP: Dynamic Host Configuration Protocol

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

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

52 Network Layer4-52 NAT: Network Address Translation Implementation: NAT router must: m 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. m remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair m 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

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

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

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


Download ppt "Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,"

Similar presentations


Ads by Google