Three methods to tell you how to set IP for a project with more than 255 cameras? Why do IP addresses usually start with 192.168?

Three methods to tell you how to set IP for a project with more than 255 cameras? Why do IP addresses usually start with 192.168?

We work in weak current, and we have the most contact with IP addresses. No matter which aspect of weak current, we need to deal with IP addresses. Usually we often hear about public network and intranet? So what is a public IP address? What is a private IP address? Why do the IP addresses we often see start with 192.168?

Another thing is that a network segment can only accommodate 254 cameras, but my current project is relatively large, with more than 300 cameras. How should I allocate IP addresses?

Let’s learn about them all today.

First, let's talk about the definition of internal and external networks: internal and external networks are relative to firewalls. The internal network is called the internal network, and the external network is called the external network. To a certain extent, the external network is equivalent to the public network, and the internal network is equivalent to the private network.

1. Special IP addresses

1. 0.0.0.0

Strictly speaking, this strange address 0.0.0.0 is no longer an IP address in the true sense. It represents a set: that is, all unclear hosts and destination networks. The "unclear" here means that there is no specific entry in the routing table of the local machine to indicate how to reach it. For the local machine, it is a "shelter" where all unknown "three-no" people are sent. If you set a default gateway in the network settings, the computer system will automatically generate a default route with a destination address of 0.0.0.0.

2. 255.255.255.255 restricted broadcast address

For this machine, this address refers to all hosts in this network segment (the same broadcast domain).

However, its meaning is clear, and in human language it means "attention all computers here". This address cannot be forwarded by a router.

3. 127.0.0.1 local address

Mainly used for testing. In Chinese, it means "myself". In Windows, this address has an alias "Localhost". Addressing such an address cannot be sent to the network interface. Unless there is an error, a data packet with the destination address "127.0.0.1" should never appear on the transmission medium.

4. 224.0.0.1 multicast address

Note the difference between it and broadcast. From 224.0.0.0 to 239.255.255.255 are all such addresses. 224.0.0.1 refers to all hosts, and 224.0.0.2 refers to all routers. Such addresses are mostly used for some specific programs and multimedia programs. If your host has IRDP (Internet Routing Discovery Protocol) enabled and uses the multicast function, then there should be such a route in your host routing table.

5. 169.254.xx

If your host uses the DHCP function to automatically obtain an IP address, then when your DHCP server fails or the response time is too long and exceeds a system-specified time, the computer operating system will assign you such an address. If you find that your host IP address is such an address, unfortunately, your network cannot operate normally now.

6. 10.xxx;172.16.0.0---172.31.255.254;192.168.xx;private address

These addresses are widely used in corporate internal networks. Some broadband routers also often use 192.168.1.1 as the default address. Private networks are not interconnected with the outside world, so they may use random IP addresses. Such addresses are reserved for use to avoid address confusion when accessing the public network in the future. When a private network using private addresses accesses the Internet, it must use address translation (NAT) to translate the private address into a public legal address. This type of address cannot appear on the Internet. For a host on a network, there are three legal destination network addresses that it can normally receive: the local IP address, the broadcast address, and the multicast address.

2. Classification of IP addresses

1. Class A address

Class A IP address: consists of a 1-byte network address and a 3-byte host address. The highest bit of the network address must be "0".

For example: 0XXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX (X represents 0 or 1)

Class A IP address range: 1.0.0.1---126.255.255.254

Private and reserved addresses in Class A IP addresses:

  • 10.XXX is a private address (the so-called private address is an address that is not used on the Internet but is used in a local area network). Range (10.0.0.1---10.255.255.254)
  • 127.XXX is a reserved address used for loop testing.

2. Class B Address

Class B IP address: consists of a 2-byte network address and a 2-byte host address. The highest bit of the network address must be "10".

For example: 10XXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX (X represents 0 or 1)

Class B IP address range: 128.0.0.1---191.255.255.254.

Private and reserved Class B IP addresses:

  • 172.16.0.0---172.31.255.254 is a private address
  • 169.254.XX is a reserved address. If your IP address is automatically obtained,

If you do not find an available DHCP server on the network, you will get one of the IPs.

191.255.255.255 is a broadcast address and cannot be assigned.

3. Class C Address

Class C IP address: consists of a 3-byte network address and a 1-byte host address. The highest bit of the network address must be "110".

For example: 110XXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX (X represents 0 or 1)

Class IP address range: 192.0.0.1---223.255.255.254.

