Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 Data Link Layer 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM.

Similar presentations


Presentation on theme: "Chapter 4 Data Link Layer 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM."— Presentation transcript:

1 Chapter 4 Data Link Layer 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

2 INTRODUCTION 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

3 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). 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

4 MEDIA ACCESS CONTROL 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

5 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

6 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

7 X-ON and X-OFF Computer B Computer A Data 0: Are you ready? X-ON: Yes
X-OFF: Hold on X-ON: Resume Data 4 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

8 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

9 Roll Call Polling A B C Roll call polling involves some waiting.
FEP Mainframe C Roll call polling involves some waiting. A timer “times out” a terminal after waiting certain period. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

10 Roll Call Polling A B C Polling is analogous to a classroom situation
9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

11 Hub Polling - Token Ring
D A C B 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

12 Hub Polling - Token Ring
D Hub A C B 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

13 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) 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

14 Contention 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

15 ERROR CONTROL IN NETWORKS
9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

16 Error Control in Networks
There are two types of errors associated with networks. Human errors, controlled by application programs Network errors, controlled by the network There are two categories of network errors. Corrupted data (that have been changed) Lost data 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

17 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

18 Network Error One bit error in 1000 bits results in an error rate of 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

19 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

20 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 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

21 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 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

22 Error Prevention There are many ways to prevent errors:
Shielding (adding insulation) Moving cables away from noise sources Changing multiplexing type (FDMTDM) Tuning transmission equipment and improving connection quality Using amplifiers and repeaters Leasing conditioned circuits 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

23 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

24 Error Detection There are three common error detection methods.
Parity Checking Longitudinal redundancy checking Polynomial checking Checksum Cyclic Redundancy 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

25 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

26 Parity Checking Assume we are using even parity with 7-bit ASCII.
The letter V in 7-bit ASCII is encoded as Because there are four 1s (an even number), parity is set to zero. This would be transmitted as: Assume we are using odd parity with 7-bit ASCII. The letter W in 7-bit ASCII is encoded as Because there are three 1s (an odd number), parity is set to zero. This would be transmitted as: 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

27 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

28 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 BCC ASCII Parity bit 1 (Note that the parity bit in the BCC is determined by parity, not LRC.) 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

29 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

30 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 % of them and CRC-32 detects % of them. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

31 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 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

32 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) 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

33 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

34 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

35 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

36 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” 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

37 *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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

38 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

39 *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). 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

40 *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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

41 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 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

42 DATA LINK PROTOCOLS 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

43 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 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

44 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

45 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

46 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. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

47 Asynchronous Transmission
Start-stop transmission is a least efficient technology. We need to bundle bytes to reach high efficiency transmissions. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

48 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 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

49 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) 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

50 Asynchronous FTP XMODEM FORMAT STX Packet# Checksum Message
1 byte compliment byte 1 byte Message 128 bytes Packet # 1 byte 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

51 Asynchronous FTP KERMIT developed by Columbia University
support a variety of different packet sizes and error detection methods typically 1000bytes/packet with CRC-24 and adjustable during transmission uses both stop-and-wait ARQ and continuous ARQ 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

52 Synchronous Transmission
With Synchronous Transmission all the letters or data in one group of data is transmitted at one time as a block of data called a frame or packet. The start and end of each packet sometimes is marked by adding synchronization characters (SYN) at the start/end of each packet. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

53 Synchronous Transmission
There are many protocols for synchronous transmission that fall into three broad categories: Byte-oriented Bit-oriented Byte-count 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

54 Synchronous Transmission
Synchronous Data Link Control (SDLC) is a mainframe protocol developed by IBM in It is a bit-oriented protocol, because the data contained in the frame do not have to be in 8-bit bytes. High-level Data Link Control (HDLC) is a formal standard developed by ISO, and is essentially the same as SDLC except that the address and control fields can be longer. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

55 Synchronous Transmission
SDLC format Flag Address Control Message Frame Flag 8 bits variable bits variable check bits sequence 16 or 32 bits 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

56 SDLC’s Transparency Problem
The problem of transparency Because SDLC uses to mark the start and end of a packet, the character “ ” will confuse the receiver. Solution - Bit Stuffing Add a 0 after every five 1s at sender side and delete the 0 at receiver side. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

57 Synchronous Transmission
Token Ring (IEEE 802.5) was developed by IBM in the early 1980s, and later became a formal standard of the IEEE. It uses a controlled access media access protocol. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

58 Synchronous Transmission
Token Ring (IEEE802.5) format Start Frame Destination Source Message End delimiter control address address variable delimiter Access Frame control check sequence 1 byte bytes Ethernet (IEEE802.3) format Destination Source Length Message CRC-32 address address bytes variable bytes 6 bytes bytes 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

59 Token Ring (IEEE 802.5) It is a byte-oriented protocol
Does not suffer the same transparency problems as SDLC Each token ring frame starts and ends with special electrical signal produced in a manner different from any other pattern of bits. The size of the message field is generally limited to 4500 bytes The frame check sequence is 32-bit CRC code. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

60 Ethernet (IEEE 802.3) Ethernet (IEEE 802.3) was conceived by Bob Metcalfe in 1973 and developed jointly by Digital, Intel, and Xerox in the 1970s. It is a byte-count protocol, because instead of using special characters or bit patterns to mark the end of a packet it includes a field that specifies the length of the message portion of the packet. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

61 Ethernet (IEEE 802.3) Ethernet has no transparency problem because it uses number of bytes, no control characters, to delineate the message. It uses contention media access control. The maximum length of the message is 1492 bytes. CRC-32 frame check 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

62 Serial Line Internet Protocol
Serial Line Internet Protocol (SLIP) is a byte-oriented protocol designed to connect two computers using Internet protocols over a point-to-point telephone line. It is developed in 1980s. SLIP suffers the transparency problem because it uses “ ” as END. So, it replaces the character in the message with “ ” (ESC) + “ ”. This trick is also used for ESC character itself, with a ESC + “ ”. Compressed SLIP (CSLIP) uses compression to reduce the amount of data transmitted. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

63 Point-to-Point Protocol
Point-to-Point Protocol (PPP) is a byte-oriented protocol developed in 1990s as a replacement for SLIP. The packet begins and ends with a flag “ ”. Therefore, it suffers the transparency problem. CRC-16 for error control Supports network layer protocols other than just Internet protocol. Message length is up to 1500 bytes. 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

64 Packet Formats of SLIP and PPP
SLIP packet layout End Message End 1 byte variable byte PPP packet layout Flag Address Control Message CRC Flag 1 byte 1 byte byte variable bytes 1 byte 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

65 Effect of Packet Size Standard Commercial’s experiment
The problem: Network performance decreased when upgraded to new server Experiment outcomes: The size of 512 bytes requires 455k bytes transmission The size of 32 kbytes requires only 245 kbytes, more delay due to larger size to be saved. What is the ideal packet size? - Infoworld, January 16, 1995 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM

66 Where We Use These Protocols
SDLC IBM Mainframe IBM Mainframe SLIP PPP S/S XModem YModem ZModem Kermit M Public Telephone Network Remote Access Server M Internet M Ethernet Router PC Mac PC Server 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM


Download ppt "Chapter 4 Data Link Layer 9/18/2018 5:27:13 AM9/18/2018 5:27:13 AM."

Similar presentations


Ads by Google