Re: Switches and ARP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2002-06-27 at 17:26, Amit Kucheria wrote:

> BTW, for this experiment, I only have unidirectional UDP traffic. So I 
> dont expect any packets back on the reverse path. Not that it should 
> really matter, should it?

Oh yes. That is why your seeing such behavior.

Here is roughly how the switching engine works in pseudo code:

OnReceiveFrame( frameReceived, receivingPort ) {
  UpdateForwardingTable( frameReceived->srcMacAddr, receivingPort );

  dstPort = LookUpForwardingTable( frameReveiced->dstMacAddr );

  if ( null(dstPort) )
    BroadcastFrameOnAllPorts( frameReceived );
  else
    SendFrameOnPort( frameReceived, dstPort );
}

The switch can only populate his forwarding table from ethernet frame on
a port, with the frame source MAC addr.

If the traffic is unidirectional, the switch will only see frame with
src MAC V1 but will never see frame with src MAC V2.

Lets assume that V1 is on port 1 and V2 on port 2.

On a fresh switch bootup, the switch forwarding table is empty.

V1 send a UDP packet to V2.
    Switch receive frame on port 1, with src MAC V1. 
    Switch learn that V1 is on port 1.
    Switch lookup port associated with V2.
    Switch doesn't know V2.
    Switch thus broadcast frame on all ports.

Forward Table:
MAC    PORT
V1     1

V2 remains silent.

Forward Table:
MAC    PORT
V1     1

V1 send another UDP packet to V2.
    Switch receive frame on port 1, with src MAC V1.
    Switch keep updated the fact that V1 is on port 1.
    Switch lookup port associated with V2.
    Switch doesn't know V2.
    Switch thus broadcast frame on all ports.

Forward Table:
MAC    PORT
V1     1

V2 remain silent.

Forward Table:
MAC    PORT
V1     1

V1 send an arp request for V2.
    Switch receive frame on port 1, with src MAC V1.
    Switch keep updated the fact that V1 is on port 1.
    Switch lookup port associated with V2.
    Switch doesn't know V2.
    Switch thus broadcast frame on all ports.

Forward Table:
MAC    PORT
V1     1

V2 receives ARP request and replies to V1.
    Switch receive frame on port 2, with src MAC V2.
    Switch learns that V2 is on port 2.
    Switch lookup port associated with V1.
    Switch knows that V1 is on port 1.
    Switch sends frame on port 1.

Forward Table:
MAC    PORT
V1     1
V2     2

V1 send another UDP packet to V2.
    Switch receive frame on port 1, with src MAC V1.
    Switch keep updated the fact that V1 is on port 1.
    Switch lookup port associated with V2.
    Switch now knows that V2 is on port 2.
    Switch sends frame on port 2.

Forward Table:
MAC    PORT
V1     1
V2     2

I hope this makes sense.

Regards,

Danny

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux