SlideShare a Scribd company logo
1 of 31
Download to read offline
Computer Networks:
Architecture and Protocols
CS4450
Lecture 6
Data Link Layer
Rachit Agarwal
1
Announcements
• We will have a “live” coding class on 02/28
• Please bring your laptops
• Its gonna be a lot of fun!
• We will learn how to implement sockets, etc.
• Please read Chapter 1 of the textbook!
• And try to solve problems at the end of Chapter 1 of the textbook
• For extra practice
• Ask us questions on Piazza
• In-class Quiz policy
• We understand that sometimes its impossible to attend a lecture
• Email AT LEAST AN HOUR BEFORE the lecture if you can’t attend
• If legitimate reasons, we will ignore that quiz for you
2
Quick recap from last lecture
3
• How to break system into modules
• Layering
• Where are modules implemented
• End-to-End Principle
• Where is state stored?
• Fate-Sharing
Recap: Three design principles
4
• Build something that works
• Connect existing networks
• Robust in face of failures
• Support multiple types of delivery service
• Accommodate a variety of networks
• Allow distributed management
• Easy host attachment
• Cost effective
• Allow resource accountability
Recap: Internet Design Goals
5
Context for Today’s Lecture
• You now understand
• Network sharing (in depth)
• Architectural principles and design goals (in depth)
• End-to-end working of the Internet (at a high-level)
• Now its time to dive deep:
• Link Layer (~1 week)
• Network Layer (~4 weeks)
• Transport Layer (~3 weeks)
• Today: Link layer
6
Goals for Today’s Lecture
• Link layer:
• Broadcast medium
• Sharing broadcast medium
• Carrier Sense Multiple Access - Collision Detection (CSMA/CD)
7
• Communication Medium
• Point-to-point
• The high-level ideas discussed so far were for point-to-point
• Broadcast
• Original design of Link layer protocols
• More recent versions have moved to point-to-point
• We will discuss why so!
• Network Adapters (e.g., NIC — network interface card)
• The hardware that connects a machine to the network
• Has a “name” — MAC (Medium access control) address
Data Link Layer
8
Point-to-Point vs. Broadcast Medium
• Point-to-point: dedicated pairwise communication
• E.g., long distance fiber link
• E.g., Point-to-point link between two routers
• Broadcast: shared wire or medium
• Traditional Link Layer (Ethernet)
• 802.11 wireless LAN
9
• Ever been to a party?
• Tried to have an interesting discussion?
• Fundamental challenge?
• Collisions
Data Link Layer: Broadcast (until ~2000s)
Broadcast Medium: Desirable properties
• One and only one: data delivery
• How do we design a broadcast medium protocol for data delivery?
11
link-layer “protocol”
source
NIC NIC NIC
desanaaon
Where it all Started: AlohaNet
12
• Norm Abramson:
• Left Stanford in 1970
• So he could SURF
• Set up first data communication system for Hawaiian islands
• Central hub at University of Hawaii, Oahu
Aloha Signaling
• Two channels: random access, broadcast
• Sites send packets to hub
• Random access channel
• Each site transmits packets at “random” times
• If a packet not received (due to collision), site resends
• Hub sends packets to all sites
• Broadcast channel
• Sites can receive even if they are also sending
• Challenge: Requires a centralized hub
• If the hub fails, the entire network fails
• Not always a good design
13
Sharing a broadcast channel
• Context: a shared broadcast channel
• Must avoid/handle having multiple sources speaking at once
• Otherwise collisions lead to garbled data
• Need distributed algorithm for sharing channel
• Algorithm determines when and which source can transmit
• Three classes of techniques
• Frequency-division multiple access: divide channel into pieces
• Time-division multiple access: divide channel into time slots
• Random access: allow uncoordinated access
• Detect collisions, and if needed, recover from collisions
• More in the Internet style!
14
• Frequency sharing
• Divide the channel into frequencies
• Every source is assigned a subset of frequencies
• And transmits data only on its assigned frequency
• Goods: no collisions
• Not-so-good:
• A source may have nothing to send (frequency wasted)
• Interference may cause disruption
• Hard to implement for wired networks
• Used in wireless networks
• E.g., radio
Frequency-Division Multiple Access (FDMA)
• Time sharing
• Divide time into slots
• Divide data into frames
• Such that a frame can be transmitted in one slot
• Every source is assigned a subset of slots
• And transmits a frame only in its assigned slot
• Goods: no collisions
• Not-so-good: Underutilization of resources
• During a slot, a source may have nothing to send
• When the source has something to send, wait for its slot
Time-Division Multiple Access (TDMA)
Random Access
17
• Bob Metcalfe:
• Xerox PARC
• Visits Hawaii, and gets the idea
• Shared wired medium
Life lesson:
If you want to invent great things,
go to Hawaii :-)
18
Link Layer (MAC) Protocol
• When source has a frame to send
• Transmit at full bandwidth
• No a priori coordination among nodes
• Two or more transmitting sources => collision
• Frame lost
• Link-layer protocol specifies:
• How to detect collision
• How to recover from collisions
19
LETS TRY!
Group Exercise:
Multiple source-destination pairs
Design a protocol that allows sharing the broadcast medium
20
link-layer “protocol”
source1
Adapter
source2
Adapter Adapter
desanaaon
CSMA (Carrier Sense Multiple Access)
• CSMA: listen before transmit
• If channel sensed idle: transmit entire frame
• If channel sensed busy: defer transmission
• Human analogy: don’t interrupt others!
• Does this eliminate all collisions?
• No, because of nonzero propagation delay
• Solution:
• Include a Collision Detection (CD) mechanism
• If a collision detected
• Retransmit
21
CSMA/CD (Carrier Sense Multiple Access, Collision Detection)
• CSMA/CD: carrier sensing
• Collisions detected within short time
• Colliding transmissions aborted, reducing wastage
• Collision detection easy in wired (broadcast) LANs
• Compare transmitted and received signals
• Collision detection difficult in wireless LANs
22
CSMA/CD (Collision Detection)
23
• B and D can tell that collision occurred
• However, need restrictions on
• Minimum frame size
• Maximum distance
• Why?
• Latency depends on physical length of link
• Time to propagate a bit from one end to the other
• Suppose A sends a packet at time 0
• B sees an idle line at all times before d
• … so B happily starts transmitting a packet
• B detects a collision at time d, and sends jamming signal
• But A can’t see collision until 2d
• A must have a frame size such that transmission time > 2d
• Need transmission time > 2 * propagation delay
24
Limits on CSMA/CD Network Length and Frame Size
Limits on CSMA/CD Network Length and Frame Size
• Transmission time > 2 * propagation delay
• Imposes restrictions.
• Example: consider 100 Mbps Ethernet
• Suppose minimum frame length: 512 bits (64 bytes)
• Transmission time = 5.12 μsec
• Thus, we want propagation delay < 2.56 μsec
• Length < 2.56 μsec * speed of light
• Length < 768m
• What about 10Gbps Ethernet?
25
Once a collision is detected …
26
• When should the frame be resent?
• Immediately?
• Every NIC would start sending immediately
• Collision again!
• Take turns?
• Back to time division multiplexing
• Carrier Sense: continuously listen to the channel
• If idle: start transmitting
• If busy: wait until idle
• Collision Detection: listen while transmitting
• No collision: transmission complete
• Collision: abort transmission; send jam signal
• Random access: exponential back off
• After collision, transmit after “waiting time”
• After k collisions, choose “waiting time” from {0, …, 2k-1)
• Exponentially increasing waiting times
• But also, exponentially larger success probability
CSMA/CD in one slide!
27
CSMA/CD (Collision Detection): An example
28
Attempt 1: Suppose a collision happens
Attempt 2: Four possibilities
Success with Probability = 0.5
Group Exercise:
What is the success probability in attempt 3?
Answer: 0.75
Performance of CSMA/CD
•Time spent transmitting a frame (collision)
•Proportional to distance d; why?
•Time spent transmitting a frame (no collision)
•Frame length p divided by bandwidth b
•Rough estimate for efficiency (K some constant)
•Observations:
•For large frames AND small distances, E ~ 1
•Right frame length depends on b, K, d
•As bandwidth increases, E decreases
•That is why high-speed LANs are switched
30
Evolution
• Ethernet was invented as a broadcast technology
• Hosts share channel
• Each packet received by all attached hosts
• CSMA/CD
• Current Ethernets are “switched” (next lecture)
• Point-to-point medium between switches;
• Point-to-point medium between each host and switch
• No sharing, no CSMA/CD
31

