Understand the role of DNS, DHCP, and other application layer protocols
📋 Prior Knowledge Required
Basic understanding of computer networks (LAN, WAN)
Knowledge of IP addressing (IPv4 and IPv6)
Understanding of client-server and peer-to-peer network models
Familiarity with the concept of packets and routing
Basic understanding of data transmission methods
Knowledge of MAC addresses and network hardware
🌟 Did You Know?
A protocol is a set of rules that define how computers communicate over a network. Without protocols, devices would not know how to structure or interpret data, leading to lost, corrupted, or misrouted information. Protocols ensure reliable data transfer, consistent formatting, error checking, and security during transmission!
1. The Need for Protocols
When communicating over networks, it is essential that some form of protocol is used by the sender and receiver of the data. Both parties need to agree on the protocol being used to ensure successful communication takes place.
📖 What is a Protocol?
A protocol is a set of rules governing communication across a network. The rules are agreed by both sender and recipient.
Define how computers communicate over a network
Ensure data is sent, received, and understood correctly by all devices
Work regardless of manufacturer or operating system
Guarantee reliable data transfer, consistent formatting, and addressing
⚠️ Without Protocols
Devices would not know how to structure or interpret data
Data could be lost, corrupted, or misrouted
Communication between different hardware and software systems would break down
No error checking and correction would be possible
Security during transmission would be compromised
📝 Example: Parity Checking Protocol
With parity checking as a way of determining whether data was transmitted correctly, it was essential to agree on the protocol: even or odd parity. Without agreeing this protocol, it would be impossible to use parity checking effectively.
1.1 Protocol Stacks
A protocol stack is a way of organising network protocols into layers, where each layer is responsible for a specific function.
📖 Benefits of Layered Protocol Stacks
Each layer handles its own task independently
Layers communicate with the layers directly above and below
Makes the network easier to design, update, and troubleshoot
Makes communication modular and efficient
Allows different technologies to work together using standardised rules
💡 Exam Tip
Remember: The TCP/IP protocol stack is the most important example. It uses four layers: Application, Transport, Internet, and Link. Using layers breaks the process down into manageable self-contained modules (decomposition), making it easier to develop and maintain.
2. TCP/IP Protocol Stack
TCP/IP (Transmission Control Protocol/Internet Protocol) is a suite of communication protocols used to interconnect network devices on the internet. It was developed by DARPA (Defense Advanced Research Projects Agency).
📖 The Four-Layer Structure
When sending data across the internet (network), the layers are used in the order layer 4 to layer 1; when receiving data, the layers are used in the order layer 1 to layer 4.
⚠️ Important Terminology
Packets are known by different names at different layers:
Frames - at the data-link layer
Datagrams - at the internet layer
Segments - at the transport layer
Different names are used as each layer adds its own header to the packet.
3. Application Layer
The application layer is where the communication process begins. It interacts directly with software applications such as web browsers and email clients. This layer prepares data for transmission by converting it into a format that can be sent and received over the network (encapsulation).
Protocol
Full Name
Port
Function
HTTP
Hypertext Transfer Protocol
80
Transfer of web pages
HTTPS
HTTP Secure
443
Encrypted web transfer
FTP
File Transfer Protocol
20, 21
File transfers
SMTP
Simple Mail Transfer Protocol
25, 587
Sending emails
POP3
Post Office Protocol v3
110
Receiving emails
IMAP
Internet Message Access Protocol
143
Receiving emails (synced)
DNS
Domain Name System
53
Domain to IP translation
DHCP
Dynamic Host Configuration Protocol
67, 68
Assigns IP addresses
3.1 HTTP & HTTPS
HTTP (Hypertext Transfer Protocol) is probably the most important application layer protocol. It underpins the World Wide Web and is used when fetching HTML documents from web servers.
📝 How HTTP Works
User keys the URL into their browser
HTTP transmits the request from application layer to transport layer (TCP)
TCP creates data packets and sends them via port 80
DNS server looks up the IP address using the domain name
Server TCP sends back an acknowledgement
Web server sends the web page back in HTML format
Browser interprets the page and displays it
💡 HTTPS vs HTTP
HTTPS works the same way as HTTP but with an added layer of security. All data sent and received using HTTPS is encrypted. It is used to protect sensitive information such as passwords, financial information, and personal data. Uses port 443.
4. File Transfer Protocol (FTP)
FTP (File Transfer Protocol) is a network protocol used for transferring files from one computer/device to another via the internet or other networks. It is similar to HTTP and SMTP, but FTP's only task is the application protocol for file transfer over a network.
📖 Key Features of FTP
Uses port 20 for data transfer and port 21 for control commands
Allows uploading and downloading files to/from a web server
Offers greater efficiency and support for bulk transfers and large files
Can resume interrupted transfers
FTP clients are software applications that make the process easier for users
📝 FTP Session Process
User types in the ftp host_name of remote system
Enters user ID and password for authentication
Connection established with FTP server
User can now use FTP commands to carry out actions
FTP Command
Function
delete
Delete a file on the remote server
close
Close the FTP connection
rename
Rename a file on the remote server
cd
Change directory on remote machine
lcd
Change directory on local machine
get
Download a file from server
put
Upload a file to server
🌟 Anonymous FTP
Anonymous FTP allows a user to access files without the need to identify who they are to the FTP server. For example, '331 Anonymous access allowed' would be a message received to confirm anonymous access.
5. Email Protocols
A family of protocols handle sending and receiving of email across the internet (WAN). These include SMTP for sending and POP3 or IMAP for receiving emails.
5.1 SMTP (Simple Mail Transfer Protocol)
SMTP is a text-based (and connection-based) protocol used when sending emails. It is sometimes referred to as a push protocol because the client opens a connection to the server and keeps the connection active all the time, then uploads a new email to the server.
📖 Push Protocol Characteristics
Client opens connection to server
Connection remains active all the time
Client uploads new emails to the server
Used between email sender and email server
Used between different email servers
⚠️ SMTP and Binary Files
Since SMTP is text-based only, it doesn't handle binary files (files containing media/images as well as text). If an email contains attachments made up of images, video, or music, it is necessary to use the MIME (Multi-purpose Internet Mail Extension) protocol instead.
📝 MIME Protocol
A MIME header is used at the beginning of the transmission. Clients use this header to select which media player is needed when the attachment is opened. MIME allows email attachments containing media files as well as text to be sent.
5.2 Email Protocol Overview
6. POP3 vs IMAP - Receiving Emails
POP3 (Post Office Protocol v3) and IMAP (Internet Message Access Protocol) are protocols used when receiving emails from the email server. These are known as pull protocols.
📖 Pull Protocol Characteristics
Client periodically connects to a server
Checks for and downloads new emails from the server
Connection is then closed
Process repeats to ensure the client is updated
6.1 POP3 (Post Office Protocol)
📝 POP3 Procedure
Connect to the email server and authenticate
Retrieve outstanding emails from the server
Delete retrieved emails from the server (optional but common)
Disconnect from the server
6.2 IMAP (Internet Message Access Protocol)
IMAP is similar to POP3 but offers more functionality:
Mail Synchronization - keeps server and client in sync
Multiple Folder - based organization on the web server
Only a copy of the email is downloaded
Original remains on the server until manually deleted
Most common protocol used by large organizations
Aspect
POP3
IMAP
Synchronisation
No sync - emails deleted from server after download
Full sync - server and client stay synchronised
Storage
Emails stored locally on device
Emails stored on server
Multi-device
Can only access from download device
Can access from any device with internet
Server Space
Frees up server storage space
Server storage can limit retained emails
Offline Access
Better for offline access (emails stored locally)
Requires internet to view emails
Changes
Changes not reflected across devices
Changes on one device sync to all devices
💡 Exam Tip - Key Difference
The main difference between POP3 and IMAP is synchronisation:
POP3: Downloads emails and typically deletes from server → No sync
IMAP: Downloads copy, keeps original on server → Full sync
7. BitTorrent Protocol
BitTorrent is a peer-to-peer (P2P) file-sharing protocol used to distribute large amounts of data efficiently across the internet. It is a communication protocol for peer-to-peer file sharing which enables users to distribute data and electronic files over the Internet in a decentralized manner.
📖 How BitTorrent Works
Instead of downloading a file from a single central server, BitTorrent allows users to download pieces of the file from multiple users (peers) who already have parts of it.
Faster, as downloads come from many sources at once
More efficient, reduces the load on any single server
Enables sharing of large files like software, videos, or games
Decentralised distribution - no central hosting required
7.1 Key Terminology
Term
Definition
Torrent
A small file containing metadata about the file to be shared (e.g., MyVideoFile.torrent)
Tracker
Central server that stores details of all computers in the swarm (IP addresses)
Swarm
A group of connected peers (clients) that share a torrent/tracker
Seed
A peer that has downloaded a file (or pieces) and made it available to other peers
Leech
A peer with negative impact - downloading more than uploading (share ratio < 1)
Lurker
A peer that downloads files but does not make available any new content
Pieces
The actual file broken up into equal segments for sharing
Metadata
A set of data that describes and gives information about other data
Share Ratio = Amount uploaded ÷ Amount downloaded Ratio > 1 = positive impact (good peer) | Ratio < 1 = negative impact (leech)
8. BitTorrent Process
📝 How BitTorrent File Sharing Works
Peer creates a torrent file containing metadata about the file to be shared
Actual file is broken up into equal segments called pieces
Other peers obtain the torrent and connect to the appropriate tracker
Each peer receives pieces and becomes a source for those pieces
Peers connect to multiple seeds and download small portions from each
Higher download speeds achieved by using multiple sources
Complete file is checked using checksum to verify integrity
Once fully downloaded, peer becomes a seed and can share with others
❌ Common Mistakes
Confusing the tracker with the actual file server - the tracker only stores metadata and IP addresses, NOT the file itself
Thinking pieces must be downloaded sequentially - they can be downloaded in any order
Forgetting that file pieces must be rearranged in correct order by BitTorrent protocol
9. Transport Layer
The transport layer regulates the network connections. This is where data is broken up into packets which are then sent to the internet/network layer (IP protocol). It ensures that packets arrive in sequence, without errors, by swapping acknowledgements and retransmitting packets if they become lost or corrupted.
9.1 TCP (Transmission Control Protocol)
TCP is responsible for the safe delivery of a message by creating sufficient packets for transmission. It is also known as a host-to-host transmission protocol because it establishes an end-to-end connection between two host computers using handshakes.
📖 TCP Characteristics
Uses Positive Acknowledgement with Retransmission (PAR) - automatically re-sends packets if no positive acknowledgement received
Connection-oriented - establishes end-to-end connection using handshakes
Ensures packets arrive in sequence
Provides error checking and flow control
Breaks data into packets (segments) and assigns port numbers
📝 TCP Host-to-Host Communication (Three-Way Handshake)
Host 'X' sends Host 'Y' a segment with synchronisation sequence bits so segments will be received in correct order
Host 'Y' responds with its own segment containing an acknowledgement plus its own synchronisation sequence bits
Host 'X' sends acknowledgement that segment from 'Y' was received
Transmission of data between 'X' and 'Y' can now take place
9.2 TCP vs UDP
Feature
TCP
UDP
Connection
Connection-oriented (handshake)
Connectionless
Reliability
Reliable (acknowledgements, retransmission)
Unreliable (no guarantees)
Speed
Slower (due to error checking)
Faster (no error checking overhead)
Ordering
Packets arrive in order
Packets may arrive out of order
Use Case
Email, web pages, file transfer
Streaming, gaming, VoIP
💡 Exam Tip
A host is a computer or device that can communicate with another computer/device on a network. Hosts can include clients and servers that send/receive data, provide services or apps.
10. Internet Layer
The internet layer identifies the intended network and host. The common protocol is IP (Internet Protocol). This layer is responsible for logical transmission of data packets over the internet.
📖 IP Functions
Ensures correct routing of packets of data over the internet/network
Responsible for protocols when communicating between networks
Takes a packet from the transport layer and adds its own header (including IP addresses of sender and recipient)
Routes each packet independently using the optimal route
Reassembles out-of-order packets when they reach the destination
Handles errors in transmission and fragmentation of data packets
10.1 Internet Layer Protocols
Protocol
Full Name
Function
IP
Internet Protocol
Connectionless, unreliable protocol providing best-effort delivery; transports datagrams over different routes
ARP
Address Resolution Protocol
Maps logical address (IP) to physical address (MAC)
RARP
Reverse ARP
Finds IP address when physical (MAC) address is known
ICMP
Internet Control Message Protocol
Monitors queries and sends error messages
IGMP
Internet Group Message Protocol
Allows transmission of a message to a group simultaneously
🌟 Important Note
At the internet layer, packets are called datagrams. The IP packet (datagram) is sent to the data-link layer where it is assembled into frames for transmission.
11. Link (Network) Layer
The link layer (also called network interface layer) is the lowest layer of the TCP/IP model. It is concerned with the physical transmission of data. It can be considered as the combination of physical layer and data link layer of the OSI model.
📖 Link Layer Functions
Defines how bits are encoded into optical or electrical pulses
Accepts IP packets and encapsulates them into frames
Synchronises transmission of frames between sender and receiver
States the transmission mode (simplex, half-duplex, full-duplex)
States the network topology (bus, star, ring, etc.)
Maps IP addresses to MAC (physical) addresses
11.1 Ethernet Protocol
Ethernet is a system that connects a number of computers or devices together to form a LAN. It uses protocols to control the movement of frames between computers and to avoid simultaneous transmission by two or more devices.
📝 Ethernet Frame Structure
A typical Ethernet frame contains:
Destination: MAC address of destination (or FF:FF:FF:FF:FF:FF for broadcast)
Source: MAC address of source computer
Type/Length: Frame length or Ethernet type (IPv4/IPv6)
Data: Actual message (46-1500 bytes)
FCS: Frame Check Sequence (checksum for integrity)
11.2 CSMA/CD
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is a network protocol used in Ethernet networks. It senses whether the shared channel is busy and defers transmission until the channel is free. If a collision is detected, the station stops transmitting, sends a jam signal, and waits for a random time before retransmission.
12. Exam-Style Questions
1. Explain why protocols are essential for network communication. Describe what could happen if no protocols were used. [4 marks]
Answer:
Protocols are sets of rules that define how computers communicate over a network
They ensure data is sent, received, and understood correctly by all devices
Without protocols, devices would not know how to structure or interpret data
Data could be lost, corrupted, or misrouted
Communication between different hardware and software systems would break down
No error checking and correction would be possible
Additional points for deeper understanding:
Protocols guarantee reliable data transfer and consistent formatting
They enable addressing and security during transmission
2. Describe the four layers of the TCP/IP protocol stack and explain the function of each layer. [8 marks]
Answer:
Application Layer (Layer 4): Where communication begins; interacts with software applications (browsers, email clients); prepares data for transmission (encapsulation); protocols include HTTP, FTP, SMTP, DNS
Transport Layer (Layer 3): Regulates network connections; breaks data into packets (segments); assigns port numbers; ensures packets arrive in sequence without errors; uses TCP or UDP
Internet Layer (Layer 2): Identifies intended network and host; adds IP addresses to packet headers; routes packets across the network; uses IP, ARP, ICMP
Link Layer (Layer 1): Prepares packets for physical transmission; translates digital packets into electrical, optical, or wireless signals; encapsulates into frames; uses Ethernet, WiFi
Additional points for deeper understanding:
When sending: data flows from Layer 4 down to Layer 1
When receiving: data flows from Layer 1 up to Layer 4
Each layer adds its own header to the packet
3. Compare HTTP and HTTPS. Why is HTTPS preferred for secure transactions? [4 marks]
Answer:
HTTP (Hypertext Transfer Protocol) transfers web pages between client and server using port 80
HTTPS works the same way but adds an encryption layer using SSL/TLS
HTTPS uses port 443 instead of port 80
HTTPS is preferred for secure transactions because all data is encrypted
Encryption protects sensitive information like passwords, financial data, and personal information
Additional points for deeper understanding:
HTTPS prevents man-in-the-middle attacks
HTTPS provides authentication of the website server
4. Explain the difference between a push protocol and a pull protocol. Give an example of each. [4 marks]
Answer:
Push protocol: Client opens connection to server and keeps it active; uploads data to server
Example: SMTP for sending emails - client uploads new email to server
Pull protocol: Client periodically connects to server; checks for and downloads data; connection closes after download
Example: POP3 or IMAP for receiving emails - client connects, downloads emails, disconnects
Additional points for deeper understanding:
Push protocols maintain active connection throughout the transfer
Pull protocols are more efficient for periodic checking/updates
5. Compare POP3 and IMAP protocols for receiving emails. When would you recommend using each? [6 marks]
Answer:
POP3: Downloads emails and typically deletes from server; emails stored locally; no synchronisation between devices
IMAP: Downloads copy of emails; original remains on server; full synchronisation across all devices
Recommend POP3 when: user wants offline access, has limited server storage, only uses one device
Recommend IMAP when: user accesses email from multiple devices, needs synchronisation, works in an organisation
POP3 frees up server storage space; IMAP allows access from any device with internet
Changes made on one device are reflected on all devices with IMAP, but not with POP3
12. Exam-Style Questions (Continued)
6. Describe the role of a tracker in the BitTorrent protocol. What information does it store? [4 marks]
Answer:
A tracker is a central server that stores details about all computers in the swarm
It stores the IP addresses of all peers downloading or uploading the file
It stores metadata about the torrent (file information, piece sizes)
It helps peers locate each other to exchange pieces of the file
It stores which parts of the file each peer owns
Additional points for deeper understanding:
The tracker does NOT store the actual file being shared
Multiple trackers can be used for redundancy
7. Explain the terms 'seed', 'leech', and 'swarm' in the context of BitTorrent. [6 marks]
Answer:
Seed: A peer that has downloaded a complete file (or pieces) and has made it available to other peers in the swarm
Leech: A peer with negative impact on the swarm - downloads more data than it uploads (share ratio < 1)
Swarm: A group of connected peers (clients) that share a particular torrent/tracker
The more seeds in a swarm, the faster the file downloading process between peers
Logging off after downloading without seeding is frowned upon by the community (becoming a leech)
Availability refers to the number of complete copies distributed amongst a swarm
8. Describe how TCP ensures reliable data transmission. Include the concept of handshakes in your answer. [5 marks]
Answer:
TCP is connection-oriented - it establishes an end-to-end connection using handshakes
Three-way handshake: (1) Host X sends synchronisation bits to Host Y, (2) Host Y responds with acknowledgement and its own sync bits, (3) Host X acknowledges
TCP uses Positive Acknowledgement with Retransmission (PAR) - automatically re-sends packets if no positive acknowledgement received
TCP ensures packets arrive in sequence using synchronisation sequence bits
TCP provides error checking and flow control
Additional points for deeper understanding:
TCP breaks data into segments and assigns port numbers
TCP can request retransmission of corrupted or lost packets
9. Explain the difference between TCP and UDP. Give an example of when each would be used. [6 marks]
Answer:
TCP: Connection-oriented, requires handshake, reliable with acknowledgements and retransmission, ensures packets arrive in order, slower due to overhead
UDP: Connectionless, no handshake required, unreliable with no guarantees, packets may arrive out of order, faster due to no error checking overhead
TCP used for: Email (SMTP), web pages (HTTP), file transfer (FTP) - where reliability is critical
UDP used for: Video streaming, online gaming, VoIP - where speed is more important than perfect delivery
TCP is better when data integrity is essential; UDP is better for real-time applications
10. Explain the role of MIME in email transmission. Why is it necessary? [4 marks]
Answer:
MIME (Multi-purpose Internet Mail Extension) is a protocol that allows email attachments containing media files
SMTP is text-based only and cannot handle binary files (files with images, video, music)
MIME adds a header at the beginning of transmission to indicate the type of content
Clients use the MIME header to select the appropriate media player for attachments
Without MIME, emails could only contain plain text
Additional points for deeper understanding:
MIME supports various content types: images, audio, video, application files
MIME enables international character sets beyond ASCII
11. Describe the purpose and function of the Ethernet frame check sequence (FCS). [3 marks]
Answer:
The FCS (Frame Check Sequence) is a 4-byte field in an Ethernet frame
It contains a checksum value calculated from the frame's data
Used to verify data integrity following transmission of the frame
Receiver recalculates the checksum and compares with FCS to detect errors
If checksums don't match, the frame is corrupted and can be rejected
12. Explain why packets are given different names at different layers of the TCP/IP stack. [4 marks]
Answer:
Each layer adds its own header to the packet during encapsulation
Segments at transport layer - include TCP/UDP header with port numbers
Datagrams at internet layer - include IP header with source/destination IP addresses
Frames at link layer - include Ethernet header with MAC addresses
Different names reflect the additional information added at each layer
This helps in understanding what processing has been applied to the data
13. Glossary
📖 Key Terms
Protocol → A set of rules governing communication across a network; agreed by both sender and recipient
TCP/IP → Transmission Control Protocol/Internet Protocol; suite of protocols for internet communication
HTTP → Hypertext Transfer Protocol; transfers web pages between client and server
HTTPS → HTTP Secure; encrypted version of HTTP using SSL/TLS
FTP → File Transfer Protocol; transfers files between computers
SMTP → Simple Mail Transfer Protocol; sends emails (push protocol)
POP3 → Post Office Protocol version 3; receives emails (pull protocol, no sync)
Remember: The TCP/IP stack enables communication between different devices and operating systems using standardised rules. Each layer adds its own header - packets become segments (transport), datagrams (internet), then frames (link). Understanding the flow from application to physical transmission is key to mastering network protocols!