1. MAC address

  • For every network card, there’s one6Bytes (48 bits) MAC address,The only global, solidified in the card’s ROM, as specified by the IEEE802 standard
    • The first three bytes: unique identifier of the organization assigned to the vendor by the IEEE registration Authority
    • The last three bytes: the network interface identifier, as determined by the vendor
  • Take one of Nokia’s network cards
Unique identifier of the organization Network interface identifier
40 and 55-82 0A-8C-6D
  • OUI query
    • standards-oui.ieee.org/oui/oui.txt
    • mac.bmcx.com/

1. MAC address representation

  • Windows: a line between each byte (-Interval)
    • 40-55-82-0A-8C-6D
  • Linux, Android, Mac, iOS: Colon () between each byte:Interval)
    • 40:55:82:0A:8C:6D
  • Packet Tracer: a dot (.Interval)
    • 4055.820 a. 8 c6d
  • when48For a whole1Is the broadcast address
  • Windows computers can use commands from terminalsipconfig /allCheck the MAC address of the network adapter
  • Macs can use commands from the terminalifconfig -aCheck the MAC address of the nic address

2. Obtain the MAC address

  • If you do not know the MAC address of the host, you can obtain the MAC address by sending ARP broadcasts

  • After the IP address and MAC address mapping information is obtained, the DEVICE caches ARP cache
  • MAC addresses obtained through ARP broadcast belong to dynamic cache
    • The storage time is short (2 minutes by default). When the MAC address of the host is expired, the host is automatically deleted. Because the MAC address of the host can be changed, the target host cannot be found if the cache is used all the time

  • Relevant command
    • Arp -a: Queries all ARP caches
    • Arp -a [host ADDRESS]: queries the ARP cache
    • Arp -d [host ADDRESS]: deletes arp cache
    • Arp -s Host ADDRESS MAC address: add a cache (static cache, stored for a long time, different systems store for different time)

Second, the ARP

  • ARP: An address resolution protocol that obtains MAC addresses from IP addresses
  • RARP: reverse address resolution protocol
    • Use the same header structure as ARP
    • In contrast, ARP is used to translate MAC addresses into IP addresses
    • Later, BOOTP and DHCP were replaced

Third, the ICMP

  • ICMP: Internet Control message protocol
    • ICMP in IPv4 is called ICMPv4, and ICMP in IPv6 is called ICMPv6
    • Usually used to return error messages
      • For example, the TTL expiration value is unreachable
    • ICMP error messages always include the source data and are returned to the sender

4. IP address

  • IP Address: Every host on the Internet has an IP address
    • The original version was IPv4, 32bit(4 bytes), and on November 25, 2019, the world ran out of IP addresses
    • Later came the IPv6 version, 128 bits.

Note: If the version is not specified, the default is IPv4

  • With the IP address192.168.1.10As an example
1100, 0000, 1010, 1000, 0000, 0001, 0000, 1010,
Part 1 Part 2 Part 3 Part 4
1100, 0000, 1010, 1000, 0000, 0001, 0000, 1010,
192 168 1 10

1. IP address composition

  • The IP address consists of two parts: network ID and host ID.
    • The network ids of computers on the same network segment are the same
    • By using the subnet mask, you can calculate the network ID: subnet mask & IP address
