計算機英語基礎知識B篇

字號:

Subnet mask
    The second item, which is required for TCP/IP to work, is the subnet mask. The subnet mask is used by the TCP/IP protocol to determine whether a host is on the local subnet or on a remote network.
    In TCP/IP, the parts of the IP address that are used as the network and host addresses are not fixed, so the network and host addresses above cannot be determined unless you have more information. This information is supplied in another 32-bit number called a subnet mask. In this example, the subnet mask is 255.255.255.0. It is not obvious what this number means unless you know that 255 in binary notation equals 11111111; so, the subnet mask is:
     11111111.11111111.11111111.0000000
    Lining up the IP address and the subnet mask together, the network and host portions of the address can be separated:
       11000000.10101000.01111011.10000100 -- IP address (192.168.123.132)
      11111111.11111111.11111111.00000000 -- Subnet mask (255.255.255.0)
      
    The first 24 bits (the number of ones in the subnet mask) are identified as the network address, with the last 8 bits (the number of remaining zeros in the subnet mask) identified as the host address. This gives you the following:
       11000000.10101000.01111011.00000000 -- Network address (192.168.123.0)
       00000000.00000000.00000000.10000100 -- Host address (000.000.000.132)
    So now you know, for this example using a 255.255.255.0 subnet mask, that the network ID is 192.168.123.0, and the host address is 0.0.0.132. When a packet arrives on the 192.168.123.0 subnet (from the local subnet or a remote network), and it has a destination address of 192.168.123.132, your computer will receive it from the network and process it.
    Almost all decimal subnet masks convert to binary numbers that are all ones on the left and all zeros on the right. Some other common subnet masks are:
       Decimal Binary
       255.255.255.192 1111111.11111111.1111111.11000000
       255.255.255.224 1111111.11111111.1111111.11100000
    Internet RFC 1878 describes the valid subnets and subnet masks that can be used on TCP/IP networks.
    Network classes
    Internet addresses are allocated by the InterNIC , the organization that administers the Internet. These IP addresses are divided into classes. The most common of these are classes A, B, and C. Classes D and E exist, but are not generally used by end users. Each of the address classes has a different default subnet mask. You can identify the class of an IP address by looking at its first octet. Following are the ranges of Class A, B, and C Internet addresses, each with an example address: ? Class A networks use a default subnet mask of 255.0.0.0 and have 0-127 as their first octet. The address 10.52.36.11 is a class A address. Its first octet is 10, which is between 1 and 126, inclusive.
    ? Class B networks use a default subnet mask of 255.255.0.0 and have 128-191 as their first octet. The address 172.16.52.63 is a class B address. Its first octet is 172, which is between 128 and 191, inclusive.
    ? Class C networks use a default subnet mask of 255.255.255.0 and have 192-223 as their first octet. The address 192.168.123.132 is a class C address. Its first octet is 192, which is between 192 and 223, inclusive.
    In some scenarios, the default subnet mask values do not fit the needs of the organization, because of the physical topology of the network, or because the numbers of networks (or hosts) do not fit within the default subnet mask restrictions. The next section explains how networks can be divided using subnet masks.
    子網(wǎng)掩碼
    第二項是子網(wǎng)掩碼,它是 TCP/IP 正常工作所必需的。TCP/IP 協(xié)議使用子網(wǎng)掩碼確定主機是在本地子網(wǎng)中還是在遠程網(wǎng)絡中。
    在 TCP/IP 中,將哪部分 IP 地址用作網(wǎng)絡地址和主機地址并不固定,所以除非您掌握詳細的信息,否則無法確定上述網(wǎng)絡地址和主機地址。此信息在另一個 32 位數(shù)字中提供,稱為子網(wǎng)掩碼。在本例中,子網(wǎng)掩碼為 255.255.255.0。如果您不知道二進制表示法中的 255 等于 11111111,可能并不清楚該數(shù)字表示的含義;照此分析,子網(wǎng)掩碼為:
    11111111.11111111.11111111.0000000
    將 IP 地址和子網(wǎng)掩碼排列在一起比較,就可以分清該地址的網(wǎng)絡部分和主機部分:
    11000000.10101000.01111011.10000100 -- IP 地址 (192.168.123.132)
    11111111.11111111.11111111.00000000 -- 子網(wǎng)掩碼 (255.255.255.0)
    前 24 位(子網(wǎng)掩碼中的數(shù)字 1)被標識為網(wǎng)絡地址,后 8 位(子網(wǎng)掩碼中剩余的數(shù)字 0)被標識為主機地址。據(jù)此可以得到:
    11000000.10101000.01111011.00000000 -- 網(wǎng)絡地址 (192.168.123.0)
    00000000.00000000.00000000.10000100 -- 主機地址 (000.000.000.132)
    這樣,我們就可以知道,在這個使用 255.255.255.0 子網(wǎng)掩碼的示例中,網(wǎng)絡 ID 為 192.168.123.0,主機地址為 0.0.0.132。當數(shù)據(jù)包到達 192.168.123.0 子網(wǎng)(從本地子網(wǎng)或遠程網(wǎng)絡),而且它的目標地址為 192.168.123.132 時,您的計算機將從網(wǎng)絡接收它并對它進行處理。
    幾乎所有十進制子網(wǎng)掩碼都轉(zhuǎn)換為左側(cè)全部是一、右側(cè)全部是零的二進制數(shù)字。其他一些常見的子網(wǎng)掩碼有:
       十進制 二進制
       255.255.255.192 1111111.11111111.1111111.11000000
     255.255.255.224 1111111.11111111.1111111.11100000
    Internet RFC 1878描述了可在 TCP/IP 網(wǎng)絡中使用的有效子網(wǎng)和子網(wǎng)掩碼。
    網(wǎng)絡類
    Internet 地址由管理 Internet 的機構(gòu) InterNIC 來分配。這些 IP 地址分成若干類。其中最常見的是 A、B 和 C 類。也有 D 和 E 類,但是最終用戶通常不會使用。每個地址類都有不同的默認子網(wǎng)掩碼??梢酝ㄟ^查看 IP 地址的第一個八位組來識別該 IP 地址的類別。下面是 A、B 和 C 類 Internet 地址的范圍,每一類地址都有一個示例: ? A 類網(wǎng)絡使用的默認子網(wǎng)掩碼為 255.0.0.0,第一個八位組為 0-127。地址 10.52.36.11 就是一個 A 類地址。它的第一個八位組為 10,介于 1 至 126 之間(包括 1 和 126)。
    ? B 類網(wǎng)絡使用的默認子網(wǎng)掩碼為 255.255.0.0,第一個八位組為 128-191。地址 172.16.52.63 就是一個 B 類地址。它的第一個八位組為 172,介于 128 至 191 之間(包括 128 和 191)。
    ? C 類網(wǎng)絡使用的默認子網(wǎng)掩碼為 255.255.255.0,第一個八位組為 192-223。地址 192.168.123.132 就是一個 C 類地址。它的第一個八位組為 192,介于 192 至 223 之間(包括 192 和 223)。
    在某些情況下,由于網(wǎng)絡的物理拓撲或因為網(wǎng)絡(或主機)的數(shù)目在默認的子網(wǎng)掩碼限制之下并不適用,所以默認子網(wǎng)掩碼值可能不適合機構(gòu)的需要。下一部分將解釋如何使用子網(wǎng)掩碼劃分網(wǎng)絡。