The OSI (Open Systems Interconnection) Model is a foundational concept in computer networking.
The OSI Model comprises seven layers, each with specific functions:
Layer | Name | Function |
---|---|---|
7 | Application | Users interact with applications that use network services to access resources. |
6 | Presentation | Data is encoded into a usable format and may be encrypted for privacy. |
5 | Session | This layer maintains communication sessions between different systems. |
4 | Transport | This layer determines how the data will be transmitted, using Transport Control Protocol (TCP) or User Datagram Protocol (UDP). |
3 | Network | This layer is responsible for determining the physical path the data will take across multiple networks. |
2 | Data Link | This layer defines the format of data on the network and associates the physical Media Access Control (MAC) address of the network interface card with the virtual IP address of the system. |
1 | Physical | The physical layer is responsible for converting the data into a physical signal representing the raw bits and transmitting it to another device. |
Mnemonic to remember the layers (from Layer 1 to Layer 7): "Please Do Not Throw Sausage Pizza Away."
The following illustrates how information is communicated through the OSI stack between Computer A and Computer B:
Layer | Computer A | Computer B |
---|---|---|
7 | Information written by a user into a web-enabled messaging application enters the word “Hello” into the text box and clicks Send. | The word “Hello” is displayed on the screen within the messaging application. |
6 | The letters of the message are encoded as numbers using a character encoding set by the presentation layer. | The presentation layer unencodes the message from numbers to the original, human-readable message “Hello”. |
5 | The session layer was used to establish the connection between the user’s computer and a remote computer and associate the encoded message with the messaging session. | Port numbers and identifiers are used to associate the incoming message with a particular application. |
4 | The transport layer is used to determine how the message will be transmitted using either TCP or UDP. The transport layer then reassembles the message using the appropriate mechanisms. For TCP, the sequence numbers are used to reassemble the original message. | For TCP, any lost or damaged packets are resent by the origin. In the case of UDP, the packets are simply processed up to the next layer. |
3 | The message is formatted into a network packet that uses IP addresses to track the origin and destination systems involved in the communication. | The frames are then reassembled into the original network packet and the IP addresses are examined. |
2 | The network packet is then segmented and formatted into data frames to be transmitted to the next device. Physical MAC addresses are used to track the frame from this device to the next connected device. | The NIC sends the received frames to be reassembled and the MAC addresses are examined. |
1 | The NIC (network interface card) converts the bits of the frame into either electrical, light, or radio signals and transmits them to the next device. | The bits are received and assembled in the NIC’s memory. |
In real-world scenarios, data flow isn't direct. Intermediate systems and networking devices exist between origin and destination.