IP address and subnet-four IP address broadcast addresses

Source: Internet
Author: User
Tags ranges
International regulations: divide all IP addresses into A, B, C, D, and E. Class DefaultSubnet Mask: Class A is 255.0.0.0; Class B is 255.255.0.0; Class C is 255.255.255.255.0. The subnet mask is a 32-bit address. It is used to shield a part of the IP address to distinguish the network ID and host ID, and shows whether the IP address is on the LAN or on a remote network.
Class A address: ranging from 0 ~ 127, actually 1 ~ 126. 0 is reserved and represents all IP addresses, while 127 is also a reserved address and is used for testing the loop.There are 126 available class A networks.
For example: 10.0.0.1, the first part of the number is the network number, and the third part of the number is the number of the local computer. To convert to binary, a 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 ", each network can accommodate more than 0.1 billion hosts (the number of hosts at the power of two is 24 ). Use a subnet mask to make a difference: 255.0.0.0.
  
Class B address: the range is from 128 to 191, for example, 172.161.1. The first and second numbers are network numbers, and the remaining two numbers are the numbers of the local computer. In binary format, a Class B IP address consists of two bytes of network address and two bytes of host address. The maximum bit of network address must be "10 ", the address range is 128.0.0.0 to 191.20.255. There are 16382 available class B networks, each of which can accommodate more than 60 thousand hosts. Use a subnet mask to differentiate between them: 255.255.0.0.
  
Class C address: the value ranges from 192 to 223, for example, 192.168.1.1. The first, second, and third segments are network numbers, and the last segment is the number of the local computer. In binary format, a class c ip address consists of a 3-byte network address and a 1-byte host address. The maximum network address must be 110 ". The range is from 192.0.0.0 to 223.20.255. A Class C network can contain more than 2.09 million hosts, and each network can accommodate 254 hosts. Use a subnet mask for the difference: 255.255.255.0.
  
Class D address: the value ranges from 224 to 239. the first byte of the Class d ip address starts with "1110". It is a specially reserved address. It does not point to a specific network. Currently, this type of address is used in multi-point broadcast (Multicast. A multicast address is used to address a group of computers at a time. It identifies a group of computers that share the same protocol. Multicast over an IP network is generally achieved through multicast IP addresses. Multicast IP address is a Class d ip address, that is, the IP address between 224.0.0.0 and 239.255.255.255.
Class E address: the value ranges from 240 to 254. It starts with "11110" and is reserved for future use.
The full zero ("0.0.0.0") Address corresponds to the current host. The IP address ("255.255.255.255.255") of "1" is the broadcast address of the current subnet.


 
In the daily network environment, B and C are basically used, and the three types of Ade addresses cannot be used.
From the above description, we can see that a lot of friends will make an error, that is, set the IP address starting with 192 to a Class B address, although Network Communication in the LAN is not affected, it is actually an irregular division.

  
Among so many network IP addresses, some IP addresses are used in our LAN, that is, private IP addresses, which are not used in the public network. Their range is:
10.0.0.0 ~ 10.20.255.255
172.16.0.0 ~ 172.31.255.255
192.168.0.0 ~ 192.168.255.255

---- Example exercise ----------
Example
Now, we can give some practical examples to have a deep understanding of the subnet mask and the host block decimal algorithm.
1. If the number of subnets required is 12, calculate the actual number of subnets.
Here, the actual number of subnets refers to subnet_num. Because the power of 12 is 16 (24), that is, subnet_block = 16, subnet_num = 16-2 = 14, so the actual number of subnets is 14.
2. It is known that the number of hosts in each subnet of a Class B subnet must reach 60 × 255 (approximately equivalent to X. y.0.1 ~ X. y.59.254.
First, the power of 60 to 2 is 64 (26), that is, ip_block = 64. Second, the subnet mask M = 256-ip_block = 256-64 = 192, finally, the subnet mask in the subnet mask format of Class B is 255.255.255.m.0, And the subnet mask is 255.255.192.0.
3. If the number of subnets required is 7, obtain the subnet mask.
7. The power closest to 2 is 8, However, eight subnet_blocks need to retain the first and last two subnet blocks."8-2 = 6 broadcast" has many applications in the network. For example, the client automatically obtains the IP address through DHCP through broadcast. However, compared with unicast and multicast, broadcast occupies almost all the bandwidth of the network in the subnet.
Let's take a meeting as an example. Only one person can speak at the venue. Imagine that if everyone uses a microphone to speak at the same time, it will turn into a box of porridge. Because of its working principle, the hub cannot filter broadcast storms. General switches do not have this function. However, some existing network switches (such as omnidirectional QS series switches) the function of filtering broadcast storms is also available, and the vro itself has the function of isolating broadcast storms. Broadcast storms cannot be completely eliminated, but they can only be transmitted within the same subnet, just as the sound of speakers can only be transmitted within the same venue, therefore, in a large and medium-sized LAN consisting of hundreds or even thousands of computers, subnets are generally divided, just like isolating a hall from many small halls by walls, to isolate broadcast storms.
In an IP address, the broadcast address is represented by the IP address "broadcast 255.255.255" (the first type below, restricted broadcast). This IP address represents all the IP addresses in the same subnet.
1. Restricted Broadcast
The restricted broadcast address is 255.255.255.255.255. This address is used for the destination address of the IP datagram during host configuration. At this time, the host may not know the network mask of its network, or even its IP address. In any case, the vro does not forward a datagram whose destination address is a restricted broadcast address. Such a datagram only appears in the local network.
An unsolved problem is: If a host has multiple interfaces, should a process send a data report to the broadcast address on this site to broadcast the data? If this is not the case, applications that want to broadcast all interfaces on the host must determine all interfaces that support broadcast on the host, and then send a datagram copy to each interface.
Most BSD systems regard zookeeper 255.255 as the broadcast address of the first interface after configuration, and do not provide the ability to transmit data packets to interfaces with broadcast capabilities. However, routed and rwhod are two applications that send UDP datagram to each interface. Both applications use similar startup processes to determine all interfaces on the host and understand which interfaces have broadcast capabilities. At the same time, the broadcast address corresponding to the interface pointing to the network is used as the destination address of the datagram sent to the interface.
Hostrequirementsrfc does not further involve whether multi-interface hosts should send restricted broadcasts to all interfaces.
2. Broadcast host numbers pointing to the network are all 1

The broadcast address of Class A network is netid.0000255, and netid is the network number of Class A network. A vro must forward the broadcast to the network, but it must also have an option not to forward.
3. Broadcast pointing to the subnet (host number tail number, so you cannot assign a regular IP address)
The address that points to the subnet's broadcast address. The subnet mask is required for IP addresses that serve as subnet direct broadcast addresses. For example, if the vro receives a datagram sent to 128.1.2.255, when the subnet mask of Class B network 128.1 is 255.255.255.0, this address is the broadcast address pointing to the subnet. However, if the subnet mask is 255.255.254.0, this address is not a broadcast address pointing to the subnet.
4. Broadcast pointing to all subnets: subnet number and host number are all 1
To broadcast to all subnets, you also need to understand the subnet mask of the destination network to distinguish it from the broadcast address that points to the network.
For example, if the destination subnet mask is 255.255.255.0, the IP address 128.1.255.255 is a broadcast address pointing to all subnets. However, if the network is not divided into subnets, This is a broadcast pointing to the network.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.