A protocol is an agreed set of rules that define how devices communicate. A protocol suite is a collection of protocols that work together — each handling a different aspect of communication.
Networks use a layered model so that:
The TCP/IP model (also called the Internet model) is the practical model used by the internet. It has 4 layers:
| Layer (TCP/IP) | OSI Equivalent | Function | Key Protocols |
|---|---|---|---|
| 4. Application | Application, Presentation, Session | Provides network services to applications. Handles data formatting, encryption at application level. | HTTP, HTTPS, FTP, SMTP, IMAP, DNS, SSH, Telnet |
| 3. Transport | Transport | End-to-end data delivery. Segmentation, flow control, error recovery, port numbers. | TCP, UDP |
| 2. Internet (Network) | Network | Logical addressing (IP), routing packets across networks. | IP (IPv4, IPv6), ICMP, ARP |
| 1. Network Access (Link) | Data Link + Physical | Physical transmission on a specific medium. Frames, MAC addresses, hardware. | Ethernet, Wi-Fi (802.11), PPP |
The OSI model (Open Systems Interconnection) is a conceptual reference model with 7 layers. It is used for understanding and troubleshooting but TCP/IP is what's actually used.
| Layer | Name | Function |
|---|---|---|
| 7 | Application | User interface, network services to apps (HTTP, FTP, DNS) |
| 6 | Presentation | Data formatting, encryption, compression (e.g. SSL/TLS) |
| 5 | Session | Opens, maintains, closes sessions between applications |
| 4 | Transport | End-to-end delivery, segmentation, flow control (TCP, UDP) |
| 3 | Network | Logical addressing and routing (IP, ICMP) |
| 2 | Data Link | Framing, MAC addressing, error detection (Ethernet, Wi-Fi) |
| 1 | Physical | Transmission of raw bits over physical medium (cables, signals) |
Mnemonic: "All People Seem To Need Data Processing" (layers 7→1: Application, Presentation, Session, Transport, Network, Data Link, Physical).
As data moves down the layers (sender side), each layer adds its own header (and sometimes trailer) — this is called encapsulation. As data moves up the layers (receiver side), each layer removes its header — this is called decapsulation.
| Layer | Data Unit (PDU) | What's Added |
|---|---|---|
| Application | Data / Message | Application data |
| Transport | Segment (TCP) / Datagram (UDP) | Source & destination port numbers, sequence number (TCP) |
| Internet/Network | Packet | Source & destination IP addresses, TTL |
| Network Access/Data Link | Frame | Source & destination MAC addresses, error check (CRC) |
| Physical | Bits | Bits transmitted on medium |
Both are transport layer protocols but they serve different purposes:
| TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | |
|---|---|---|
| Connection | Connection-oriented (3-way handshake before data) | Connectionless — sends without establishing connection |
| Reliability | Reliable — acknowledgements, retransmission of lost packets | Unreliable — no acknowledgements, no retransmission |
| Order | Guarantees in-order delivery | No ordering guarantee |
| Speed | Slower (overhead of reliability mechanisms) | Faster (minimal overhead) |
| Flow control | Yes (window size) | No |
| Use cases | Web (HTTP/S), email (SMTP), file transfer (FTP) | Video streaming, VoIP, online gaming, DNS queries |
Before TCP transmits data, a connection is established:
Port numbers (0–65535) identify specific applications/services on a device. They allow multiple applications to share one IP address. Combined with an IP address, they form a socket.
| Port | Protocol | Use |
|---|---|---|
| 20/21 | FTP | File Transfer Protocol (data/control) |
| 22 | SSH | Secure Shell (remote access) |
| 25 | SMTP | Sending email |
| 53 | DNS | Domain Name System queries |
| 80 | HTTP | Web (unencrypted) |
| 110 | POP3 | Receiving email (downloads to client) |
| 143 | IMAP | Receiving email (server-based access) |
| 443 | HTTPS | Web (encrypted, TLS) |
8 questions · 20 marks · instantly marked
| Term | Definition |
|---|