An example of how to calculate the subnet mask and broadcast address

Source: Internet
Author: User

Question:

If a company has 100 computers and a class C registered IP address segment: 218.102.142.0, its Intranet (LAN) needs to be further divided into two subnets, each with 40 computers and 60 computers,

Requirements:

(1) Specify the subnet mask;

(2) assume that the IP addresses of one or two computers in the Intranet are 218.102.142.7 and 218.102.142.219. Try to calculate the subnet address and broadcast address of the two computers respectively, and whether they are in the same subnet.

 

Analysis questions and answers:

This problem is very simple. It is similar to the memory cascade problem in the digital circuit we have learned.

For example:

Class C addresses have four CIDR blocks: 218.102.142.0, and three of them indicate network numbers.

Take this example

It has 255 machines

Address from 218.102.142.0 --- 218.102.142.255

The network address is 218.102.142 .*

 

If you want to split the network into several subnets

Is to extend the network number to the back

Use a part of the number that originally represents the machine subaccount to represent the network number.

In this way, the purpose of dividing subnets is achieved.

 

In this case

Because we need to divide two subnets

Then you need to expand a single bit to indicate the network number.

 

The remaining part must be able to represent the machine number.

Like this, you must ensure that there are six digits behind it.

The first two digits are used to differentiate subnets.

The first two and three bytes represent a subnet.

 

XXXXXXXX. xxyyyyyy

X indicates the network number.

Y indicates the host number.

 

In fact, you can determine the subnet address without the subnet mask.

Because it can be calculated manually.

 

The subnet mask is used to obtain the above digits.

 

So the subnet mask is to replace all those X with 1.

 

So there are four different combinations of the last two X

You can make two different

In this way, the subnet address is not necessarily

However, the mask must be: 255.255.255.255.192

 

But the following two machines

Let's phase out their addresses and subnet masks and take out the preceding X to be their subnet addresses.

 

218.102.142.0

218.102.142.192

In binary format

1111111.111111.11111111.00

1111111.111111.11111111.11

This is the subnet address of the two networks.

 

The rule is that the broadcast address of each subnet is the maximum address of the subnet host.

 

Which one is the largest?

Of course, all Y is the largest of 1!

Therefore, the first broadcast address is 1111111111.111111.11111111.001111111111.

The second broadcast address is 11111111.11111111.11111111.11111111111111.

The number of values in 1 is incorrect.

 

Convert to decimal

Yes

2017100000000191

255.255.255.255

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.