Top Banner
Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols
52

Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Jan 04, 2016

Download

Documents

Cody Grant
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Chapter -8Data Link Protocols

• Asynchronous Protocols• Synchronous Protocols• Character-Oriented Protocols• Bit-Oriented Protocols

Page 2: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

www.gxmu.edu.cn

Data Link Control Protocol

INTRODUCTION• A set of rules that define the exact format of messages exchanged between

computers or between computers and people is called a protocol.• Data link protocols are necessary so that all of the devices on the network are

operating by the same set of rules and are able to communicate with each other.

• DATA LINK PROTOCOLS FUNCTIONS Communication startup Character identification and framing Message identification

The DTE must separate the characters on the communications line into messages.

Page 3: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

DATA LINK PROTOCOLS FUNCTIONS

Line ControlThe part of a protocol consisting of the rules that specify the way the

receiving terminal signals the sending terminal if it has received data correctly, how and under what circumstances the line will be turned around, and whether the receiving terminal can accept more data is called line control.

Error Control The part of the protocol consisting of rules specifying what happens when an error is detected, what to do if communications suddenly and unexplainably cease, and the way communications are reestablished after they are broken is called error control.

 Termination The part of a protocol consisting of rules for ending the communications under normal and abnormal circumstances is called termination.

Page 4: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

DESIRABLE ATTRIBUTES OF DATA LINK PROTOCOLS

Transparency The ability of data terminal equipment (DTE) to be able to transmit and receive any bit pattern as data is called transparency . Code independenceThe protocol allow the transmission of data from any data coding system.   EfficiencyThe protocol should use as few characters as possible to control the data transmission so that most of the line capacity can be used for actual data transmission.

PROTOCOL IMPLEMENTION A data link protocol is implemented by transmitting certain bit patterns or characters on the communications circuit.

PREDETERMINED COMMUNICATIONS PARAMETERS Predetermined communication parameters are those that are set manually by switches or specified as parameters in software

Page 5: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

LINE ACCESS

When two stations on a circuit transmit at the same time, a(n) collision occurs. There are three primary ways that circuit access can be obtained:contentionpolling,token passing.

Contention: When any station that has traffic looks to see if the circuit is free, and if it is, begins sending its traffic the line control technique is called contention. Polling : When a central or control station asks each station on the circuit or network if it has traffic to send it is using a line control technique called polling. Roll call polling: Roll call polling is the most common implementation of a polling system. In order to know what stations to poll and in what sequence, the master station uses a polling list.Fast select polling: Fast select polling speeds up the polling process because a slave station that doesn’t have traffic isn’t required to return a character to the master station.

Page 6: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

MESSAGE FORMATData messages normally consist of three parts: the header, text, and trailer. The header of a message contains and conveys information about the message, such as the destination node’s address, a sequence number, and perhaps a date and time.

Message format showing examples of the kinds of control characters the protocol might employ.

Page 7: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

FLOW CONTROLTechniques to ensure that a fast transmitting node does not send data faster than the receiving node can receive and process it are called flow control. Necessary when data is being sent faster than it can be processed by receiverThe simplest, most effective, least expensive, and most commonly used method for transmission error control.Using retransmission.

Computer to printer is typical settingCan also be from computer to computer, when a processing program is limited in capacity

Stop-and-wait Flow Control: Stop-and-wait Flow Control is the simplest form control.

The data flow of stop-and-wait flow control.

Page 8: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

8

Stop-and-Wait Flow Control

• Also called Stop-and-Wait Automatic Repeat reQuest (ARQ)

• It is the simplest form• Source may not send new frame until receiver

acknowledges the frame already sent• Very inefficient, especially when a single message is

broken into separate frames, or when the data link is long enough for significant delays to be introduced

Page 9: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

9

Stop-and-Wait ARQ

• One frame received and handled at a time• If frame is damaged, receiver discards it and sends no

acknowledgment– Sender uses timer to determine whether or not to

retransmit– Sender must keep a copy of transmitted frame until

acknowledgment is received

• If acknowledgment is damaged, sender will know it because of numbering

Page 10: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

10

Page 11: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Sliding Window Flow ControlThe flow control technique that allows multiple frames to be in transit on the line at one time is called sliding window. There are two common implementations of sliding window flow control: go-back-n and selective repeat.

