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
HTTP uses the default port 80 by default. The URL scheme http:// determines the protocol and its default port, not the query string parameter port=123. Query parameters are sent to the server after the connection is established and have no effect on which port the browser connects to.
Step-by-step Derivation:
- URL scheme analysis:
http://ftp.example.jp/index.cgi?port=123starts withhttp://, which specifies the HTTP protocol. - Default port lookup: HTTP protocol uses TCP port 80 as its default port (defined in RFC 7230).
- Query string clarification: The
?port=123is a query parameter passed to the server-side script (index.cgi). It does not instruct the browser which port to connect to. - Port specification syntax: If a specific port were needed, it would be in the URL as
http://ftp.example.jp:8080/index.cgi(colon-separated before the path). - Conclusion: The browser connects to port 80, the standard HTTP port.