Chapter Six Errors Error Detection and Error Control

  • Slides: 52
Download presentation
Chapter Six - Errors, Error Detection, and Error Control 1

Chapter Six - Errors, Error Detection, and Error Control 1

Chapter Six - Errors, Error Detection, and Error Control Introduction Noise is always present.

Chapter Six - Errors, Error Detection, and Error Control Introduction Noise is always present. If a communications line experiences too much noise, the signal will be lost or corrupted. Communication systems should check for transmission errors. Once an error is detected, a system may perform some action. Some systems perform no error control, but simply let the data in error be discarded. 2

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors – White

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors – White Noise • Also known as thermal or Gaussian noise • is much like the static you hear when a radio is being tuned between two stations. • is dependent on the temperature of the medium. As the temperature increases, the level of noise increases due to the increased activity of the electrons in the medium. • Because white noise is relatively continuous, it can be reduced significantly but never completely eliminated. • White noise is the type of interference that makes an analog or digital signal become fuzzy (Figure 6 -1). • Relatively constant and can be reduced. • If white noise gets to strong, it can completely disrupt the signal. 3

Chapter Six - Errors, Error Detection, and Error Control 4

Chapter Six - Errors, Error Detection, and Error Control 4

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors – Impulse

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors – Impulse Noise is a non continuous noise, is an analog burst of energy. One of the most disruptive forms of noise. Random spikes of power that can destroy one or more bits of information. Difficult to remove from an analog signal because it may be hard to distinguish from the original signal. Impulse noise can damage more bits if the bits are closer together (transmitted at a faster rate). 5

Chapter Six - Errors, Error Detection, and Error Control 6

Chapter Six - Errors, Error Detection, and Error Control 6

Chapter Six - Errors, Error Detection, and Error Control 7

Chapter Six - Errors, Error Detection, and Error Control 7

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors - Crosstalk

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors - Crosstalk Unwanted coupling between two different signal paths. For example, hearing another conversation while talking on the telephone. Relatively constant and can be reduced with proper measures. 8

Chapter Six - Errors, Error Detection, and Error Control 9

Chapter Six - Errors, Error Detection, and Error Control 9

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors - Echo

Chapter Six - Errors, Error Detection, and Error Control Noise and Errors - Echo The reflective feedback of a transmitted signal as the signal moves through a medium. Most often occurs on coaxial cable. If echo bad enough, it could interfere with original signal. Relatively constant, and can be significantly reduced. 10

Chapter Six - Errors, Error Detection, and Error Control 11

Chapter Six - Errors, Error Detection, and Error Control 11

Chapter Six - Errors, Error Detection, and Error Control Jitter: • the rises and

Chapter Six - Errors, Error Detection, and Error Control Jitter: • the rises and falls of the signal can start to shift, or become blurry, and thus produce jitter. • If jitter becomes too great, correcting it can require the transmitting devices to slow down their transmission rates, which in turn limits overall system performance. • Causes of jitter can include electromagnetic interference, crosstalk, passing the signal through too many repeaters, and the use of lower-quality equipment. 12

Chapter Six - Errors, Error Detection, and Error Control 13

Chapter Six - Errors, Error Detection, and Error Control 13

Chapter Six - Errors, Error Detection, and Error Control Attenuation: • is the continuous

Chapter Six - Errors, Error Detection, and Error Control Attenuation: • is the continuous loss of a signal's strength as it travels though a medium. • can be eliminated with the use of amplifiers for analog systems or repeaters for digital systems. 14

Chapter Six - Errors, Error Detection, and Error Control Error Prevention To prevent errors

Chapter Six - Errors, Error Detection, and Error Control Error Prevention To prevent errors from happening, several techniques may be applied: - Proper shielding of cables to reduce interference - Telephone line conditioning or equalization - Replacing older media and equipment with new, possibly digital components - Proper use of digital repeaters and analog amplifiers - Observe the stated capacities of the media 15

Chapter Six - Errors, Error Detection, and Error Control 16

Chapter Six - Errors, Error Detection, and Error Control 16

Chapter Six - Errors, Error Detection, and Error Control Error Detection Despite the best

Chapter Six - Errors, Error Detection, and Error Control Error Detection Despite the best prevention techniques, errors may still happen. To detect an error, something extra has to be added to the data/signal. This extra is an error detection code. Let’s examine two basic techniques for detecting errors: parity checking, and cyclic redundancy checksum. 17

Chapter Six - Errors, Error Detection, and Error Control Parity Checks Simple parity -

Chapter Six - Errors, Error Detection, and Error Control Parity Checks Simple parity - If performing even parity, add a parity bit such that an even number of 1 s are maintained. If performing odd parity, add a parity bit such that an odd number of 1 s are maintained. For example, send 1001010 using even parity For example, send 1001011 using even parity 18

Chapter Six - Errors, Error Detection, and Error Control Parity Checks What happens if

Chapter Six - Errors, Error Detection, and Error Control Parity Checks What happens if the character 10010101 is sent and the first two 0 s accidentally become two 1 s? Thus, the following character is received: 11110101. Will there be a parity error? Problem: Simple parity only detects odd numbers of bits in error. 19

