[1843] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Proxy ARP, strange ideas.

daemon@ATHENA.MIT.EDU (Christer Weinigel)
Mon Feb 5 01:52:11 1996

Date: 	Mon, 5 Feb 1996 02:30:07 +0100
From: Christer Weinigel <wingel@hog.rydnet.lysator.liu.se>
To: linux-net@vger.rutgers.edu
Reply-to: wingel@ctrl-c.liu.se

Hello,

I am experimenting with a rather magic network setup between my
computers at home, so I've been messing around with ipv4/arp.c quite a
lot.  Somewhere around kernel 1.3.42 the arp code was massively
reorganized, which broke some of my magic changes, but that's rather
irrelevant.  Anyway, the way the arp code worked before the
reorganization, all proxy-arp entries had to be kept in one table,
since one entry could match several network-interfaces; since the
change, one proxy arp entry can only match one interface.  Because of
this, the proxy-arp lookup could be made slightly faster by rewriting
arp.c .  I don't know how important the speed and memory efficiency of
the proxy-arp lookup is (does one usually have a dozen or thousands of
entries?) but if it is important enough, it could be made slightly
faster by splitting arp_proxy_list into one list for each device.

The inner loop in arp_rcv could be rewritten like this which would
save a few processor-cycles and bytes of storage.  Is it worth doing?

--- 
			for (proxy_entry=arp_proxy_list;
			     proxy_entry;
			     proxy_entry = proxy_entry->next)
			{
				if (proxy_entry->dev == dev &&
				    !((proxy_entry->ip^tip)&proxy_entry->mask))
					break;
			}
---
			for (proxy_entry=dev->arp_proxy_list;
			     proxy_entry;
			     proxy_entry = proxy_entry->next)
			{
				if (!((proxy_entry->ip^tip)&proxy_entry->mask))
					break;
			}
---

And, while on the subject of arp; what is proxy-arp really used for?
Doesn't almost _all_ use of proxy-arp look like this:

$ arp -i eth0 -s hostname hardware-address-of-eth0 pub

Because if that's the case, why not write a new utility
`proxy-arp-for' which takes only one argument, a hostname?
This program would do something like this:

route_through_device = find_route_to(host)
for (dev = all_devices_on_system; dev; dev = dev->next)
	if (dev != route_through_device)
		arp -i dev -s host hardware_address(dev) pub

Maybe one should go even one step further and put this functionality
directly in the kernel, the proxy-arp code would be much simplified
and could probably be made much faster.

Comments, critique or flames?

  /Christer


-- 
Christer Weinigel, wingel@ctrl-c.liu.se


home help back first fref pref prev next nref lref last post