Date: Mon, 30 Dec 2013 20:03:08 -0800 From: Oleg Moskalenko <mom040267@gmail.com> To: Sepherosa Ziehau <sepherosa@gmail.com> Cc: FreeBSD Net <freebsd-net@freebsd.org> Subject: Re: Question about the "connected" UDP sockets Message-ID: <BD5668BD-8285-45AB-88C7-AEA475A69731@gmail.com> In-Reply-To: <CAMOc5cyhSB1Y24ajEJuKTdWE60-A4aVZrF3pSa0enB2DJCWNuw@mail.gmail.com> References: <CALDtMrL32%2BYdhCH2s2SPG31MOS4j9XXFXNsrei80e=k98ApUAA@mail.gmail.com> <CAMOc5cyhSB1Y24ajEJuKTdWE60-A4aVZrF3pSa0enB2DJCWNuw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks a lot ! Oleg Sent from my iPhone On Dec 30, 2013, at 7:38 PM, Sepherosa Ziehau <sepherosa@gmail.com> wrote: > On Fri, Dec 27, 2013 at 1:49 AM, Oleg Moskalenko <mom040267@gmail.com> wro= te: >> Hi >>=20 >> I cannot find the information about the implementation details of the >> "connected" UDP sockets in FreeBSD. I know that in older Linux kernels al= l >=20 >=20 > You could start from sys/netinet/udp_usrreq.c:udp_connect(). >=20 >=20 >> 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 o= f >> sockets to find the proper destination. >>=20 >> 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} ? >=20 >=20 > UDP uses its own hash table for "connected" sockets (inpcb actually). > The "connected" inpcbs are hashed using lport/fport/laddr/faddr > (4-tuple). >=20 > Best Regards, > sephe
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BD5668BD-8285-45AB-88C7-AEA475A69731>