OSI Model

The Open Systems Interconnection [OSI] model, developed by the International Organization for Standardization [ISO],
is a reference framework for standardizing communication between systems.
It divides the communication process into seven abstraction layers:
Physical, Data Link, Network, Transport, Session, Presentation, and Application.
These layers describe the flow of data from physical transmission to high-level application data,
where each layer provides specific functionalities to the one above it and is supported by the one below it.

Layer 1 - Physical:
The Physical Layer is the lowest layer of the OSI model, responsible for the physical connection between devices.
This layer deals with the transmission of raw data in the form of electrical, optical, or radio signals.
It defines the types of cables, connectors, and network interface cards [NICs] used to establish these connections.
In simple terms, the Physical Layer ensures that data is transmitted from one device to another over a physical medium,
like an Ethernet cable or Wi-Fi signal.
Protocols: Ethernet, IEEE802.11, ISDN, USB, Bluetooth.

Layer 2 - Data Link:
The Data Link Layer establishes a reliable link between two directly connected devices.
This layer ensures the correct transmission of data packets by organizing them into frames and adding error detection and correction information.
The Data Link Layer is also responsible for Media Access Control [MAC] addressing, which uniquely identifies devices on a local network.
In summary, the Data Link Layer helps maintain a stable connection between devices, manages data flow, and enables devices to be uniquely identified within a local network.
Protocols: ARP, Ethernet, L2TP, LLDP, MAC, NDP, PPP, PPTP, VTP, VLAN.

Layer 3 - Network:
The Network Layer is responsible for routing data packets between different networks.
This layer uses logical addresses, such as IP addresses, to identify devices and determine the best path to transmit data between them.
The Network Layer also manages traffic congestion and deals with packet fragmentation when necessary.
In essence, the Network Layer ensures that data reaches its destination even when it needs to travel across multiple networks.
Protocols: ARP, IP, NAT, ICMP, IPsec, ICMP [ping].

Layer 4 - Transport:
The Transport Layer provides end-to-end communication services between devices.
This layer is responsible for ensuring that data is transmitted reliably, in the correct sequence, and without errors.
The Transport Layer uses protocols like Transmission Control Protocol [TCP] for reliable, connectionoriented communication or
User Datagram Protocol [UDP] for connectionless, faster communication.
In simple terms, the Transport Layer ensures that data is delivered accurately and efficiently from one device to another over a network.
Protocols: TCP, UDP, SCTP.

Layer 5 - Session:
The Session Layer manages the establishment, maintenance, and termination of connections [sessions] between devices.
This layer enables multiple applications on different devices to communicate simultaneously by creating, managing, and synchronizing sessions.
In essence, the Session Layer helps devices maintain an organized and secure connection during communication.
Protocols: NetBIOS, RPC, SMB, Socks.

Layer 6 - Presentation:
The Presentation Layer is responsible for data formatting, translation, and encryption.
This layer ensures that the data sent by one device is understandable by the receiving device by converting it into a common format.
The Presentation Layer can also handle data compression and encryption to ensure data is transmitted efficiently and securely.
In simple terms, the Presentation Layer translates data into a format that both the sender and receiver can understand and ensures the data's confidentiality and integrity.
Protocols: TLS, SSL, AFP.

Layer 7 - Application:
The Application Layer is the topmost layer of the OSI model, and it interfaces directly with user applications.
This layer provides the protocols and services necessary for communication between applications,
such as web browsers, email clients, and file sharing programs.
The Application Layer is responsible for identifying communication partners,
establishing resource availability, and ensuring data is sent and received correctly.
In essence, the Application Layer is the bridge between the network and the user,
enabling seamless communication between applications on different devices.
Protocols: UPnP, DHCP, DNS, HTTP, NFS, NTP, POP3, SMTP, SNMP, FTP, Telnet, SSH, TFTP, IMAP.

TCP/IP Model

The Internet protocol suite, commonly known as TCP/IP,
is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria.
The foundational protocols in the suite are the Transmission Control Protocol [TCP], the User Datagram Protocol [UDP], and the Internet Protocol [IP].
The Internet protocol suite provides end-to-end data communication specifying
how data should be packetized, addressed, transmitted, routed, and received.
This functionality is organized into four abstraction layers, which classify all related protocols according to each protocol's scope of networking.
An implementation of the layers for a particular application forms a protocol stack.
From lowest to highest, the layers are:

Layer 1 - Network/Data Link:
The network link layer, also known as the network interface layer or data link layer,
consists of protocols that operate only on a link,
the network component that interconnects nodes or hosts in the network.
The protocols in this lowest layer include Ethernet for local area networks and Address Resolution Protocol.

Layer 2 - Internet:
The internet layer, also called the network layer,
deals with packets and connects independent networks to transport the packets across network boundaries.
The network layer protocols are IP and Internet Control Message Protocol, which are used for error reporting.

Layer 3 - Transport:
This layer is like the transport layer of the OSI model.
It is responsible for the end-to-end communication and delivery of data.
TCP - Transmission Control Protocol is the reliable communication protocol,
using a sequence number to identify each packet and ensure they are sent and received correctly.
A three-way handshake secures the connection.
UDP - User Datagram Protocol is the opposite of TCP.
It's unreliable, the packets send without any order,
packets can easily get lost on the way to the host/server,
packets are checked for integrity if they arrive, and the receiver cannot know the number of packets he was supposed to get.
Packets can send to the broadcast address, which undermines security.

Layer 4 - Application:
The application layer consists of various protocols that preform all the OSI model's,
Application, Presentation, Session layers.
This includes interaction with the appliation, data translation and encoding, dialogue control,
and coordination between systems. Such protocols are:
HTTP, FTP, POP3, SMTP, DNS, NTP, SSH, and more.