15 · Exploring the Packet Delivery Process探索封包傳遞流程

Default Gateways預設閘道

A source host can communicate directly (without a router) with a destination host only if the two hosts are on the same subnet. If the two hosts are on different subnets, the sending host must send the data to its default gateway, which will forward the data to the destination. The default gateway is an address on a router (or Layer 3 switch) connected to the same subnet that the source host is on.

來源主機只有在與目的主機位於同一個子網路時,才能直接(不透過路由器)與目的主機通訊。若兩台主機位於不同子網路,傳送端主機必須將資料傳送至其預設閘道,再由預設閘道將資料轉送至目的地。預設閘道是連接到來源主機所在同一子網路的路由器(或第 3 層交換器)上的位址。

Interactive content from the online course (not available offline)線上課程的互動內容(離線版未收錄)

Therefore, before a host can send a packet to its destination, it must first determine if the destination address is on its local subnet or not. It uses the subnet mask in this determination. The subnet mask describes which portion of an IPv4 address refers to the network or subnet and which part refers to the host.

因此,主機在傳送封包到目的地之前,必須先判斷目的位址是否位於其本地子網路內。它會利用子網路遮罩來進行此判斷。子網路遮罩描述 IPv4 位址中哪一部分代表網路或子網路,哪一部分代表主機。

The source host first does an AND operation between its own IPv4 address and subnet mask to arrive at its local subnet address. To determine if the destination address is on the same subnet, the source host then does an AND operation between the destination IPv4 address and the source's subnet mask. This is because it doesn't know the subnet mask of the destination address, and if the devices are on the same subnet, they must have the same mask. If the resulting subnet address is the same, it knows the source and destination are on the same subnet. Otherwise, they are on different subnets.

來源主機首先會將自己的 IPv4 位址與子網路遮罩進行 AND 運算,以取得其本地子網路位址。為判斷目的位址是否位於同一子網路,來源主機接著會將目的 IPv4 位址與來源端的子網路遮罩進行 AND 運算。這是因為來源主機不知道目的位址的子網路遮罩,而若裝置位於同一子網路,它們必定使用相同的遮罩。若運算結果的子網路位址相同,就表示來源與目的位於同一子網路;否則,它們位於不同子網路。

For example, IPv4 host 10.10.1.241/24 is on the 10.10.1.0/24 subnet. If the host that it wants to communicate with is 10.10.1.175, it knows that this IPv4 host is also on the local 10.10.1.0/24 subnet.

舉例來說,IPv4 主機 10.10.1.241/24 位於 10.10.1.0/24 子網路。若它想通訊的主機是 10.10.1.175,它便可知道此 IPv4 主機也位於本地的 10.10.1.0/24 子網路。

If the source and destination devices are on the same subnet, then the source can deliver the packet directly. If they are on different subnets, then the packet must be forwarded to the default gateway, which will forward it to its destination. The default gateway address must have the same network and subnet portion as the local host address; in other words, the default gateway must be on the same subnet as the local host.

若來源與目的裝置位於同一子網路,來源便可直接傳遞封包。若它們位於不同子網路,封包就必須轉送至預設閘道,再由其轉送至目的地。預設閘道位址的網路與子網路部分,必須與本地主機位址相同,換句話說,預設閘道必須與本地主機位於同一子網路。

Interactive content from the online course (not available offline)線上課程的互動內容(離線版未收錄)

Host is configured with the address of their default gateway. On a Windows computer, the Internet Protocol (TCP/IP) Properties tools are used to enter the default gateway IP address if you need to set the network parameters manually. These parameters may also be learned automatically.

主機會設定其預設閘道的位址。在 Windows 電腦上,若需要手動設定網路參數,可使用網際網路通訊協定(TCP/IP)內容工具輸入預設閘道 IP 位址。這些參數也可以自動取得。

Which three statements about a default gateway are true? (Choose three.)以下哪三項關於預設閘道的敘述是正確的?(請選三項。)