More Related Content

Similar to lecture06-link-layer.pdf

CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)Sam Bowne
 
Switching Concepts presentation
Switching Concepts presentationSwitching Concepts presentation
Switching Concepts presentationzameer Abbas
 
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)Sam Bowne
 
CISSP - Chapter 4 - Network Topology
CISSP - Chapter 4 - Network TopologyCISSP - Chapter 4 - Network Topology
CISSP - Chapter 4 - Network TopologyKarthikeyan Dhayalan
 
Computer networks unit ii
Computer networks    unit iiComputer networks    unit ii
Computer networks unit iiJAIGANESH SEKAR
 
2018 FRSecure CISSP Mentor Program- Session 7
2018 FRSecure CISSP Mentor Program- Session 72018 FRSecure CISSP Mentor Program- Session 7
2018 FRSecure CISSP Mentor Program- Session 7FRSecure
 
link-medium-access-control.pptx
link-medium-access-control.pptxlink-medium-access-control.pptx
link-medium-access-control.pptxpatrickwang85
 
Module 1 Introduction to Computer Networks.pptx
Module 1 Introduction to Computer Networks.pptxModule 1 Introduction to Computer Networks.pptx
Module 1 Introduction to Computer Networks.pptxAASTHAJAJOO
 
IP Signal Distribution
IP Signal DistributionIP Signal Distribution
IP Signal DistributionrAVe [PUBS]
 
