CSCD 330 Network Programming

Similar documents
CSCD 330 Network Programming Fall 2012

Chapter 5 Link Layer and LANs

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

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

Chapter 5: Link layer

Data Link Layer: Multi Access Protocols

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

CSC 4900 Computer Networks: The Link Layer

CSC 401 Data and Computer Communications Networks

ECE 4450:427/527 - Computer Networks Spring 2017

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

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

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

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

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

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

Links. CS125 - mylinks 1 1/22/14

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

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

Chapter 6 The Link Layer and LANs

CC451 Computer Networks

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

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

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

Chapter V: Link Layer

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

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

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

CMPE 150: Introduction to Computer Networks

Chapter 5 Link Layer and LANs

Goals of Today s Lecture. Adaptors Communicating

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

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

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

Module 10 Data Link Layer CS655! 10-1!

Data Link Layer: Overview, operations

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

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

Multiple Access Links and Protocols

CS 3516: Computer Networks

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

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

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

Medium Access Control

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

Master Course Computer Networks IN2097

Chapter V: Link Layer

Link Layer and Ethernet

Link Layer and Ethernet

Chapter 4 Network Layer

MULTIPLE ACCESS PROTOCOLS 2. 1

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

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Master Course Computer Networks IN2097

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

Chapter 5: DataLink Layer

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

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

Chapter 5 Link Layer and LANs

Module 4 Data Link Layer CS655! 4-1!

EE 122: Ethernet and

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

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

Link Layer and LANs. Our Goals. Link Layer

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

Goal and Outline. Computer Networking. What Do We Need? Today s Story Lecture 3: Packet Switched Networks Peter Steenkiste

Medium Access Control

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

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

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Introduction to Computer Networks. 03 Data Link Layer Introduction

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

Links Reading: Chapter 2

CARRIER SENSE MULTIPLE ACCESS (CSMA):

Principles behind data link layer services

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

ECE 158A: Lecture 13. Fall 2015

CCM 4300 Lecture 5 Computer Networks, Wireless and Mobile Communications. Dr Shahedur Rahman. Room: T115

Link Layer: Retransmissions

Multiple Access Protocols

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

Chapter 5: The Data Link Layer

CS 4453 Computer Networks Winter

Medium Access Protocols

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

Principles behind data link layer services:

Principles behind data link layer services:

ECE 4450:427/527 - Computer Networks Spring 2017

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Chapter 6 The Data Link layer

CS 3640: Introduction to Networks and Their Applications

Computer and Network Security

Lecture 9: Bridging. CSE 123: Computer Networks Alex C. Snoeren

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

CSC 8560 Computer Networks: Link Layer

CSCI Computer Networks Spring 2017

Summary of MAC protocols

CSCI Computer Networks Fall 2016

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

Transcription:

CSCD 330 Network Programming Spring 2018 Lecture 17 Link Layer Hardware and Protocols Who is this? Reading: Chapter 5 in text Some slides provided courtesy of J.F Kurose and K.W. Ross, All Rights Reserved, copyright 2016 1

Robert (Bob) Metcalf Inventor of Ethernet Bob Metcalfe Helped build early Internet while still an undergraduate Invented Ethernet while at Xerox Palo Alto Research Center Founded 3Com Corp. Served as publisher at IDG's Infoworld Publishing Co. Wrote three books Since January 2001 has been a venture capitalist with Polaris Ventures Nice article on him if you want to read it http://electronicdesign.com/articles/index.cfm?ad=1&articleid=2855 2

Introduction to Link Layer So far, Application Layer - applications interface to people Messages get delivered Transport Layer application to application Segments get delivered Network Layer destination to destination Datagrams get delivered Link Layer node to node delivery Frames are delivered 3

Link Layer Overview Main question at this layer How do I deliver packets or frames between two nodes in the network? Historical reasons look at other link layer schemes But, Ethernet is currently dominant wired technology 802.11 Wireless another protocol Actually a variation of Ethernet Covered in a different chapter, in a different course and at a future time in a galaxy far away... 4

Link Layer 5.1 5.1a 5.2 5.3 5.4 5.5 Introduction and Services NIC Cards Error detection and correction Multiple access protocols Link-layer Addressing Ethernet 5

