Networking Forums

Networking Forums > Computer Networking > Linux Networking > TCP kernel hash function

Reply
Thread Tools Display Modes

TCP kernel hash function

 
 
Soohyun Cho
Guest
Posts: n/a

 
      05-30-2004, 08:05 AM
Hi all,

I want to find established TCP connections between same source-destination
hosts regardless of their ports.
While I was looking at Linux TCP kernel source codes I found Linux use hash
tables to find owner socket id of received packets.
This may be good to improve TCP session lookup speed than searching TCP
sockets using doubly linked lists as in BSD.
However if I want to find TCP connections going to the same destination host
I found it is very inefficient because Linux does not maintain linked lists
of socks.
I found sock->pprev or sock->next of struct sock are nothing but itself or
empty.
I needed to search whole possible hash value space to find small set of TCP
connections.
In Linux, this value is tcp_ehash_size and it is 131072. It's huge enough to
degrade TCP performance.
It took too much time to find some TCP socks going to the same hosts.

I couldn't narrow down the lookup speed because tcp_hashfn() generates so
randomly distributed hash numbers rather than grouping them according to
destination ip address.
The hash value could be anything from 0 to 131072..
I think this happens because source port number space is so big.

Is there any way to retrieve this kind of information fast in Linux kernel?
Do I have to insert additional structure to struct sock for this?

I would really appreciate who answer my question.
Thanks,

Soohyun Cho.




 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get data in kernel SEND buffer for a TCP socket from a netfilter based kernel module Rohit Linux Networking 0 05-10-2007 11:27 AM
killing a kernel thread ....... UDP server (kernel module)......... alex Linux Networking 0 09-20-2006 11:26 AM
Regarding MS Mac Address Hash computation Sameer Wireless Internet 0 07-24-2006 10:32 AM
Added some debugging stuff under net/ipv4, I can see the new function in System.map file, I can't see that under /proc/ksyms once I loaded new kernel, why? santa19992000@yahoo.com Linux Networking 0 08-22-2005 03:45 PM
IPSec to Watchguard - failing ISAKMP n/d hash Max Metral Windows Networking 0 09-14-2004 02:08 PM



1 2 3 4 5 6 7 8 9 10 11