Chapter Six - Errors, Error Detection, and Error Control Parity Checks Longitudinal parity adds

Chapter Six - Errors, Error Detection, and Error Control Parity Checks Longitudinal parity adds a parity bit to each character then adds a row of parity bits after a block of characters. The row of parity bits is actually a parity bit for each “column” of characters. The row parity bits plus the column parity bits add a great amount of redundancy to a block of characters. 20

Chapter Six - Errors, Error Detection, and Error Control 21

Chapter Six - Errors, Error Detection, and Error Control 21

Chapter Six - Errors, Error Detection, and Error Control 22

Chapter Six - Errors, Error Detection, and Error Control 22

Chapter Six - Errors, Error Detection, and Error Control Parity Checks Both simple parity

Chapter Six - Errors, Error Detection, and Error Control Parity Checks Both simple parity and longitudinal parity do not catch all errors. Simple parity only catches odd numbers of bit errors. Longitudinal parity is better at catching errors but requires too many check bits added to a block of data. We need a better error detection method. What about cyclic redundancy checksum? 23

Chapter Six - Errors, Error Detection, and Error Control Arithmetic Checksum: • Used by

Chapter Six - Errors, Error Detection, and Error Control Arithmetic Checksum: • Used by Many higher-level protocols used on the Internet (such as TCPand IP) • characters to be transmitted are "summed" together. • This sum is then added to the end of the message and the message is transmitted to the receiving end. • The receiver accepts the transmitted message and performs the same summing operation and essentially compares its sum with the sum that was generated by the transmitter. • If the two sums agree, then no error occurred during the transmission. If the two sums do not agree, the receiver informs the transmitter that an error has occurred. 24

Chapter Six - Errors, Error Detection, and Error Control • Suppose we want to

Chapter Six - Errors, Error Detection, and Error Control • Suppose we want to transmit the message "This is cool. " In ASCII , • that message would appear in binary as: 10101001 101000 1101001 1110011 0100000 1100011 1101111 1101100 0101110. • The first binary value - 1010100 - is the value 84 in decimal. 1101000 equals 104. The next binary value 1101001 equals 105; 1110011 equals 115; 0100000 equals 32; 1100011 equals 99; 1101111 equals 111; 1101111 again is 111; 1101100 equals 108; and 0101110 equals 46 • TCPand IP actually add these values in binary to create a binary sum. 25

Chapter Six - Errors, Error Detection, and Error Control • The sum 1056 is

Chapter Six - Errors, Error Detection, and Error Control • The sum 1056 is then added to the outgoing message and sent to the receiver. • The receiver will take the same characters, add their ASCII values, and if there were • no errors during transmission, should get the same sum of 1056. 26

Chapter Six - Errors, Error Detection, and Error Control Cyclic Redundancy Checksum The CRC

Chapter Six - Errors, Error Detection, and Error Control Cyclic Redundancy Checksum The CRC error detection method treats the packet of data to be transmitted as a large polynomial. ex: The transmitter takes the message polynomial and using polynomial arithmetic, divides it by a given generating polynomial. The quotient is discarded but the remainder is “attached” to 27

Chapter Six - Errors, Error Detection, and Error Control Cyclic Redundancy Checksum 28

Chapter Six - Errors, Error Detection, and Error Control Cyclic Redundancy Checksum 28

Chapter Six - Errors, Error Detection, and Error Control Cyclic Redundancy Checksum The message

Chapter Six - Errors, Error Detection, and Error Control Cyclic Redundancy Checksum The message (with the remainder) is transmitted to the receiver. The receiver divides the message and remainder by the same generating polynomial. If a remainder not equal to zero results, there was an error during transmission. If a remainder of zero results, there was no error during transmission. 29

Chapter Six - Errors, Error Detection, and Error Control 30

Chapter Six - Errors, Error Detection, and Error Control 30

Chapter Six - Errors, Error Detection, and Error Control 31

Chapter Six - Errors, Error Detection, and Error Control 31

Chapter Six - Errors, Error Detection, and Error Control Once an error is detected,

Chapter Six - Errors, Error Detection, and Error Control Once an error is detected, what is the receiver going to do? 1. Do nothing 2. Return an error message to the transmitter 3. Fix the error with no further help from the transmitter 32

Chapter Six - Errors, Error Detection, and Error Control - Do Nothing Seems like

Chapter Six - Errors, Error Detection, and Error Control - Do Nothing Seems like a strange way to control errors but some lower layer protocols such as frame relay perform this type of error control. For example, if frame relay detects an error, it simply tosses the frame. No message is returned. Frame relay assumes a higher protocol (such as TCP/IP) will detect the tossed frame and ask for retransmission 33

Chapter Six - Errors, Error Detection, and Error Control - Return an Error Message

Chapter Six - Errors, Error Detection, and Error Control - Return an Error Message Once an error is detected, an error message is returned to the transmitter Two basic forms: Stop-and-wait error control Sliding window error control 34

Chapter Six - Errors, Error Detection, and Error Control Stop-and-Wait Error Control Stop-and-wait is