1100 0000.1010 1000.0000 0001.0000 1010 IP address: 192.168.1.10&1111 1111.1111.1111.1111 1111.0000 0000 Subnet mask: 255.255.255.0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0001.0000 0000 segment: 192.168.1.0 1100 0000.1010 1000.0000 0001 corresponding to subnet mask 1111 1111.1111.1111 1111 is 0000 1010 corresponding to subnet mask 0000 0000 That's the host IDCopy the code
  • Network segment: The host ID is in addition to the network ID0For example192.168.1.0
  • There is no way to get a network segment from an IP address, such as an IP address130.168.1.10We can’t see the network segment of this IP address
  • You can calculate the network segment where the IP address resides only by using a subnet mask, for example, a subnet mask255.255.0.0, you can calculate the IP address130.168.1.10Network segment is130.168.0.0Where, the network ID130.168, the host ID0.0
  • Host ids in IP addresses are assigned to different computers on the same network segment
    • For example, network segment130.168.0.0In theory, it can be allocated to130.168.0.0~130.168.255.255, a total of256 * 256 = 65536computer
    • However,130.168.0.0Represents a network segment that cannot be assigned to a computer
    • 130.168.255.255Represents broadcast address, that is, broadcast to all connected computers in the same network segment
    • So the number of computers is zero256 * 256-2 = 65534computer
  • Four computers are placed on Packet Tracer, and their subnet masks are uniformly as255.255.255.0The IP addresses are annotated by notes, so they are all on the same network segment192.168.1.0on

  • throughPing 192.168.1.255, can send broadcast to all computers, both:The host IDThe maximum size of the255Is used to send broadcast to all computers in the same network segment, cannot be assigned to a hostThe host ID

  • Therefore, a minimum of 0 and a maximum of 255 host ids have special functions and cannot be assigned to hosts as host ids

  • For example, network segment 130.168.0.0

    • The minimum host bit value130.168.0.0Used as a network segment,
    • Maximum host bit130.168.255.255As a broadcast address
    • So the range of assignable computer IP addresses is130.168.0.1~130.168.255.254The number is256 * 256-2 = 65534
  • Before communicating with other computers, the computer checks whether the target host and itself are on the same network segment

    • Same network segment: Does not need to be forwarded by a router
    • Different network segments are forwarded to routers for forwarding

2. IP address classification

  • Class A Address: The default subnet mask is 255.0.0.0
8bit 24bit
Network ID

0At the beginning
ID the host
  • Class B address: Default subnet mask 255.255.0.0
16bit 16bit
Network ID

10At the beginning
ID the host
  • Class C address: The default subnet mask is 255.255.255.0
24bit 8bit
Network ID

110At the beginning
ID the host
  • Class D address: with1110Beginning, multicast address
  • Class E address: with1111The beginning is reserved for future use
  • Only class A/B/C addresses can be assigned to hosts
(1) Class A address
  • Because the first part of the network ID has to be0, so the value range is0000 0000 ~ 0111 1111

  • Network ID
    • 0Can’t use,127As a reserved field, where127.0.0.1Is the local loopback address, which is the host address
    • The first part that can be assigned to a host ranges from1~126
  • The host ID
    • The values of parts 2, 3, and 4 range from 0 to 255
    • Among them0.0.0and255.255.255The network segment and broadcast address cannot be assigned
    • Therefore, the maximum number of hosts supported by each Class A network is 256 * 256 * 256-2 = 2^ 24-2 = 16777214
(2) Class B address
  • Because the first two digits of the network ID have to be10, so the value range is1000 0000 0000 0000 ~ 1011 1111 1111 1111

  • Network ID
    • The first part that can be assigned to a host ranges from128 ~ 191The value range of the second part is0 ~ 255
  • The host ID
    • The value range for parts 3 and 4 is0 ~ 255
    • The maximum number of hosts supported by a Class B network is 256 x 256-2 = 2^ 16-2 = 65534
(3) Class C address
  • Because the first three digits of the network ID have to be110, so the value range is1100 0000 0000 0000 0000 0000 ~ 1101 1111 1111 1111 1111 1111 1111

  • Network ID
    • That can be assigned to the host
    • The range of values in Part 1 is192 ~ 223
    • The value range for parts 2 and 3 is0 ~ 255
  • The host ID
    • The range of values in Part 4 is0 ~ 255
    • The maximum number of hosts that a class C address can hold is 256-2 = 254
(4) Class D address
  • No subnet mask, used for multicast (multicast) addresses
    • Part 1 The value range is224 ~ 239

(5) Class E address
  • Reserved for future use
    • The first part is the range240 ~ 255

3. Subnet mask

1. CIDR representation method of subnet mask

  • CIDR: classless interzone route
  • CIDR representation of a subnet mask
    • 192.168.1.100/24On behalf ofSubnet maskThere are24个1, that is,255.255.255.0
    • 123.210.100.200/16On behalf ofSubnet maskThere are16个1, that is,255.255.0.0
  • In order to/willThe IP addressandSubnet maskPartition, for example:
    • 192.168.1.100/24In theThe IP addressis192.168.1.100.Subnet maskis24个1, that is:1111 1111 1111 1111 1111 1111 0000 0000, equivalent to the255.255.255.0
    • 123.210.100.200/16In theThe IP addressis123.210.100.200.Subnet maskis16个1, that is:1111 1111 1111 0000 0000 0000, equivalent to the255.255.0.0

