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 8: The Link Layer III Addressing Protocols (animations from Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain 1 You


  1. CS 3640: Introduction to Networks and Their Applications Fall 2018, Lecture 8: The Link Layer III – Addressing Protocols (animations from Christo Wilson @ NEU) Instructor: Rishab Nithyanand Teaching Assistant: Md. Kowsar Hossain 1

  2. You should… • Be checking Piazza regularly for announcements. • Be close to making a submission for assignment 1. • Know and understand: • The three Internet design principles. • Encapsulation. • 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. 2

  3. Recap: Medium access control protocols • What is the function of a MAC protocol? What are the general strategies for designing one? • Regulate access to the shared medium. • Strategies: Medium partitioning, token-based access, best-effort need- based access. • What are the problems with partitioning and token-based access? • Why does slotted ALOHA have better performance than standard ALOHA? • Introducing “slots” means that the “sensitive” transmission period is cut in half. This basically doubles the achievable throughput.

  4. The link layer: The CSMA/CA MAC protocol (1990s) • Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA). • Currently used in wireless transmission protocols (WiFi 802.11). • In wireless networks: • Carrier sensing while transmitting is not feasible, so collisions can only be detected at the receiver. Why? • Detecting collisions is harder because accurately sensing the medium is tough – wireless signals may not carry to far away hosts. • Connectivity is not transitive: If A can reach B and B can reach C, it doesn’t mean that A can reach C. • Instead, wireless networks just try to avoid collisions instead of detecting and retransmitting. They use the CSMA/CA protocol.

  5. The link layer: The CSMA/CA protocol • B wants to transmit to C. • Sense the carrier. Is another node transmitting? • Yes. So do an exponential back-off before trying again. A B C D

  6. The link layer: The CSMA/CA protocol • B wants to transmit to C. • Sense the carrier. Is another node transmitting? • No. Send frames. If I don’t get an ACK in reasonable time, start again. A B C D

  7. The link layer: The CSMA/CA MAC protocol • Step 1: • Sense the carrier. Is another node transmitting? • Step 2: • If the carrier is not busy: Send the frames. • If the carrier is busy: Do an exponential back-off and go to step 1. • Step 3: • Wait for an acknowledgement. If it doesn’t arrive after “timeout” seconds, go to step 1 and try again. • Problem: Collisions can still occur and utilization can be low! • Why? Hidden nodes and exposed terminals.

  8. The link layer: The CSMA/CA MAC protocol – Hidden terminals • Step 1 : Sense the carrier. Is another node transmitting? • Hidden nodes can increase false-negatives. Collision! A B C C cannot hear A A cannot hear C

  9. The link layer: The CSMA/CA MAC protocol – Hidden terminals • Discuss: Would asking for permission from the receiver help? Collision! A B C C cannot hear A A cannot hear C

  10. The link layer: The CSMA/CA MAC protocol (with RTS/CTS) A B C

  11. The link layer: The CSMA/CA MAC protocol (with RTS/CTS) • Step 1: • Sense the carrier. Is another node transmitting? • Step 2: • If the carrier is not busy: Tell the receiver you have something to send via a “Request To Send” (RTS) message. Wait for “timeout” seconds for a “Clear To Send” (CTS) message from the receiver. • If CTS arrives: send the frames. • If CTS doesn’t arrive: do an exponential back -off and go to step 1. • If the carrier is busy: Do an exponential back-off and go to step 1. • Step 3: • Wait for an acknowledgement. If it doesn’t arrive after “timeout” seconds, go to step 1 and try again. • Solves the hidden terminal problem, doesn’t help with exposed terminals.

  12. The link layer: The CSMA/CA MAC protocol – Exposed terminals • Step 1 : Sense the carrier. Is another node transmitting? • Exposed terminals can increase false-positives. Carrier sense detects a busy channel No collision No collision A B C D

  13. The link layer: The CSMA/CA MAC protocol – Exposed terminals • Discuss: Why doesn’t RTS/CTS messaging work here? • RTS/CTS helps reduce false-negatives (thinking that the medium is free when it isn’t) but doesn’t prevent false - positives (thinking the medium is busy when it isn’t) because we never actually reach the RTS stage when we have a false-positive. A B C D

  14. The link layer: The CSMA/CA MAC protocol – Exposed terminals • Discuss: Why not skip sensing and just start with an RTS message if it solves the exposed terminal problem? • Overhead! • RTS/CTS packets don’t have any useful data in them. As your network gets faster, you send more RTS/CTS packets per second because you can handle more transmissions per second. • RTS/CTS overhead on a 1Mbps WiFi connection: 4% • RTS/CTS overhead on a 11Mbps WiFi connection: 25% • Sending RTS/CTS packets when you don’t need to will only make this worse. • Lesson: Everything is a trade-off! • Researchers and engineers decided that the overhead from this approach was too high to be a feasible solution to the exposed terminal problem.

  15. Recap: Medium access control protocols • What is the general idea behind CSMA protocols? • Sense the medium before transmitting. • Why are wireless media more challenging? • Collisions can only be detected at the receiver and carrier sensing is not always accurate. • Why do we need a CSMA/CD and CSMA/CA protocol? • Collisions can still occur due to transmission delays, CSMA/CD detects these and improves throughput by stopping transmission as soon as it is detected. • CSMA/CA tries to avoid collisions entirely by requesting permission from the receiver before transmission.

  16. This week in class 1. 2. 3. Recap: Error Link layer Link layer detection in the principles: principles: link layer Medium access Addressing 16

  17. Addressing in the link layer • When we studied MAC protocols, we assumed that packets went on every wire (i.e., they were broadcasted). • This is why collisions occurred, but there was no need for any logic in the link-layer hardware. • Originally, Ethernet was a broadcast- only medium and that’s how things worked. Today, with new types of hardware we have new opportunities for efficiency-gain. Terminator Repeater

  18. Link layer and network interface technologies: Hubs • Discuss: What are the pros and cons of using Hubs for your LAN? • Pros: Dirt cheap hardware with no logic. • Cons: Poor efficiency and scalability. Good enough for small LANs. Send Packet B → C Hub B C

  19. Link layer and network interface technologies: Bridges and switches • Discuss: What could we do to improve efficiency and scalability? • Stop using broadcast! Only send packets to their intended recipients. • This is what bridges and switches do. They contain logic to figure out which wire to put packets on. Send Packet A B → C Bridge B C

  20. Link layer and network interface technologies: Bridges and hubs in the real world • In the real world, we use a combination of old ethernet broadcast nets, hubs, and bridges. • Bridges are usually used to create a “bridge” between two small LANs. Hub Hub

  21. Link layer and network interface technologies: Bridges and hubs in the real world • Discuss: Why aren’t bridges used within all LANs? • This is the real world. You cannot force deployment – even when it is better (Windows XP in most federal agency computers). • Bridges are more expensive and complex than hubs. Hub Hub

  22. Link layer and network interface technologies: Bridges vs. Hubs (the internals) • Why are bridges more expensive and complicated? • They have memory for packets to be queued. • The have internal logic to forward packets to the correct wires. Bridge Hub Inputs Outputs Switch Fabric Makes routing Memory buffer decisions

  23. How do switches/bridges know what packet goes on which wire? • Each interface has a “MAC address”. • This is a 48-bit string that is allocated by the device manufacturer. • MAC addresses are unique to a device and usually cannot be changed. • Regulated by the IEEE. • Every link layer frame needs to have a source and destination MAC address to ensure forwarding is done correctly.

  24. How do switches/bridges know what packet goes on which wire? • Each interface has a “MAC address”. • Each bridge/switch maintains a “forwarding table”. • Basically a collection of records of which MAC addresses are accessible through which ports. Records expire after a “timeout”. MAC address port age 00:00:00:00:00:AA 1 1 minute 00:00:00:00:00:BB 2 7 minutes 00:00:00:00:00:CC 3 2 seconds 00:00:00:00:00:DD 1 3 minutes

  25. How do switches/bridges know what packet goes on which wire? • How is the forwarding table built? • Look at the source of each arriving frame. • Which MAC address sent the frame? • Which port did it reach the bridge on? Delete old entries after a timeout MAC Address Port Age 00:00:00:00:00:AA 1 0 minutes 00:00:00:00:00:AA 00:00:00:00:00:BB 2 0 minutes Port 1 Port 2 Hub 00:00:00:00:00:BB

Recommend


More recommend