CS 455/555 Intro to Networks and Communications. Link Layer

Similar documents
Chapter 5 Link Layer and LANs

The Link Layer and LANs. Chapter 6: Link layer and LANs

CSC 4900 Computer Networks: The Link Layer

Chapter 5: Link layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 16

CSC 401 Data and Computer Communications Networks

Lecture 8 Link Layer: functionality, error detection, media access algorithm

Data Link Layer: Multi Access Protocols

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Outline. Introduction to Networked Embedded Systems - Embedded systems Networked embedded systems Embedded Internet - Network properties

ECE 4450:427/527 - Computer Networks Spring 2017

Link Layer and LANs 안상현서울시립대학교컴퓨터 통계학과.

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

1-1. Switching Networks (Fall 2010) EE 586 Communication and. November 8, Lecture 30

Chapter V: Link Layer

CC451 Computer Networks

Lecture 8 The Data Link Layer part I. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Lecture 19. Principles behind data link layer services Framing Multiple access protocols

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

Chapter 6 The Link Layer and LANs

Links. CS125 - mylinks 1 1/22/14

CMPE 150: Introduction to Computer Networks

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

Link layer, LANs: outline. Chapter 5-1 Link Layer. Link layer: introduction. Link layer services

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

Chapter 4 Network Layer

Module 10 Data Link Layer CS655! 10-1!

transferring datagram from one node data-link layer has responsibility of to adjacent node over a link 5-1 TDTS06 Computer networks

Chapter 5 Link Layer and LANs

Chapter V: Link Layer

CSCD 330 Network Programming

Multiple Access Links and Protocols

MULTIPLE ACCESS PROTOCOLS 2. 1

Broadcast Links, Addressing and Media Access Control. Link Layer B. Link and Physical Layers. MAC Addresses

Data Link Layer: Overview, operations

Link Layer and LANs. CMPS 4750/6750: Computer Networks

Chapter 6: Link layer and LANs. Link layer, LANs: outline. Link layer: introduction. Link layer: context. Link layer services (more)

SC250 Computer Networking I. Link Layer. Prof. Matthias Grossglauser LCA/I&C.

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Master Course Computer Networks IN2097

Master Course Computer Networks IN2097

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

CSCD 330 Network Programming Fall 2012

Physical Layer. Medium Access Links and Protocols. Point-to-Point protocols. Modems: Signaling. Modems Signaling. Srinidhi Varadarajan

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Module 4 Data Link Layer CS655! 4-1!

Medium Access Control

Link Layer: Introduction. Chapter 5 Link Layer & LANS. Link layer: context. Link Layer Services

Goals of Today s Lecture. Adaptors Communicating

CS 3516: Computer Networks

Chapter 5 Link Layer and LANs

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Lecture 5 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Link Layer and LANs. Our Goals. Link Layer

Lecture 6 - Link layer. Lecture 5 Review. Link Layer. Introduction, Services. Notes. Notes. Notes. Notes. Networks and Security. Jacob Aae Mikkelsen

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Redes de Computadores. Medium Access Control

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

CSC 8560 Computer Networks: Link Layer

Link Layer: Introduction. Chapter 5 Link Layer & LANS. Link layer: context. Link Layer Services

Chapter 5: DataLink Layer

Chapter 5: The Data Link Layer

Chapter 6 The Link Layer and LANs

Link Layer: Introduction. Chapter 5 Link Layer & LANS. Link layer: context. Link Layer Services

Chapter 5 Link Layer. Link Layer 5-1

Chapter 6 The Data Link layer

Link Layer and Ethernet

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

CSCI Computer Networks Spring 2017

CSCI Computer Networks Fall 2016

Link Layer and Ethernet

Chapter 6 The Link Layer and LANs

Chapter 6 The Link Layer and LANs

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

CSE 461: Multiple Access. Homework: Chapter 2, problems 1, 8, 12, 18, 23, 24, 35, 43, 46, and 58

Chapter 6 The Link Layer and LANs

Links. COS 461: Computer Networks Spring Mike Freedman h?p://

COMP211 Chapter 6/7 Link Layer

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

Links Reading: Chapter 2

Links. Error Detection. Link Layer. Multiple access protocols. Nodes Links Frame. Shared channel Problem: collisions How nodes share a channel

EE 122: Ethernet and

Data Link Layer Overview

Chapter 5 part 1 LINK LAYER

Data Link Layer Overview

COMP 3331/9331: Computer Networks and Applications. Data Link layer. Link layer, LANs: outline. Data Link Layer

Internet protocol stack

Data Link Layer Overview

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

Chapter 6 The Data Link layer

Data Link Layer Overview

Chapter 5 Link Layer and LANs

Chapter 6. Link Layer and LANs 6-1. Computer Networking: A Top Down Approach 7th edition Jim Kurose, Keith Ross Pearson/Addison Wesley April 2016

