Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Link Level Design Issues Services provided to Network Layer Framing Error control Flow control.

Similar presentations


Presentation on theme: "Data Link Level Design Issues Services provided to Network Layer Framing Error control Flow control."— Presentation transcript:

1

2

3 Data Link Level Design Issues Services provided to Network Layer Framing Error control Flow control

4 Services provided to Network Layer Layer 4 Layer 3 Layer 2 Layer 1 Layer 4 Layer 3 Layer 2 Layer 1 Physical Medium Host 1Host 2 Virtual Data Path Actual Data Path

5 Most Common Services Unacknowledged connectionless service –Very low error rate –Voice traffic Acknowledged connectionless service –Frame arrived safely –Good for wireless (unreliable) channels Acknowledged connection oriented service –Reliable stream of ordered frames –Three phases -connection, data flow, disconnect

6 33 22222 2 ROUTER Routing Processor Link Layer Processor Transmission line to a router Frames Packets Data link protocol Placement of Data Link Protocol

7 Character count - obsolete Starting and ending characters, with character stuffing (see next slide) Starting and ending flags, with bit stuffing(see following slide) Physical layer coding violations Framing

8 Character Stuffing (Transparency to User) DLESTXDLEETXDLEETXDLE Frame Beginning of frame End of frame Actual data sequence Stuffed character User data The first of two DLE characters is always a stuff-delete

9 Bit Stuffing (Transparency to User) 01111110 011111010 Frame Beginning of frame End of frame Actual data sequence Stuffed bit User data A “0” following five “1’s” is always deleted 01111110

10 Error control Physical layer coding violations

11 Error Control Automatic Repeat Request (ARQ) –Error detecting codes –Positive acknowledgement(ACK) –Negative acknowledgement(NACK) –Timeout –Delay sensitivity Forward Error Correction –Error correcting codes –Delay insensitive –Much more overhead required

12 Link-by-Link vs End-to-End Error Control There’s a tradeoff

13 N links p = Probability of error on a single link M = Single message transmission time Link-by-line acknowledgement Average no. link retransmissions=1/(1-p) Average message transmission time per link=M/(1-p) Average message transmission time N links = NM/(1-p) End-to-end acknowledgement Probability no error end-to-end=(1-p) N Probability at least one error end-to-end=q=1- (1-p) N Average no. end-to-end retransmissions=1/(1-q)= (1-p) -N Average transmission time, end-to-end = M (1-p) -N Assumption of negligible propagation delay

14 Link error probability Normalized transmission time Link-by-link 3 links Link-by-link 10 links End-to-end 3 links End-to-end 10 links

15 Flow control Closed loop controls –Sliding window Open loop –Leaky bucket

16

17 Redundancy Encoding Block codes –(n,k) code n= codeword length, k=Information bits ASCII (8,7) code –Parity bits ASCII “e” 10100110 Parity bit –Hamming distance-number of different places Convolutional Codes –Difference in path lengths –Viterbi decoding

18 (7,4) Hamming Code

19 Augmented Hamming Code extra parity bit over all other bits

20 Hamming Distance and Error Correction Example-six bit codewords Codeword 1- 001101 Codeword 2- 101001 Hamming Distance Two Number of places codewords differ

21

22 n bit codeword - vertex on an n dimensional cube Number of edges tranversed from one point to another =Hamming distance between codewords Codewords Intermediate vertices Distance = 5

23 Codewords Single Error Detecting Code-Distance two Single-error correcting or double-error detecting Distance three Single-error correcting and double-error detecting Distance four Vertex Distances and error correction and detection

24 Distance and Correcting and Detecting Capability D=Number of detectable errors C=Number of correctable errors  Minimum distance between codewords Examples: (7,4) Hamming code  =3 D= 2 and C=1 Augmented Hamming (8,4) code  =4, D=3 and C =1 Received n bits not a codeword Received n bits closest to one codeword

25

26 Forward Error Correction P e =P(Single bit in error) Independence from bit to bit

27 Trade between data rate and error correcting power

28 Code Efficiency n bit codeword - vertex on an n dimensional cube An efficient code packs the code “densely” n nearest neigbors Code point

29 n-1 nearest neighbors of adjacent point Code point

30 Number of vertices at distance I from a codeword Number of vertices at distance C or less Vertices belong to codeword Packing the cube efficiently Number of code points Lower bound on number of vertices Equality for Perfect code

