1. Introduction to network model In computer networks, there is the famous OSI seven-layer protocol architecture, which has clear concepts and complete theories, but it is complex and impractical. The TCP/IP architecture is different and has been widely used. Finally, combining the advantages of OSI and TCP/IP, a five-layer protocol architecture was adopted. The IP described in this article is based on the network layer in the five-layer protocol model. 2. Classified IP addresses How to represent IP address An IP address is a 32-bit identifier that is unique worldwide and is assigned to each interface of each host (router) on the Internet. The first field is the network number, and the second field is the host number. A host number must be unique within the network range specified by the previous network number, so an IP address is unique in the entire network. Currently, there are five types of IP addresses: A, B, C, D, and E.
Therefore, we generally use the three types of network addresses, ABC. IP addresses are 32-bit binary codes. In order to improve readability, each 8 bits of the 32-bit IP address is expressed in equivalent decimal (dotted decimal), so the IP addresses commonly seen in our daily lives appear. For example: the IP address, 128.11.3.31, converted to binary is 100000000 00001011 00000011 00011111. It can be seen that the class bit is 10, which can be judged as a Class B address. 3. The scope of assignment of commonly used IP addresses 1. Network number assignment range (1) The network number of a Class A address occupies one byte, but because one bit is the class bit, only 7 bits are available. However, due to regulations, the network field is all 0 and is a reserved field to represent the current network, and 127 (01111111) is another reserved field for loopback testing of local software. The common 127.0.0.1 represents the local machine, and the reason is also here. Therefore, the number of network numbers that can be assigned to a Class A address is (27-2). (2) The network number of a Class B network address has two bytes. The first two bits are fixed at 10, leaving only 14 bits available. Since the network number will not be all 0s or all 1s no matter how these 14 bits are taken, the actual minimum Class B network address is specified as 128.1.0.0. Therefore, the number of network numbers that can be assigned to a Class B address is (214-1). (3) Class C addresses have a 3-byte network field number. The first three bits are fixed at 110, leaving only 21 bits available. Similarly, the smallest network address that can be assigned to a Class C address is 192.0.1.0. Therefore, the number of network numbers that can be assigned to a Class C address is (221-1). 2. Host number assignment range Since the host number is regulated, a host number of all 0s means that the IP address is a single network address to which "this host" is connected (for example, if a host address is 5.6.7.8, then the network address of the host is 5.0.0.0), while all 1s means "all", that is, all hosts on the network.
3. Summarize the IP assignment range From the above description of the assignment of network numbers and host numbers, we can see that there are a total of 232 addresses in the IP address space.
4. IP address and hardware address From a hierarchical perspective, the hardware address is the address used by the data link layer and the physical layer (often called the MAC address), while the IP address is the address used by the network layer and the layers above it, and is a logical address. At the network layer, we transmit data packets from IP1 to IP2. No matter how many times we forward them, from the network layer's perspective, the source address is always IP1 and the destination address is always IP2. However, from the data link layer's perspective, this is obviously not the case. These are physical addresses, and it is very likely that the source node will go through multiple physical address changes at intermediate nodes before reaching the destination node. The conversion between IP addresses and physical addresses requires two important protocols, ARP (Address Resolution Protocol) and RARP (Reverse Address Resolution Protocol). IP addresses are converted into physical addresses through ARP, and physical addresses can be converted into corresponding IP addresses through RARP. 4. Subnets and Supernets Simply put, it is about how to manage multiple hosts under one IP address. 1. Subnet Now assume such a scenario, a datagram with a destination address of 145.13.3.10 (in subnet 145.13.3.0) has reached router R1 (145.13.0.0), then how does this router forward it to 145.13.3.0? We don't know whether the destination address has been subnetted. This leads to the concept of subnet mask, which is also 32 bits, consisting of a string of 1s and 0s. The 1 in the subnet mask corresponds to the network number position + subnet network number position in the IP address, and the 0 in the subnet mask corresponds to the current host number position in the IP address. We only need to perform an "AND" operation on the IP address and the subnet mask. If the subnet is divided, the network address of the subnet to be found will be obtained immediately. If the subnet is not divided (there is a default subnet mask), the network address of the IP address can be directly obtained.
2. Supernet Classless addressing CIDR uses variable-length subnet masks to further improve the resource utilization of IP addresses. It has two characteristics:
To facilitate routing selection, CIDR uses a 32-bit address mask. The number of 1s is the length of the network prefix. For example, the address mask of the /20 address block in the above example is 11111111 11111111 11110000 00000000. Therefore, it can be seen that the shorter the network prefix, the more addresses its address block contains. This allows the IPv4 address space to be allocated more effectively according to actual conditions. |
<<: 2G and 3G network retirement countdown, your old mobile phone may have to be thrown away
>>: How 5G frequencies affect range and speed
[[344212]] This article is reprinted from the WeC...
[[255453]] The Haidilao indecent video incide...
[[437603]] If you follow current events, you’ve p...
In November 2023 , the " China Enterprise &q...
First of all, I want to emphasize that the TCP/IP...
LOCVPS (Global Cloud) has launched a special prom...
At the Apple conference this morning, the most ex...
Over the past few decades, there has been a huge ...
The so-called 5G commercialization requires beare...
The IP addresses of the same VLAN and the same ne...
Engineers who have a little knowledge of computer...
5G is a technology that can rewrite the "rul...
[[268489]] Mobile communications, starting with G...
RAKsmart's product line has been further enri...
[[344927]] There are two technical standards for ...