Skip to main content

Web and file server communication

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.

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

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.

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.
ServerProtocolTransportPort
WebHTTP / HTTPSTCP80 / 443
FileFTPTCP20, 21
FileTFTPUDP69
Name lookupDNSUDP/TCP53

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.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Networks and Security chapter 6 questions →