24-ad-hoc.ppt
24-ad-hoc.ppt24-ad-hoc.ppt
24-ad-hoc.pptsumadi26
 
Protocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 Protocol
Protocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 ProtocolProtocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 Protocol
Protocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 ProtocolPradnya Saval
 
Protocols and Interfaces - IPv4, IPv6, X.25, X.75
Protocols and Interfaces - IPv4, IPv6, X.25, X.75Protocols and Interfaces - IPv4, IPv6, X.25, X.75
Protocols and Interfaces - IPv4, IPv6, X.25, X.75Pradnya Saval
 
Networkprotocolstructurescope 130719081246-phpapp01
Networkprotocolstructurescope 130719081246-phpapp01Networkprotocolstructurescope 130719081246-phpapp01
Networkprotocolstructurescope 130719081246-phpapp01Gaurav Goyal
 

Similar to lecture06-link-layer.pdf (20)

CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)
 
Switching Concepts presentation
Switching Concepts presentationSwitching Concepts presentation
Switching Concepts presentation
 
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
 
Switching
SwitchingSwitching
Switching
 
CISSP - Chapter 4 - Network Topology
CISSP - Chapter 4 - Network TopologyCISSP - Chapter 4 - Network Topology
CISSP - Chapter 4 - Network Topology
 
Computer networks unit ii
Computer networks    unit iiComputer networks    unit ii
Computer networks unit ii
 
unit1.ppt
unit1.pptunit1.ppt
unit1.ppt
 
2018 FRSecure CISSP Mentor Program- Session 7
2018 FRSecure CISSP Mentor Program- Session 72018 FRSecure CISSP Mentor Program- Session 7
2018 FRSecure CISSP Mentor Program- Session 7
 
link-medium-access-control.pptx
link-medium-access-control.pptxlink-medium-access-control.pptx
link-medium-access-control.pptx
 
Network devices
Network devicesNetwork devices
Network devices
 
Network hardware 2
Network hardware 2Network hardware 2
Network hardware 2
 
Module 1 Introduction to Computer Networks.pptx
Module 1 Introduction to Computer Networks.pptxModule 1 Introduction to Computer Networks.pptx
Module 1 Introduction to Computer Networks.pptx
 
Unit2.2
Unit2.2Unit2.2
Unit2.2
 
Basic networking
Basic networkingBasic networking
Basic networking
 
IP Signal Distribution
IP Signal DistributionIP Signal Distribution
IP Signal Distribution
 
24-ad-hoc.ppt
24-ad-hoc.ppt24-ad-hoc.ppt
24-ad-hoc.ppt
 
lecture04.ppt
lecture04.pptlecture04.ppt
lecture04.ppt
 
Protocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 Protocol
Protocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 ProtocolProtocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 Protocol
Protocol and Interfaces - IPv4, IPv6, X.25 Protocol, X.75 Protocol
 
Protocols and Interfaces - IPv4, IPv6, X.25, X.75
Protocols and Interfaces - IPv4, IPv6, X.25, X.75Protocols and Interfaces - IPv4, IPv6, X.25, X.75
Protocols and Interfaces - IPv4, IPv6, X.25, X.75
 
