Presentation is loading. Please wait.

Presentation is loading. Please wait.

CE 4228 Data Communications and Networking

Similar presentations


Presentation on theme: "CE 4228 Data Communications and Networking"— Presentation transcript:

1 CE 4228 Data Communications and Networking
Data Link Control

2 Data Link Control – Outline
Transmission timing Flow control Channel coding Error control HDLC

3 Interface

4 Interface DTE DCE DCE communicates data and control info with DTE
Data terminal equipment or data processing devices Do not usually include data transmission facilities Need another interface DCE Data circuit terminating equipment Modem, NIC Transmit bits on medium DCE communicates data and control info with DTE Done over interchange circuits with interface standards

5 Interface – Characteristics
Mechanical Connection plugs Electrical Voltage, timing, encoding Functional Data, control, timing, grounding Procedural Sequence of events

6 Digital Transmission Timing
Timing problems require a mechanism to synchronize the transmitter and receiver Two solutions Asynchronous Synchronous

7 Asynchronous Data transmitted one character at a time
5 to 8 bits Timing only within each character Re-synchronized with each character

8 Asynchronous – Diagram

9 Asynchronous – Behavior
In a steady stream, interval between characters or length of stop element is uniform In idle state, receiver looks for transition 1 to 0 Next seven intervals, the length of a character, are read Then look for next 1 to 0 for next character Simple, cheap Overhead of 2 or 3 bits per character, roughly 20% Good for data with large gaps such as keyboard

10 Synchronous – Bit Level
Block of data transmitted without start/stop bits Clocks must be synchronized Can use separate clock line Good over short distances Subject to impairments Embed clock signal in data Manchester encoding Carrier frequency for analog transmission

11 Synchronous – Block Level
Need to indicate start and end of block Use preamble and postamble Bit patterns to indicate start and end More efficient than asynchronous Lower overhead

12 Synchronous – Diagram

13 Frame Transmission

14 Flow Control Ensuring the sending entity does not overwhelm the receiving entity Preventing buffer overflow Transmission time Time taken to emit all bits into medium Propagation time Time for a bit to traverse the link Stop-and-wait Sliding window

15 Stop-and-Wait Source transmits frame
Destination receives frame and replies with acknowledgement Source waits for ACK before sending next frame Destination can stop flow by not send ACK Work well for a few large frames May be necessary for a low quality link High error/loss rate

16 Stop-and-Wait – Fragmentation
Large block of data may be split into small frames Limited buffer size Errors detected sooner when whole frame received On error, retransmission of smaller frames is needed Prevent one station occupying medium for long periods Stop-and-wait becomes inadequate for multiple smaller frames per message in a high quality link, such as LAN

17 Stop-and-Wait – Analysis
T = Tt + Tp + Tr + Tt(ACK) + Tp(ACK) + Ts T = time between two data frame transmissions Tt = transmission time of data frame = N/R Tp = propagation time of data frame = L/c0 Tr = receiving node processing time Tt(ACK) = transmission time of ACK = N(ACK)/R Tp(ACK) = propagation time of ACK = Tp Ts = sending node processing time

18 Stop-and-Wait – Efficiency
Efficiency  = Tt/T = Tt/(Tt + 2Tp) = 1/(1+2a) T  Tt + 2Tp when N(ACK) << N, Tr + Ts << Tp a = propagation time/transmission time = (L/c0)/(N/R) A long link, a small frame size, or a high link speed will yield a low efficiency a

19 Stop-and-Wait – Example
Suppose R = 10 Mbps L = 2000 meters c0 = 2  108 m/s N = bits N(ACK) = 400 bits Tr = Ts = 2 sec T  Tt + Tt(ACK) + 2Tp msec T  1.06 msec Efficiency  = 1/1.06  94.3% If N =1000 bits  = 0.1/0.16  62.5% If R = 100 Mbps  = 0.1/0.128  78.1% If R = 1 Gbps  = 0.01/0.034  29.1%

20 Stop-and-Wait – Link Utilization

21 Sliding Window Flow Control
Allow multiple frames to be in transit Receiver has buffer of size W Transmitter can send up to W frames without ACK Each frame is numbered ACK includes number of next frame expected Sequence number bounded by field of size k Frames are numbered modulo 2k

22 Sliding Window – Diagram

23 Sliding Window – Example

24 Sliding Window – Enhancements
RNR Receive not ready Receiver can acknowledge frames without permitting further transmission Must send a normal acknowledge to resume If duplex, use piggybacking If no data to send, use acknowledgement frame If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag as in TCP

25 Sliding Window – Analysis
Efficiency depends on Window size W The value of a T = 1 + 2a Two cases Case I W ≥ 1 + 2a   1 Case II W < 1 + 2a  = W/(1 + 2a)

26 Sliding Window – W ≥ 1 + 2a

27 Sliding Window – W < 1 + 2a

28 Sliding Window – Efficiency

29 Errors An error occurs when a bit is altered between transmission and reception Caused by thermal noise, electromagnetic interference, loss of synchronization, etc. Impossible to guarantee that any single bit will be received correctly, no matter what communication equipment used

