📝 FTP control and data connection (9 MCQs)
Two TCP Connections in an FTP Session
FTP uses separate control and data connections so commands can continue independently of file transfer. The control connection normally begins when the client connects to server TCP port 21. A data connection is created when an operation requires a listing or file contents, then is commonly closed when that transfer finishes. This design separates session control from the potentially lengthy movement of file contents.
Control Channel and Server Listening Port
The control channel carries commands such as USER, PASS, TYPE, PORT, PASV, RETR and STOR, plus numeric server replies. In active mode, the client tells the server where to connect for data. In passive mode, the server reports a listening address and port, and the client initiates the data connection.
Active and Passive Data-Channel Establishment
After login, the client chooses a transfer mode and requests a file. For active FTP, the server opens the data connection toward the client-specified endpoint. For passive FTP, the client opens a second TCP connection to the server's advertised port. The data stream carries the transfer, while command/reply exchange remains on the control channel.
Comparing PORT and PASV Transfer Setup
Suppose a client uses PASV and receives an advertised server port such as 50000. It opens a new TCP connection to that port and then sends RETR manual.pdf on the original control connection. The server sends the file over the new channel and returns a completion reply over the control connection.
Firewall Effects on FTP Data Connections
Firewalls and Network Address Translation can complicate FTP because a session requires a second connection with endpoint information exchanged through control commands. Passive mode is often easier for clients behind restrictive firewalls because the client initiates both connections. Server configuration must expose an appropriate passive port range and advertise reachable addresses.
Misreading FTP's Connection Architecture
'FTP always uses one TCP connection' ignores the distinct data path. 'Passive mode means the server initiates the data connection' reverses the setup; the client initiates it. 'Port 20 is mandatory for every transfer' is false because passive transfers use a server-selected listening port and active behavior depends on server implementation and negotiated details.
Tracing FTP Control and Data Port Behavior
In a diagram, label the control connection as client-to-server TCP port 21 and draw the data connection separately. For active mode, trace the server's outbound data connection; for passive mode, trace the client's outbound connection. Explain firewall implications and distinguish connection establishment from the later transfer of file bytes. Trace both sockets independently when interpreting an FTP session or network capture.
FTP Connection and Mode Terms
- Control channel - Carries commands and server replies.
- Data channel - Carries transferred file or listing data.
- Active mode - Server initiates the data connection.
- Passive mode - Client initiates the data connection.
- PORT - Specifies the client's data endpoint.
- PASV - Requests passive connection parameters.
📝 All FTP control and data connection MCQs
Q1. If a peer-to-peer service first uses a lightweight client‑server request to locate a peer’s address and that request fails, what is the most likely immediate outcome for the user?
📖 Explanation: When the discovery step fails, the client cannot determine which peer holds the desired resource. Without an address, the application cannot initiate the peer‑to‑peer transfer, so it must inform the user of the failure. This error feedback is the typical immediate response, rather than silent retries or fallback to a server.
Q2. Because security is a major challenge in pure peer‑to‑peer architectures, which inference best explains why distributed services are harder to secure than centralized ones?
📖 Explanation: In a pure P2P system, every participant acts as both client and server, expanding the attack surface. Each node may have varying security postures, and an adversary can target any of them. Centralized architectures limit exposure to a few managed servers, allowing uniform security updates and monitoring, which simplifies protection.
Q3. When a mixed paradigm combines client‑server discovery with peer‑to‑peer data transfer, what is the most likely effect on overall network traffic compared to a pure client‑server model?
📖 Explanation: The mixed approach introduces an initial client‑server exchange to locate peers, then shifts the bulk of data to direct peer connections. While the discovery step adds a small overhead, the overall traffic pattern becomes more variable: some sessions may see large savings, others may still involve substantial server traffic, depending on peer availability.
Q4. Which statement best compares the scalability of pure peer‑to‑peer systems with traditional client‑server architectures?
📖 Explanation: In a P2P network, each new participant contributes resources, so the system’s capacity grows roughly in proportion to the number of peers. Conversely, a client‑server model relies on a fixed set of servers; as more clients connect, the servers become bottlenecks unless additional infrastructure is provisioned, making scalability less natural.
Q5. Why is BitTorrent generally more cost‑effective than traditional server‑hosted file distribution?
📖 Explanation: BitTorrent splits files into small pieces and exchanges them among peers, meaning each participant both downloads and uploads. This shared responsibility dramatically cuts the bandwidth that a single server would otherwise need to provide, lowering operational expenses while still delivering the file efficiently to many users.
Q6. How do security implications differ between a pure peer‑to‑peer model and a mixed client‑server/peer‑to‑peer paradigm?
📖 Explanation: In a pure P2P system, every node is responsible for its own security measures, creating inconsistent protection levels. A mixed paradigm can centralize critical functions such as authentication and key distribution on a trusted server, while still leveraging P2P for data transfer, thereby improving overall security while preserving decentralization benefits.
Q7. Applying the principle of minimizing latency, which design choice best supports a hybrid file‑sharing system?
📖 Explanation: A round‑robin scheduler balances load across multiple peers, preventing any single node from becoming a bottleneck. By distributing requests evenly, the system reduces the chance that a user will experience high latency due to an overloaded peer, thereby improving overall responsiveness while still benefiting from peer‑to‑peer distribution.
Q8. To improve security in peer‑to‑peer internet telephony without sacrificing decentralization, which mechanism is most effective?
📖 Explanation: A decentralized public‑key infrastructure (PKI) allows each participant to generate and share cryptographic keys without a central authority. Peers can then authenticate one another and establish encrypted channels, preserving the peer‑to‑peer nature while mitigating eavesdropping and impersonation risks.
Q9. What does the abbreviation P2P stand for in networking contexts?
📖 Explanation: P2P is a common shorthand for \Peer‑to‑Peer