Chapter 3: Introduction to Physical Layer PDF
Document Details
Uploaded by OrganizedEuclid
Helwan University
Tags
Summary
This document introduces the physical layer in data communication. It explains analog and digital signals, along with their associated concepts such as bandwidth, throughput, latency and jitter. The document provides a breakdown of the various components of the physical layer.
Full Transcript
CHAPTER 3 Introduction to Physical Layer O ne of the major functions of the physical layer is to move data in the form of elec- tromagnetic signals across a transmission medium. Whether yo...
CHAPTER 3 Introduction to Physical Layer O ne of the major functions of the physical layer is to move data in the form of elec- tromagnetic signals across a transmission medium. Whether you are collecting numerical statistics from another computer, sending animated pictures from a design workstation, or causing a bell to ring at a distant control center, you are working with the transmission of data across network connections. Generally, the data usable to a person or application are not in a form that can be transmitted over a network. For example, a photograph must first be changed to a form that transmission media can accept. Transmission media work by conducting energy along a physical path. For transmission, data needs to be changed to signals. This chapter is divided into six sections: ❑ The first section shows how data and signals can be either analog or digital. Ana- log refers to an entity that is continuous; digital refers to an entity that is discrete. ❑ The second section shows that only periodic analog signals can be used in data communication. The section discusses simple and composite signals. The attri- butes of analog signals such as period, frequency, and phase are also explained. ❑ The third section shows that only nonperiodic digital signals can be used in data communication. The attributes of a digital signal such as bit rate and bit length are discussed. We also show how digital data can be sent using analog signals. Base- band and broadband transmission are also discussed in this section. ❑ The fourth section is devoted to transmission impairment. The section shows how attenuation, distortion, and noise can impair a signal. ❑ The fifth section discusses the data rate limit: how many bits per second we can send with the available channel. The data rates of noiseless and noisy channels are examined and compared. ❑ The sixth section discusses the performance of data transmission. Several channel measurements are examined including bandwidth, throughput, latency, and jitter. Performance is an issue that is revisited in several future chapters. 53 54 PART II PHYSICAL LAYER 3.1 DATA AND SIGNALS Figure 3.1 shows a scenario in which a scientist working in a research company, Sky Research, needs to order a book related to her research from an online bookseller, Sci- entific Books. Figure 3.1 Communication at the physical layer Sky Research Alice Alice Application Transport Network Data-link Physical R2 Network To other Data-link ISPs Physical R1 R2 R4 Network To other R3 R4 Data-link ISPs Physical Switched R5 WAN Network R5 Data-link National ISP Physical ISP R7 To other Network ISPs Data-link R6 R7 Physical Legend Point-to-point WAN Bob LAN switch Application Transport WAN switch Network Data-link Router Bob Physical Scientific Books We can think of five different levels of communication between Alice, the com- puter on which our scientist is working, and Bob, the computer that provides online ser- vice. Communication at application, transport, network, or data-link is logical; communication at the physical layer is physical. For simplicity, we have shown only CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 55 host-to-router, router-to-router, and router-to-host, but the switches are also involved in the physical communication. Although Alice and Bob need to exchange data, communication at the physical layer means exchanging signals. Data need to be transmitted and received, but the media have to change data to signals. Both data and the signals that represent them can be either analog or digital in form. 3.1.1 Analog and Digital Data Data can be analog or digital. The term analog data refers to information that is continuous; digital data refers to information that has discrete states. For example, an analog clock that has hour, minute, and second hands gives information in a continuous form; the movements of the hands are continuous. On the other hand, a digital clock that reports the hours and the minutes will change suddenly from 8:05 to 8:06. Analog data, such as the sounds made by a human voice, take on continuous values. When someone speaks, an analog wave is created in the air. This can be captured by a microphone and converted to an analog signal or sampled and converted to a digital signal. Digital data take on discrete values. For example, data are stored in computer memory in the form of 0s and 1s. They can be converted to a digital signal or modu- lated into an analog signal for transmission across a medium. 3.1.2 Analog and Digital Signals Like the data they represent, signals can be either analog or digital. An analog signal has infinitely many levels of intensity over a period of time. As the wave moves from value A to value B, it passes through and includes an infinite number of values along its path. A digital signal, on the other hand, can have only a limited number of defined values. Although each value can be any number, it is often as simple as 1 and 0. The simplest way to show signals is by plotting them on a pair of perpendicular axes. The vertical axis represents the value or strength of a signal. The horizontal axis represents time. Figure 3.2 illustrates an analog signal and a digital signal. The curve representing the analog signal passes through an infinite number of points. The vertical lines of the digital signal, however, demonstrate the sudden jump that the signal makes from value to value. Figure 3.2 Comparison of analog and digital signals Value Value Time Time a. Analog signal b. Digital signal 56 PART II PHYSICAL LAYER 3.1.3 Periodic and Nonperiodic Both analog and digital signals can take one of two forms: periodic or nonperiodic (sometimes referred to as aperiodic; the prefix a in Greek means “non”). A periodic signal completes a pattern within a measurable time frame, called a period, and repeats that pattern over subsequent identical periods. The completion of one full pattern is called a cycle. A nonperiodic signal changes without exhibiting a pat- tern or cycle that repeats over time. Both analog and digital signals can be periodic or nonperiodic. In data communi- cations, we commonly use periodic analog signals and nonperiodic digital signals, as we will see in future chapters. In data communications, we commonly use periodic analog signals and nonperiodic digital signals. 3.2 PERIODIC ANALOG SIGNALS Periodic analog signals can be classified as simple or composite. A simple periodic analog signal, a sine wave, cannot be decomposed into simpler signals. A composite periodic analog signal is composed of multiple sine waves. 3.2.1 Sine Wave The sine wave is the most fundamental form of a periodic analog signal. When we visualize it as a simple oscillating curve, its change over the course of a cycle is smooth and consistent, a continuous, rolling flow. Figure 3.3 shows a sine wave. Each cycle consists of a single arc above the time axis followed by a single arc below it. Figure 3.3 A sine wave Value Time We discuss a mathematical approach to sine waves in Appendix E. A sine wave can be represented by three parameters: the peak amplitude, the fre- quency, and the phase. These three parameters fully describe a sine wave. CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 57 Peak Amplitude The peak amplitude of a signal is the absolute value of its highest intensity, propor- tional to the energy it carries. For electric signals, peak amplitude is normally measured in volts. Figure 3.4 shows two signals and their peak amplitudes. Figure 3.4 Two signals with the same phase and frequency, but different amplitudes Amplitude Peak amplitude Time a. A signal with high peak amplitude Amplitude Peak amplitude Time b. A signal with low peak amplitude Example 3.1 The power in your house can be represented by a sine wave with a peak amplitude of 155 to 170 V. However, it is common knowledge that the voltage of the power in U.S. homes is 110 to 120 V. This discrepancy is due to the fact that these are root mean square (rms) values. The signal is squared and then the average amplitude is calculated. The peak value is equal to 21/2 × rms value. Example 3.2 The voltage of a battery is a constant; this constant value can be considered a sine wave, as we will see later. For example, the peak value of an AA battery is normally 1.5 V. Period and Frequency Period refers to the amount of time, in seconds, a signal needs to complete 1 cycle. Frequency refers to the number of periods in 1 s. Note that period and frequency are just one characteristic defined in two ways. Period is the inverse of frequency, and frequency is the inverse of period, as the following formulas show. 1 1 f 5 --- and T 5 --- T f Frequency and period are the inverse of each other. Figure 3.5 shows two signals and their frequencies. Period is formally expressed in seconds. Frequency is formally expressed in Hertz (Hz), which is cycle per second. Units of period and frequency are shown in Table 3.1. 58 PART II PHYSICAL LAYER Figure 3.5 Two signals with the same amplitude and phase, but different frequencies Amplitude 12 periods in 1 s Frequency is 12 Hz 1s Time 1 s Period: 12 a. A signal with a frequency of 12 Hz Amplitude 6 periods in 1 s Frequency is 6 Hz 1s Time T Period: 16 s b. A signal with a frequency of 6 Hz Table 3.1 Units of period and frequency Period Frequency Unit Equivalent Unit Equivalent Seconds (s) 1s Hertz (Hz) 1 Hz Milliseconds (ms) 10–3 s Kilohertz (kHz) 103 Hz Microseconds (μs) 10–6 s Megahertz (MHz) 106 Hz Nanoseconds (ns) 10–9 s Gigahertz (GHz) 109 Hz Picoseconds (ps) 10–12 s Terahertz (THz) 1012 Hz Example 3.3 The power we use at home has a frequency of 60 Hz (50 Hz in Europe). The period of this sine wave can be determined as follows: 1 1 T 5 --- 5 ------ 5 0.0166 s 5 0.0166 3 103 ms 5 16.6 ms f 60 This means that the period of the power for our lights at home is 0.0116 s, or 16.6 ms. Our eyes are not sensitive enough to distinguish these rapid changes in amplitude. Example 3.4 Express a period of 100 ms in microseconds. Solution From Table 3.1 we find the equivalents of 1 ms (1 ms is 10–3 s) and 1 s (1 s is 106 μs). We make the following substitutions: 100 ms 5 100 3 10–3 s 5 100 3 10–3 3 106 ms 5 102 3 10–3 3 106 ms 5 105 ms CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 59 Example 3.5 The period of a signal is 100 ms. What is its frequency in kilohertz? Solution First we change 100 ms to seconds, and then we calculate the frequency from the period (1 Hz = 10–3 kHz). 100 ms 5 100 3 10–3 s 5 10–1 s 1 1 f 5 --- 5 ------------ 21 Hz 5 10 Hz 5 10 3 10–3 kHz 5 10–2 kHz T 10 More About Frequency We already know that frequency is the relationship of a signal to time and that the frequency of a wave is the number of cycles it completes in 1 s. But another way to look at frequency is as a measurement of the rate of change. Electromagnetic signals are oscillating wave- forms; that is, they fluctuate continuously and predictably above and below a mean energy level. A 40-Hz signal has one-half the frequency of an 80-Hz signal; it completes 1 cycle in twice the time of the 80-Hz signal, so each cycle also takes twice as long to change from its lowest to its highest voltage levels. Frequency, therefore, though described in cycles per sec- ond (hertz), is a general measurement of the rate of change of a signal with respect to time. Frequency is the rate of change with respect to time. Change in a short span of time means high frequency. Change over a long span of time means low frequency. If the value of a signal changes over a very short span of time, its frequency is high. If it changes over a long span of time, its frequency is low. Two Extremes What if a signal does not change at all? What if it maintains a constant voltage level for the entire time it is active? In such a case, its frequency is zero. Conceptually, this idea is a sim- ple one. If a signal does not change at all, it never completes a cycle, so its frequency is 0 Hz. But what if a signal changes instantaneously? What if it jumps from one level to another in no time? Then its frequency is infinite. In other words, when a signal changes instantaneously, its period is zero; since frequency is the inverse of period, in this case, the frequency is 1/0, or infinite (unbounded). If a signal does not change at all, its frequency is zero. If a signal changes instantaneously, its frequency is infinite. 3.2.2 Phase The term phase, or phase shift, describes the position of the waveform relative to time 0. If we think of the wave as something that can be shifted backward or forward along the time axis, phase describes the amount of that shift. It indicates the status of the first cycle. Phase describes the position of the waveform relative to time 0. 60 PART II PHYSICAL LAYER Phase is measured in degrees or radians [360º is 2π rad; 1º is 2π/360 rad, and 1 rad is 360/(2π)]. A phase shift of 360º corresponds to a shift of a complete period; a phase shift of 180° corresponds to a shift of one-half of a period; and a phase shift of 90º cor- responds to a shift of one-quarter of a period (see Figure 3.6). Figure 3.6 Three sine waves with the same amplitude and frequency, but different phases 0 Time a. 0 degrees 1/4 T 0 Time b. 90 degrees 0 Time 1/2 T c. 180 degrees Looking at Figure 3.6, we can say that a. A sine wave with a phase of 0° starts at time 0 with a zero amplitude. The amplitude is increasing. b. A sine wave with a phase of 90° starts at time 0 with a peak amplitude. The amplitude is decreasing. c. A sine wave with a phase of 180° starts at time 0 with a zero amplitude. The amplitude is decreasing. Another way to look at the phase is in terms of shift or offset. We can say that a. A sine wave with a phase of 0° is not shifted. b. A sine wave with a phase of 90° is shifted to the left by 1--- cycle. However, note 4 that the signal does not really exist before time 0. c. A sine wave with a phase of 180° is shifted to the left by 1--- cycle. However, note 2 that the signal does not really exist before time 0. Example 3.6 A sine wave is offset 1--- cycle with respect to time 0. What is its phase in degrees and radians? 6 Solution We know that 1 complete cycle is 360°. Therefore, 1 cycle is --- 6 1 2π π --- 3 360 5 60° 5 60 3 --------- rad 5 --- rad 5 1.046 rad 6 360 3 CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 61 3.2.3 Wavelength Wavelength is another characteristic of a signal traveling through a transmission medium. Wavelength binds the period or the frequency of a simple sine wave to the propagation speed of the medium (see Figure 3.7). Figure 3.7 Wavelength and period Wavelength Transmission medium At time t Direction of Transmission medium propagation At time t + T While the frequency of a signal is independent of the medium, the wavelength depends on both the frequency and the medium. Wavelength is a property of any type of signal. In data communications, we often use wavelength to describe the transmis- sion of light in an optical fiber. The wavelength is the distance a simple signal can travel in one period. Wavelength can be calculated if one is given the propagation speed (the speed of light) and the period of the signal. However, since period and frequency are related to each other, if we represent wavelength by λ, propagation speed by c (speed of light), and frequency by f, we get propagation speed Wavelength 5 (propagation speed) 3 period 5 ----------------------------------------------- frequency c λ 5 -- f The propagation speed of electromagnetic signals depends on the medium and on the frequency of the signal. For example, in a vacuum, light is propagated with a speed of 3 × 108 m/s. That speed is lower in air and even lower in cable. The wavelength is normally measured in micrometers (microns) instead of meters. For example, the wavelength of red light (frequency = 4 × 1014) in air is 8 c 3 3 10 λ 5 -- 5 ----------------- 14 - 5 0.75 3 10–6 m 5 0.75 mm f 4 3 10 In a coaxial or fiber-optic cable, however, the wavelength is shorter (0.5 μm) because the propagation speed in the cable is decreased. 3.2.4 Time and Frequency Domains A sine wave is comprehensively defined by its amplitude, frequency, and phase. We have been showing a sine wave by using what is called a time-domain plot. The time-domain plot shows changes in signal amplitude with respect to time (it is an amplitude-versus-time plot). Phase is not explicitly shown on a time-domain plot. 62 PART II PHYSICAL LAYER To show the relationship between amplitude and frequency, we can use what is called a frequency-domain plot. A frequency-domain plot is concerned with only the peak value and the frequency. Changes of amplitude during one period are not shown. Figure 3.8 shows a signal in both the time and frequency domains. Figure 3.8 The time-domain and frequency-domain plots of a sine wave Amplitude 1 second: Frequency: 6 Hz Peak value: 5 V 5 Time (s) a. A sine wave in the time domain (peak value: 5 V, frequency: 6 Hz) Amplitude Peak value: 5 V 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Frequency (Hz) b. The same sine wave in the frequency domain (peak value: 5 V, frequency: 6 Hz) It is obvious that the frequency domain is easy to plot and conveys the information that one can find in a time domain plot. The advantage of the frequency domain is that we can immediately see the values of the frequency and peak amplitude. A complete sine wave is represented by one spike. The position of the spike shows the frequency; its height shows the peak amplitude. A complete sine wave in the time domain can be represented by one single spike in the frequency domain. Example 3.7 The frequency domain is more compact and useful when we are dealing with more than one sine wave. For example, Figure 3.9 shows three sine waves, each with different amplitude and fre- quency. All can be represented by three spikes in the frequency domain. Figure 3.9 The time domain and frequency domain of three sine waves Amplitude Amplitude 15 15 10 10 5 5 Time 0 8 16 Frequency b. Frequency-domain representation of 1s the same three signals a. Time-domain representation of three sine waves with frequencies 0, 8, and 16 CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 63 3.2.5 Composite Signals So far, we have focused on simple sine waves. Simple sine waves have many applica- tions in daily life. We can send a single sine wave to carry electric energy from one place to another. For example, the power company sends a single sine wave with a fre- quency of 60 Hz to distribute electric energy to houses and businesses. As another example, we can use a single sine wave to send an alarm to a security center when a burglar opens a door or window in the house. In the first case, the sine wave is carrying energy; in the second, the sine wave is a signal of danger. If we had only one single sine wave to convey a conversation over the phone, it would make no sense and carry no information. We would just hear a buzz. As we will see in Chapters 4 and 5, we need to send a composite signal to communicate data. A composite signal is made of many simple sine waves. A single-frequency sine wave is not useful in data communications; we need to send a composite signal, a signal made of many simple sine waves. In the early 1900s, the French mathematician Jean-Baptiste Fourier showed that any composite signal is actually a combination of simple sine waves with different fre- quencies, amplitudes, and phases. Fourier analysis is discussed in Appendix E; for our purposes, we just present the concept. According to Fourier analysis, any composite signal is a combination of simple sine waves with different frequencies, amplitudes, and phases. Fourier analysis is discussed in Appendix E. A composite signal can be periodic or nonperiodic. A periodic composite signal can be decomposed into a series of simple sine waves with discrete frequencies— frequencies that have integer values (1, 2, 3, and so on). A nonperiodic composite sig- nal can be decomposed into a combination of an infinite number of simple sine waves with continuous frequencies, frequencies that have real values. If the composite signal is periodic, the decomposition gives a series of signals with discrete frequencies; if the composite signal is nonperiodic, the decomposition gives a combination of sine waves with continuous frequencies. Example 3.8 Figure 3.10 shows a periodic composite signal with frequency f. This type of signal is not typical of those found in data communications.We can consider it to be three alarm systems, each with a different frequency. The analysis of this signal can give us a good understanding of how to decompose signals. It is very difficult to manually decompose this signal into a series of simple sine waves. However, there are tools, both hardware and software, that can help us do the job. We are not con- cerned about how it is done; we are only interested in the result. Figure 3.11 shows the result of decomposing the above signal in both the time and frequency domains. The amplitude of the sine wave with frequency f is almost the same as the peak amplitude of the composite signal. The amplitude of the sine wave with frequency 3f is one-third of that of 64 PART II PHYSICAL LAYER Figure 3.10 A composite periodic signal Time Figure 3.11 Decomposition of a composite periodic signal in the time and frequency domains Amplitude Frequency f Frequency 3f Frequency 9f Time a. Time-domain decomposition of a composite signal Amplitude f 3f 9f Frequency b. Frequency-domain decomposition of the composite signal the first, and the amplitude of the sine wave with frequency 9f is one-ninth of the first. The fre- quency of the sine wave with frequency f is the same as the frequency of the composite signal; it is called the fundamental frequency, or first harmonic. The sine wave with frequency 3f has a frequency of 3 times the fundamental frequency; it is called the third harmonic. The third sine wave with frequency 9f has a frequency of 9 times the fundamental frequency; it is called the ninth harmonic. Note that the frequency decomposition of the signal is discrete; it has frequencies f, 3f, and 9f. Because f is an integral number, 3f and 9f are also integral numbers. There are no frequencies such as 1.2f or 2.6f. The frequency domain of a periodic composite signal is always made of dis- crete spikes. Example 3.9 Figure 3.12 shows a nonperiodic composite signal. It can be the signal created by a microphone or a telephone set when a word or two is pronounced. In this case, the composite signal cannot be periodic, because that implies that we are repeating the same word or words with exactly the same tone. CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 65 Figure 3.12 The time and frequency domains of a nonperiodic signal Amplitude Amplitude Amplitude for sine wave of frequency f Time 0 f 4 kHz Frequency a. Time domain b. Frequency domain In a time-domain representation of this composite signal, there are an infinite num- ber of simple sine frequencies. Although the number of frequencies in a human voice is infinite, the range is limited. A normal human being can create a continuous range of frequencies between 0 and 4 kHz. Note that the frequency decomposition of the signal yields a continuous curve. There are an infinite number of frequencies between 0.0 and 4000.0 (real values). To find the amplitude related to frequency f, we draw a vertical line at f to intersect the envelope curve. The height of the vertical line is the amplitude of the corresponding frequency. 3.2.6 Bandwidth The range of frequencies contained in a composite signal is its bandwidth. The band- width is normally a difference between two numbers. For example, if a composite signal contains frequencies between 1000 and 5000, its bandwidth is 5000 − 1000, or 4000. The bandwidth of a composite signal is the difference between the highest and the lowest frequencies contained in that signal. Figure 3.13 shows the concept of bandwidth. The figure depicts two composite signals, one periodic and the other nonperiodic. The bandwidth of the periodic signal contains all integer frequencies between 1000 and 5000 (1000, 1001, 1002,...). The bandwidth of the nonperiodic signals has the same range, but the frequencies are continuous. Example 3.10 If a periodic signal is decomposed into five sine waves with frequencies of 100, 300, 500, 700, and 900 Hz, what is its bandwidth? Draw the spectrum, assuming all components have a maxi- mum amplitude of 10 V. Solution Let fh be the highest frequency, fl the lowest frequency, and B the bandwidth. Then B 5 fh 2 fl 5 900 2 100 5 800 Hz 66 PART II PHYSICAL LAYER The spectrum has only five spikes, at 100, 300, 500, 700, and 900 Hz (see Figure 3.14). Figure 3.13 The bandwidth of periodic and nonperiodic composite signals Amplitude 1000 5000 Frequency Bandwidth = 5000 – 1000 = 4000 Hz a. Bandwidth of a periodic signal Amplitude 1000 5000 Frequency Bandwidth = 5000 – 1000 = 4000 Hz b. Bandwidth of a nonperiodic signal Figure 3.14 The bandwidth for Example 3.10 10 V 100 300 500 700 900 Frequency Bandwidth = 900 − 100 = 800 Hz Example 3.11 A periodic signal has a bandwidth of 20 Hz. The highest frequency is 60 Hz. What is the lowest frequency? Draw the spectrum if the signal contains all frequencies of the same amplitude. Solution Let fh be the highest frequency, fl the lowest frequency, and B the bandwidth. Then B 5 fh 2 fl 20 5 60 2 fl fl 5 60 2 20 5 40 Hz The spectrum contains all integer frequencies. We show this by a series of spikes (see Figure 3.15). Example 3.12 A nonperiodic composite signal has a bandwidth of 200 kHz, with a middle frequency of 140 kHz and peak amplitude of 20 V. The two extreme frequencies have an amplitude of 0. Draw the frequency domain of the signal. CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 67 Figure 3.15 The bandwidth for Example 3.11 40 41 42 58 59 60 Frequency Bandwidth = 60 − 40 = 20 Hz (Hz) Solution The lowest frequency must be at 40 kHz and the highest at 240 kHz. Figure 3.16 shows the fre- quency domain and the bandwidth. Figure 3.16 The bandwidth for Example 3.12 Amplitude 40 kHz 140 kHz 240 kHz Frequency Example 3.13 An example of a nonperiodic composite signal is the signal propagated by an AM radio station. In the United States, each AM radio station is assigned a 10-kHz bandwidth. The total bandwidth ded- icated to AM radio ranges from 530 to 1700 kHz. We will show the rationale behind this 10-kHz bandwidth in Chapter 5. Example 3.14 Another example of a nonperiodic composite signal is the signal propagated by an FM radio sta- tion. In the United States, each FM radio station is assigned a 200-kHz bandwidth. The total bandwidth dedicated to FM radio ranges from 88 to 108 MHz. We will show the rationale behind this 200-kHz bandwidth in Chapter 5. Example 3.15 Another example of a nonperiodic composite signal is the signal received by an old-fashioned analog black-and-white TV. A TV screen is made up of pixels (picture elements) with each pixel being either white or black. The screen is scanned 30 times per second. (Scanning is actually 60 times per second, but odd lines are scanned in one round and even lines in the next and then interleaved.) If we assume a resolution of 525 × 700 (525 vertical lines and 700 horizontal lines), which is a ratio of 3:4, we have 367,500 pixels per screen. If we scan the screen 30 times per sec- ond, this is 367,500 × 30 = 11,025,000 pixels per second. The worst-case scenario is alternating black and white pixels. In this case, we need to represent one color by the minimum amplitude and the other color by the maximum amplitude. We can send 2 pixels per cycle. Therefore, we need 11,025,000 / 2 = 5,512,500 cycles per second, or Hz. The bandwidth needed is 5.5124 MHz. 68 PART II PHYSICAL LAYER This worst-case scenario has such a low probability of occurrence that the assumption is that we need only 70 percent of this bandwidth, which is 3.85 MHz. Since audio and synchronization sig- nals are also needed, a 4-MHz bandwidth has been set aside for each black and white TV chan- nel. An analog color TV channel has a 6-MHz bandwidth. 3.3 DIGITAL SIGNALS In addition to being represented by an analog signal, information can also be repre- sented by a digital signal. For example, a 1 can be encoded as a positive voltage and a 0 as zero voltage. A digital signal can have more than two levels. In this case, we can send more than 1 bit for each level. Figure 3.17 shows two signals, one with two lev- els and the other with four. We send 1 bit per level in part a of the figure and 2 bits per level in part b of the figure. In general, if a signal has L levels, each level needs log2 L bits. For this reason, we can send log24 = 2 bits in part b. Figure 3.17 Two digital signals: one with two signal levels and the other with four signal levels Amplitude 8 bits sent in 1 s, Bit rate = 8 bps 1 0 1 1 0 0 0 1 Level 2 Level 1 1s Time a. A digital signal with two levels Amplitude 16 bits sent in 1 s, Bit rate = 16 bps 11 10 01 01 00 00 00 10 Level 4 Level 3 Level 2 1s Time Level 1 b. A digital signal with four levels Example 3.16 A digital signal has eight levels. How many bits are needed per level? We calculate the number of bits from the following formula. Each signal level is represented by 3 bits. Number of bits per level 5 log28 5 3 Example 3.17 A digital signal has nine levels. How many bits are needed per level? We calculate the number of bits by using the formula. Each signal level is represented by 3.17 bits. However, this answer is CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 69 not realistic. The number of bits sent per level needs to be an integer as well as a power of 2. For this example, 4 bits can represent one level. 3.3.1 Bit Rate Most digital signals are nonperiodic, and thus period and frequency are not appropri- ate characteristics. Another term—bit rate (instead of frequency)—is used to describe digital signals. The bit rate is the number of bits sent in 1s, expressed in bits per second (bps). Figure 3.17 shows the bit rate for two signals. Example 3.18 Assume we need to download text documents at the rate of 100 pages per second. What is the required bit rate of the channel? Solution A page is an average of 24 lines with 80 characters in each line. If we assume that one character requires 8 bits, the bit rate is 100 3 24 3 80 3 8 5 1,536,000 bps 5 1.536 Mbps Example 3.19 A digitized voice channel, as we will see in Chapter 4, is made by digitizing a 4-kHz bandwidth analog voice signal. We need to sample the signal at twice the highest frequency (two samples per hertz). We assume that each sample requires 8 bits. What is the required bit rate? Solution The bit rate can be calculated as 2 3 4000 3 8 5 64,000 bps 5 64 kbps Example 3.20 What is the bit rate for high-definition TV (HDTV)? Solution HDTV uses digital signals to broadcast high quality video signals. The HDTV screen is normally a ratio of 16 : 9 (in contrast to 4 : 3 for regular TV), which means the screen is wider. There are 1920 by 1080 pixels per screen, and the screen is renewed 30 times per second. Twenty-four bits represents one color pixel. We can calculate the bit rate as 1920 3 1080 3 30 3 24 5 1,492,992,000 ≈ 1.5 Gbps The TV stations reduce this rate to 20 to 40 Mbps through compression. 3.3.2 Bit Length We discussed the concept of the wavelength for an analog signal: the distance one cycle occupies on the transmission medium. We can define something similar for a digital signal: the bit length. The bit length is the distance one bit occupies on the transmis- sion medium. Bit length 5 propagation speed 3 bit duration 70 PART II PHYSICAL LAYER 3.3.3 Digital Signal as a Composite Analog Signal Based on Fourier analysis (See Appendix E), a digital signal is a composite analog sig- nal. The bandwidth is infinite, as you may have guessed. We can intuitively come up with this concept when we consider a digital signal. A digital signal, in the time domain, comprises connected vertical and horizontal line segments. A vertical line in the time domain means a frequency of infinity (sudden change in time); a horizontal line in the time domain means a frequency of zero (no change in time). Going from a frequency of zero to a frequency of infinity (and vice versa) implies all frequencies in between are part of the domain. Fourier analysis can be used to decompose a digital signal. If the digital signal is periodic, which is rare in data communications, the decomposed signal has a frequency- domain representation with an infinite bandwidth and discrete frequencies. If the digital signal is nonperiodic, the decomposed signal still has an infinite bandwidth, but the fre- quencies are continuous. Figure 3.18 shows a periodic and a nonperiodic digital signal and their bandwidths. Figure 3.18 The time and frequency domains of periodic and nonperiodic digital signals Time f 3f 5f 7f 9f 11f 13f Frequency a. Time and frequency domains of periodic digital signal Time 0 Frequency b. Time and frequency domains of nonperiodic digital signal Note that both bandwidths are infinite, but the periodic signal has discrete frequen- cies while the nonperiodic signal has continuous frequencies. 3.3.4 Transmission of Digital Signals The previous discussion asserts that a digital signal, periodic or nonperiodic, is a com- posite analog signal with frequencies between zero and infinity. For the remainder of the discussion, let us consider the case of a nonperiodic digital signal, similar to the ones we encounter in data communications. The fundamental question is, How can we send a digital signal from point A to point B? We can transmit a digital signal by using one of two different approaches: baseband transmission or broadband transmission (using modulation). CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 71 A digital signal is a composite analog signal with an infinite bandwidth. Baseband Transmission Baseband transmission means sending a digital signal over a channel without changing the digital signal to an analog signal. Figure 3.19 shows baseband transmission. Figure 3.19 Baseband transmission Digital signal Channel Baseband transmission requires that we have a low-pass channel, a channel with a bandwidth that starts from zero. This is the case if we have a dedicated medium with a bandwidth constituting only one channel. For example, the entire bandwidth of a cable connecting two computers is one single channel. As another example, we may connect several computers to a bus, but not allow more than two stations to communi- cate at a time. Again we have a low-pass channel, and we can use it for baseband com- munication. Figure 3.20 shows two low-pass channels: one with a narrow bandwidth and the other with a wide bandwidth. We need to remember that a low-pass channel with infinite bandwidth is ideal, but we cannot have such a channel in real life. How- ever, we can get close. Figure 3.20 Bandwidths of two low-pass channels Amplitude 0 a. Low-pass channel, wide bandwidth f1 Frequency Amplitude 0 f1 Frequency b. Low-pass channel, narrow bandwidth Let us study two cases of a baseband communication: a low-pass channel with a wide bandwidth and one with a limited bandwidth. 72 PART II PHYSICAL LAYER Case 1: Low-Pass Channel with Wide Bandwidth If we want to preserve the exact form of a nonperiodic digital signal with vertical seg- ments vertical and horizontal segments horizontal, we need to send the entire spectrum, the continuous range of frequencies between zero and infinity. This is possible if we have a dedicated medium with an infinite bandwidth between the sender and receiver that preserves the exact amplitude of each component of the composite signal. Although this may be possible inside a computer (e.g., between CPU and memory), it is not possible between two devices. Fortunately, the amplitudes of the frequencies at the border of the bandwidth are so small that they can be ignored. This means that if we have a medium, such as a coaxial or fiber optic cable, with a very wide bandwidth, two stations can communicate by using digital signals with very good accuracy, as shown in Figure 3.21. Note that f1 is close to zero, and f2 is very high. Figure 3.21 Baseband transmission using a dedicated medium Input signal bandwidth Bandwidth supported by medium Output signal bandwidth 0 ∞ f1 f2 f1 f2 t t Input signal Wide-bandwidth channel Output signal Although the output signal is not an exact replica of the original signal, the data can still be deduced from the received signal. Note that although some of the frequen- cies are blocked by the medium, they are not critical. Baseband transmission of a digital signal that preserves the shape of the digital signal is possible only if we have a low-pass channel with an infinite or very wide bandwidth. Example 3.21 An example of a dedicated channel where the entire bandwidth of the medium is used as one single channel is a LAN. Almost every wired LAN today uses a dedicated channel for two stations com- municating with each other. In a bus topology LAN with multipoint connections, only two stations can communicate with each other at each moment in time (timesharing); the other stations need to refrain from sending data. In a star topology LAN, the entire channel between each station and the hub is used for communication between these two entities. We study LANs in Chapter 13. Case 2: Low-Pass Channel with Limited Bandwidth In a low-pass channel with limited bandwidth, we approximate the digital signal with an analog signal. The level of approximation depends on the bandwidth available. Rough Approximation Let us assume that we have a digital signal of bit rate N. If we want to send analog sig- nals to roughly simulate this signal, we need to consider the worst case, a maximum number of changes in the digital signal. This happens when the signal carries the CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 73 sequence 01010101... or the sequence 10101010.... To simulate these two cases, we need an analog signal of frequency f = N/2. Let 1 be the positive peak value and 0 be the negative peak value. We send 2 bits in each cycle; the frequency of the analog signal is one-half of the bit rate, or N/2. However, just this one frequency cannot make all patterns; we need more components. The maximum frequency is N/2. As an example of this con- cept, let us see how a digital signal with a 3-bit pattern can be simulated by using analog signals. Figure 3.22 shows the idea. The two similar cases (000 and 111) are simulated with a signal with frequency f = 0 and a phase of 180° for 000 and a phase of 0° for 111. The two worst cases (010 and 101) are simulated with an analog signal with frequency f = N/2 and phases of 180° and 0°. The other four cases can only be simulated with an analog signal with f = N/4 and phases of 180°, 270°, 90°, and 0°. In other words, we need a chan- nel that can handle frequencies 0, N/4, and N/2. This rough approximation is referred to as using the first harmonic (N/2) frequency. The required bandwidth is N N Bandwidth 5 ---- 2 0 5 ---- 2 2 Figure 3.22 Rough approximation of a digital signal using the first harmonic for worst case Amplitude Bandwidth = N 2 0 N/4 N/2 Frequency Digital: bit rate N Digital: bit rate N Digital: bit rate N Digital: bit rate N 0 0 0 0 0 1 0 1 0 0 1 1 Analog: f = 0, p = 180 Analog: f = N/4, p = 180 Analog: f = N/2, p = 180 Analog: f = N/4, p = 270 Digital: bit rate N Digital: bit rate N Digital: bit rate N Digital: bit rate N 1 0 0 1 0 1 1 1 0 1 1 1 Analog: f = N/4, p = 90 Analog: f = N/2, p = 0 Analog: f = N/4, p = 0 Analog: f = 0, p = 0 Better Approximation To make the shape of the analog signal look more like that of a digital signal, we need to add more harmonics of the frequencies. We need to increase the bandwidth. We can increase the bandwidth to 3N/2, 5N/2, 7N/2, and so on. Figure 3.23 shows the effect of 74 PART II PHYSICAL LAYER Figure 3.23 Simulating a digital signal with first three harmonics Amplitude Bandwidth = 5N 2 0 N/4 N/2 3N/4 3N/2 5N/4 5N/2 Frequency Digital: bit rate N Analog: f = N/2 and 3N/2 0 1 0 Analog: f = N/2 Analog: f = N/2, 3N/2, and 5N/2 this increase for one of the worst cases, the pattern 010. Note that we have shown only the highest frequency for each harmonic. We use the first, third, and fifth harmonics. The required bandwidth is now 5N/2, the difference between the lowest frequency 0 and the highest frequency 5N/2. As we emphasized before, we need to remember that the required bandwidth is proportional to the bit rate. In baseband transmission, the required bandwidth is proportional to the bit rate; if we need to send bits faster, we need more bandwidth. By using this method, Table 3.2 shows how much bandwidth we need to send data at different rates. Table 3.2 Bandwidth requirements Bit Rate Harmonic 1 Harmonics 1, 3 Harmonics 1, 3, 5 n = 1 kbps B = 500 Hz B = 1.5 kHz B = 2.5 kHz n = 10 kbps B = 5 kHz B = 15 kHz B = 25 kHz n = 100 kbps B = 50 kHz B = 150 kHz B = 250 kHz Example 3.22 What is the required bandwidth of a low-pass channel if we need to send 1 Mbps by using base- band transmission? CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 75 Solution The answer depends on the accuracy desired. a. The minimum bandwidth, a rough approximation, is B = bit rate /2, or 500 kHz. We need a low-pass channel with frequencies between 0 and 500 kHz. b. A better result can be achieved by using the first and the third harmonics with the required bandwidth B = 3 × 500 kHz = 1.5 MHz. c. A still better result can be achieved by using the first, third, and fifth harmonics with B = 5 × 500 kHz = 2.5 MHz. Example 3.23 We have a low-pass channel with bandwidth 100 kHz. What is the maximum bit rate of this channel? Solution The maximum bit rate can be achieved if we use the first harmonic. The bit rate is 2 times the available bandwidth, or 200 kbps. Broadband Transmission (Using Modulation) Broadband transmission or modulation means changing the digital signal to an ana- log signal for transmission. Modulation allows us to use a bandpass channel—a channel with a bandwidth that does not start from zero. This type of channel is more available than a low-pass channel. Figure 3.24 shows a bandpass channel. Figure 3.24 Bandwidth of a bandpass channel Amplitude f1 f2 Frequency Bandpass channel Note that a low-pass channel can be considered a bandpass channel with the lower frequency starting at zero. Figure 3.25 shows the modulation of a digital signal. In the figure, a digital signal is converted to a composite analog signal. We have used a single-frequency analog signal (called a carrier); the amplitude of the carrier has been changed to look like the digital sig- nal. The result, however, is not a single-frequency signal; it is a composite signal, as we will see in Chapter 5. At the receiver, the received analog signal is converted to digital, and the result is a replica of what has been sent. If the available channel is a bandpass channel, we cannot send the digital signal directly to the channel; we need to convert the digital signal to an analog signal before transmission. 76 PART II PHYSICAL LAYER Figure 3.25 Modulation of a digital signal for transmission on a bandpass channel Input digital signal t Output digital signal t Digital/analog Analog/digital converter converter Input analog signal bandwidth Available bandwidth Output analog signal bandwidth f1 f2 f1 f2 f1 f2 t Bandpass channel t Input analog signal Input analog signal Example 3.24 An example of broadband transmission using modulation is the sending of computer data through a telephone subscriber line, the line connecting a resident to the central telephone office. These lines, installed many years ago, are designed to carry voice (analog signal) with a limited band- width (frequencies between 0 and 4 kHz). Although this channel can be used as a low-pass chan- nel, it is normally considered a bandpass channel. One reason is that the bandwidth is so narrow (4 kHz) that if we treat the channel as low-pass and use it for baseband transmission, the maximum bit rate can be only 8 kbps. The solution is to consider the channel a bandpass channel, convert the digital signal from the computer to an analog signal, and send the analog signal. We can install two converters to change the digital signal to analog and vice versa at the receiving end. The converter, in this case, is called a modem (modulator/demodulator), which we discuss in detail in Chapter 5. Example 3.25 A second example is the digital cellular telephone. For better reception, digital cellular phones convert the analog voice signal to a digital signal (see Chapter 16). Although the bandwidth allo- cated to a company providing digital cellular phone service is very wide, we still cannot send the digital signal without conversion. The reason is that we only have a bandpass channel available between caller and callee. For example, if the available bandwidth is W and we allow 1000 cou- ples to talk simultaneously, this means the available channel is W/1000, just part of the entire bandwidth. We need to convert the digitized voice to a composite analog signal before sending. The digital cellular phones convert the analog audio signal to digital and then convert it again to analog for transmission over a bandpass channel. 3.4 TRANSMISSION IMPAIRMENT Signals travel through transmission media, which are not perfect. The imperfection causes signal impairment. This means that the signal at the beginning of the medium is not the CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 77 same as the signal at the end of the medium. What is sent is not what is received. Three causes of impairment are attenuation, distortion, and noise (see Figure 3.26). Figure 3.26 Causes of impairment Impairment causes Attenuation Distortion Noise 3.4.1 Attenuation Attenuation means a loss of energy. When a signal, simple or composite, travels through a medium, it loses some of its energy in overcoming the resistance of the medium. That is why a wire carrying electric signals gets warm, if not hot, after a while. Some of the electrical energy in the signal is converted to heat. To compensate for this loss, amplifiers are used to amplify the signal. Figure 3.27 shows the effect of attenuation and amplification. Figure 3.27 Attenuation Original Attenuated Amplified Amplifier Point 1 Transmission medium Point 2 Point 3 Decibel To show that a signal has lost or gained strength, engineers use the unit of the decibel. The decibel (dB) measures the relative strengths of two signals or one signal at two dif- ferent points. Note that the decibel is negative if a signal is attenuated and positive if a signal is amplified. P2 dB 5 10 log10 ------ P1 Variables P1 and P2 are the powers of a signal at points 1 and 2, respectively. Note that some engineering books define the decibel in terms of voltage instead of power. In this case, because power is proportional to the square of the voltage, the formula is dB = 20 log 10 (V2/V1). In this text, we express dB in terms of power. 78 PART II PHYSICAL LAYER Example 3.26 Suppose a signal travels through a transmission medium and its power is reduced to one-half. This means that P2 = 1--2- P1. In this case, the attenuation (loss of power) can be calculated as P2 0.5P 1 10 log10 ------ 5 10 log10 -------------- 5 10 log100.5 5 10(–0.3) 5 –3 dB P1 P1 A loss of 3 dB (−3 dB) is equivalent to losing one-half the power. Example 3.27 A signal travels through an amplifier, and its power is increased 10 times. This means that P2 = 10P1. In this case, the amplification (gain of power) can be calculated as P2 10P 1 10 log10 ------ 5 10 log10 ------------ 5 10 log1010 5 10(1) 5 10 dB P1 P1 Example 3.28 One reason that engineers use the decibel to measure the changes in the strength of a signal is that decibel numbers can be added (or subtracted) when we are measuring several points (cascading) instead of just two. In Figure 3.28 a signal travels from point 1 to point 4. The signal is attenuated by the time it reaches point 2. Between points 2 and 3, the signal is amplified. Again, between points 3 and 4, the signal is attenuated. We can find the resultant decibel value for the signal just by adding the decibel measurements between each set of points. Figure 3.28 Decibels for Example 3.28 1 dB –3 dB 7 dB –3 dB Amplifier Point 1 Transmission Point 2 Point 3 Transmission Point 4 medium medium In this case, the decibel value can be calculated as dB 5 23 1 7 23 5 11 The signal has gained in power. Example 3.29 Sometimes the decibel is used to measure signal power in milliwatts. In this case, it is referred to as dBm and is calculated as dBm = 10 log10 Pm, where Pm is the power in milliwatts. Calculate the power of a signal if its dBm = −30. Solution We can calculate the power in the signal as dBm 5 10 log10 dBm 5 230 log10Pm 5 23 Pm 5 1023 mW CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 79 Example 3.30 The loss in a cable is usually defined in decibels per kilometer (dB/km). If the signal at the beginning of a cable with −0.3 dB/km has a power of 2 mW, what is the power of the signal at 5 km? Solution The loss in the cable in decibels is 5 × (−0.3) = −1.5 dB. We can calculate the power as dB 5 10 log10 (P2 / P1) 5 21.5 (P2 / P1) 5 10 20.15 5 0.71 P2 5 0.71P1 5 0.7 3 2 mW 5 1.4 mW 3.4.2 Distortion Distortion means that the signal changes its form or shape. Distortion can occur in a composite signal made of different frequencies. Each signal component has its own propagation speed (see the next section) through a medium and, therefore, its own delay in arriving at the final destination. Differences in delay may create a difference in phase if the delay is not exactly the same as the period duration. In other words, signal components at the receiver have phases different from what they had at the sender. The shape of the composite signal is therefore not the same. Figure 3.29 shows the effect of distortion on a composite signal. Figure 3.29 Distortion Composite signal Composite signal sent received Components, Components, in phase out of phase At the sender At the receiver 3.4.3 Noise Noise is another cause of impairment. Several types of noise, such as thermal noise, induced noise, crosstalk, and impulse noise, may corrupt the signal. Thermal noise is the random motion of electrons in a wire, which creates an extra signal not originally sent by the transmitter. Induced noise comes from sources such as motors and applianc- ses. These devices act as a sending antenna, and the transmission medium acts as the receiving antenna. Crosstalk is the effect of one wire on the other. One wire acts as a sending antenna and the other as the receiving antenna. Impulse noise is a spike (a sig- nal with high energy in a very short time) that comes from power lines, lightning, and so on. Figure 3.30 shows the effect of noise on a signal. We discuss error in Chapter 10. 80 PART II PHYSICAL LAYER Figure 3.30 Noise Transmitted Noise Received Point 1 Transmission medium Point 2 Signal-to-Noise Ratio (SNR) As we will see later, to find the theoretical bit rate limit, we need to know the ratio of the signal power to the noise power. The signal-to-noise ratio is defined as average signal power SNR 5 ------------------------------------------------------ average noise power We need to consider the average signal power and the average noise power because these may change with time. Figure 3.31 shows the idea of SNR. Figure 3.31 Two cases of SNR: a high SNR and a low SNR Signal Noise Signal + noise a. High SNR Signal Noise Signal + noise b. Low SNR SNR is actually the ratio of what is wanted (signal) to what is not wanted (noise). A high SNR means the signal is less corrupted by noise; a low SNR means the signal is more corrupted by noise. Because SNR is the ratio of two powers, it is often described in decibel units, SNRdB, defined as SNRdB 5 10 log10 SNR CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 81 Example 3.31 The power of a signal is 10 mW and the power of the noise is 1 μW; what are the values of SNR and SNRdB? Solution The values of SNR and SNRdB can be calculated as follows: SNR 5 (10,000 mw) / (1 mw) 5 10,000 SNRdB 5 10 log10 10,000 5 10 log10 104 5 40 Example 3.32 The values of SNR and SNRdB for a noiseless channel are SNR 5 (signal power) / 0 5 ∞ SNRdB 5 10 log10 ∞ 5 ∞ We can never achieve this ratio in real life; it is an ideal. 3.5 DATA RATE LIMITS A very important consideration in data communications is how fast we can send data, in bits per second, over a channel. Data rate depends on three factors: 1. The bandwidth available 2. The level of the signals we use 3. The quality of the channel (the level of noise) Two theoretical formulas were developed to calculate the data rate: one by Nyquist for a noiseless channel, another by Shannon for a noisy channel. 3.5.1 Noiseless Channel: Nyquist Bit Rate For a noiseless channel, the Nyquist bit rate formula defines the theoretical maximum bit rate BitRate 5 2 3 bandwidth 3 log2L In this formula, bandwidth is the bandwidth of the channel, L is the number of signal levels used to represent data, and BitRate is the bit rate in bits per second. According to the formula, we might think that, given a specific bandwidth, we can have any bit rate we want by increasing the number of signal levels. Although the idea is theoretically correct, practically there is a limit. When we increase the number of sig- nal levels, we impose a burden on the receiver. If the number of levels in a signal is just 2, the receiver can easily distinguish between a 0 and a 1. If the level of a signal is 64, the receiver must be very sophisticated to distinguish between 64 different levels. In other words, increasing the levels of a signal reduces the reliability of the system. Increasing the levels of a signal may reduce the reliability of the system. 82 PART II PHYSICAL LAYER Example 3.33 Does the Nyquist theorem bit rate agree with the intuitive bit rate described in baseband transmission? Solution They match when we have only two levels. We said, in baseband transmission, the bit rate is 2 times the bandwidth if we use only the first harmonic in the worst case. However, the Nyquist formula is more general than what we derived intuitively; it can be applied to baseband transmis- sion and modulation. Also, it can be applied when we have two or more levels of signals. Example 3.34 Consider a noiseless channel with a bandwidth of 3000 Hz transmitting a signal with two signal levels. The maximum bit rate can be calculated as BitRate 5 2 3 3000 3 log22 5 6000 bps Example 3.35 Consider the same noiseless channel transmitting a signal with four signal levels (for each level, we send 2 bits). The maximum bit rate can be calculated as BitRate 5 2 3 3000 3 log24 5 12,000 bps Example 3.36 We need to send 265 kbps over a noiseless channel with a bandwidth of 20 kHz. How many sig- nal levels do we need? Solution We can use the Nyquist formula as shown: 265,000 5 2 3 20,000 3 log2L log2L 5 6.625 L 5 26.625 5 98.7 levels Since this result is not a power of 2, we need to either increase the number of levels or reduce the bit rate. If we have 128 levels, the bit rate is 280 kbps. If we have 64 levels, the bit rate is 240 kbps. 3.5.2 Noisy Channel: Shannon Capacity In reality, we cannot have a noiseless channel; the channel is always noisy. In 1944, Claude Shannon introduced a formula, called the Shannon capacity, to determine the theoretical highest data rate for a noisy channel: Capacity 5 bandwidth 3 log2(1 1 SNR) In this formula, bandwidth is the bandwidth of the channel, SNR is the signal-to- noise ratio, and capacity is the capacity of the channel in bits per second. Note that in the Shannon formula there is no indication of the signal level, which means that no matter how many levels we have, we cannot achieve a data rate higher than the capacity of the channel. In other words, the formula defines a characteristic of the channel, not the method of transmission. CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 83 Example 3.37 Consider an extremely noisy channel in which the value of the signal-to-noise ratio is almost zero. In other words, the noise is so strong that the signal is faint. For this channel the capacity C is calculated as C 5 B log2 (1 1 SNR) 5 B log2(1 1 0) 5 B log21 5 B 3 0 5 0 This means that the capacity of this channel is zero regardless of the bandwidth. In other words, we cannot receive any data through this channel. Example 3.38 We can calculate the theoretical highest bit rate of a regular telephone line. A telephone line nor- mally has a bandwidth of 3000 Hz (300 to 3300 Hz) assigned for data communications. The signal-to-noise ratio is usually 3162. For this channel the capacity is calculated as C 5 B log2 (1 1 SNR) 5 3000 log2(1 1 3162) 5 3000 3 11.62 5 34,860 bps This means that the highest bit rate for a telephone line is 34.860 kbps. If we want to send data faster than this, we can either increase the bandwidth of the line or improve the signal-to-noise ratio. Example 3.39 The signal-to-noise ratio is often given in decibels. Assume that SNRdB 5 36 and the channel bandwidth is 2 MHz. The theoretical channel capacity can be calculated as SNRdB 5 10 log10SNR SNR 5 10SNRdB/10 SNR 5 10 3.6 5 3981 C 5 B log2(1 1 SNR) 5 2 3 106 3 log23982 5 24 Mbps Example 3.40 When the SNR is very high, we can assume that SNR + 1 is almost the same as SNR. In these cases, the theoretical channel capacity can be simplified to C 5 B 3 SNRdB. For example, we can calculate the theoretical capacity of the previous example as C 5 2 MHz 3 (36 / 3) 5 24 Mbps 3.5.3 Using Both Limits In practice, we need to use both methods to find the limits and signal levels. Let us show this with an example. Example 3.41 We have a channel with a 1-MHz bandwidth. The SNR for this channel is 63. What are the appro- priate bit rate and signal level? Solution First, we use the Shannon formula to find the upper limit. C 5 B log2(1 1 SNR) 5 106 log2(1 1 63) 5 106 log264 5 6 Mbps The Shannon formula gives us 6 Mbps, the upper limit. For better performance we choose something lower, 4 Mbps, for example. Then we use the Nyquist formula to find the number of signal levels. 84 PART II PHYSICAL LAYER 4 Mbps 5 2 3 1 MHz 3 log2L L54 The Shannon capacity gives us the upper limit; the Nyquist formula tells us how many signal levels we need. 3.6 PERFORMANCE Up to now, we have discussed the tools of transmitting data (signals) over a network and how the data behave. One important issue in networking is the performance of the network—how good is it? We discuss quality of service, an overall measurement of network performance, in greater detail in Chapter 30. In this section, we introduce terms that we need for future chapters. 3.6.1 Bandwidth One characteristic that measures network performance is bandwidth. However, the term can be used in two different contexts with two different measuring values: bandwidth in hertz and bandwidth in bits per second. Bandwidth in Hertz We have discussed this concept. Bandwidth in hertz is the range of frequencies con- tained in a composite signal or the range of frequencies a channel can pass. For exam- ple, we can say the bandwidth of a subscriber telephone line is 4 kHz. Bandwidth in Bits per Seconds The term bandwidth can also refer to the number of bits per second that a channel, a link, or even a network can transmit. For example, one can say the bandwidth of a Fast Ethernet network (or the links in this network) is a maximum of 100 Mbps. This means that this network can send 100 Mbps. Relationship There is an explicit relationship between the bandwidth in hertz and bandwidth in bits per second. Basically, an increase in bandwidth in hertz means an increase in bandwidth in bits per second. The relationship depends on whether we have baseband transmission or transmission with modulation. We discuss this relationship in Chapters 4 and 5. In networking, we use the term bandwidth in two contexts. ❑ The first, bandwidth in hertz, refers to the range of frequencies in a composite sig- nal or the range of frequencies that a channel can pass. ❑ The second, bandwidth in bits per second, refers to the speed of bit transmission in a channel or link. CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 85 Example 3.42 The bandwidth of a subscriber line is 4 kHz for voice or data. The bandwidth of this line for data trans- mission can be up to 56,000 bps using a sophisticated modem to change the digital signal to analog. Example 3.43 If the telephone company improves the quality of the line and increases the bandwidth to 8 kHz, we can send 112,000 bps by using the same technology as mentioned in Example 3.42. 3.6.2 Throughput The throughput is a measure of how fast we can actually send data through a network. Although, at first glance, bandwidth in bits per second and throughput seem the same, they are different. A link may have a bandwidth of B bps, but we can only send T bps through this link with T always less than B. In other words, the bandwidth is a potential measurement of a link; the throughput is an actual measurement of how fast we can send data. For example, we may have a link with a bandwidth of 1 Mbps, but the devices connected to the end of the link may handle only 200 kbps. This means that we cannot send more than 200 kbps through this link. Imagine a highway designed to transmit 1000 cars per minute from one point to another. However, if there is congestion on the road, this figure may be reduced to 100 cars per minute. The bandwidth is 1000 cars per minute; the throughput is 100 cars per minute. Example 3.44 A network with bandwidth of 10 Mbps can pass only an average of 12,000 frames per minute with each frame carrying an average of 10,000 bits. What is the throughput of this network? Solution We can calculate the throughput as Throughput 5 (12,000 3 10,000) / 60 5 2 Mbps The throughput is almost one-fifth of the bandwidth in this case. 3.6.3 Latency (Delay) The latency or delay defines how long it takes for an entire message to completely arrive at the destination from the time the first bit is sent out from the source. We can say that latency is made of four components: propagation time, transmission time, queuing time and processing delay. Latency 5 propagation time 1 transmission time 1 queuing time 1 processing delay Propagation Time Propagation time measures the time required for a bit to travel from the source to the destination. The propagation time is calculated by dividing the distance by the propaga- tion speed. Propagation time 5 Distance / (Propagation Speed) 86 PART II PHYSICAL LAYER The propagation speed of electromagnetic signals depends on the medium and on the frequency of the signal. For example, in a vacuum, light is propagated with a speed of 3 × 108 m/s. It is lower in air; it is much lower in cable. Example 3.45 What is the propagation time if the distance between the two points is 12,000 km? Assume the propagation speed to be 2.4 × 108 m/s in cable. Solution We can calculate the propagation time as Propagation time 5 (12,000 3 10,000) / (2.4 3 28) 5 50 ms The example shows that a bit can go over the Atlantic Ocean in only 50 ms if there is a direct cable between the source and the destination. Transmission Time In data communications we don’t send just 1 bit, we send a message. The first bit may take a time equal to the propagation time to reach its destination; the last bit also may take the same amount of time. However, there is a time between the first bit leaving the sender and the last bit arriving at the receiver. The first bit leaves earlier and arrives ear- lier; the last bit leaves later and arrives later. The transmission time of a message depends on the size of the message and the bandwidth of the channel. Transmission time 5 (Message size) / Bandwidth Example 3.46 What are the propagation time and the transmission time for a 2.5-KB (kilobyte) message (an e- mail) if the bandwidth of the network is 1 Gbps? Assume that the distance between the sender and the receiver is 12,000 km and that light travels at 2.4 × 108 m/s. Solution We can calculate the propagation and transmission time as Propagation time 5 (12,000 3 1000) / (2.4 3 108) 5 50 ms Transmission time 5 (2500 3 8) / 109 5 0.020 ms Note that in this case, because the message is short and the bandwidth is high, the dominant factor is the propagation time, not the transmission time. The transmission time can be ignored. Example 3.47 What are the propagation time and the transmission time for a 5-MB (megabyte) message (an image) if the bandwidth of the network is 1 Mbps? Assume that the distance between the sender and the receiver is 12,000 km and that light travels at 2.4 × 108 m/s. Solution We can calculate the propagation and transmission times as Propagation time 5 (12,000 3 1000) / (2.4 3 108) 5 50 ms Transmission time 5 (5,000,000 3 8) /106 5 40 s CHAPTER 3 INTRODUCTION TO PHYSICAL LAYER 87 Note that in this case, because the message is very long and the bandwidth is not very high, the dominant factor is the transmission time, not the propagation time. The propa- gation time can be ignored. Queuing Time The third component in latency is the queuing time, the time needed for each interme- diate or end device to hold the message before it can be processed. The queuing time is not a fixed factor; it changes with the load imposed on the network. When there is heavy traffic on the network, the queuing time increases. An intermediate device, such as a router, queues the arrived messages and processes them one by one. If there are many messages, each message will have to wait. 3.6.4 Bandwidth-Delay Product Bandwidth and delay are two performance metrics of a link. However, as we will see in this chapter and future chapters, what is very important in data communications is the product of the two, the bandwidth-delay product. Let us elaborate on this issue, using two hypothetical cases as examples. ❑ Case 1. Figure 3.32 shows case 1. Figure 3.32 Filling the link with bits for case 1 Sender Receiver Bandwidth: 1 bps Delay: 5 s Bandwidth × delay = 5 bits After 1 s 1st bit After 2 s 2nd bit 1st bit After 3 s 3rd bit 2nd bit 1st bit After 4 s 4th bit 3rd bit 2nd bit 1st bit After 5 s 5th bit 4th bit 3rd bit 2nd bit 1st bit 1s 1s 1s 1s 1s Let us assume that we have a link with a bandwidth of 1 bps (unrealistic, but good for demonstration purposes). We also assume that the delay of the link is 5 s (also unrealistic). We want to see what the bandwidth-delay product means in this case. Looking at the figure, we can say that this product 1 × 5 is the maximum number of bits that can fill the link. There can be no more than 5 bits at any time on the link. ❑ Case 2. Now assume we have a bandwidth of 5 bps. Figure 3.33 shows that there can be maximum 5 × 5 = 25 bits on the line. The reason is that, at each second, there are 5 bits on the line; the duration of each bit is 0.20 s. The above two cases show that the product of bandwidth and delay is the number of bits that can fill the link. This measurement is important if we need to send data in bursts and wait for the acknowledgment of each burst before sending the next one. To use the maximum capability of the link, we need to make the size of our burst 2 times the product 88 PART II PHYSICAL LAYER Figure 3.33 Filling the link with bits in case 2 Sender Receiver Bandwidth: 5 bps Delay: 5 s Bandwidth × delay = 25 bits First 5 bits After 1 s First 5 bits After 2 s First 5 bits After 3 s First 5 bits After 4 s First 5 bits After 5 s 1s 1s 1s 1s 1s of bandwidth and delay; we need to fill up the full-duplex channel (two directions). The sender should send a burst of data of (2 × bandwidth × delay) bits. The sender then waits for receiver acknowledgment for part of the burst before sending another burst. The amount 2 × bandwidth × delay is the number of bits that can be in transition at any time. The bandwidth-delay product defines the number of bits that can fill the link. Example 3.48 We can think about the link between two points as a pipe. The cross section of the pipe represents the bandwidth, and the length of the pipe represents the delay. We can say the volume of the pipe defines the bandwidth-delay product, as shown in Figure 3.34. Figure 3.34 Concept of bandwidth-delay product Length: delay Cross section: bandwidth Volume: bandwidth × delay 3.6.5 Jitter Another performance issue that is related to delay is jitter. We can roughly say that jit- ter is a problem if different packets of data encounter different delays and the applica- tion using the data at the receiver site is time-sensitive (audio and video data, for example). If the delay for the first packet is 20 ms, for the second is 45 ms, and for the third is 40 ms, then the real-time application that uses the packets endures jitter. We dis- cuss jitter in greater detail in Chapter 28.