Friday, November 18, 2011

Wireless Internet CCTV - IP Addresses For Beginners, Part 2

Wireless Internet CCTV - IP Addresses For Beginners, Part 2


In part 1 of this series on IP adDresses in wireless internet CCTV, I looked at how most home networks share a small number of identical IP adDresses, so your neighbour's laptop could easily have precisely the same address as your own laptop or your internet CCTV camera! Here in part 2, I'm going to show why these duplicate addresses don't cause chaos when messages are sent across the internet.

Let's use an example to show how devices can communicate successfully even if they share the same address. Say your laptop has an IP address of 192.168.1.5 and your wireless internet CCTV camera has an address of 192.168.1.101. Let's also say that your neighbour's laptop has, by coincidence, the same address as your laptop: 192.168.1.5. Before we go any further, you may be thinking that the odds of this are infinitesimally low. Well, actually they are not. This is because most home networks have IP addresses that tend to be in the same few ranges, often from 192.168.0.1 to 192.168.0.255 or from 192.168.1.1 to 192.168.1.255.

Back to our example, this means that when your neighbour tries to connect to your wireless internet CCTV camera (assuming you have given him the password), we would have a problem if only the home networks' IP addresses were used, because your neighbour's laptop on 192.168.1.5 would send a message to your camera at 192.168.1.101, but when the camera replies, would the reply go to back to your neighbour's laptop on 192.168.1.5, or your laptop on 192.168.1.5, or someone else's Computer somewhere else in the world that also happens to have a 192.168.1.5 address? Clearly this would not work, and that's why the internet has its own set of IP addresses that are universally unique. Continuing the above example, when your neighbour's laptop at 192.68.1.5 in his network sends a message to your internet camera, first of all the message will reach his router, which wraps it up so it is labelled with your neighbour's single unique internet IP address, say 74.125.45.100, and sends it to your network's unique internet address, say 209.191.93.53. Note that the household or "internal" address of your neighbour's laptop, 192.168.1.5, is never sent across the internet at all. Now, when the message reaches your house, more specifically your router, the router hands it to your wireless internet camera. In this way, home networks throughout the world can reuse the same IP addresses.

There is something missing from this explanation that you may have spotted. How does your router "know" that a message coming in is for your internet CCTV camera, if that camera's IP address of 192.168.1.101 is not sent in the message? The answer is that your camera is allocated a "port" number, which is sent with the message. So your neighbour, when logging into your camera, would type not just your internet IP address of 209.191.93.53 into his browser address bar, but rather 209.191.93.53:8765, where 8765 is the port number allocated to your camera. Your router would need to be set up to know that any message coming in with a port number of 8765 is to be "forwarded" to the camera. This is what we know as "port forwarding", which is really outside the scope of this article.

IP address theory is a complex business, but when it comes to working with wireless internet CCTV, you only need to know the basics, and hopefully this series of articles has helped to achieve that.




No comments:

Post a Comment