Connecting nodes in a network brings out several problems :
- Encoding / decoding : Encoding bits on to the medium so that receiving nodes will decode and process the data.
- Framing
- Error Detection : because frames sometimes: corrupt while it s going to its destination.
- Reliability : Making the connection and communication even the frames corrupt.
- Media access control, a medium can be used by several hosts/nodes the idea is to share the resources and connection fairly between nodes.
Nodes (hosts , which can be a computer, router, switch etc..) are like the vertices of a graph, where links (cables or some communication channel or protocol) are the edges of a graph and the graph is a network. Switch or router is a also a node as stated, they are made of special purpose hardware just for communication and networking. I have experienced that it s also possible to set up a Unix machine to work as a switch or router. However, it s preferred that hardware switch and router is used for this. They are more sophisticated and efficient. Today, most of the routers and switches tend to contain a small operating system anyway. On cloud computing, there are businesses which uses cloud instances to run as a load balancer. That s also kind of routing. For nodes (computers) memory is more important than CPU speed, because CPU speed is much faster than the memory speed. A network adaptor consists of two interface, bus interface which understands and set the communication with host and link interface which communicates with link. This is called the IO bus, IO bus is usually slower. Adaptor uses control status register which is readable and writable from the CPU. This is how the CPU uses the network adaptor. CPU tells the Control status register to send or receive the data. To inform the host of an an network event, the adaptor interrupts the host and tell the CPU that there is an activity on the network.
There are two ways of how bytes are transferred between the adaptor and the host. First, DMA (Direct Memory Access), which adaptor reads and writes the memory directly and control the communication. The other is using a PIO (Programmed IO) which is using a API and writing some code for communication.
Type of data at different level of network; bits and bytes at physical layer, frames at link layer, packets at network layer, messages at transport layers, unit or cells at the application layers.
Contention : when a switch receives frames more than it can handle at a time, switch starts storing the messages in a queue or buffer which is called contention. So switch is slower than the network traffic. When the switch buffer / queue can not store any more frames, the switch begins to drop the frames which is called congestion.
Network links are implemented using several different kind of mediums : coaxial cable, fiber, air, twisted pair etc.. The communication between the links and nodes happen using electromagnetic waves, which are called signals and they travel at the speed of light, this speed varies from medium to medium. In computer networks data is presented in binary format and yet it s being transmitted as binary format, converting the data that s presented to us into a form that computer can understand is called encoding, and after receiving this data making it meaning is called decoding. Network communication while sending the data uses high signal for 1 and low signal for 0.
Point to point links are connecting two hosts together. This link can use two different kind of data flow, full duplex which the data travels in both direction of the connection(This communication happens simultaneously.), half duplex the data travels only at a single direction.
Spread Spectrum in wireless nets : is to use wide range of frequencies so that other interference of other signals and devices wont affect the communication. One technique is called the frequency hopping, in which sender uses different frequencies by using a psuedorandom number generator, then it uses different channels in each transmission, receiver also uses the same algorithm so that it can get the packets.another technique for spread spectrum is direct sequence which send more information by adding exclusive-or of the data in the packets in the case of loss of data, receiver can recover the missing data.
Encoding: Two hosts communicates using a physical link, sender send the data in bits and bytes through the link between the nodes. For the link to carry that data from sender to receiver it should be encoded in such a way that receiver will understand the data, for sender to send the data using the physical signal, is called encoding. This is like high and low voltage (1 and 0). First encoding technique is called Non-return to zero (NRZ) which works as follows : sender sends the data using high and low voltage as 0 and 1. The problem with NRZ is that if the sender sends too much amount of 0 or 1 then we have the problems called base line wander, which the receiver wont understand the the difference between the voltages. For baseline wander, receiver keeps an average of the received 1 and 0 s and if the next signal is lower than the average it s 0 otherwise it s 1. Second alternative is clock recovery : which the sender and receiver clocks are supposed to be synchronized which is a very hard task.
Another encoding approach is Non-return zero inverted (NRZI) which if the signal doesnt change it means the signal is 0, if the signal changes it means it s 1. This solves the consecutive 1 problem, but it doesnt solve it for 0.
Manchester encoding uses exclusive or of the bit and clock and sends it to receiver. For 0, the signal is up and down between a period. when the signal changes it remains same for 1 unit of time, then continues. The problem with Manchester encoding is efficiency, the signals are faster than other encoding therefore the receiver would work at double rate, and efficiency diminishes.