Presentation is loading. Please wait.

Presentation is loading. Please wait.

Datakommunikasjon Høsten 2001 Forelesning nr 3, 10. september 2001 Ch 7, Data Link Control.

Similar presentations


Presentation on theme: "Datakommunikasjon Høsten 2001 Forelesning nr 3, 10. september 2001 Ch 7, Data Link Control."— Presentation transcript:

1 Datakommunikasjon Høsten 2001 Forelesning nr 3, 10. september 2001 Ch 7, Data Link Control

2 Forelesning nr 4, høsten 2001 Øvingsoppgaver zOppgave 7.11, 7.17 og 7.26 zGjennomgås onsdag 19. september

3 Forelesning nr 4, høsten 2001 Flow Control zEnsuring the sending entity does not overwhelm the receiving entity yPreventing buffer overflow zTransmission time yTime taken to emit all bits into medium zPropagation time yTime for a bit to traverse the link

4 Forelesning nr 4, høsten 2001 Model of Frame Transmission

5 Forelesning nr 4, høsten 2001 Stop and Wait zSource transmits frame zDestination receives frame and replies with acknowledgement zSource waits for ACK before sending next frame zDestination can stop flow by not send ACK zWorks well for a few large frames

6 Forelesning nr 4, høsten 2001 Fragmentation zLarge block of data may be split into small frames yLimited buffer size yErrors detected sooner (when whole frame received) yOn error, retransmission of smaller frames is needed yPrevents one station occupying medium for long periods zStop and wait becomes inadequate

7 Forelesning nr 4, høsten 2001 Link utnyttelse Transmission time = tid det tar å sende en ramme Settes = 1 Propagation delay = tid det å sende en bit fra A til B Settes = a

8 Forelesning nr 4, høsten 2001 Stop and Wait Link Utilization

9 Forelesning nr 4, høsten 2001 Sliding Windows Flow Control zAllow multiple frames to be in transit zReceiver has buffer W long zTransmitter can send up to W frames without ACK zEach frame is numbered zACK includes number of next frame expected zSequence number bounded by size of field (k) yFrames are numbered modulo 2 k

10 Forelesning nr 4, høsten 2001 Sliding Window Diagram

11 Forelesning nr 4, høsten 2001 Example Sliding Window

12 Forelesning nr 4, høsten 2001 Sliding Window Enhancements zReceiver can acknowledge frames without permitting further transmission RNR (Receive Not Ready) zMust send a normal acknowledge to resume zIf duplex, use piggybacking yIf no data to send, use acknowledgement frame yIf data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP)

13 Forelesning nr 4, høsten 2001 Error Detection zAdditional bits added by transmitter for error detection code zParity yValue of parity bit is such that character has even (even parity) or odd (odd parity) number of ones yEven number of bit errors goes undetected

14 Forelesning nr 4, høsten 2001 Cyclic Redundancy Check zFor a block of k bits transmitter generates n bit sequence zTransmit k+n bits which is exactly divisible by some number zReceive divides frame by that number yIf no remainder, assume no error

15 Forelesning nr 4, høsten 2001 Error detection

16 Forelesning nr 4, høsten 2001 CRC Cyclic Redundancy Check M= , melding som skal overføres CRC generatorpolynom P= x 4 +x+1=10011 FCS (Frame Check Sequence) er rest av divisjonen 2 n * M : P n= : = Gir rest på 1110, dvs FCS = 1110 Sender M + FCS =

17 Forelesning nr 4, høsten :10011= FCS = 1110 Utregning Overfører: (2 n M) (FCS) =

18 Forelesning nr 4, høsten 2001 CRC polynomer zCRC-12 x 12 +x 11 +x 3 +x 3 +x+1 zCRC-16 zCRC-CCITT zCRC-32

19 Forelesning nr 4, høsten 2001 Error Control zDetection and correction of errors zLost frames zDamaged frames zSamlebegrep: Automatic repeat request yError detection yPositive acknowledgment yRetransmission after timeout yNegative acknowledgement and retransmission

20 Forelesning nr 4, høsten 2001 Automatic Repeat Request (ARQ) zStop and wait zGo back N zSelective reject (selective retransmission)

