Open Systems Interconnection Model

if 2 devices want to communicate over the internet how will they communicate, to accomplish successful communication between devices or computers the 7-layered OSI mode was introduced by the International Organization for Standardization (ISO)in 1984.

OSI model is a theoretical model each layer of this model is a package of protocols, if I say application layer it does not mean that it includes applications like Chrome, Firefox but instead it includes application layer protocols that are needed to make these applications work correctly, now let's discuss these 7 layers :

Application layer: used by network applications, network application means, applications that use the Internet like Chrome, Firefox etc. A web browser is a network application running on your PC, it does not reside in the application layer but it uses application layer protocols like HTTP, HTTPS, etc to do web surfing. All these protocols form the base for various network services like File transfer (file transfer protocol) e-mail (SMTP) web surfing (HTTP) etc.

Presentation layer: The presentation layer receives data from the application layer in the form of characters and numbers presentation layer converts these characters and numbers to machine-understandable binary format.

NVBASJHFBVSEG --> 110001010101100101 46125623165837

before data is transmitted the presentation layer reduces the number of bits that are used to represent the original data this bit reduction process is called data compression data compression reduces the amount of space to store a file as the size of the file is reduced (5MB -> 2MB) and it can be received at the destination at very less time to maintain the integrity of data before transmission data is encrypted encryption enhances the security of data at senders side data is encrypted and at receivers side, data is decrypted. SSL (secure socket layer) protocol is used for encryption and decryption of data. So presentation layer performs 3 basic functions: 1) Translation 2) Data compression 3) Encryption/ decryption

Session layer: The session layer helps in setting up and managing connections enabling sending and receiving of data followed by the termination of connections for sessions. session layer contains its helpers called APIs, NETBIOS or network basic input-output system, which is an example of APIs, which allow different applications on different computers to communicate with each other. Just before a session or connection is established with the server server performs authentication (a process of verifying who the user is ) for this the server uses a username and password once the username and password are matched a session is established between the user and server. The server also does Authorization whether the user is authorized to access the file or not.

session layer keeps track of the file that is being downloaded e.g servers store images, and texts when you request a website your browser opens a separate session to the webserver to download each of that text and image file separately these files are received in the form of data packets session layer keeps a track of which data packet belongs to which file, either text or image file and tracks where the received data packets go. So session layer performs 3 functions:

  1. Session management

  2. Authentication

  3. Authorization

Transport layer: The Transport layer ensures that messages are transmitted in the order in which they are sent and there is no duplication of data.

  • The main responsibility of the transport layer is to transfer the data completely.

  • It receives the data from the upper layer and converts them into smaller units known as segments.

  • This layer can be termed as an end-to-end layer as it provides a point-to-point connection between source and destination to deliver the data reliably.

protocols used in this layer are TCP and UDP

TCP (transmission control protocol): It is a standard protocol that allows the systems to communicate over the internet, It establishes and maintains a connection between hosts, When data is sent over the TCP connection, then the TCP protocol divides the data into smaller units known as segments. Each segment travels over the internet using multiple routes, and they arrive in different orders at the destination. The transmission control protocol reorders the packets in the correct order at the receiving end.

UDP (user datagram protocol): User Datagram Protocol is a transport layer protocol, It is an unreliable transport protocol as in this case receiver does not send any acknowledgment when the packet is received, the sender does not wait for any acknowledgment. Therefore, this makes a protocol unreliable.

Network layer: It is layer 3 that manages device addressing, and tracks the location of devices on the network.

  • It determines the best path to move data from the source to the destination based on the network conditions, the priority of service, and other factors.

  • The Data link layer is responsible for routing and forwarding the packets.

  • Routers are the layer 3 devices, they are specified in this layer and used to provide the routing services within an internetwork.

  • The protocols used to route the network traffic are known as Network layer protocols. Examples of protocols are IP and IPv6.

Functions

  • Internetworking: Internetworking is the main responsibility of the network layer. It provides a logical connection between different devices.

  • Addressing: A Network layer adds the source and destination address to the header of the frame. Addressing is used to identify the device on the internet.

  • Routing: Routing is the major component of the network layer, and it determines the best optimal path out of the multiple paths from the source to the destination.

  • Packetizing: A Network Layer receives the packets from the upper layer and converts them into packets. This process is known as Packetizing. It is achieved by internet protocol (IP).

Data link layer: This layer is responsible for the error-free transfer of data frames. It defines the format of the data on the network. It provides reliable and efficient communication between two or more devices.

  • It is mainly responsible for the unique identification of each device that resides on a local network.

  • It contains two sub-layers:

    • Logical Link Control Layer

      • It is responsible for transferring the packets to the Network layer of the receiver that is receiving.

      • It identifies the address of the network layer protocol from the header.

      • It also provides flow control.

    • Media Access Control Layer

      • It is used for transferring the packets over the network

functions of the data link layer:

  • Framing: The data link layer translates the physical's raw bit stream into packets known as Frames. The Data link layer adds the header and trailer to the frame. The header which is added to the frame contains the hardware destination and source address.
  • Physical Addressing: The Data link layer adds a header to the frame that contains a destination address. The frame is transmitted to the destination address mentioned in the header.

  • Flow Control: Flow control is the main functionality of the Data-link layer. It is the technique through which the constant data rate is maintained on both sides so that no data gets corrupted. It ensures that the transmitting station such as a server with a higher processing speed does not exceed the receiving station, with a lower processing speed.

  • Error Control: If any error seems to occur, then the receiver sends the acknowledgment for the retransmission of the corrupted frames.

Physical layer: It is the hardware section and here you have your mechanical wires or devices or something when a networking problem occurs, many networking pros go right to the physical layer to check that all of the cables are properly connected and that the power plug hasn’t been pulled from the router, switch or computer here you work with cables the data you get from above is in form of 0 or 1 physical layer is gonna transport it into our wires local media it can be like electrical signals, radio signals or something when the data is received to someone at that particular time the physical layer will receive the signal convert it into bits and pass it to the data link layer as a frame and then frame will be moved to higher layers.