The Open Systems Interconnection Model
The OSI model is a conceptual framework that represents how a network communicates. Starting from layer 1 (Physical Layer) where everything touchable is described, all the way to layer 7 (Application Layer) where all types of applications used by end-users are described. To help you imagine this process, think of ordering a package online on a website such as eBay. When purchased, the package is created and sent to your house where you can open and utilize it. Each layer describes processes responsible for sending and receiving information to serve the end-user, just like the system within an eCommerce!
Physical Layer (1)
Hardware ↔ Signal
The physical layer is pretty simple. This is the part of the OSI that you can touch. It is the first level of the OSI model and contains anything that can be touched, measured, or seen such as hardware, peripherals, and cables. It deals with the electric impulses that are turned into binary signals going through devices, cables, and Network Interface Cards (NIC).
It is responsible for the physical or wireless connection between nodes. It defines the connector, the electrical cable, or wireless technology connecting the devices. This includes cable specs, pin-out patterns, voltages, network cards, protocol standards (RJ45, V series modem standards), and even host bus adapters (HBA).

Data Link Layer (2)
Access to device / assigning identity to hardware
The Data Link Layer is the second layer which is composed of two parts. Firstly, Logical Link Control (LLC), which identifies network protocols, performs error checking and synchronizes frames. Secondly, Media Access Control (MAC) which uses MAC addresses to connect devices and define permissions to transmit and receive data. With the information from the physical layer 1, it knows where data is being sent and received from which type of media.
When information is being sent, layer 1 binary signals are transferred into layer 2 frames (a segment of data with a beginning and end), and connections are established between two connected nodes on a network. When information is being received, it breaks up layer 3 network packets into layer 2 frames and sends them from source to destination by using the unique MAC address of the host’s Network Interface Card.
It’s important to note that the Datalink layer only operates inside local networks. HUBs, Bridges, and switches are types of devices that help with this. Switches allow to connect to other computers on the same local subnet and are mapped to the local MAC addresses. HUBs, also known as “Dumb switches”, receive data and broadcast it to the network that is connected- there is no mapping to MAC or IP addresses. Bridges provide point-to-point connectivity. This means that we can’t route packages or send/receive anything from the outer network unless there’s a router setup to connect two or more separate LANs.

Network Layer (3)
Routing across networks / the internet / the «IP layer»
The network layer has two main functions. One is breaking up Layer 4 segments into layer 3 packets and/or reassembling the packets on the receiving end. The other is the routing itself, which is done by discovering the best path across a physical network. The network layer uses network addresses (typically Internet Protocol addresses) to route these packets to the destination node. When receiving this routed data, the data link layer establishes and terminates a connection between two connected nodes on a network. It breaks up Layer 3 packets into Layer 2 frames and sends them from the source to the destination host through the defined layer 1 physical media.
When talking about how to discover the best path across a physical network, we mention routing protocols such as OSPF, RIP, and BGP. These are protocols that determine various ways to choose the best route of a network of nodes to choose from.
RIP (Routing Information Protocol) is a distance vector routing protocol and uses the distance or hops count to determine the transmission path.
OSPF (for Open Shortest Path First) uses a link-state routing algorithm. It analyzes different sources like speed, cost, and path congestion while identifying the shortest path.
BGP (Border Gateway Protocol) is a standardized exterior gateway protocol designed to exchange routing and reachability information. It is a more intelligent routing protocol than RIP and is mostly used for larger size organizations.

Transport Layer (4)
Management / Control of packets and information
The transport layer takes data transferred in the session layer and breaks it into layer 4 segments. It is responsible for reassembling the segments on the receiving end, turning them back into data that can be used by the session layer. The transport layer carries outflow control, sending data at a rate that matches the connection speed of the receiving device, and error control, checking if data was received incorrectly and if not, request it again.
The Transport layer decides how data is sent over the network. It splits layer 5 data into different packages and sends them in specific methods of flow. Some protocols are state- and connection-oriented which means that they can keep track of the packages and verify delivery, such as TCP. It supports re-transmission for loss of packages, verification, enumeration of packages, and similar.

Session Layer (5)
Establishing, terminating, and controlling connections
The Session layer controls the connections between computers and devices. It establishes, manages, and terminates the connections known as sessions. It operates as an opening, closing, and managing mechanism for application processes. The session layer supports full-duplex and half-duplex operations and creates procedures for checkpointing, adjournment, restart and termination. The session layer is also responsible for synchronizing information from different sources.
It also cooperates with the Transport Layer 4 when using TCP Three-way-handshake because it is a session establishing verification. It coordinates where the conversation goes, when and whom they go to.

Presentation Layer (6)
Translating raw data for Applications / Encryption and Decryption
The Presentation Layer provides a translation of raw packages to another form so the Application Layer 7 entities can understand the data with their syntax and semantics. Data can be communicated in different formats via different sources. Thus, the presentation layer is responsible for integrating all formats into a standard format for efficient and effective communication. Such as converting Binary 1s and 0s to ASCII in a simple way of thinking.
Encryption/Decryption is typically done at this level too, although it can be done in the Application Layer 7, Session layer 5, Transport Layer 4, or Network Layer 3- each of them having its advantages and disadvantages.

Application Layer (7)
End-User ↔ Software Applications
The Application Layer is the closest layer that works with the end-user and interacts with Software and applications. It is defined as the user interface responsible for displaying received information to the user. It enables applications to access the network, can identify whom to connect to, check network availability, synchronize communication, and uses all of that data to let us access and view it in a user-friendly way.
These software applications may incorporate a few web browsers or email applications. However, it is important to understand that custom software applications differ from software applications. The conventions like HTTP or SMTP are considered under the application layer for starting email interchanges among the system hubs. Not to be confused with applications such as Word and Excel.

Shipping The OSI Model
A short explanation of how the different processes work together in steps of the OSI.
1. Electrical signals going through devices. Within cables, NIC, and such. Binary numbers 0s and 1s in ports and pins.
2. Mac addresses on all ports so the computer knows where to send on a LAN. Segments of data are sent to switches on the same subnet.
3. IP addresses stamped on data, routing packets to different IP addresses/default gateways. Fixes essential configurations like routing protocols, the best path to use, and which addresses to go through.
4. File sent over TCP to make sure the computer gets 100% of the file. Must break it into chunks since big files can’t be sent all in one. Asks “did this one get there, and this one, and this one, and this one…”
5. Before the device can send data, it has to make sure it can establish and maintain a connection. The session layer establishes and maintains the handshake. How big you’re allowed to send, who are going to talk when what to do when. “Resend it if this happens, stop when this package has arrived” Provides a termination when everything is good.
6. The packet must be encrypted so we don’t send it over original FTP, but FTP for security measures. Receiving data over FTP and decrypting it over FTP. Then translates the information within the decrypted package to services and applications.
7. Operating System wants to send a file and asks for permission. The sent data asks if it has permission to access the file and network, “can I present this to the user?” “which application used to present it?” “show timestamp on when it was received?”.
Image sources: https://www.amberit.eu/what-is-the-osi-model/