Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Subnet mask, broadcast address, DNS and gateway

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

subnet mask, broadcast address, DNS, and gateway

Text keywords: subnet mask, broadcast address, DNS, gateway

Subnet mask 1. Subnet mask function

Subnet mask is literally understood as a subnet mask, that is to say, from an IP address alone, we cannot determine how many bits the network number and host number of the address are. Although we know that Class A, Class B, and Class C addresses have their own range, we can know how many bits the network number and host number of this type of network are, but this is also based on the subnet mask being the default value.

The subnet mask for class A URLs defaults to: 255.0.0.0The subnet mask for class B URLs defaults to: 255.255.0.0The subnet mask for class C URLs defaults to: 255.255.255.0

When an IP address is given, we can obtain the number of network digits of the network where the address is located by the corresponding subnet mask, so as to determine the number of machines that the network can accommodate (i.e., the number of host digits). Another function is to determine whether two machines are in the same subnet by calculation.

2. Determine whether two machines are on the same subnet (network segment)

Subnet mask is composed of 32 binary digits composed of four groups of numbers, the left is the network bit, represented by the binary number 1, the number of 1 is equal to the length of the network bit, the right is the host bit, represented by the binary number 0, the number of 0 is equal to the length of the host bit. When making custom subnet masks, 1s and 0s must be consecutive, respectively.

For each type of network default subnet mask, in fact, it is relatively easy to determine the network segment, because each 255 happens to be 8 binary bits of 1, separated by an English period, so that we directly retain the corresponding part of 255, clear the corresponding part of 0 can be obtained.

Class A address URL: 113.88.87.65 -> Network segment: 113.0.0Class B address URL: 183.14.23.92 -> Network segment: 183.221.0.0Class C address URL: 200.67.83.77 -> Network segment: 200.67.83.0

If we artificially specify a subnet mask, it is equivalent to dividing the IP address into three parts: network number, subnet number and subnet host number. That is to say, part of the host number is occupied by the subnet number, so it is difficult to immediately determine whether the two IP addresses are in the same subnet. At this time, binary AND operation is needed.

AND operation rule: 1 AND 1 = 11 AND 0 = 00 AND 1 = 00 AND 0 = 0

Take a 28-bit subnet mask as an example: 225.225.255.240 (111111.111111.111111.11110000). Intuitively, the subnet host number has only four digits. If two machines are in the same subnet, the binary representation of the last group of digits cannot exceed 00001111 on the premise that the first 24 bits (the first three groups) of network addresses are all the same. Otherwise, the two machines must not be in the same subnet. Two machines that are not on the same subnet need to communicate through a router.

Example 1: 200.67.83.3 and 200.67.83.14 Direct comparison: 3 - > 0000 0011, 14 -> 0000 1110, in the same subnet through the operation and comparison, the result is the same, in the same subnet 1111 0000 AND 0000 0011 = 0000 000111 0000 AND 0000 1110 = 0000 000 Example 2: Direct comparison between 200.67.83.13 and 200.67.83.77: 13 -> 0000 1101, 77 -> 0010 1101, the host number part of the latter has exceeded the limited number of bits, must not be in the same subnet through comparison with the operation, the results are different, not in the same subnet 1111 0000 AND 0000 1101 = 0000 0001 111 0000 AND 0010 1101 = 0010 0000 II. Address 1. What's the use of broadcasting addresses?

A broadcast address is an address that is specifically used to broadcast simultaneously to all hosts in the network. This is like listening to a radio channel. The radio channel itself is a broadcast address. The announcer pushes to this address, so as long as the audience can receive this channel, they can hear the broadcast. Well, how much light does this broadcast cover? This still depends on our network number. We know that a complete IP address is composed of two parts: the network number and the host number, so the coverage of the broadcast is all the hosts under its network.

2. How is broadcast address calculated?

Broadcast address calculation is actually very simple, as long as the host number where the binary bits are all changed to 1 can be broadcast address.

local area network address: 192.168.211.32/24 (the number after slash represents the binary digits of subnet mask, then the digits of host number are 32-24=8), so the broadcast address is: 192.168.211.255 III. DNS1. What is DNS?

NDS itself stands for Domain Name System, one of the core services of the Internet. With everyone's experience of using the Internet, it seems that entering a URL and then going straight to a website is already a normal thing. In fact, all kinds of functional services we enjoy come from specific public network servers, which all have their own public network IP. Then there are several questions:

IP addresses are not easy to remember IP address assignment is managed by the network operator and may be assigned to other machines or withdrawn for easy access by users

If we have been using our small notebook to record the IP address of various treasure sites, then if there is a change of carrier due to performance upgrades, server lease expiration, etc., then the original IP address will be recovered or allocated to other individuals or companies. That this causes us to collect IP addresses hard completely useless, then add an alias to the IP address is a good way. We can establish a mapping relationship between an alias and an IP address. Users only need to remember this alias. Even if the server is replaced, we only need to re-establish the mapping relationship between the IP address and this alias!

The domain we are talking about actually refers to the suffix of com, edu, cn, net and other names. There is no difference in use and access, but it is chosen by different users because it is an abbreviation with different meanings. That is to say, a complete domain name contains two parts: name and suffix.

2. Configure DNS server addresses?

The NDS server is responsible for providing domain name resolution services, and stores a large number of mapping information between domain names and IP addresses in a distributed database.

114.114.114.114 DNS115.159.157.26: Ali public DNS8.8.8.8: DNS provided by Google, globally universal IV. Gateway

Literally, gateway is a checkpoint. When we need to communicate with the network, we need to go through layers of routers. At this time, someone must be responsible for directing traffic and maintaining the whole order.

When our computer network communication, we have to go through the gateway to deal with, then the specific embodiment of the gateway is actually an IP address, but this IP address is usually the address assigned to the device with routing function, such as: router.

The IP address of the gateway is usually provided by the network administrator or obtained automatically using DHCP.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report