Data and Computer Communications. The Data Link Layer.

Slides:



Advertisements
Similar presentations
5-1 Data Link Layer l Objective: to achieve reliable and efficient communication between 2 adjacent machines l Data link layer design issues n services.
Advertisements

Data and Computer Communications Digital Data Communications Techniques.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
I N THE N AME OF G OD C OMPUTER N ETWORKS C HAPTER 3: T HE D ATA L INK L AYER Dr. Shahriar Bijani Shahed University March 2014.
Data and Computer Communications
Chapter 6 Errors, Error Detection, and Error Control
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 6 – Digital Data Communications Techniques.
CSCI 4550/8556 Computer Networks Comer, Chapter 7: Packets, Frames, And Error Detection.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
The Data Link Layer Chapter 3. Position of the data-link layer.
The OSI Reference Model
Chapter 6: Errors, Error Detection, and Error Control
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Error Control.
Chapter 6 Errors, Error Detection, and Error Control
William Stallings Data and Computer Communications 7th Edition Chapter 6 Digital Data Communications Techniques.
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Digital Data Communications Techniques Updated: 2/9/2009.
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
1/26 Chapter 6 Digital Data Communication Techniques.
Lecture 10: Error Control Coding I Chapter 8 – Coding and Error Control From: Wireless Communications and Networks by William Stallings, Prentice Hall,
Data Link Layer - 1 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
TOBB ETÜ ELE46/ELE563 Communications Networks Lecture 01 May 6, 2014 Fall 2011 Tuesday 10:30 – 12:20 (310) Thursday 15:30 – 17:20 (372) İsrafil Bahçeci.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
ECS 152A 4. Communications Techniques. Asynchronous and Synchronous Transmission Timing problems require a mechanism to synchronize the transmitter and.
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 6 – Digital Data Communications Techniques.
Data and Computer Communications
جلسه هشتم شبکه های کامپیوتری به نــــــــــــام خدا.
Chapt 3 Data Link Layer1 Data Link Layer Functions –Provides services to network layer Well-defined interface –Framing –Flow control – between adjacent.
Data Link Layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Data Link Layer : Services, Framing, Error Detection and Correction2.
The Data Link Layer Goal –As reliable as possible, efficient communication Point-to-Point –single connection –bits arrive in order sent Not necessarily.
Data and Computer Communications Chapter 6 – Digital Data Communications Techniques.
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1. Error Detection Techniques:
EEC4113 Data Communication & Multimedia System Chapter 5: Error Control by Muhazam Mustapha, October 2011.
CS3505: DATA LINK LAYER. data link layer  phys. layer subject to errors; not reliable; and only moves information as bits, which alone are not meaningful.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
Data Communications & Computer Networks, Second Edition1 Chapter 6 Errors, Error Detection, and Error Control.
Chapter 6: Errors, Error Detection, and Error Control Data Communications and Computer Networks: A Business User’s Approach Third Edition.
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 6 – Digital Data Communications Techniques.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
CSCI 465 D ata Communications and Networks Lecture 9 Martin van Bommel CSCI 465 Data Communications & Networks 1.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
1/30/ :20 PM1 Chapter 6 ─ Digital Data Communication Techniques CSE 3213 Fall 2011.
FIT1005 FIT – Monash University
Data and Computer Communications Eighth & Ninth Edition by William Stallings Chapter 6 – Digital Data Communications Techniques.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Data Link Layer Chapter 3.
Data and Computer Communications Digital Data Communications Techniques + Error Control+ Digital Data Communications Techniques + Error Control+Multiplexing.
The Data Link Layer RIS 251 Dr. ir. S.S. Msanjila.
Coding and Error Control
The Data Link Layer Supplementery Slides
Data and Computer Communications
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer.
Data and Computer Communications
Part III Datalink Layer 10.
Digital data communication (Error control)
William Stallings Data and Computer Communications 7th Edition
EEC4113 Data Communication & Multimedia System Chapter 5: Error Control by Muhazam Mustapha, August 2010.
Data and Computer Communications
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer. Position of the data-link layer.
Presentation transcript:

Data and Computer Communications

The Data Link Layer

Data Link Layer Design Issues Network layer services Network layer services Framing Framing Error control Error control Flow control Flow control

Data Link Layer  Algorithms for achieving: Reliable, + Reliable, + Efficient, communication of a whole units – frames (as opposed to bits – Physical Layer) between two machines. Efficient, communication of a whole units – frames (as opposed to bits – Physical Layer) between two machines.  Two machines are connected by a communication channel that acts conceptually like a wire (e.g., telephone line, coaxial cable, or wireless channel).  Essential property of a channel that makes it “wire-like” connection is that the bits are delivered in exactly the same order in which they are sent.

Data Link Layer  For ideal channel (no distortion, unlimited bandwidth and no delay) the job of data link layer would be trivial.  However, limited bandwidth, distortions and delay makes this job very difficult.

