Zbr's days.
March
Sun Mon Tue Wed Thu Fri Sat
       
22
2007
Months
Mar

About TODO Blog RSS Old blog Projects Gallery Notes

Thu, 22 Mar 2007

Kernel with multidimensional trie instead of socket tables boots!


Single trie is created for the following protocols:

  • IP (AF_INET) sockets
    • TCP established sockets
    • TCP listen sockets
    • TCP timewait sockets
    • RAW sockets
    • UDP sockets
  • Unix domain sockets
  • Netlink sockets
Lookup methods as long as insertion/deletion ones differ only in key setup part, although insert/delete methods perform some additional per-protocl steps (like cleaning private areas in netlink).

Patch itself contains horrible ifdefs and hacks, but it works (somehow) - my system boots and I can log in over ssh and run tcpdump, although it crashes when I connect from that host.
I think it is a win.

I'm cooking up a patch, which will be sent to netdev@ in a couple of moments, with link to trie design and userspace tests.
If (and only if) network developers will decide that idea worth implementation, I Will proceed and clean things up (and change tons and tons of code all over the place).

/devel/networking :: Link / Comments (0)


Multidimensional trie implementation for Linux sockets.


Ok, I've implemented Unix domain sockets (both bound and private namespace), but kernel still does not boot - udevd does not create appropriate device nodes in /dev, since it never receives any single netlink message - just because I broke netlink broadcasting.
Netlink sockets were hashed y pid and protocol values, but they were also placed into additional per-protocol broadcast lists (mc_list). Since I removed appropriate entry from socket structure, I need to remove appropriate list from netlink table, so right now broadcasting does not work.
I need to think how to implement netlink broadcasting correctly without changes in the socket structure.

Upd: I need to return one liststructure back to implement correct traversal of all sockets - for example for /proc and netlink statistics, I of course can use the same approach current code does - for example TCP statistics code runs over the whole hash table and gets info about each entry, so I can run over all trie too, but I do not like such approach, so I will return one hlist_node in sock_common structure (or will use list_head, which is simple to operate), which will form a list of all sockets for given protocol. Netlink in turn will has per-protocol lists to implement broadcasting.

/devel/networking :: Link / Comments (0)