Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th Edition Copyright © 2002 John Wiley & Sons, Inc.

Similar presentations


Presentation on theme: "1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th Edition Copyright © 2002 John Wiley & Sons, Inc."— Presentation transcript:

1 1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th Edition Copyright © 2002 John Wiley & Sons, Inc.

2 2 Copyright  John Wiley & Sons, Inc. All rights reserved. Reproduction or translation of this work beyond that named in Section 117 of the United States Copyright Act without the express written consent of the copyright owner is unlawful. Requests for further information should be addressed to the Permissions Department, John Wiley & Sons, Inc. Adopters of the textbook are granted permission to make back-up copies for their own use only, to make copies for distribution to students of the course the textbook is used in, and to modify this material to best suit their instructional needs. Under no circumstances can copies be made for resale. The Publisher assumes no responsibility for errors, omissions, or damages, caused by the use of these programs or from the use of the information contained herein.

3 3 Chapter 4. Learning Objectives Understand the role of data link layer Become familiar with two basic approaches to controlling access to the media Become familiar with common sources of error and their prevention Understand three common error detection and correction methods Become familiar several commonly used data link protocols

4 4 Chapter 4. Outline Introduction Media Access Control –Controlled Access, Contention, Relative Performance Error Control –Sources of Errors, Error Prevention, Error Detection, Error Correction via Retransmission, Forward Error Correction Data Link Protocols –Asynchronous Transmission, Asynchronous File Transfer Protocols, Synchronous Transmission Transmission Efficiency Summary

5 5 Introduction

6 6 The data link layer sits between the physical and network layers, organizing physical layer bit streams into coherent messages that are passed up to the network layer. Data link protocols have three functions: –Media Access Control: Controlling when computers transmit. –Error Control: Detecting and correcting transmission errors. –Message Delineation: Identifying the beginning and end of a message.

7 7 Media Access Control

8 8 Media Access Control means controlling when computers transmit. It is important in situations where more than one computer wants to send data at the same time over the same circuit, such as: –Point-to-point half duplex links requiring computers to take turns –Multipoint configurations in which several computers share the same circuit The two main MAC approaches are: controlled access and contention.

9 9 Controlled Access Controlled access works like a stop light, controlling access to the shared resource of the network circuit. It is commonly used with access to mainframes, whereby the mainframe or its front end processor determine which circuits have access to it at a given moment. It is also used by some local area network protocols (token ring, FDDI).

10 10 X-ON/X-OFF X-ON/X-OFF is an older controlled access protocol first developed for teletype but still used on some half duplex circuits or between a computer and a printer. Computer A begins by sending an initial message requesting to transmit data. If Computer B is not busy, it responds with an X-ON signal. Then Computer A starts transmitting. A periodically pauses to let B send a message. If B is busy it sends an X-OFF message. A waits until B sends an X-ON message again, signaling A that it can begin sending again.

11 11 Polling With polling, the server periodically contacts each client to see if it wants to transmit. Clients transmit only after being asked by the server if they want to send something. In roll call polling, each client is checked in order to see if it wants to transmit. Clients can also be prioritized so that they are polled more frequently. In hub polling (also called token passing) one computer starts the poll, sending message (if it has one) and then passes the token on to the next computer. This continues in sequence until the token reaches the first computer, which starts the polling cycle all over again.

12 12 Contention Contention approaches, such as Ethernet, allow computers to transmit whenever the circuit is free. This means collisions can occur (more than one computer transmitting at the same time). Like two people in a group speaking at the same time, their messages collide and have to be resent. Contention approaches to media access control need to have a way to sort out which computer is allowed to transmit first after a collision occurs.

13 13 Relative Performance (Figure 4-1) The performance of controlled access versus contention approaches depends on network conditions. Contention approaches tend to work better for smaller networks with relatively low usage. Since usage is low, the probability of collisions is also low, but when volume is high their performance deteriorates. Controlled access tends to work better for networks with high traffic volumes where the probability of collisions is high and controlling access means the network will be more efficiently used.

14 14 Figure 4-1 Relative Performance of Controlled vs. Contention based MAC protocols

15 15 Error Control

16 16 Error Control Error control is handling network errors caused by problems in transmission, not human errors. Error types include corrupted data and lost data. Error control is concerned with: 1) preventing, 2) detecting and 3) correcting errors. While errors can occur in a single bit, they can also be longer. An important error type is a burst error in which many bits are corrupted at the same time.

17 17 Sources of Errors (Figure 4-2) Sources of errors include: –Line outages in which a circuit fails –White noise caused by thermal energy (hiss) –Impulse noise (spikes) are an important source of burst errors and can be caused by lightning, power surges, and poor connections –Cross-talk occurs when one circuit picks up signals from another –Echoes are caused by poor connections causing the signal to be reflected back to the transmitting source –Attenuation is the weakening of a signal over a distance –Jitter occurs due to small variations in the amplitude, frequency, and phase of a signal –Harmonic distortion occurs when an amplifier does not correctly amplify its input signal

