I am reading TCP/IP Illustrated recently, and I am confused about the IP Routing.

Here is the routing table in that text:

enter image description here


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, 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 (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, but as he said, it matches the entry (the network IDs and subnet IDs match), and the flag of this entry is U, no G, no H, the packet will directly send to him, so the packet whose destination address is sun ( finally be send to That doesn't make sense.

Sorry for my bad English; I hope you guys could get what I am talking about.

  • 1
    This article might help explain Routers and routing a little simpler.
    – Eddie
    Jul 12, 2016 at 14:55

1 Answer 1


The routing table entry is a network. If traffic is destined to, the routing table will be searched for the longest match to that address. The longest match is, so the traffic destined to will be sent, the gateway to the network. The router assumes that knows how to get the traffic to

  • But according to the book, is exactly srv4 itself, the owner of this routing table, I think that will cause an infinite loop....
    – ryuu
    Jul 12, 2016 at 14:56
  • No. That is the address of an interface on the router. The router will send traffic destined to out that interface, which is where the network is connected, presumably where the host can be found.
    – Ron Maupin
    Jul 12, 2016 at 14:59
  • oh I think I got it. And when it comes out, does it use ARP to find ?
    – ryuu
    Jul 12, 2016 at 15:13
  • That depends on the layer-2 protocol used on that interface. If it is a protocol which uses ARP, e.g. ethernet, the router will first check its ARP cache to see if it knows the MAC address for the destination IP address. If it doesn't find it in the ARP cache, it will use ARP to discover the MAC address for that IP address. If the interface uses a serial port with a protocol for that, e.g. PPP, then ARP isn't used.
    – Ron Maupin
    Jul 12, 2016 at 15:19
  • Thatis very effective and helpful. I am grateful.
    – ryuu
    Jul 12, 2016 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.