2. Why should subnets be divided?

  • If 200 hosts need to reside on the same network segment, you can allocate a Class C network segment, for example192.168.1.0/24
    • A total of 254 available IP addresses:192.168.1.1 ~ 192.168.1.254
    • With 54 more idle IP addresses, this situation is not a waste of resources
  • If you need 500 hosts on the same network segment, assign a Class B network segment, for example191.100.0.0/16
    • 65,534 available IP addresses:191.100.0.1 ~ 191.100.255.254
    • There are 65034 more idle IP addresses, which is a huge waste of resources
  • How to minimize IP address waste?
    • Divide subnets properly.

3. Subnets

  • Subnet division: Use the host bit as the subnet bit to create multiple subnets

  • Divide the available

    • Equal-length subnet division: Divide a network segment into multiple subnets. The number of available IP addresses on each network is the same
    • Variable length subnet division: The number of available IP addresses for each word network can vary
  • Subnet delimit separator: www.ab126.com/web/3552.ht…

  • Procedure for dividing subnets

    • Determine the length of the subnet mask
    • Determine the IP address available to the first and last host in the subnet

4. Equal-length subnets – Divide them into 2 subnets

  • There is a class C address with a network ID192.168.0, the subnet mask is255.255.255.0That is, the network segment is192.168.0.0/24, a total of configurable254host
  • Now the network segment is divided into two words. You only need to move the subnet mask one bit to the right, that is:255.255.255.128/25
  • A network segment:
    • The host ID range is yes192.168.0.1 ~ 192.168.0.126
    • Network segment:192.168.0.0
    • Broadcast Address:192.168.0.127
1100 0000.1010 1000.0000 0000.0000 0000 & 1111 1111.1111 1111.1111 1111.1000 0000 Subnet mask: 255.255.255.128/25 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0000.0000 0000 segment: 192.168.0.0/25Copy the code
  • B segment
    • Host ID Range only192.168.0.129 ~ 192.168.0.254
    • Network segment:192.168.0.128
    • Broadcast Address:192.168.0.255
1100 0000.1010 1000.0000 0000.1000 0000&1111 1111.1111 1111.1111 1111.1000 0000 Subnet mask: 255.255.255.128/25 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0000.1000 0000 segment: 192.168.0.128/25Copy the code

5, isometric subnets – isometric subnets are divided into 4 subnets

  • Network segment192.168.0.0/24Is divided into four subnets. You only need to move the subnet mask two places to the right
Subnet mask: 1111 1111.1111.1111.1111.0000 0000 255.255.255.0/24 1111 1111.111111.1111.1100 0000 255.255.255.192/26Copy the code
  • A network segment:192.168.0.0/26
1100 0000.1010 1000.0000 0000.0000 0000 & 1111 1111.1111 1111.1111 1111.1100 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0000.0000 0000Copy the code
  • B segment:192.168.0.64/26
1100 0000.1010 1000.0000 0000.0100 0000&1111 1111.1111 1111.1111 1111.1100 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0000.0100 0000Copy the code
  • C segment:192.168.0.128/26
1100 0000.1010 1000.0000 0000.1000 0000&1111 1111.1111 1111.1111 1111.1100 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0000.1000 0000Copy the code
  • D segment:192.168.0.192/26
1100 0000.1010 1000.0000 0000.1100 0000&1111 1111.1111 1111.1111 1111.1100 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0000.1100 0000Copy the code

