Links Reading: Chapter 2

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

Links. CS125 - mylinks 1 1/22/14

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

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

Goals of Today s Lecture. Adaptors Communicating

Chapter 5 Link Layer and LANs

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

CSC 4900 Computer Networks: The Link Layer

Chapter 5: Link layer

Data Link Layer: Multi Access Protocols

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

Data Link Layer. Our goals: understand principles behind data link layer services: instantiation and implementation of various link layer technologies

Chapter 5 Link Layer and LANs

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

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

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

ECE 4450:427/527 - Computer Networks Spring 2017

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

Chapter 5 Link Layer and LANs

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

Data Link Layer: Overview, operations

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

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 V: Link Layer

Your Future?! Links and LANs! Regrading of Homework! Other Announcements! Goals of Todayʼs Lecture! Link-Layer Services!

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

Link Layer and Ethernet

Link Layer and Ethernet

Link Layer and LANs. Our Goals. Link Layer

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

CSC 401 Data and Computer Communications Networks

Master Course Computer Networks IN2097

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

Master Course Computer Networks IN2097

Module 10 Data Link Layer CS655! 10-1!

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

Medium Access Protocols

Principles behind data link layer services

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

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

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

Summary of MAC protocols

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

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

EE 122: Ethernet and

CMPE 150: Introduction to Computer Networks

Module 4 Data Link Layer CS655! 4-1!

Ethernet. EE 122: Intro to Communication Networks. Fall 2007 (WF 4-5:30 in Cory 277) Vern Paxson TAs: Lisa Fowler, Daniel Killebrew & Jorge Ortiz

CS 43: Computer Networks Switches and LANs. Kevin Webb Swarthmore College December 5, 2017

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

Principles behind data link layer services:

Principles behind data link layer services:

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

Chapter V: Link Layer

Chapter 6 The Link Layer and LANs

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

Chapter 5: DataLink Layer

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

CC451 Computer Networks

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

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

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Principles behind data link layer services:

Medium Access Control

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

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

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

MULTIPLE ACCESS PROTOCOLS 2. 1

The Link Layer II: Ethernet

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

CSCD 330 Network Programming

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

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

CSC 8560 Computer Networks: Link Layer

CSC 4900 Computer Networks: Link Layer (2)

Chapter 4 Network Layer

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

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

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

CS 3640: Introduction to Networks and Their Applications

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

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

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

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

CSMA/CD (Collision Detection)

Chapter 5: The Data Link Layer. Chapter 5 Link Layer and LANs. Ethernet. Link Layer. Star topology. Ethernet Frame Structure.

The Link Layer and LANs: Ethernet and Swiches

Chapter 5: The Data Link Layer

Chapter 5 Link Layer and LANs

Multiple Access Links and Protocols

Computer and Network Security

ECE 158A: Lecture 13. Fall 2015

CSCI Computer Networks Fall 2016

CSCD 330 Network Programming Fall 2012

Chapter 5 Link Layer. Link Layer 5-1

COMP211 Chapter 6/7 Link Layer

CSCI Computer Networks Spring 2017

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 7

Transcription:

Links Reading: Chapter 2 COS 461: Computer Networks Spring 2009 (MW 1:30 2:50 in COS 105) Mike Freedman hgp://www.cs.princeton.edu/courses/archive/spring09/cos461/ 1

Goals of Today s Lecture Link layer services Encoding, framing, and error detecton Error correcton and flow control Sharing a shared media Channel parttoning Taking turns Random access Ethernet protocol Carrier sense, collision detecton, and random access Frame structure Hubs and switches 2

Message, Segment, Packet, and Frame host HTTP HTTP message host HTTP TCP TCP segment TCP router router IP IP packet IP IP packet IP IP packet IP Ethernet interface Ethernet interface SONET interface SONET interface Ethernet interface Ethernet interface Ethernet frame SONET frame Ethernet frame 3

Link Layer Protocol for Each Hop IP packet transferred over multple hops Each hop has a link layer protocol May be different on different hops Analogy: trip from Princeton to Lausanne Limo: Princeton to JFK Plane: JFK to Geneva Train: Geneva to Lausanne Refining the analogy Tourist == packet Transport segment == communicaton link TransportaTon mode == link layer protocol Travel agent == routng algorithm 4

Adaptors CommunicaTng datagram link layer protocol frame frame sending node adapter adapter receiving node Link layer implemented in adaptor (network interface card) Ethernet card, PCMCIA card, 802.11 card Sending side: Encapsulates datagram in a frame Adds error checking bits, flow control, etc. Receiving side Looks for errors, flow control, etc. Extracts datagram and passes to receiving node 5

Link Layer Services Encoding RepresenTng the 0s and 1s Framing EncapsulaTng packet into frame, adding header, trailer Using MAC addresses, rather than IP addresses Error detecton Errors caused by signal agenuaton, noise. Receiver detectng presence of errors Error correcton Receiver correctng errors without retransmission Flow control Pacing between adjacent sending and receiving nodes 6

