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.

Slides:



Advertisements
Similar presentations
Chapter 3 The Data Link Layer.
Advertisements

The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
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.
The Data Link Layer Chapter 3.
CIS 725 Data Link Layer. Physical Layer Figure 3-1 B. Forouzan, TCP/IP Protocol Suite.
Dr. Shahriar Bijani Shahed University March 2014
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 10 Introduction to Computer Networks.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao Cleveland State University
CSC 3352 Computer Communications Chapter 3&41 The Link Layer Has 2 main Components The Data Link Layer Medium Access Control (MAC) Examples:SLIP, PPP,
The Data Link Layer Chapter 3. Position of the data-link layer.
The OSI Reference Model
Circuit Switching (a) Circuit switching. (b) Packet switching.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Gursharan Singh Tatla Transport Layer 16-May
CS 640: Introduction to Computer Networks Aditya Akella Lecture 5 - Encoding and Data Link Basics.
Data and Computer Communications. The Data Link Layer.
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.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
Chapter 3 THE DATA LINK LAYER
جلسه هشتم شبکه های کامپیوتری به نــــــــــــام خدا.
Chapt 3 Data Link Layer1 Data Link Layer Functions –Provides services to network layer Well-defined interface –Framing –Flow control – between adjacent.
Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be.
THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2.
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.
The data link layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Error detection.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Frame delineation Dealing with transmission errors.
Chapter 3 The Data Link Layer (60 % practical part)
The Data Link Layer Chapter 3 10/28/2015www.noteshit.com1.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 13.
Wireless and Mobile Networks (ELEC6219) Session 3: Theories of Data Communications. Data Link Layer. Adriana Wilde and Jeff Reeve 22 January 2015.
The Data Link Layer Chapter 3 1/21/2016www.ishuchita.com1.
COMPUTER NETWORKS. Unit -2 Continue... Physical Layer Connection –Oriented Networks : X.25 Relay Frames Types of cables Co-axial Fiber optics Twisted.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Data Link Layer Chapter 3.
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.
NET 221D : COMPUTER NETWORKS FUNDAMENTALS LECTURE 4: DATA LINK LAYER Behrouz A. Forouzan” Data communications and Networking 1.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Data Link Layer Chapter 3.
1 The Data Link Layer A. S. Tanenbaum Computer Networks W. Stallings Data and Computer Communications Chapter 3.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Net 221D:Computer Networks Fundamentals
Network Models. 2.1 what is the Protocol? A protocol defines the rules that both the sender and receiver and all intermediate devices need to follow,
Data Link Control. The two main functions of the data link layer are data link control and media access control. The first, data link control, deals with.
The Data Link Layer RIS 251 Dr. ir. S.S. Msanjila.
Net 221D : Computer Networks Fundamentals
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 link layer (LLC).
Chapter 3 The Data Link Layer
Data Link Layer What does it do?
Chapter 3 – Part 1 The Data Link Layer.
Overview Jaringan Komputer (2)
Net 221D : Computer Networks Fundamentals
Chapter 3 The Data Link Layer.
CS412 Introduction to Computer Networking & Telecommunication
The Data Link Layer Chapter
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.
EEC-484/584 Computer Networks
UNIT-II The Data Link Layer.
Data Link Layer. Position of the data-link layer.
Presentation transcript:

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

Main Reference: Computer Networks A. S. Tanenbaum and D. J. Wetherall, Computer Networks (5th Edition), Pearson Education, the book slides,

D ATA L INK L AYER D ESIGN I SSUES Network layer services Framing Error control Flow control 3

D ATA L INK L AYER Algorithms for achieving: Reliable, Efficient, communication of frames (as opposed to bits – Physical Layer) between two machines. Essential property of a channel that makes it “wire-like” connection: the bits are delivered in exactly the same order in which they are sent. 4

D ATA L INK L AYER 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. 5

