Nowadays, classless addressing is predominantly used. However, to fully understand the concepts you will learn about here, you need to understand how the ever-changing needs dictated the evolution of addressing solutions over time.
如今,無分類定址方式已是主流。不過,為了完全理解你將在此學到的概念,你需要了解不斷變化的需求如何促使定址解決方案隨時間演進。
In the early days of the internet, the standard reserved the first 8 bits of an IPv4 address for the network part and the remaining 24 bits for the host part. 24 host bits offer 16,777,214 IPv4 host addresses. It soon became clear that such address allocation is inefficient because most organizations require several smaller networks of smaller size rather than one network with thousands of computers. Also, most organizations need several networks of different sizes.
在網際網路發展初期,標準將 IPv4 位址的前 8 位元保留給網路部分,其餘 24 位元則作為主機部分。24 個主機位元可提供 16,777,214 個 IPv4 主機位址。很快就發現這樣的位址配置效率不彰,因為大多數組織需要的是數個較小的網路,而非一個擁有數千台電腦的單一網路。此外,大多數組織需要多個不同大小的網路。
The first step to address this need was made in 1981 when the IETF released RFC 790, where the IPv4 address classes were introduced for the first time. Here the Internet Assigned Numbers Authority (IANA) determined IPv4 Class A, Class B, and Class C.
解決此需求的第一步發生在 1981 年,當時 IETF 發布了 RFC 790,首次引入 IPv4 位址類別。網際網路號碼分配機構(IANA)也在此時確立了 IPv4 A 類、B 類與 C 類。
Assigning IPv4 addresses to classes is known as classful addressing. Each IPv4 address is broken down into a network ID and a host ID. In addition, a bit or bit sequence at the start of each address determines the class of the address.
將 IPv4 位址分配到不同類別稱為分類定址。每個 IPv4 位址都會分成網路 ID 與主機 ID。此外,每個位址開頭的一個位元或位元序列決定了該位址的類別。
Address classes also have a part in deciding which part of the IP address you can select on your own, and which part of an IP address is fixed. Class defines the network part of the IP address, which you could not change, and the host part of the IP address is the one that you can select and use, of course if this IP address is still available.
位址類別也決定了 IP 位址中哪部分可由你自行選擇,哪部分是固定的。類別定義了 IP 位址中你無法變更的網路部分,而主機部分則是你可以選擇並使用的部分,當然前提是該 IP 位址仍可用。
For example, if you need to assign an IP address of class C, you can only select the value for the last octet of an IP address. The first three octets should be fixed, and could not be modified. If you need an IP address assigned from class A, you can select the second, third, and fourth octet of the IP address, but the first one should be fixed, and could not be modified.
舉例來說,如果你需要指派一個 C 類的 IP 位址,你只能選擇 IP 位址最後一個八位元組的值,前三個八位元組必須固定,不能修改。如果你需要指派一個 A 類的 IP 位址,你可以選擇 IP 位址的第二、第三與第四個八位元組,但第一個必須固定,不能修改。
Class A
A 類
A Class A address block is designed to support extremely large networks with more than 16 million host addresses. The Class A address uses only the first octet (8 bits) of the 32-bit number to indicate the network address. The remaining 3 octets of the 32-bit number are used for host addresses. The first bit of a Class A address is always a 0. Because the first bit is a 0, the lowest number that can be represented is 00000000 (decimal 0), and the highest number that can be represented is 01111111 (decimal 127). However, these two network numbers, 0 and 127, are reserved and cannot be used as network addresses. Therefore, any address that has a value between 1 and 126 in the first octet of the 32-bit number is a Class A address.
A 類位址區塊的設計目的是支援超過 1,600 萬個主機位址的極大型網路。A 類位址僅使用 32 位元數字中的第一個八位元組(8 位元)來表示網路位址,其餘 3 個八位元組則用於主機位址。A 類位址的第一個位元恆為 0。由於第一個位元為 0,可表示的最小數值為 00000000(十進位 0),最大數值為 01111111(十進位 127)。然而,這兩個網路號碼 0 與 127 是保留的,不能作為網路位址使用。因此,任何在 32 位元數字第一個八位元組中值介於 1 到 126 之間的位址都是 A 類位址。
Class B
B 類
The Class B address space is designed to support the needs of moderate to large networks with more than 65,000 hosts. The Class B address uses two of the four octets (16 bits) to indicate the network address. The remaining two octets specify host addresses. The first 2 bits of the first octet of a Class B address are always binary 10. Starting the first octet with binary 10 ensures that the Class B space is separated from the upper levels of the Class A space. The remaining 6 bits in the first octet may be populated with either ones or zeros. Therefore, the lowest number that can be represented with a Class B address is 10000000 (decimal 128), and the highest number that can be represented is 10111111 (decimal 191). Any address that has a value in the range of 128 to 191 in the first octet is a Class B address.
B 類位址空間的設計目的是支援中至大型網路,可容納超過 65,000 台主機的需求。B 類位址使用四個八位元組中的兩個(16 位元)來表示網路位址,其餘兩個八位元組則指定主機位址。B 類位址第一個八位元組的前 2 位元恆為二進位 10。第一個八位元組以二進位 10 開頭,可確保 B 類位址空間與 A 類位址空間的上層區隔開來。第一個八位元組中其餘 6 位元可以是 1 或 0。因此,B 類位址可表示的最小數值為 10000000(十進位 128),最大數值為 10111111(十進位 191)。任何第一個八位元組值介於 128 到 191 之間的位址都是 B 類位址。
Class C
C 類
The Class C address space is the most commonly available address class. This address space is intended to provide addresses for small networks with a maximum of 254 hosts. In a Class C address, the first three octets (24 bits) of the address identify the network portion, with the remaining octet reserved for the host portion. A Class C address begins with binary 110. Therefore, the lowest number that can be represented is 11000000 (decimal 192), and the highest number that can be represented is 11011111 (decimal 223). If an address contains a number in the range of 192 to 223 in the first octet, it is a Class C address.
C 類位址空間是最常見的位址類別,此位址空間用於提供小型網路的位址,最多可容納 254 台主機。在 C 類位址中,位址的前三個八位元組(24 位元)用於識別網路部分,其餘一個八位元組則保留給主機部分。C 類位址以二進位 110 開頭。因此,可表示的最小數值為 11000000(十進位 192),最大數值為 11011111(十進位 223)。若位址第一個八位元組的值介於 192 到 223 之間,該位址即為 C 類位址。
Class D
D 類
Class D (multicast) IPv4 addresses are dedicated to multicast applications such as streaming media. Multicasts are a special type of broadcast in that only hosts that request to participate in the multicast group will receive the traffic to the IPv4 address of that group. Unlike IPv4 addresses in Classes A, B, and C, multicast addresses are always the destination address and never the source. A Class D address begins with binary 1110. Therefore, the lowest number represented is 11100000 (decimal 224), and the highest number that can be represented is 11101111 (decimal 239). If an address contains a number in the range of 224 to 239 in the first octet, it is a Class D address.
D 類(群播)IPv4 位址專門用於串流媒體等群播應用程式。群播是一種特殊的廣播類型,只有請求加入群播群組的主機才會收到傳送到該群組 IPv4 位址的流量。與 A、B、C 類 IPv4 位址不同,群播位址一律作為目的位址,永遠不會作為來源位址。D 類位址以二進位 1110 開頭。因此,可表示的最小數值為 11100000(十進位 224),最大數值為 11101111(十進位 239)。若位址第一個八位元組的值介於 224 到 239 之間,該位址即為 D 類位址。
Class E
E 類
Class E (reserved) IPv4 addresses are reserved by the IANA as a block of experimental addresses. Class E IPv4 addresses should never be assigned to IPv4 hosts. A Class E address begins with binary 1111. Therefore, the lowest number that can be represented is 11110000 (decimal 240), and the highest number that can be represented is 11111111 (decimal 255). If an address contains a number in the range of 240 to 255 in the first octet, it is a Class E address.
E 類(保留)IPv4 位址由 IANA 保留作為實驗性位址區塊。E 類 IPv4 位址不應指派給任何 IPv4 主機。E 類位址以二進位 1111 開頭。因此,可表示的最小數值為 11110000(十進位 240),最大數值為 11111111(十進位 255)。若位址第一個八位元組的值介於 240 到 255 之間,該位址即為 E 類位址。
The following table shows the IPv4 address range of the first octet (in decimal and binary) for Class A, B, C, D, and E IPv4 addresses
下表顯示 A、B、C、D、E 類 IPv4 位址第一個八位元組(十進位與二進位)的位址範圍
Class A, B, and C First Octet Binary and Decimal Ranges
A、B、C 類第一個八位元組的二進位與十進位範圍
IPv4 Address Class IPv4 位址類別 | First Octet Binary Range 第一個八位元組的二進位範圍 | First Octet Decimal Range 第一個八位元組的十進位範圍 |
Class A A 類 | 00000001 to 01111110 00000001 至 01111110 | 1–126 1–126 |
Class B B 類 | 10000000 to 10111111 10000000 至 10111111 | 128–191 128–191 |
Class C C 類 | 11000000 to 11011111 11000000 至 11011111 | 192–223 192–223 |
Class D (Multicast) D 類(群播) | 11100000 to 11101111 11100000 至 11101111 | 224–239 224–239 |
Class E (Reserved) E 類(保留) | 11110000 to 11111111 11110000 至 11111111 | 240–255 240–255 |
