I am reading TCP/IP Illustrated recently, and I am confused about the IP Routing.
Here is the routing table in that text:
G: The route is to a gateway (router). If this flag is not set, the destination is directly connected.
H: The route is to a host, that is, the destination is a complete host address. If this flag is not set, the route is to a network, and the destination is a network address: a net ID, or a combination of a net ID and a subnet ID.
The author gives some examples about that, one of them is:
Assume the destination address is the host sun, 126.96.36.199. A search is first made for a matching host entry. The two host entries in the table (slip and localhost) don't match, so a search is made through the routing table again for a matching network address. A match is found with the entry 188.8.131.52 (the network IDs and subnet IDs match), so the emd0 interface is used. This is a direct route, so the link-layer address will be the destination address.
That's what makes me confused. The destination address should be the host sun
184.108.40.206, but as he said, it matches the entry
220.127.116.11 (the network IDs and subnet IDs match), and the flag of this entry is
H, the packet will directly send to him, so the packet whose destination address is sun (
18.104.22.168) finally be send to
22.214.171.124? That doesn't make sense.
Sorry for my bad English; I hope you guys could get what I am talking about.