---
title: "Web and file server communication"
subject: "Computer Networks and Security"
chapter: 6
key: "semester_7/computer_networks_and_security:web-file-server-communication"
source: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/web-file-server-communication
site: BCT Engineering
---

# Web and file server communication

Computer Networks and Security · Chapter 6: Application Layer

- Asked in: 2073 Shrawan, 6 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/web-file-server-communication
- Whole chapter: https://www.bctengineer.com/md/semester_7/computer_networks_and_security/chapter-6

## Question

How are web server and file server communication possible in a network? Explain with the protocols used.

## Short answer

Web servers use HTTP/HTTPS over TCP ports 80/443, while file servers use FTP on ports 20/21, TFTP on UDP port 69, or SMB/NFS. DNS resolves names, TCP/IP establishes connections, and IP routes packets over the network.

## Answer

A **web server** stores web pages and serves them to browsers; a **file server** stores files for download/upload and sharing. Both communicate with clients over the network using application-layer protocols that run on TCP/IP.

```text
Client (browser / FTP client)
   | 1. DNS: name -> IP (UDP 53)
   | 2. TCP connection (port 80/443 or 21)
   v
Web server (HTTP)        File server (FTP / SMB / NFS)
```

#### Web server communication
1. The user types a URL. The client resolves the host name by **DNS**.
2. A **TCP** connection (three-way handshake) is opened to port 80 (HTTP) or 443 (HTTPS, using TLS).
3. The browser sends an **HTTP request** (`GET /index.html HTTP/1.1`).
4. The server returns an **HTTP response** with status code and the page; the browser also requests images and scripts.
5. The connection is closed or kept alive.

#### File server communication
- **FTP:** two TCP connections: control on port 21 (commands such as USER, PASS, LIST, RETR, STOR) and data on port 20. SFTP/FTPS add security.
- **TFTP:** simple file transfer over UDP port 69.
- **SMB/CIFS (Windows) and NFS (Unix):** file sharing in a LAN.

| Server | Protocol | Transport | Port |
|---|---|---|---|
| Web | HTTP / HTTPS | TCP | 80 / 443 |
| File | FTP | TCP | 20, 21 |
| File | TFTP | UDP | 69 |
| Name lookup | DNS | UDP/TCP | 53 |

Below the application layer, IP routes the packets and Ethernet/Wi-Fi carries the frames, so both servers can be reached from anywhere in the network.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which protocol and transport does a web server use?
   A. HTTP over TCP port 80/443
   B. HTTP over UDP 80
   C. FTP over TCP 69
   D. DNS over TCP 80
   Answer: A. HTTP runs over TCP port 80 (HTTPS 443). (Key point: Web protocol)

2. How many connections does FTP use?
   A. One on port 80
   B. Two: control on 21, data on 20
   C. One UDP on 69
   D. Three
   Answer: B. FTP separates control (21) and data (20). (Key point: FTP)

3. TFTP uses:
   A. TCP 21
   B. UDP 69
   C. TCP 80
   D. UDP 53
   Answer: B. TFTP is simple transfer over UDP port 69. (Key point: TFTP)

## Related in Computer Networks and Security

- [Email server and its protocols](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aemail-protocols-server) — Computer Networks and Security, chapter 6, asked 3×
- [Short note: Web server](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aweb-server-note) — Computer Networks and Security, chapter 6
- [Client-server vs peer-to-peer](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aclient-server-vs-p2p) — Computer Networks and Security, chapter 1
- [Proxy server and bandwidth reduction](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aproxy-server-bandwidth) — Computer Networks and Security, chapter 6
- [Network design for 3-star hotel](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Ahotel-network-design) — Computer Networks and Security, chapter 1

## Related in other subjects

- [Web-mail to POP3 message transfer protocols](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Aalice-bob-email-protocols) — Internet and Intranet, chapter 3
- [HTTP request methods; web server and virtual hosting](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Ahttp-methods-config-virtual-hosting) — Internet and Intranet, chapter 4
- [Uses of microwaves in communication and protocols](https://www.bctengineer.com/question.md?key=semester_7%2Frf_and_microwave_engineering%3Amicrowave-communication-uses-protocols) — RF and Microwave Engineering, chapter 1
- [Reliable client-server communication](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Areliable-client-server) — Distributed System, chapter 9
