Network Protocols (Basics)

OSI reference model

OSI reference model (eng. Open Systems Interconnection Basic Reference Model) is an abstract description of network architecture. The OSI reference model consists of seven different levels of abstraction.

Layers Unit Protocols Application
Network processes related to the application Data HTTP, HTTPS, FTP, SSH, DNS, SMTP Presentation
Data encryption and coding Data MIME SSL TLS Session
End user session establishment Data RPC, PAP, SCP Transportation
Connection, reliability, transportation Segment
Datagram TCP, UDP Network
Logical addressing and routing Package IP, ICMP, ARP, RARP Link layer
Physical addressing, media access Frame PPP, HDLC, Frame Relay Physical layer
Signal transmission Bit Token Ring
IEEE 802.11

Transport protocols in the application layer

The application layer (English Application layer) describes the operation of applications in the network and their interaction with services and protocols of lower layers. Application layer protocols function to exchange data between running programs. Those programs in the application layer between which data is exchanged are:

  • database management programs
  • email programs
  • file server programs
  • print server
  • operating system commands

Transport protocols in the application layer, better known as Web protocols, are established ways of communication between the web browser and the application on the server (web server) when transporting data between the browser and the server. Well-known web protocols are:

  • HTTP
  • HTTPS
  • FTP (File Transfer Protocol)
  • IMAP
  • IRC (Internet Real Chat)
  • SMTP (Simple Mail Transfer Protocol
  • POP3 (Post Office Protocol 3)
  • SSH (Secure Shell Protocol)
  • BitTorrent

HTTP protocol

HTTP (English HyperText Transfer Protocol) is a network protocol that represents the main and most common method of transferring information on the Web. The main purpose of this protocol is to deliver HTML documents, ie. website. HTTP is a protocol for communication between server and client, which works on the principle of request/response. An HTTP client, which is usually a web browser, initiates data transfer after establishing a TCP/IP connection with a remote web server on a specific port.

Http server is an application that constantly listens for requests on a specific network communication port (typically port 80), waiting for a client to connect and send its request.
Communication is actually connectionless and stateless. After the response of the HTTP server to the request from the client, the connection is terminated until the next request.

Request

The request consists of a basic HTTP command whose syntax consists of the name:

  • HEADER consisting of text that specifies aspects of the request
    • commands (GET or POST )
    • name of the requested document
    • supported HTTP versions
  • A blank line is used to separate the header and body
  • BODY
Example

Server response

The server response consists of:

  • request status reports consisting of a three-digit status code and a short descriptive text:
    • 1XX – Information
    • 2XX – Success
    • 3XX – Redirection
    • 4XX – Client Side Error
    • 5XX – Server Error
  • specific answer consisting of:
    • headers (which has the same syntax as the request header and provides basic information about the nature
      answers)
    • from any specific content requested in the request
Example

HTTPS protocol

HTTPS (eng. Hypertext Transfer Protocol Secure) is a combination of HTTP with SSL/TSL protocol to provide encryption and secure server identification, uses port 443.
HTTPS connection is often used for financial transactions over the Internet and for the transfer of sensitive information. HTTPS should not be confused with Secure HTTP (S-HTTP). The main idea of ​​the HTTPS protocol is to create a secure channel over an unprotected network. This provides protection against attacks, provided the certificate is issued by a verified and trusted issuer (Certificate Authority). Trust in HTTPS is based on major certification bodies whose certificates come with the installation of the Web browser.
When accessing a website with an invalid certificate, newer browsers display the question over the entire window. Newer browsers also show information about site security in the address bar. Extended Validation (eng. Extended Validation) of the certificate includes that in newer browsers the field with the address (address bar) should be green. Such certificates are more expensive than ordinary ones. Most browsers also display a warning if the site uses content from another address that has not been verified with a digital certificate.

FTP protocol

FTP ( File transfer protocol) is the most commonly used protocol for transferring data between two computers on a network and is great for transferring large documents.
FTP uses TCP/IP for network communication, which allows it to be reliable and session-oriented. An FTP connection is established at the request of the client computer to the server computer. The client computer must have a program that implements the FTP protocol (so-called FTP client), and the server computer must have a program that accepts connections on a standard FTP port and also understands FTP protocol commands (so-called FTP server or FTP daemon). When an FTP client sends a command to an FTP server, the FTP server responds with a three-digit number, which represents the response code.
The codes are determined by the FTP standard and are used for faster data exchange, and client programs usually interpret this message for the user in a language understandable to humans. Based on the response, the user knows whether the command was executed successfully and how to continue working.

The disadvantages of the FTP protocol are:
  • Both passwords and file contents are transmitted without encryption, byte by byte, and can be intercepted and used for unauthorized access to the server and the transmitted content itself. Various FTP extensionsthey solve this problem by inserting encryption intermediate layers using algorithms like SSL or TLS.
  • The protocol uses multiple connections in one transaction, one for the control session, one for each request. This makes it difficult for administrators in charge of controlling the firewall.
  • In active mode, the client chooses an arbitrary port to communicate with the server, which also makes it difficult for a firewall that allows content to pass through only certain ports. This problem is most often solved by using the passive mode of operation.
  • It is possible to misuse FTP’s built-in content redirection capabilities to make content
    redirected to another computer.
  • FTP has a lot of downtime due to the large number of commands required to start a transaction.
  • There is no data integrity control – if the transaction is interrupted for some reason, the recipient has no way to verify that the received content is complete.
  • When transferring files, additional data such as creation date, last modification, etc. are not transferred. Upon receipt, the file is assigned the current date and time. FTP extensions, such as SFTP, also allow the transfer of such attributes. There are currently plans to expand the FTP standard to include such capabilities, but most popular FTP clients and servers do not yet support it.

BitTorrent protocol

BitTorrent is the name of a peer to peer protocol for sharing and exchanging files. Each file that is to be shared must be indexed (that is, the file is divided into equal parts, from 16kB up to 4MB, a checksum is made of all parts, and the resulting file is saved to the torrent file server).
Then the person sharing the file logs in to the tracker server and then it is possible for all those who found the torrent on the index server to start sharing the file, first from the source, and then among themselves.

Transport protocols in the transport layer

The transport layer is in charge of segmenting data from higher levels, that is, rejoining them. Then for identification, monitoring and control of communication between individual applications. The unit of information on this layer is a “segment”.

TCP (Transmission Control Protocol)

The role of TCP is to ensure reliable data transfer in an IP environment. TCP transfers data as an unstructured sequence of bytes identified by a sequence. This protocol facilitates the transfer of files by grouping bytes into segments, assigning them a sequence number, assigning a port number to applications and forwarding them to the IP protocol.

UDP (User Datagram Protocol)

It does not work on the principle of links, but on the principle of creating incompatible packages. It is used when data needs to be sent quickly, when speed response is important, when the order of arrival of packets is not important and when it is not a big problem when the data is destroyed. The most common uses are videoconferencing, DNS and multiplayer (online) video games.

Protocols for addressing in the network layer

IP (Internet Protocol)

IP is the primary network layer protocol in the Internet Protocol Suite. Internet Protocol (IP) contains addressing information and some control information that allows packets to be routed. It contains addressing information, which ensures that every network device (computer, server, workstation, router interface) that is connected to the Internet has a unique address and can be easily identified throughout the Internet, and it also contains control information that allows packets to be forwarded (routed) based on known IP addresses.
IP does not require priorestablishing a connection at the time of sending the data, but the computer sending the data tries until it forwards the message (best effort) model, the data transmission is relatively unreliable, which means that there is almost no guarantee that the sent packet will actually reach the destination after it has been sent.