12.07.2019 6:56, Andrei Borzenkov пишет:
11.07.2019 15:53, Per Jessen пишет:
Andrei, you wouldn't happen to know how to look at the hash value used? Afaict, it doesn't change - if I do e.g. 10 or 20 new sessions one after one, they all pick the same route.
Displaying hash itself which is return value of kernel function is relatively easy - function return is well defined trace point. Displaying its arguments or internal variables seems to be more complicated and requires real programming in whatever trace language is used.
...
Here "telnet" is called twice in different terminals with the same destination address. I am not sure where two other calls to hash come from, may be some internal library resolver or similar.
I did become curious and tried to capture input to hash function. bor@tw:~> sudo ./fibhashsnoop PID COMM SADDR DADDR HASH 3882 telnet 00000000:0 4a7d8363:23 20767294 3882 telnet 0a00020f:0 4a7d8363:23 736f1ef2 3882 telnet 0a00020f:56546 4a7d8363:23 396252f9 3887 telnet 00000000:0 4a7d8363:23 20767294 3887 telnet 0a00020f:0 4a7d8363:23 736f1ef2 3887 telnet 0a00020f:56548 4a7d8363:23 34d6e578 3892 telnet 00000000:0 4a7d8363:23 20767294 3892 telnet 0a00020f:0 4a7d8363:23 736f1ef2 3892 telnet 0a00020f:56550 4a7d8363:23 7d96dbcf 3901 telnet 00000000:0 4a7d8363:23 20767294 3901 telnet 0a00020f:0 4a7d8363:23 736f1ef2 3901 telnet 0a00020f:56552 4a7d8363:23 783155e1 3906 telnet 00000000:0 4a7d8363:23 20767294 3906 telnet 0a00020f:0 4a7d8363:23 736f1ef2 3906 telnet 0a00020f:56554 4a7d8363:23 33cb2d99 ^Cbor@tw:~> All numbers are hex (I am lazy). So it appears kernel calls routing code several times, assuming the last one (with actual port numbers) determines the final route - two consecutive invocations select the same gateway. So in the worst case you may have bad luck. Max hash value ix 0x7ffffff, with equal weights each gateway gets half of all values, i.e. hash below 0x3ffffff selects one gateway, above - another gateway. So in the worst case all your traffic is indeed hashed to one gateway only.
Anyway, resulting hashes seem to be always the same. I am afraid I'm not as deep into kernel routing code to make any useful comment here.
Still true :) In particular I have no idea why routing decision is apparently performed three times. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org