[TAG] What's an IP gateway anyhow?
bpm at idiom.com
Mon Nov 7 06:21:04 MSK 2005
On Sat, Nov 05, 2005 at 11:20:37PM -0700, Jason Creighton wrote:
> Basically, my question boils down to this: How does setting a gateway to
> a network differ from just setting a route to a network?
Usually, not at all. The 'gateway' is the default router for the LAN.
There may be other routers on the LAN, which may be preferred for
certain networks, but in the commonest instance there's only one router
and the two are synonymous.
> So, obviously, there's something going on that I don't understand. How
> does that work, then? Does Alice look at her routing tables and see that
> she has Bob as her gateway, and then sends a packet with IP destination
> set to 22.214.171.124, but with *ethernet* destination set to Bob's MAC
> address? Or something more complex?
Take the simplest example: a host with no routing tables beyond the
single default router. Alice has a packet for an IP address. She
examines it and her subnet mask to see if the destination is local to
her subnet. If so, she just ARPs the destination and uses the response
to consruct an ethernet frame.
If the packet destination is not local, she ARPs her default gateway (no
other routes, remember) and constructs an ethernet frame with the
destination MAC equal to the gateway's MAC.
Menlo Park, California
More information about the TAG