Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multimedie- och kommunikationssystem, lektion 6

Similar presentations


Presentation on theme: "Multimedie- och kommunikationssystem, lektion 6"— Presentation transcript:

1 Multimedie- och kommunikationssystem, lektion 6
Kap 6: Fort. digital transmission. Felhantering.

2 In a single-bit error, only one bit in the data unit has changed.
Note: In a single-bit error, only one bit in the data unit has changed.

3 Single-bit error

4 A burst error means that 2 or more bits in the data unit have changed.
Note: A burst error means that 2 or more bits in the data unit have changed.

5 Burst error of length 5

6 Note: Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destination.

7 Redundancy

8 Detection methods

9 Note: In parity check, a parity bit is added to every data unit so that the total number of 1s is even (or odd for odd-parity).

10 Example 1 Suppose the sender wants to send the word world. In ASCII (7-bit code) the five characters are coded as Even parity is used. The following shows the actual bits sent:

11 Example 3 Now suppose the word world in Example 1 is received by the receiver without being corrupted in transmission. The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4). The data are accepted. Now suppose the word world in Example 1 is corrupted during transmission. The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted, discards them, and asks for retransmission.

12 Note: Simple parity check can detect all single-bit errors. It can detect burst errors only if the total number of errors in each data unit is odd.

13 Note: In two-dimensional parity check, a block of bits is divided into rows and a redundant row of bits is added to the whole block.

14 10.6 Two-dimensional parity

15 Example 4 Suppose the following block is sent:
However, it is hit by a burst noise of length 8, and some bits are corrupted. When the receiver checks the parity bits, some of the bits do not follow the even-parity rule and the whole block is discarded.

16 CRC = Cyclic Redundency Check
CRC generator and checker CRC = Cyclic Redundency Check

17 ”Vanlig” division (Nämnare)
(Kvot) 0 3 5 Nominator (Täljare) 1 7 . 1 5 2 17 (Nämnare) Reminder (Rest) Haltande liknelse med CRC: Om vi subtraherar täljaren (17) med resten (2) vi ett tal som är jämnt delbart med nämnaren (5). Om mottagaren tar emot något som inte är delbart med 5 har sannolikt att bitfel uppstått.

18 Modulo 2 Arithmetic In modulo 2 arithmetic addition and substruction are identical to EXCLUSUVE OR (XOR) operation. Multiplication and division are the same as in base-2 arithmetic without carries in addition or borrows in substraction. 0 XOR 0 = 0 0 XOR 1 = 1 1 XOR 0 = 1 1 XOR 1 = 0 Examples: 1011 XOR 0101 = 1110 1001 XOR 1101 = 0100

19 10.8 Binary division in a CRC generator
The number of 0s is one less than the number of bits in G (divisor)

20 10.8 Binary division in a CRC generator
The first bit in the numerator is 1. Then the first bit in the quotient is 1. The first bit in the quotient is 1 and one times the divisor results in this Obtained by XOR-ing 1001 and 1101

21 10.8 Binary division in a CRC generator
Transmitted data:

22 10.9 Binary division in CRC checker

23 The transmitted data is 11010110111110
Another Example The transmitted data is

24 7th order polynomial 8 bit divisor
A polynomial representing a divisor 7th order polynomial 8 bit divisor

25 Polynomyal representation
Based upon discrete mathetematics, where bit strings are treated as polynomials. k bit divisor is represented as (k-1) degree polynomial with coefficients 0 and 1. Example: has 7 bits It can be represented as a polynomial of 6th degree 1·x6 + 0·x5 + 1·x4 +0·x3 + 1·x2 + 1·x1 + 0·x0 = x6 + x4 + x2 + x

26 Table 10.1 Standard polynomials
Name Polynomial Application CRC-8 x8 + x2 + x + 1 ATM header CRC-10 x10 + x9 + x5 + x4 + x 2 + 1 ATM AAL ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 LANs

27 Example 5 It is obvious that we cannot choose x (binary 10), x2 (binary 100), etc, because then the reminder is 0. We cannot chose a polynomial that is divisible by x, for example x2 + x (binary 110). However, we can choose x + 1 (binary 11) because it is not divisible by x, but is divisible by x + 1. We can also choose x2 + 1 (binary 101) because it is divisible by x + 1 (binary division).

