3

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

Flags:

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, 140.252.13.33. 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 140.252.13.32 (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 140.252.13.33, but as he said, it matches the entry 140.252.13.32 (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 (140.252.13.33) finally be send to 140.252.13.32? That doesn't make sense.

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

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

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

5
  • But according to the book, 140.252.13.34 is exactly srv4 itself, the owner of this routing table, I think that will cause an infinite loop....
    – ryuu
    Jul 12 '16 at 14:56
  • No. That is the address of an interface on the router. The router will send traffic destined to 140.252.13.33 out that interface, which is where the 140.252.13.32 network is connected, presumably where the 140.252.13.33 host can be found.
    – Ron Maupin
    Jul 12 '16 at 14:59
  • oh I think I got it. And when it comes out, does it use ARP to find 140.252.13.33 ?
    – ryuu
    Jul 12 '16 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 '16 at 15:19
  • Thatis very effective and helpful. I am grateful.
    – ryuu
    Jul 12 '16 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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