cs 3640 introduction to
play

CS 3640: Introduction to Networks and Their Applications Fall 2018, - PowerPoint PPT Presentation

CS 3640: Introduction to Networks and Their Applications Fall 2018, Lecture 10: The Network Layer I: Packet fragmentation, IPv4, and IPv6 (Credit: Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain 1


  1. CS 3640: Introduction to Networks and Their Applications Fall 2018, Lecture 10: The Network Layer I: Packet fragmentation, IPv4, and IPv6 (Credit: Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain 1

  2. You should… • Be checking Piazza regularly for announcements. • Have started working on assignment 2. • Know and understand: • The three Internet design principles. • The components of the Internet. • Circuit- vs. packet- switched networks. • Components of end-to-end delay. • Functions of the link layer: error detection, MAC, local addressing/routing. 2

  3. Today in class 1. 2. 3. Recap: Packet Internet Network layer fragmentation Protocol v4 and functions v6 3

  4. Recap: Network layer functions and IP addressing • What are the functions of the network layer? • Addressing: How do we specify who we want to talk to on the Internet? • Forwarding: How do we make sure our router knows what the next hop is? (local) • Routing: How do we make sure our packets get to the other side? (global) • What type of guarantees can the network layer make? Why? • Best effort service without guarantees. It has to serve the lowest common denominator. • Why doesn’t “flat addressing” work on the Internet? What does? • Flat addressing is not scalable. Too many routing table entries for every router. • Hierarchical addressing scales better. Don’t need to have entries for all routers. • Need highly specific information only for routers in their own network.

  5. Recap: Network layer functions and IP addressing • How is hierarchical addressing implemented? • Each IP address has a “network” string known to all routers and a “host” string known to edge routers (access networks). • What are the IP address classes and their limitations? • Class A networks are too big for access network routers. • How do we address this issue? • Subnetting – i.e., add another hierarchical layer to the address. • Class C networks are too many for everyone else. • How do we address this issue? • CIDR based routing table entries.

  6. Recap: CIDR (Classless Inter Domain Routing) • Key idea: Get rid of IP classes in routing tables. • With IP classes, routers need to remember how to reach each network – there are 2.1M of them! • CIDR facilitates aggregation to reduce the number of entries by getting rid of IP address “classes”. • How? • Think of IP addresses as leaves of a 32 level binary tree. A node on the n th level can reach all nodes on the (n+1) th to 32 nd levels that • have the same prefix. CIDR representation means that routers just can store just the n th level entry • if the router uses the same next hop for all IP addresses reachable by it. When you see a netmask of “16”, it means we’re talking about the 16 th level • in this binary tree.

  7. Recap: CIDR (Classless Inter Domain Routing) • Key idea: Get rid of IP classes in routing tables. • How? Think of IP addresses as leaves of a 32 level binary tree. A node on the n th level • can reach all nodes on the (n+1) th to 32 nd levels that have the same prefix. CIDR representation means that routers just can store just the n th level entry if • the router uses the same next hop for all IP addresses reachable by it. Same length netmask All bits match except for the last one Same port Prefix Netmask Prefix After Masking (in Binary) Next Hop Reachable Through 207.46.0.0 19 11001111 00101110 000***** ******** Port 1 207.46.0.0 18 Port 1 11001111 00101110 00****** ******** 207.46.0.0 17 Port 1 207.46.32.0 19 11001111 00101110 001***** ******** Port 1 11001111 00101110 0******* ******** 207.46.64.0 18 11001111 00101110 01****** ******** Port 1 207.46.128.0 18 11001111 00101110 10****** ******** Port 2 207.46.192.0 18 11001111 00101110 11****** ******** Port 3

  8. Today in class 1. 2. 3. Recap: Packet Internet Network layer fragmentation Protocol v4 and functions v6 8

  9. Fragmentation at the network layer • The network layer interconnects many different networks. • Each of these could have different MTUs (Maximum Transmission Units). • This is the size of the largest frame the link layer can handle. • Anything bigger is not transmitted. • MTUs are unknown prior to sending a message. • How the IP protocol deals with this: • The network layer finds out the MTU of the current network. • Easy. They’re on the same device. • The network layer “fragments” packets so they all are compatible with the current networks link layer. • Easy. Just take a transport layer datagram. Break it into (MTU – IP header) sized chunks. Slap an IP header on each chunk. That’s one packet. • The network layer reassembles these frames so that the receiver can get the original packet back. • Not so easy.

  10. Fragmentation at the network layer • Discuss: What information does the receiver need to have to correctly reassemble packets? MTU = 4000 MTU = 2000 MTU = 1500 3 4 Datagram Dgram1 Dgram2 1 2

  11. Fragmentation at the network layer • The IP protocol header has three fields to help with reassembly. • Identifier: A unique number for the original (senders) datagram. • “MF” flag: More fragments to follow. This is 0 for the last fragment. • Offset: Which bytes from the original datagram are in the current packet. 0 4 8 12 16 19 24 31 HLen TOS Datagram Length Version Identifier Offset Flags TTL Protocol Checksum Source IP Address Destination IP Address Options (if any, usually not) Data

  12. Fragmentation at the network layer MTU = 4000 MTU = 2000 MTU = 1500 Length = 2000, M = 1 Offset = 0 IP Data Length = 3820, M = 0 20 1980 IP Hdr Data 1980 3800 20 Length = 1840, M = 0 + 1820 Offset = 1980 = 3800 IP Data 20 1820

  13. Fragmentation at the network layer MTU = 2000 MTU = 1500 Length = 2000, M = 1 Length = 1500, M = 1 Offset = 0 Offset = 0 IP Data IP Data Length = 1500, M = 1 Offset = 1980 20 1980 20 1480 IP Data 1480 Length = 520, M = 1 20 1480 Offset = 1480 + 500 Length = 1840, M = 0 Length = 360, M = 0 IP Data Offset = 1980 = 1980 Offset = 3460 IP Data 20 500 IP Data 20 1820 20 340

  14. Fragmentation at the network layer Reassembly happens at the destination. Length = 1500, M = 1, Offset = 0 • The M = 0 fragment gives us the total data size: IP Data fragment offset + len(data in fragment). 20 1480 • Take fragment with smallest offset, remove header. Length = 520, M = 1, Offset = 1480 Add data field to datagram. Repeat until all IP Data fragments are assembled. 20 500 • Challenges: • Fragments arrive out-of-order (painful, but ok) Length = 1500, M = 1, Offset = 1980 • Duplicate fragments (painful, but ok) IP Data • Missing fragments (drop the packet) 20 1480 Length = 360, M = 0, Offset = 3460 IP Data 340 20

  15. Fragmentation at the network layer • Discuss: What Internet principles and characteristics are at work in IP fragmentation? • Each network can have its own MTU [decentralization and heterogeneity] • Fragments contain complete routing information and can travel independently of its fellow fragments [packet switching] • Routers can silently drop fragments without alerting the sender [best- effort, no guarantees] • Reassembly is only done at the end-points [end-to-end principle and fate- sharing]

  16. Fragmentation at the network layer • Computation and fragmentation • Fragmentation is expensive – memory required to hold fragments and CPU required to split them up and put them together correctly. • Routers have dedicated hardware and CPUs to handle fragmentation. • Discuss: Fragmentation is expensive. How do we avoid it? Assume we can set a “don’t fragment” bit on each packet. • MTU discovery protocol. • Send packets with a “don’t fragment” flag. If it doesn’t reach the destination, the packet is too big. Reduce the packet size and try again.

  17. Today in class 1. 2. 3. Recap: Packet IPv4 and IPv6 Network layer fragmentation functions 17

  18. No more IPv4 • How many hosts on the Internet? About 23 billion! How many IPv4 addresses? 2 32 (about 4.2 billion) • • In 1980, when IPv4 was designed there were 50 universities (with a few computers each) on the Internet. • 31 years later, we’re almost out of IP addresses. Region Regional Internet Registry (RIR) IPv4 Exhaustion Date Asia/Pacific APNIC April 19, 2011 Europe/Middle East RIPE September 14, 2012 South America LACNIC June 10, 2014 North America ARIN September 22, 2015 Africa AFRINIC January 2022 (Projected)

  19. IPv6 to replace IPv4 • IPv6 introduced in 1998. It has 128-bit addresses! 2 128 (3.5x10 38 ) different IP addresses! • • Are we going to laugh at how small this is in 2050? • Probably not. There are only 7.5x10 18 grains of sand in the world (famous last words). • • Address format of IPv6. • 8 groups of 16- bit values, separated by ‘:’ • Leading zeroes in each group may be omitted • Groups of zeroes can be omitted using ‘::’ • Examples (all are valid): • 2001:0db8:0000:0000:0000:ff00:0042:8329 • 2001:0db8:0:0:0:ff00:42:8329 • 2001:0db8::ff00:42:8329

Recommend


More recommend