When you get to the U’s in the acronym dictionary there’s a traffic jam... URI, URL, URN, where does it end? For now, we’re going to focus on the URLs, or Uniform Resource Locators, that you know and love. Every resource on the web has its own unique address, in the URL format.
Not shown:
Optional Query String: Remember, if this was a GET request, the extra info (parameters) would be appended to the end of this URL, starting with a question mark “?”, and with each parameter (name/value pair) separated by an ampersand “&”.
Off the path
A 16-bit number that identifies a specific software program on the server hardware.
Your internet web (HTTP) server software runs on port 80. That’s a standard. If you’ve got a Telnet server, it’s running on port 23. FTP? 21. POP3 mail server? 110. SMTP? 25. The Time server sits at 37. Think of ports as unique identifiers. A port represents a logical connection to a particular piece of software running on the server hardware. That’s it. You can’t spin your hardware box around and find a TCP port. For one thing, you have 65536 of them on a server (0 to 65535). For another, they do not represent a place to plug in physical devices. They’re just numbers representing a server application.
Without port numbers, the server would have no way of knowing which application a client wanted to connect to. And since each application might have its own unique protocol, think of the trouble you’d have without these identifiers. What if your web browser, for example, landed at the POP3 mail server instead of the HTTP server? The mail server won’t know how to parse an HTTP request! And even if it did, the POP3 server doesn’t know anything about serving back an HTML page.
If you’re writing services (server programs) to run on a company network, you should check with the sys-admins to find out which ports are already taken. Your sys-admins might tell you, for example, that you can’t use any port number below, say, 3000.
Well-known TCP port numbers for common server applications
The TCP port numbers from 0 to 1023 are reserved for well-known services (including the Big One we care about—port 80). Don’t use these ports for your own custom server programs!