IP routing
How do packets get from one place to another (when they do)?
Hosts have tables listing available network interfaces and the
IP networks reachable from them, containing:
- A route destination and netmask (to specify a particular range
of IP addresses reachable from this route)
- A gateway (the IP address to forward traffic to, if relevant)
- An interface (the hardware interface for that network)
- Flags (used internally to specify route types and other information)
A netmask is literally just a bitmask used with logical
operations to manipulate address bits
- It's usually written either like a numeric IP address
(255.255.254.0) or in the more modern "CIDR" notation as
/23 (the number of one bits on the left); both
stand for a mask of 11111111111111111111111000000000
- For routing decisions, if dest_IP & netmask == route_dest
then the destination IP is considered to match that route
- For sending broadcast messages, the broadcast address for a
subnet is dest_IP | ~(netmask)
A router is just a host that has multiple physical network
interfaces and knows how to move packets between
multiple networks
Both routers and normal hosts have routing tables, but a router's
table is usually more complicated
Next ->
Steve VanDevender
Last modified: Thu Jul 8 14:45:29 PDT 2010