Ethernet LAN Re: Router MAC address

Bookmark this page:  YahooMyWeb Yahoo!  Google Google  Windows Live Favorites Windows Live  del.icio.us del.icio.us  digg digg  Add to Netscape Netscape
Subject Author Date
Re: Router MAC address James Harris 11-28-08
Posted by James Harris on November 28, 2008, 9:00 am
Please log in for more thread options
> In article
>
> > Good find with the arping. If I read the RFC correctly (linked RFC
> > 820) from
>
> > http://en.wikipedia.org/wiki/Address_Resolution_Protocol
>
> > a host should update its arp table with the last info received. That
> > said I may have read it incorrectly - it was only a cursory scan over
> > the info - or the arp handler may choose not to add an entry for the
> > second update. The RFC doesn't look like it was written with this
> > situation in mind.
>
> I think you're right. That's how "gratuitous ARP" works to update ARP
> caches when an IP moves to a new machine.
>
> So I find it strange that Linux uses the first ARP response received,
> rather than the last.

I've found a note in the Linux arp source:

893 if (n) {
894 int state = NUD_REACHABLE;
895 int override;
896
897 /* If several different ARP replies follows back-to-back,
898 use the FIRST one. It is possible, if several proxy
899 agents are active. Taking the first reply prevents
900 arp trashing and chooses the fastest router.
901 */
902 override = time_after(jiffies, n->updated + n->parms->locktime);
903
904 /* Broadcast replies and request packets
905 do not assert neighbour reachability.
906 */
907 if (arp->ar_op != htons(ARPOP_REPLY) ||
908 skb->pkt_type != PACKET_HOST)
909 state = NUD_STALE;
910 neigh_update(n, sha, state, override ? NEIGH_UPDATE_F_OVERRIDE :
0);
911 neigh_release(n);
912 }

This looks like it checks the time since the last update in some way
(line 902) to set the override variable. If the override variable is
set it uses it in line 910 to select NEIGH_UPDATE_F_OVERRIDE (which is
a flag setting) to send to the neigh_update routine. Perhaps that
routine ignores the update if that flag bit is set.

At any rate the comment is most enlightening!

P.S. The above code is from

http://www.gelato.unsw.edu.au/lxr/source/net/ipv4/arp.c

which you can see is part of a recent 2.6 kernel. Judging by the
copyright date and the lack of any mention of this behaviour in the
change log it is possible this has been the Linux behaviour for some
time.

James


Similar ThreadsPosted
I have PC->Router->DSL Modem->ISP, Does ISP Router learn the PC MAC address? April 25, 2005, 9:33 am
Router MAC address November 26, 2008, 10:34 am
Re: Router MAC address November 28, 2008, 9:00 am
VRRP (IP packets addressed to the IP address of the virtual router owner) January 18, 2005, 3:12 am
VRRP (IP packets addressed to the IP address of the virtual router owner) January 19, 2005, 10:54 am
VRRP (IP packets addressed to the IP address of the virtual router owner) January 20, 2005, 2:41 am
MAC address of an IPv6 address April 10, 2007, 4:42 pm
ADSL Router connected to another router problem September 28, 2006, 3:34 am
connecting Cisco router to Juniper router via e1 September 24, 2007, 6:18 am
is a NAT device/'home router' - a router? September 27, 2005, 8:10 pm
Mac address recovery December 17, 2004, 9:07 am
Change MAC address January 25, 2005, 8:53 am
Valid mac address February 7, 2006, 8:21 pm
Change MAC address June 20, 2007, 7:19 am
MAC destination address July 19, 2007, 12:06 am
Residential Cabling Guide

Home Cabling Guide

Finally, an instantly downloadable book that saves you thousands in home improvement dollars! Enjoy living in 21st century technology-advanced home while increasing its selling value and competitive advantage on the real estate market. Whether your cabling is for home office or high-tech leisure, you can wire your home yourself or learn "wirish" to speak with your cabling contractors in their language!

Learn More