Physical and Data Link layers

Chapter 6 The Link Layer and LANs

Data Link Protocols. TCP/IP Suite and OSI Reference Model. The TCP/IP protocol stack does not define the lower layers of a complete protocol stack

Computer Communication Networks Link

Transcription:

CS 455/555 Intro to Networks and Communications Link Layer Dr. Michele Weigle Department of Computer Science Old Dominion University mweigle@cs.odu.edu http://www.cs.odu.edu/~mweigle/cs455-s13 1 Link Layer Outline Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet Link-Layer Switches 2

Link Layer Introduction Hosts and routers are nodes Communication channels that connect adjacent nodes along communication path are links» wired links» wireless links» LANs Layer-2 packet is a frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to adjacent node over a single link 3 Link Layer Context Datagram may be transferred by different link protocols over different links:» e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link Each link protocol provides different services» e.g., may or may not provide reliable transport over link Transportation Analogy trip from Norfolk to Florence» car: Norfolk to DC» plane: DC to Pisa» train: Pisa to Florence tourist = datagram transport segment = communication link transportation mode = link layer protocol travel agent = routing algorithm 4

Link Layer Services Framing, link access:» encapsulate datagram into frame, adding header, trailer» channel access if shared medium» MAC addresses used in frame headers to identify source, destination different from IP address Reliable delivery between adjacent nodes» seldom used on low bit error link (fiber, some twisted pair)» wireless links: high error rates 5 Link Layer Services (more) Flow Control:» pacing between adjacent sending and receiving nodes Error Detection:» errors caused by signal attenuation, noise.» receiver detects presence of errors: signals sender for retransmission or drops frame Error Correction:» receiver identifies and corrects bit error(s) without resorting to retransmission Half-duplex and full-duplex» with half duplex, nodes at both ends of link can transmit, but not at same time 6

Link Layer Where is the link layer implemented? Link layer implemented in "adapter" (aka network interface card NIC)» Ethernet card, PCMCI card, 802.11 card» implements link, physical layer Attaches into host's system buses Combination of hardware, software, firmware 7 Link Layer Adapters Communicating Sending side:» encapsulates datagram in a frame» adds error checking bits, reliable data transport, flow control, etc. Receiving side:» looks for errors, reliable data transport, flow control, etc» extracts datagram, passes to receiving node 8

Link Layer Outline Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet Link-Layer Switches 9 Link Layer Error Detection Error detection not 100% reliable» may miss some errors» larger EDC field yields better detection and correction error detection and correction bits 10

Error Detection Common Techniques Parity Check» illustrate basic ideas behind error detection and correction Checksumming» typically used in transport layer Cyclic Redundancy Check (CRC)» typically used in the link layer in the adapter 11 Error Detection Parity Checking Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors odd parity 0 0 even parity 12

Error Detection Internet Checksum Goal: detect "errors" (e.g., flipped bits) in transmitted packet (note: used at transport layer only) Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1's complement sum) of segment contents sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value:» NO - error detected» YES - no error detected. But maybe errors nonetheless? 13 Error Detection Cyclic Redundancy Check (CRC) View data bits, D, as a binary number Choose r+1 bit pattern (generator), G Choose r CRC bits, R, such that <D, R> exactly divisible by G (modulo 2) Receiver knows G, divides <D, R> by G» if non-zero remainder: error detected! Can detect all burst errors less than r+1 bits 14

CRC Example Want: D. 2 r XOR R = ng equivalently: D. 2 r = ng XOR R equivalently: if we divide D. 2 r by G, want remainder R d = 6, r = 3 D R. 2 r = remainder [ ] G 15 Link Layer Outline Introduction and services Error detection and correction Multiple access protocols Link-layer addressing Ethernet Link-Layer switches 16

Link Layer Multiple Access Links and Protocols Point-to-point» PPP for dial-up access» point-to-point link between Ethernet switch and host Broadcast (shared wire or medium)» old-fashioned Ethernet» upstream HFC» 802.11 wireless LAN humans at a cocktail party (shared air, acoustical) shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) 17 Link Layer Multiple Access Single shared broadcast channel Two or more simultaneous transmissions by nodes: interference» collision, if node receives two or more signals at the same time Multiple access protocol» distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit» communication about channel sharing must use channel itself no out-of-band channel for coordination 18

Multiple Access Protocols Ideal Protocol Broadcast channel of rate R bps when one node wants to transmit, it can send at rate R when M nodes want to transmit, each can send at average rate R/M fully decentralized» no special node to coordinate transmissions» no synchronization of clocks, slots simple 19 Multiple Access Control (MAC) Protocols Taxonomy Channel Partitioning» divide channel into smaller "pieces" (time slots, frequency, code)» allocate piece to node for exclusive use Random Access» channel not divided, allow collisions» "recover" from collisions "Taking turns"» nodes take turns, but nodes with more to send can take longer turns 20

