Which TCP port number of the server the Web browser will connect to when specifying URL...
Accenture technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Which TCP port number of the server the Web browser will connect to when specifying URL (Universal Resource Locator) as http://ftp.example.jp/index.cgi?port=123 in the Web browser?
Show answer & explanation
Answer: B. 80
The URL scheme is HTTP (not HTTPS or FTP), which uses the default port 80. The query string parameter 'port=123' is data passed to the server-side script, not the actual TCP port the browser uses to connect. Port 21 is for FTP, 443 is for HTTPS, and 123 is for NTP—none of these apply to an HTTP connection.
Step-by-step Derivation:
- Parse the URL: http://ftp.example.jp/index.cgi?port=123
- Identify the scheme: 'http' (not 'https' or 'ftp')
- HTTP uses the default TCP port 80 for connections
- The query string '?port=123' is application-level data, not the transport layer port
- The browser connects to port 80 and sends the full URI including the query string to the server
- Answer: Port 80