-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 06 April 2003 08:21, Patrick McHardy scrawled: > N N Ashok wrote: > > I understand the concept of multipath in routing but dont know how the > >'equalize' option affects routing. From what I read, multipath specifies a > >list of interfaces (nexthops) to use for a given route. Whenever a route > > is looked up in the FIB, each interface (nexthop) is used according the > > 'weight' assigned to it during the route setup. By default the weights > > are assigned a value of 1 which results in each of the interface being > > used approximately equally. > > I read that 'equalize' option is suppossed to distribute the load on a > >per-packet basis. But the stock kernel does not seem to do it. I read the > >equalize patch provided by Patrick McHardy, <kaber@xxxxxxxxx> at > >http://trash.net/~kaber/. This does achieve the per-packet load-balancing. > > I wanted to know what does the 'equalize' option do in the kernel > > without this patch. Can anyone help me with this? > > Without the patch the kernel does nothing. An exact desciption how it > works is included > in the patch. Please make sure you understand the problems of per-packet > loadbalancing > before using it. If both lines have different rtt's tcp will get very > confused by constantly > arriving out-of-order packets, the performance may be even worse than > with just one > line. For ethernet bonding may be more appropriate. BTW, the patch was > not written by > me, i only adapted it to 2.4.18 and fixed some locking bugs. > > Bye > Patrick Thanks for the reply Patrick. I apologize for the length of the mail but I wanted to be sure that I explained my situation clearly. I did go through the patch itself to see what the changes were. And I've gone through the networking code of the kernel in quite some depth. In fact searching for RTM_F_EQUALIZE in the kernel gets only one hit which itself is the definition of RTM_F_EQUALIZE. Let me be sure I understand the patch correctly. With regards to the packets that are forwarded, the equalize-patch causes a FIB lookup for every packet that has a matching route in the route-cache with the RTCF_EQUALIZE flag set (i.e part of a multipath). I was wondering if there is a performance hit due to the FIB lookup for every packet going out on the multipath. Now, I am trying to modify the networking code to do per-session load-balancing. The idea is this: For every session (as maintained by the IP connectracking module), the outgoing interface is decided by the fib_multipath_select() based on the weights. For all packets belonging to this session, the same interface will be used. What I plan to do is keep track of the outgoing interface for a session in the connection structure maintained by IP connectracking module. When a packet arrives for lookup at the route cache, I check if the packet is part of any existing connection. If so, I get the outgoing interface for this interface from the connection structure. Now, the tricky part, I want to make sure that this interface is still usable to send out this packet. I am thinking of keeping a pointer to the fib_info for the route in the route cache and then search the fib_info for this route. If the interface is still usable, I should be able to find it in the fib_info. If I find it then I send it out on the interface without doing a FIB lookup. If the interface is not in the fib_info, that would indicate that the interface last used for this connection is not available, and then I would choose one from the available interfaces in the fib_info. Before I go ahead with these modifications, I would like to seek your opinion on this and any suggestions on how to do it if another solution exists. Thanks again, Ashok - -- - ----------------------------------------------------------------------------- My public key: gpg --recv-keys --keyserver blackhole.pca.dfn.de DCB44F2E - ----------------------------------------------------------------------------- "...there is nothing so unnatural as the commonplace." Sir Arthur Conan Doyle in "Adventures of Sherlock Holmes: A Case of Identity" - ----------------------------------------------------------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+kKYxRhXpVty0Ty4RAi1XAJ4mi1HF/HLGd2/WaoqdR19g1LJxVwCgxqgv 1eVon9AXusRYFJs+VqWD0xs= =7bYs -----END PGP SIGNATURE-----