directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sangjin Lee (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRSERVER-2074) small default TCP receive/send buffer size causing TCP packet fragmentation on some platforms
Date Tue, 16 Jun 2015 17:55:01 GMT

    [ https://issues.apache.org/jira/browse/DIRSERVER-2074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14588464#comment-14588464
] 

Sangjin Lee commented on DIRSERVER-2074:
----------------------------------------

Mina's default receive buffer size (as well as the send buffer size) is 1 KB. These values
affect the TCP window size during the TCP handshake, and on some platforms this results in
consistently small TCP window sizes. One example (from the tcpdump):

{noformat}
10:30:32.358645 IP localhost.50199 > localhost.60538: Flags [S], seq 1804572222, win 32792,
options [mss 16396,sackOK,TS val 566449661 ecr 0,nop,wscale 8], length 0
10:30:32.358661 IP localhost.60538 > localhost.50199: Flags [S.], seq 2381946627, ack 1804572223,
win 1140, options [mss 16396,sackOK,TS val 566449661 ecr 566449661,nop,wscale 0], length 0
10:30:32.358672 IP localhost.50199 > localhost.60538: Flags [.], ack 1, win 129, options
[nop,nop,TS val 566449661 ecr 566449661], length 0
10:30:32.358788 IP localhost.50199 > localhost.60538: Flags [.], seq 1:571, ack 1, win
129, options [nop,nop,TS val 566449661 ecr 566449661], length 570
10:30:32.358796 IP localhost.60538 > localhost.50199: Flags [.], ack 571, win 570, options
[nop,nop,TS val 566449661 ecr 566449661], length 0
10:30:32.358801 IP localhost.50199 > localhost.60538: Flags [P.], seq 571:585, ack 1, win
129, options [nop,nop,TS val 566449661 ecr 566449661], length 14
{noformat}

Although the client (50199) starts out with a large window size (32792), the server (KDC server
at port 60538) immediately narrows it to 1140, and the resulting window size comes out to
be 570 bytes. The 1140 bytes the server sets is largely a function of the receive buffer size.
So it's doing a 570-byte packets on a loopback connection!

To me, mina's small default sizes for receive/send buffers strike me as outdated and inadequate.
I see several options for eliminating this unnecessary fragmentation:
# change the default buffer sizes in TcpTransport to use more reasonable values (e.g. 32 KB
or 64 KB)
# at least allow an option to set the default buffer sizes in TcpTransport so users of TcpTransport
can configure the buffer size
# change the default buffer sizes in mina (affects all apps that use mina)

Although I suspect it might be fine to update the default buffer sizes in mina, that would
potentially be a disruptive change as it changes behavior implicitly for everyone. My suggestion
would be doing 1 and 2.

> small default TCP receive/send buffer size causing TCP packet fragmentation on some platforms
> ---------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-2074
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2074
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0-M20
>            Reporter: Sangjin Lee
>
> This is a follow-up on DIRSERVER-2071.
> Currently the default receive/send buffer size of TcpTransport is 1 KB, which is pretty
small. This has an effect of resulting in very small TCP window size and TCP packet fragmentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message