18 18 Source of Error What causes itHow to prevent it Line Outages Storms, accidents White NoiseMovement of electronsIncrease signal strength Impulse NoiseSudden increases in electricity (e.g., lightning) Shield or move the wires Cross-talkMultiplexer guard bands are too small or wires too close together Increase the guard bands, or move or shield the wires Echo Poor connectionsFix the connections, or tune equipment Attenuation Gradual decrease in signal over distance Use repeaters or amplifiers Intermodulation Noise Signals from several circuits combine Move or shield the wires Jitter Analog signals change phaseTune equipment Harmonic Distortion Amplifier changes phaseTune equipment Figure 4-2 Sources of errors and ways to prevent or minimize them

19 19 Error Detection Most error detection techniques work in the same way: –An error detection value is first calculated by the sender and transmitted along with the data. –At the receiving end, the error detection value is recalculated and checked against the received value. –If the two values are the same, the data has been received correctly –If they differ, however, an error has occurred and the data needs to be sent again. Three common forms of error detection techniques are currently in use: parity checks, longitudinal redundancy checking, and polynomial checking.

20 20 Parity Checking (Figure 4-3) Parity checking is one of the oldest and simplest error detection techniques. In parity checking, a single bit is added to each character. For even parity, the sum of the bits (including the parity bit) remains even, for odd parity, the sum remains odd. At the receiving end, the parity bit is recalculated. If one bit has been transmitted in error the received parity bit will differ from the recalculated one. Parity checking is simple, but doesn’t catch all errors. If two (or an even number of) bits have been changed at the same time, the parity check appears to be correct even though an error has occurred.

21 21 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 1’s (an even number), Parity is set to 0, so that the sum of all the bits remains even. This would be transmitted as: 01101010. Assume we are using odd parity with 7-bit ASCII. Again, the letter V in 7-bit ASCII is encoded as 0110101. Because there are four 1’s (an even number), Parity is set to 1, so that the sum of all the bits remains odd. This would be transmitted as: 01101011. Figure 4-3 Using parity for error detection Note: the above slide differs from the text.

22 22 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 1’s (an even number), Parity is set to 0, so that the sum of all the bits remains even. This would be transmitted as: 01101010. Assume we are using even parity with 7-bit ASCII. The letter W in 7-bit ASCII is encoded as 0001101. Because there are three 1’s (an odd number), Parity is set to 1, so that the sum of all the bits remains even. This would be transmitted as: 00011011. Figure 4-3 Using parity for error detection

23 23 Longitudinal Redundancy Checking (LRC) LRC was developed as an improvement over parity checks. LRC adds an additional character of parity checks, called a block control character (BCC) to each block of data. Unlike ordinary parity, the BCC parity calculations are based on the 1 st bit, 2 nd bit, etc. in a block (see Figure 4-4). LRC is a major improvement over parity checking, catching over 98% of all errors, but still misses a significant number of errors.

24 24 For example, suppose we were to send the message “DATA” using odd parity and LRC with 7-bit ASCII: Letter ASCII Parity bit D 1000100 1 A 1000001 1 T 1010100 0 A 1000001 1 BCC 1101111 1 (Note that the BCC’s parity bit is also determined by parity.) Figure 4-4 Using LRC for error detection

25 25 Polynomial Checking Polynomial checking, the most powerful error checking technique currently in widespread use, adds 1 or more characters to the end of the message based on a mathematical algorithm. Checksum is a 1-byte calculation made by adding the byte values of the message, dividing the total by 255 and saving the remainder (95% effective). Cyclic Redundancy Check (CRC) is also computed by calculating the remainder to a division problem. CRC-16 (99.969% effective) and CRC-32 (99.99%) are in common use today.

26 26 Error Correction via Retransmission When an error is detected, it is corrected by retransmission of the data along with its error detection value. The process of requesting that a data transmission be resent is called an Automatic Repeat Request or ARQ. The two main ARQ protocols are: –Stop and Wait ARQ –Continuous ARQ

27 27 Stop-and-Wait ARQ (Figure 4-5) Stop-and-Wait ARQ is a half duplex technique that works just like it sounds. The sender first sends a packet, then waits to hear from the receiver. If the packet has been received without error, an acknowledgement (ACK) is sent back by the receiver and the next packet is sent. If the receiver detects an error in the packet that was just sent, the receiver sends back a negative acknowledgement (NAK) and the sender resends the packet again.

28 28 Figure 4-5. Stop and Wait ARQ

29 29 Continuous ARQ (Figure 4-6) Continuous ARQ is a full duplex technique that allows the sender to continue sending packets without waiting for the receiver to acknowledge that they have been received correctly. Acknowledgements are still sent back by the receiver once they have been processed and include some kind information to identify which packet was acknowledged. If a packet is received in error, the receiver sends back a NAK for a specific packet to be resent.

30 30 Figure 4-6. Continuous ARQ

