CSCI-1680 Link Layer Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.

Slides:



Advertisements
Similar presentations
COS 461 Fall 1997 Data Link Layer u Today: LANs other than Ethernet –token rings –switched networks –cellular technology u remaining issues –error detection.
Advertisements

CSCI-1680 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
CPS-365 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Theophilus Benson.
EE 4272Spring, 2003 Chapter 7 Data Link Control Objectives: Effective & reliable data communication between two directly connected transmitting-receiving.
Chapter 2: Direct Link Networks (continued) Slide Set 5.
The ALOHA Protocol “Free for all”: whenever station has a frame to send, it does so. –Station listens for maximum RTT for an ACK. –If no ACK after a specified.
CSCI-1680 Link Layer Wrap-Up Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
CSCI-1680 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Spring 2002CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
1 Shared Access Networks Outline Bus (Ethernet) Token ring (FDDI) Wireless (802.11)
EE 122: Error detection and reliable transmission Ion Stoica September 16, 2002.
1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
1 K. Salah Module 4.0: Data Link Layer The Logical Link Control (LLC) sublayer –Framing –Flow Control –Error Control The Media Access Control (MAC) sublayer.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Spring 2002CS 4611 Shared Access Networks Outline Bus (Ethernet) Token ring (FDDI) Wireless (802.11)
Spring 2004 EE4272 Direct Link Networks (I) Hardware Building Blocks (nodes & links) 5 Issues before Exchanging Packets  Encoding  Framing  Error Detection.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Spring 2003CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
CS352- Link Layer Dept. of Computer Science Rutgers University.
Networking. Protocol Stack Generally speaking, sending an message is equivalent to copying a file from sender to receiver.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Cs/ee 143 Communication Networks Chapter 3 Ethernet Text: Walrand & Parakh, 2010 Steven Low CMS, EE, Caltech.
Data Link Layer IS250 Spring 2010
Lecture 8: Ethernet and Token Ring Networks. Ethernet Carrier Sense, Multiple Access and Collision Detect (CSMA/CD) LAN Ethernet Standard-DEC, Intel,
18-Aug-154/598N: Computer Networks Overview Direct link networks –Error detection - Section 2.4 –Reliable transmission - Section 2.5.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 17.
Ethernet. Ethernet Goals Simplicity Low Cost Compatibility Address flexibility Fairness –All nodes have equal access to the network High speed Stability.
NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are here.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 16.
CPS 365 Theophilus Benson. Today’s Lecture Recap last class Error detection code – Parity – Check-Sum – Error-Correcting-Codes Error correcting code –
14-Oct-15Computer Networks1 Reliable Transmission.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15.
Data Link Layer Moving Frames. Link Layer Protocols: ethernet, wireless, Token Ring and PPP Has node-to-node job of moving network layer.
Link Layer Dr. Mozafar Bag-Mohammadi Ilam University.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 12: Reliability Slides used with permissions.
Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.
CSCI-1680 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, Rodrigo Fonseca John Jannotti.
Review. Layers Physical layer – sending bits from one place to another, ensuring an okay BER Data link layer – encapsulate information bits into frames,
Transport Layer: Sliding Window Reliability
EE 122: Lecture 6 Ion Stoica September 13, 2001 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose)
1 Ethernet History –developed by Xerox PARC in mid-1970s –roots in Aloha packet-radio network –standardized by Xerox, DEC, and Intel in 1978 –similar to.
1 Multiple Access: Ethernet Section Point-to-Point vs. Broadcast Media Point-to-point –PPP for dial-up access –Point-to-point link between Ethernet.
Transmission Errors Error Detection and Correction.
1 Direct Link Networks: Reliable Transmission Sections 2.5.
CSE331: Introduction to Networks and Security Lecture 4 Fall 2002.
CSCI-1680 Link Layer Wrap-Up Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Computer Networking Lecture 16 – Reliable Transport.
1 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
UNIT 3 MULTIPLE ACCESS Adapted from lecture slides by Behrouz A. Forouzan © The McGraw-Hill Companies, Inc. All rights reserved.
CS 457 – Lecture 3 Link Layer Protocols Fall 2011.
CS380 Int. to Comp. Networks Data Link Networks - Part II1 Reliable Transmission How to fix corrupted frames. –Error correcting codes too expensive –Should.
Multiple Access Methods
Reliable Transmission
Advanced Computer Networks
Getting Connected (Chapter 2 Part 3)
Chap. 4 Data link layer 2.
Data Link Layer What does it do?
CS 457 – Lecture 6 Ethernet Spring 2012.
Multiple Access Methods
CSCI-1680 Link Layer Reliability
Getting Connected (Chapter 2 Part 3)
Reliable transmission
Point-to-Point Links Outline Encoding Framing Error Detection
Lecture 5- Data Link Layer
CSCI-1680 Link Layer I Rodrigo Fonseca
Multiple Access Methods
LAN Addresses and ARP IP address: drives the packet to destination network LAN (or MAC or Physical) address: drives the packet to the destination node’s.
Error detection: Outline
Presentation transcript:

