Chapter 4 discusses digital data communication systems, focusing on encoding techniques for digital and analog data, including various methods such as NRZ, Manchester, and differential encoding. It also covers data link control protocols, emphasizing the importance of flow control, error detection, and error control in ensuring effective communication. Additionally, the chapter explains the sliding-window flow control method and error detection processes, including parity checks and cyclic redundancy checks (CRC).
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views62 pages
4 Digital Data Communication
Chapter 4 discusses digital data communication systems, focusing on encoding techniques for digital and analog data, including various methods such as NRZ, Manchester, and differential encoding. It also covers data link control protocols, emphasizing the importance of flow control, error detection, and error control in ensuring effective communication. Additionally, the chapter explains the sliding-window flow control method and error detection processes, including parity checks and cyclic redundancy checks (CRC).
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62
Chapter 4
Digital data communication system
Encoding • Digital data, digital signals: The simplest form of digital encoding of digital data is to assign one voltage level to binary one and another to binary zero. More complex encoding schemes are used to improve performance, by altering the spectrum of the signal and providing synchronization capability. • Digital data, analog signal: A modem converts digital data to an analog signal so that it can be transmitted over an analog line. The basic techniques are amplitude shift keying (ASK), frequency shift keying (FSK), and phase shift keying (PSK).All involve altering one or more characteristics of a carrier frequency to represent binary data. • Analog data, digital signals: Analog data, such as voice and video, are often digitized to be able to use digital transmission facilities. The simplest technique is pulse code modulation (PCM), which involves sampling the analog data periodically and quantizing the samples. • Analog data, analog signals: Analog data are modulated by a carrier frequency to produce an analog signal in a different frequency band, which can be utilized on an analog transmission system. The basic techniques are amplitude modulation (AM), frequency modulation (FM), and phase modulation (PM). Encoding Encoding techniques • Nonreturn to Zero-Level (NRZ-L) • Nonreturn to Zero Inverted (NRZI) • Bipolar-AMI • Pseudoternary • Manchester • Differential Manchester Non-Return to Zero (NRZ) • The most common, and easiest, way to transmit digital signals is to use two different voltage levels for the two binary digits. • Codes that follow this strategy share the property that the voltage level is constant during a bit interval; there is no transition (no return to a zero voltage level). – For example, the absence of voltage can be used to represent binary 0, with a constant positive voltage used to represent binary 1.
• There are two types
– Non-return to zero –Level – Non-return to zero – Inverted Non-return to zero –Level • a negative voltage represents one binary value and a positive voltage represents the other. • In the example shown below – 0 is represented by positive voltage – 1 is represented by negative voltage NRZI (Nonreturn to Zero, invert on ones) • The data themselves are encoded as the presence or absence of a signal transition at the beginning of the bit time. – A transition (low to high or high to low) at the beginning of a bit time denotes a binary 1 for that bit time; – no transition indicates a binary 0. • NRZI is an example of differential encoding. What is differential encoding? • In differential encoding, the information to be transmitted is represented in terms of the changes between successive signal elements rather than the signal elements themselves. • The encoding of the current bit is determined as follows: – If the current bit is a binary 0, then the current bit is encoded with the same signal as the preceding bit; – if the current bit is a binary 1, then the current bit is encoded with a different signal than the preceding bit. Multilevel Binary • These codes use more than two signal levels. – bipolar-AMI (alternate mark inversion) – pseudoternary bipolar-AMI • A binary 0 is represented by no line signal, and a binary 1 is represented by a positive or negative pulse. • In the example below the binary 1 pulses must alternate in polarity and most recent preceding 1 bit has negative voltage pseudoternary • The binary 1 that is represented by the absence of a line signal • The binary 0 by alternating positive and negative pulses. • In the example below most recent preceding 0 bit has negative voltage Biphase • Manchester • Differential Manchester Manchester – There is a transition at the middle of each bit period. – The mid-bit transition serves as a clocking mechanism and also as data: • a low-to-high transition represents a 1, • high-to-low transition represents a 0. Differential Manchester • the mid-bit transition is used only to provide clocking. • In this encoding scheme – 0 is represented by the presence of a transition at the beginning of a bit period – 1 is represented by the absence of a transition at the beginning of a bit period. DATA LINK CONTROL PROTOCOLS • Because of the possibility of transmission errors, and because the receiver of data may need to regulate the rate at which data arrive, synchronization and interfacing techniques are insufficient by themselves. • It is necessary to impose a layer of control in each communicating device that provides functions such as flow control, error detection, and error control. • This layer of control is known as a data link control protocol. DATA LINK CONTROL PROTOCOLS(cont) • Requirements and objectives for effective data communication between two directly connected transmitting-receiving stations: – Flow control: The sending station must not send frames at a rate faster than the receiving station can absorb them. – Error control: Bit errors introduced by the transmission system should be corrected. – Addressing: On a shared link, such as a local area network (LAN), the identity of the two stations involved in a transmission must be specified. – Control and data on same link: It is usually not desirable to have a physically separate communications path for control information. – Link management: The initiation, maintenance, and termination of a sustained data exchange require a fair amount of coordination and cooperation among stations. FLOW CONTROL • Flow control is a technique for assuring that a transmitting entity does not overwhelm a receiving entity with data. • The receiving entity typically allocates a data buffer of some maximum length for a transfer. – When data are received, the receiver must do a certain amount of processing before passing the data to the higher-level software. In the absence of flow control, the receiver’s buffer may fill up and overflow while it is processing old data. Transmission and propagation Time • Transmission time – The time it takes for a station to emit all of the bits of a frame onto the medium is the; – This is proportional to the length of the frame. • The propagation time – time it takes for a bit to traverse the link between source and destination. Stop-and-Wait Flow Control • A source entity transmits a frame. • After the destination entity receives the frame, it indicates its willingness to accept another frame by sending back an acknowledgment to the frame just received. • The source must wait until it receives the acknowledgment before sending the next frame. • The destination can thus stop the flow of data simply by withholding acknowledgment . • This procedure works fine and, indeed, can hardly be improved upon when a message is sent in a few large frames. • But With the use of multiple frames for a single message, the stop-and-wait procedure may be inadequate Stop-and-Wait Flow Control(cont.) • However, it is often the case that a source will break up a large block of data into smaller blocks and transmit the data in many frames. This is done for the following reasons: – The buffer size of the receiver may be limited. – The longer the transmission, the more likely that there will be an error, necessitating retransmission of the entire frame. With smaller frames, errors are detected sooner, and a smaller amount of data needs to be retransmitted. – On a shared medium, such as a LAN, it is usually desirable not to permit one station to occupy the medium for an extended period, thus causing long delays at the other sending stations. Case where transmission time is greater than propagation time
• When a<1 ,(a is propagation
time and transmission time is normalized to 1)the propagation time is less than the transmission time. • In this case, the frame is sufficiently long that the first bits of the frame have arrived at the destination before the source has completed the transmission of the frame Case where transmission time is less than propagation time • When a>1, ,(a is propagation time and transmission time is normalized to 1)the the propagation time is greater than the transmission time. • In this case, the sender completes transmission of the entire frame before the leading bits of that frame arrive at the receiver. Stop-and-Wait Flow Control • Note – For a>1 the line is always underutilized – For a<1 the line is inefficiently utilized. • In essence stop-and-wait flow control provides inefficient line utilization for – very high data rates, – very long distances between sender and receiver, Sliding-Window Flow Control • The essence of the problem described so far is that only one frame at a time can be in transit. • In situations where the bit length of the link is greater than the frame length(a>1) serious inefficiencies result. • Efficiency can be greatly improved by allowing multiple frames to be in transit at the same time. Sliding-Window Flow Control (cont.) • Let us examine how this might work for two stations , A and B, connected via a full-duplex link. • Station B allocates buffer space for W frames. Thus, B can accept W frames, and A is allowed to send W frames without waiting for any acknowledgments. • To keep track of which frames have been acknowledged, each is labeled with a sequence number. • B acknowledges a frame by sending an acknowledgment that includes the sequence number of the next frame expected. • This acknowledgment also implicitly announces that B is prepared to receive the next W frames, beginning with the number specified. Sliding-Window Flow Control (cont.) • This scheme can also be used to acknowledge multiple frames. • For example, B could receive frames 2, 3, and 4 but withhold acknowledgment until frame 4 has arrived. By then returning an acknowledgment with sequence number 5, B acknowledges frames 2, 3, and 4 at one time. • A maintains a list of sequence numbers that it is allowed to send, and B maintains a list of sequence numbers that it is prepared to receive. Each of these lists can be thought of as a window of frames. Sliding-Window Flow Control (cont.) • the sequence number to be used occupies a field in the frame therefore, it is limited to a range of values. – For example, for a 3-bit field, the sequence number can range from 0 to 7. Accordingly, frames are numbered modulo 8; that is, after sequence number 7, the next number is 0. • In general, for a k-bit field – the range of sequence numbers is 0 to 2k-1 – frames are numbered modulo 2k – the maximum window size is 2k-1 Sliding-Window Flow Control (cont.) Sliding-Window Flow Control (cont.) • The mechanism so far described provides a form of flow control:The receiver must only be able to accommodate seven frames beyond the one it has last acknowledged. • Most data link control protocols also allow a station to cut off the flow of frames from the other side by sending a Receive Not Ready (RNR) message, • Receive Not Ready (RNR) message – acknowledges former frames – but forbids transfer of future frames. • For example , RNR 5 means “I have received all frames up through number 4 but am unable to accept any more at this time.” • At some subsequent point, the station must send a normal acknowledgment to reopen the window. • If two stations exchange data, each needs to maintain two windows, one for transmit and one for receive, and each side needs to send the data and acknowledgments to the other. • To provide efficient support for this requirement, a feature known as piggybacking • Each data frame includes a – field that holds the sequence number of that frame – plus a field that holds the sequence number used for acknowledgment. • If a station has data to send and an acknowledgment to send, it sends both together in one frame, saving communication capacity. • if a station has an acknowledgment but no data to send, it sends a separate acknowledgment frame, such as RR or RNR. • If a station has data to send but no new acknowledgment to send, it must repeat the last acknowledgment sequence number that it sent. – This is because the data frame includes a field for the acknowledgment number, and some value must be put into that field. When a station receives a duplicate acknowledgment, it simply ignores it. • Sliding-window flow control is potentially much more efficient than stop-and-wait flow control. • The reason is that, with sliding-window flow control, the transmission link is treated as a pipeline that may be filled with frames in transit. • In contrast, with stop-and-wait flow control, only one frame may be in the pipe at a time Error control ERROR DETECTION
• Regardless of the design of the transmission
system, there will be errors, resulting in the change of one or more bits in a transmitted frame. Error Detection Process Error Detection Process • For a given frame of bits, additional bits that constitute an error- detecting code are added by the transmitter. • This code is calculated as a function of the other transmitted bits. • Typically, for a data block of k bits, the error-detecting algorithm yields an error-detecting code of n-k bits, where n-k < K • The error-detecting code, also referred to as the check bits, is appended to the data block to produce a frame of n bits, which is then transmitted. • The receiver separates the incoming frame into the k bits of data and n- k bits of the error-detecting code. • The receiver performs the same error-detecting calculation on the data bits and compares this value with the value of the incoming error- detecting code. • A detected error occurs if and only if there is a mismatch. Parity Check • The simplest error-detecting scheme is to append a parity bit to the end of a block of data. • The value of this bit is selected so that the character has an even number of 1s (even parity) or an odd number of 1s (odd parity). • Note, however, that if two (or any even number) of bits are inverted due to error, an undetected error occurs. • The use of the parity bit is not foolproof, as noise impulses are often long enough to destroy more than one bit, particularly at high data rates. Cyclic Redundancy Check (CRC) • One of the most common, and one of the most powerful, error-detecting codes • Given a k-bit block of bits, or message, the transmitter generates an n-k- bit sequence, known as a frame check sequence (FCS), such that the resulting frame, consisting of n bits, is exactly divisible by some predetermined number. • The receiver then divides the incoming frame by that number and, if there is no remainder, assumes there was no error. Modulo 2 Arithmetic • Modulo 2 arithmetic uses binary addition with no carries, which is just the exclusive-OR (XOR) operation. • Binary subtraction with no carries is also interpreted as the XOR operation: • For example, Back to CRC Example on CRC Example on CRC(cont.) Error control • Error control refers to mechanisms to detect and correct errors that occur in the transmission of frames • data are sent as a sequence of frames; frames arrive in the same order in which they are sent; and each transmitted frame suffers an arbitrary and potentially variable amount of delay before reception. • In addition ,there is possibility of two types of errors: • Lost frame: A frame fails to arrive at the other side. – For example, a noise burst may damage a frame to the extent that the receiver is not aware that a frame has been transmitted. • Damaged frame: A recognizable frame does arrive, but some of the bits are in error (have been altered during transmission). common techniques for error control • Error detection: • Positive acknowledgment: The destination returns a positive acknowledgment to successfully received, error- free frames. • Retransmission after timeout: The source retransmits a frame that has not been acknowledged after a predetermined amount of time. • Negative acknowledgment and retransmission: The destination returns a negative acknowledgment to frames in which an error is detected. The source retransmits such frames. Automatic Repeat reQuest (ARQ) • Collectively, the mechanisms discussed on the previous slide are all referred to as automatic repeat request (ARQ); • The effect of ARQ is to turn an unreliable data link into a reliable one. • Three versions of ARQ have been standardized: – Stop-and-wait ARQ – Go-back-N ARQ – Selective-reject ARQ Stop-and-Wait ARQ • Stop-and-wait ARQ is based on the stop-and-wait flow control technique • The source station transmits a single frame and then must await an acknowledgment (ACK). • No other data frames can be sent until the destination station’s reply arrives at the source station. • Two sorts of errors could occur – Frame that arrives at the destination could be damaged – The acknowledgment could be damaged Damaged Frame • The receiver detects this by using the error-detection technique and simply discards the frame. • To account for this possibility, the source station is equipped with a timer. • After a frame is transmitted, the source station waits for an acknowledgment. If no acknowledgment is received by the time that the timer expires, then the same frame is sent again. • Note that this method requires that the transmitter maintain a copy of a transmitted frame until an acknowledgment is received for that frame. Damaged Acknowledgment • Station A sends a frame. • The frame is received correctly by station B, which responds with an acknowledgment (ACK). • The ACK is damaged in transit and is not recognizable by A, which will therefore time out and resend the same frame. • This duplicate frame arrives and is accepted by B. • B has therefore accepted two copies of the same frame as if they were separate. • To avoid this problem, frames are alternately labeled with 0 or 1, and positive acknowledgments are of the form ACK0 and ACK1. • source A to destination B. • The third frame transmitted by A is lost or damaged and therefore B does not return an ACK. • A times out and retransmit the frame. • Later,A transmits a frame labeled 1 but the ACK0 for that frame is lost. A times out and retransmits the same frame.When B receives two frames in a row with the same label, it discards the second frame but sends back an ACK0 to each. Advantage and disadvantage of Stop and Wait ARQ • Advantage – Simplicity • Disadvantage – ineffeciency Go-Back-N ARQ • The form of error control based on sliding- window flow control that is most commonly used is called go-back-N ARQ. • In this method, a station may send a series of frames sequentially numbered modulo some maximum value. • The number of unacknowledged frames outstanding is determined by window size, using the sliding-window flow control technique • While no error occur, the destination will acknowledge incoming frames as usual • If the destination station detects an error in a frame, it may send a negative acknowledgment for that frame. • The destination station will discard that frame and all future incoming frames until the frame in error is correctly received. • Thus, the source station , when it receives a REJ, must retransmit the frame in error plus all succeeding frames that were transmitted in the interim. • Suppose that station A is sending frames to station B. • After each transmission , A sets an acknowledgment timer for the frame just transmitted. Suppose that B has previously successfully received frame i-1 and A has just transmitted frame i. • The go-back-N technique takes into account the following contingencies for the following cases: – Damaged frame. – Damaged RR 1.Damaged frame • If the received frame is invalid (i.e.,B detects an error, or the frame is so damaged that B does not even perceive that it has received a frame), B discards the frame and takes no further action as the result of that frame. • There are two subcases: a) Within a reasonable period of time,A subsequently sends frame i+1 . B receives frame i+1 out of order and sends a REJ i. A must retransmit frame i and all subsequent frames. b) A does not soon send additional frames. B receives nothing and returns neither an RR nor a REJ. – When A’s timer expires, it transmits an RR frame that includes a bit known as the P bit, which is set to 1. – B interprets the RR frame with a P bit of 1 as a command that must be acknowledged by sending an RR indicating the next frame that it expects, which is frame i. – When A receives the RR, it retransmits frame i. Alternatively, A could just retransmit frame i when its timer expires. 2.Damaged RR. • There are two subcases • (a) B receives frame i and sends RR i+1 which suffers an error in transit. Because acknowledgments are cumulative (e.g., RR 6 means that all frames through 5 are acknowledged), it may be that A will receive a subsequent RR to a subsequent frame and that it will arrive before the timer associated with frame i expires. • (b) If A’s timer expires, it transmits an RR command as in Case 1b. It sets another timer, called the P-bit timer. If B fails to respond to the RR command, or if its response suffers an error in transit, then A’s P- bit timer will expire.At this point,A will try again by issuing a new RR command and restarting the P-bit timer. This procedure is tried for a number of iterations. If A fails to obtain an acknowledgment after some maximum number of attempts, it initiates a reset procedure. 3.Damaged REJ. • If a REJ is lost, this is equivalent to Case 1b. Because of the propagation delay on the line, by the time that an acknowledgment (positive or negative) arrives back at the sending station, it has already sent at least one additional frame beyond the one being acknowledged. In this example, frame 4 is damaged. Frames 5 and 6 are received out of order and are discarded by B. When frame 5 arrives, B immediately sends a REJ 4.When the REJ to frame 4 is received, not only frame 4 but frames 5 and 6 must be retransmitted. Note that the transmitter must keep a copy of all unacknowledged frames. The Figure also shows an example of retransmission after timeout. No acknowledgment is received for frame 5 within the timeout period, so A issues an RR to determine the status of B. Selective-Reject ARQ • With selective-reject ARQ, the only frames retransmitted are those that receive a negative acknowledgment, in this case called SREJ, or those that time out. • The Figure illustrates the selective- Reject ARQ. When frame 5 is received out of order, B sends a SREJ 4, indicating that frame 4 has not been received. • However, B continues to accept incoming frames and buffers them until a valid frame 4 is received. At that point, B can place the frames in the proper order for delivery to higher-layer software Selective-Reject ARQ • Selective reject would appear to be more efficient than go-back-N, because it minimizes the amount of retransmission. • On the other hand, the receiver must maintain a buffer large enough to save post-SREJ frames until the frame in error is retransmitted and must contain logic for reinserting that frame in the proper sequence. • The transmitter, too, requires more complex logic to be able to send a frame out of sequence. Because of such complications, select-reject ARQ is much less widely used than go-back-N ARQ