31 Implementation of Coding and Decoding In digital hardware, naturally Cyclic codes -every codeword a cyclic shift of another eg Hamming code codewords 1,3,4,6,8,10 and cyclic shifts 3 - 0011010 13 - 1101000 Cyclic codes represented by a polynomial Each code has a unique generator polynomial-G(x) e.g. For (7,4) Hamming, G(x)=

32

33 Divisor Quotient Remainder

34 Forming a codeword from k information bits 1) D(x) - k-1 degree polynomial representing data 2) Form x n-k D(x) (n-1 degree) 3) Divide x n-k D(x) by G(x), save remainder R(x) 4) Form codeword C(x)= x n-k D(x) +R(x) Mathematical justification Codeword is a multiple of G(x) If not an error has occurred.

35 Example 1110(14) to be transmitted-D(x)= x 3 + x 2 + x Multiplication by x 3 gives x 6 + x 5 + x 4 Remainder after division by x 3 + x 2 +1 is x C(x)=x 6 + x 5 + x 4 + x 1110010(14) Error in transmission channel error 1111010 Received x 6 + x 5 + x 4 + x 3 + x /x 3 + x 2 +1 R(x)= x 3

36 Divider circuit

37 Encoder Implementation Divider Circuit Input Sequence Remainder - R(x) n-k tic delay D(x) D(x)+ R(x)

38 Generating Polynomials of Cyclic Codes Standards for Error Detection

39 Burst Error Capabilities of CRC Codes Transmitted C(x) Channel error E(x) Received C(x) + E(x) Because of error C(x) + E(x) is not divisible by G(x) E(x)/G(x)=R(x) ModG(x)

40 If (x+1) a factor of G(x) odd number of errors All double errors All bursts of length < r+1

41 Interleaving for Burst Errors n1n1 k 2 codewords each (n 1 k 1 ) n1n1 n1n1 Imagined rearrangement n 2 - k 2 Error burst n 1 Additional Storage and Processing n 1 (n 2 - k 2 ) parity bits Turbo codes n 2 - k 2

42 Convolutional codes T input 110100 Example(3,1) code output + T + 111 100 010 110 011 001 000

43 Trellis Representations 00 01 10 11 00 01 10 11 000 111 001 110 011 100 010 101 State Input Next state

44 Viterbi Algorithm-shortest path Trellis codes-Euclidian distance shortest path-Hamming distance

45 conv encoder block encoder CHAN block decoder VA Configurations Correction block encoder CHAN Error detection NACK Detection

46 A B Data Link Prototcols

47 Data Link Layer Source Machine Unrestricted Simplex Transmitter Form Frame Physical Layer Packet from Network Layer

48 Elementary Data Link Protocols(3.3) Flag Basic Link Level Frame Info CKSM Frame Header Kind Seq ACK User Data Formed into a Packet and Passed to Network Layer Frame header Three fields

49 Dealing with an Unreliable Channel Timeout routines Sequence number in Frames

50 Unrestricted Simplex Receiver Wakeup Remove frame from Physical level buffer Form packet and Pass to Network Layer Go back to sleep

51 Simplex Stop-and Wait Infinite processor speed or infinite buffer not needed Inserting maximum delay too conservative ACK to sender is solution (Data in one direction only ) Transmitter Fetch packet from network level Form frame Frame stored in transmit buffer until ACK received Transmitted after ACK Receiver Remove frame from Physical level buffer Form packet and Pass to Network Layer Return ACK Flow Control Problem

52 Stop-and Wait Simplex - Noisy Channel Complicating Factor - ACK errors Same frame received in succssion Remedy - sequence numbers 0 and 1 Transmitter Initialize sequence number Fetch packet from network level Form frame Insert sequence number in frame Timeout and resend frame Frame stored in transmit buffer until ACK received Invert sequence number

53 Receiver CHECKSUM to validate received frame Remove frame from Physical level buffer Check sequence number Form packet and Pass to Network Layer Invert expect sequence number Return ACK

54 Sliding Window Protocols Full Duplex Info and ACKs simultaneously Piggybacking-ACK on Data Frames -complications-ad hoc scheme Sequence numbers - maximum 2 n -1 Sending window - Number of frames allowed to send Receiving window - Number of frames allowed to accept

55 One bit Sliding Window (Stop-and-Wait) Link Layer A Link Layer B Info and piggybacked ACKs One process as initiator else duplication(See Fig 3-14b)

