Networking Foundations Part 1

Protocol in general defines the format and the order of messages that are sent and received. If I am going to send messages, I'm going to send data. It's like on envelope I will put sender destination, address, etc. All protocols define format, order of messages sent and received, and actions taken on msg transmission receipt. An example is US mail, or HTTP (makes browser capable of taking to the web server and asking for the content of the webpage. TCP/TLS/DLS are also protocols. We want a more decent way for networking functions and networking protocols. We try to do that by putting these protocols on top of each other on a stack.

Each protocol layer heavily depends on the layer below it. Protocols define format, order of messages sent, and action(s) taken. Most of the functionality on Layer 1 is on the network interface. 

Here's an example of a Computer Network Protocol, where one device triggers the other connection, the other will respond, and first will ask a question and second one will respond. Networks have many pieces, such as hosts, routers, media, applications, protocol, and hardware/software. To organize our discussion we will create layers. Networking is the seme functions being repeated but in the reverse order. 

Here is the internet stack: Application, Transport, Network, Link, Physical. We're going to focus solely on the physical layer and the data link layer. We will also discuss about Network Security. Layer 1 and Layer 2 have 2 devices connected with some communication channel interacting with it. The Application layer is run by supporting network applications. We will assume 2 devices directly communicate with other. Transport is process-process data transfer (TCP/UDP). Layer 3  (Network) is routing of datagrams, fragmentation and discovery. Layer 4 (Link) is the data transfer between neighboring network elements (Ethernet, Wi-Fi aka 802.11, PPP) and Layer 5 is the physical layer, or bits on the wire. Physical, Link, Network, presentation and application are in TCP/IP. Presentation layer allows application to interpret meaning of data (encryption, compression, machine-specific conventions). The session is synchronization, checkpointing, and recovery of data (cookies so server knows lost section). 

Internet protocol stack is physical, link, network, transport, and application layers. OSI reference model is physical, link, network, transport, session, presentation, and application layers. 

Let's assume we have a source, and try to Communicate with the web browser with an application. The nature of the application is to send. The application will pass to transport layer. In there TCP might add its own header to the message. Now, the transport layer has to pass message to network layer, which adds another header (source IP address, destination IP address, routing), now passed to data link layer which add its own header (packet). This frame passed to physical layer which passes data as signals on the wire. Package goes to switch, a layer 2 device that implements layer 1 and layer 2. The physical layer will take signals and convert it into bits, then pass to data link layer. The switch stores frame, and checks header. Once it decides to pass into physical layer to modulate and send to next hub, which is router (layers 1, 2 and 3). The datalink layer will pass to network layer. Data link layer relies on a switching table, and now the network layer is commander in chief and tells the data link layer where to send. Network layer will look up the table, and add something, and then tell the data link layer what to s end, which passes to physical layer. Now signal will be converted to physical layer take the data and passes all the way up the stack. All these layers will have to collaborate at the source and the destination. 


Headers are stripped as the packet moves up the protocol stack. 


Why do we need devices that are layer 2 and layer 3 then? Router as used to communicate in a different network, towards a different IP address. Within the same network, switches are used. Routers can do everything that switches can do, if not more. When I get a packet to the network, I know which interface that I can send it to its destination. When data link layer has multiple outgoing interface, they don't know how to send it, since there's no direction so it sends to all outgoing interfaces. During the period the switch is still learning, it floods the network. The router already has distributed protocol where they talk with each other and uses a forwarding table. It knows the specific outgoing interface with each network. But routers are more expensive. Tradeoff is switches are cheaper, but routers are better performing. 

Let's first look at the physical and data link layer. How can one device take data, and modulate and convert it to a segment, and the other device will have to reverse the process. Transmission media is not created equal and properties of wires, fiber, wireless limit the network performance. We send bits analog wise via modulation. Wireless includes satellite, cellular, Wi-Fi, etc. Let's see how data/bits are converted into segments. 

How can multiple conversations be put at the same time on the same transmission medium? 1 way is static (multiplexing) and the other is dynamic (media access). Let's finally see how layers 1 and 2 finally work. Let's first go over the electromagnetic spectrum, which is basically the spectrum of sinusoidal waves. Range of waves that differ by frequencies (period/wavelength) is basically the electromagnetic spectrum. Within this spectrum, the waves that are in there are used in everyday life. 


Electrons move in waves whether in the air of in a vacuum in copper or in fiber. Sounds are transmitted as waves. Light waves have higher frequent than wives in the wife communication. If I use LEDs and switch them on and off very fast, what would be the difference between many frequencies? A higher frequency wave can carry more data but it is also more susceptible to blockage. Cellular and Wi-Fi communication can go through obstacles but 5G will not go through obstacles because of the high frequencies. The difference in the waves is their frequencies. The higher the frequency, the higher the throughput. The higher frequency portion of electromagnetic spectrum has a lot of waves. Bandwidth is HIGHER for higher frequency in the electromagnetic spectrum. 

As long as you have the same bandwidth, you should be able to send the exact same maximum bit rate. The waves unfortunately get attenuated as they travel through the medium. As long as you're a wave, you're going to get some form of attenuation. Low frequency waves don't attenuate as much. It's like a fast vs slow runner analogy, the faster runner (higher frequency) gets tired (attenuated) more. Low frequency isn't aiming to penetrate. If the wavelength is over cm then it can penetrate the wall. If its a mm and smaller, it's more difficult to penetrate the wall. Wavelength (λ, meters) is the space required for wave to make complete cycle. T is the time (period) to make a complete cycle.

The amplitude (A0) defines the intensity, aka "Peak", of the wave. Period is measured in seconds, frequency is measured in Hz, or cycles/second. The wavelength is distance that once cycle would take. 

The higher the frequency, the lower the wavelength. You need an antenna to be able to transmit these waves. We need another antenna with similar characteristics, size should be proportional to wavelength. Waves traves at the speed of light. In a vacuum, λf = c. So then λ*f is around 300, or around 300,000km/s.

Wi-Fi uses the ISM band. It uses the same portion of the spectrum as other technologies. Radio band is wide area broadcast, infrared/light is line of sight, and microwave is used for LAN and 3G/4G. Spectrum is getting populated, lots of things are coming about in the air. Each country has electromagnetic spectrum and set up auctions on who's going to use these spectrums. To manage interference, the spectrum is carefully divided. Software Defined Radios, or SDRs can be used to snoop on wireless communication and to transmit signals. With enough resources and time, you can decrypt almost anything.

Next topic is bandwidth. Bandwidth is different to electrical engineers than to computer scientists. From an electrical engineering standpoint, bandwidth is the size from electromagnetic spectrum used to communicate. Bandwidth is the width of the frequency range used to transmit the waves without being strongly attenuated. It's the range of the spectrum given to send these signals. B in bits per second is how fast to push the information across the system. B is the size of the range given from the electromagnetic spectrum. Signal attenuation depends on the physical properties of transmission medium. Attenuation differs depending on wave frequency thus introducing distortion. Attenuation is the falloff of wave's energy with distance. Baseband is sending signals from somewhere close to 0 frequency. It doesn't start at 0, but it starts at somewhere. Baseband signals run from 0 up to a maximum frequency. Passband signals are shifted to occupy a higher range of frequencies. Passband signals are shifted to occupy a higher range of frequencies. Instead of using frequencies that are low, you push to a higher frequency in the spectrum. 

The range of frequencies used will start at frequency #1 and end at another frequency. Bandwidth if from 0 to the unattenuated frequency fc at which power has fallen in half. We should be able to determine the range from the bandwidth and bits. Any band of a given width can carry the same information. 802.11 wireless channels are allowed to use up to 20 MHz (range has 20 million waves). TV channels typically use 6MHz each. Fiber channels use 30,000 Ghz. There is a relationship between B in Hz and B in bits/second. 

Comments

Popular Posts