Shortcut to seniority
Home
Go to main page
Section level: Junior
A journey into the programming realm
Section level: Intermediate
The point of no return
Section level: Senior
Leaping into the unknown
                    Go to main page
A journey into the programming realm
The point of no return
Leaping into the unknown
The OSI model is a 7 layer network model which relates on how the communication is performed on the network.
The first three layers are the responsibility of the network, while the remaining ones are the responsibility of the host.
The physical layer is responsible for ensuring that the physical assets (hardware, routers, switches, cabling etc) are powered on and are able to send and receive data.
The data link layer provides data transfer between two directly connected nodes (connected by a physical layer). The protocol data unit for this layer is the Frame, which is a simple container for a single network packet.
The network layer is responsible for packet forwarding, and at this place you’ll find most of the router functionality. It is responsible for establishing the way in which the data is communicated in your network and in other networks – either via packet forwarding or routing.
The protocol data unit for this layer is the Network packet, which consists of control information (source and destination, sequencing information, etc.) and the user data (payload).
The transport layer is where details regarding the transport are set, such as how much data to send, where to, and at what rate, and it ensures the delivery of the entire file / message.
An example of the transport layer is the TCP which is build on top of the Internet protocol (IP), commonly known as TCP/IP. The protocol data unit for this layer is the Segment, which is the data packages that are to be transmitted over the network. The package segmentation is the process of dividing the data into smaller units to be further transmitted over the network.
The session layer is where the computers speak with each other and at this layer we will find the functions that involve the setup, how long the system waits for a response, or the termination of the applications at the end of the session.
The presentation layer is the one that is independent of the data representation at the application layer. At this layer, the data is prepared or translated from the application format to the network format (for sending data), or the other way around, from the network format to the application format (for receiving data). For example, at this layer is where the encryption / decryption takes place.
The application layer is the one at the top, which is the closest to the end user. The applications that work at this layer are the ones that the user directly interacts with, such as web browsers.
TCP and UDP are protocols used for sending packets (data) over the internet. Both of them are built on top of the internet protocol, meaning that the packets are sent to an IP address.
TCP guarantees that the packages are sent and received in order, by numbering them. The sender will send the first package, whilst waiting for a confirmation from the receiver. In case the response is not received or it’s not what it was expected, that same packet will be resent. Packets are also checked for errors to assure that the data was not corrupted during the transfer.
UDP works similarly to TCP, but without all the error checking. With UDP, the packets are simply sent to the recipient. There is no guarantee that the packets were all received and you cannot ask for a package again – it’s a fire and forget mechanism. This is mostly used when speed is desirable and corrupted data are not a problem, such as online games or live broadcasts.
Telnet is a networking protocol which uses port 23 and was specifically designed for Local Area Networks (LAN). It allows users to log into other computers that are part of the same network.
Telnet is not a secure communication protocol – the data transferred over network is in plain text (including passwords), thus anyone can sniff the packets to read the data. Other than that, there are no authentication policies or data encryption techniques, which poses as a big security thread.
SSH is the new protocol used to access the network devices over the network, and it allows users to log into other computers and execute commands on the remote machine.
SSH is a secure communication protocol, providing strong authentication and encryption over data transferred over the network.
First two were initially introduced in Chapter 5 – Problem solving
Priority queue (max heap): Elements are inserted based on their priority, thus the most important message is always the first one to be taken from the queue.