Replacing the earlier sequential search through the routing table with a binary search has significantly sped up lookups, which can happen up to twice per packet forwarded (once for source address, once for destination address).
With "only" 16 million addresses in AMPRnet, why don't you use a 16-million entry array holding the next hop for each IP in 44.x.x.x or zero for those addresses that have no tunnel? Then you only need a single index operation to get the next hop for a packet. That requires 64MB of memory to store, hardly a significant amount today. And it can double-up as the filter to forward traffic only to/from registered addresses.
Of course the update operation becomes more expensive, but it could probably be done in-place without disrupting packet forwarding. Or you could build a second table and then switch to it after the build is complete (requiring 128MB).
Rob
Interesting concept. Someday if we have enough memory I may try it, but right now amprgw (an old machine) has only 4 GB of memory. It'd die swapping.
At the moment, I use the ipfw firewall to filter registered addresses; that saves several context switches. - Brian
On Mon, May 01, 2017 at 07:16:58PM +0200, Rob Janssen wrote:
With "only" 16 million addresses in AMPRnet, why don't you use a 16-million entry array holding the next hop for each IP in 44.x.x.x or zero for those addresses that have no tunnel? Then you only need a single index operation to get the next hop for a packet. That requires 64MB of memory to store, hardly a significant amount today. And it can double-up as the filter to forward traffic only to/from registered addresses.
Of course the update operation becomes more expensive, but it could probably be done in-place without disrupting packet forwarding. Or you could build a second table and then switch to it after the build is complete (requiring 128MB).
Rob
44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
On 05/01/2017 10:24 AM, Brian Kantor wrote:
(Please trim inclusions from previous messages) _______________________________________________ Interesting concept. Someday if we have enough memory I may try it, but right now amprgw (an old machine) has only 4 GB of memory. It'd die swapping.
At the moment, I use the ipfw firewall to filter registered addresses; that saves several context switches.
- Brian
I'm curious, it sounds like the machine you are using is a FreeBSD one, since you are using ipfw.
If that is the case, have you looked at the setfib command? Just curious as to if using multiple routing tables would help at all. It would require a recompiling of the KERNEL with the ROUTETABLES= entry in your kernel config.
-Stacy
Yes, it's FreeBSD 10.3. No, I haven't looked at setfib because as I understand it, it selects kernel routing tables, and I'm doing the routing in a user-space program. - Brian
On Mon, May 01, 2017 at 01:01:44PM -0700, Stacy wrote:
I'm curious, it sounds like the machine you are using is a FreeBSD one, since you are using ipfw.
If that is the case, have you looked at the setfib command? Just curious as to if using multiple routing tables would help at all. It would require a recompiling of the KERNEL with the ROUTETABLES= entry in your kernel config.
-Stacy
44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
On 05/01/2017 01:13 PM, Brian Kantor wrote:
(Please trim inclusions from previous messages) _______________________________________________ Yes, it's FreeBSD 10.3. No, I haven't looked at setfib because as I understand it, it selects kernel routing tables, and I'm doing the routing in a user-space program.
- Brian
Cool. I've been a FreeBSD guy since 2.2.1-RELEASE (too long ago).
It is kernel based. It would be curious as to if the overhead and speed is better or worse that your userspace program. Some people seem to be using it as a "poor man's" BGP.
It would be interesting to see the guts of the AMPR gateway and how you implemented it. I know that some people have asked to see the code, and you mentioned that it may be encumbered a bit. Too bad.
-Stacy
If that is the case, have you looked at the setfib command? Just curious as to if using multiple routing tables would help at all. It would require a recompiling of the KERNEL with the ROUTETABLES= entry in your kernel config.
It actually doesn't even require a recompile. Just set net.fibs=<n> in /boot/loader.conf and reboot.
-J
On May 1, 2017, Brian Kantor Brian@UCSD.Edu wrote:
Interesting concept. Someday if we have enough memory I may try it, but right now amprgw (an old machine) has only 4 GB of memory. It'd die swapping.
To the members:
I think Brian deserves a new computer. If anyone has a more capable machine that's a few steps above the current amprgw hardware, please consider donating it.
I'll be glad to coordinate the effort: feel free to send me infor- mation about any machine you are willing to donate.
Brian,
Please let us know what your "dream" machine would be. We'll get as close as we can.
Bill, W4EWH
Yes, what do you need Brian?
M
-----Original Message----- From: 44Net [mailto:44net-bounces+n6mef=mefox.org@hamradio.ucsd.edu] On Behalf Of Bill Horne W4EWH Sent: Tuesday, May 2, 2017 7:00 AM To: AMPRNet working group 44net@hamradio.ucsd.edu Subject: Re: [44net] amprgw routing
(Please trim inclusions from previous messages) _______________________________________________
On May 1, 2017, Brian Kantor Brian@UCSD.Edu wrote:
Interesting concept. Someday if we have enough memory I may try it, but right now amprgw (an old machine) has only 4 GB of memory. It'd die swapping.
To the members:
I think Brian deserves a new computer. If anyone has a more capable machine that's a few steps above the current amprgw hardware, please consider donating it.
I'll be glad to coordinate the effort: feel free to send me infor- mation about any machine you are willing to donate.
Brian,
Please let us know what your "dream" machine would be. We'll get as close as we can.
Bill, W4EWH _________________________________________ 44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
Thank you Bill, but we already have some plans in work to obtain a newer machine, one with a faster processor (we're already at 2.3 GHz) and more memory, and is compatable with our data center management. (Rack mount, remote console access, etc.) I'll know more within the next few months.
If that doesn't work out, I'll happily take a donation of a new machine.
As to 4GB of memory being enough, it's plenty. The router image and data space just aren't very big, and they're static structures that can be locked into memory so paging doesn't affect the routing. The 'C' language and libraries are fairly memory-efficient if the programmer is. - Brian
On Tue, May 02, 2017 at 10:00:19AM -0400, Bill Horne W4EWH wrote:
To the members:
I think Brian deserves a new computer. If anyone has a more capable machine that's a few steps above the current amprgw hardware, please consider donating it.
I'll be glad to coordinate the effort: feel free to send me infor- mation about any machine you are willing to donate.
Brian,
Please let us know what your "dream" machine would be. We'll get as close as we can.
Bill, W4EWH