6. Divide variable length subnets

  • If the length of a subnet address block is the same as that of the original network segment(1/2)^n, then
    • Add n 1s to the subnet mask of the original network segment
    • Subnets are not equally long, and their subnet masks are different

  • Suppose the figure above is correct192.168.0.0/24Create a variable-length subnet
    • C Network segment: The subnet mask is yes255.255.255.128/25. That is:1111 1111.1111 1111.1111 1111.1000 0000
    • B Network segment: The subnet mask is yes255.255.255.192/26. That is:1111 1111.1111 1111.1111 1111.1100 0000
    • A Network segment: The subnet mask is yes255.255.255.192/27. That is:1111 1111.1111 1111.1111 1111.1110 0000
    • D Network segment: The subnet mask is yes255.255.255.192/30. That is:1111 1111.1111 1111.1111 1111.1111 1100
    • E Network segment: The subnet mask is yes255.255.255.192/30. That is:1111 1111.1111 1111.1111 1111.1111 1100

7. Think about questions

  • Can the following two devices communicate normally?

  • First equipment
    • IP address:192.168.0.10
    • Subnet mask:255.255.255.0
    • Network segment:192.168.0.0
  • Second device
    • IP address:192.168.10.10
    • Subnet mask:255.255.0.0
    • Network segment:192.168.0.0
  • You can find that the two devices are on the same network segment and can send messages in theory

  • And in fact,Computer 0Is unable toComputer 1message-sending
  • And that’s because,Computer 0I don’t knowComputer 1theSubnet mask, just know thatComputer 1theThe IP address, so it’s calculatingComputer 1theNetwork segmentIs usedComputer 0In and of itselfSubnet mask
    • Computer 0theSubnet mask: 255.255.255.0
    • Computer 1theThe IP address: 192.168.10.10
    • After calculation,Computer 1Network segment when:192.168.10.0
    • So,Computer 0Can’t giveComputer 1Send a message

Fourth, super net

  • Hypernet: As opposed to a subnet, it combines multiple contiguous network segments into a larger network segment
  • Requirements: Originally 200 computers used 192.168.. 0.0/24 network segment, now we want to add 200 devices to the same network segment
    • 200 are in network segment 192.168.0.0/24 and 200 are in network segment 192.168.1.0/24
    • Merge 192.168.0.0/24 and 192.168.1.0/24 into one network segment: 192.168.0.0/23

192.168.0.0/24 1100 0000.1010 1000.0000 0000.0000 0000 & 1111 1111.1111 1111.1111 1111.0000 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0000.0000 0000Copy the code
192.168.1.0/24 1100 0000.1010 1000.0000 0001.0000 0000&1111 1111.1111 1111.1111 1111.0000 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0001.0000 0000Copy the code
192.168.0.0/23 1100 0000.1010 1000.0000 0000.0000 0000 & 1111 1111.1111 1111.1111 1110.0000 0000 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0000.0000 0000Copy the code

1, thinking,

  • Can the IP address 192.168.0.255/23 be assigned to a computer?
192.168.0.255/23 1100 000 | 1111 IP address: 0.1111 1000.0000 0000.1010 192.168.0.255 & 1111 111 | 0000 subnet mask 0.0000 1111.1111 1111.1111: 255.255.254.0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - | -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 000 | 0000 segment: 0.0000 192.168.0.0/23Copy the code
  • 192.168.0.255/23 is not a network segment192.168.0.0/23Is not a broadcast address
  • Therefore, the IP address 192.168.0.255/23 can be assigned to computers
  • 192.168.0.0/23The maximum IP address of is192.168.0.1/23, that is:1100 0000.1010 1000.0000 0001.1111 1111

2. Merge the four network segments

  • Move the subnet mask two bits to the left to merge four network segments

  • Merge 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24 into network segment 192.168.0.0/22

3, think

  • The following two network segments can be moved to the left by the subnet mask1Do bits merge?

  • 192.168.1.0/24The subnet mask is moved one bit to the left. The network segment is192.168.0.0/23
192.168.0.0/23 1100 0000.1010 1000.0000 0001.0000 0000 192.168.1.0/24 & 1111 1111.1111 1110.0000 0000 255.255.254.0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0000.0000 0000 192.168.0.0/23Copy the code
  • 192.168.2.0/24The subnet mask is moved one bit to the left. The network segment is192.168.2.0/23
192.168.2.0/23 1100 0000.1010 1000.0000 0010.0000 0000 192.168.1.0/24 & 1111 1111.1111 1111.1111 1110.0000 0000 255.255.254.0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 1100 0000.1010 1000.0000 0010.0000 0000 192.168.2.0/23Copy the code
  • If I move one to the left,192.168.0.0/23and192.168.2.0/23Therefore, they cannot be merged into the same network segment

