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 9: The Network Layer I: Addressing (Credit: Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain 1 You should Be


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

  2. You should… • Be checking Piazza regularly for announcements. • Be ready for assignment 2. • Download VirtualBox and assignment at end of class! • 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. • How error detection works at the link layer. • How medium access control works at the link layer – ALOHA, CSMA/CD, CSMA/CA, RTS/CTS. • How link layer addressing and routing works - End hosts, Switches, Hubs. 2

  3. Today in class 1. layer principles 2. 3. Recap: Link The role of the Network layer network layer addressing 3

  4. Recap: Medium access control protocols • What is the function of a MAC protocol? What are the general strategies for designing one? • Why does slotted ALOHA have better performance than standard ALOHA? • Why cant we use CSMA/CD for wireless media? • Carrier sensing while transmitting is not feasible, so collisions can only be detected at the receiver. • What is the hidden terminal problem with CSMA/CA? How do we solve it? • Two terminals want to transmit to another common terminal. They cannot hear each other and they collide. Asking for permission to transmit helps (RTS/CTS). • What is the exposed terminal problem? Why don’t we use RTS/CTS always? • A terminal falsely thinks another is transmitting to the same destination and backs off. RTS/CTS is too expensive!

  5. Recap: Link layer addressing • Hubs vs. Switches vs. Bridges? Why are hubs a good/bad idea? • Hubs broadcast everywhere. • Switches and bridges are more intelligent and maintain forwarding tables. • Switches are connected to a single end-hosts. Bridges are connected to entire LANs. • What is a forwarding table? How do bridges/switches update their tables? • A collection of <MAC address, port/interface> entries used by switches to learn which MAC addresses are accessible through which interfaces. These mappings are gathered by observing source MAC addresses of each arriving frame. • If no entry exists, a frame is broadcasted through all interfaces. • Why are loops bad in our networks? How do we stop them? • They cause packets to circulate forever. Building a logical MST from routing tables avoid this. • MST construction high-level idea: Pick a root. Every node finds the shortest path to root. Merge all paths.

  6. Today in class 1. layer principles 2. 3. Recap: Link The role of the Network layer network layer addressing 6

  7. What the network layer does • It connects multiple LANs with each other. • Facilitate communication between incompatible link layers (e.g., Wi-Fi and Ethernet networks). Routers • The connected networks are an “internetwork”. Example: The Internet.

  8. The structure of the Internet • The Internet is a collection of interconnected networks. • It is not organized to have a specific topology and technologies in each network vary significantly. • Packets travel from source to destination by hopping through networks • Routers “peer” (connect) with different networks • At each hop a router sends packets to one of its peer networks • Remember: The Internet is packet-switched • Discuss: What are the implications of this? • Packets between the same source and destination can take different routes. Network 3 Network 1 Network 4 Network 2

  9. Forwarding vs. Routing • Discuss: How do you plan a long multi-day road trip? • You plan the trip at a high- level: We’ll drive from Iowa City to Chicago to Youngstown to New York. • This is routing: How can we make this packet reach its final destination? • Then you plan the day-to-day bits: We need to get off the I-80 and onto the I-76 to get from Iowa City to Chicago. • This is forwarding: How can we make this packet reach its next hop?

  10. The network layer • 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) • Why not use the link layer? It does both of these for LANs. • Link layer protocols were not designed to be scalable to billions of end-hosts. • Link layers can be different in different networks! • What makes the network layer special? • The core protocols are implemented in every host and router! There is no Internet without the network layer. • Discuss: What kind of service guarantees can the network layer provide if it has to serve every network on the Internet? • Serve the lowest common denominator. Best-effort but no guarantees.

  11. Today in class 1. layer principles 2. 3. Recap: Link The role of the Network layer network layer addressing 11

  12. Addressing options • Discuss: How did LANs deal with addressing? Why doesn’t that work on the Internet? • LANs relied on a “flat” addressing scheme. • A unique random 48-bit string for each device. • Problem: Each router has to remember how to reach every other device on the Internet (~23 Billion). • Discuss: How do we deal with addressing in the physical world? • We use a hierarchical addressing scheme. • Country (least specific) – State – City – Street – Building – Apartment – Person (most specific). • Mail routing offices along the way only need to know how to reach the region at some specificity. • E.g., UPS New York only needs to know how to get the parcel to UPS Iowa. UPS Iowa needs to get the parcel to UPS Iowa City.

  13. Network layer addressing • The Internet uses a hierarchical addressing scheme. Datagram, 1** Destination = 101 10* 100 101 11* 0** 110 00* 000 111 01* 001 010 011

  14. In In rea eality, th this is is what rou outes loo look li like

  15. IP addressing • Every device on the Internet has an “IP address” • IP (Internet Protocol) is THE network layer protocol. • There is no Internet without IP! • IPv4: 32 bit strings • They are usually written in dotted notation. Example: 192.168.0.1 • Each of these numbers is a byte. 0 8 16 24 31 Decimal 192 168 21 76 Hex C0 A8 15 4C Binary 11000000 10101000 00010101 01001100

  16. Requirements of routing tables • For ANY IP address, be able to give the next hop. • 32 bit addresses: 2 32 addresses! • Problem isn’t just storage. Also speed of lookup. • 4 10G ports operating at capacity will require 176Gbps memory bandwidth! • DRAM is 6 Gbps. • Need to hit caches and have smaller tables.

  17. The hierarchy of IP addresses • Each IP address has a “network” string known to all routers and a “host” string known to edge routers (access networks). 0 31 Pfx Network Host Known by all Known by edge routers (LAN) routers • How long is the network string and host string? • Depends on the “class” of the network.

  18. Classes of IP addresses 0 1 8 16 24 31 • Class A Example: MIT 0 Ntwk Host 18.*.*.* 1-126 0 2 8 16 24 31 Example: UIowa  Class B 10 Network Host 172.16.*.* 128-191 0 3 8 16 24 31 11 Example:  Class C Network Host 0 216.63.78.* 192-223 • IANA (Internet Assigned Number Authority) assigns IP addresses. • You can apply, get a class, and start installing routers that advertise routes to devices in your class.

  19. The hierarchy of IP addresses Networ Pfx Host k … … Subtree size determined by network class

  20. The hierarchy of IP addresses • Discuss: Do IP address classes solve our problem of memory on routing devices? Why or why not? Way too big Class Prefix Network Number of Classes Hosts per Class Bits Bits 2 7 – 2 = 126 2 24 – 2 = 16,777,214 A 1 7 (0 and 127 are reserved) (All 0 and all 1 are reserved) 2 14 = 16,398 2 16 – 2 = 65,534 B 2 14 (All 0 and all 1 are reserved) 2 21 = 2,097,512 2 8 – 2 = 254 C 3 21 (All 0 and all 1 are reserved) Total: 2,114,036 Too many network IDs

  21. The problem with class-based hierarchies • Problem: Too many hosts to remember for Class A and Class B access network routers. • Discuss: How would you do this? Way too big Class Prefix Network Number of Classes Hosts per Class Bits Bits 2 7 – 2 = 126 2 24 – 2 = 16,777,214 A 1 7 (0 and 127 are reserved) (All 0 and all 1 are reserved) 2 14 = 16,398 2 16 – 2 = 65,534 B 2 14 (All 0 and all 1 are reserved) 2 21 = 2,097,512 2 8 – 2 = 254 C 3 21 (All 0 and all 1 are reserved) Total: 2,114,036

  22. Reducing router storage with “subnets” • Problem: Too many hosts to remember for Class A and Class B access network routers. • Solution: Hack on another layer to the hierarchy. • Each “network” manages many “subnetworks”. • The number of hosts in each subnetwork is much smaller. • Each access network router only needs to know how to reach a subnet. • If it seems like everything on the Internet is a patched solution, its because it is! The designers did not foresee needing to store 1000s of entries on routers. Pfx Ntwk Subnet Host

Recommend


More recommend