Private address in Class C address: 192.168.XX is a private address. (192.168.0.1---192.168.255.255)

4. Class D Address

Class D address: does not distinguish between network address and host address, and the first four bits of its first byte are fixed to 1110.

For example: 1110XXXX.XXXXXXXX.XXXXXXXXX.XXXXXXXX (X represents 0 or 1)

Class D address range: 224.0.0.1---239.255.255.254

5. Class E Address

Class E address: does not distinguish between network address and host address, and the first four bits of its first byte are fixed to 1111.

For example: 1111XXXX.XXXXXXXX.XXXXXXXXX.XXXXXXXX (X represents 0 or 1)

Class E address range: 240.0.0.1---255.255.255.254

Private network address

Except for these three IP address segments which are private IP addresses, the others are public IP addresses.

These addresses have been declared private, and any device in the intranet can use them at will, but IP addresses in these three ranges are not allowed to appear on the Internet (external network). Therefore, our platform is used more often in internal networking, such as monitoring projects and company internal computer IP settings, and 192.168.xx is used more often.

Usually, the private address segment is selected according to the number of hosts that need to be accommodated. For a relatively small home network, a Class C address, 192.168.1.x, can accommodate 254 terminals, which is sufficient.

Schools or large enterprises may use Class B or even Class A as the address segment for their internal networks. For example, when you use your mobile phone to access the Internet, you may get an internal network address starting with 10, rather than a public network address.

3. NAT Address Translation

Private network addresses can only be used in local area networks. Different local area networks can use the same private network address, but private network addresses cannot appear on the Internet. So how can private network addresses access the Internet? This requires NAT address translation to map the internal network address to the external network address.

NAT address translation realizes the mutual conversion between the intranet IP address and the public network address, converting a large number of intranet IP addresses into one or a small number of public network IP addresses, thus reducing the occupation of public network IP addresses.

Port mapping is commonly used in home networks. The core of NAT is a mapping table (source IP address, source port, destination IP address, destination port), which maps the internal network source IP address and port to different ports of the same public network address, as shown in the figure below.

