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

The Foundation of computer Network (2)-- IP address details

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

Share

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

1. IP address

1. The function of ip address:

Uniquely identify a device that accesses the Internet within a certain range (all devices that need to surf the Internet must have an ip address)

The representation of the ip address:

1. Let the machine see it

1010101010001010101010 (pure binary)

2. For people to see

Dotted decimal, X.X.X.X (X represents a decimal system, each X corresponds to 8 binary, the value range of X: 0,255)

The structure of the ip address:

Length is 32bit

The structure is: network bit + host bit

two。 Subnet mask

Function: distinguish the network bits from the host bits in the IP address, which must correspond to the IP address one by one

The range of values for y.y.y.y-> y is 0-- 255.

/ n-- > n indicates how many 1s are in the subnet mask

Function: the bits in the IP address corresponding to 1 in the subnet mask are called network bits

The bit in the IP address corresponding to 0 in the subnet mask is called the host bit

Characteristics

# one-to-one correspondence with IP address

# 1 and 0 are always continuous and will not cross

# the left side is always 1, the right side is always 0

Related confusing concepts:

-inverse mask (inverse-mask)

Just change the ones and zeros in the mask to each other.

-wildcard (wildcard bits)

0 and 1 can cross or not cross.

Classification of 3.ip addresses

Goal: in order to facilitate the management of IP addresses

Principle: look at the first few fixed bit of the first byte in the IP address

0000 0000.X.X.X

The first byte of A, the first bit, if it is 0, it is called a class An address.

0-127 default mask 255.0.0.0

0000 0000-> 0

0111 1111-> 127

The first byte of B, the first two bit, if it is 10, it is called the Class B address.

128-191 default mask 255.255.0.0

1000 0000-> 128

1011 1111-> 191

The first byte of C, the first three bit, if it is 110, it is called a class C address

192-223 default mask 255.255.255.0

D the first byte, the first four bit, if it is 1110, it is called a class D address

224-239 No mask

E the rest

240-255 laboratory reserved for use

Special IP address: (cannot be configured on network devices)

Network address: represents a range / area and does not represent any device. All the host bits in the IP address are 0.

Broadcast address: represents all devices in a range / area. The host bits in this IP address are all 1

Note: addresses starting with 0 and 127 cannot be directly configured on the device.

4. Problems faced by IP address

The endless use of IP addresses in a network segment cannot be assigned to other departments, so it will result in a waste of IP addresses.

Solution:

(1) Private address / public address network address translation

Private IP address of Class A:

10.0.0.0-10.255.255.255

10.0.0.0/8

Private IP address of Class B:

172.16.0.0-172.31.255.255

172.16.0.0/12

Private IP address of Class C:

192.168.0.0-192.168.255.255

192.168.0.0/16

Private IP address of Class D:

239.0.0.0-239.255.255.255

239.0.0.0/8

(2) Subnetting

(3) IPv6

Subnetting case:

There is a company, called XXXX, has three departments, each department has 50 hosts, each department must use a different IP network segment, each department must minimize the waste of IP addresses, give a network segment: 192.168.1.0max 24

The solution is as follows:

(1) first pay attention to the number of available hosts in each network segment, that is, the number of host bits in each new network should be calculated first; if n, then the number of host IP addresses in each new network is 2 ^ n.

(2) 2 ^ n must be greater than or equal to the number of hosts required for each new network, that is, 2 ^ n-2 > = 50,-> n > = 6

Note: minus 2, which means excluding 2 special IP addresses in each network segment, that is, network address and broadcast address

(3) determine the subnet mask of the new network based on the calculated host bits; subnet mask = 32-6, that is, / 26

(4) so the new network should be:

192.168.1.0000 0000 / 26

Network address: 192.168.1.0 / 26

Broadcast address: 192.168.1.63 / 26

192.168.1.0100 0000 / 26

Network address: 192.168.1.64 / 26

Broadcast address: 192.168.1.127 / 26

192.168.1.1000 0000 / 26

Network address: 192.168.1.128 / 26

Broadcast address: 192.168.1.191 / 26

192.168.1.1100 0000 / 26

Network address: 192.168.1.192 / 26

Broadcast address: 192.168.1.255swap 26

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