CSCI-1680 Link Layer Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca

Administrivia Where are the policy forms? Snowcast due on Friday Homework I out on Thursday GitHub –brown-csci1680 organization –Private repositories for each group

Today Previously… –Physical Layer Encoding Modulation –Link Layer Framing Link Layer –Error Detection –Reliability –Media Access –Ethernet –Token Ring

Error Detection Idea: add redundant information to catch errors in packet Used in multiple layers Three examples: –Parity –Internet Checksum –CRC

Simplest Schemes Repeat frame –High overhead –Can’t correct error Parity –Can detect odd number of bit errors –No correction

2-D Parity Add 1 parity bit for each 7 bits Add 1 parity bit for each bit position across the frame) –Can correct single-bit errors –Can detect 2- and 3-bit errors, most 4-bit errors

IP Checksum Fixed-length code –n-bit code should capture all but 2 -n fraction of errors –But want to make sure that includes all common errors Example: IP Checksum

How good is it? 16 bits not very long: misses 1/64K errors Checksum does catch any 1-bit error But not any 2-bit error –E.g., increment word ending in 0, decrement one ending in 1 Checksum also optional in UDP –All 0s means no checksums calculated –If checksum word gets wiped to 0 as part of error, bad news

CRC – Error Detection with Polynomials Consider message to be a polynomial in Z 2 [x] –Each bit is one coefficient –E.g., message > m(x) = x 7 + x 5 + x Can reduce one polynomial modulo another –Let n(x) = m(x)x 3. Let C(x) = x 3 + x –Find q(x) and r(x) s.t. n(x) = q(x)C(x) + r(x) and degree of r(x) < degree of C(x) –Analogous to taking 11 mod 5 = 1

Polynomial Division Example Just long division, but addition/subtraction is XOR

CRC Select a divisor polynomial C(x), degree k –C(x) should be irreducible – not expressible as a product of two lower-degree polynomials in Z 2 [x] Add k bits to message –Let n(x) = m(x)x k (add k 0’s to m) –Compute r(x) = n(x) mod C(x) –Compute n(x) = n(x) – r(x) (will be divisible by C(x)) (subtraction is XOR, just set k lowest bits to r(x)!) Checking CRC is easy –Reduce message by C(x), make sure remainder is 0

Why is this good? Suppose you send m(x), recipient gets m’(x) –E(x) = m’(x) – m(x) (all the incorrect bits) –If CRC passes, C(x) divides m’(x) –Therefore, C(x) must divide E(x) Choose C(x) that doesn’t divide any common errors! –All single-bit errors caught if x k, x 0 coefficients in C(x) are 1 –All 2-bit errors caught if at least 3 terms in C(x) –Any odd number of errors if last two terms (x + 1) –Any error burst less than length k caught

Common CRC Polynomials CRC-8: x 8 + x 2 + x CRC-16: x 16 + x 15 + x 2 + x 1 CRC-32: x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x CRC easily computable in hardware

Reliable Delivery Error detection can discard bad packets Problem: if bad packets are lost, how can we ensure reliable delivery? –Exactly-once semantics = at least once + at most once

At Least Once Semantics How can the sender know packet arrived at least once? –Acknowledgments + Timeout Stop and Wait Protocol –S: Send packet, wait –R: Receive packet, send ACK –S: Receive ACK, send next packet –S: No ACK, timeout and retransmit

Stop and Wait Problems Duplicate data Duplicate acks Can’t fill pipe (remember bandwitdh- delay product) Difficult to set the timeout value