Encoding Signals propagate over physical links Source node encodes the bits into a signal Receiving node decodes the signal back into bits Simplify some electrical engineering details Assume two discrete signals, high and low E.g., could correspond to two different voltages Simple approach High for a 1, low for a 0 0 0 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 07

Problem With Simple Approach Long strings of 0s or 1s introduce problems No transitons from low to high, or high to low Receiver keeps average of signal it has received Uses the average to distnguish between high and low Long flat strings make receiver sensitve to small change TransiTons also necessary for clock recovery Receiver uses transitons to derive its own clock Long flat strings do not produce any transitons Can lead to clock drid at the receiver AlternaTves (see SecTon 2.2) Non return to zero inverted: TransiTon for 1, None for 0 Manchester encoding: clock XOR NRZ: L H (0), H L (1) 8

Framing Break sequence of bits into a frame Typically implemented by the network adaptor SenTnel based Delineate frame with special pagern (e.g., 01111110) 01111110 Frame contents 01111110 Problem: what if special pagerns occurs within frame? SoluTon: escaping the special characters E.g., sender always inserts a 0 ader five 1s and receiver always removes a 0 appearing ader five 1s Similar to escaping special characters in C programs 9

Framing (ConTnued) Counter based Include the payload length in the header instead of pumng a sentnel at the end Problem: what if the count field gets corrupted? Causes receiver to think the frame ends at a different place SoluTon: catch later when doing error detecton And wait for the next sentnel for the start of a new frame Clock based Make each frame a fixed size No ambiguity about start and end of frame But, may be wasteful 10

Error DetecTon Errors are unavoidable Electrical interference, thermal noise, etc. Error detecton Transmit extra (redundant) informaton Use redundant informaton to detect errors Extreme case: send two copies of the data Trade off: accuracy vs. overhead Techniques for detectng errors Parity checking Checksum Cyclic Redundancy Check (CRC) 11

Error DetecTon Techniques Parity check Add an extra bit to a 7 bit code Odd parity: ensure an odd number of 1s E.g., 0101011 becomes 01010111 Even parity: ensure an even number of 1s E.g., 0101011 becomes 01010110 Checksum Treat data as a sequence of 16 bit words Compute a sum of all 16 bit words, with no carries Transmit the sum along with the packet Cyclic Redundancy Check (CRC) See SecTon 2.4.3 12

Point to Point vs. Broadcast Media Point to point PPP for dial up access Point to point link between Ethernet switch and host Broadcast (shared wire or medium) TradiTonal Ethernet 802.11 wireless LAN 13

MulTple Access Protocol Single shared broadcast channel Avoid having multple nodes speaking at once Otherwise, collisions lead to garbled data MulTple access protocol Distributed algorithm for sharing the channel Algorithm determines which node can transmit Classes of techniques Channel parttoning: divide channel into pieces Taking turns: passing a token for the right to transmit Random access: allow collisions, and then recover 14

Channel ParTToning: TDMA TDMA: Tme division multple access Access to channel in "rounds" Each staton gets fixed length slot in each round Time slot length is packet transmission Tme Unused slots go idle Example: 6 staton LAN with slots 1, 3, and 4 15

Channel ParTToning: FDMA FDMA: frequency division multple access Channel spectrum divided into frequency bands Each staton assigned fixed frequency band Unused transmission Tme in bands go idle Example: 6 staton LAN with bands 1, 3, and 4 frequency bands time 16

Taking Turns MAC protocols Polling Master node invites slave nodes to transmit in turn Concerns: Polling overhead Latency Single point of failure (master) Token passing Control token passed from one node to next sequentally Token message Concerns: Token overhead Latency Single point of failure (token) 17

Random Access Protocols When node has packet to send Transmit at full channel data rate R. No a priori coordinaton among nodes Two or more transmimng nodes collision Random access MAC protocol specifies: How to detect collisions How to recover from collisions Examples ALOHA and SloGed ALOHA CSMA, CSMA/CD, CSMA/CA 18

Key Ideas of Random Access Carrier Sense (CS) Listen before speaking, and don t interrupt Checking if someone else is already sending data and waitng Tll the other node is done Collision DetecTon (CD) If someone else starts talking at the same 8me, stop Realizing when two nodes are transmimng at once by detectng that the data on the wire is garbled Randomness Don t start talking again right away WaiTng for a random Tme before trying again 19

SloGed ALOHA AssumpTons All frames same size Time divided into equal slots (Tme to transmit a frame) Nodes start to transmit frames only at start of slots Nodes are synchronized If two or more nodes transmit, all nodes detect collision OperaTon When node obtains fresh frame, transmits in next slot No collision: node can send new frame in next slot Collision: node retransmits frame in each subsequent slot with probability p untl success 20

