Top Banner
Data and Computer Data and Computer Communications Communications Eighth & Ninth Edition Eighth & Ninth Edition by William Stallings by William Stallings Chapter 7 – Chapter 7 – Data Data Link Control Link Control Protocols Protocols
32

Data and Computer Communications

Mar 15, 2016

Download

Documents

baxter-haynes

Data and Computer Communications. Chapter 7 – Data Link Control Protocols. Eighth & Ninth Edition by William Stallings. Data Link Control Protocols. sending data over a data communications link. need layer of logic above Physical to manage exchange of data over a link - PowerPoint PPT Presentation
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: Data and Computer Communications

Data and Computer Data and Computer CommunicationsCommunications

Eighth & Ninth EditionEighth & Ninth Editionby William Stallingsby William Stallings

Chapter 7 – Chapter 7 – Data Data Link Control Link Control ProtocolsProtocols

Page 2: Data and Computer Communications

Data Data Link Control ProtocolsLink Control Protocols

need layer of logic above Physicalneed layer of logic above Physical to manage exchange of data over a linkto manage exchange of data over a link

frame synchronization (frame synchronization (blocks are called frames) blocks are called frames) flow control (sending and receiving at same flow control (sending and receiving at same

speed)speed) error control ( what level of errors is acceptable)error control ( what level of errors is acceptable) Addressing (identify of sender and receiver)Addressing (identify of sender and receiver) control and data (what is data what is control info)control and data (what is data what is control info) link management (link management (initiation, maintenance, and initiation, maintenance, and

termination of a sustained data exchange over a link).termination of a sustained data exchange over a link).

sending data over a data communications link.

Page 3: Data and Computer Communications

Flow ControlFlow Control

ensure sending entity does not overwhelm ensure sending entity does not overwhelm receiving entityreceiving entity by preventing buffer overflowby preventing buffer overflow

influenced by:influenced by: transmission timetransmission time

• time taken to emit all bits into mediumtime taken to emit all bits into medium propagation timepropagation time

• time for a bit to traverse the linktime for a bit to traverse the link assume here no errors but varying delaysassume here no errors but varying delays

The sending station must not send frames at a rate faster than the receiving station can absorb them.

Page 4: Data and Computer Communications

Model of Frame TransmissionModel of Frame Transmission

data are sent in a sequence of frames, with each frame containing a portion of the data and some control information.

Page 5: Data and Computer Communications

Stop and WaitStop and WaitThe simplest form of flow controlThe simplest form of flow control source transmits framesource transmits frame destination receives frame and replies with destination receives frame and replies with

acknowledgement (ACK)acknowledgement (ACK) source waits for ACK before sending nextsource waits for ACK before sending next destination can stop flow by not send ACKdestination can stop flow by not send ACK works well for a few large framesworks well for a few large frames Stop and wait becomes inadequate if large Stop and wait becomes inadequate if large

block of data is split into small frames block of data is split into small frames

Page 6: Data and Computer Communications

Stop and Wait Link UtilizationStop and Wait Link Utilization

the stop-and-wait procedure may be inadequate, mainly since only one frame at a time can be in transit.

Page 7: Data and Computer Communications

Sliding Windows Flow ControlSliding Windows Flow Control

The problem described so far is that only one The problem described so far is that only one frame at a time can be in transit at the same timeframe at a time can be in transit at the same time

Efficiency can be greatly improved by allowing Efficiency can be greatly improved by allowing multiple frames to be in transit at the samemultiple frames to be in transit at the same

Animation process shockwave Animation process shockwave : : http://www.humboldt.edu/~aeb3/telecom/Encapsulhttp://www.humboldt.edu/~aeb3/telecom/Encapsulation.html ation.html

Page 8: Data and Computer Communications

Sliding Windows Flow ControlSliding Windows Flow Control allows multiple numbered frames to be in transitallows multiple numbered frames to be in transit receiver has buffer W longreceiver has buffer W long transmitter sends up to W frames without ACKtransmitter sends up to W frames without ACK ACK includes number of next frame expectedACK includes number of next frame expected sequence number is bounded by size of field (k)sequence number is bounded by size of field (k)

frames are numbered modulo 2frames are numbered modulo 2kk

giving max window size of up to 2giving max window size of up to 2k k - 1- 1 receiver can ack frames without permitting further receiver can ack frames without permitting further

transmission (Receive Not Ready)transmission (Receive Not Ready) must send a normal acknowledge to resumemust send a normal acknowledge to resume if have full-duplex link, can piggyback Acksif have full-duplex link, can piggyback Acks

Each Each data framedata frame includes a field that holds the sequence number of that includes a field that holds the sequence number of that frame plus a field that holds the sequence number used for acknowledgmentframe plus a field that holds the sequence number used for acknowledgment

Page 9: Data and Computer Communications

Sliding Window DiagramSliding Window Diagram

Page 10: Data and Computer Communications

Sliding Window ExampleSliding Window Example

Page 11: Data and Computer Communications

Error ControlError Control detection and correction of errors such as:detection and correction of errors such as:

lost frameslost frames damaged framesdamaged frames

common techniques use:common techniques use: error detectionerror detection positive acknowledgmentpositive acknowledgment retransmission after timeoutretransmission after timeout negative acknowledgement & retransmissionnegative acknowledgement & retransmission

Bit errors introduced by the transmission system should be corrected.

Page 12: Data and Computer Communications

Automatic Repeat Request Automatic Repeat Request (ARQ)(ARQ)

collective name for such error control collective name for such error control mechanisms, including:mechanisms, including:

stop and waitstop and wait go back Ngo back N selective reject (selective retransmission)selective reject (selective retransmission)

Page 13: Data and Computer Communications

Stop and WaitStop and Wait source transmits single framesource transmits single frame wait for ACKwait for ACK if received frame damaged, discard itif received frame damaged, discard it

transmitter has timeouttransmitter has timeout if no ACK within timeout, retransmitif no ACK within timeout, retransmit

if ACK damaged,transmitter will not recognize itif ACK damaged,transmitter will not recognize it transmitter will retransmittransmitter will retransmit receive gets two copies of framereceive gets two copies of frame use alternate numbering and ACK0 / ACK1use alternate numbering and ACK0 / ACK1

Page 14: Data and Computer Communications

Stop and WaitStop and Wait see example with both see example with both

types of errorstypes of errors pros and conspros and cons

simplesimple inefficientinefficient

Page 15: Data and Computer Communications

Go Back NGo Back N referred to as referred to as continuous ARQcontinuous ARQ.. based on sliding windowbased on sliding window if no error, ACK as usualif no error, ACK as usual use window to control number of outstanding use window to control number of outstanding

framesframes if error, reply with rejectionif error, reply with rejection

discard that frame and all future frames until error discard that frame and all future frames until error frame received correctlyframe received correctly

transmitter must go back and retransmit that frame transmitter must go back and retransmit that frame and all subsequent framesand all subsequent frames

Page 16: Data and Computer Communications

Go Back N - Handling Go Back N - Handling Damaged FrameDamaged Frame

error in frame error in frame i i so receiver rejects frame so receiver rejects frame i i transmitter retransmits frames from transmitter retransmits frames from ii

Lost FrameLost Frame frame frame ii lost and either lost and either

• transmitter sends transmitter sends i+1 i+1 andand receiver gets frame receiver gets frame i+1i+1 out of seq and rejects frame out of seq and rejects frame i i

• or transmitter times out and send ACK with P bit or transmitter times out and send ACK with P bit set which receiver responds to with ACK set which receiver responds to with ACK i i

transmitter then retransmits frames from transmitter then retransmits frames from ii

Page 17: Data and Computer Communications

Go Back N - HandlingGo Back N - Handling

Page 18: Data and Computer Communications

Selective RejectSelective Reject also called selective retransmissionalso called selective retransmission only rejected frames are retransmittedonly rejected frames are retransmitted subsequent frames are accepted by the receiver subsequent frames are accepted by the receiver

and bufferedand buffered minimizes retransmissionminimizes retransmission receiver must maintain large enough bufferreceiver must maintain large enough buffer more complex logic in transmittermore complex logic in transmitter hence less widely usedhence less widely used useful for satellite links with long propagation useful for satellite links with long propagation

delaysdelays

Page 19: Data and Computer Communications

Go Back N Go Back N vsvs

Selective Selective RejectReject

Page 20: Data and Computer Communications

High Level Data Link Control High Level Data Link Control (HDLC)(HDLC)

an important data link control protocolan important data link control protocol specified as ISO 33009, ISO 4335specified as ISO 33009, ISO 4335 station types station types To satisfy a variety of applications To satisfy a variety of applications ::

Primary - controls operation of link Primary - controls operation of link ( frames are ( frames are commands )commands )

Secondary - under control of primary station Secondary - under control of primary station (issues (issues response) response)

Combined - issues commands and responsesCombined - issues commands and responses a station may issue both commands and responsesa station may issue both commands and responses..

Page 21: Data and Computer Communications

High Level Data Link Control High Level Data Link Control (HDLC)(HDLC)

HDLC also defines 2 link HDLC also defines 2 link configurationsconfigurations.. Unbalanced - 1 primary, 1 secondaryUnbalanced - 1 primary, 1 secondary supports both full-duplex and half-duplex supports both full-duplex and half-duplex

transmission.transmission. Balanced - 2 combined stationsBalanced - 2 combined stations supports both full-duplex and half-duplex supports both full-duplex and half-duplex

transmissiontransmission

Page 22: Data and Computer Communications

HDLC Transfer ModesHDLC Transfer ModesHDLC defines three data transfer modes:HDLC defines three data transfer modes: Normal Response Mode (NRM)Normal Response Mode (NRM)

Used with unbalanced configUsed with unbalanced config primary initiates transferprimary initiates transfer secondary may only transmit data in response to a command from secondary may only transmit data in response to a command from

