OSI Model: Seven Layers of Network Communication
OSI Model (Open Systems Interconnection)
The OSI model is a theoretical model that describes how data travels through a network in seven layers, from the physical transmission of data to the application.
The layers of the OSI model describe the different functions required to transfer data across a network:
- Application layer: Provides services to applications (e.g., HTTP, FTP) and is similar to the application layer of the TCP/IP model.
- Presentation layer: Responsible for formatting and encrypting data so that it is understandable to the recipient.
- Session layer: Manages sessions between users and maintains the order of communication (e.g., control tokens).
- Transport layer: Ensures reliable communication and controls errors and packet order (e.g., TCP, UDP).
- Network layer: Responsible for routing data between networks and adding network addresses (e.g., IP).
- Data link layer: Ensures the transfer of data in frames within the same network, with error control.
- Physical layer: Transmits bits over a physical medium (wires, radio waves).
1. Application Layer
- Function: Provides an interface for communication between the user and the network (e.g., web browsing, email, file transfer).
Protocols:- HTTP/HTTPS: Transfer of web data (secured via HTTPS).
- FTP: File transfer.
- SMTP, POP, IMAP: Sending and retrieving email.
- DNS: Translation of domain names into IP addresses.
- DHCP: Automatic assignment of IP addresses.
- SSH/Telnet: Remote device management (SSH is secure, Telnet is not).
- BitTorrent/Gnutella: Peer-to-peer file transfer.
2. Presentation Layer
- Function:
- Ensures correct encoding, encryption and formatting of data for transmission, and enables interpretation of data at the destination.
- Protocols: SSL/TLS: Data encryption and protection against eavesdropping or manipulation.
3. Session Layer
- Function:
- Manages sessions (connections) between applications. Maintains sessions and enables resumption after interruptions.
- Protocols:
- ADSP, ASP: Session management in AppleTalk networks.
- NetBIOS: Communication in local area networks (LAN).
- PAP: Authentication of clients and servers.
- SMPP: Transfer of SMS messages.
4. Transport Layer
- Function:
- Divides data into segments and ensures their reliable transmission.
- Controls data flow and reassembles segments at the destination.
- Protocols:
- TCP: Reliable transmission (e.g., web, email).
- UDP: Faster but unreliable transmission (e.g., VoIP, streaming).
5. Network Layer
- Function:
- Addresses and routes packets across the network using IP addresses. Manages routes for data transfer between networks.
- Protocols:
- IP: Addressing and routing of packets.
- ICMP: Checking destination availability (ping).
- IPsec: Security encryption of data at the network layer.
6. Data Link Layer
- Function:
- Manages physical and logical addressing of devices (e.g., MAC addresses). Controls flow and detects errors in data transmission. Establishes and terminates connections between physically connected devices.
- Protocols:
- Ethernet: Standard for data transmission in local area networks (LAN).
- Wi-Fi (802.11): Standard for wireless data transmission.
- PPP (Point-to-Point Protocol): Used for data transfer between two points, e.g., via a modem.
- Frame Relay: Data transmission in wide area networks.
7. Physical Layer
- Function:
- Transmits raw bits of data over physical media (cables, optical fiber, radio waves).
- Defines the electrical, optical or radio characteristics of the signal.
- Protocols and standards:
- Ethernet (physical aspect): Defines cable characteristics and transmission speeds (e.g., Cat5, Cat6).
- USB (Universal Serial Bus): Protocol for physical data transfer between devices.
- DSL (Digital Subscriber Line): Data transmission over telephone lines.
- Bluetooth: Standard for short-range wireless communication.
IEEE 802 - Division of the Data Link Layer
- MAC (Media Access Control): Controls network access and the method of data transmission (addressing and routing).
- LLC (Logical Link Control): Identifies network layer protocols, performs encapsulation and frame synchronization.
Data Link Layer Protocols
- ARP (Address Resolution Protocol): Maps an IP address to a MAC address.
- RARP (Reverse Address Resolution Protocol): Maps a MAC address to an IP address.
General Frame Format
- Frame start: A sequence of bits marking the beginning of the frame.
- Address field: Contains the MAC addresses of the source and destination devices.
- Type: Indicates the type of data.
- Control field: Contains data for managing the link.
Frame End
- Check field: Performs error detection.
- Frame end: Marks the end of the frame and the start of the next one, if any.
Topology
- Physical topology: The layout of devices and their connections.
- Logical topology: The path data takes through the network.