Link Layer - Introduction Link Layer Terms Both Hosts and Routers Called nodes Communication channels connect adjacent nodes along communication path, links Wired links Wireless links Layer-2 packet is a Frame encapsulates datagram Data-link layer responsible for transferring a frame from one node to adjacent node over a link 6

Link Layer Services The services offered by Link Layer are... Framing Link Access Reliable Delivery Flow Control Error Detection and Correction Half duplex and full duplex 7

Link Layer Services Framing Encapsulate datagram into frame, add header, trailer MAC (Media Access Control) addresses used in frame headers to identify source, destination Example MAC address: 00:13:02:BA:43:56 Reliable Delivery Between Adjacent Nodes Wireless links: higher error rates, Does more for reliability than wired Does compute errors Wired relies on upper layers to handle it Channel Access Share channel if shared medium Point to point if not shared 8

Reliable Delivery Question on Reliability So, why would you need both link-level and transport layer reliability? Because dealing with reliability at two levels! Transport layer reliability For end-to-end delivery between two processes Link layer reliability For delivery between two nodes connected by a single link 9

Link Layer Services Continued 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 10

Link Layer Implementation Where is the link layer implemented? Hardware or software? Separate card or on chip? Mostly Implemented Hardware Network Interface Card (NIC) 11

Link Layer Implementation Alternative to actual NIC card... Built in to the motherboard

Link Layer Implemented In each host Link layer implemented in Network adaptor Network Interface Card (NIC) Ethernet card, PCMCI card, 802.11 card Implements link and physical layers Attaches to host s system buses Combination of hardware, software, firmware host schematic application transport network link cpu memory host bus (e.g., PCI) controller link physical physical transmission network adapter card 13

Network Interface Cards (NIC) Basics A Network Interface Card (NIC) Establishes link between computer and network, and manages link A NIC performs two crucial tasks: 1. Establishes and manages computer s network connection 2. Encodes and translates digital data into signals for outgoing messages, and Translates signals into digital computer data for incoming messages DataLink Layer 14

Parallel vs. Serial Transmission NICs also manage transformation of network data s form Computer bus has series of parallel data lines (Parallel transmission) Signals traversing network media consist of a linear sequence of bits of data (serial transmission) NIC takes outgoing transmission in parallel form and recasts them into their serial equivalents For incoming messages, process reverses Converting between serial and parallel transmission, NIC has memory, to hold data temporarily DataLink Layer 15

Parallel vs. Serial Transmission Bus width Bus width - number of parallel lines in a computer bus Industry Standard Architecture (ISA) bus 16-bit Now obsolete!!! Peripheral Component Interconnect (PCI) bus 32-bit, 64-bit, of course faster DataLink Layer 16

Network Interface Card Heart of card is a special purpose processor chip Does framing, link access, flow control and error detection Encryption too, for wireless Examples Intel 8254x controller implements Ethernet, Atheros AR5006 controller handles 802.11 protocol Trend... Integrate adapters into motherboard, not separate cards anymore Particularly true for laptops and phones devices 17

Link Layer 5.1 Introduction and services 5.2 Error detection and correction 5.3Multiple access protocols 5.4 Link-layer Addressing 5.5 Ethernet 18

Error Detection and Correction Causes of Transmission Errors Signal noise, attenuation or distortion Both on wired and wireless mediums See next slide...

Definitions What is Signal Attenuation? Loss of signal strength measured in decibels (db) dec i bel - Defined a unit used to express differences in power, in acoustics or electronics: equal to ten times the common logarithm of the ratio of two signals. Occurs for several reasons Range - both wireless and wired transmissions gradually dissipate in strength over longer distance Interference - on wireless networks, radio interference or physical obstructions like walls dampen communication signals Wire size - on wired networks, thinner wires suffer from higher (more) attenuation than thicker wires

Errors at Link Layer Two Ideas for Errors at Link Layer Error detection Parity checks, cyclic redundancy codes, checksum Error correction Send redundant information with frame When receiving frame incorrectly, receiver makes educated guess about the original frame Often done for missing frames in real-time applications

