何時使用可路由 IP 位址與不可路由 IP 位址

何時使用可路由 IP 位址與不可路由 IP 位址

據我了解,有以下幾種“不可路由的“ IP 範圍:

  • A類保留空間10.0.0.0/8
  • B類保留空間172.16.0.0/12
  • C類保留空間192.168.0.0/16
  • E 類保留用於研究 240.0.0.0

但我想我並沒有從根本上理解「可路由」與「不可路由」之間的差異。什麼時候需要可路由而不是不可路由,反之亦然?

答案1

您列出的這些範圍在此進行了描述 RFC 1918 - 專用網際網路的位址分配

標題給出了他們的用例: “...用於私有內部網路”

所有 IP 位址範圍在技術上都是可路由的,包括 RFC 中列出的範圍。但它們通常被稱為不可路由的。這是因為它們不能透過公共互聯網路由或存取。即互聯網上不存在這些範圍的路由。

它們是為專用網路保留的。具有 RFC 1918 IP 範圍的專用網路無需在 Internet 上發布這些專用網路路由即可存取公共 Internet,其方式是透過位於專用 Intranet 和 Internet 之間執行網路位址轉換或 NAT 的路由器。但這是另一個話題了。

至於為什麼你首先想要不可路由的位址? RFC 中的摘錄對此進行了解釋。

One challenge is a concern within the community that globally unique
address space will be exhausted. 

A separate and far more pressing concern is that the amount of 
routing overhead will grow beyond the
capabilities of Internet Service Providers. 

Efforts are in progress
within the community to find long term solutions to both of these
problems. Meanwhile it is necessary to revisit address allocation
procedures, and their impact on the Internet routing system.

答案2

我想我會在這件事上持相反的態度。 IMO,太多人在談論全類 ip 尋址時大驚小怪地試圖糾正人們。 RFC 1918 保留位址是從當時的全類別位址空間中劃分出來的。事實上,我讀過的每一篇有關 RFC 1918 地址的文檔都以它們的全類名稱來引用它們。我認為將 RFC 1918 位址稱為 A 類、B 類等是完全可以接受的。

至於可路由/不可路由的爭論,我將發布此內容(直接來自 RFC 1918):

   Because private addresses have no global meaning, routing information
   about private networks shall not be propagated on inter-enterprise
   links, and packets with private source or destination addresses
   should not be forwarded across such links. Routers in networks not
   using private address space, especially those of Internet service
   providers, are expected to be configured to reject (filter out)
   routing information about private networks. If such a router receives
   such information the rejection shall not be treated as a routing
   protocol error.

該描述完美而簡潔地描述了 RFC 1918 位址的「不可路由」性質,因此,在 IMO 中將它們稱為不可路由是完全可以接受的。

我認為討論這個問題花了太多時間。如果有人將 RFC 1918 位址空間稱為 A 類、B 類等,並將它們稱為不可路由,那麼我完全同意。我知道他們這麼說的意思,其他人也應該如此。即使對於網路「菜鳥」來說,了解全類尋址、RFC 1918 位址空間以及 CIDR 也是加深對網路的理解的關鍵。

另外:

RFC 1918 使用 CIDR 和全類別術語來引用這些私有位址範圍,如下例所示:

We will refer to the first block as "24-bit block", the second as
"20-bit block", and to the third as "16-bit" block. Note that (in
pre-CIDR notation) the first block is nothing but a single class A
network number, while the second block is a set of 16 contiguous
class B network numbers, and third block is a set of 256 contiguous
class C network numbers.

If a suitable subnetting scheme can be designed and is supported by
the equipment concerned, it is advisable to use the 24-bit block
(class A network) of private address space and make an addressing
plan with a good growth path. If subnetting is a problem, the 16-bit
block (class C networks), or the 20-bit block (class B networks) of
private address space can be used.

我在 RFC 1918 中找不到任何聲明更喜歡其中一個術語,如果 RFC 1918 對這兩個術語的使用不是那麼含糊的話,也許會更好,但事實就是如此。我在這裡唯一的觀點是,我認為我們是時候停止在人們使用術語“class”或“class-full”來指這些 IP 位址範圍時對他們進行打擊了。如果一個人了解 ip 尋址,那麼當他們在討論或文獻/文件中遇到其中一個(或兩者)時,他們就會理解這兩個術語的用法。對於剛學習 ip 尋址的人來說,我認為對全類尋址有一個紮實的理解對於理解一般的 ip 尋址有很大幫助,並為理解無類尋址奠定了基礎。

答案3

私有 IPv4 位址空間是可路由的,公司將其用於內部網路。您可以將它們與 OSPF、BGP 等路由協定一起使用。有時人們會錯誤地公開宣布它們 (BGP)。

所有現代設備都使用 CIDR。甚至 MS-DOS 也支援 CIDR。網路課程和術語已經過時。僅僅出於考古原因就應該對其進行研究。

私有 IPv4 位址空間和公用位址空間之間的唯一區別是私有位址空間在 Internet 上不是唯一的,它們旨在供內部使用。但這並不能阻止您與鄰居 AS 達成協議並在您和鄰居之間使用它們。在這種情況下,「內部」意味著你們兩個之間。是的,這是不好的做法,但這是可能的。

相關內容