In short, due to the small scale of home network, private network addresses starting with 192.168 are usually used. The optical modem dials up to obtain a public network address (or the operator's private network address), and maps to different ports of this public network address through NAT to access the Internet. The main thing to note is that NAT mode and routing mode are different.

Now that we have a brief understanding of the knowledge about IP, let's focus on the following points. Now that surveillance projects are getting bigger and bigger, there are hundreds of cameras at any time. How do we set the IP address?

4. How to set IP for more than 255 cameras

Many friends have asked, how to set the IP address for large-scale monitoring projects?

For monitoring projects, many faults are caused by improper IP address settings, such as IP conflicts, or several monitoring images not being displayed, etc., which are all related to IP. It is very important to allocate IP addresses reasonably.

1. Why should IP be allocated reasonably?

For small monitoring projects, the IP address setting is relatively simple, and most people will not make mistakes. However, for monitoring projects with more than 254 points, it is easy to make mistakes. Why?

  • First, if there are more than 254 points and the network segments are not divided, allowing the system to automatically assign IP addresses will easily cause IP conflicts.
  • Second, if the network is divided into segments, the allocation of IP addresses and the setting of subnet masks become a problem. Some friends are not familiar with IP address allocation and are prone to making mistakes.

So what should we do? Dividing the network segments is a reasonable approach.

2. How to allocate IP in large networks

For monitoring of more than 254 points, although we can assign IP addresses without dividing the network segments, a good network planning is not only about simply and barely realizing the functions, but also needs to focus on the later maintenance and the clarity and scalability of the entire network.

Let's take an example to see how to assign IP addresses.

A factory monitoring project is divided into four areas with a total of 300 points. All equipment is in an intranet, and the main line is connected by optical cable. There are two areas with 70 points each, and the other two areas with 80 points each. How to set their IP addresses?

First, let's analyze,

To achieve the monitoring of these 300 points, there are two ways to do it:

(1) Type 1: No network segmentation

The first method is to not divide VLANs and use layer 2 switches. The IP address can be directly set to an IP address range of 192.168.0.1-192.168.1.254, and the subnet mask is 255.255.254.0. A total of 500 IP addresses can be used, which is completely sufficient.

Some friends may wonder how the subnet mask 255.255.254.0 is derived, and why it is not 255.255.255.0?

Subnet mask calculation

Here we will explain the IP address range 192.168.0.1-192.168.1.254 separately. Why is the subnet mask of this network segment 255.255.254.0?

This IP address range includes two IP segments.

  • The first IP segment is: 192.168.0.1-192.168.0.254 and its subnet mask is 255.255.255.0.
  • The second IP segment is: 192.168.1.1-192.168.1.254, and its subnet mask is 255.255.254.0.

In layman's terms, their common subnet mask is 255.255.254.0.

(2) The second method: dividing the network segment

Here we focus on the method of dividing network segments. Using a three-layer switch, four network segments can be directly divided.

Main monitoring address: 192.168.1.1 255.255.252.0

  • Area A address: 192.168.1.2~192.168.1.254 Mask 255.255.252.0 Gateway 192.168.1.1
  • Area B address: 192.168.2.1~192.168.2.254 Mask 255.255.252.0 Gateway 192.168.1.1
  • Zone C address: 192.168.3.1~192.168.3.254 Mask 255.255.252.0 Gateway 192.168.1.1
  • D zone address: 192.168.4.1~192.168.4.254 mask 255.255.252.0 gateway 192.168.1.1

Each network segment here can accommodate more than 250 points, which is more than enough to allocate IP addresses to each area. In addition, if points are added in each area in the future, there will be enough reserves. It is worth noting that the access layer switches need to be reasonably allocated. We have mentioned the selection of access layer switches before, so we will not explain it in detail here.

So what are the benefits of dividing network segments in this way?

The IP addresses of the four areas are relatively obvious. If there is a problem with a camera, you can quickly locate the camera with the problem by batch pinging the IP addresses. At the same time, it can also effectively prevent IP conflicts. IP is a problem that occurs frequently in network failures, and it can also reduce broadcast storms.

(3) The third option: Choose a recorder with dual network ports

Let's first look at the two network working modes of the dual-port hard disk recorder:

  • Network Fault Tolerance vs. Multi-Address Settings
  • Network Fault Tolerance

The two network cards use the same IP address. Select "Primary Network Card" and choose LAN1 or LAN2 as the primary network card. When a network failure occurs on one network card, the system activates the backup network card to ensure that the system's network works normally.

Multi-address settings:

The parameters of the two network cards are independent of each other, and the network cards work together. Select "Network Card Selection" to set LAN1 and LAN2 separately. You can select one network card as the default route. When the system actively connects to the external network, the data is forwarded by the default route.

After understanding the two network working modes of dual-port video recorders, you can see that when adding a camera that is not in the same network segment as the hard disk video recorder, we use the multi-address setting network working mode. How to use it specifically?

Let me teach you now~

We assume that the IP address of the router connected to the LAN1 port of the recorder is 192.168.1.1, and the network segment of the camera we need to add can be the network segment of http://192.168.0.XXX.

At this time, enter the recorder main menu - system configuration - network configuration - basic configuration, change the working mode to multi-address setting, select LAN1 for the network card, assign IP address 192.168.1.100 and other network parameters to LAN1. Because LAN1 is used to connect to the router at this time, we select LAN1 as the default route.

We connect the network cable of the camera to the LAN2 port of the recorder, select LAN2 as the network card, assign an IP address of 192.168.0.100 to LAN2, and other network parameters are as shown in the figure.

At this point, the recorder has two IP addresses. LAN1 port is used to connect to the external network for external network access, and LAN2 port is used to connect to the camera. We can then add a camera in Channel Management-IP Channel Management, and we can connect to the external network and see the monitoring screen!

<<:  10 things to know about MU-MIMO Wi-Fi

>>:  100 basic network knowledge popularization, read it to complete half of the network master

Recommend

Xentain: $1.25/month-1GB/15GB SSD/1Gbps unlimited traffic/Fremont data center

New merchant, mainly with the discount code, the ...

How 5G can help realize massive IoT

When discussing the coming 5G era, attention is o...

5G applications are gaining attention, adding new impetus to smart education!

Education is a national priority. my country has ...

Principles and Applications of Distributed System Selenium GRID

Author: Wang Huan, Unit: China Mobile Smart Home ...

CloudCone: $17/year-dual-core/1GB/55GB/2TB@1Gbps/Los Angeles data center

Here is some information about CloudCone's re...

The development of 5G will open up a new track for the Internet of Things

The Ministry of Industry and Information Technolo...

How does the gateway record request response logs in SpringCloud microservices?

Hello everyone, I am Piaomiao. In microservices d...

The second half of the 5G era begins

On June 6, 2019, China officially issued 5G licen...