Routers have these two important functions:
路由器具有以下兩項重要功能:
- Path determination: Routers use their routing tables to determine how to forward packets. Each router must maintain its own local routing table, which contains a list of all destinations known to the router and information about reaching those destinations. When a router receives an incoming packet, it examines the destination IP address in the packet and searches for the best match between the destination address and the network addresses in the routing table. A matching entry may indicate that the destination is directly connected to the router or that it can be reached via another router. This router is called the next-hop router and is on the path to the final destination. If there is no matching entry, the router sends the packet to the default route. If there is no default route, the router drops the packet.路徑判斷:路由器使用其路由表來判斷如何轉發封包。每台路由器都必須維護自己的本地路由表,其中包含路由器已知的所有目的地清單,以及到達這些目的地的相關資訊。當路由器收到進來的封包時,會檢查封包中的目的地 IP 位址,並在目的地位址與路由表中的網路位址之間尋找最佳比對。若比對成功的項目,可能表示該目的地直接連接到此路由器,或可透過另一台路由器到達。這台路由器稱為下一跳路由器,位於通往最終目的地的路徑上。若找不到比對的項目,路由器會將封包傳送到預設路由。若也沒有預設路由,路由器則會丟棄該封包。
- Packet forwarding: After a router determines the appropriate path for a packet, it forwards it through a network interface toward the destination network. Routers can have interfaces of different types. When forwarding a packet, routers perform encapsulation following the OSI Layer 2 protocol implemented at the exit interface. The figure shows router A, which has two FastEthernet interfaces and one serial interface. When router A receives an Ethernet frame, it de-encapsulates it, examines it, and determines the exit interface. If the router needs to forward the packet out of the serial interface, the router will encapsulate the frame according to the Layer 2 protocol used on the serial link. The figure also shows a conceptual routing table that lists destination networks known to the router and its corresponding exit interface or next-hop address. If an interface on the router has an IPv4 address within the destination network, the destination network is considered "directly connected" to the router. For example, assume that router A receives a packet on its Serial0/0/0 interface destined for a host on network 10.1.1.0. Because the routing table indicates that network 10.1.1.0 is directly connected, router A forwards the packet out of its FastEthernet 0/1 interface, and the switches on the segment process the packet to the host. If a destination network in the routing table is not directly connected, the packet must reach the destination network via the next-hop router. For example, assume that router A receives a packet on its Serial0/0/0 interface and the destination host address is on the 10.1.3.0 network. In this case, it must forward the packet to the router B interface with the IPv4 address 10.1.2.2.封包轉發:路由器判斷出封包的適當路徑後,會透過網路介面將其轉發至目的地網路。路由器可具備不同類型的介面。轉發封包時,路由器會依照出口介面所實作的 OSI 第 2 層通訊協定進行封裝。圖中顯示路由器 A,它具有兩個 FastEthernet 介面與一個序列介面。當路由器 A 收到一個 Ethernet 框架時,會將其解封裝、檢視內容,並判斷出口介面。若路由器需要將封包從序列介面轉發出去,路由器會依照該序列鏈路所使用的第 2 層通訊協定重新封裝該框架。圖中還顯示了一個概念性路由表,列出路由器已知的目的地網路,以及對應的出口介面或下一跳位址。若路由器上的某個介面在目的地網路範圍內擁有 IPv4 位址,該目的地網路即視為與路由器「直接連接」。舉例來說,假設路由器 A 在其 Serial0/0/0 介面上收到一個目的地為網路 10.1.1.0 上某主機的封包。由於路由表指出網路 10.1.1.0 為直接連接,路由器 A 會將封包從其 FastEthernet 0/1 介面轉發出去,該網段上的交換器再將封包處理送達該主機。若路由表中的目的地網路並非直接連接,封包就必須透過下一跳路由器才能到達目的地網路。舉例來說,假設路由器 A 在其 Serial0/0/0 介面上收到一個封包,而目的地主機位址位於 10.1.3.0 網路上。在此情況下,它必須將封包轉發至路由器 B 上 IPv4 位址為 10.1.2.2 的介面。
Which routing table element describes the IPv4 address of the successive neighboring device?路由表中的哪個元素描述了下一個相鄰裝置的 IPv4 位址?
