Chapter 8 Data Link Protocols Asynchronous Protocols Synchronous

  • Slides: 52
Download presentation
Chapter -8 Data Link Protocols • • Asynchronous Protocols Synchronous Protocols Character-Oriented Protocols Bit-Oriented

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

Data Link Control Protocol INTRODUCTION • A set of rules that define the exact

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. • v v v DATA LINK PROTOCOLS FUNCTIONS Communication startup Character identification and framing Message identification The DTE must separate the characters on the communications line into messages. www. gxmu. edu. cn

DATA LINK PROTOCOLS FUNCTIONS v Line Control The part of a protocol consisting of

DATA LINK PROTOCOLS FUNCTIONS v Line Control The 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. v. 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. v Termination The part of a protocol consisting of rules for ending the communications under normal and abnormal circumstances is called termination.

DESIRABLE ATTRIBUTES OF DATA LINK PROTOCOLS v Transparency The ability of data terminal equipment

DESIRABLE ATTRIBUTES OF DATA LINK PROTOCOLS v Transparency The ability of data terminal equipment (DTE) to be able to transmit and receive any bit pattern as data is called transparency. v. Code independence The protocol allow the transmission of data from any data coding system. v Efficiency The 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

LINE ACCESS When two stations on a circuit transmit at the same time, a(n)

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: contention polling, 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. v 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. v. 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.

MESSAGE FORMAT Data messages normally consist of three parts: the header, text, and trailer.

MESSAGE FORMAT Data 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.

FLOW CONTROL Techniques to ensure that a fast transmitting node does not send data

FLOW CONTROL Techniques 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 receiver The simplest, most effective, least expensive, and most commonly used method for transmission error control. Using retransmission. Computer to printer is typical setting Can 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.

Stop-and-Wait Flow Control • Also called Stop-and-Wait Automatic Repeat re. Quest (ARQ) • It

Stop-and-Wait Flow Control • Also called Stop-and-Wait Automatic Repeat re. Quest (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 8

Stop-and-Wait ARQ • One frame received and handled at a time • If frame

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 9

10

10

Sliding Window Flow Control The flow control technique that allows multiple frames to be

Sliding Window Flow Control The 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.

12

12

Sliding-Window Flow Control • Also called Continuous ARQ • Allows multiple frames to be

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 13

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

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.

Figure 11 -2 • In general, microcomputer file transfer protocols are used on asynchronous

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-1 K (CRC+1 K blocks) YMODEM(CRC-16) ZMODEM (CRC-32) KERMIT (CRC-24)

ASYNCHRONOUS DATA LINK PROTOCOLS Asynchronous data link protocols deal with individual characters rather than

ASYNCHRONOUS DATA LINK PROTOCOLS Asynchronous 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.

Y MODEM PROTOCOL Y MODEM is a protocol similar to the XMODEM except with

Y MODEM PROTOCOL Y MODEM is a protocol similar to the XMODEM except with the following expectations 1. The information field has a maximum capacity of 1024 bytes 2. Two CAN characters are required to abort a transmission 3. ITU-T-CRC 16 is used to calculate the frame check sequence 4. 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).

Asynchronous Transmission Start-stop transmission is a least efficient technology. We need to bundle bytes

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

Asynchronous FTP XMODEM FORMAT STX 1 byte Packet# compliment 1 byte Message 128 bytes

Asynchronous FTP XMODEM FORMAT STX 1 byte Packet# compliment 1 byte Message 128 bytes Checksum 1 byte Packet # 1 byte 20

Figure 11 -3 XMODEM

Figure 11 -3 XMODEM

Asynchronous FTP KERMIT – developed by Columbia University – support a variety of different

Asynchronous FTP KERMIT – developed by Columbia University – support a variety of different packet sizes and error detection methods – typically 1000 bytes/packet with CRC-24 and adjustable during transmission – uses both stop-and-wait ARQ and continuous ARQ 22

Figure 11 -4 Byte-Count. Oriented protocols

Figure 11 -4 Byte-Count. Oriented protocols

SYNCHRONOUS DATA LINK PROTOCOLS • Synchronous data link protocols typically deal with blocks of

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

Bit-Oriented Protocols • A bit-oriented protocol uses only one special character , called the

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 P 143 PROTOCOL CONVERSION A protocol converter changes one protocol to another, when, for example, a message is sent between two networks that use different protocols.

Figure 11 -5

Figure 11 -5

Figure 11 -6 Simple Frame

Figure 11 -6 Simple Frame

Figure 11 -7 A Frame with Header

Figure 11 -7 A Frame with Header

Figure 11 -8 Multiblock Frame

Figure 11 -8 Multiblock Frame

Figure 11 -9 Multiframe Transmission

Figure 11 -9 Multiframe Transmission

Figure 11 -10 Control Frame

Figure 11 -10 Control Frame

Figure 11 -11 Control Frames

Figure 11 -11 Control Frames

Figure 11 -11 -continued Control Frames

Figure 11 -11 -continued Control Frames

Figure 11 -11 -continued Control Frames

Figure 11 -11 -continued Control Frames

Figure 11 -12 Byte Stuffing

Figure 11 -12 Byte Stuffing

High-Level Data Link Control (HDLC) • The OSI’s data link protocol • A bit-oriented

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

HDLC Frame Structure Flag: 01111110, at start and end Address: secondary station (for multi

HDLC Frame Structure Flag: 01111110, at start and end Address: secondary station (for multi drop configurations) Information: the data to be transmitted Frame check sequence: 16 - or 32 -bit CRC Control: purpose or function of frame Information frames: contain user data Supervisory frames: flow/error control (ACK/ARQ) Unnumbered frames: variety of control functions

Transparency Problem • The problem of transparency – Because HDLC uses 01111110 to mark

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 1 s at sender side and delete the 0 at receiver side. 38

HDLC Operation • Initialization: S-frames specify mode and sequence numbers U-frames acknowledge • Data

HDLC Operation • Initialization: S-frames specify mode and sequence numbers U-frames acknowledge • Data Transfer: I-frames exchange user data, S-frames acknowledge and provide flow/error control • Disconnect: U-frames initiate and acknowledge 39

Error Detection • It is possible to develop data transmission methodologies that give very

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 40

Error Correction • A receiver that detects an error simply asks the sender to

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 41

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

Error Correction via Retransmission w With Continuous ARQ the sender does not wait for acknowledgement before sending next message. If it receives an REJ, it retransmits the needed messages. w 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) w Continuous ARQ is a full-duplex transmission technique. 42

Packet Loss • How it could be? Two possibilities: – The receiver did not

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” 43

*Forward Error Correction Forward error correction uses codes containing sufficient redundancy to prevent errors

*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. 44

45

45

Error Detection: Parity Bits • Bit added to each character to make all bits

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%) 46

Parity Checking One of the oldest and simplest method, parity checking adds 1 additional

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

Parity Checking Assume we are using even parity with 7 -bit ASCII. The letter

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

Longitudinal Redundancy Checking (LRC) LRC was developed to overcome the problem with parity’s low

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

Longitudinal Redundancy Checking For example, suppose we were to send the message “DATA” using

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

Polynomial Checking Like LRC, polynomial checking adds 1 or more characters to the end

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

Error Detection: Cyclic Redundancy Check (CRC) • Data in frame treated as a single

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%) 52