+ All Categories
Home > Documents > 1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th...

1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th...

Date post: 17-Dec-2015
Category:
Upload: edwin-robinson
View: 231 times
Download: 1 times
Share this document with a friend
Popular Tags:
49
1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th Edition Copyright © 2002 John Wiley & Sons, Inc.
Transcript
Page 1: 1 Chapter 4. Data Link Layer Business Data Communications and Networking Fitzgerald and Dennis, 7th Edition Copyright © 2002 John Wiley & Sons, Inc.

1

Chapter 4. Data Link Layer

Business Data Communications and Networking Fitzgerald and Dennis,

7th EditionCopyright © 2002 John Wiley & Sons, Inc.

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

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.

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

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

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

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

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

5

Introduction

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

6

Introduction• 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.

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

7

Media Access Control

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

8

Media Access Control

• 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.

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

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).

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

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.

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

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.

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

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.

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

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.

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

14

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

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

15

Error Control

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

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.

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

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

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

18

Source of Error 

What causes it How to prevent it

Line Outages 

Storms, accidents  

White Noise Movement of electrons Increase signal strength

Impulse Noise Sudden increases in electricity (e.g., lightning)

Shield or move the wires

Cross-talk Multiplexer guard bands are too small or wires too close together

Increase the guard bands, ormove or shield the wires

Echo 

Poor connections Fix the connections, ortune 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 phase Tune equipment

Harmonic Distortion 

Amplifier changes phase Tune equipment

Figure 4-2 Sources of errors and ways to prevent or minimize them

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

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.

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

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.

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

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 detectionNote: the above slide differs from the text.

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

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

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

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 1st bit, 2nd 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.

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

24

For example, suppose we were to send the message “DATA” using odd parity and LRC with 7-bit ASCII:

Letter ASCII Parity bitD 1000100 1A 1000001 1T 1010100 0A 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

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

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.

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

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

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

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.

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

28

Figure 4-5. Stop and Wait ARQ

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

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.

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

30

Figure 4-6.ContinuousARQ

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

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).

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

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.

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

33

Figure 4-7 Forward Error Correction

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

34

Data Link Protocols

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

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.

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

36

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

XMODEM-1K 1028 8-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

* Varies depending on message length.

Figure 4-8 Data Link Protocol Summary

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

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.

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

38

Figure 4-9 Asynchronous Transmission

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

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.

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

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)

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

41

Figure 4-11 SDLC Frame Format

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

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)

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

43

Figure 4-12 Ethernet Frame Format

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

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)

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

45

Figure 4-13 PPP packet layout

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

46

Transmission Efficiency

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

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.

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

48

Figure 4-14 Optimum Packet Size

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

49

End of Chapter 4


Recommended