SloGed ALOHA Pros Single actve node can contnuously transmit at full rate of channel Highly decentralized: only slots in nodes need to be in sync Simple Cons Collisions, wastng slots Idle slots Nodes may be able to detect collision in less than Tme to transmit packet Clock synchronizaton 21

CSMA (Carrier Sense MulTple Access) Collisions hurt the efficiency of ALOHA protocol At best, channel is useful 37% of the Tme CSMA: listen before transmit If channel sensed idle: transmit entre frame If channel sensed busy, defer transmission Human analogy: don t interrupt others! 22

CSMA Collisions Collisions can still occur: propagation delay means two nodes may not hear each other s transmission Collision: entire packet transmission time wasted 23

CSMA/CD (Collision DetecTon) CSMA/CD: carrier sensing, deferral as in CSMA Collisions detected within short Tme Colliding transmissions aborted, reducing wastage Collision detecton Easy in wired LANs: measure signal strengths, compare transmiged, received signals Difficult in wireless LANs: receiver shut off while transmimng Human analogy: the polite conversatonalist 24

CSMA/CD Collision DetecTon 25

Three Ways to Share the Media Channel parttoning 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 actve node! Taking turns protocols Eliminates empty slots without causing collisions Vulnerable to failures (e.g., failed node or lost token) Random access MAC protocols Efficient at low load: single node can fully utlize channel High load: collision overhead 26

Ethernet Dominant wired LAN technology First widely used LAN technology Simpler, cheaper than token LANs and ATM Kept up with speed race: 10 Mbps 10 Gbps Metcalfe s Ethernet sketch 27

Ethernet Uses CSMA/CD Carrier Sense: wait for link to be idle Channel idle: start transmimng Channel busy: wait untl idle Collision DetecTon: listen while transmimng No collision: transmission is complete Collision: abort transmission, and send jam signal Random access: exponental back off Ader collision, wait a random Tme before trying again Ader m th collision, choose K randomly from {0,, 2 m 1} and wait for K*512 bit Tmes before trying again 28

LimitaTons on Ethernet Length A latency d B Latency depends on physical length of link Time to propagate a packet from one end to the other Suppose A sends a packet at Tme t And B sees an idle line at a Tme just before t+d so B happily starts transmimng a packet B detects a collision, and sends jamming signal But A doesn t see collision Tll t+2d 29

LimitaTons on Ethernet Length A latency d B A needs to wait for Tme 2d to detect collision So, A should keep transmimng during this period and keep an eye out for a possible collision Imposes restrictons on Ethernet Maximum length of the wire: 2500 meters Minimum length of the packet: 512 bits (64 bytes) 30

Ethernet Frame Structure Sending adapter encapsulates packet in frame Preamble: synchronizaton Seven bytes with pagern 10101010, followed by one byte with pagern 10101011 Used to synchronize receiver, sender clock rates 31

Ethernet Frame Structure (ConTnued) Addresses: source and destnaton MAC addresses Adaptor passes frame to network level protocol If destnaton address matches the adaptor Or the destnaton address is the broadcast address Otherwise, adapter discards frame Type: indicates the higher layer protocol Usually IP, but also Novell IPX, AppleTalk, CRC: cyclic redundancy check Checked at receiver If error is detected, the frame is simply dropped 32

Unreliable, ConnecTonless Service ConnecTonless No handshaking b/w sending and receiving adapter Unreliable Receiving adapter doesn t send ACKs or NACKs Packets passed to network layer can have gaps Gaps will be filled if applicaton is using TCP Otherwise, the applicaton will see the gaps 33

Hubs: Physical Layer Repeaters Hubs are physical layer repeaters Bits coming from one link go out all other links At the same rate, with no frame buffering No CSMA/CD at hub: adapters detect collisions twisted pair hub 34

InterconnecTng with Hubs Backbone hub interconnects LAN segments All packets seen everywhere, forming one large collision domain Can t interconnect Ethernets of different speeds hub hub hub hub 35

Link layer device Switch Stores and forwards Ethernet frames Examines frame header and selectvely forwards frame based on MAC dest address When frame is to be forwarded on segment, uses CSMA/CD to access segment Transparent Hosts are unaware of presence of switches Plug and play, self learning Switches do not need to be configured 36

Switch: Traffic IsolaTon Switch breaks subnet into LAN segments Switch filters packets Same LAN segment frames not usually forwarded onto other LAN segments Segments become separate collision domains switch hub hub hub collision domain collision domain collision domain 37

Benefits of Ethernet Easy to administer and maintain Inexpensive Increasingly higher speed Moved from shared media to switches Change everything except the frame format A good general lesson for evolving the Internet 38

Conclusions IP runs on a variety of link layer technologies Point to point links vs. shared media Wide varietes within each class Link layer performs key services Encoding, framing, and error detecton OpTonally error correcton and flow control Shared media introduce interestng challenges Decentralized control over resource sharing ParTToned channel, taking turns, and random access Ethernet as a wildly popular example 39