56 A sends (0,1,A0) A gets (0,0,B0) * A sends (1,0,A1) A gets (1,1,B1) * A sends (0,1,A2) A gets (0,0,B2) * A sends (1,0,A3) B gets (0,1,A0) B sends (0,0,B0) B gets (1,0,A1) * B sends (1,1,B1) B gets (0,1,A2) * B sends (0,0,B2) B gets (1,0,A3) * B sends (1,1,B3) ( Seq, ACK,Pkt #) Time A in Lead

57 A sends (0,1,A0) A gets (0,1,B0) * A sends (0,0,A0) A gets (0,0,B0) A sends (1,0,A1) A gets (1,0,B1) * A sends (1,1,A1) B sends (0,1,B0) B gets (0,1,A0) * B sends (0,0,B0) B gets (0,0,A0) B sends (1,0,B1) B gets (1,0,A1) B sends (1,1,B1) B gets (1,1,A1) B sends (0,1,B2) Time No leader ( Seq, ACK,Pkt #)

58 Low throughput one bit window Line Flow Frame Transmission Timeout interval Message Transmission Throughput(Line Utilization) F T  F/(F+T) Example: 50 kbps satellite channel, 1000 bit frame, Round trip delay 520 msec. F=20 msec 

59 Window = w > 1 Pipelining 1 2 3 4 5 6 7 8 Eg: w = 4 Transmit 1 2 3 4 5 6 7 8 Receive ACKs Can be all at once ACK last in batch

60 Error control Go-back-n 1 2 3 4 5 2 3 4 5 Transmit 1 2 3 4 5 2 3 4 5 Receive Frame in error Ignored Timeout or NACK

61 A subtlety in sequence numbering Sequence numbers-0,1,…,MAX_SEQ Up to MAX_SEQ frames can be outstanding not MAX_SEQ+1 Example: w=4, MAX_SEQ=3 Frames 0, 1, 2, 3 received correctly but ACKs lost Frames 0, 1, 2, 3 retransmitted receiver thinks they are new Remedy: MAX_SEQ=3, w=3, receiver waiting for 3 in above scenario

62 Selective repeat 1 2 3 4 5 2 6 7 Transmit 1 2 3 4 5 2 6 7 Receive Frame in error Stored Timeout or NACK ACK NACK Careful of repeats

63 A sends frames 0 1 2 3 4 5 6 A times out and resends frames 0 1 2 3 4 5 6 A sends frames 7 0 1 2 3 4 5 Window at B 0 1 2 3 4 5 6 B gets 0 1 2 3 4 5 6 without error B sends ACK and Advances window to 7 0 1 2 3 4 5 (empty buffers) B gets 0 1 2 3 4 5 6 without error B sends ACK for 0 1 2 3 4 5 6 Bad packets sent to network level ( Seq, ACK,Pkt #) ACKs destroyed Problem with SR

64 A sends frames 0 1 2 3 A times out and resends frames 0 1 2 3 Window at B 0 1 2 3 B gets 0 1 2 3 without error B sends ACK for Advances window to 4 5 6 7 (empty buffers) B gets 0 1 2 3 without error B sends ACK ( Seq, ACK,Pkt #) ACKs destroyed Remedy: New window has no overlap with original window i.e window half of max sequence number Number of buffers=window size Timer for each buffer Auxiliary timer

65 Efficiency Comparisions F=Frame transmission time RT=Roundtrip delay(propagation, processing) w=Window size (sec) > RT (simplification) P F =Probability frame error detected= 1-(1-P B ) F =1-(1-F P B )= F P B for P B <<1 T Saw, T GBn, T SR Total frame transmission times  =F/ Total frame transmission time

66 Stop and Wait 1 2 2 2 3 4 Transmit 1 2 2 2 3 4 Receive Frame in error RT T saw =(F+RT)/(1- P F )  = (1- P F )/(1+RT/F)

67 Go-back-n 1 2 3 4 5 6 7 8 9 10 2 3 4 5 Transmit 1 2 3 4 5 6 7 8 9 10 2 3 4 5 Receive RT T GBn =F /(1- P F )+RT P F /(1- P F )  = (1- P F )/(1+ P F RT/F)

68 Selective Repeat 1 2 3 4 5 6 7 8 9 10 2 111213 Receive RT T SR = F /(1- P F )  = 1- P F

69 T saw =(F+RT)/(1- P F )  = (1- P F )/(1+RT/F) T GBn =F /(1- P F )+RT P F /(1- P F )  = (1- P F )/(1+ P F RT/F) T SR = F /(1- P F )  = 1- P F Stop and Wait Go-Back-n Selective Repeat

70 Efficiency Normalized round trip SAW P F =.1 SAW P F =.01 SR P F =.1 SR P F =.01 GBn P F =.1 GBn P F =.01

71 Homework problems #1 Calculate the efficiency of all three protocols for the following set of parameters: 1) Frame length = 1000 bits 2) Line rate = 1.544 Mbps 3) Line length = 1000 km 4) Bit error probability=10 -4 5) Assume window larger than RT 6) Assume propagation of 6  sec/km #12, #15,#20, #24,#25

72 Finite State Machine Models of Protocols S = Set of possible channel and process states M = Set of frames on channel I = Set of initial states T = Set of transitions between states Reachability analysis Deadlock state –No transition out of state –No forward progress possible SDL - Specification Description Protocol

73 Example: Send-and-Wait Protocol Two sender states, 0,1 Two receiver states, 0,1 Four Channel states –0 Frame in transit –1 Frame in transit –A Ack in transit –Channel empty

74 0 0 - 0 0 0 1 0 - 1 0 1 0 1 00 1 - 1 0A 1 1 - 1 1 1 0 1 A 0 7 0 7 1 0 5 4 2 0 3 6 8 0 8 0 Transition Who runs? Frame accepted Frame emitted To network layer 0 (Frame lost) 1 R 0 A Yes 2 S A 1 - 3 R 1 A Yes 4 S A 0 - 5 R 0 A No 6 R 1 A No 7 S (timeout) 0 - 8 S (timeout) 1 - Stop and Wait Protocol (Sender, Receiver, Channel) Normal operation

75 Flag Data CKSMAddresses Control Bit oriented protocols SDLC, HDLC, ADCCP, LAP, LAP Addresses - Multiple terminals lines Control - Sequence number, ACKs, etc (See next slide.) Data - Transparency to User CKSM - CRC Codes

76 Types of Frames Differences in Control Fields Information 0 Sequence P/F Next Control Field Piggybacked ACK Type indicator 3 bit number Poll/Final Supervisory 1 0 Type P/F Next Control Field 0 -ACK, 1 - NACK, 2 - Receive not ready 3 - Selective reject Unnumbered - Control and Data (sometimes) - depends on particular protocol

77 Control Functions DISC(disconnect)-Machine going down SNRM(Set Normal Response Mode)- Machine coming back on unbalanced SABM(Set Asynchronous Balanced Mode) FRMR(Frame Reject)-Frame looks funny UA(Unnumbered Acknowledgement)-ACK for control frames Miscellaneous - Initialization, polling, status reports

78 LAN The Internet Router Subnet Hosts Leased Lines

79 MODEM ROUTER Dial-up Telephone Line TCP/IP Connection Using SLIP of PPP Access

80 PPP Point-to-Point Protocol Framing similar to HDLC-Frame delineation, error detection LCP(Link Control Protocol)-line bringing up,testing, setting options, putting down NPC(Network Control Protocol)- Negotiating network layer options

81 PPP Frame Similar to HDLC but Character Oriented Flag Payload CKSM Addresses ControlFlag Protocol Character stuffing to make frame integral number of bytes Flag - 01111110 Address - 11111111 all stations accept the frame Control - 00000011 default, sequence number on unreliable lines Address and control field can be omitted by negotiation Protocol-Kind of packet in payload field Payload variable up to some maximum Checksum-2 bytes with 4 bytes optional

82 DeadNetwork Establish Authenticate Open Terminate Failed Carrier Detected Both sides agree on options Successful authentication NCP configuration Done Carrier Dropped

83 ATM(Asynchronous Transfer Mode) 5 octets 48 octets Cell Header User Data Upper layers Plane management Layer management Control planeUser Plane ATM Adaptation layer ATM layer Physical layer PMD- Physical medium dependent TC - Transmission convergence cells bits

84 5 octets 48 octets Cell Header User Data No error control HEC - Checksum over header using generator polynomial Control bytes

85 Non-Data Cells in ATM Idle cells in synchronous media OAM (Operations and Maintenance) –First three header bytes all zeros –Exchanges between switches –Speed matching in SONET –Framing function

86 Cell Reception Cell delineation HUNT PRESYNCH SYNC Bit-by-bit check Cell-by-cell check Correct HEC detected Incorrect HEC detected  Consecutive correct HECs Consecutive incorrect HECs Probability of random “correct” pattern = 2 -8 Probability of  random “correct” patterns = 2 -8 


Download ppt "Data Link Level Design Issues Services provided to Network Layer Framing Error control Flow control."

Similar presentations


Ads by Google