28 The sender wants to send k bits message
How CRC Operates The sender wants to send k bits message The sender and the receiver must agree in advance on n+1 bit string called generator polynomial (divisor), G. G can be represented as n-degree polynomial n redundant bits are added to the k bits message. They are called CRC bits. Data bits to be sent CRC bits k bits n bits

29 How CRC Operates (Cont.)
The redundant bits are chosen in such a way that the resulting k+n bit string is exactly divisible (with a reminder=0) by G using modulo 2 arithmetic. The receiver divides the received data together with the CRC bits by G using modulo 2 arithmetic. If the reminder is 0, then the string is considered to be without errors If the reminder is not 0, the data unit is with errors and it is rejected

30 Example 6 The CRC-12 x12 + x11 + x3 + x + 1
which has a degree of 12, will detect all burst errors affecting an odd number of bits, will detect all burst errors with a length less than or equal to 12, and will detect, percent of the time, burst errors with a length of 12 or more.

31 Example 6.7: CRC

32

33 Note: The sender follows these steps:
The unit is divided into k sections, each of n bits. All sections are added using one’s complement to get the sum. The sum is complemented and becomes the checksum. The checksum is sent with the data.

34 20 bit data gives k=20/n=4 sections (rows).
Column: Carry from column 5 1 Example Carry from column 4 Carry from column 3 Carry from column 2 n=5 bit checksum. 20 bit data gives k=20/n=4 sections (rows). The addition starts in the last column. The bits are carried in the columns before. The 6th and 7th bit are added The sum is complemented Carry from column 1 Sum Checksum

35 Example 7 Suppose the following block of 16 bits is to be sent using a checksum of 8 bits. The numbers are added using one’s complement Sum Checksum The pattern sent is

36 Note: The receiver follows these steps:
The unit is divided into k sections, each of n bits. All sections are added using one’s complement to get the sum. The sum is complemented. If the result is zero, the data are accepted: otherwise, rejected.

37 Example 8 Now suppose the receiver receives the pattern sent in Example 7 and there is no error. When the receiver adds the three sections, it will get all 1s, which, after complementing, is all 0s and shows that there is no error. Sum Complement means that the pattern is OK.

38 Example 9 Now suppose there is a burst error of length 5 that affects 4 bits. When the receiver adds the three sections, it gets Partial Sum Carry Sum Complement the pattern is corrupted.

39 11.1 Flow and Error Control Flow Control (Flödesstyrning)
Error Control (Felhantering) Båda dessa funktioner hanteras av vissa datalänkprotokoll (lager 2), i LLC-sublagret, t.ex. vid trådlös kommunikation eller vid modem. End-to-end flödesstyrning och felkontroll hanteras av transportprotokollet TCP (lager 4).

40 Flow control Necessary when data is being sent faster than it can be processed by receiver to avoid that the receiver’s buffer is overwhelmed.

41 Felhantering med hjälp av felrättande koder
FEC = Forward Error Correction. Baseras på felrättande istället för felupptäckande koder. Kräver ingen backkanal. Två typer: Faltningskoder (convolutional codes). Ex:Vid Faltningskod med kodtakt (code rate) 1/3 infogas två redundanta bitar mellan varje bit i nyttomeddelandet. Dessa felrättande bitar beräknas kontinuerligt för varje inkommande bit i nyttomeddelandet. Blockkoder (block codes) Ex: I digital-TV-systemet används en s.k. Read Salomon-kod med beteckningen RS(204, 188, 8). Det innebär att nyttoinformationen delas upp i 188 byte stora block. För varje block beräknas en felrättande kod, som läggs till blocket så att blocket blir 204 byte. Redundanden är alltså 204 – 188 = 16 byte. Koden klarar 8 felaktiga byte.

42 Felhantering med hjälp av felupptäckande koder
Alternativ 1: Bortkastning av felaktiga paket. Alternativ 2: ARQ = Automatic Repeat reQuest = automatisk omsändning av paket vid bitfel, eller om paketet inte når fram. I fortsättning kommer vi med begreppet ”error control” eller ”felkontroll” att avse ARQ.

43 Protocols to be presented
Idle RQ = Stop-and-wait ARQ Sliding Window Flow Control Go-back-N ARQ Selective Repeat ARQ Sliding Window Protocols

