Easy video surveillance
With the spread of smarphones, the possibility of creating video surveillance systems has become increasingly concrete. Installing an IP camera and monitoring home or office space over the phone is becoming an easy task for many.
The considerations that will be made can be declined on any device connected to the local network, a nas for example. It is in fact useful to have a nas installed in the local network and to be able to reach it also from a smarphone or from a computer outside the network.
The problem in managing a device arises when you leave the local network and start using the mobile network. How come I can not reach the camera anymore?
The answer is very simple, but perhaps not as clear: the IP address used to identify it has changed.
Recall that the ip address is the string of 4 numbers separated by a comma used to uniquely identify a device. For example 192.168.1.1 is a valid IP address and perhaps you have already met it because it is often assigned to the local network router.
So why does the IP address of the camera change when I move from the local network to the mobile one?
In fact, the address itself does not change, but changes the way in which the device, the camera in this case, is reached.
An example to clarify the ideas
We try to explain this behavior by referring to a common situation in many companies.
Imagine a telephone system with a switchboard and two internal telephones. Each internal telephone is identified by a number that only applies to the local telephone network
.So to reach extension 102 from the phone 101 you will have to type 102 precisely.
If from outside we type 102 we get only the busy line signal or number that does not exist.
If instead we type 12345102 then we reach the switchboard which, by virtue of a predefined rule, will route the call to the interior 102.
The feeling is that of having contacted the target phone directly while in reality during the connection phase the main actor was the switchboard.
We have understood that the identification number of the interior 102 is always the same, but the way in which it can be achieved changes.
What really happens
What happens in a LAN is conceptually the same even if, as can be seen from the figure, the complexity increases (but only slightly). In fact, a telephone exchange has a well-defined purpose, while a computer network, with the same hardware, can have many uses.
Having understood the example of the phones it is easy to understand what happens in a local network.
Within the network it is possible to reach the camera by typing in its identifier, then 192.168.1.10 in this case, while outside it is necessary to use the public ip 18.104.22.168, that of the router that will route the connection to the camera.
In fact it seems all simple and in fact it is in systems that provide a static public IP address.
Unfortunately, due to the lack of public ip (see The reasons for Dynamic DNS
), the rule is to have a dynamic IP which complicates things a bit. Within the network the situation does not change, but what address should I use outside if all times changes?
DnsUp: the dynamic dns
Fortunately, the Internet architecture provides a service called DNS, used daily and unknowingly by all users every time a site is visited.
This service translates the names (www.dnsup.eu
for example) into IP addresses (better managed by the machines).
So the best way to reach the camera is to use a name and not an ip address (myhost.dd0.eu).
DnsUp provides to keep constantly updated the association name - ip address in order to make the camera always traceable.
29 Sep 2018