Channel Partitioning Protocols Time Division Multiple Access (TDMA) Access to channel in "rounds" Each station gets fixed length slot (length = pkt trans time) in each round Unused slots go idle Example:» 6-station LAN» 1, 3, 4 have packets» slots 2, 5, 6 idle 6-slot frame 1 3 4 1 3 4 21 Channel Partitioning Protocols Frequency Division Multiple Access (FDMA) Channel spectrum divided into frequency bands Each station assigned fixed frequency band Unused transmission time in frequency bands go idle Example:» 6-station LAN» 1, 3, 4 have packets» frequency bands 2, 5, 6 idle time FDM cable frequency bands 22

MAC Protocols Random Access Protocols When node has packet to send» transmit at full channel data rate R» no a priori coordination among nodes Two or more transmitting nodes "collision" Random access MAC protocol specifies:» how to detect collisions» how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MAC protocols:» slotted ALOHA» ALOHA» CSMA, CSMA/CD, CSMA/CA 23 Random Access Protocols Slotted ALOHA Assumptions: All frames are L bits Time divided into equal size slots of L/R seconds (time to transmit 1 frame) Nodes start to transmit only at slot beginning Nodes are synchronized If 2 or more nodes transmit in slot, all nodes detect collision Operation: When node obtains fresh frame, transmits in next slot» if no collision: node can send new frame in next slot» if collision: node retransmits frame in each subsequent slot with probability p until success 24

Random Access Protocols Slotted ALOHA Pros Single active node can continuously transmit at full rate of channel Highly decentralized: only slots in nodes need to be in sync Simple Cons Collisions, wasting slots Idle slots Clock synchronization 25 Slotted ALOHA Efficiency Efficiency: long-run fraction of successful slots Suppose N nodes with many frames to send, each transmits in slot with probability p Probability that given node has success in a slot p (1-p) N-1 Max efficiency» find p* that maximizes Np (1-p) N-1 For many nodes, take limit of Np* (1-p*) N-1 as N goes to infinity Max efficiency = 1/e =.37 Probability that any node has a success Np (1-p) N-1 At best, channel used for useful transmissions 37% of time! 26

Random Access Protocols Pure (unslotted) ALOHA Simpler, no synchronization When frame first arrives, transmit immediately Collision probability increases:» frame sent at t 0 collides with other frames sent in [t 0-1, t 0 +1] 27 Pure ALOHA Efficiency P (success by given node) = P (node transmits) * P (no other node transmits in [t 0-1, t 0 ]) * P (no other node transmits in [t 0, t 0 +1]) = p (1-p) N-1 (1-p) N-1 = p (1-p) 2(N-1) choosing optimum p and then letting n -> infinity... = 1/(2e) =.18 even worse than slotted ALOHA 28

Random Access Protocols CSMA (Carrier Sense Multiple Access) Listen before transmit» if channel sensed idle, transmit entire frame» if channel sensed busy, defer transmission for a random amount of time and listen again Listen while transmitting» if collision, stop transmitting 29 CSMA Collisions spatial layout of nodes collisions can still occur: propagation delay means two nodes may not hear each other's transmission collision: entire packet transmission time wasted note the role of distance and propagation delay in determining collision probability 30

CSMA CSMA/CD (Collision Detection) Carrier sensing, deferral as in CSMA» collisions detected within short time» colliding transmissions aborted, reducing channel wastage Collision detection» easy in wired LANs measure signal strengths, compare transmitted, received signals» difficult in wireless LANs received signal strength overwhelmed by local transmission strength Human analogy: the polite conversationalist 31 CSMA/CD Collision detection 32

MAC Protocols "Taking Turns" MAC protocols Channel partitioning MAC protocols» share channel efficiently and fairly at high load» inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocols» efficient at low load: single node can fully utilize channel» high load: collision overhead "Taking turns" protocols» look for best of both worlds! 33 "Taking Turns" MAC protocols Polling Master node "invites" slave nodes to transmit in turn data poll Typically used with "dumb" slave devices data master Concerns:» polling overhead» latency» single point of failure (master) slaves 34

"Taking Turns" MAC protocols Token Passing Control token passed from one node to next sequentially T Node can only send when it has the token (nothing to send) T Concerns:» token overhead» latency» single point of failure (token) data 35 MAC Protocols Summary Channel partitioning, by time, frequency, or code» Time Division, Frequency Division Random access (dynamic)» ALOHA, S-ALOHA, CSMA, CSMA/CD» carrier sensing: easy in some technologies (wire), hard in others (wireless)» CSMA/CD used in Ethernet» CSMA/CA used in 802.11 Taking turns» polling from central site, token passing» Bluetooth, FDDI, IBM Token Ring 36

Link Layer Outline Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet Link-Layer Switches 37