IP addresses and their classification

        To facilitate hierarchical addressing and network configuration, each IP address contains two identifiers, i.e., the network number and host number. All hosts the same physical network using the same network number, and each host (such as workstations, servers, routers) this network has LAN has a unique number corresponding host. Thus the format of an IP address can be simply expressed as: IP address :: = {<network number> <host number>}.


Early on, in order to provide the necessary flexibility for networks of all sizes, designer IP address IP address space is divided into five different categories, this was taken into account: a variety of very different networks, some networks have many hosts, and some network hosts rarely. The IP address is divided into different categories in order to better meet the needs of different users. Thus, when applying a unit to an IP address is actually an address space having access to the same network number, wherein the specific host number assigned by the unit itself, not only do the unit in the range of jurisdiction host number can be repeated.


        Figure 1 shows the five different types of IP addresses, wherein A, B, C class is a unicast address (one communication), as shown in Table 1.

                                                               The network ID and a host ID of FIG. 1 IP Address

image.png


 


As can be seen from the figure above, IP address, only a specified host, it indicates the network to which the host is connected to the

image.png


        A类IP地址由1字节的网络地址和3字节的主机地址组成,其中网络地址的最高位必须为0。A类IP地址中可指派的网络数量为126(2^ 7-2)个,这里减2是由于网络号字段中全0的IP地址为保留地址,表示本网络,而网络号为127的地址保留用于环回测试本机的进程间通信(127.0.0.0到127.255.255.255是保留地址,用于环回测试,0.0.0.0到0.255.255.255也是保留地址,用于表示所有的IP地址。) A类IP地址中主机号占3个字节,因此每个A类网络中最大主机数为16777214(2^ 24-2),这里减2的原因是,主机号字段为全0表示该IP地址为本机所属网络的地址(如一个主机的IP地址为5.6.7.8,则该主机所在的网络地址就是5.0.0.0),而全1表示所有的,因此全1的主机号字段表示该网络中的所有主机。IP地址空间共有2^32个地址,整个A类地址空间共有2^31个地址,占整个地址空间的50%。


        B类IP地址由2字节的网络地址和2字节的主机地址组成,其中网络地址的最高两位必须为10。由于网络号字段的前两位固定,后面的14位无论怎样都不可能出现全0或全1的情况,因此这里不存在网络总数减2的问题。但实际上B类网络地址中128.0.0.0是不可指派的,而可以指派的B类最小网络地址为128.1.0.0,因此B类地址可指派的网络数为16383(2^14-1)个。B类地址的每个网络上最大主机数为65534(2^16-2)个,这里需要减2是因为要扣除全0或全1的主机号。整个B类地址空间共约有2^30个地址,占整个地址空间的25%。


        Class C the IP address consists of three bytes of network and host addresses composed of 1 byte, the most significant bit network address must be 110. Class C network addresses 192.0.0.0 reserved address is not assigned, and therefore the total number of the network can assign 2097151 (2 ^ 21-1) th, Similarly, Class C address on each network the maximum number of hosts 2 ^ 8- 2. The entire class C address space for a total of about 2 ^ 29 addresses, accounting for 12.5% of the entire address space.



Guess you like

Origin blog.51cto.com/14451009/2438078