Data Link Layer Design Issues  Physical layer delivers bits of information to and from data link layer. The functions of Data Link Layer are: 1. Providing a well-defined service interface to the network layer. 2. Dealing with transmission errors. 3. Regulating the flow of data so that slow receivers are not swamped by fast senders.  Data Link layer Takes the packets from Physical layer, and Takes the packets from Physical layer, and Encapsulates them into frames Encapsulates them into frames

Data Link Layer Design Issues  Each frame has a frame header – a field for holding the packet, and frame header – a field for holding the packet, and frame trailer. frame trailer.  Frame Management is what Data Link Layer does.  See figure in the next slide:

Packets and Frames Relationship between packets and frames.

Services Provided to the Network Layer  Principal Service Function of the data link layer is to transfer the data from the network layer on the source machine to the network layer on the destination machine. Process in the network layer that hands some bits to the data link layer for transmission. Process in the network layer that hands some bits to the data link layer for transmission. Job of data link layer is to transmit the bits to the destination machine so they can be handed over to the network layer there (see figure in the next slide). Job of data link layer is to transmit the bits to the destination machine so they can be handed over to the network layer there (see figure in the next slide).

Network Layer Services (a) Virtual communication. (b) Actual communication.

Possible Services Offered 1. Unacknowledged connectionless service. 2. Acknowledged connectionless service. 3. Acknowledged connection-oriented service.

Unacknowledged Connectionless Service  It consists of having the source machine send independent frames to the destination machine without having the destination machine acknowledge them.  Example: Ethernet, Voice over IP, etc. in all the communication channel were real time operation is more important that quality of transmission.

Acknowledged Connectionless Service  Each frame send by the Data Link layer is acknowledged and the sender knows if a specific frame has been received or lost.  Typically the protocol uses a specific time period that if has passed without getting acknowledgment it will re-send the frame.  This service is useful for commutation when an unreliable channel is being utilized (e.g., WiFi).  Network layer does not know frame size of the packets and other restriction of the data link layer. Hence it becomes necessary for data link layer to have some mechanism to optimize the transmission.

Acknowledged Connection Oriented Service  Source and Destination establish a connection first.  Each frame sent is numbered Data link layer guarantees that each frame sent is indeed received. Data link layer guarantees that each frame sent is indeed received. It guarantees that each frame is received only once and that all frames are received in the correct order. It guarantees that each frame is received only once and that all frames are received in the correct order.  Examples: Satellite channel communication, Satellite channel communication, Long-distance telephone communication, etc. Long-distance telephone communication, etc.

Acknowledged Connection Oriented Service  Three distinct phases: 1. Connection is established by having both side initialize variables and counters needed to keep track of which frames have been received and which ones have not. 2. One or more frames are transmitted. 3. Finally, the connection is released – freeing up the variables, buffers, and other resources used to maintain the connection.

Services

Asynchronous and Synchronous Transmission  timing problems require a mechanism to synchronize the transmitter and receiver receiver samples stream at bit intervals receiver samples stream at bit intervals if clocks not aligned, drifting will sample at wrong time after sufficient bits are sent if clocks not aligned, drifting will sample at wrong time after sufficient bits are sent  two techniques to synchronize asynchronous transmission asynchronous transmission synchronous transmission synchronous transmission

Asynchronous Transmission

Asynchronous - Behavior  simple  cheap  overhead of 2 or 3 bits per char (~20%)  Stop element 1.5 time unit  good for data with large gaps (keyboard)  6% error.  Framing error – in picture the last (8 th ) bit can be mistaken as a start bit

Synchronous Transmission  block of data transmitted, sent as a frame  clocks must be synchronized can use separate clock line can use separate clock line or embed clock signal in data or embed clock signal in data  need to indicate start and end of block use preamble and post-amble use preamble and post-amble  more efficient (lower overhead) than asynchronous

Types of Error  an error occurs when a bit is altered between transmission and reception  single bit errors only one bit altered only one bit altered caused by white noise caused by white noise  burst errors contiguous sequence of B bits in which first, last and any number of intermediate bits are in error contiguous sequence of B bits in which first, last and any number of intermediate bits are in error caused by impulse noise or by fading in wireless caused by impulse noise or by fading in wireless effect is greater at higher data rates effect is greater at higher data rates

Error Detection  will have errors  detect using error-detecting code  added by transmitter  recalculated and checked by receiver  still chance of undetected error  parity parity bit set so frame has even number of ones (even parity) or odd number of ones (odd parity) parity bit set so frame has even number of ones (even parity) or odd number of ones (odd parity) even number of bit errors goes undetected even number of bit errors goes undetected

Error Detection Process

Error Detection  P b = Probability a bit is received in error, Bit Error Rate (BER)  P 1 = Probability a frame is received with no error  P 2 = Probability a frame is received with undetected error  F = number of bits / frame  Then, P 1 = (1- P b ) F, P 2 = (1- P 1 )

