Subject: vi lossage is caused by TCP delayed acks
To: None <current-users@NetBSD.ORG>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: current-users
Date: 05/12/1998 12:47:28
Yesterday I complained about vi not recognizing cursor key presses
in -current.
Now I found that the escape sequence sent by the client (cursor
down = ESC O B = 1b 4f 42) is torn apart by a delayed ACK in
the TCP connection. vi's default waiting time for completion of
an escape sequence is 100 ms, so the delay is just enough to
make vi treat the incoming data as separate commands.

For illustration I've appended 2 tcpdump outputs - the first one
to a -current machine, the second one to 1.3.1.

So what's the proper solution? Is there still being worked
on TCP flow control, or should vi's default setting for
"escapetime" (undocumented btw) be increased?

best regards
Matthias


11:31:49.050710 zelux6.1023 > zelz26.login: P 1391425389:1391425390(1)
ack 14716
15277 win 16384
                         4500 0029 09b4 0000 3c06 9543 865e e910
                         865e ea0a 03ff 0201 52ef 776d 57b7 112d
                         5018 4000 3bb2 0000 1b
11:31:49.148360 zelz26.login > zelux6.1023: P 1:2(1) ack 1 win 17520 [tos 0x10]
                         4510 0029 62da 0000 4006 380d 865e ea0a
                         865e e910 0201 03ff 57b7 112d 52ef 776e
                         5018 4470 4b41 0000 0700 0000 0000
11:31:49.152266 zelux6.1023 > zelz26.login: P 1:3(2) ack 2 win 16383
                         4500 002a 09b5 0000 3c06 9541 865e e910
                         865e ea0a 03ff 0201 52ef 776e 57b7 112e
                         5018 3fff 076e 0000 4f42

11:59:09.626938 zelux6.1021 > zel393.login: P 50:51(1) ack 772 win 16384
                         4500 0029 3587 0000 3c06 6941 865e e910
                         865e ea39 03fd 0201 726a 0a32 9e3d a8e9
                         5018 4000 ab02 0000 1b
11:59:09.626939 zel393.login > zelux6.1021: . ack 51 win 17519 [tos 0x10]
                         4510 0028 fa3e 0000 4006 a07a 865e ea39
                         865e e910 0201 03fd 9e3d a8e9 726a 0a33
                         5010 446f c19b 0000 0000 0000 0000
11:59:09.626940 zelux6.1021 > zel393.login: P 51:52(1) ack 772 win 16384
                         4500 0029 3588 0000 3c06 6940 865e e910
                         865e ea39 03fd 0201 726a 0a33 9e3d a8e9
                         5018 4000 7701 0000 4f
11:59:09.626941 zel393.login > zelux6.1021: . ack 52 win 17519 [tos 0x10]
                         4510 0028 fa3f 0000 4006 a079 865e ea39
                         865e e910 0201 03fd 9e3d a8e9 726a 0a34
                         5010 446f c19a 0000 0000 0000 0000
11:59:09.626942 zelux6.1021 > zel393.login: P 52:53(1) ack 772 win 16384
                         4500 0029 3589 0000 3c06 693f 865e e910
                         865e ea39 03fd 0201 726a 0a34 9e3d a8e9
                         5018 4000 8400 0000 42