Does it matter what port NUMBER you use with IP cameras and port-forwarding?

a47573750

Honorable
Dec 5, 2012
5
0
10,510
I've read that some ports like 81 are more frequent hacking targets (because of common use?) but does the port number matter in terms of network camera and router reliability, as long as it's TCP/UDP capable? Is there any functional difference between ports 81, 99, 1510, 6124, 8080, 8100 or any random port number in the allowable range?

I don't fully understand the "port" concept except in an abstract way. It's a bit like how people think they understand gasoline octane ratings but when you research the details it's something else altogether. No need to segue into that topic! Just an analogy to things people rarely cover beyond "it is what it is."
 
Solution


If an IP address is a street address, a port is an apartment number...


If an IP address is a street address, a port is an apartment number.

Processes can bind ports, and any combination of an IP address (bound by the machine) and a port (bound by a process running on the machine) form what's called a socket.

Ports numbers below 1024 are called "well known ports". These are ports that are associated with well established services and protocols. For example, port 80 is associated with HTTP and is usually bound by a web server; port 25 is associated with SMTP and is usually bound by a mail server.

Port numbers 49152 and above are called "ephemeral ports". These are ports that are used by clients to make outbound connections to servers.

Ports between the well-known range and the ephemeral range are free to use for whatever purpose. It's common to run an auxiliary web server on port 8080 if port 80 is already in use by another web server. It's also common to use one of these ports as an alternative SMTP port since many ISPs block traffic on port 25 to reduce email spam.

To be clear, there is no technical difference between ports. The ranges and assignments are all based on historical usage and convention. A game server could run on port 80, but that would be unconventional since port 80 is almost always associated with a web server.
When you enter a URL in your web browser it first tries to resolve the IP address from the supplied host name. This is done by communicating with a DNS server on port 53. Once an IP address is resolved, it then tries to connect to that IP address on port 80 for HTTP traffic and port 443 for HTTPS traffic. Since these ports are well known and adhered to almost 100% of the time, there's no need to display them in the URL.
Go ahead and enter http://www.tomshardware.com:80 in your web browser, it will most likely truncate it to http://www.tomshardware.com.
Then, try and enter http://www.tomshardware.com:81 and watch it fail to connect. This tries to establish a connection on port 81, which wont work because there's nothing on that port.
Finally, try and enter https://www.tomshardware.com:80 and watch it connect but fail to load. This tries to establish an HTTPs connection on the HTTP port. The client is expecting an encryption negotiation, but the server is expecting plaintext. Something similar would happen if you entered http://www.tomshardware.com:443 which tries to send HTTP data to an HTTPS service.

Now that that brief explanation is out of the way, you can pick any port that you want for your IP camera but it should be in the 1024 to 49151 range. If it supports SSL, you should enable that too using a self signed certificate.
 
Solution

Kewlx25

Distinguished
A port is like the extension for a phone number. Your IP lets the data get routed to you, and a single program binds to a port, so when the packet is for a given port, it is really for a given program.

If your device is expecting data on port 1234, unless the data is sent to port 1234, the device will not notice it, even if it receives it.

Some firewalls can also all port forwarded to also redirect to a different port. So if your device is listen on port 80, you can forward port 1234 to 80.
 

a47573750

Honorable
Dec 5, 2012
5
0
10,510
I guess it's sort of a "lame" question but that does clear it up mostly. I'll look at ports as simply numbers, like sending an email to the right address, and different users need to know the address of well-used ports. The exact electronic aspect of what's going on might be too much to know.

The choice of port 80 (why not 60 or 20 or 15) as the default for websites is probably one of those old long stories.
 
By default, HTTP (web page) traffic comes through on port 80. If you setup the web page to load on port 4040, people loading the web page (i.e. www.abc.com) will not get the page, they need to type in www.abc.com:4040.

Just remember, if you set the port(s) different from default, the "master" and the "slave" both need to be set manually to the same port.