30 Errors – Single Bit Errors
One bit altered Adjacent bits not affected White noise

31 Errors – Burst Errors Contiguous sequence of B bits in which first last and any number of intermediate bits in error Impulse noise, or fading in wireless Effect greater at higher data rates

32 Channel Coding BER is a performance metric of a digital communication system Channel coding Coding for channel error reduction A process by which redundant digits are inserted into the source data in such a fashion that the transmitted data exhibit certain patterns which can be used by the receiver to do error detection or error correction Block coding Convolution coding

33 Error Detection Additional bits added by transmitter for error detection code Parity Value of parity bit is such that character has even or odd number of ones Even parity or odd parity Even number of bit errors goes undetected

34 Error Detection – Process

35 Error Detection – Parity

36 Error Detection – CRC Cyclic redundancy check
Cyclical shifting of a valid code produces another valid code For a block of k-bit data, transmitter generates n-bit codeword Exactly divisible by some number Receiver divides frame by that number If no remainder, assume no error Capable of detecting various error patterns including most error bursts

37 Error Detection – CRC Example

38 Error Detection – CRC Process

39 Error Detection – CRC Division

40 Error Detection – CRC Division

41 Error Detection – CRC Hardware
Shift register

42 Error Detection – CRC Hardware

43 Error Detection – CRC Polynomial
Bit pattern can be represented as a polynomial

44 Error Detection – CRC Polynomial
Bit pattern can be represented as a polynomial Simpler analysis

45 Error Detection – CRC Standard
Parity bit CRC-16 16 bits per data frame x16 + x12 + x5 + 1 Also called CRC-CCITT, used in HDLC FCS, Bluetooth CRC-32 32 bits per data frame x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 +x4 + x2 + x + 1 IEEE MAC frame

46 Error – Treatment Correction of detected errors usually requires data block to be retransmitted Not appropriate for wireless applications Bit error rate is high Lots of retransmissions Propagation delay can be long compared with frame transmission time Satellite Would result in retransmission of frame in error plus many subsequent frames Need to correct errors on basis of bits received

47 Error Correction Each k bit block mapped to an n bit block, n>k
Forward error correction encoder Codeword sent Received bit string may contain errors Received code word passed to FEC decoder If no errors, original data block output Some error patterns can be detected and corrected Some error patterns can be detected but not corrected Some rare error patterns are not detected Result in incorrect data output from FEC

48 Error Correction – Process

49 Error Correction – Operation
Add redundancy to transmitted message Can deduce original in face of certain level of error rate Block error correction code In general, add n−k bits to end of block Gives n bit block, called codeword All of original k bits included in codeword Some FEC map k bit input onto n bit codeword such that original k bits do not appear

50 Error Correction – Hamming Code
2n−k = n +1 Single bit error 0100 1101 0110 1111 Error at 2 Error at 1,2, or 3 0100 1101 0110 Error at 1,2, or 4 1111 No error at 1,3, and 4

51 Error Correction – Hamming Code

52 Error Correction – Hamming Code
Burst error correction by interleaving

53 Channel Coding – Performance
Redundant digit insertion leads to either increased bit rate and bandwidth requirement or reduced information rate for fixed bandwidth Percentage of errors that can be detected or corrected represents the performance of a channel code In general, channel coding results in a drastically reduced BER Trade-off between bandwidth and BER

54 Channel Coding – Performance

55 Channel Coding Theorem
Shannon’s 2nd theorem For R  C, there exists a channel coding scheme such that the information from the data source can be transmitted over the channel with an arbitrarily small error rate despite the presence of noise Channel capacity C bps Data source with information rate R bps If R > C, this cannot be true

56 Channel Coding Theorem
No matter how small the BER is specified, a channel code can be designed to beat it With codec complexity and delay as tradeoff Reliable communication concept It guarantees the existence of an elegant coding method which supports the benefit of channel coding It does not offer a means of constructing it

57 Error Control Detection and correction of errors Lost frames
Damaged frames Automatic repeat request Error detection Positive acknowledgment Retransmission after timeout Negative acknowledgement and retransmission

58 ARQ Automatic repeat request Stop-and-wait Go-back-N Selective reject

59 Stop-and-Wait Source transmits single frame Wait for ACK
If received frame damaged, discard it Transmitter has timeout If no ACK within timeout, retransmit If ACK damaged, transmitter will not recognize it Transmitter will retransmit Receiver gets two copies of the same frame Use ACK0 and ACK1

60 Stop-and-Wait Simple Inefficient

61 Stop-and-Wait – Analysis
Stop-and-wait flow control Not account for retransmissions that due to errors q = probability of retransmission of erroneous frame nr = average number of transmissions for each successful frame nr = 1×(1−q) + 2×q(1−q) + 3×q2(1−q) + … nr = 1/(1−q)   1/[nr(1+2a)] = (1−q)/(1+2a) With retransmissions

62 Go-Back-N Based on sliding window
If no error, ACK as usual with next frame expected Use window to control number of outstanding frames If error, reply with rejection Discard that frame and all future frames until error frame received correctly Transmitter must go back and retransmit that frame and all subsequent frames