44 The Idle RQ (Repeat Request) Protocol
The simplest protocol for error and flow control How the protocol operates: Source may not send a new frame until the receiver acknowledges previous one. The receiver sends only positive acknowledgements (ACK) to notify the sender that the frame was received. If the frame 0 was received, the ACK 1 is sent. In that way the sender is notified that the receiver is expecting frame 1. The ID of the frame is called a sequence number. 1 bit sequence numbers is sufficient. Sequence:

45 Figure 6.23 Idle RQ error control scheme: (a) error free;

46 (b) corrupted I-frame;

47 Figure 6.24 Idle RQ link utilization.

48 (c) corrupted ACK-frame.

49 ACK n = Acknowledgement. Expecting frame number n
Normal operation ACK n = Acknowledgement. Expecting frame number n

50 11.2 Stop-and-Wait ARQ, lost frame

51 Lost or Damaged Frame The sender starts a timer when it sends each frame If the ACK is not received before the timer expires, the sender resends the same frame again

52 11.3 Stop-and-Wait ARQ, lost ACK frame

53 Lost or damaged ACK Lost ACK causes duplicate frames A duplicate frame is recognized by the sequence number and is discarded The receiver sends the same ACK again

54 11.4 Stop-and-Wait ARQ, delayed ACK

55 Note: Numbered acknowledgments are needed if an acknowledgment is delayed and the next frame is lost.

56 Piggybacking Usually the communication is in both ways – this means that the sender is a receiver and the receiver is the sender, too. (both send and receive data) To save on the processing and bandwidth the short ACKs messages are not sent as separate frames. Instead, they may be included in the frames with data. This technique is called piggybacking

57 Example 6.8: Idle RQ

58 Figure 6.25 Effect of propagation delay as a function of data transmission rate; parts correspond to Example 6.8.

59

60

61

62

63 Example 6.9

64 Piggybacking

