Computer Networks · Unit 6 · 7 hrs
Application Layer
Exam-focused notes for Application Layer (Computer Networks, CSC263): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.
Application Layer in short
This chapter covers the application layer: what it does, the web and HTTP, how domain names are resolved, the protocols used to move files and email, the server roles that support those applications, and the SNMP protocol used to manage a network's own devices.
What this unit covers
- Introduction and Functions
- Web &HTTP
- DNS and the Query Types
- File Transfer and Email Protocols: FTP, SFTP, SMTP, IMAP, POP3
- Overview of Application Server Concepts: Proxy, Web, Mail
- Network Management: SNMP
DNS and the Query Types
2081 · 10 marks
What are the features of the application layer? Why is DNS required? Explain about recursive, non-recursive, and iterative DNS queries.[10]
Show solved answerHide answer
Application Layer: Features, DNS, and Query Types
1. Features of the Application Layer
The Application Layer is Layer 7 of the OSI model (also called the Desktop Layer). It is implemented by network applications that produce data to be transferred over the network. It serves as a window for application services to access the network and display received information to the user.
Key Features / Functions:
| Feature | Description |
|---|---|
| File Transfer | Allows users to access, retrieve, and manage files on a remote computer (e.g., FTP) |
| Mail Services | Provides the basis for email forwarding and storage facilities (e.g., SMTP, POP3) |
| Directory Services | Provides database source access for global information about various services |
| Network Virtual Terminal | Allows a user to log on to a remote host and work as if connected locally |
| User Interface | Responsible for node-to-node communication and controls user-interface specifications |
| Access to Network Resources | Enables browsers, messengers, Skype, and other applications to communicate over the network |
| Protocol Support | Supports protocols such as HTTP, HTTPS, SSH, DNS, FTP, SMTP, etc. |
2. Why is DNS Required?
DNS (Domain Name System) is a hierarchical, distributed naming system used on the Internet.
The Core Problem:
- Computers communicate using IP addresses (e.g.,
142.250.190.46) - Humans find it easy to remember domain names (e.g.,
www.google.com) - There is a need for a system that translates domain names into IP addresses automatically
Reasons DNS is Required:
-
Human Readability: It is nearly impossible for users to memorize numeric IP addresses for every website. DNS maps easy-to-remember names to IP addresses.
-
Scalability: The Internet has billions of devices. A single centralized host file (like the old
HOSTS.TXT) cannot scale. DNS uses a distributed hierarchical database to handle this. -
Dynamic IP Management: IP addresses of servers can change. DNS allows the domain name to remain constant even if the underlying IP address changes.
-
Load Distribution: DNS can map one domain name to multiple IP addresses, enabling load balancing across servers.
-
Service Location: DNS supports different record types (MX, CNAME, etc.) to locate mail servers, aliases, and other services.
In short: DNS acts as the "phone book" of the Internet, making it usable and accessible for humans.
3. Types of DNS Queries
When a client needs to resolve a domain name, the DNS system uses three types of queries:
3.1 Recursive DNS Query
Client --> Local DNS Resolver --> Root DNS --> TLD DNS --> Authoritative DNS
<--(final answer)------<-----------<-----------<------------------
- In a recursive query, the client asks the DNS resolver to do all the work and return the final answer.
- The DNS resolver (usually the ISP's DNS server) takes full responsibility for resolving the query.
- It contacts other DNS servers on behalf of the client and returns the complete resolved IP address or an error.
- The client only makes one request and waits for the complete answer.
Steps:
- Client sends query to Local DNS Resolver: "What is the IP of www.example.com?"
- Local Resolver queries Root DNS Server
- Root DNS refers to TLD (
.com) DNS Server - TLD DNS refers to Authoritative DNS Server
- Authoritative DNS returns the IP address
- Local Resolver returns the final IP back to the client
Advantage: Simple for the client
Disadvantage: Heavy load on the DNS resolver
3.2 Non-Recursive (Iterative) DNS Query
Note: In many textbooks, "non-recursive" and "iterative" are used interchangeably. They describe the same process where the resolver is directed step-by-step.
Client --> Local DNS Resolver
|
+--> Root DNS Server --> "Ask TLD Server at X.X.X.X"
|
+--> TLD DNS Server --> "Ask Authoritative Server at Y.Y.Y.Y"
|
+--> Authoritative DNS Server --> "IP is Z.Z.Z.Z"
|
Client <-- Final Answer
- In an iterative (non-recursive) query, the DNS server does not do the full resolution itself.
- Instead, it returns the best answer it currently has -- which may be a referral (address of another DNS server that might know the answer).
- The resolver itself is responsible for following up with each referred server.
- The process continues until the authoritative answer is found.
Steps:
- Client asks Local Resolver: "What is the IP of www.example.com?"
- Local Resolver asks Root DNS: Root says "I don't know, but ask the TLD server at 192.5.6.30"
- Local Resolver asks TLD DNS: TLD says "I don't know, but ask the Authoritative server at 205.251.196.1"
- Local Resolver asks Authoritative DNS: Returns "IP = 93.184.216.34"
- Local Resolver returns the IP to the client
Advantage: Distributes the load across multiple DNS servers
Disadvantage: More round trips required
3.3 Summary Comparison Table
| Feature | Recursive Query | Iterative (Non-Recursive) Query |
|---|---|---|
| Who does the work? | DNS Resolver does all the work | Resolver follows referrals step by step |
| Response to client | Final IP address (complete answer) | Referral or final answer at each step |
| Load on resolver | High | Distributed |
| Number of client requests | One | One (but resolver makes multiple) |
| Typical use | Client to Local Resolver | Local Resolver to other DNS servers |
| Error handling | Returns error if not found | Returns "not found" at each step |
2076 · 5 marks
Why do we need a DNS system when we can directly use an IP address? what is domain name space? [5]
Show solved answerHide answer
DNS System and Domain Name Space
Why Do We Need DNS When We Can Directly Use IP Addresses?
Although it is technically possible to access any resource on the internet using its IP address directly (e.g., typing 192.168.1.1 in a browser), the DNS system is needed for the following important reasons:
1. Human Readability and Memory
- IP addresses are numeric (e.g.,
142.250.190.46) and are very difficult for humans to remember. - Domain names like
www.google.comare meaningful, easy to remember, and user-friendly. - DNS acts as a translator between human-readable domain names and machine-readable IP addresses.
2. Flexibility and IP Change Management
- The IP address of a server may change over time (due to server migration, ISP changes, etc.).
- With DNS, the domain name stays the same while only the DNS record is updated in the background.
- Users never need to know or update the new IP address.
3. Load Distribution
- A single domain name can map to multiple IP addresses, allowing traffic to be distributed across several servers.
- This would not be possible if users directly used a single IP address.
4. Supporting Other Programs
- As stated in the notes, DNS is a supporting program used by other programs such as e-mail.
- Many internet services (email, FTP, web browsing) rely on DNS to function correctly.
5. Scalability
- The internet has billions of devices. Maintaining and distributing a manual list of IP-to-name mappings for every user would be impossible.
- DNS provides a distributed, hierarchical, and scalable solution to this problem.
Domain Name Space
The Domain Name Space is the hierarchical and organized structure used by DNS to manage and store all domain names on the internet.
Key Characteristics:
- The domain name space is organized as an inverted tree structure, with the root at the top.
- The tree is divided into levels, and each node in the tree has a label.
- The full domain name of any node is called its Fully Qualified Domain Name (FQDN), which is read from the node up to the root, separated by dots (
.).
Structure of Domain Name Space:
. (Root)
/ \
com org net edu gov (Top-Level Domains - TLD)
/
google
/
www
| Level | Example | Description |
|---|---|---|
| Root | . | Top of the hierarchy, managed by IANA |
| Top-Level Domain (TLD) | .com, .org, .edu | First level below root |
| Second-Level Domain | google, example | Registered by organizations/individuals |
| Subdomain | www, mail | Further divisions within a domain |
Example:
For the domain name www.google.com:
comis the Top-Level Domain (TLD)googleis the Second-Level Domainwwwis the subdomain/host
Summary:
The domain name space is a global, hierarchical, tree-structured naming system that organizes all domain names on the internet, allowing DNS to efficiently translate human-readable names into IP addresses.
2080.1 · 5 marks
What do you understand by DNS? Explain FTP and SFTP. [5]
Overview of Application Server Concepts
2081 · 5 marks
Difference between web server and proxy server. [5]
Show solved answerHide answer
Difference Between Web Server and Proxy Server
Web Server
A web server is a server that stores, processes, and delivers web content (HTML pages, images, files) directly to clients (browsers) using the HTTP protocol. It responds to client requests by serving the requested resources from its own storage.
- It is the origin/destination of the client's request.
- It hosts websites and web applications.
- It communicates directly with the end user's browser.
- Example: Apache, Nginx, IIS.
Proxy Server
A proxy server is an intermediary server that separates end-user clients from the destinations they browse. It translates traffic between networks or protocols and evaluates outbound (or inbound) requests before relaying them to the actual destination.
- It sits between the client and the web server.
- It does not necessarily host any content of its own.
- Example: Squid, Varnish.
Key Differences
| Basis | Web Server | Proxy Server |
|---|---|---|
| Role | Hosts and serves web content directly to clients | Acts as an intermediary between client and destination server |
| Position | Is the final destination of a client request | Sits between the client and the web server |
| Content | Stores and serves its own content (HTML, images, etc.) | Does not store original content; forwards requests and responses |
| Purpose | To deliver web pages and resources | To provide security, privacy, caching, and access control |
| IP Hiding | Does not hide the client's IP address | Can hide the client's IP address while browsing |
| Caching | May cache responses for performance | Commonly used for caching to save bandwidth and improve speed |
| Security | Provides security for hosted content | Provides security by filtering and controlling internet usage |
| Types | Static or Dynamic web server | Forward proxy, Reverse proxy, Open proxy |
| Example | Apache, Nginx | Squid, Varnish, VPN |
Summary
In short, a web server is the source of web content, while a proxy server is a middleman that controls, filters, or relays communication between the client and the web server. A proxy server is used for purposes such as:
- Controlling internet usage of employees and children
- Bandwidth savings and improved speeds
- Privacy benefits (hiding IP address)
- Improved security
- Getting access to blocked resources
File Transfer and Email Protocols
2080 · 5 marks
Differentiate between IMAP and POP3. Explain SNMP. [5]
Web &HTTP
Make Unit 6 stick
Practice CSC263 with flashcards & quizzes