Networking Forums

Networking Forums > Computer Networking > Linux Networking > A networking doubt

Reply
Thread Tools Display Modes

A networking doubt

 
 
Ashish Shukla
Guest
Posts: n/a

 
      04-05-2007, 07:03 PM
Hi,

I'm having a doubt regarding routing in Linux. Following is the ASCII
diagram of the scenario.


+----+ +-----------+ +-----------------+
+----------+
| me <--------| SWITCH A |--------> 31 SERVER 32 <-------| SWITCH
B |
+----+ +-----------+ | 192.168.1.0/24 |
+----------+
+-----------------+
As illustrated in the above diagram, the box named "me" (IP address:
192.168.1.118/24) is connected to a network switch "A" . A box named
"SERVER" (IP addresses 192.168.1.31/24 and 192.168.1.32/24) with
interface "eth0" (having address 192.168.1.31/24) connected to switch
"A" and interface "eth1" (having address 192.168.1.32/24) connected to
switch "B" . Now, when I do a "ping 192.168.1.32" from "me" I get a
reply. I wanted to know why I get reply from 192.168.1.32/24 which is
not directly connected to network switch "A" ? I checked ARP cache on
"me" and found that "192.168.1.31/24" and "192.168.1.32/24" are
pointing to the same MAC address.

I'm running CentOS 4.4 (AMD64 architecture).

Thanks in advance,
Ashish Shukla
-
http://wahjava.wordpress.com/

 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      04-05-2007, 07:23 PM
On Apr 5, 3:03 pm, "Ashish Shukla" <wahj...@gmail.com> wrote:
> Hi,
>
> I'm having a doubt regarding routing in Linux. Following is the ASCII
> diagram of the scenario.
>
> +----+ +-----------+ +-----------------+ +----------+
> | me <--------| SWITCH A |----> 31 SERVER 32 <---| SWITCH B |
> +----+ +-----------+ | 192.168.1.0/24 | +----------+
> +-----------------+
> As illustrated in the above diagram, the box named "me" (IP address:
> 192.168.1.118/24) is connected to a network switch "A" . A box named
> "SERVER" (IP addresses 192.168.1.31/24 and 192.168.1.32/24) with
> interface "eth0" (having address 192.168.1.31/24) connected to switch
> "A" and interface "eth1" (having address 192.168.1.32/24) connected to
> switch "B" . Now, when I do a "ping 192.168.1.32" from "me" I get a
> reply. I wanted to know why I get reply from 192.168.1.32/24 which is
> not directly connected to network switch "A" ? I checked ARP cache on
> "me" and found that "192.168.1.31/24" and "192.168.1.32/24" are
> pointing to the same MAC address.


"SERVER" is apparently configured to forward IP datagrams between its
two interfaces.

When you ping 192.168.1.32 from your "me" system, the low level
ethernet drivers in "me" have to find out which MAC address to put on
the packet. "me" sends an ARP WHO-HAS query out onto the ethernet,
asking for the MAC address of the system responsible for 192.168.1.32.
Your SERVER, acting as a gateway and owner of the 192.186.1.32 IP
address replies with an ARP reply, giving the MAC address of it's
192.168.1.31 NIC. This is the MAC address that "me"s ethernet driver
should address packets for 192.168.1.32 to.

Now, "me" sends its datagrams for 192.168.1.32 to the MAC address that
ROUTER replied with, which takes them to ROUTER. ROUTER receives these
datagrams and, being the gateway to 192.168.1.32, recognizes through
its routing tables that it should process these packets. It picks up
the packets that "me" sends to 192.168.1.32 from its 192.168.1.31
interface, and passes them onward to its 192.168.1.32 interface. The
reply from 192.168.1.32 goes in the reverse route: internally through
ROUTER to 192.168.1.31, and onwards to "me" by way of 'me"s MAC
address.



 
Reply With Quote
 
Ashish Shukla
Guest
Posts: n/a

 
      04-05-2007, 09:31 PM