the primarythe primary used on multi-drop lines, eg host + terminalsused on multi-drop lines, eg host + terminals

Asynchronous Balanced Mode (ABM)Asynchronous Balanced Mode (ABM) balanced config, either station initiates transmission, has no balanced config, either station initiates transmission, has no

polling overhead, widely usedpolling overhead, widely used Asynchronous Response Mode (ARM)Asynchronous Response Mode (ARM)

unbalanced config, secondary may initiate transmit without unbalanced config, secondary may initiate transmit without permission from primary, rarely usedpermission from primary, rarely used

Page 23: Data and Computer Communications

HDLC Frame StructureHDLC Frame Structure HDLC uses synchronous transmissionHDLC uses synchronous transmission of of

framesframes single frame format usedsingle frame format used

Page 24: Data and Computer Communications

Flag Fields and Bit StuffingFlag Fields and Bit Stuffing delimit frame at both ends with 01111110 seqdelimit frame at both ends with 01111110 seq A single flag may be used as the closing flag for one A single flag may be used as the closing flag for one

frame and the opening flag for the next.frame and the opening flag for the next. receiver hunts for flag sequence to synchronizereceiver hunts for flag sequence to synchronize bit stuffing used to avoid confusion with data bit stuffing used to avoid confusion with data

containing flag seq 01111110containing flag seq 01111110 0 inserted after every sequence of five 1s0 inserted after every sequence of five 1s if receiver detects five 1s it checks next bitif receiver detects five 1s it checks next bit if next bit is 0, it is deleted (was stuffed bit)if next bit is 0, it is deleted (was stuffed bit) if next bit is 1 and seventh bit is 0, accept as flagif next bit is 1 and seventh bit is 0, accept as flag if sixth and seventh bits 1, sender is indicating abortif sixth and seventh bits 1, sender is indicating abort

Page 25: Data and Computer Communications

Address FieldAddress Field

identifies secondary station that sent or will identifies secondary station that sent or will receive framereceive frame

usually 8 bits longusually 8 bits long may be extended to multiples of 7 bitsmay be extended to multiples of 7 bits

LSB indicates if is the last octet (1) or not (0)LSB indicates if is the last octet (1) or not (0) all ones address 11111111 is broadcastall ones address 11111111 is broadcast

On a shared link, such as (LAN), the identity of the On a shared link, such as (LAN), the identity of the two stations involved in a transmission must be two stations involved in a transmission must be specifiedspecified.

Page 26: Data and Computer Communications

Control FieldControl Field

different for different frame typedifferent for different frame type Information - data transmitted to user (next layer up)Information - data transmitted to user (next layer up)

• Flow and error control piggybacked on information framesFlow and error control piggybacked on information frames Supervisory - ARQ when piggyback not usedSupervisory - ARQ when piggyback not used Unnumbered - supplementary link controlUnnumbered - supplementary link control

first 1-2 bits of control field identify frame typefirst 1-2 bits of control field identify frame type

the receiver must be able to distinguish control the receiver must be able to distinguish control information from the data being transmitted.information from the data being transmitted.

Page 27: Data and Computer Communications

Control FieldControl Field use of Poll/Final bit depends on contextuse of Poll/Final bit depends on context in command frame is P bit set to1 to solicit (poll) in command frame is P bit set to1 to solicit (poll)

response from peerresponse from peer in response frame is F bit set to 1 to indicate in response frame is F bit set to 1 to indicate

response to soliciting commandresponse to soliciting command seq number usually 3 bitsseq number usually 3 bits

can extend to 8 bits as shown belowcan extend to 8 bits as shown below

Page 28: Data and Computer Communications

Information & FCS FieldsInformation & FCS Fields Information Field Information Field

in information and some unnumbered framesin information and some unnumbered frames must contain integral number of octetsmust contain integral number of octets variable lengthvariable length

Frame Check Sequence Field (FCS)Frame Check Sequence Field (FCS) used for error detectionused for error detection either 16 bit CRC or 32 bit CRCeither 16 bit CRC or 32 bit CRC

Page 29: Data and Computer Communications

HDLC OperationHDLC Operation consists of exchange of information, consists of exchange of information,

supervisory and unnumbered framessupervisory and unnumbered frames have three phaseshave three phases

initializationinitialization• by either side, set mode & seqby either side, set mode & seq

data transferdata transfer• with flow and error controlwith flow and error control• using both I & S-frames (RR, RNR, REJ, SREJ)using both I & S-frames (RR, RNR, REJ, SREJ)

disconnect disconnect • when ready or fault notedwhen ready or fault noted

Page 30: Data and Computer Communications

HDLC Operation ExampleHDLC Operation ExampleProcedures for the management of initiation, maintenance, and termination of a sustained data exchange over a link.

Handshake

process

Page 31: Data and Computer Communications

HDLC Operation ExampleHDLC Operation Example

Page 32: Data and Computer Communications

SummarySummary introduced need for data link protocolsintroduced need for data link protocols flow controlflow control error controlerror control HDLCHDLC