Date: Tue, 31 Dec 2013 11:38:56 +0800 From: Sepherosa Ziehau <sepherosa@gmail.com> To: Oleg Moskalenko <mom040267@gmail.com> Cc: FreeBSD Net <freebsd-net@freebsd.org> Subject: Re: Question about the "connected" UDP sockets Message-ID: <CAMOc5cyhSB1Y24ajEJuKTdWE60-A4aVZrF3pSa0enB2DJCWNuw@mail.gmail.com> In-Reply-To: <CALDtMrL32%2BYdhCH2s2SPG31MOS4j9XXFXNsrei80e=k98ApUAA@mail.gmail.com> References: <CALDtMrL32%2BYdhCH2s2SPG31MOS4j9XXFXNsrei80e=k98ApUAA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 27, 2013 at 1:49 AM, Oleg Moskalenko <mom040267@gmail.com> wrote: > Hi > > I cannot find the information about the implementation details of the > "connected" UDP sockets in FreeBSD. I know that in older Linux kernels all You could start from sys/netinet/udp_usrreq.c:udp_connect(). > UDP sockets are stored in a hash table - and the remote IP:port are not > used for the hash calculation, so the performance is awful when you have > thousands "connected" UDP sockets on the same local IP:port address. So a > UDP packet incoming to the local address has to go through the long list of > sockets to find the proper destination. > > How it is done in the FreeBSD ? Are the UDP "connected" sockets using a > hash table with key based upon 5-tuple (protocol, remote-ip, remote-port, > local-ip, local-port} ? UDP uses its own hash table for "connected" sockets (inpcb actually). The "connected" inpcbs are hashed using lport/fport/laddr/faddr (4-tuple). Best Regards, sephe
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMOc5cyhSB1Y24ajEJuKTdWE60-A4aVZrF3pSa0enB2DJCWNuw>