65 Efficiency of Stop-and-Wait
Very inefficient, having in mind that most of the time the sender is idle Example: 40 km copper cable, 10 Mbps rate, 1000 bit frame, Signal in copper propagates at 2 x 108 m/sec Transmission time is 1000/ (Takes 0.1 msec to transmit frame) Propagation time is 40000/ 2 x 108 (0.2 msec delay to begin arriving at the receiver) Total time is 0.3 msec. to get to the receiver ACK transmission time is approximately 0 (assuming the ACK is very short (length  0) 0.2 msec is the time for the ACK to arrive at the sender Total time is 0.5 msec before the sender can transmit again 0.5 ms for 0.1 msec frame or efficiency is 20%

66 Sliding-Window flow control
Several frames can be sent without acknowledgement being received N is the window size – the maximum number of frames that can be sent and not being acknowledged. The receiver must be able to buffer N frames. Sequence numbers are used to identify each frame. They are carried in the header. The number of different sequence numbers must be at least N+1. If the field for sequence numbers allows m bits, the number of different sequence number is 2m and the sequence numbers range from 0 to 2m-1. In that case the maximum window size is N = 2m-1.

67 Sender sliding window The sender window is the the set of frames that may be transmitted before an ACK. It slides when the sender has received an ACK and sent next frame.

68 11.7 Receiver sliding window
The receiver window is the the set of frames that may be accepted before the buffer is full. While the buffer is full, the receiver sends no ACK. The window of a stuffed receiver slides when the receiver has ”consumed” a frame and thus sent an ACK.

69 Stop-and-Wait vs. Sliding Window
Window size N=3. Sender Receiver Sender Receiver Frame 0 Transmission + propagation time for the packet Frame 0 propa-gation time Transmission time for the packet Frame 1 ACK 0 Frame 2 ACK 1 . Time Frame 1 Frame consump-tion delay ACK 2 Transmission + propagation time for the ACK ACK 3 ACK 1 Time Frame 0 ACK 0 Frame consumption delay . . Sequence numbers are 1 bit long (0 or 1) Sequence numbers from 0 to 2m-1. m-bit field for the seq. num.

70 Sender and Receiver Prospective
The window size is 7

71 Sliding Window Flow Control
5 6 7 1 2 3 4 F0 5 6 7 1 2 3 4 F1 5 6 7 1 2 3 4 5 6 7 1 2 3 4 ACK1 F2 5 6 7 1 2 3 4 5 6 7 1 2 3 4 ACK2 F3 5 6 7 1 2 3 4 5 6 7 1 2 3 4 ACK3 5 6 7 1 2 3 4 F4 5 6 7 1 2 3 4 ACK4 5 6 7 1 2 3 4 F5 5 6 7 1 2 3 4 ACK5 5 6 7 1 2 3 4 5 6 7 1 2 3 4 ACK6 5 6 7 1 2 3 4 5 6 7 1 2 3 4 N=6

72 ARQ with Sliding Window
Problems arise when some of the frames are discarded (errors or lost frames). Two strategies are developed to deal with this problem: Go-back-N strategy The reciever simply discards all frames after the damaged frame without sending acknowledgement. Selective repeat strategy The receiver keeps all the frames after the damaged frame. It sends negative acknowledgement (NACK) for the damaged frame. When the sender finaly notice that something is wrong it retransmits the bad frame. The two strategies are trade-offs between bandwidth and data-link buffer space.

73 Go-Back-N Strategy If a frame is lost, the lost frame and all the frames sent after it are sent again. Sending window of size N, receiving window of size 1. The sender has to buffer N frames Bandwidth is wasted.

74 11.9 Go-Back-N ARQ, normal operation

75 11.10 Go-Back-N ARQ, lost frame

76 11.11 Go-Back-N ARQ: sender window size

77 Selective Repeat Strategy
Only retransmit the frames that are in error Both sending and receiving window are of size N

78 11.13 Selective Repeat ARQ, lost frame

79 11.14 Selective Repeat ARQ, sender window size

80 Bandwidth – Delay Product
The product of the bit rate (bandwidth expressed as bits per seconds) and the propagation time gives the number of bits that can be on the channel and thus can give orientation about the window size When propagation time is high (for example in satellite channels), the window size need to be larger

81 Example 1 In a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link? Solution The bandwidth-delay product is 1  106  20  10-3 = 20,000 bits The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system sends only 1000 bits. We can say that the link utilization is only 1000/20,000, or 5%. For this reason, for a link with high bandwidth or long delay, use of Stop-and-Wait ARQ wastes the capacity of the link.

82 Example 2 What is the utilization percentage of the link in Example 1 if the link uses Go-Back-N ARQ with a 15-frame sequence? Solution The bandwidth-delay product is still 20,000. The system can send up to 15 frames or 15,000 bits during a round trip. This means the utilization is 15,000/20,000, or 75 percent. Of course, if there are damaged frames, the utilization percentage is much less because frames have to be resent.

83 High-level Data Link Control Protocol
HDLC is one of the first protocols that implements mechanisms of ARQ Supports half-duplex and full-duplex mode on point-to-point links Uses three types of frames: information (I-frames), supervisory (S-frames) and unnumbered (U-frames) Only I frames carry information, S frames carry transport control information and U frames are used for managing the link

84 HDLC Frame Structure Flag: 01111110, at start and end
Address Control FCS Information Flag: , at start and end Physical Address: secondary station (for multidrop configurations) Information: the data to be transmitted Frame check sequence (FCS): 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 (see p.220)

85 HDLC frame types

86 The Need for Bit Stuffing
The flags show the receiver the start and the end of frame There is a problem if the flag appears in the middle of the frame as a part of data The receiver will ”think” it is the end of frame A technique called “bit stuffing” is used to resolve this problem

87 The sender stuffs redundant 0s
Bit Stuffing The sender stuffs redundant 0s Every time it encounters five 1s in a row, it inserts a redundant 0 The redundant 0 tells the receiver that the sequence is not a flag The receiver removes all redundant 0s to restore the original frame Example: Bit stuff the following data: Redundant 0s

88 11.24 Bit stuffing and removal

89 Bit stuffing in HDLC

90 PPP (Point-to-Point Protocol)
Based upon HDLC Used for point-to-point access Common protocol used for connecting home users to the Internet (via dial-up, DSL or cable modem or leased line) Defines the negotiation for establishment of the link Defines the protocol carried on the network layer Includes authentication and a field about the type of network protocol carried within the frame

91 CRC bits are error control bits
PPP Frame Format Number of bytes in a field 1 1 1 1 or 2 variable 2 or 4 1 Flag Address Control Flag Protocol Payload CRC Physical Address field with all 1s indicate broadcasting, i.e. that all stations accept the frame Since the Address and Control fields are constant, the two parties can negotiate to omit them, thus saving 2 bytes Protocol field defines what is carried in the payload field (user data or other information) CRC bits are error control bits


Download ppt "Multimedie- och kommunikationssystem, lektion 6"

Similar presentations


Ads by Google