What is the OSI model? Explain the different layers of the OSI model?

The Open Systems Interconnection (OSI) model is a reference model that describes how applications interact with each other over a computer network. It has seven layers; they are as shown below:

  1. Physical Layer: This is the lowest level of the OSI model. Here, data is converted into an electrical impulse and sent through a physical medium. It is also responsible for the physical connection between the devices.
  2. Data Link Layer: Here, the data packet is encoded and decoded into bits. This layer looks into the node to node delivery of a message.
  3. Network Layer: In this layer, datagrams are transferred from one to another. The functions here are routing and logical addressing.
  4. Transport Layer: This layer is responsible for end-to-end connections. The data in this layer is called segments. This is where TCP and UDP protocols work.
  5. Session Layer: This layer controls signals between computers. The session layer establishes, maintains, and ends connections between processes.
  6. Presentation Layer: It is responsible for translating data into the application layer format. Here, the data is formatted, encrypted, and then sent to the next layer.
  7. Application Layer: Finally, here, services are provided to the end-users. The application layer deals with any sort of data that the application of a machine generates, like a user input such as a password, and so on.