Error Detection Error Detection Lets Receiver Determine whether received message has been corrupted Checksum simplest method Checksum, function of message, gets appended to message Receiver uses same function to calculate checksum of received message and compare it with appended checksum

Example of Checksum 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 Only done on IP packet header Receiver: Compute checksum of received segment Check if computed checksum equals checksum field value: NO - error detected YES - no error detected DataLink Layer 23

Error Detection Parity Checking Even Parity If you get odd number of bits including parity bit > A bit changed in transmission Single parity bit is an error detecting code, Not an error correcting code No way to determine which bit is corrupted Two-dimensional parity checks parity of both column and row, pinpoints error and allows for correction 24

Parity Checking Simplest Technique Two Dimensional Bit Parity Single Bit Parity Detect and correct single bit errors Detect single bit errors 1 9 1 s Add a 1 Simple detection For Even Parity Number of 1 s in data + parity bit must be an Even number Can locate and correct errors 25

Parity Checking Comment Is a limit to parity schemes A parity bit only guaranteed to detect an odd number of bit errors One, three, five, and so forth If even number of bits (two, four, six and so on) are flipped, the parity bit appears to be correct, even though the data is corrupt This is for even parity Odd parity will have the reverse problem 26

Checksumming Cyclic Redundancy Check (CRC) Want algorithm detects some number of changed bits Ideally... implemented in hardware CRC Scheme CRC algorithms treat message as an enormous binary number, Divide it by another fixed binary number, Make remainder from this division the checksum Widely used in practice (Ethernet, 802.11 WiFi, ATM) It has better powers of detection than bit parity or checksums uses entire number, handle more bit errors nice example below http://www.repairfaq.org/filipg/link/f_crc_v3.html 27

Link Layer 5.1 Introduction and services 5.2 Error detection and correction 5.3 Multiple access protocols 5.4 Link-layer Addressing 5.5 Ethernet 28

Access Links and Protocols Two types of links 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 802.11 wireless LAN Satellite shared wire (e.g., shared RF cabled non-switch Ethernet)(e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical) 29

Communication Between Nodes Point to Point Links These are dedicated channels between a node and switch or modem No need to share the link Broadcast Links Multiple sending and receiving nodes all connected to single broadcast channel Central problem at link layer How to share the link between nodes Must coordinate access between competing nodes Known as Multiple Access Problem

Multiple Access Problem Question is How do you fairly share the medium at the Link level? Everyone is connected to same network All want to send their data all the time. How do we fairly share the medium?

Multiple Access Protocols Idea is... can send and receive in both directions single shared broadcast channel Two or more simultaneous transmissions by nodes means interference Collision if node receives two or more signals at the same time gibberish, must retransmit, BAD! Multiple Access Protocol Distributed algorithm, 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 32

Examine Following Strategies Look at each of the strategies and see how close each meets the IDEAL Multiple Access Channel properties...

Multiple Access Protocols: A Taxonomy Three broad classes 1. Channel Partitioning Divide channel into smaller pieces Time slots, frequency, code division Allocate piece to node for exclusive use 2. Random Access Channel not divided, allow collisions Recover from collisions 3. Taking turns Nodes take turns, but nodes with more to send can take longer turns 34

Channel Partitioning

Channel Partitioning Protocols: TDMA TDMA: Time Division Multiple Access Access to channel in "rounds" Each station gets fixed length slot Length = packet transit time, in each round Whats the problem? Unused slots wasted Example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle 6-slot frame 1 3 4 1 3 4 36

TDMA: Time Division Multiple Access Analogy Take turns talking Fix each person a time slot All get a turn even when they have nothing to say Our class 5 slot limit Eric Talks Kevin Silent Ian Talks Lana Silent Mark Talks Wasted two slots where others could have had useful things to say 37

Channel Partitioning Protocols: FDMA FDMA: frequency division multiple access FDM cable frequency bands Channel spectrum divided into frequency bands Each station assigned fixed frequency band Whats the problem? Some frequency bands are idle, you are limited to your band Example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle time 38

