Date: Wed, 26 Feb 2025 09:38:20 -0500 From: Cheng Cui <cc@freebsd.org> To: jaeyong yoo <y.jaeyong@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: Sending empty segment upon receiving partial ACK Message-ID: <38B72ADC-B796-4BFC-8F94-2BD6E40C4231@freebsd.org> In-Reply-To: <CANud0THEOnkWbuOn413AV_auSrY7-SysXThrTyigZMxujEdqEg@mail.gmail.com> References: <CANud0THEOnkWbuOn413AV_auSrY7-SysXThrTyigZMxujEdqEg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] > On Feb 18, 2025, at 12:11, jaeyong yoo <y.jaeyong@gmail.com> wrote: > > Hi freebsd-net, > > I am observing somewhat strange pcap behavior. > Scenario: > A --> B > A is the only sender of the data and B is the only receiver. Note that > we use PRR. > When B is sending partial ACKs to A, there are cases when A sends out > just an empty segment with the same sequence number to B. Which seems > to be pure overhead. > > After digging through the code, I think this could be triggered by the > following sequence: > > 1. https://github.com/freebsd/freebsd-src/blob/main/sys/netinet/tcp_input.c#L2892 > during prr-partial ack processing, it calls tcp_output with ACKNOW flag. > > 2.https://github.com/freebsd/freebsd-src/blob/main/sys/netinet/tcp_output.c#L415 > in tcp_output, it determines "len" how much to send and when ACKed > bytes in partial ack is small enough, this "len" becomes zero. > > 3. https://github.com/freebsd/freebsd-src/blob/main/sys/netinet/tcp_output.c#L702 > As the flag is set to "ACKNOW", with zero length, it anyway sends out > a segment with 0 length. > > My question is, is there some check before sending out like checking > if the length is zero? > > > Thanks, > Jaeyong > Hi Jaeyong, The places (1&2) you have looked at are TCP congestion control/loss recovery related principles. It might mean your network was experiencing congestions or packet drops if you checked at the right code. If yes, that was a problem to look at in the first place. If not, the zero length TCP packet is a pure ack, which in different code path has its own purpose. Best Regards, Cheng Cui [-- Attachment #2 --] <html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Feb 18, 2025, at 12:11, jaeyong yoo <y.jaeyong@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div>Hi freebsd-net,<br><br>I am observing somewhat strange pcap behavior.<br>Scenario:<br> A --> B<br>A is the only sender of the data and B is the only receiver. Note that<br>we use PRR.<br>When B is sending partial ACKs to A, there are cases when A sends out<br>just an empty segment with the same sequence number to B. Which seems<br>to be pure overhead.<br><br>After digging through the code, I think this could be triggered by the<br>following sequence:<br><br>1. https://github.com/freebsd/freebsd-src/blob/main/sys/netinet/tcp_input.c#L2892<br>during prr-partial ack processing, it calls tcp_output with ACKNOW flag.<br><br>2.https://github.com/freebsd/freebsd-src/blob/main/sys/netinet/tcp_output.c#L415<br>in tcp_output, it determines "len" how much to send and when ACKed<br>bytes in partial ack is small enough, this "len" becomes zero.<br><br>3. https://github.com/freebsd/freebsd-src/blob/main/sys/netinet/tcp_output.c#L702<br>As the flag is set to "ACKNOW", with zero length, it anyway sends out<br>a segment with 0 length.<br><br>My question is, is there some check before sending out like checking<br>if the length is zero?<br><br><br>Thanks,<br>Jaeyong<br><br></div></div></blockquote><br></div><div>Hi Jaeyong,</div><div><br></div><div>The places (1&2) you have looked at are TCP congestion control/loss recovery</div><div>related principles. It might mean your network was experiencing congestions</div><div>or packet drops if you checked at the right code. If yes, that was a problem to look</div><div>at in the first place.</div><div><br></div><div>If not, the zero length TCP packet is a pure ack, which in different code path has</div><div>its own purpose.</div><br><div> <div>Best Regards,<br>Cheng Cui</div><div><br></div><br class="Apple-interchange-newline"> </div> <br></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38B72ADC-B796-4BFC-8F94-2BD6E40C4231>
