8 The Physical Layer
Prof. Bhushan Trivedi
Introduction
The physical layer is the first layer that we start learning about. Study of the physical layer is important for more than one reason. First and foremost, it is the layer that deals with data communication, i.e. sending bits across. Recall the analogy that we used in the first module. It is a truck driver and doing the job of carrying everything that we send and receive. If there is no physical layer, there is no network!
The other reason for physical layer being important is that it limits the functioning of other layers to a large extent. There are two options to choose for a physical layer, one is wired and another is wireless. Our choice determines what the other layers have to do. A wired physical layer, in the current context, is quite robust and we can forgo error handling (Ethernet is a popular example) at the next layer, the data link layer. Unlike that, if we opt for a wireless physical layer, we need to provide elaborate measures to handle errors at the data link layer. The wired physical layer can go for much larger sizes of frames compared to wireless physical layer, thus this choice also affects the frame size one will use at the data link layer. All in all, both types of physical layers are so different that the data link layer must come out with different strategies to manage them. In fact, the data transmission speed depends heavily on how fast the physical layer sends data across. The frame format, if elaborate error handing is to be done, requires specific fields and thus changes with respect to type of physical layer.
Let us first begin with what a physical layer should do to provide services it intends to provide.
Duties of Physical Layer
Primarily, the physical layer has to carry the bits across. In other words, the physical layer of the sender picks up bits to be sent, convert them into some form of the electromagnetic wave and send them to the other end. At the other end, the physical layer of the receiver collects those waves, interpret them as bits and pass it up the data link layer. The physical layer have no idea what that bit indicates, it is a roll number of a student or name of a customer or a phone number of an employee, it just pass it over to the other end1. The electromagnetic wave is generated either by electric power, i.e. by moving electrons (in copper cable), or by optical power, i.e. by moving photons (in fiber optic cables).
1 That is why this process is known as data communication and not information communication, the carrier does not know the meaning of what is being transmitted.
When the communication happens through a wire, the wave travels along the direction the wire is laid out and thus called guided communication. Unlike that, the wireless transmission moves along the straight line and called unguided. Thus, the first duty of the physical layer is restated as, converting the bits into some form of EM signals at the sender’s end and vice versa at the receiver.
Though wired and wireless modes are different, what they transmit remains the same, the EM waves, and thus there is a striking similarity in some of the issues of both types of transmission. In the case of wired communication, the EM waves used by different communication methods are different; for example, FO uses EM waves with very high frequencies as compared to the copper cables.
The second duty of the physical layer is to see the right delivery; i.e. the data is given only to the intended recipient and not anybody else. This is particularly important where there is more than one recipient in line. To deliver to the right candidate, some form of addressing mechanism must be provided by the physical layer. Each recipient is identified by a unique address.
During this delivery process, there are three distinct problems that might occur when the sender and receiver start communicating and have little idea about the status of the other party.
Unaware receiver: – in this case sender is sending but receiver is unaware and thus the data is not delivered.
Speed Mismatch: – in this case, the sender is sending at speed more than the receiver can handle, some of the data is dropped by the receiving physical layer in this case. Figure 9.2 describes the case.
Multiple non-synchronized receivers: – in this case, a sender is sending to multiple recipients one after another. If there is a problem with synchronization, the data intended for one recipient will be given to another and that is what creates a problem. The bigger issue is, once the sender and receiver are out of sync, it continues to do so unless some special care is taken. Figure 9.3 indicates a case where one sender is sending to multiple receivers. Here it is an intermediary receiver, which may not exist in some cases and some mechanism to find out a typical slot for a receiver is calculated at the sender itself. When that is done, the synchronization between sender and receiver becomes very important. In figure 9.4, a case is shown where sender starts sending little late and misses the first receiver. The second receiver gets the data intended for the first receiver and so on and no receiver gets the correct data.
It is also important to note that the sender and receiver, in this case, are synchronized over time. Each receiver is receiving at a particular time slot. Thus if the first receiver has to start receiving at 00:12:05, and continue till 00:12:10, while the second receiver has to start receiving at 00:12:10 and receive till 00:12:15, and the sender starts at 00:12:10 instead of 00:12:05, the first receiver is completely missed which is shown in that figure. Even if the sender misses it by some other margin, the problem will still remain as data of one receiver will be delivered to another even if the sender starts one second later.
Instead of time synchronization, the sender and receiver may be synchronized with frequency. For example, it is possible for each receiver to have a specific frequency to the receiver. The sender sends over each of the frequencies one after another. The synchronization problem occurs here as well as the sender and receiver, if work at different frequencies, cannot communicate. The sender must be sending at the exact frequency at which the receiver is listening.
Synchronization problem occurs due to many other issues. Consider figures 9.5 and 9.6. when the sender considers a length of the time slot as t and the receiver considers a different value for a timeslot, 1.25t, the difference is good enough for the sender to send 5 ones and receiver to interpret as four ones.
Even when the out of sync time slots is not completely out of sync, a typical characteristic of the physical layer makes it so. In a case of the electric circuits which measure the value of the wave, it does so in the middle of the time slot. If there are two values possible, for example, -5 V for 0 and +5 for 1, the receiver considers the value when it measures the timeslot, the middle value. Figure 9.7 and 9.8 indicates how that happens. When a sender is sending 10111101, the receiver receives 11011111110011.
The fourth duty is called multiplexing and demultiplexing. When there are multiple senders sending and multiple senders receiving on the same line, the physical layer needs to carry all of them and deliver each one of them to their right recipient. Let us look at few other important data link layer duties one by one.
Machine port level addressing
There may be more than one physical connections for a given machine. For example, each laptop has a wired as well a wireless connections possible. The routers have as many connections as the networks they are connected to. The physical ports which connect networks are known as interfaces. Thus a laptop has two interfaces, a wired Ethernet and a wireless, for example. A desktop might have only one wired interface and a router might have multiple interfaces. Interestingly, a single card may represent multiple virtual interfaces. One of the important jobs of the physical layer is to direct the traffic to right interface.
Look at figure 9.9. The router R has three interfaces, connecting it to R1, R2 and R3 routers. Whenever a frame is to be sent to any one of the routers, the data link layer provides that frame to the physical layer which passes it to the respective interface. In a normal computer case, the NIC cards contain both physical and data link layer where we have a different physical layer for a different interface and thus one physical layer is connected with only one interface. When we use a virtual interface (for example, take a case of the virtual network where R1 R2 and R3 are connected to a virtual network), there is a single card represents multiple interfaces where this becomes important.
When modern switches or routers operate, they have one controller (you can call it running the physical layer), controlling multiple ports. In that case, their physical layer does need to work as we mentioned above. It will have to decide the right interface or port number and forward the traffic to that port.
Coding schemes and synchronization
Bits, when sent over the physical line, needs to be sent in a fashion which can improve the rate of sending as well as improve the error handling. Both wired and wireless transmission uses different coding schemes for transferring their data. You can refer to reference-2 for details of some popular schemes used in practice. Such schemes are popularly known as coding mechanisms.
For example, let us try to learn the technique used by the first version of Ethernet, the Manchester encoding which we mentioned in the previous module.
The Manchester encoding seems wasteful. It uses two symbols (one high and one low) for sending one bit. That means, to achieve the bitrate specified in the first version of Ethernet, 10 Mb, the Manchester encoding requires the cards to work at 20 M/symbols per second; i.e. double the speed. Why? Let us try to understand. A brief answer is, to achieve synchronization.
We have already seen that the synchronizing between sender and receiver is critical for the physical layer. If sender and receiver’s clock are not synchronized, the sender sends something and receiver receives something else.
Let us try to understand what exactly is the problem and what is the solution to it. First of all, the sender has no clue about the time the receiver’s clock has as both of them are running their own clock and there is no central authority to confirm their time. Both sender and receiver must synchronize their clock before any real communication to take place. The modern clocks may be very precise but the data rate at which current networks operate makes it even harder for the clocks to synchronize. For example, a 10Gb Ethernet requires 1010 ticks every second. A drift of 1/100 second can wipe 108 bytes (10Mb), which can be a file of a moderate size!
Once we have seen what the problem is, let us try to see if we can solve it. The receiver, keep of testing the input and try to gauge the speed of the sender and try to sync before the actual transmission. In most cases, a frame is preceded by a preamble. One such example of a preamble is used in Ethernet which is 8 bytes in size containing a pattern of 101010… such a pattern indicates when sender moved from 1 to 0 and 0 to 1. Now if the sender is faster than receiver, the transition happens before receiver expects it and if the sender is slower, it happens later. Thus the receiver will have 8 * 8 = 64 bits to judge the speed of the sender.
Something similar happens while the sender uses a scheme like Manchester Encoding. Every bit has a transition in the middle. That means receiver if out of sync with the sender, have a chance to set it right every bit and it is unlikely that the receiver gets out of sync with the sender. That was the reason Manchester Encoding was chosen and used in Ethernet.
However, with current high-speed networks, providing speeds double than actual bitrate is overkill. The clocks have become much better and precise and for shorter LAN distance communication (normal Ethernet communication is about 100 meters), other coding schemes which are not wasteful can be used. That is why Manchester Encoding is not used in current Ethernet solutions.
A value indicating a number of signals per second is known as symbol rate or baud rate. Normally, baud rate is a smaller value than bitrate; i.e. one would like to send a higher number of bits per symbol. In the case of Manchester encoding, the baud rate is exactly double than the bitrate.
Multiplexing data streams
Multiplexing happens at each layer and the physical layer is no exception. A fiber optic cable can carry many videos together. An ISP can use a single fiber cable to cater to many users. If there are five users, each of which having a connection of 10 Mb, a cable which can carry 50 Mb, can multiplex all five users’ data together. ISP may provide 5 different connections to five different customers (each of 10 Mb) but only one cable out with the capacity of 50 Mb. Multiplexing is more common at telephone lines. Consider a telephone exchange which connects with subscribers. The outgoing lines from telephone exchange are much lesser in number than incoming lines (each from one subscriber), as each outgoing line accumulates many incoming lines. Though we will not describe how multiplexing process happens in telephone lines here, you may refer to Reference-2 for the same.
The process of getting multiple streams together at the sending point also requires separating them at the receiver’s end. That process is known as demultiplexing.
A classic example of this process is a radio signal. The signal which our radio set receives contains signals from multiple radio stations and it is basically a multiplexed signal. Similarly, a TV signal is also an example of a multiplexed signal. The radio set or television set does demultiplexing to get the signals of the programs the users want to watch.
Our interest lies in the idea of multiplexing the signals carrying data and we will concentrate on that now onwards. Before we move on, we will look at a typical problem that distinguishes data communication from other communication like Radio and Television.
Frequency division and Time Division multiplexing does not work with data
We looked at examples of broadcasting of TV channels and telephone line communication and seen that they use multiplexing. Earlier we have seen that such multiplexing can be done using either dividing the available resources by time or by frequency. TC and Telephone communication uses either one of them. Even physical layers of our mobile phones use technology like GSM which uses a mixture of frequency and time division multiplexing.
However good FDM and TDM are for other traffic, one typical characteristic of the data makes it inappropriate them for data traffic. The data traffic is not constant like telephone and TV but bursty. Let us take an example to understand. If we are browsing a website www.oup.com (this is an Oxford University Press website). The entire home page is downloaded in a few seconds and for that period, the network bandwidth is completely utilized. The traffic volume is huge for that particular period of time, assume it to be 2 msec. Once the page is downloaded, and we read that page and explore the content for say 10 seconds. During those 10 seconds, there is no traffic. After which we may find a book we would like to learn more about and click on the link. Again for about 2 msec, the network traffic is high. While we are exploring the content of the book, the traffic again goes back to trickle. Every time a page being downloaded, the traffic jumps up, and drops to almost zero during the other period, and picks up again when another page is downloaded.
Similar behavior is also observed when we are working on a local network. Suppose a file is on the server which we would like to edit. When we open the file on our local machine, the file is downloaded and the traffic jumps up for that period of download. The traffic drops to zero when the file is completely downloaded and we start editing. Once we stop editing and save the file, the file uploaded to the server and the traffic again increases.
The traffic, in such cases, does not remain constant, it jumps up for a very short period usually some microseconds, stoops down for a comparatively large period usually some minutes and starts all over again in the same pattern. Such traffic is called bursty.
TDM and FDM are both not suited for bursty data. Let us try to understand why. Let us try to see what happens If we use TDM for our data traffic and allocate every sender a time slot. There is a large possibility that the time slot allocated to a typical user remains unallocated as most of the time the sender is neither sending nor receiving. On the contrary, when he has to either send or receive, it is quite possible that the allocated slot is less than what is required. Similarly, when FDM is deployed, i.e. each user is given a typical frequency to operate on, most of the time most of the users are not sending and receiving and thus their frequency bands remain unutilized for that period. Whichever user is sending, only need to send using its own frequency and very likely to fall short of user requirement, even when other frequency slots are free (but allocated to other users).
To illustrate the point, let us take a simple example of five senders and five receivers. Also, assume each user is either given a time or frequency slot to transmit as depicted in figure 9.11. The figure showcases two rounds but there are many such rounds possible in the actual case. Now consider a case where user 2 is interested in sending a large file. He can only send during his time slot and thus after 10 such slots, he can actually send only in two slots.
We have taken a simplified but realistic timing assumptions here. As most of the time, most of the senders are not sending, our assumption is realistic. If each slot is worth 1 Mb, we are utilizing 2 Mb out of total 10 Mb available to us. Looking from another angle, if user-2 needs to send a 50Mb file, if he can use all the bandwidth, he can send it in 10 seconds but due to above allocation, he can only send 2Mb in 10 seconds and require 25 seconds to send the complete file. This time will increase with a number of users. In above case, we have 5 users so, in 10 sec., each user has two turns. If we have 10 users, each user will only have a single turn and thus the user2 needs to have 50 seconds to send the same file.
Thus either TDM and FDM does not serve the purpose. Alternative methods are needed. If you think that when only one sender out of five has something to send and not others, is a rare case, it is not so. The burstiness of the traffic ensures such behavior being common across most networks. This clearly indicates that one needs other than FDM and TDM for data traffic.
Researchers have tried to model network traffic and tried to get better methods for organizing network traffic. Many different methods including “whoever wants to send, just do so” kind of approach to strict “only those who are authorized to send now, should send” kind of an approach are used in practice.
Before we conclude this module, let us try to see how electromagnetic spectrum is laid out. This is going to help us learn more about how the transmission takes place in the wired and wireless world.
The Electromagnetic Spectrum
EM waves are used for transmission, be it wired or wireless, so we will have a closer look at them. These waves are a manifestation of electromagnetic energy traveling from one point to another. There are many different types of EM waves and different types of waves possess different types of properties which make them suitable or otherwise for data transmission. The EM spectrum describes EM waves of different frequencies.
We have already studied about the frequency in the previous module. Frequency is a number of times the wave oscillates in a second. More oscillations, more the frequency. Another characteristic that usually is mentioned when one discusses frequency is called wavelength. It is the distance between two consecutive picks or lows in the same wave. It is apparent from the figure 14 that as the frequency increases, the wave is shortened and thus the wavelength is reduced. That means, higher the frequency, shorter the wavelength. The experts use different scales to measure high-frequency and low-frequency waves. When they are dealing with low frequency, they represent the wave based on the frequency on which the wave operates, while the higher frequency waves are identified by their wavelength. Thus lower frequency waves are measured in Hz (number of oscillations per second) while higher frequency waves are measured in microns2 (the wavelength of the wave).
let us now have a closer look at the complete electromagnetic spectrum used for data transmission. The waves belonging to different frequencies are known to be part of bands like Radio, Microwave, Infrared, Visible Light, UV, X-rays and Gamma rays. All these bands are also categorized further. We will explore different parts of the EM spectrum in the next module but let us have a brief introduction in this module.
Radio waves range from 10KHz (1KHz = 1000 Hz, 1 MHz = 106 Hz) to 108 Hz (= 100 MHz =0.1GHz). While Microwave starts from 108 Hz (or 0.1GHz), where the radio wave ends, and goes till 1011 Hz (or 100 GHz or 0.1 THz). After that, infrared waves begin and continue till almost 1015 Hz (or 100 THz). That ends with a small spectrum that is visible to humans and thus called visible light. The later part, with UV, X-Rays and Gamma rays are not used because they are hazardous to life.
Please also note that there is some inconsistency in the values of lower and upper bounds of ranges for each type of spectrum in literature and you may get different values for different ranges when reading different articles.
2 A micron is 1 millionth of the meter, i.e. 10-6 meters
you can view video on The Physical Layer |
References
- Computer Networks by Bhushan Trivedi, Oxford University Press
- Data Communication and Networking, Bhushan Trivedi, Oxford University Press