From nobody Wed Sep 18 13:01:16 2024 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X7zLD0TSPz5WLMM for ; Wed, 18 Sep 2024 13:01:24 +0000 (UTC) (envelope-from wds24@mails.tsinghua.edu.cn) Received: from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net [52.237.72.81]) by mx1.freebsd.org (Postfix) with ESMTP id 4X7zLB1Ct0z3yp3 for ; Wed, 18 Sep 2024 13:01:21 +0000 (UTC) (envelope-from wds24@mails.tsinghua.edu.cn) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mails.tsinghua.edu.cn header.s=dkim header.b=oFgjfnYZ; dmarc=pass (policy=none) header.from=mails.tsinghua.edu.cn; spf=pass (mx1.freebsd.org: domain of wds24@mails.tsinghua.edu.cn designates 52.237.72.81 as permitted sender) smtp.mailfrom=wds24@mails.tsinghua.edu.cn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mails.tsinghua.edu.cn; s=dkim; h=Received:Message-ID:Date: MIME-Version:User-Agent:To:From:Subject:Content-Type: Content-Transfer-Encoding; bh=jLjCMXtSZaH5PeMkdz/u7UbcVbQuM+wXgF 6V2b7M8pQ=; b=oFgjfnYZ4JHbRzW9VPKzrcs1WCAjwT5pqBpImuofAcyf+bUMHj kbGgRvyOFhzx5RQQm+ZLu22DVFxGZ+ZjW6nEwyKvvt+CsOGonfIM1/dfIe3lo8nk H5n5ZzGvr7Y7EhtSAAfGunAUd17UDOLMXbXrragXD/R+B7ejFjLhac+lI= Received: from [59.66.20.229] (unknown [59.66.20.229]) by web1 (Coremail) with SMTP id yAQGZQAnHr0dz+pmpcyUAA--.7152S2; Wed, 18 Sep 2024 21:01:17 +0800 (CST) Message-ID: <9a1e0b13-e06f-46aa-8174-4b80eea4473a@mails.tsinghua.edu.cn> Date: Wed, 18 Sep 2024 21:01:16 +0800 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: freebsd-net@freebsd.org From: dashuai wu Subject: Does the UDP socket in FreeBSD actually use a send buffer to store packets like Linux? Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CM-TRANSID:yAQGZQAnHr0dz+pmpcyUAA--.7152S2 X-Coremail-Antispam: 1UD129KBjvdXoW7JFyrKFy3AF4kKw1rAw4DXFb_yoWxCwc_WF Z5KryUtw1UXr47Za4rKFnrWF47Xay8AFyxur1kJayIg348ArW5XFn7ur92vw40gayUtrn8 AFyrXws3Gry0vjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbxxYjsxI4VWxJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2vYz4IE04k24VAvwVAKI4IrM2AIxVAIcxkEcVAq07x2 0xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18Mc Ij6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc2xS Y4AK67AK6ry8MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I 8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUJVWU XwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x 0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_ Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUxa 0PDUUUU X-CM-SenderInfo: hzgvjko6pdxz3vow2x5qjk3toohg3hdfq/1tbiAQEEDWbqluUtEwAAsI X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; DWL_DNSWL_LOW(-1.00)[tsinghua.edu.cn:dkim]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[mails.tsinghua.edu.cn,none]; R_SPF_ALLOW(-0.20)[+a:azure-sdnproxy.icoremail.net]; R_DKIM_ALLOW(-0.20)[mails.tsinghua.edu.cn:s=dkim]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[52.237.72.81:from]; RCVD_NO_TLS_LAST(0.10)[]; XM_UA_NO_VERSION(0.01)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCPT_COUNT_ONE(0.00)[1]; RWL_MAILSPIKE_POSSIBLE(0.00)[52.237.72.81:from]; ASN(0.00)[asn:8075, ipnet:52.224.0.0/11, country:US]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[mails.tsinghua.edu.cn:+] X-Rspamd-Queue-Id: 4X7zLB1Ct0z3yp3 I noticed that FreeBSD does not have kernel parameters for adjusting the send buffer size like Linux does. The parameter kern.ipc.maxsockbuf does not seem to affect UDP sending behavior in this thread(https://forums.freebsd.org/threads/increase-buffer-with-maxsockbuf-for-udp-streaming.75981/). While reading the source code, I found that the UDP socket seems to only use the buffer size to determine if a single message is too large, and it does not track the amount of buffer space already used. So, does the UDP socket in FreeBSD actually have a send buffer like Linux? If yes, where can I find the source code about it? Thanks all for your time. - Dashuai Wu