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 uses the http:// scheme, which defaults to TCP port 80 regardless of the domain name (ftp.example.jp) or query parameters (?port=123). The query parameter 'port=123' is application-level data sent to the server, not the TCP port used for the initial connection. Port 21 is for FTP, port 443 is for HTTPS, and port 123 is for NTP—none are used by HTTP.
Step-by-step Derivation:
- Parse the URL: http://ftp.example.jp/index.cgi?port=123
- Identify the scheme: 'http://' specifies the protocol
- Apply the default port for HTTP: Port 80
- Note: The query parameter '?port=123' is sent as part of the HTTP request body/URL after connection, not used to determine the TCP port
- Connection is made to ftp.example.jp:80, then the HTTP GET request includes the full path and query string