Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding.

Similar presentations


Presentation on theme: "Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding."— Presentation transcript:

1 Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding versus routing m how a router works m routing (path selection) m dealing with scale m advanced topics: IPv6, mobility r instantiation, implementation in the Internet

2 Network Layer4-2 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

3 Network Layer4-3 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side, delivers segments to transport layer r network layer protocols in every host, router r router examines header fields in all IP datagrams passing through it application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical

4 Network Layer4-4 Two Key Network-Layer Functions r forwarding: move packets from router’s input to appropriate router output r routing: determine route taken by packets from source to dest. m routing algorithms analogy: r routing: process of planning trip from source to dest r forwarding: process of getting through single interchange

5 Network Layer4-5 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 32213221 Interplay between routing and forwarding

6 Network Layer4-6 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection” r packets forwarded using destination host address m packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data

7 Network Layer4-7 Forwarding table Destination Address Range Link Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 4 billion possible entries

8 Network Layer4-8 Longest prefix matching Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 DA: 11001000 00010111 00011000 10101010 Examples DA: 11001000 00010111 00010110 10100001 Which interface?

9 Network Layer4-9 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

10 Network Layer4-10 The IP protocol The IPv4 (Internet Protocol) header.

11 Network Layer4-11 IP protocol: header fields r Version m Keeps track of which version of the protocol The datagram belongs to (current = 4.0) r IHL m Since header is not constant, this field Tells how long the header is, in 32-bit words r Total length: includes both header and data m Max length = 65 Kbytes r TTL: is a counter used to limit packet lifetimes m Prevents packets from wandering around forever

12 Network Layer4-12 IP protocol: header fields (cont’d) r Protocol field m Tells which transport process to give the packet to TCP is one possibility and so are UDP and others r Header checksum m Verifies the header only, It must be recomputed at each hop –Because at least one field always change (TTL field) r The source address and destination address m Indicate the destination network and host numbers

13 Network Layer4-13 IP options r Strict source routing m The datagram is supposed to follow a specific route r Record route m Allows system managers to track down bugs In routing algorithms

14 Network Layer4-14 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP

15 Network Layer4-15 IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment offset upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. how much overhead with TCP? r 20 bytes of TCP r 20 bytes of IP r = 40 bytes + app layer overhead

16 Network Layer4-16 IP options r Strict source routing m The datagram is supposed to follow a specific route r Record route m Allows system managers to track down bugs In routing algorithms

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

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

19 Network Layer4-19 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Link state m Distance Vector m Hierarchical routing r 4.6 Routing in the Internet m RIP m OSPF m BGP r 4.7 Broadcast and multicast routing

20 Network Layer4-20 IP Addresses

21 Network Layer4-21 Special IP addresses r The IP address 0.0.0.0 m Is used by hosts when they are booting r IP addresses with 0 as network number m Refer to the current network

22 Network Layer4-22 Class A, B, and C networks: default masks without subnetting r Routers use a default mask m To define size of the network and host parts of address r Default mask m is a 32 bit binary number written in dotted- decimal m defines the structure of an IP address Identifying the size of the network part of an IP address –Class A mask has a default mask of 255.0.0.0 –Class B default mask => 255.255.0.0 –Class C default mask => 255.255.255.0

23 Network Layer4-23 A typical campus network A B C D E F G H

24 Network Layer4-24 Subnets r Main objective m Allow networks to be split into several parts (subnets) For internal use and still act like a single network to outside r Idea m Some bits are taken away from the host number To create a subnet number m A third part appears in the middle of the address

25 Network Layer4-25 Subnets: example r The main router uses a subnet mask m Indicating the split between network + subnet and host m The subnet mask in this case is 255.255.252.0 alternative notation is /22 indicating a 22 bit long mask m Outside the network, subnetting is not visible

26 Network Layer4-26 How IP packets are processed at a router r Without subnetting m Each router has a routing table listing Some number of network IP addresses –Telling how to get to distant networks Some number of local host IP addresses –Telling how to get to local hosts r With subnetting m Router table is reduced furthermore By creating a three-level hierarchy (network, subnet, and host) m A router on subnet k Knows how to get to all other subnets and to local hosts does not have to know details about hosts on other subnets

27 Network Layer4-27 Scaling the IP address for the Internet r In the early 1990s m It became apparent that Internet was growing so fast That all IP addresses would be assigned by mid-1990s –new organizations would be unable to connect to Internet r Several solutions were developed m That allowed the Internet to grow Without letting us run out of IP addresses –Classless Interdomain Routing (CIDR) –Network Address Translation (NAT)

28 Network Layer4-28 IP Addressing r IP address: 32-bit identifier for host, router interface r interface: connection between host/router and physical link m router’s typically have multiple interfaces m host typically has one interface m IP addresses associated with each interface 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.1 = 11011111 00000001 00000001 00000001 223 111

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

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

31 Network Layer4-31 Subnets How many? 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2 223.1.2.1 223.1.2.6 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2

32 Network Layer4-32 IP addressing: CIDR CIDR: Classless InterDomain Routing m subnet portion of address of arbitrary length m address format: a.b.c.d/x, where x is # bits in subnet portion of address 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23

33 Network Layer4-33 Exercises r You have a class C network, and you need to design it for 7 usable subnets with each subnet handling a minimum of 18 hosts each. Which of the following network masks should you use? m 255.255.224.0 m 255.255..255.230 m 255.255.255.224 m 255.255.255.240 m None of the above

34 Network Layer4-34 Exercises r If a host on a network has the address 172.16.210.0/22, what is the address of the subnetwork to which the host belongs? m 172.16.42.0 m 172.16.107.0 m 172.16.208.0 m 172.16.255.208 m 172.16.254.0

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

36 Network Layer4-36 CDR – Classless InterDomain Routing A set of IP address assignments. 5-59

37 Network Layer4-37 CIDR (ctd) r Routing tables: m AddressMask C: 11000010 00011…255.255.11111000.0 E: 194.24.00001…255.255.11111100.0 O: 194.24.0001…255.255.11110….. r A packet addressed to 194.24.17.4 m Matches the Oxford base r A router m with a single line for all 3 universities => Three entries may be combined: 194.24.0.0/19

38 Network Layer4-38 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration- >tcp/ip->properties m UNIX: /etc/rc.config r DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server m “plug-and-play”


Download ppt "Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding."

Similar presentations


Ads by Google