21 Forelesning nr 4, høsten 2001 Stop and Wait zSource transmits single frame zWait for ACK zIf received frame damaged, discard it yTransmitter has timeout yIf no ACK within timeout, retransmit zIf ACK damaged,transmitter will not recognize it yTransmitter will retransmit yReceive gets two copies of frame yUse ACK0 and ACK1

22 Forelesning nr 4, høsten 2001 Stop and Wait - Diagram Benytter ACK0 og ACK1 som i sliding window

23 Forelesning nr 4, høsten 2001 Stop and Wait - Pros and Cons zSimple zInefficient

24 Forelesning nr 4, høsten 2001 Go Back N zBased on sliding window zIf no error, ACK as usual with next frame expected zUse window to control number of outstanding frames zIf error, reply with rejection yDiscard that frame and all future frames until error frame received correctly yTransmitter must go back and retransmit that frame and all subsequent frames

25 Forelesning nr 4, høsten 2001 Go Back N - Damaged Frame zReceiver detects error in frame i zReceiver sends rejection-i zTransmitter gets rejection-i zTransmitter retransmits frame i and all subsequent

26 Forelesning nr 4, høsten 2001 Go Back N - Lost Frame (1) zFrame i lost zTransmitter sends i+1 zReceiver gets frame i+1 out of sequence zReceiver send reject i zTransmitter goes back to frame i and retransmits

27 Forelesning nr 4, høsten 2001 Go Back N - Lost Frame (2) zFrame i lost and no additional frame sent zReceiver gets nothing and returns neither acknowledgement nor rejection zTransmitter times out and sends acknowledgement frame with P bit set to 1 (P=1 betyr kommando) zReceiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) zTransmitter then retransmits frame i

28 Forelesning nr 4, høsten 2001 Go Back N - Damaged Acknowledgement zReceiver gets frame i and send acknowledgement (i+1) which is lost zAcknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter times out on frame i zIf transmitter times out, it sends acknowledgement with P bit set as before zThis can be repeated a number of times before a reset procedure is initiated

29 Forelesning nr 4, høsten 2001 Go Back N - Diagram RR=Receive Ready REJ = Reject

30 Forelesning nr 4, høsten 2001 Selective Reject zAlso called selective retransmission zOnly rejected frames are retransmitted zSubsequent frames are accepted by the receiver and buffered zMinimizes retransmission zReceiver must maintain large enough buffer zMore complex logic in transmitter

31 Forelesning nr 4, høsten 2001 Selective Reject - Diagram RR = Receive Ready REJ = Reject SREJ = Selective reject

32 Forelesning nr 4, høsten 2001 High Level Data Link Control zHDLC zISO 33009, ISO 4335

33 Forelesning nr 4, høsten 2001 HDLC Station Types zPrimary station yControls operation of link yFrames issued are called commands yMaintains separate logical link to each secondary station zSecondary station yUnder control of primary station yFrames issued called responses zCombined station yMay issue commands and responses

34 Forelesning nr 4, høsten 2001 HDLC Link Configurations zUnbalanced yOne primary and one or more secondary stations ySupports full duplex and half duplex zBalanced yTwo combined stations ySupports full duplex and half duplex

35 Forelesning nr 4, høsten 2001 HDLC Transfer Modes (1) zNormal Response Mode (NRM) yUnbalanced configuration yPrimary initiates transfer to secondary ySecondary may only transmit data in response to command from primary yUsed on multi-drop lines yHost computer as primary yTerminals as secondary

36 Forelesning nr 4, høsten 2001 HDLC Transfer Modes (2) zAsynchronous Balanced Mode (ABM) yBalanced configuration yEither station may initiate transmission without receiving permission yMost widely used yNo polling overhead

37 Forelesning nr 4, høsten 2001 HDLC Transfer Modes (3) zAsynchronous Response Mode (ARM) yUnbalanced configuration ySecondary may initiate transmission without permission form primary yPrimary responsible for line yrarely used

38 Forelesning nr 4, høsten 2001 Frame Structure zSynchronous transmission zAll transmissions in frames zSingle frame format for all data and control exchanges

39 Forelesning nr 4, høsten 2001 Frame Structure Diagram Start Stopp

40 Forelesning nr 4, høsten 2001 Flag Fields zDelimit frame at both ends zFlagg = zMay close one frame and open another zReceiver hunts for flag sequence to synchronize