Chapter Six - Errors, Error Detection, and Error Control Stop-and-Wait Error Control Stop-and-wait is the simplest of the error control protocols. A transmitter sends a frame then stops and waits for an acknowledgment. If a positive acknowledgment (ACK) is received, the next frame is sent. If a negative acknowledgment (NAK) is received, the same frame is transmitted again. 35

Chapter Six - Errors, Error Detection, and Error Control 36

Chapter Six - Errors, Error Detection, and Error Control 36

Chapter Six - Errors, Error Detection, and Error Control • A workstation (Station A)

Chapter Six - Errors, Error Detection, and Error Control • A workstation (Station A) transmits one packet of data to another workstation (Station B), then stops and waits for a reply from Station B. • Four things can happen at this point. • First, if the packet of data arrives without error, Station B responds with a positive acknowledgment, When Station A receives an ACK, it transmits the next data packet. • Second, if the data arrives with an error, Station B responds with a negative acknowledgment. If Station A receives a NAK, it resends the previous data packet. 37

Chapter Six - Errors, Error Detection, and Error Control • Third, a packet arrives

Chapter Six - Errors, Error Detection, and Error Control • Third, a packet arrives at Station B uncorrupted, Station B transmits an ACK, but the ACK is lost or corrupted. Because Station A must wait for acknowledgment, it will not be able to transmit any more packets. • After a certain amount of time (called a timeout), Station A resends the last packet. But now if this packet arrives uncorrupted at Station B, Station B will not know that it is the same packet as the last one received. To avoid this confusion, the packets are numbered 0, 1, and so on. • Fourth, Station A sends a packet, but the packet is lost. Since the packet did not arrive at Station B, Station B will not return an ACK. Because Station A does not receive an ACK, it will time 38 out and resend the previous packet.

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control These

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control These techniques assume that multiple frames are in transmission at one time A sliding window protocol allows the transmitter to send up to the window size frames before receiving any acknowledgments. When a receiver does acknowledge receipt, the returned ACK contains the number of the frame expected next. 39

Chapter Six - Errors, Error Detection, and Error Control • To follow the flow

Chapter Six - Errors, Error Detection, and Error Control • To follow the flow of data in a sliding window protocol with window size 7, packets are assigned numbers 0, I, 2, 3, 4, 5, 6, and 7. Once packet number 7 is transmitted, the number sequencing starts back over at 0. • Even though the packets are numbered 0 through 7, which corresponds to eight different packets, only seven data packets can be outstanding (unacknowledged) at one time. • So, two data packets of the same number can never be transmitted at the same time. 40

Chapter Six - Errors, Error Detection, and Error Control • Consider a scenario in

Chapter Six - Errors, Error Detection, and Error Control • Consider a scenario in which the sender transmits five packets and stops. • The receiver receives the five packets and acknowledges them. • Before the acknowledgment is received, the sender can send two more packets, because the window size is 7. • On receipt of the acknowledgment, the sender can send an additional five packets before it has to stop again. 41

Chapter Six - Errors, Error Detection, and Error Control acknowledgments always contain a value

Chapter Six - Errors, Error Detection, and Error Control acknowledgments always contain a value equal to the number of the next expected packet. 42

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control Older

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control Older sliding window protocols numbered each frame or packet that was transmitted More modern sliding window protocols number each byte within a frame Let’s look at an example in which the packets are numbered: 43

Chapter Six - Errors, Error Detection, and Error Control 44

Chapter Six - Errors, Error Detection, and Error Control 44

Chapter Six - Errors, Error Detection, and Error Control This example shows each byte

Chapter Six - Errors, Error Detection, and Error Control This example shows each byte numbered 45

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control Notice

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control Notice that an ACK is not always sent after each frame is received. It is more efficient to wait for a few received frames before returning an ACK. How long should you wait until you return an ACK? 46

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control Using

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control Using TCP/IP, there are some basic rules concerning ACKs Rule 1: If a receiver just received data and wants to send its own data, piggyback an ACK along with that data Rule 2: If a receiver has no data to return and has just ACKed the last packet, receiver waits 500 ms for another packet. If while waiting, another packet arrives, send the ACK immediately Rule 3: If a receiver has no data to return and has just ACKed the last packet, receiver waits 500 ms. No packet, send ACK 47

Chapter Six - Errors, Error Detection, and Error Control 48

Chapter Six - Errors, Error Detection, and Error Control 48

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control What

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control What happens when a packet is lost? As shown in the next slide, if a frame is lost, the following frame will be “out of sequence”. The receiver will hold the out of sequence bytes in a buffer and request the sender to retransmit the missing frame. 49

Chapter Six - Errors, Error Detection, and Error Control 50

Chapter Six - Errors, Error Detection, and Error Control 50

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control What

Chapter Six - Errors, Error Detection, and Error Control Sliding Window Error Control What happens when an ACK is lost? As shown in the next slide, if an ACK is lost, the sender will wait for the ACK to arrive and eventually time-out. When the time-out occurs, the sender will resend the last frame. 51

Chapter Six - Errors, Error Detection, and Error Control 52

Chapter Six - Errors, Error Detection, and Error Control 52