Data Link Layer. Chapter 4. INTRODUCTION . Introduction . A data link protocol provides three functions: Controls when computers transmit ( media access control ). Detects and corrects transmission errors ( error control ). Identifies the start and end of a message ( message delineation ).
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Data Link Layer Chapter 4
Introduction A data link protocol provides three functions: • Controls when computers transmit (media access control). • Detects and corrects transmission errors (error control). • Identifies the start and end of a message (message delineation).
Media Access Control Media access control (MAC) refers to the need to control when devices transmit. MAC becomes important when several computers share the same communications circuit to ensure no two devices attempt to transmit data at the same time.
Controlled Access Most computer networks managed by a host mainframe computer use controlled access. • X-ON/X-OFF is one of the oldest MAC protocols dating back to the days of the teletype. • The X-ON signal indicates a system ready to receive messages, the X-OFF signal indicates a system too busy to receive.
X-ON and X-OFF Data 0: Are you ready? Computer B Computer A X-ON: Yes Data 1 Data 2 Data 3 X-OFF: Hold on X-ON: Resume Data 4
Controlling Access Polling is the process of sending a signal to a client that gives it permission to transmit or to ask it to receive. There are several types of polling. • Roll call polling, the FEP works consecutively through a list of clients, first 1, then 2 etc. until all are polled. • Hub go-ahead polling (a.k.a. token passing) One computer starts the poll and passes it to the next system on the multipoint circuit, which sends its message or passes it to the next system, and so on.
Roll Call Polling A B FEP Mainframe C Roll call polling involves some waiting. A timer “times out” a terminal after waiting certain period.
Roll Call Polling A B C Polling is analogous to a classroom situation
Hub Polling - Token Ring D A C B
Hub Polling - Token Ring D Hub A C B
Contention Contention is the opposite of controlled access. Computers wait until the circuit is free and then transmit whenever they have data to send. Requires a technique to handle situations when two devices try to transmit at the same time (Collision)
Error Control in Networks There are two types of errors associated with networks. • Human errors, controlled by applicationprograms • Network errors, controlled by the network There are two categories of network errors. • Corrupted data (that have been changed) • Lost data
What are Network Errors? Network errors are a fact of life in data communications networks. Normally errors occur in bursts. • In a burst error, more than one data bit is changed by the error-causing condition. • Errors are not uniformly distributed, regardless of error rate statistics. Dial-up lines are more prone to errors because they have less stable parameters.
Network Error • One bit error in 1000 bits results in an error rate of 0.001. However, it also means that one character made up of 8-bit is not correct. The character error rate becomes 1/125. It is 8 times of the bit error rate.
Network Error The fact that errors tend to be clustered in bursts rather than evenly dispersed is both good and bad: • Good: long period error-free transmission • Bad: it is more difficult to recover the data from the errors. • I h*ve a p*ncil in my p*cket • I have a *e**il in my pocket • Give me your *oney, or I’ll ki** you.
What Causes Errors? Line noise and Distortion cause errors. Source of Error What Causes It How to Prevent It. Line Outages White Noise Impulse Noise Cross-Talk Echo Attenuation Intermodulation Noise Jitter Harmonic Distortion Storms, Accidents Movement of electrons Sudden increases in electricity (e.g. lightening) Multiplexer guardbands too small, or wires too close together Poor connections Graduate decrease in signal over distance Signals from several circuits combine Analog signals change phase Amplifier changes phase Increase signal strength Shield or move the wires Increase the guardbands, or move or shield the wires Fix the connections, or tune equipment Use repeaters or amps Move or shield the wires Tune equipment Tune equipment
Impulse Noise • The primary source of errors caused by voltage changes in adjacent lines, lightning flashes, poor connections, etc. • Lasts as long as 1/100 second and sounds like a click • At 300bps 3 bits would be affected • At 33,600 bps, 336 bits (42 characters) would be changed
Error Prevention There are many ways to prevent errors: • Shielding (adding insulation) • Moving cables away from noise sources • Changing multiplexing type (FDMTDM) • Tuning transmission equipment and improving connection quality • Using amplifiers and repeaters • Leasing conditioned circuits
Error Detection It is possible to develop data transmission methodologies that give very high error detection and correction performance. The only way to do error detection and correction is to send extra data with each message. In general, the larger the amount of error detection data sent, the greater the ability to detect an error.
Error Detection There are three common error detection methods. • Parity Checking • Longitudinal redundancy checking • Polynomial checking • Checksum • Cyclic Redundancy
Parity Checking One of the oldest and simplest method, parity checking adds 1 additional bit to each byte in the message. The value of this parity bit is dependent on the number of 1’s in each byte transmitted. Even parity causes the sum of all bits (including the parity bit) to be even. Odd parity causes the sum to be odd. Unfortunately if two bits are erroneous, the parity checking will fail. Parity checking results in about a 50% reliability rate.
Parity Checking Assume we are using even parity with 7-bit ASCII. The letter V in 7-bit ASCII is encoded as 0110101. Because there are four 1s (an even number), parity is set to zero. This would be transmitted as: 01101010. Assume we are using odd parity with 7-bit ASCII. The letter W in 7-bit ASCII is encoded as 0001101. Because there are three 1s (an odd number), parity is set to zero. This would be transmitted as: 00011010.
Longitudinal Redundancy Checking (LRC) LRC was developed to overcome the problem with parity’s low probability of detection. LRC adds one additional character, called the block check character (BCC) to the end of the entire message or packet of data. The value of the BCC is calculated much like the Parity bit, but for the entire message. Results in a 98% reliability rate.
Longitudinal Redundancy Checking For example, suppose we were to send the message “DATA” using odd parity and LRC with 7-bit ASCII: Letter D A T A BCC ASCII 1000100 1000001 1010100 1000001 1101111 Parity bit 1 1 0 1 1 (Note that the parity bit in the BCC is determined by parity, not LRC.)
Polynomial Checking Like LRC, polynomial checking adds 1 or more characters to the end of the message based on a mathematical algorithm. With checksum, 1 byte is added to the end of the message. It is obtained by summing the message values,and dividing by 255. The remainder is the checksum. (95% effective) With Cyclical Redundancy Check (CRC), 8, 16, 24 or 32 bits are added, computed by calculating a remainder to a division problem.
CRC Performance • CRC is able to detect 100% the errors of the same length as the CRC or less. • When the burst error is longer than the CRC, CRC-16 detects 99.998% of them and CRC-32 detects 99.99999998% of them.
Error Correction via Retransmission The simplest, most effective, least expensive, and most commonly used method for error correction is retransmission. A receiver that detects an error simply asks the sender to retransmit the message until it is received without error. (called Automatic Repeat reQuest (ARQ)). • Stop-and-wait ARQ vs. Continuous ARQ
Error Correction via Retransmission • With Stop and Wait ARQ the sender stops and waits for a response from the receiver after each message or data package. • Responses are: • Acknowledgement (ACK) • Negative acknowledgement (NAK)
Continuous ARQ With Continuous ARQ the sender does not wait for acknowledgement before sending next message. If it receives an NAK, it retransmits the needed messages. The packets that are retransmitted may be only those containing an error (called Link Access Protocol for Modems (LAP-M)), or may be the first packet with an error and all those that followed it (call Go-Back-N ARQ) Continuous ARQ is a full-duplex transmission technique. It is sometimes called sliding window.
Packet Loss • How it could be? Two possibilities: • The receiver did not receive the packet • The sender did not receive the ACK message • What can we do with packet loss? • Use “Time-out” to detect packet loss • Re-send the packet if there is a “time-out”
*Forward Error Correction Forward error correction uses codes containing sufficient redundancy to prevent errors by detecting and correcting them at the receiving end without retransmission of the original message. • Hamming code is capable of correcting 1 bit error. • More sophisticated techniques, such as Reed-Solomon, are commonly used.
*Hamming Code The number of parity or error check bits required is given by the Hamming rule, and is a function of the number of bits of information transmitted. The Hamming rule is expressed by the following inequality: d + p + 1 < = 2P Where d is the number of data bits and p is the number of parity bits. The result of appending the computed parity bits to the data bits is called the Hamming code word. The size of the code word c is obviously d+p, and a Hamming code word is described by the ordered set (c,d).
*Forward Error Correction • FEC is commonly used in satellite transmission. A round trip from the Earth station to the satellite and back includes a significant delay. Error rates can fluctuate, depending on the condition of equipment, sun spots, or the weather. Compared to satellite equipment costs, the additional cost of FEC is insignificant. • Chip implementations of FEC has been used in modems, e.g. V.34.
Network Error Control (Review) • Preventing • Detecting • Parity checking, 50% reliability rate • Longitudinal Redundancy Checking, 98% reliability rate • Polynomial Redundancy Checking • Checksum, 95% effective • Cyclical redundancy Checking (CRC) (99.998%-100% effective) • Correcting • Retransmission: Stop and wait ARQ, Continuous ARQ • Forward Error Correction: Hamming or Reed-Solomon code
Data Link Protocols Protocol Size Error Detection Retransmission Media Access Asynchronous Transmission 1 Parity Continuous ARQ Full Duplex File Transfer Protocols XMODEM 132 8-bit Checksum Stop-and-wait ARQ Controlled Access XMODEM-CRC 132 8-bit CRC Stop-and-wait ARQ Controlled Access X-MODEM-1K 1028 8-bit CRC Stop-and-wait ARQ Controlled Access YMODEM 1029 16-bit CRC Stop-and-wait ARQ Controlled Access ZMODEM * 32-bit CRC Continuous ARQ Controlled Access KERMIT * 24-bit CRC Continuous ARQ Controlled Access Synchronous Protocols SDLC * 16-bit CRC Continuous ARQ Controlled Access HDLC * 16-bit CRC Continuous ARQ Controlled Access Token Ring * 32-bit CRC Stop-and-wait ARQ Controlled Access Ethernet * 32-bit CRC Stop-and-wait ARQ Contention SLIP * None None Full Duplex PPP * 16-bit CRC Continuous ARQ Full Duplex
Asynchronous Transmission Asynchronous Transmission is often referred to as start-stop transmission because the transmitting device can transmit a character whenever it is convenient, and the receiving device will accept that character. Each character is transmitted independently of all other characters. To accomplish this a start bit (0), and a stop bit (1) are added to each character. The recognition of the start and stop of each message is called synchronization.
Asynchronous In computer programming, asynchronous (from Greek meaning "not at the same time" and pronounced "ay-SIN-kro-nus") pertains to processes that proceed independently of each other until one process needs to “interrupt” the other process with a request. In data communication, asynchronous transmission means the transmitted data blocks or characters are independent of each other.
Synchronous Synchronous data communication requires that each end of an exchange of communication respond in turn without initiating a new communication. A typical activity that might use a synchronous protocol would be a transmission of files from one point to another. As each transmission is received, a response is returned indicating success or the need to resend. Each successive transmission of data requires a response to the previous transmission.
Asynchronous Transmission Start-stop transmission is a least efficient technology. We need to bundle bytes to reach high efficiency transmissions.
Six Issues in Packet Design • Error correction • Addressing • Delineation (packet format) • The transparency problem • Transmission efficiency (packet size vs. bandwidth utilization ratio) • Media access control
Asynchronous File Transfer Protocols In general, microcomputer file transfer protocols are used on asynchronous point-to-point circuits, typically across telephone lines via a modem. • XMODEM (132 bytes) • XMODEM-CRC (CRC-8) • XMODEM-1K (CRC+1K blocks) • YMODEM(CRC-16) • ZMODEM (CRC-32) • KERMIT (CRC-24)
Asynchronous FTP XMODEM FORMAT STX Packet# Checksum 1 byte compliment 1 byte 1 byte Message 128 bytes Packet # 1 byte