Chapter 3 Basic Communication Concepts 3.1 Introduction This chapter introduces some of the basic concepts of signals and information communication. The following section, 3.2, looks at some of the ways signals become more difficult to receive as they travel through various media. When more than one device attempts to send a signal, the result is a collision and the correct data cannot be transmitted. Section 3.3 discusses handling collisions — a major issue when multiple devices share a single, limited medium. Finally, errors in a digital signal can be detected and in many cases the signal can be restored before it is resent, processed, or stored. Section 3.4 introduces some of the basics of error detection and correction. Like many of the topics we will study in computer networks class, error detection and correction are not limited to networks but are applied in many other areas of computer science, especially data storage, which we will discuss again in the Chapter 4. 3.2 Signal Degradation This section introduces three main types of signal degradation: attenuation, noise, and interference. Attenuation is the gradual decrease in signal strength with increased distance and time. Noise is caused by many sources but we will first consider the properties of noise. One particular source of noise is interference from other signals. Attenuation is a gradual loss of amplitude or power in a signal as it 19 20 CHAPTER 3. BASIC COMMUNICATION CONCEPTS propagates (moves) through a medium. The attenuation of a radio signal depends on its frequency. The radio signals used in Wi-Fi networks (usually narrow bands in the 2 to 5 GHz range) normally extends only through one area of a building, several floors. Attenuation of radio signals also depends on the atmospheric conditions, the weather. Occlusion refers to a more permanent reduction of a signal due to permanent objects such as buildings, mountains, or the curve of the Earth. Noise can also be introduced in the amplification process and other signal processing. Signal-to-noise ratio (S/N ratio, or SNR) is a measure of the amount of noise present in the signal compared to the part of the signal that is able to transmit data. Another source of signal noise is when nearby signals are introduced into the media or devices or otherwise change the signal. Because an electrical signal is usually sent with two or more wires, electrical interference can occur from another wire in the same transmission. Some of the techniques for reducing this type of interference, known as crosstalk, are discussed in Chapter 4. Signal interference is especially a problem in wireless transmissions. All electronic devices can emit radio signals so new devices and systems must be checked carefully to prevent noise in the radio bands that are reserved. For this reason, in many countries electronic devices must be registered with the communication authorities, such as the FCC (Federal Communications Commission) in the US and JATE (Japan Approvals Institute for Telecommunications Equipment) in Japan. In Europe, devices must carry the (European Conformity) symbol indicating their compliance with EU legislation. 3.3 Collision Detection and Avoidance In addition to interference from outside sources, there are times that two or more devices attempt to use a limited channel at the same time. This special kind of interference, called a collision, is very common, in part because it is inconvenient and sometimes inefficient to design systems to listen every time they send. Even when devices do listen, there is generally nothing to prevent two systems from simultaneously starting to use one channel. For this reason, when there is some possibility for collisions, systems have methods for determining how to handle the collision. One method, used in Carrier Sense Multiple Access with Collision Detection (CSMA/CD) for 3.4. ERROR DETECTION AND CORRECTION 21 ethernet, is to have each device wait a pseudorandomly set time period before attempting to send the signal again. Another method, used in Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) for wireless networks (such as 802.11 networks), is to have a device request a time interval to transmit. Other devices acknowledge the request and do not transmit until the transmission or allotted time period is complete. Collision detection and avoidance is included in Media Access Control (MAC), the Data-Link Layer protocols that allow various devices to share wired or wireless physical channels, protocols we will cover again when we talk about MAC addresses. 3.4 Error Detection and Correction Error detection and correction is a fundamental part of all information processing because all media, whether it be for storage or communication, has the possibility of errors. In error detection, the objective is to find errors. In error correction, the correct values can often be found even when there are errors. The correct value is determined by the sender. In networking, error detection and correction is usually done in the Data Link Layer or the Transport Layer. The Data Link Layer handles errors that occur from the physical media, NIC devices, etc., for example, errors from the noise sources discussed above. Wireless media is more prone to errors and is therefore more likely to use error correction. One of the tasks of the Transport Layer is to check packet integrity so on the sending side data is added to allow checking on the receiving end. There are two basic methods of error detection and correction. The first is to send extra data along with the data to be sent and this method is used in parity bits, checksums, and mirroring. The other basic method is to limit the number of values that are used in communication so that it is likely that an error will be an invalid value and the correct data can be inferred, which is the method used in Hamming Distance. Parity is a method of appending (adding) check bits to the beginning or end of blocks of data so that the whole block has an easily-computed bit characteristic. For example, in odd parity, a bit may be added to ensure that the block of data (which could be large or small depending on the number of errors expected, among other considerations) has an odd number of bits set to 1. (Even parity would add a bit to ensure an even number of 1’s.) In block parity, multiple parity bits can be added “horizontally” (on one contiguous 22 CHAPTER 3. BASIC COMMUNICATION CONCEPTS set of bits, for example each byte or word) and “vertically” (on one bit in each set for the whole block). When an single-bit error occurs, block parity can usually correct the error. Parity is usually a method of error detection but block parity can provide error detection and correction. Checksums are an extension of the idea of parity. You can observe checksums all around you, many are designed to prevent error by human users in number entry. However, the basic principle is exactly the same. Like parity, a set of contiguous digits (contiguous bits in binary data or decimal digits in human readable data) is fed through an iterative algorithm (a loop). The output of the algorithm is then appended to the data, just as in parity bits. On the other end, the same algorithm or a complementary algorithm is used to check the data. The name checksum seems to imply that the result is a sum. For example, Internet Checksum is simply an iterative sum in which the overflow is thrown away. However, most checksum algorithms use specially selected values on each digit or on each set of bits so that errors such as reversed digits (in human data entry) or noise bursts (in communication) can be detected more reliably. One of the most common types of checksum algorithm is called Cyclic Redundancy Check. (Technically, all parity bit algorithms are cyclic redundancy checks of the shortest bit length, one bit.) Typically, a cyclic redundancy check uses an agreed-upon value of a set bit length, one bit longer than the bits to be appended as a checksum. This value is repeatedly subtracted or XORed from a set of bits, shifting from left to right to find a remainder. The remainder is appended to the bits to be sent so that on the receiving end the remainder of the same operation is always zero. (See the accompanying worksheet.) Mirroring is simply storing or sending more than one copy of the data. This kind of redundancy uses a lot of media resources and so is used most commonly in data storage, where media is not as limited as in communication. Mirroring is often used for data recovery rather than error detection and so are used together with less resource expensive error detection such as parity. For example, redundant disk storage often uses parity for error detection and mirroring to recover the correct data. 3.5. GLOSSARY 3.5 23 Glossary append — (in data manipulation) Add bits or bytes to the beginning or end of an existing datum. attenuation — The reduction in strength, and therefore in signal-to-noise ratio, of a signal as it travels over distance. block parity — Adding parity to a sequence of words both horizontally (one parity bit added to each word) and vertically (an additional parity word, the same width as the data, with its own parity bit). A single-bit error can be both detected and corrected by finding the intersection of horizontal and verticla parity errors. Horizontal parity indicates which word is errnoneous, and vertical parity identifies which bit within that word is erroneous. Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) — A Data-Link Layer mechanism allowing multiple devices to transmit over the same physical medium. Before transmission a device transmits a request to reserve a block of time during which it alone will be able to transmit. When the other devices sharing the medium acknowledge this request the transmitter sends its information. The reservation ends when the data has been transmitted or the block of time has elapsed. Carrier Sense Multiple Access with Collision Detection (CSMA/CD) — A Data-Link Layer mechanism allowing multiple devices to transmit over the same physical medium. When a device transmits a message it monitors the medium for conflicting transmissions (collisions). When a collision is detected, all transmitted data is invalidated and each transmitter waits a pseudo-random time (growing exponentially with successive collisions) before attempting to retransmit the message. (European Conformity) — A manufacturers’ mark indicating that a device conforms to European Community regulations. Devices manufactured or offered for sale in the EU must carry this mark. The symbol stands for Conformité Européenne, which is ‘European Conformity’ in French. checksum — Extra data appended to a message or data for error detection purposes. collision — An attempt by two transmitters to send data on the same physical medium at the same time. 24 CHAPTER 3. BASIC COMMUNICATION CONCEPTS collision avoidance — Reserving a block of time on a shared medium, by mutual agreement between all transmitters, so that a transmitter can send a message without risk of collision. collision detection — Monitoring a physical medium for conflicting tranmsissions and aborting all transmissions if a conflict is detected. crosstalk — The pollution of one signal by content from another nearby signal being sent on a similar physical medium (such as an electrical wire). Cyclic Redundancy Check (CRC) — degradation — The reduction in quality (signal-to-noise ratio) of a signal because of attenuation or the introduction of noise as it travels over distance. error correction — The process of (identifying and then) repairing data that has been damaged. error detection — The process of identifying data that has been damaged. Federal Communications Commission (FCC) — An authority in the US responsible for regulating the use of the electromagnetic spectrum and approving for sale devices that could potentially cause electromagnetic interference. interference — The pollution of a signal either from a noise source or from another nearby signal traveling on the same or a similar medium. Japan Approvals Institute for Telecommunications Equipment (JATE) — An institute providing compliance certification for telecommunications equipment in Japan. Media Access Control (MAC) — Data-Link Layer protocols providing physical hardware addresses and access control mechanisms allowing several network devices to communicate on a multiple access network over a shared medium such as wired or wireless Ethernet. medium — A physical object through which a signal can propagate such as copper wire (electrical signals), fibre-optic cable (light signales), or space (radio signals). mirroring — An error recovery mechanism that uses redudant copies of data. 3.5. GLOSSARY 25 noise — Signal content that was not deliberated generated by the transmitter. Noise can be related to the type of content being sent (e.g., crosstalk), unrelated (e.g., an electromechanical device causing noise in a copper wire), or unrelated and possibly caused by natural physical processes (e.g., the white noise ‘static’ heard in the background of weak radio signals). occlusion — Attenuation of a signal caused by a physical obstruction between the transmitter and the receiver. packet integrity — Correctness of the data within a packet. An error detection mechanism can verify packet integrity. parity — An extra bit appended to a data word to ensure some property of the bits within that word, e.g., that the count of ‘1’ bits is always odd (horizontal parity). An extra word can also be appended to a sequence of data words to provide parity for each bit position within the sequence (vertical parity). When combined, the two kinds of parity can identify and repair a single-bit error with the data. remainder — The amount ‘left over’ after performing an integer division. When dividing by a 2n (a power of two) the quotient can be found by shifting the data to the right by n bits; the bits that are shifted out of the word on the right-hand side contain the remainder. signal-to-noise ratio (SNR, or S/N ratio) — The strength of the content part of a signal divided by the combined strengths of all sources of noise impressed upon the signal. The SNR measures the quality of a communication channel, and a low SNR will threaten the integrity of data transmitted over it. (The number of ‘bars’ on a WiFi or cellular telephone transceiver are related to the SNR of the communications channel being used. More bars indicate a higher SNR.) signal — (in communications) A quantity that varies over time (or space) in order to convey a message. Time-varying signals include speech as well as the modulatation of electrical voltage, light intensity, or electromagnetic wave frequency in computer communications networks. (Space-varying signals include photographic images.) 26 CHAPTER 3. BASIC COMMUNICATION CONCEPTS XOR — Acronym for eXclusive OR. A bitwise function whose output is 1 when exactly one of its inputs is 1. (The output is 0 if all inputs are 0 or more than one input is 1.) As a binary arithmetic operator it is often written as ‘⊕’. A⊕B A B 0 0 0 1 1 1 0 1 1 1 0 0 It is equivalent to addition (and subtraction) in modulo 2 arithmetic. Copyright © 2014 E.W. Cooper and I.K. Piumarta All rights reserved. Permission is granted for you to download, save and then view or print one copy of this document for personal study purposes. No other form of publishing, duplication or redistribution is permitted without explicit prior consent.