4. The law of merging network segments

(1) The number of network segments that can be merged when the subnet mask is moved to the left

  • Merge two network segments, move the subnet mask 1 bit to the left, merge four network segments, move the subnet mask 2 bits to the left, merge eight network segments, move the subnet mask 3 bits to the left
  • Namely: supposenIs the number of network segments,nis2thekPower (k>=1), the subnet mask moves to the leftkBit can mergenA network segment
(2) The network segment that can be merged
  • Assuming thatnis2thekPower (k>=1), the following network segments are available
1100 0000.1010 1000.0000 0000.0000 0000 192.168.0.0/24 1100 0000.1010 1000.0000 0001.0000 0000 192.168.1.0/24 1100 0000.1010 1000.0000 0010.0000 0000 192.168.2.0/24 1100 0000.1010 1000.0000 0011.0000 0000 192.168.3.0/24 1100 0000.1010 1000.0000 0100.0000 0000 192.168.4.0/24 1100 0000.1010 1000.0000 0101.0000 0000 192.168.5.0/24 1100 0000.1010 1000.0000 0110.0000 0000 192.168.6.0/24 1100 0000.1010 1000.0000 0111.0000 0000 192.168.7.0/24 1100 0000.1010 1000.0000 1000.0000 0000 192.168.8.0/24 1100 0000.1010 1000.0000 1001.0000 0000 192.168.9.0/24 1100 0000.1010 1000.0000 1010.0000 0000 192.168.10.0/24 1100 0000.1010 1000.0000 1011.0000 0000 192.168.11.0/24 1100 0000.1010 1000.0000 1100.0000 0000 192.168.12.0/24 1100 0000.1010 1000.0000 1101.0000 192.168.13.0/24 1100 0000.1010 1000.0000 1110.0000 0000 192.168.14.0/24 1100 0000.1010 1000.0000 1111.0000 0000 192.168.15.0/24...Copy the code
  • If the network number of the first network segment can benDivisible, so it starts off continuousnTwo network segments, can pass the left shiftkBit subnet mask to merge

  • Assuming thatn=2When,k=1
1100 0000.1010 1000.0000 0000.0000 0000 192.168.0.0/24 First network segment 1100 0000.1010 1000.0000 0001.0000 0000 192.168.1.0/24 The second segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0010.0000 0000 192.168.2.0/24 First network segment 1100 0000.1010 1000.0000 0011.0000 0000 192.168.3.0/24 Second network segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0100.0000 0000 192.168.4.0/24 first segment 1100 0000.1010 1000.0000 0101.0000 0000 192.168.5.0/24 second segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0110.0000 0000 192.168.6.0/24 First network segment 1100 0000.1010 1000.0000 0111.0000 0000 192.168.7.0/24 The second segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1000.0000 0000 192.168.8.0/24 First network segment 1100 0000.1010 1000.0000 1001.0000 0000 192.168.9.0/24 Second network segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1010.0000 0000 192.168.10.0/24 first segment 1100 0000.1010 1000.0000 1011.0000 0000 192.168.11.0/24 Second network segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1100.0000 0000 192.168.12.0/24 first segment 1100 0000.1010 1000.0000 1101.0000 0000 192.168.13.0/24 Second network segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1110.0000 0000 192.168.14.0/24 first segment 1100 0000.1010 1000.0000 1111.0000 0000 192.168.15.0/24 second network segment...Copy the code
  • Cut the way above, each2Network segments are divided into1Groups, each groupFirst network segmentThe network number can be2Evenly divided, each network segment moves to the left1Bits can be merged into a new network segment

  • Assuming thatn=4When,k=2
