The Network Layer Data Plane
Total Page:16
File Type:pdf, Size:1020Kb
The Network Layer: Data Plane Overview Net 1 R1 Net 2 R2 Net 3 R3 Net 4 1. Network Layer Basics Raj Jain 2. What’s inside a router? Washington University in Saint Louis 3. Forwarding Protocols: IPv4, DHCP, NAT, IPv6 Saint Louis, MO 63130 4. Software Defined Networking [email protected] Audio/Video recordings of this lecture are available on-line at: Note: This class lecture is based on Chapter 4 of the textbook http://www.cse.wustl.edu/~jain/cse473-16/ (Kurose and Ross) and the figures provided by the authors. Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-1 4-2 Overview Network Layer Basics Forwarding and Routing 1. Forwarding and Routing T Forwarding: Input link to output link via Address prefix lookup in a table. 2. Connection Oriented Networks: ATM Networks T Routing: Making the Address lookup table 3. Classes of Service T Longest Prefix Match 4. Router Components 5. Packet Queuing and Dropping 125.200.1.3 126.23.45.67 125.200.1.1 125.200.1.2 128.272.15.2 2 1 Prefix Next Router Interface 126.23.45.67/32 125.200.1.1 1 128.272.15/24 125.200.1.2 2 128.272/16 125.200.1.1 1 Ref: Optional Homework: R3 in the textbook Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-3 4-4 Network Service Models What's Inside a Router? Lookup T Guaranteed Delivery: No packets lost PHY Datalink Forwarding Switching Queueing Datalink PHY T Bounded delay: Maximum delay ……Queueing Fabric T In-Order packet delivery: Some packets may be missing Routing T Guaranteed minimal throughput Processor T Guaranteed maximum jitter: Delay variation T Input Ports: receive packets, lookup address, queue Use Content Addressable Memories (CAMs) and caching T Security Services (optional in most networks) T Switch Fabric: Send from input port to output port T ATM offered most of these T Output Ports: Queuing, transmit packets T IP offers none of these Best effort service (Security is optional) Optional Homework: R4, R5 in the textbook Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-5 4-6 Types of Switching Fabrics Where Does Queuing Occur? T If switching fabric is slow, packets wait on the input port. T If switching fabric is fast, packets wait for output port Queueing (Scheduling) and drop policies T Queueing: First Come First Served (FCFS), Weighted Fair Queueing Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-7 4-8 Ideal Buffering Packet Dropping Policies Source Destination Probability of Drop Ack Average Q T Flow Control Buffering = RTT*Transmission Rate T Drop-Tail: Drop the arriving packet T Buffer = RTT*Transmission Rate/(# of TCP flows) T Random Early Drop (RED): Drop arriving packets even before the queue is full T Routers measure average queue and drop incoming packet with certain probability Active Queue Management (AQM) Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-9 4-10 Head-of-Line Blocking Network Layer Basics: Review T Packet at the head of the queue is waiting 1. Forwarding uses routing table to find output port for Other packets can not be forwarded even if they are datagrams using longest prefix match. Routing going to other destination protocols make the table. 2. IP provides only best effort service (KISS). 3. Routers consist of input/output ports, switching fabric, and processors. 4. Datagrams may be dropped even if the queues are not full (Random early drop). 5. Queueing at input may result in head of line blocking. Ref: Read Sections 4.1, 4.2, full, Page 305-329 of the textbook. Try R1 through R16 Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-11 4-12 IP Datagram Format Overview Forwarding Protocols Version Header Length Type of Total Length Datagram 1. IPv4 Datagram Format in 4B words Service in Bytes ID 2. IP Fragmentation and Reassembly 4b 4b 8b 16b 16b 3. IP Addressing Rsvd Don’t More Fragment Offset Time (Hops) Upper Layer Fragment Fragments in 8B blocks to Live Protocol 4. Network Address Translation (NAT) 1b 1b 1b 13b 8b 8b Flags 1=ICMP 5. Universal Plug and Play 6=TCP 6. Dynamic Host Control Protocol (DHCP) Header Source Destination Options Padding Payload 17=UDP Checksum IP Address IP Address 7. IPv6 16b 32b 32b Variable Variable Variable Multiple of 4B Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-13 4-14 IP Fragmentation Fields IP Fragmentation and Reassembly T Header length: in units of 16-bit words length ID MoreFrag offset T Data Unit Identifier (ID) Example =4000 =x =0 =0 T Sending host puts an identification number in each T 4000 byte datagram One large datagram becomes several smaller datagrams datagram T Maximum Transmission Unit (MTU) = 1500 bytes length ID MoreFrag offset T Total length: Length of user data plus header in bytes =1500 =x =1 =0 1480 bytes in T Fragment Offset - Position of fragment in original datagram data field length ID MoreFrag offset =1500 =x =1 =185 In multiples of 8 byte blocks offset = 1480/8 length ID MoreFrag offset T More fragments flag =1040 =x =0 =370 20 1480 Indicates that this is not the last fragment Len=1500 20 1480 T Datagrams can be fragmented/refragmented at any router Len=1500 20 1020 T Datagrams are reassembled only at the destination host Len=1040 Len=4000 Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/185¯8 ©2016 Raj Jain 4-15 4-16 Homework 4A IP Address Classes T Class A: 0 Network Local T Consider sending a 2400-byte datagram into a link 17 24 bits that has an MTU of 720 bytes. Suppose the original T Class B: 10 Network Local datagram is stamped with the identification number 214 16 bits 422. How many fragments are generated? What are T Class C: 110 Network Local the values in the various fields in the IP datagram(s) 321 8 bits generated related to fragmentation? T Class D: 1110 Host Group (Multicast) 428 bits T Class E: 11110 Future use 527 bits T Local = Subnet + Host (Variable length) Router Router Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/Subnet ©2016 Raj Jain 4-17 4-18 IP Addressing Subnetting 128.10 Router 128.211 T All hosts on a subnetwork have the same prefix. 128.10.0.1 128.10.0.2 128.211.6.115 Position of the prefix is indicated by a “subnet mask” Router 10.0.0.37 10.0.0.49 T Example: First 23 bits = subnet 192.5.48.3 Address: 10010100 10101000 00010000 11110001 10 Router Mask: 11111111 11111111 11111110 00000000 192.5.48 .AND. 10010100 10101000 00010000 00000000 T All IP hosts have a 32-bit address.128.10.0.1 =1000 0000 0000 1010 0000 0000 0000 0001 Network T All hosts on a network have the same network prefix Subnet 1 Subnet 2 Subnet n Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse473-16/ ©2016 Raj Jain 4-19 4-20 IP addressing: CIDR Homework 4B T CIDR: Classless InterDomain Routing T Consider a router that interconnects 3 subnets: Subnet 1, T Subnet portion of address of arbitrary length Subnet 2, and Subnet 3. Suppose all of the interfaces in each of these three subnets are required to have the prefix 223.1.17/24. T Address format: a.b.c.d/x, where x is # bits in subnet portion of address Also suppose that Subnet 1 is required to support up to 61 interfaces, Subnet 2 is to support up to 96 interfaces, and T All 1’s in the host part is used for subnet broadcast Subnet 3 is to support up to 16 interfaces. Provide three T All 0’s in the host part was meant as “subnet address” but network address prefixes (of the form a.b.c.d/x) that satisfy not really used for anything. Some implementation allow it these constraints. Use adjacent allocations. For each subnet, to be used as host address. Some don’t. Better to avoid it. also list the subnet mask to be used in the hosts. subnet host part part 11001000 00010111 00010000 00000000 200.23.16.0/23 Washington University in St.