---
title: "Client/server architecture and FTP operation"
subject: "Internet and Intranet"
chapter: 3
key: "semester_8/internet_and_intranet:client-server-ftp"
source: https://www.bctengineer.com/q/semester_8/internet_and_intranet/client-server-ftp
site: BCT Engineering
---

# Client/server architecture and FTP operation

Internet and Intranet · Chapter 3: Protocols and Client/Server Applications

- Asked in: 2073 Bhadra, 4+6 marks
- Video: [The Client Server Model | Clients and Servers](https://www.youtube.com/watch?v=L5BlpPU_muY) — The TechCave
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/internet_and_intranet/client-server-ftp
- Whole chapter: https://www.bctengineer.com/md/semester_8/internet_and_intranet/chapter-3

## Question

Define client/server architecture with its benefits and drawbacks. Discuss the FTP client/server operation with its types.

## Short answer

Client/server architecture splits work between requesting clients and a central server, giving central control and scalability but a single point of failure and server cost. FTP uses a control connection on port 21 and a separate data connection; active mode has the server initiate data, passive mode has the client initiate, with anonymous and authenticated variants.

## Answer

#### Client/server architecture

In **client/server architecture** the work is divided between two kinds of programs. A **server** provides a service (files, web pages, database, mail) and waits for requests. A **client** starts the communication, sends a request and displays the result. They communicate over a network by a protocol; one server serves many clients.

```text
 Client 1 --\
 Client 2 ---+--request--> [ Server ] <--> data
 Client 3 --/   <-response-
```

**Benefits**
- Central control of data, security and backup.
- Easy to manage, update and upgrade the server.
- Resources and expensive hardware are shared by many clients.
- Scalable: servers can be added or upgraded.
- Clients and servers can be of different platforms; roles are clear.

**Drawbacks**
- The server is a single point of failure; if it is down, clients cannot work.
- Heavy load on the server and network can cause congestion.
- Servers and administration are costly.
- Needs skilled staff and strong security for the server.
- Clients depend on the network.

#### FTP client/server operation

**File Transfer Protocol (FTP)** (RFC 959) transfers files between a client and a server over TCP. It uses **two connections**:

- **Control connection:** TCP port 21; stays open for the whole session and carries commands (USER, PASS, LIST, RETR, STOR, QUIT) and replies (220 ready, 331 password needed, 230 logged in, 226 transfer complete).
- **Data connection:** opened for each file transfer or directory listing (TCP port 20 in active mode) and closed after the transfer.

```text
 FTP Client                        FTP Server
 [User interface]---control (21)---[Server PI]
 [Data transfer ]---data (20/n)----[Data transfer]
```

Steps: (1) client connects to port 21; (2) client logs in; (3) client sends a command such as RETR file; (4) a data connection is opened and the file is sent; (5) the data connection closes; (6) QUIT closes the session.

**Types of FTP**

1. **Active mode:** client sends PORT with its address and port; the server opens the data connection from port 20 to the client. Firewalls and NAT on the client side often block it.
2. **Passive mode:** client sends PASV; the server opens a random port and the client makes both connections. This works through firewalls and is the default today.
3. **Anonymous FTP:** public access with user "anonymous" and an e-mail as password; for public downloads.
4. **Authenticated FTP:** needs a user name and password.
5. **Secure variants:** FTPS (FTP over TLS) and SFTP (file transfer over SSH).
6. **Transfer modes:** ASCII (text) and binary (images, programs).

## Check yourself

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

1. In client/server architecture, which side starts the communication?
   A. The server, which pushes data to clients
   B. The client, which sends a request to a server waiting for requests
   C. Either side, at random
   D. A router
   Answer: B. A server provides a service and waits; the client initiates and displays the result. (Key point: Client/server roles)

2. Which is a main drawback of client/server architecture?
   A. Data cannot be backed up centrally
   B. The server is a single point of failure and may be overloaded
   C. Clients and servers must use the same platform
   D. It cannot be scaled
   Answer: B. If the server is down clients cannot work, and heavy load can cause congestion. (Key point: Single point of failure)

3. How many connections does FTP use and what do they carry?
   A. One connection carrying both commands and files
   B. A control connection on port 21 for commands and replies, and a data connection for each transfer
   C. Two data connections on port 21
   D. A UDP connection for control and TCP for data
   Answer: B. FTP keeps a control connection (port 21) open for the session and opens a data connection per transfer or listing. (Key point: FTP two connections)

4. Why is passive FTP preferred through firewalls and NAT?
   A. The client makes both connections, so the server does not connect back into the client
   B. The server connects back from port 20 to the client
   C. It uses UDP
   D. It skips authentication
   Answer: A. In passive mode the client sends PASV and opens both connections; active mode needs the server to connect to the client, which is often blocked. (Key point: Active vs passive FTP)

## Related in Internet and Intranet

- [Conditional GET; 3-tier architecture components](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Aconditional-get-3tier) — Internet and Intranet, chapter 4
- [Redundant hierarchical network design for bank](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Aredundant-network-bank-four-departments) — Internet and Intranet, chapter 5
- [N-tier challenges and tiered ISP backbone](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3An-tier-challenges-tiered-isp) — Internet and Intranet, chapter 1
- [Redundant network design for insurance company](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Aredundant-network-xyz-insurance) — Internet and Intranet, chapter 5
- [Redundant network for IOE Pulchowk campus](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Aredundant-network-ioe-pulchowk) — Internet and Intranet, chapter 5

## Related in other subjects

- [Features of client/server architecture](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aclient-server-features) — Computer Networks and Security, chapter 1
- [Architecture before specification; client-server](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aarchitecture-before-specification) — Software Engineering, chapter 3
- [Client-server versus distributed object architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aclient-server-vs-distributed-object) — Software Engineering, chapter 3
- [Multiprocessor versus client-server architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Amultiprocessor-vs-client-server) — Software Engineering, chapter 3