On Apr 6, 12:23 am, "Lew Pitcher" <lpitc...@sympatico.ca> wrote:
[snip]
>
> "SERVER" is apparently configured to forward IP datagrams between its
> two interfaces.
>
> When you ping 192.168.1.32 from your "me" system, the low level
> ethernet drivers in "me" have to find out which MAC address to put on
> the packet. "me" sends an ARP WHO-HAS query out onto the ethernet,
> asking for the MAC address of the system responsible for 192.168.1.32.
> Your SERVER, acting as a gateway and owner of the 192.186.1.32 IP
> address replies with an ARP reply, giving the MAC address of it's
> 192.168.1.31 NIC. This is the MAC address that "me"s ethernet driver
> should address packets for 192.168.1.32 to.
>
> Now, "me" sends its datagrams for 192.168.1.32 to the MAC address that
> ROUTER replied with, which takes them to ROUTER. ROUTER receives these
> datagrams and, being the gateway to 192.168.1.32, recognizes through
> its routing tables that it should process these packets. It picks up
> the packets that "me" sends to 192.168.1.32 from its 192.168.1.31
> interface, and passes them onward to its 192.168.1.32 interface. The
> reply from 192.168.1.32 goes in the reverse route: internally through
> ROUTER to 192.168.1.31, and onwards to "me" by way of 'me"s MAC
> address.


Thanks
Ashish Shukla

 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      04-05-2007, 10:22 PM
Hello,

Lew Pitcher a écrit :
> On Apr 5, 3:03 pm, "Ashish Shukla" <wahj...@gmail.com> wrote:
>
>>[...] I wanted to know why I get reply from 192.168.1.32/24 which is
>>not directly connected to network switch "A" ?


Simply because 192.168.1.32 belongs to the server. The interface on
which the address is configured does not matter. By default, the Linux
TCP/IP stack can use any of its local IP addresses on any of its interfaces.

> "SERVER" is apparently configured to forward IP datagrams between its
> two interfaces.


Not necessarily. This is not needed.

> When you ping 192.168.1.32 from your "me" system, the low level
> ethernet drivers in "me" have to find out which MAC address to put on
> the packet.


No. The ethernet drivers are not involved in the ARP resolution. They
just transmit and receive ethernet frames for the TCP/IP stack which is
in charge of the ARP resolution.

> Your SERVER, acting as a gateway and owner of the 192.186.1.32 IP
> address


Not as a gateway. Only as the owner of 192.186.1.32. The server receives
an ARP request for one of its IP addresses on one its interfaces and
replies with the MAC address of this interface.

> Now, "me" sends its datagrams for 192.168.1.32 to the MAC address that
> ROUTER replied with, which takes them to ROUTER.


Yes. I guess you mean "server" instead of "router".

> ROUTER receives these
> datagrams and, being the gateway to 192.168.1.32,


No, being the owner of 192.168.1.32.

> recognizes through
> its routing tables that it should process these packets.


Yes. Recognizes from looking up the special "local" routing table that
it is a local address.

> It picks up
> the packets that "me" sends to 192.168.1.32 from its 192.168.1.31
> interface, and passes them onward to its 192.168.1.32 interface.


No. Since the destination address is a local address, the TCP/IP stack
performs a local delivery to the upper layer. IP forwarding is not
involved in the routing to a local address.

Note to Ashish Shukla : giving IP addresses from the same IP subnet to
interfaces on different physical networks, as you did, is a mistake. It
causes conflicting routes in the routing table.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
doubt regarding Cisco Certification Exams? avinash Linux Networking 1 09-24-2004 01:21 AM
Xbox live doubt Arie Broadband Hardware 5 08-02-2004 07:33 PM
doubt 2 swathi Windows Networking 0 11-28-2003 07:47 AM
Doubt swathi Windows Networking 0 11-28-2003 07:45 AM
Re: doubt regarding .tgz Shadow_7 Linux Networking 0 07-04-2003 11:03 PM



1 2 3 4 5 6 7 8 9 10 11