The data flow in a simple sliding window flow control.

Page 12: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

12

Page 13: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

13

Sliding-Window Flow Control

• Also called Continuous ARQ • Allows multiple frames to be in transit• Receiver sends acknowledgement with sequence number of anticipated

frame• Sender maintains list of sequence numbers it can send, receiver maintains

list of sequence numbers it can receive• ACK (acknowledgement, or RR – Receiver Ready) supplemented with RNR

(receiver not ready)

Go-Back-N ARQ

• Uses sliding-window flow control• When receiver detects error, it sends negative acknowledgment (REJ)• Sender must begin transmitting again from rejected frame• Transmitter must keep a copy of all transmitted frames

Page 14: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Data Transmission Modes • The manner how alphanumeric data characters are transmitted and received

between terminals is given by the data transmission modes.

• Two modes available are character and block.

• Character Mode: Character codes are transmitted asynchronously i.e. whenever the operator depresses a key, the data character is sent from the source to destination station and are displayed on the screen at the current location of cursor.

• Block Mode: Here, when operator enters the characters, they are stored in the buffers and displayed on screen. When the operators gets ready to send the information enter, send or return key is pressed, which transmits all the data characters previously entered into the memory. The assortment of characters transmitted as a group is called a block or frame of data. The block mode is more appropriate for multi drop data communications circuits operating in a polling environment.

Page 15: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.
Page 16: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-2

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

Page 17: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

ASYNCHRONOUS DATA LINK PROTOCOLSAsynchronous data link protocols deal with individual characters rather than blocks of data.Point-to-Point Protocol(PPP):•A protocol that is primarily used by PC workstations to send IP over dial-up lines, typically when dialing in to an ISP for connection to the Internet, is called PPP.•PPP has largely replaced the SLIP protocol because it has better error detection.

PPP’s frame format

XMODEM Protocol:•The XMODEM protocol was developed for use between PCs, especially for transfers of data files between them.•Data transmission and control are quite simple with XMODEM protocol.

Page 18: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Y MODEM PROTOCOL

Y MODEM is a protocol similar to the XMODEM except with the following expectations1. The information field has a maximum capacity of 1024 bytes2. Two CAN characters are required to abort a transmission3. ITU-T-CRC 16 is used to calculate the frame check sequence4. Multiple frames can be sent in succession and then acknowledged with a single ACK

or NAK character.

ZMODEM PROTOCOL:

ZMODEM is a newer protocol that simply combines the features of XMODEM and YMODEM

BLAST (Blocked Asynchronous Transmission) The BLAST Session protocol defines a set of rules for file transfer and file management with a remote computer. It features full-duplex transmission and uses sliding window flow control.

Other Asynchronous Protocols:•A sophisticated check character at the end of each block of data is called a cyclic redundancy check(CRC).

Page 19: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Asynchronous Transmission

Start-stop transmission is a least efficient technology. We need to bundle bytes to reach high efficiency transmissions.

Page 20: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

20

Asynchronous FTP

STX Packet# Checksum1 byte compliment 1 byte

1 byte

Message128 bytes

XMODEM FORMAT

Packet # 1 byte

Page 21: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

XMODEMFigure 11-3

Page 22: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

22

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

Page 23: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-4

Byte-Count-Oriented protocols

Page 24: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

SYNCHRONOUS DATA LINK PROTOCOLS

• Synchronous data link protocols typically deal with blocks of data , not individual characters.•The three types are character-oriented protocol, byte-count-oriented protocol and bit-oriented protocols.

Character-Oriented Protocols:•A character-oriented protocol uses special characters to indicate the beginnings and ends of messages . The best known character-oriented protocol is the Binary Synchronous Communications Protocol(BSC),also known as BISYNC.•BISYNC is defined to only support the 6-bit trans code (SBT), EBCDIC, and ASCII.

Byte-Count-Oriented Protocols:•Byte-count-oriented protocols have a special characters to mark the beginning of the header , followed by a count field that indicates how many characters are in the data portion of the messages.•The best known byte-count-oriented protocol is the Digital Data Communications Message Protocol(DDCMP).

Page 25: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Bit-Oriented Protocols•A bit-oriented protocol uses only one special character , called the flag character. which marks the beginning and end of parts of the message.•The best known bit-oriented protocols are the ISO’s High-Level Data Link Control (HDLC) protocol.•SDLC is a subset of HDLC.

•OTHER DATA LINK PROTOCOLS P143

PROTOCOL CONVERSION

A protocol converter changes one protocol to another, when, for example, a message is sent between two networks that use different protocols.

Page 26: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-5

Page 27: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Simple Frame

Figure 11-6

Page 28: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

A Frame with Header

Figure 11-7

Page 29: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Multiblock Frame

Figure 11-8

Page 30: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-9 Multiframe Transmission

Page 31: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Control Frame

Figure 11-10

Page 32: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-11

Control Frames

Page 33: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-11-continued

Control Frames

Page 34: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-11-continued

Control Frames

Page 35: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

Figure 11-12

Byte Stuffing

Page 36: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

36

High-Level Data Link Control (HDLC)

• The OSI’s data link protocol• A bit-oriented protocol• On transmitting side, HDLC receives data from an application,

and delivers it to the receiver on the other side of the link• On the receiving side, HDLC accepts the data and delivers it to

the higher level application layer• Both modules exchange control information, encoded into a

frame• (IBM’s SDLC has similar features and the format of HDLC)

Page 37: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

HDLC Frame Structure

Flag: 01111110, at start and endAddress: secondary station (for multi drop configurations)Information: the data to be transmittedFrame check sequence: 16- or 32-bit CRCControl: purpose or function of frame

Information frames: contain user dataSupervisory frames: flow/error control (ACK/ARQ)Unnumbered frames: variety of control functions

Page 38: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

38

Transparency Problem

• The problem of transparency– Because HDLC uses 01111110 to mark the start

and end of a packet, the character “01111110” will confuse the receiver.

• Solution - Bit Stuffing– Add a 0 after every five 1s at sender side and

delete the 0 at receiver side.

Page 39: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

39

HDLC Operation

• Initialization: S-frames specify mode and sequence numbersU-frames acknowledge

• Data Transfer: I-frames exchange user data,S-frames acknowledge and provide flow/error control

• Disconnect: U-frames initiate and acknowledge

Page 40: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

40

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.• There are three common error detection methods.

– Parity Checking– Longitudinal redundancy checking– Polynomial checking

• Checksum• Cyclic Redundancy

Page 41: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

41

Error Correction

• A receiver that detects an error simply asks the sender to retransmit the message until it is received without error. – Lost frame– Damaged frame

• With Stop and Wait ARQ the sender stops and waits for a response from the receiver after each message or data package.

• Responses are:– Error detection– Positive acknowledgment (ACK)– Negative acknowledgment and retransmission (NAK)– Retransmission after time-out

Page 42: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

42

Error Correction via Retransmission With Continuous ARQ the sender does not wait

for acknowledgement before sending next message. If it receives an REJ, 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.

Page 43: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

43

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”

Page 44: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

44

*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.• commonly used in satellite transmission. • Chip implementations of FEC has been used in modems,

e.g. V.34.

Page 45: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

45

Page 46: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

46

Error Detection: Parity Bits

• Bit added to each character to make all bits add up to an even number (even parity) or odd number (odd parity)

• Good for detecting single-bit errors only• High overhead (one extra bit per 7-bit

character=12.5%)

Page 47: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

47

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.

Page 48: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

48

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 1010111 (Oct127).Because there are five 1s (an odd number), parity is set to zero.This would be transmitted as: 10101110.

Page 49: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

49

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.

Page 50: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

50

Longitudinal Redundancy Checking

ASCII10001001000001101010010000011101111

LetterDATA

BCC

Parity bit11011

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

(Note that the parity bit in the BCC is determined by parity,not LRC.)

Page 51: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

51

Polynomial CheckingLike 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.

Page 52: Chapter -8 Data Link Protocols Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented Protocols.

52

Error Detection: Cyclic Redundancy Check (CRC)

• Data in frame treated as a single binary number, divided by a unique prime binary, and remainder is attached to frame

• 17-bit divisor leaves 16-bit remainder, 33-bit divisor leaves 32-bit remainder

• For a CRC of length N, errors undetected are 2-N

• Overhead is low (1-3%)