1100 0000.1010 1000.0000 0000.0000 0000 192.168.0.0/24 First network segment 1100 0000.1010 1000.0000 0001.0000 0000 192.168.1.0/24 Second network segment 1100 0000.1010 1000.0000 0010.0000 0000 192.168.2.0/24 Third network segment 1100 0000.1010 1000.0000 0011.0000 0000 192.168.3.0/24 fourth segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 0100.0000 0000 192.168.4.0/24 First network segment 1100 0000.1010 1000.0000 0101.0000 0000 192.168.5.0/24 Second network segment 1100 0000.1010 1000.0000 0110.0000 0000 192.168.6.0/24 Network segment 3 1100 0000.1010 1000.0000 0111.0000 0000 192.168.7.0/24 Network segment 4 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1000.0000 0000 192.168.8.0/24 first segment 1100 0000.1010 1000.0000 1001.0000 0000 192.168.9.0/24 Second network segment 1100 0000.1010 1000.0000 1010.0000 0000 192.168.10.0/24 Third network segment 1100 0000.1010 1000.0000 1011.0000 0000 192.168.11.0/24 Fourth network segment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1100.0000 0000 192.168.12.0/24 first segment 1100 0000.1010 1000.0000 1101.0000 0000 192.168.13.0/24 Second network segment 1100 0000.1010 1000.0000 1110.0000 0000 192.168.14.0/24 Network segment 3 1100 0000.1010 1000.0000 1111.0000 0000 192.168.15.0/24 Network segment 4...Copy the code
  • Cut the way above, each4Network segments are divided into1Groups, each groupFirst network segmentThe network number can be4Evenly divided, each network segment moves to the left2Bits can be merged into a new network segment

  • Assuming thatn=8When,k=3
1100 0000.1010 1000.0000 0000.0000 0000 192.168.0.0/24 First network segment 1100 0000.1010 1000.0000 0001.0000 0000 192.168.1.0/24 Second network segment 1100 0000.1010 1000.0000 0010.0000 0000 192.168.2.0/24 Third network segment 1100 0000.1010 1000.0000 0011.0000 0000 192.168.3.0/24 Fourth network segment 1100 0000.1010 1000.0000 0100.0000 0000 192.168.4.0/24 Fifth network segment 1100 0000.1010 1000.0000 0101.0000 0000 192.168.5.0/24 6th network segment 1100 0000.1010 1000.0000 0110.0000 0000 192.168.6.0/24 7th network segment 1100 0000.1010 1000.0000 0111.0000 0000 eighth segment 192.168.7.0/24 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1100 0000.1010 1000.0000 1000.0000 0000 192.168.8.0/24 First network segment 1100 0000.1010 1000.0000 1001.0000 0000 192.168.9.0/24 second network segment 1100 0000.1010 1000.0000 1010.0000 0000 192.168.10.0/24 Third network segment 1100 0000.1010 1000.0000 1011.0000 0000 192.168.11.0/24 fourth network segment 1100 0000.1010 1000.0000 1100.0000 0000 192.168.12.0/24 Network segment 5 1100 0000.1010 1000.0000 1101.0000 0000 192.168.13.0/24 Network segment 6 1100 0000.1010 1000.0000 1110.0000 0000 192.168.14.0/24 Seventh network segment 1100 0000.1010 1000.0000 1111.0000 0000 192.168.15.0/24 The eighth network segment...Copy the code
  • Cut the way above, each8Network segments are divided into1Groups, each groupFirst network segmentThe network number can be8Evenly divided, each network segment moves to the left3Bits can be merged into a new network segment

  • Such as:
    • The first network segment is binary0At the end, so it starts to be continuous2Two network segments can be moved to the left1Bit subnet mask to merge
    • The first network segment is binary00At the end, so it starts to be continuous4Two network segments can be moved to the left2Bit subnet mask to merge
    • The first network segment is binary000At the end, so it starts to be continuous8Two network segments can be moved to the left3Bit subnet mask to merge
    • .

5, judge a play alone is the subnet began to ultra net

  • First of all,
    • Look at the type of network segment: Class A network, class B network, class C network?
    • By default, the bits of A class A subnet mask are 8, the bits of A Class B subnet mask are 16, and the bits of A class C subnet mask are 24
  • then
    • If the subnet mask has more bits than the default subnet mask, it is a subnet
    • If the number of bits in the subnet mask is smaller than the default subnet mask, the network is hypernet
  • Such as
    • 25.100.0.0/16 is A Class A subnet
    • 200.100.0.0/16 is a class C hypernet