The OSI Reference Model
OSI Reference Model
OSI stands for Open System Interconnection. OSI provides a framework for creating and implementing networking standards, devices, and internetworking schemes.
The following devices operate at the OSI model:
- Network Management Stations (NMSs)
- Web and application servers
- Gateways
- Network hosts
The OSI reference model has the following seven layers:
- Application layer (layer 7)
- Presentation layer (layer 6)
- Session layer (layer 5)
- Transport layer (layer 4)
- Network layer (layer 3)
- Data Link layer (layer 2)
- Physical layer (layer 1)
Application Layer
- The Application layer of the OSI model is the place where users communicate with the computer.
- It is also known as Desktop layer.
- The services provided by application layer are mail service, directory service, and network resources, etc.
- Application layer uses protocols like HTTP (Hyper Text Transfer Protocol), FTP (File Transfer Protocol), and ARP (Address Resolution Protocol).
Presentation Layer
- It presents data that comes from the Application layer and responsible for data translation and code formatting.
- It is also known as Translation layer because it translates one form of data into another form.
- It performs functions like translation (ASCII to EBCDIC), data compression, decompression, encryption, and decryption.
Session Layer
- It is responsible for setting up, managing, authenticating, and then tearing down the session.
- It coordinates communication between systems and servers to organize their communication by offering three different modes: Simplex, half duplex, and full duplex.
Simplex
In this mode, communication takes place only one direction. Only one device at a time can send the data and the other devices can receive only.
Example
Radio broadcasting, television broadcasting, and computer to printer communication.
Half Duplex
In this mode, communication takes place in both directions, but not at the same time. When one device is sending, the other can receive only and vice versa.
Example
Walkie-Talkie, Older modem protocols.
Full Duplex
In this mode, communication takes place in both directions; both devices can send and receive data simultaneously at the same time.
Example
Telephone.
Transport Layer
- It receives the data from the session layer, and splits the data into smaller units, passes into the network layer.
- Multiplexing, splitting on data is done by this layer.
- It is responsible for end-to-end delivery of complete data.
- It provides reliable communication between end devices over the network and also provides mechanisms for establishing, maintaining, and terminating virtual circuits.
- A reliable Transport layer connection uses the acknowledgment to make sure all data is transmitted and received reliably.
- A reliable connection defines as a virtual circuit that uses flow control, connection-oriented communication, and acknowledge, which are characteristics of the Transport layer.
Flow Control of OSI Model
- Flow control is a procedure that tells the sender how much segments (data) it can transmit before it must wait for an acknowledgment from the receiver.
- Each receiving device has a block of memory, called buffer, which process incoming segments and a limited amount of memory to store incoming segments.
- The receiver must inform the sender before the buffer overflow occurs and request that the sender to send fewer segments or stop temporarily until previous segments are processed.
- A secure data flow is maintained to avoid congestion and data loss.
Connection-Oriented Communication
In reliable transport operation, a device that wants to transmit or set up a connection-oriented communication session with a remote device by creating a session. The transmitting device first establishes a connection-oriented session with its peer system, which is called setup or a three-way handshake.
Three-way handshake –
- The client sends a SYN (synchronize) packet to the server, which has a random sequence number.
- The server sends back a SYN-ACK packet, containing a random sequence number and an ACK number acknowledging the client’s sequence number.
- The client sends an ACK number to the server, acknowledging the server’s sequence number.
- The sequence numbers on both ends are synchronized. Both ends can now send and receive data independently.
Acknowledgments
Reliable data delivery ensures the data won't be duplicated or lost.
It is achieved through something called acknowledgment with retransmission. It is a technique that requires a receiving machine to communicate with the transmitting source by sending an acknowledgment message back to the sender when it receives the data. The sender waits for an acknowledgment before sending the next segment. When it sends a segment, the transmitting machine starts a timer, and if the timer ends and the sender does not get any acknowledgment from the receiving machine, the sender retransmits the segment.
In the above example, sending machine sends segments 1, 2, and 3. The receiving machine acknowledges it and requesting for segment 4. When it receives the acknowledgment, the sender then transmits segment 4, 5, and 6. If segment 5 lost, the receiving machine provides acknowledgment that segment is to be resent. The sending machine will then resend the lost segment and wait for an acknowledgment if it receives acknowledgment it move on to the transmission of segment 7.
Network Layer
- It handles the service requests from the transport layer and further forwards the service request to the data link layer.
- It selects the shortest path to transmit packets from the host to host (source to destination) delivery.
- Router and Switches work on the network layer.
- Logical addresses (IP addresses) are used in the Network layer.
Two types of packets are used at the network layer.
- Data Packets
- Route Update Packets
Data Link Layer
- This layer provides the physical transmission of data and handles error notification, network topology, and flow control.
- It is responsible for node to node delivery of the message.
- It receives the packets (message) from the network layer.
- It formats the message into pieces, each called a data frame and adds a header containing the source and destination address.
- Switches and bridges are operated on the data link layer.
Data link layer has two sub layers:
Media Access Control (MAC)
It is responsible for error-free data transmission and for providing electronic access to one or more Network Interface Cards (NIC) at the physical layer.
MAC sublayer contains the MAC address (hardware or physical address) for the NIC.
Logical Link Control (LLC)
It is responsible for identifying Network layer protocols and then encapsulating them.
Physical Layer
- The main role of the physical layer is: It sends and receives bits. Bits come only in values 1 or 0.
- It communicates directly with the various types of communication media.
- It also deals with electrical, Mechanical and functional specifications of the devices, media, etc.
Examples of the physical layer are:
Wired: Ethernet, Dial-up telephone modem, etc.
Wireless: IEEE 802.11 (Wi-Fi), Bluetooth.
Layer Functions
Application – File, message, database, and application services
Presentation – Data encryption, compression, and translation services
Session – Dialog control
Transport – End-to-end connection
Network - Routing
Data Link – Framing
Physical – Physical topology
The OSI layer is divided into two groups.
Upper Layers
The upper three layers define how the applications within the end stations will communicate with each other.
Application – Provides a user interface.
Presentation - Presents data
- Handles processing such as encryption
Session - Keeps different applications’ data separate
Lower Layers
The Lower four layers define how data is transmitted end to end. These layers know anything about networking or network addresses.
Transport - Provides reliable or unreliable delivery
- Performs error correction before retransmit
Network - Provides logical addressing, which router use for path determination
Data Link - Combines packets into bytes and bytes into a frame
- Provides access to media using MAC address
- Performs error detection not correction
Physical - Moves bits between devices
- Specifies voltage, and wire speed