Error Detection # ISDN has 64 Kbps channel, 1 frame with undetected error per day is expected, (1 frame = 1000 bits), Calculate the number of Frames / day and P 2.  If actual P b = 10 -6, can we achieve the above P 2 ?

Cyclic Redundancy Check  one of most common and powerful checks  for block of k bits, transmitter generates an n-k bit frame check sequence (FCS)  Transmits n bits which is exactly divisible by some number  receiver divides frame by that number if no remainder, assume no error if no remainder, assume no error for math, see Stallings chapter 6 for math, see Stallings chapter 6

Cyclic Redundancy Check  Basis: Modulo-2 arithmetic (X-or for + or -)  Message, M =  Pattern, P = (MSB & LSB = ‘1’)  FCS = ? (5 bits) (01110)  Multiply the Message by 2 5, then divide by the Pattern. Remainder is added with the Message and transmitted.  P is one bit longer than FCS.

Cyclic Redundancy Check Selection of polynomial P: - Should not be divisible by X - Should be divisible by X+1 Benefits: - Detects all burst errors that affect odd number of bits - Detects all burst errors of length less than or equal to degree of the polynomial (FCS)

Cyclic Redundancy Check - Detects, with high probability, all burst errors of length greater than the degree of the polynomial

Cyclic Redundancy Check # CRC-12 (X 12 + X 11 +X 3 +X+1) Degree: 12 Detects all burst errors that affects odd number of bits, Detects all burst errors of length less than or equal to 12, Detects (99.97 percent of) all burst errors of length more than or equal to 12.

Error Correction  correction of detected errors usually requires correct data block to be retransmitted  not appropriate for wireless applications bit error rate is high causing lots of retransmissions bit error rate is high causing lots of retransmissions when propagation delay long (satellite) compared with frame transmission time, resulting in retransmission of frame in error plus many subsequent frames when propagation delay long (satellite) compared with frame transmission time, resulting in retransmission of frame in error plus many subsequent frames  instead need to correct errors on basis of bits received  error correction provides this

Error Correction Process

Error Correction  2-dimensional Parity:  “Data is arranged in 2-dimensional array and parity bit is added for each row and column”  P V  “Detects and Corrects all single bit errors”  “Detects all odd number of bit errors and some even P H number of bit errors”

How Error Correction Works  adds redundancy to transmitted message  can deduce original despite some errors  e.g. block error correction code map k bit input onto an n bit codeword map k bit input onto an n bit codeword each distinctly different each distinctly different if get error, assume codeword sent was closest to that received if get error, assume codeword sent was closest to that received  for math, see Stallings chapter 6  Much reduced effective data rate

Block Code Principles  Hamming distance = difference in # of bits,  p = , q = , d (p,q) = ?  Data Code      # Find the distance between all the valid codes (in pairs) on this slide.

Block Code Principles  Received 00100, valid? Can it be corrected?  Find distances and the minimum.  ‘Select the valid code at the minimum distance’  Received 00100, correct word?  More than one minimum distance!!!  (Invalid) => valid and  ‘Equidistance of 2’ => can detect, not correct

Hamming ECC  ‘use of extra parity bits to allow the position identification of a single error’  1. Mark all bit positions that are powers of 2 as parity bits. (positions 1, 2, 4, 8, 16, etc.)  2. All other bit positions are for the data to be encoded. (positions 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, etc.)

Hamming ECC  3. Each parity bit calculates the parity for some of the bits in the code word. The position of the parity bit determines the sequence of bits that it checks.  Position 1: checks bits (1,3,5,7,9,11,...) – Alternate Position 2: checks bits (2,3,6,7,10,11,14,15,...) – Alternate 2-bits  Position 4: checks bits (4,5,6,7,12,13,14,15,20,21,22,23,...) - Alternate 4-bits

Hamming ECC  Position 8: checks bits (8-15,24-31,40- 47,...) – Alternate 8-bits 4. Set the parity bit to create even parity.  A byte of data:  Place the data word, leaving spaces for the parity bits: _ _ 1 _ _ Calculate the parity bits.

Hamming ECC  Position 1 checks bits 1,3,5,7,9,11: ? _ 1 _ _ set position 1 to a 0: 0 _ 1 _ _  Position 2 checks bits 2,3,6,7,10,11: 0 ? 1 _ _ set position 2 to a 1: _ _  Position 4 checks bits 4,5,6,7,12: ? _ set position 4 to a 1: _

Hamming ECC  Position 8 checks bits 8,9,10,11,12: ? set position 8 to a 0:  Final code word:  Finding and fixing a corrupted bit:  Suppose that the word was received as instead.  The method is to verify each check bit.

Hamming ECC  Parity bits 2 and 8 are incorrect. It is = 10, that bit position 10 is the location of the bad bit and needs to be inverted.  # Test if these Hamming-code words are correct. If one is incorrect, indicate the correct code word. Also, indicate what the original data was.   