khan wrote:
> From: "khan" <(E-Mail Removed)>
> Newsgroups: comp.os.ms-windows.networking.tcp-ip
> Subject: IP address.
> Date: Mon, 19 Jun 2006 03:45:21 -0700
>
> I wanted to clarify, how the IP address is matched and forwarded.
> This is my understanding.
> Let us consider your working on a machine "X" with IP address is
> 192.168.1.220, a IP packet is received with destination IP as
> 192.168.1.220(i.e machine "X" itself is the destination).Let the
> subnet mask be 255.255.255.0.With this subnetmask, network id will be
> 192.168.1 and host id will be 220.
>
> Now there are two possibilities according to me.
>
> 1. Check the routing table & match the entire IP address if it matches
> completely and is the local IP address, pass the packectto transport
> layer of local machine.or else just forwards the packet to next
> appropriate router or to the host machine. or
>
> 2.First the network part is compared and if matches, the host part is
> compared If matches,passes packet to the transport layer of local
> machine.
The kernel routing table decides where to send an IP packet. If you type:
netstat -rn
you get a list of destinations and interfaces. Then when a packet is to
be sent, the kernel behaves as if it did a linear search down the table
(matching the destination IP address against (destination and genmask)
in the table.
Linux doesn't seem to display a localhost entry.
Robert
|