41 Forelesning nr 4, høsten 2001 Bitstuffing - transparens zBrukes i HDLC for å ungå problemer med like datafelt og flagg. zMellom sending av start og stop flagg, senderen vil alltid sette inn en 0er etter fem 1ere: Etter å ha detektert start flagget gransker den bit strømmen: ynår det kommer et mønster på fem 1ere, ser den på det 6. yer dette en 0er, slettes det yer dette en 1er og det syvende en 0er, er dette et godkjent flagg. ydersom både 6 og 7 er 1ere, et abort signal sendt.

42 Forelesning nr 4, høsten 2001 Bit Stuffing zExample with possible errors

43 Forelesning nr 4, høsten 2001 Address Field zIdentifies secondary station that sent or will receive frame zUsually 8 bits long zMay be extended to multiples of 7 bits yLSB of each octet indicates that it is the last octet (1) or not (0) zAll ones ( ) is broadcast

44 Forelesning nr 4, høsten 2001 Control Field zDifferent for different frame type yInformation - data to be transmitted to user (next layer up) xFlow and error control piggybacked on information frames ySupervisory - ARQ when piggyback not used yUnnumbered - supplementary link control zFirst one or two bits of control field identify frame type

45 Forelesning nr 4, høsten 2001 Control Field Diagram

46 Forelesning nr 4, høsten 2001 Poll/Final Bit zUse depends on context zCommand frame yP bit y1 to solicit (poll) response from peer zResponse frame yF bit y1 indicates response to soliciting command

47 Forelesning nr 4, høsten 2001 Information Field zOnly in information and some unnumbered frames zMust contain integral number of octets zVariable length

48 Forelesning nr 4, høsten 2001 Frame Check Sequence Field zFCS zError detection z16 bit CRC zOptional 32 bit CRC

49 Forelesning nr 4, høsten 2001 HDLC Operation zExchange of information, supervisory and unnumbered frames zThree phases yInitialization yData transfer yDisconnect

50 Forelesning nr 4, høsten 2001 Examples of Operation (1)

51 Forelesning nr 4, høsten 2001 Examples of Operation (2) N(S), N(R)

52 Forelesning nr 4, høsten 2001 Other DLC Protocols (LAPB,LAPD) zLAPB - Link Access Procedure, Balanced yPart of X.25 (ITU-T) ySubset of HDLC - ABM yPoint to point link between system and packet switching network node (mellom DTE og DCE) zLAPD - Link Access Procedure, D-Channel yBeskrevet i Q.921 spesifikasjonen yABM yAlways 7-bit sequence numbers y16 bit address field contains two sub-addresses xOne for device and one for user (next layer up)

53 Forelesning nr 4, høsten 2001 ISDN – datalinklaget (lag 2) FCS = Frame Check Sequence

54 Forelesning nr 4, høsten 2001 LAPD commands and responses I - Information RR – Receive Ready RNR – Receive Not Ready REJ – Reject SABME – Set Asynchronous Balanced Mode DM – Disconnect Mode UI – Unnumbered Information DISC – Disconnect UA – Unnumbered acknowledge FRMR – Frame Reject XID – Exchange Identification

55 Forelesning nr 4, høsten 2001 LAPD – Timers zT200 = 1s, Time to wait for an ack before initiating recovery zT201 = 1s, Minimum time between TEI identity check messages zT202 = 2s, Minimum time between TEI identity check messages zT203 = 10s, Maximum time with no frames exchanged

56 Forelesning nr 4, høsten 2001 Other DLC Protocols (LLC) zLogical Link Control (LLC) yIEEE 802 yDifferent frame format yLink control split between medium access layer (MAC) and LLC (on top of MAC) yNo primary and secondary - all stations are peers yTwo addresses needed xSender and receiver yError detection at MAC layer x32 bit CRC yDestination and source access points (DSAP, SSAP)

57 Forelesning nr 4, høsten 2001 Logical Link Control/Medium Access Control

58 Forelesning nr 4, høsten 2001 Eksempel på LAPD


Download ppt "Datakommunikasjon Høsten 2001 Forelesning nr 3, 10. september 2001 Ch 7, Data Link Control."

Similar presentations


Ads by Google