OSI model

OSI model


OSI model is an acronym for Open Systems Interconnection is used to define how data is transferred from one system to another system in a computer network. Now you may ask how a network is formed? If two computers are connected to each other with LAN cables, connectors and Network Interface Card forms a network. Since the designing and infrastructure won't be similar of two computers the OSI model was introduced by ISO(International Organization for Standardization) in 1984 for a successful communication between computers or networks.

OSI model consists of  7 different layers

1. Application layer
2. Presentation layer
3. Session layer
4. Transport layer
5. Network layer
6. Data link layer
7. Physical layer

Now I'm going to give a mnemonic to remember the OSI model

Please-Do-Not-Throw-Sausage-Pizza-Away, easy right?




Application layer -

  1. Application layer does not include applications like chrome, firefox instead it includes application layer protocols that are needed to make these application work correctly in the network or internet.
  2. Application layer is used by Network Application for eg. applications that uses internet, web browser is a network application running in your PC, it does not reside in the layer but uses application layer protocols such as HTTP or HTTPS.
  3. There are n number of protocols that are enabled to do various functions at this layer.
  4. Eg. HTTP, HTTPS, FTP, NFS, DHCP, SNMP, TELNET, POP3, IRC.
  5. For file transfer it uses FTP i.e File Transfer Protocol, for web surfing it uses HTTP/HTTPS, for email transfer it uses SMTP i.e Simple Mail Transfer Protocol, for virtual terminal it uses TELNET.

Presentation layer - 

  1. Presentation layer receives data from application layer. Since computer only understands binary format data - 0s and 1s, data which is received from application layer is in the form of characters and numbers so presentation layer converts these formats into binary form.
  2. Conversion of data from ASCII to EBCDIC is known as translation.
  3. Before transmission, this layer reduces no. of bits used to represent original data, this process is known as compression. Which can be lossy or lossless.
  4. To maintain the integrity of data before transmission data is encrypted. At sender's side data is encrypted at receiver's side data is decrypted,which enhances the security of data
  5. SSL is used in presentation layer for encryption and decryption

Session layer - 

  1. Session layer helps in setting up and managing connections enabling sending and receiving of data followed by termination of connections or sessions.
  2. Session layer has API's, NETBIOS for basic network input output system is an e.g of API which allows applications on different computers to communicate with each other.
  3. Before session is established with a server, it performs a function called as authentication.
  4. Authentication is a process to verify who you are which uses username and password, onced this is matched connection is established between your server and computer.
  5. After authentication, authorization is checked. Authorization is a process to determine if an authenticated user has permission to access a file if not a message will be displayed saying you are not authorized to access this file.
  6. Session layer keeps a track of files that are downloaded. for e.g a webpage contains texts, images these texts and images are stored as separate files from the web server.
  7. When you request a website in your web browser, your web browser opens a separate session to download these files which are received in the form of a data packets. 
  8. Session layer keeps a track of which data packets belong to which file, either text file or image file and tracks where these received data packets go, which helps is session management

Transport layer - 

  1. Transport layer controls the reliability of communication through segmentation, flow control and error control.
  2. Protocols of this layer are TCP and UDP

Segmentation - 
  1. Here data received from session layer is divided into small data units called as segments.
  2. Each segments contains a source and destination port numbers and a sequence number
  3. Port number helps to direct each segment to the correct application and sequence numbers helps to rearrange the segments in the correct order to form a correct message.
Flow Control -
  1. Transport layer controls the amount of data being transmitted.
  2. Suppose our mobile is connected to a server which can transmit a data upto 100Mbps and our mobile can process data upto 10Mbps, now we are downloading file from the server and server starts sending data at 50 Mbps, so mobile phones with the help of transport layer can tell the server to reduce the transmission rate and vice versa
Error control - 
  1. If data is not arrived in the destination, transport layer uses Automatic Repeat Request Scheme to retransmit the lost or corrupted data.
  2. A group of bits called as checksum is added to each segment to find out received corrupted segment.

Network layer -

  1. Transport layer passes segments to the network layer, data units in the network layer are called as packets.
  2. It is the layer where router resides. The functions of network layer are logical addressing, path determination and routing.
  3. IP addressing is done in network layer known as logical addressing.
  4. Routing is the method of moving data packets from source to destination and it is based on logical address.
  5. Choosing a best possible path for data delivery from source to destination is known as path determination.

Data Link layer - 

  1. This layer receives data packets from network layer, there are two types of addressing- logical addressing and physical addressing.
  2. Logical addressing is done in network layer whereas physical addressing is done in data link layer.
  3. Where MAC address of sender and receiver are assigned to each data packet to form a frame.
  4. Data link layer is embedded as software in NIC of a computer and provides means to transfer data from one computer to another via local media.
  5. Local media includes copper wire, optical fiber or air for radio signals.

Physical layer - 

  1. This layer converts this binary sequence into signals and transmit over local media.
  2. It can be an electrical signal in case of copper cable, light signal in case of optical fiber and radio signal in case of an air.
  3. So signal generated in physical layer depends on the type of the media used to connect two devices.
  4. At the receiver, physical layer receives signals converts it to bits and passes it to the data link layer as a frame.
  5. Finally data is moved to application layer, application layer protocols makes the sender's message visible in the application in the receiver's computer screen.









Comments

Popular

MAC address

MITM Attack