Communication Protocol
1. Definition
A communication protocol is a set of agreed rules and conventions that two or more communicating entities follow so that data can be exchanged correctly. It defines what is sent, in what form, in what order, and what to do if something goes wrong. Without a protocol, two devices — even with identical hardware — cannot understand each other: a protocol is the common language of a network.
2. The Three Elements of a Protocol
| Element | Question it answers | Example |
|---|---|---|
| Syntax | What is the format/structure of the message? | An Ethernet frame has preamble, destination MAC (6 B), source MAC (6 B), type (2 B), payload, FCS; an IPv4 header is fixed 20 bytes |
| Semantics | What does each field mean, and what action follows? | Port 443 means HTTPS; a SYN flag requests a connection; ACK number acknowledges received bytes |
| Timing | When to send and how fast? | Speed matching between a fast sender and a slow receiver, sequence ordering, timeouts and retransmission intervals |
3. Functions Performed by Protocols
- Framing / encapsulation — wrapping data with headers and trailers so the receiver knows where messages begin and end.
- Addressing — identifying the destination: MAC address (link), IP address (network), port number (process).
- Flow control — preventing a fast sender from overwhelming a slow receiver (sliding-window, ACK-based).
- Error control — detecting and correcting errors using parity bits, checksums, CRC, and retransmission (ARQ).
- Sequencing and reassembly — numbering segments so that lost, duplicated or out-of-order packets can be handled.
- Connection management — establishing, maintaining and terminating a session (the TCP three-way handshake, FIN/ACK).
- Multiplexing — allowing many applications and connections to share one physical link (ports, sessions).
- Routing and forwarding — deciding the path across multiple networks (IP, OSPF, BGP).
- Security — authentication, encryption and integrity (TLS/SSL, IPsec, WPA2/WPA3).
- Compression — reducing the number of bits sent.
- Congestion control — backing off when the network is overloaded.
4. Protocol Layering and Peer Communication
Host A Host B
┌──────────┐ logical (peer-to-peer) conversation ┌──────────┐
│ Layer 3 │◄──────── same protocol, same rules ───►│ Layer 3 │
├──────────┤ ├──────────┤
│ Layer 2 │◄────────── logical exchange ──────────►│ Layer 2 │
├──────────┤ ├──────────┤
│ Layer 1 │◄──── actual signals over the medium ──►│ Layer 1 │
└──────────┘ └──────────┘
Each layer talks logically to its peer on the other machine, but physically only to the layer below. The layer's data plus its header becomes the payload of the next lower layer — encapsulation. This modularity means a protocol in one layer can be replaced (Wi-Fi instead of Ethernet, IPv6 instead of IPv4) without rewriting the others.
5. Well-Known Protocols
| Layer / purpose | Protocol | Function |
|---|---|---|
| Application | HTTP/HTTPS | Web pages (HTTPS = HTTP over TLS) |
| Application | FTP, SFTP | File transfer |
| Application | SMTP, POP3, IMAP | Sending and retrieving e-mail |
| Application | DNS | Domain name → IP address |
| Application | DHCP | Automatic IP configuration |
| Application | SNMP | Network device monitoring |
| Transport | TCP | Reliable, connection-oriented byte stream |
| Transport | UDP | Unreliable, connectionless datagrams (fast) |
| Network | IP (v4/v6) | Addressing and routing of packets |
| Network | ICMP | Error and diagnostic messages (ping) |
| Network | ARP | IP address → MAC address |
| Routing | OSPF, RIP, BGP | Dynamic route exchange inside/outside an organisation |
| Data link | Ethernet (802.3), Wi-Fi (802.11) | Framing, MAC addressing, media access |
| Data link | PPP | Point-to-point over serial/WAN links |
| Security | TLS/SSL, IPsec | Encryption, integrity, authentication |
6. Connection-Oriented vs Connectionless
| Basis | Connection-oriented (TCP) | Connectionless (UDP) |
|---|---|---|
| Connection setup | Handshake required (SYN, SYN-ACK, ACK) | None — just send |
| Reliability | Acknowledgements and retransmission | No guarantee of delivery |
| Ordering | Sequence numbers preserve order | Order not guaranteed |
| Overhead | Higher headers, state, ACKs | Very low, minimal header (8 bytes) |
| Speed | Slower | Faster |
| Flow/congestion control | Yes | No |
| Typical use | Web, e-mail, file transfer, SSH | DNS, DHCP, VoIP, video streaming, gaming, TFTP |
7. Design Considerations
Reliability vs efficiency — every check costs bandwidth and latency. Simplicity vs features. Interoperability — open standards (IETF RFCs, IEEE 802, ISO) keep vendors compatible. Scalability — a protocol designed for a LAN may fail on the Internet (broadcast storms, address exhaustion). Security — protocols designed before the Internet became hostile need add-ons such as TLS. Evolvability — version fields and options permit extension without breaking existing implementations.
8. Exam Points
- Define a protocol. Explain syntax, semantics and timing with examples — 5 marks, almost certain.
- List the main functions of a communication protocol — 5 marks, frequent.
- Why are protocols layered? Explain peer-to-peer logical communication — 5 marks.
- Differentiate connection-oriented and connectionless protocols with examples — 5 marks, very frequent.
- Name any five protocols with the layer they belong to and their function — 5 marks.
- What happens if two computers run different protocols? — 3 marks.