63 Go-Back-N – Damaged Frame
Receiver detects error in frame i Receiver sends rejection-i Transmitter gets rejection-i Transmitter retransmits frame i and all subsequent

64 Go-Back-N – Lost Frame Frame i lost Transmitter sends i+1
Receiver gets frame i+1 out of sequence Receiver sends rejection-i Transmitter goes back to frame i and retransmits

65 Go-Back-N – Lost Last Frame
Frame i lost and no additional frame sent Receiver gets nothing and returns neither acknowledgement nor rejection Transmitter times out and sends acknowledgement frame with P bit set to 1 Receiver interprets this as command which it acknowledges with the number of the next frame it expects, which is frame i Transmitter then retransmits frame i Same scenario as in case of damaged rejection

66 Go-Back-N – Damaged ACK
Receiver gets frame i and send acknowledgement i+1 which is lost Acknowledgements are cumulative, so next acknowledgement i+n may arrive before transmitter times out on frame i If transmitter times out, it sends acknowledgement with P bit set as before This can be repeated a number of times before a reset procedure is initiated

67 Go-Back-N

68 Go-Back-N – Analysis p(k) = qk−1(1−q)
Probability that a frame takes k transmissions to succeed q = probability of retransmission nr = average number of transmissions for each successful frame An erroneous frame causes N retransmissions N  1 + 2a provided that W  1 + 2a W = window size At least this many frames have been transmitted when the ACK of the 1st of these frames is supposed to arrive

69 Go-Back-N – Analysis   1/nr  (1−q)/(1+2aq)
  (1−q)/(1+2a) in case of stop-and-wait Benefit of go-back-N decreases when q increases

70 Selective Reject Also called selective retransmission
Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimize retransmission Receiver must maintain large enough buffer More complex login in transmitter

71 ARQ – Efficiency

72 HDLC High-level Data Link Control Bit-oriented protocol Widely used
ISO 33009, ISO 4335 Bit-oriented protocol Widely used Basis for many other important data link control protocols Similar formats Similar mechanisms LAPB, LAPD, LAPF

73 HDLC – Station Types Primary station Secondary station
Control operation of link Frames issued are called commands Maintain separate logical link to each secondary station Secondary station Under control of primary station Frames issued called responses Combined station May issue commands and responses

74 HDLC – Link Configurations
Unbalanced One primary and one or more secondary stations Support full duplex and half duplex Balanced Two combined stations

75 HDLC – Transfer Modes NRM Normal response mode
Unbalanced configuration Primary initiates transfer to secondary Secondary may only transmit data in response to command from primary Used on multi-drop lines Host computer as primary Terminals as secondary

76 HDLC – Transfer Modes ABM ARM Asynchronous balanced mode
Balanced configuration Either station may initiate transmission without receiving permission No polling overhead Most widely used ARM Asynchronous response mode Unbalanced configuration Secondary may initiate transmission without permission form primary Primary responsible for line Rarely used

77 HDLC – Frame Structure Synchronous transmission
All transmissions in frames Single frame format for all data and control exchanges

78 HDLC – Flag Field 01111110 Delimit frame at both ends
May close one frame and open another Receiver hunts for flag sequence to synchronize

79 HDLC – Bit Stuffing Used to avoid confusion with data containing 0 inserted after every sequence of five 1s If receiver detects five 1s it checks next bit If 0, it is deleted If 1 and seventh bit is 0, accept as flag If sixth and seventh bits 1, sender is indicating abort

80 HDLC – Bit Stuffing Error

81 HDLC – Address Field Identify secondary station that sent or will receive frame Usually 8 bits long May be extended to multiples of 7 bits LSB of each octet indicates that it is the last octet or not by 1 or 0 All ones, , is broadcast

82 HDLC – Control Field Different for different frame type
Information Data to be transmitted to user Flow and error control piggybacked on information frames Supervisory ARQ when piggyback not used Unnumbered Supplementary link control First one or two bits of control filed identify frame type

83 HDLC – Control Field

84 HDLC – Poll/Final Bit Depend on context Command frame Response frame
P bit 1 to solicit, or poll, response from peer Response frame F bit 1 indicates response to soliciting command

85 HDLC – Information Field
Only in information and some unnumbered frames Must contain integral number of octets Variable length

86 HDLC – FCS Field Frame check sequence Error detection 16-bit CRC
Optional 32-bit CRC

87 HDLC – Operation Exchange of information, supervisory and unnumbered frames Three phases Initialization Data transfer Disconnect

88 HDLC – Operation

89 HDLC – Operation

90 PPP Point-to-point protocol Used in Internet Dial-up modem
Router to router Dial-up modem Home to ISP Byte oriented Byte stuffing

91 Data Link Control – Conclusion
Several procedures needed to ensure the data integrity Additional bits inserted Different techniques for different kinds of transmissions Tasks can be divided


Download ppt "CE 4228 Data Communications and Networking"

Similar presentations


Ads by Google