At Most Once Semantics How to avoid duplicates? –Uniquely identify each packet –Have receiver and sender remember Stop and Wait: add 1 bit to the header –Why is it enough?

Sliding Window Protocol Still have the problem of keeping pipe full –Generalize approach with > 1-bit counter –Allow multiple outstanding (unACKed) frames –Upper bound on unACKed frames, called window

Sliding Window Sender Assign sequence number (SeqNum) to each frame Maintain three state variables –send window size (SWS) –last acknowledgment received (LAR) –last frame send (LFS) Maintain invariant: LFS – LAR ≤ SWS Advance LAR when ACK arrives Buffer up to SWS frames

Sliding Window Receiver Maintain three state variables: –receive window size (RWS) –largest acceptable frame (LAF) –last frame received (LFR) Maintain invariant: LAF – LFR ≤ RWS Frame SeqNum arrives: –if LFR < SeqNum ≤ LAF, accept –if SeqNum ≤ LFR or SeqNum > LAF, discard Send cumulative ACKs

Tuning SW How big should SWS be? –“Fill the pipe” How big should RWS be? –1 ≤ RWS ≤ SWS How many distinct sequence numbers needed? –If RWS = 1, need at least SWS+1 –If RWS = SWS, SWS < (#seqs + 1)/2

Case Study: Ethernet (802.3) Dominant wired LAN technology –10BASE2, 10BASE5 (Vampire Taps) –10BASET, 100BASE-TX, 1000BASE-T, 10GBASE-T,… Both Physical and Link Layer specification CSMA/CD –Carrier Sense / Multiple Access / Collision Detection Frame Format (Manchester Encoding):

Ethernet Addressing Globally unique, 48-bit unicast address per adapter –Example: 00:1c:43:00:3d:09 (Samsung adapter) –24 msb: organization – txthttp://standards.ieee.org/develop/regauth/oui/oui. txt Broadcast address: all 1s Multicast address: first bit 1 Adapter can work in promiscuous mode

Media Access Control Control access to shared physical medium –E.g., who can talk when? –If everyone talks at once, no one hears anything –Job of the Link Layer Two conflicting goals –Maximize utilization when one node sending –Approach 1/N allocation when N nodes sending

Different Approaches Partitioned Access –Time Division Multiple Access (TDMA) –Frequency Division Multiple Access (FDMA) –Code Division Multiple Access (CDMA) Random Access –ALOHA/ Slotted ALOHA –Carrier Sense Multiple Access / Collision Detection (CSMA/CD) –Carrier Sense Multiple Access / Collision Avoidance (CSMA/CA) –RTS/CTS (Request to Send/Clear to Send) –Token-based

Ethernet MAC Problem: shared medium –10Mbps: 2500m, with 4 repeaters at 500m Transmit algorithm –If line is idle, transmit immediately –Upper bound message size of 1500 bytes –Must wait 9.6μs between back to back frames –If line is busy: wait until idle and transmit immediately

Handling Collisions Collision detection (10Base2 Ethernet) –Uses Manchester encoding –Constant average voltage unless multiple transmitters If collision –Jam for 32 bits, then stop transmitting frame Collision detection constrains protocol –Imposes min. packet size (64 bytes or 512 bits) –Imposes maximum network diameter (2500m) –Ensure transmission time ≥ 2x propagation delay (why?)

Collision Detection Without minimum frame length, might not detect collision

When to transmit again? Delay and try again: exponential backoff nth time: k × 51.2μs, for k = U{0..2 min(n,10) - 1} –1 st time: 0 or 51.2μs –2 nd time: 0, 51.2, 102.4, or 153.6μs Give up after several times (usually 16)

Capture Effect Exponential backoff leads to self- adaptive use of channel A and B are trying to transmit, and collide Both will back off either 0 or 51.2μs Say A wins. Next time, collide again. –A will wait between 0 or 1 slots –B will wait between 0, 1, 2, or 3 slots …

Token Ring Idea: frames flow around ring Capture special “token” bit pattern to transmit Variation used today in Metropolitan Area Networks, with fiber

Interface Cards Problem: if host dies, can break the network Hardware typically has relays

Token Ring Frames Frame format (Differential Manchester) Sender grabs token, sends message(s) Recipient checks address Sender removes frame from ring after lap Maximum holding time: avoid capture Monitor node reestablishes lost token

Coming Up Link Layer Switching