Interview Question Record 1: IP Subnet Planning

Premise: Interview software test, ask if you have practiced the basic
IP subnet division of the network? Do you know what class A class B class C class D is?

Knowledge source: "Understanding Subnet Routing Technology Basics in Ten Minutes" (https://www.bilibili.com/video/BV19D4y197uD?from=search&seid=10672242701857477391&spm_id_from=333.337.0.0)

IP address concept

An IP address is used to uniquely identify a host on a network,
usually expressed in 32-bit dotted decimal.

Decimal representation: 192.168.1.1
Binary representation: 11000000.10101000.00000001.00000001

Natural Classification of IP Addresses

insert image description here

Subnet mask:

The number of digits used to identify the network number and host number in the P address
Representation method:

  • 32-bit binary number, in the subnet mask, the code corresponding to the part of the network number with "1" is 255.0.0.0, indicating that the first 8 bits of this address are the subnet mask of the network number, and the part of the host number is "0" express. For example, the subnet mask of the IP address 1.1.1.1 is 255.0.0.0, indicating that the first 8 bits of the address are the network number.
  • The network suffix method represents the subnet mask, that is, "/<network number digits>", such as 138.960.1/18 means the network number is 18 bits, the host number is 14 bits
    insert image description here
    Q: a network, the host number has x bits, then this network How many P addresses can be assigned to a host?
    A: The network contains 2 addresses, excluding the network address and the broadcast address, the P addresses that can be assigned to the host are 2^×-2 (2 is all 0, all 1 IP address)
    E: For example, a class C network, the |P address that can be assigned to the host is 2^8-2=254

Learn how to perform subnetting

Q: China United has recently applied to the China Internet Network Information Center (CNNC) for a Class C network segment - 200.1.1.0/24. The company has three departments: the technical department, the marketing department, and the personnel and finance department, and each department has 50, 25, and 20 computers, respectively. As the company's network administrator, please divide the applied addresses reasonably so that each department is in a subnet. The network address, broadcast address, and range of available host P addresses are required for each subnet, and which subnet is used by each department.

insert image description here
insert image description here

insert image description here
A: It is concluded that n=2, that is, after the division, the subnet number is 2 bits, which can represent 4 subnets, the host number is 6 bits, and the number of hosts that can be allocated to each subnet is 62

insert image description here

insert image description here
(Note: The network number in the binary of this figure has not been changed to binary)

insert image description here

Follow-up study:
Overall framework of computer network: https://blog.csdn.net/qq_39328436/article/details/114647971

[Computer Network] - Hematemesis of classic interview questions: https://blog.csdn.net/qq_39328436/article/details/113739457

Guess you like

Origin blog.csdn.net/qq_40794986/article/details/120235079