Random Access 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 Medium Access Control protocol specifies Key Problems How to detect collisions How to recover from collisions Examples Slotted ALOHA, ALOHA CSMA, CSMA/CD, CSMA/CA 40

Aloha Protocol Simple protocol developed by Norman Abramson and colleagues at University of Hawaii, in 1968 Used low-cost amateur radio-like systems to create a computer network linking distributed campuses of the University Protocol allows every system to send a frame if its ready to send Based on a shared medium network This was basis for Ethernet!!!!

Slotted ALOHA Assumptions All frames same size Time divided into equal size slots Time to transmit 1 frame Nodes transmit only at slot beginning Nodes are now synchronized If 2 or more nodes transmit in slot, all nodes detect collision 42

Slotted ALOHA 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 Probability is key and is between 0 and 1

Slotted ALOHA Probability is key Probability p means each node independently tosses a coin, heads or tails P says how likely it is node gets a head Node transmits under this event (1-p) is the probability of getting tail on a coin Means node skips a slot and tosses again in next slot 44

Slotted Aloha C collision E empty S - Success

Slotted ALOHA Pros Single active node can continuously transmit at full rate of channel Highly decentralized: Slots in nodes need to be in sync Simple C collision E empty S - Success Takes 9 slots Cons Collisions, wasting slots Idle slots Nodes may be able to detect collision in less than time to transmit packet Clock synchronization 46

Slotted Aloha efficiency Whats the Efficiency of Aloha? Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send) 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 Prob that any node has a success = Np(1-p)N-1 Max efficiency: find p* that maximizes, successful nodes Np(1-p)N-1 For many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives: Max efficiency = 1/e =.37 At best: channel used for useful transmissions 37% of time!! 47

Slotted ALOHA Throughput versus offered traffic for ALOHA systems.

CSMA (Carrier Sense Multiple Access) Max throughput achievable by slotted ALOHA is 0.368. CSMA improved throughput compared to Aloha protocols. Big Improvement... Listen before you speak! Listens to the channel before transmitting a packet (avoid avoidable collisions) 49

Assumptions with CSMA Networks 1. Constant length packets 2. No errors, except those caused by collisions 3. Each host can sense the transmissions of all other hosts 4. The propagation delay is small compared to the transmission time 50

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! 51

CSMA collisions spatial layout of nodes Collisions can still occur: propagation delay means two nodes may not hear each other s transmission B sends at t0 D sends at t1 Collision: entire packet transmission time wasted 52

CSMA/CD (Collision Detection) CSMA/CD: Carrier sensing as in CSMA Collisions detected within short time Colliding transmissions aborted, reduces channel wasting time Collision Detection Easy in wired LANs Measure signal strengths, compare transmitted and received signals Difficult in wireless LANs: Received signal has problems with signal strength due to attenuation and interference 53

CSMA/CD Collision Detection 54

CSMA/CD Sense the channel If idle, transmit immediately If busy, wait until the channel becomes idle Collision detection Abort a transmission immediately if a collision is detected Try again later after waiting a random amount of time Will revisit this later when we describe Ethernet... 55

Taking Turns 56

Taking Turns MAC protocols Polling: Master node invites slave nodes to transmit in turn Typically used with dumb slave devices Bluetooth uses polling Concerns: Polling overhead Latency Single point of failure (master) data poll master data slaves 57

Token Passing Protocols Token Ring protocol was developed by IBM mid1980s Access involves token-passing Token Ring, computers are connected so that signal travels around the network from one computer to another in a logical ring A single electronic token moves around ring from one computer to the next If computer does not have information to transmit, it simply passes the token on to the next workstation If computer wishes to transmit and receives an empty token, it attaches data to the token

Token Passing Protocols Token Ring protocol requires a star-wired ring using twisted pair or fiber optic cable It operates, transmission speeds of 4 Mbps or 16 Mbps Due to the increasing popularity of Ethernet, Use of Token Ring decreased dramatically http://en.wikipedia.org/wiki/ibm_token_ring

Taking Turns MAC protocols Token passing: Control token passed from one node to next sequentially. Token message Concerns: Token overhead Latency Single point of failure (token) T (nothing to send) T data 60

Summary of Protocols 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 61

End 62