A networking doubt - Networking

This is a discussion on A networking doubt - Networking ; Hi, I'm having a doubt regarding routing in Linux. Following is the ASCII diagram of the scenario. +----+ +-----------+ +-----------------+ +----------+ | me 31 SERVER 32 B | +----+ +-----------+ | 192.168.1.0/24 | +----------+ +-----------------+ As illustrated in the above ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: A networking doubt

  1. A networking doubt

    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/


  2. Re: A networking doubt

    On Apr 5, 3:03 pm, "Ashish Shukla" 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.




  3. Re: A networking doubt

    On Apr 6, 12:23 am, "Lew Pitcher" 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


  4. Re: A networking doubt

    Hello,

    Lew Pitcher a écrit :
    > On Apr 5, 3:03 pm, "Ashish Shukla" 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 to Thread