FTP uses ports 20 and 21 to transfer files between a client and server over TCP/IP networks like the internet. There are two transfer modes - active mode where the server connects to the client's data port, and passive mode where the client initiates both connections to the server's ports. HTTP is a request/response protocol used to transfer web pages over the internet, with clients like browsers making requests on port 80 to web servers, which respond with files, data, or error messages. Web servers translate URL paths to local file system paths and serve index files like index.html when directories are requested. HTTPS adds encryption and authentication to standard HTTP using port 443.