D ATA L INK L AYER D ESIGN I SSUES 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 flooded by fast senders. Data Link layer Takes the packets from Physical layer, and Encapsulates them into frames 6

D ATA L INK L AYER D ESIGN I SSUES Each frame has: A frame header A field for holding the packet A frame trailer. Data Link Layer does the frame Management. 7

P ACKETS AND F RAMES Relationship between packets and frames. 8

S ERVICES P ROVIDED TO THE N ETWORK L AYER 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. Job of data link layer: To transmit the bits to the destination machine so they can be handed over to the network layer there (next slide). 9

N ETWORK L AYER S ERVICES (a) Virtual communication. (b) Actual communication. 10

P OSSIBLE S ERVICES O FFERED 1. Unacknowledged connectionless service. 2. Acknowledged connectionless service. 3. Acknowledged connection-oriented service. 11

U NACKNOWLEDGED C ONNECTIONLESS S ERVICE The source machine sends 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 than quality of transmission. 12

A CKNOWLEDGED C ONNECTIONLESS S ERVICE Each frame sent 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 the 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. 13

A CKNOWLEDGED C ONNECTION O RIENTED S ERVICE 1. Establishment: First, the source and destination establish a connection. 2. Transmission: Each frame sent is numbered Data link layer guarantees that - each frame sent is indeed received. - each frame is received only once. - all frames are received in the correct order. 3. Release: Finally, the connection is released freeing up the variables, buffers, and other resources used to maintain the connection. Examples: Satellite channel communication, Long-distance telephone communication, etc. 14

F RAMING To provide service to the network layer, the data link layer must use the service provided to it by physical layer. Stream of data bits provided to data link layer is not guaranteed to be without errors. Errors could be: Number of received bits does not match number of transmitted bits (deletion or insertion) Bit Value It is up to data link layer to correct the errors if necessary. 15

F RAMING Transmission of the data link layer: Breaking up the bit stream into discrete frames Computation of a checksum for each frame Include the checksum into the frame before it is transmitted. Receiver computes its checksum error for a receiving frame. If it is different from the checksum that is being transmitted will have to deal with the error. Framing is more difficult than one could think! 16

F RAMING M ETHODS 1. Byte count. 2. Flag bytes with byte stuffing. 3. Flag bits with bit stuffing. 4. Physical layer coding violations. 17

1. B YTE C OUNT F RAMING It uses a field in the header to specify the number of bytes in the frame. Once the header information is being received, it will be used to determine end of the frame. Trouble with this algorithm is that when the count is incorrectly received the destination will get out of synch with transmission. Destination may detect the error in the frame, but (in this algorithm) can not correct it. 18 Data 132

1. B YTE C OUNT F RAMING ( CONT.) A byte stream. (a) Without errors. (b) With one error. 19

2. F LAG B YTES WITH B YTE S TAFFING Boundary detection of the frame by appending the frame start and frame end special bytes (FLAG byte). If the actual data contains a byte that is identical to the FLAG byte (e.g., picture, data stream, etc.): an escape character just before the “FLAG” character. Similar to escape sequences in C++ cout >> “You must \”escape\” quotes in strings”; Used by Point-to-Point protocols, e.g. modem, DSL, cellular 20

2. F LAG B YTES WITH B YTE S TAFFING ( CONT.) A frame delimited by flag bytes. 4 examples of byte sequences before and after byte stuffing. Data STAR T FLAG END FLAG ENDESC 21 Problem: Too tied to the 8-bit per character format... UNICODE uses 16-bits/char

3. F LAG B ITS WITH B IT S TUFFING Similar to the Byte Stuffing method, but using Bits (1) instead of Bytes (8 Bits). It was developed for High-level Data Link Control (HDLC) protocol. Each frames begins and ends with a special bit pattern: Flag Byte = or 0x7E Whenever the sender’s data link layer encounters five consecutive 1s in the data it automatically stuffs a 0 bit into the outgoing bit stream. USB uses bit stuffing. 22