31 31 Forward Error Correction ARQ techniques are also called backward error correction. The alternative, forward error correction, means the receiving device can correct incoming messages itself instead of having them resent. To do this, extra corrective information needs to be sent along with the data that allows the data to be checked and corrected by the receiver. The amount of extra information needed is usually quite a lot (50-100% of the data). This technique is useful for one way transmissions or when transmission times are very long (as with communications to spacecraft).

32 32 Forward Error Correction (Figure 4-7) One forward error correction technique, called a Hamming Code, work a bit like LRC. Extra parity values are calculated so that each data bit figures into two parity bit calculations. That means that if any one bit, either parity or data, gets changed in transmission, the change in the received data can be detected and corrected (see Figure 4-7). This technique, however, only works for one bit errors.

33 33 Figure 4-7 Forward Error Correction

34 34 Data Link Protocols

35 35 Data Link Protocols (Figure 4-8) Data link protocols differ by message delineation, frame length, and frame field structure. Another fundamental difference is between asynchronous and synchronous transmission data link protocols.

36 36 ProtocolSizeError DetectionRetransmissionMedia Access Asynchronous Transmission 1ParityContinuous ARQFull Duplex File Transfer Protocols XMODEM1328-bit ChecksumStop-and-wait ARQControlled Access XMODEM-CRC1328-bit CRCStop-and-wait ARQControlled Access XMODEM-1K10288-bit CRCStop-and-wait ARQControlled Access ZMODEM*32-bit CRCContinuous ARQControlled Access KERMIT*24-bit CRCContinuous ARQControlled Access Synchronous Protocols SDLC*16-bit CRCContinuous ARQControlled Access HDLC*16-bit CRCContinuous ARQControlled Access Token Ring*32-bit CRCStop-and wait ARQControlled Access Ethernet*32-bit CRCStop-and wait ARQContention SLIP*None Full Duplex PPP*16-bit CRCContinuous ARQFull Duplex * Varies depending on message length. Figure 4-8 Data Link Protocol Summary

37 37 Asynchronous Transmission (Figure 4-9) In asynchronous transmission (sometimes called start-stop transmission), each character is sent independently. The transmission sequence begins with a start bit, next the character is sent, then the parity bit and finally a stop bit are sent. The start bit is usually a 0 and the stop bit a 1. Between transmissions (called “idle time”), a series of stop bits are sent. When a new character is sent, the start bit is used by the receiver for synchronization.

38 38 Figure 4-9 Asynchronous Transmission

39 39 Synchronous Transmission In synchronous transmission, data is sent in a large block called a frame or packet, typically about a thousand characters long. Synchronous transmission is used on both point- to-point and multipoint circuits. In the latter case, addressing information needs to be included in the frame. Synchronous packets sometimes begin and end with a series of synchronization (SYN) characters that are used to help the receiver recognize incoming data. Synchronous transmission protocols can be byte- oriented, bit-oriented, or byte-count protocols.

40 40 Synchronous Data Control Link (SDLC) SDLC is a bit-oriented protocol developed by IBM (Figure 4-11) –SDLC uses a controlled media access protocol. –Frames begin & end with a special 8-bit flag (01111110). –Supervisory frames are used for error and flow control. Each SDLC frame contains the following fields: –Start Flag (8 bits) –Destination Address (8 or 16 bits) –Control: identifies frame type; control or supervisory –Message: variable length, contains data –Frame Check Sequence (CRC-32) –Ending Flag (8 bits)

41 41 Figure 4-11 SDLC Frame Format

42 42 Ethernet (IEEE 802.3) Most widely used LAN protocol. Byte-count with contention based media access control. Developed jointly by Digital, Intel, and Xerox (see Figure 4-12). Each frame contains: –MAC layer destination and source addresses (6 bytes each) –Length (of data) field (2 bytes) –Data or message field of variable length –Frame Check Sequence (CRC-32, 4 bytes long)

43 43 Figure 4-12 Ethernet Frame Format

44 44 Point-to-Point Protocol (PPP) Byte-oriented protocol developed in the early 90s. Commonly used on voice grade dial-up lines between home PCs and ISPs. Each PPP frame contains: –Start Flag (1 byte) –Address and Control fields (1 bytes each) –Protocol field (2 bytes) –Data or message field (variable length, up to 1500B) –Frame Check Sequence (CRC-16, 2 bytes long) –End Flag (1 byte)

45 45 Figure 4-13 PPP packet layout

46 46 Transmission Efficiency

47 47 Optimal Packet Size (Figure 4-14) Throughput is the total number of information bits received per second, after taking into account the overhead bits and the need to retransmit packets containing errors. In designing a protocol, there is a trade-off between large and small packets. Small packets are less efficient, but are less likely to contain errors and less costly in terms of circuit capacity to retransmit if there is an error.

48 48 Figure 4-14 Optimum Packet Size

49 49 End of Chapter 4


Download ppt "1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th Edition Copyright © 2002 John Wiley & Sons, Inc."

Similar presentations


Ads by Google