Networkprotocolstructurescope 130719081246-phpapp01
Networkprotocolstructurescope 130719081246-phpapp01Networkprotocolstructurescope 130719081246-phpapp01
Networkprotocolstructurescope 130719081246-phpapp01
 

Recently uploaded

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

lecture06-link-layer.pdf

  • 1. Computer Networks: Architecture and Protocols CS4450 Lecture 6 Data Link Layer Rachit Agarwal 1
  • 2. Announcements • We will have a “live” coding class on 02/28 • Please bring your laptops • Its gonna be a lot of fun! • We will learn how to implement sockets, etc. • Please read Chapter 1 of the textbook! • And try to solve problems at the end of Chapter 1 of the textbook • For extra practice • Ask us questions on Piazza • In-class Quiz policy • We understand that sometimes its impossible to attend a lecture • Email AT LEAST AN HOUR BEFORE the lecture if you can’t attend • If legitimate reasons, we will ignore that quiz for you 2
  • 3. Quick recap from last lecture 3
  • 4. • How to break system into modules • Layering • Where are modules implemented • End-to-End Principle • Where is state stored? • Fate-Sharing Recap: Three design principles 4
  • 5. • Build something that works • Connect existing networks • Robust in face of failures • Support multiple types of delivery service • Accommodate a variety of networks • Allow distributed management • Easy host attachment • Cost effective • Allow resource accountability Recap: Internet Design Goals 5
  • 6. Context for Today’s Lecture • You now understand • Network sharing (in depth) • Architectural principles and design goals (in depth) • End-to-end working of the Internet (at a high-level) • Now its time to dive deep: • Link Layer (~1 week) • Network Layer (~4 weeks) • Transport Layer (~3 weeks) • Today: Link layer 6
  • 7. Goals for Today’s Lecture • Link layer: • Broadcast medium • Sharing broadcast medium • Carrier Sense Multiple Access - Collision Detection (CSMA/CD) 7
  • 8. • Communication Medium • Point-to-point • The high-level ideas discussed so far were for point-to-point • Broadcast • Original design of Link layer protocols • More recent versions have moved to point-to-point • We will discuss why so! • Network Adapters (e.g., NIC — network interface card) • The hardware that connects a machine to the network • Has a “name” — MAC (Medium access control) address Data Link Layer 8
  • 9. Point-to-Point vs. Broadcast Medium • Point-to-point: dedicated pairwise communication • E.g., long distance fiber link • E.g., Point-to-point link between two routers • Broadcast: shared wire or medium • Traditional Link Layer (Ethernet) • 802.11 wireless LAN 9
  • 10. • Ever been to a party? • Tried to have an interesting discussion? • Fundamental challenge? • Collisions Data Link Layer: Broadcast (until ~2000s)
  • 11. Broadcast Medium: Desirable properties • One and only one: data delivery • How do we design a broadcast medium protocol for data delivery? 11 link-layer “protocol” source NIC NIC NIC desanaaon
  • 12. Where it all Started: AlohaNet 12 • Norm Abramson: • Left Stanford in 1970 • So he could SURF • Set up first data communication system for Hawaiian islands • Central hub at University of Hawaii, Oahu
  • 13. Aloha Signaling • Two channels: random access, broadcast • Sites send packets to hub • Random access channel • Each site transmits packets at “random” times • If a packet not received (due to collision), site resends • Hub sends packets to all sites • Broadcast channel • Sites can receive even if they are also sending • Challenge: Requires a centralized hub • If the hub fails, the entire network fails • Not always a good design 13
  • 14. Sharing a broadcast channel • Context: a shared broadcast channel • Must avoid/handle having multiple sources speaking at once • Otherwise collisions lead to garbled data • Need distributed algorithm for sharing channel • Algorithm determines when and which source can transmit • Three classes of techniques • Frequency-division multiple access: divide channel into pieces • Time-division multiple access: divide channel into time slots • Random access: allow uncoordinated access • Detect collisions, and if needed, recover from collisions • More in the Internet style! 14
  • 15. • Frequency sharing • Divide the channel into frequencies • Every source is assigned a subset of frequencies • And transmits data only on its assigned frequency • Goods: no collisions • Not-so-good: • A source may have nothing to send (frequency wasted) • Interference may cause disruption • Hard to implement for wired networks • Used in wireless networks • E.g., radio Frequency-Division Multiple Access (FDMA)
  • 16. • Time sharing • Divide time into slots • Divide data into frames • Such that a frame can be transmitted in one slot • Every source is assigned a subset of slots • And transmits a frame only in its assigned slot • Goods: no collisions • Not-so-good: Underutilization of resources • During a slot, a source may have nothing to send • When the source has something to send, wait for its slot Time-Division Multiple Access (TDMA)
  • 17. Random Access 17 • Bob Metcalfe: • Xerox PARC • Visits Hawaii, and gets the idea • Shared wired medium
  • 18. Life lesson: If you want to invent great things, go to Hawaii :-) 18
  • 19. Link Layer (MAC) Protocol • When source has a frame to send • Transmit at full bandwidth • No a priori coordination among nodes • Two or more transmitting sources => collision • Frame lost • Link-layer protocol specifies: • How to detect collision • How to recover from collisions 19
  • 20. LETS TRY! Group Exercise: Multiple source-destination pairs Design a protocol that allows sharing the broadcast medium 20 link-layer “protocol” source1 Adapter source2 Adapter Adapter desanaaon
  • 21. CSMA (Carrier Sense Multiple Access) • CSMA: listen before transmit • If channel sensed idle: transmit entire frame • If channel sensed busy: defer transmission • Human analogy: don’t interrupt others! • Does this eliminate all collisions? • No, because of nonzero propagation delay • Solution: • Include a Collision Detection (CD) mechanism • If a collision detected • Retransmit 21
  • 22. CSMA/CD (Carrier Sense Multiple Access, Collision Detection) • CSMA/CD: carrier sensing • Collisions detected within short time • Colliding transmissions aborted, reducing wastage • Collision detection easy in wired (broadcast) LANs • Compare transmitted and received signals • Collision detection difficult in wireless LANs 22
  • 23. CSMA/CD (Collision Detection) 23 • B and D can tell that collision occurred • However, need restrictions on • Minimum frame size • Maximum distance • Why?
  • 24. • Latency depends on physical length of link • Time to propagate a bit from one end to the other • Suppose A sends a packet at time 0 • B sees an idle line at all times before d • … so B happily starts transmitting a packet • B detects a collision at time d, and sends jamming signal • But A can’t see collision until 2d • A must have a frame size such that transmission time > 2d • Need transmission time > 2 * propagation delay 24 Limits on CSMA/CD Network Length and Frame Size
  • 25. Limits on CSMA/CD Network Length and Frame Size • Transmission time > 2 * propagation delay • Imposes restrictions. • Example: consider 100 Mbps Ethernet • Suppose minimum frame length: 512 bits (64 bytes) • Transmission time = 5.12 μsec • Thus, we want propagation delay < 2.56 μsec • Length < 2.56 μsec * speed of light • Length < 768m • What about 10Gbps Ethernet? 25
  • 26. Once a collision is detected … 26 • When should the frame be resent? • Immediately? • Every NIC would start sending immediately • Collision again! • Take turns? • Back to time division multiplexing
  • 27. • Carrier Sense: continuously listen to the channel • If idle: start transmitting • If busy: wait until idle • Collision Detection: listen while transmitting • No collision: transmission complete • Collision: abort transmission; send jam signal • Random access: exponential back off • After collision, transmit after “waiting time” • After k collisions, choose “waiting time” from {0, …, 2k-1) • Exponentially increasing waiting times • But also, exponentially larger success probability CSMA/CD in one slide! 27
  • 28. CSMA/CD (Collision Detection): An example 28 Attempt 1: Suppose a collision happens Attempt 2: Four possibilities Success with Probability = 0.5
  • 29. Group Exercise: What is the success probability in attempt 3? Answer: 0.75
  • 30. Performance of CSMA/CD •Time spent transmitting a frame (collision) •Proportional to distance d; why? •Time spent transmitting a frame (no collision) •Frame length p divided by bandwidth b •Rough estimate for efficiency (K some constant) •Observations: •For large frames AND small distances, E ~ 1 •Right frame length depends on b, K, d •As bandwidth increases, E decreases •That is why high-speed LANs are switched 30
  • 31. Evolution • Ethernet was invented as a broadcast technology • Hosts share channel • Each packet received by all attached hosts • CSMA/CD • Current Ethernets are “switched” (next lecture) • Point-to-point medium between switches; • Point-to-point medium between each host and switch • No sharing, no CSMA/CD 31