3. F LAG B ITS WITH B IT S TUFFING ( CONT.) (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in the receiver’s memory after de-stuffing. 23

F RAMING Many data link protocols use a combination of presented methods for safety. E.g.: Ethernet and Each frame begin with a well-defined pattern called a preamble. Preamble is typically 72 bits long. It is then followed by a length field. 24

E RROR C ONTROL After framing, the data link layer has to handle eventual errors in transmission or detection. Ensuring that all frames are delivered to the network layer at the destination and in proper order. Unacknowledged connectionless service: it is OK for the sender to output frames regardless of its reception. Reliable connection-oriented service: it is NOT OK. 25

E RROR C ONTROL Reliable connection-oriented service usually will provide a sender with some feedback about what is happening at the other end of the line. Receiver Sends Back Special Control Frames. If the Sender Receives positive Acknowledgment it will know that the frame has arrived safely. Timer and Frame Sequence Number for the Sender is Necessary to handle the case when there is no response (positive or negative) from the Receiver. 26

F LOW C ONTROL Important Design issue for the cases when the sender is faster than the receiver. Two approaches: 1. Feedback-based flow control Receiver sends back information to the sender giving it permission to send more data, or Telling sender how receiver is doing. 2. Rate-based flow control Built in mechanism that limits the rate at which sender may transmit data, without the need for feedback from the receiver. 27

E RROR D ETECTION AND C ORRECTION Two basic strategies to deal with errors: 1. Include enough redundant information to enable the receiver to deduce what the transmitted data must have been: Error correcting codes. 2. Include only enough redundancy to allow the receiver to deduce that an error has occurred (but not which error): Error detecting codes. 28

E RROR D ETECTION & C ORRECTION C ODE 1. Hamming codes. 2. Binary convolutional codes. 3. Reed-Solomon codes. 4. Low-Density Parity Check codes. 29

All the codes presented in previous slide add redundancy to the sent information. A frame consists of m data bits (message) and r redundant bits (check). Block code - the r check bits are computed solely as function of the m data bits with which they are associated. the m bits were looked up in a large table to find their corresponding r check bits. Systemic code – the m data bits are send directly along with the check bits (rather than being encoded). Linear code – the r check bits are computed as a linear function of the m data bits. XOR or modulo 2 addition is a popular choice. 30 E RROR D ETECTION & C ORRECTION C ODE

n – total length of a block (i.e., n = m + r ) ( n, m ) code n –bit codeword containing n bits. m/n – code rate (range ½ for noisy channel and close to 1 for high-quality channel). 31

E RROR D ETECTION & C ORRECTION C ODE Example Transmitted: Received: XOR operation gives number of bits that are different. XOR: Hamming Distance: number of bit positions in which two codewords differ. It shows that two codes are d distance apart = d errors to convert one into the other. 32

E RROR D ETECTION & C ORRECTION C ODE All 2 m possible data messages are legal, but due to the way the check bits are computers not all 2 n possible code words are used. Only small fraction of 2 m / 2 n =1/2 r are possible will be legal codewords. The error-detecting and error-correcting codes of the block code depend on this Hamming distance. To reliably detect d error, one would need a distance d+1 code. To correct d error, one would need a distance 2d+1 code. 33

E RROR D ETECTION & C ORRECTION C ODE Example: 4 valid codes: Minimal Distance of this code is 5 => can correct and double errors and it detect quadruple errors => single or double – bit error. Hence the receiving end must assume the original transmission was => had triple error that was received as it would be detected in error. 34

E RROR D ETECTION & C ORRECTION C ODE One cannot perform double errors and at the same time detect quadruple errors. Error correction requires evaluation of each candidate codeword which may be time consuming search. Through design this search time can be minimized. In theory if n = m + r, this requirement becomes: (m + r + 1) ≤ 2 r 35