lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 7 Sep 2010 02:13:46 -0300
From:	ツ Leandro Melo de Sales <leandroal@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org
Subject: Re: TCP packet size and delivery packet decisions

On Tue, Sep 7, 2010 at 1:36 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le mardi 07 septembre 2010 à 01:20 -0300, ツ Leandro Melo de Sales a
> écrit :
>> Hi all,
>>    We are facing a not expected behavior (at least for us) from the
>> TCP stack under Linux. We need to write 78 bytes per writing using
>> write() function. But instead of sending 78 bytes TCP implementation
>> in Linux sends 48 bytes and later 30 bytes. We then started to debug
>> the implementation, but although we got some progress on this, I have
>> decided to ask in this list if someone can anticipate provide me more
>> information why TCP is not sending 78 at once, in addition to have any
>> clarification about if it is possible to force TCP sends 78 bytes in
>> each write() function call.
>>    I have tried many alternatives: set TCP_CORK; used socket API to
>> write a fixed 78 bytes per write() function call; and so forth). Also,
>> I know that TCP is a byte-stream protocol and this decision is made by
>> many different factors, such as cwd size, mss and so forth, but 78
>> bytes is too small to split it in two different packets. Our
>> application works as expected under Windows, it sends 78 bytes at
>> once.
>>
>>    In this way, any comment from the list regarding this issue will be
>> kindly accepted and helpful.
>
>
> Could you send a tcpdump of such session, with say first 10 packets ?
>
>

For this moment, this is all that I have, I can't not use TCPDump
right now, but I think the below information are what you'd like to
have:

Under Linux:

Source              Dest.               Flags
192.168.0.34    192.168.0.70    [SYN] Seq=0 Win=5840 Len=0 MSS=1460
TSV=105155 TSER=0 WS=7
192.168.0.70    192.168.0.34    [SYN, ACK] Seq=0 Ack=1 Win=78 Len=0 MSS=78
192.168.0.34    192.168.0.70    [ACK] Seq=1 Ack=1 Win=5840 Len=0
192.168.0.34    192.168.0.70    [PSH, ACK] Seq=1 Ack=1 Win=5840 Len=48
192.168.0.34    192.168.0.70    [PSH, ACK] Seq=49 Ack=1 Win=5840 Len=30
192.168.0.70    192.168.0.34    [ACK] Seq=1 Ack=49 Win=78 Len=0
192.168.0.70    192.168.0.34    [RST, ACK] Seq=1 Ack=79 Win=78 Len=0

Under Windows:

Source              Dest.               Flags
192.168.0.35    192.168.0.70    [SYN] Seq=0 Win=64240 Len=0 MSS=1460
192.168.0.70    192.168.0.35    [SYN, ACK] Seq=0 Ack=1 Win=78 Len=0 MSS=78
192.168.0.35    192.168.0.70    [ACK] Seq=1 Ack=1 Win=64272 Len=0
192.168.0.35    192.168.0.70    [PSH, ACK] Seq=1 Ack=1 Win=64272 Len=78
192.168.0.70    192.168.0.35    [ACK] Seq=1 Ack=79 Win=78 Len=0
192.168.0.35    192.168.0.70    [PSH, ACK] Seq=79 Ack=1 Win=64272 Len=78
192.168.0.70    192.168.0.35    [ACK] Seq=1 Ack=157 Win=78 Len=0
192.168.0.35    192.168.0.70    [PSH, ACK] Seq=157 Ack=1 Win=64272 Len=78
192.168.0.70    192.168.0.35    [ACK] Seq=1 Ack=235 Win=78 Len=0
192.168.0.35    192.168.0.70    [FIN, ACK] Seq=235 Ack=1 Win=64272 Len=0
192.168.0.70    192.168.0.35    [FIN, ACK] Seq=1 Ack=236 Win=78 Len=0
192.168.0.35    192.168.0.70    [ACK] Seq=236 Ack=2 Win=64272 Len=0

To simplify, below is a very summarized source code used to connect to
the remove server. I have tried to use sendall() function from python
socket API and it does not work either. I have implemented similar
program in C, but nothing new was produced.

==========

import socket
host = '192.168.0.70'
port = 70

hex_CONNECT = "<78 hex bytes -- suppressed>"
hex_COMMAND1 = "<78 hex bytes -- suppressed>"
hex_COMMAND6 = "<78 hex bytes -- suppressed>"

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.setsockopt(socket.SOL_TCP, socket.TCP_CORK, 1)
s.send(unhexlify(hex_CONNECT))
s.send(unhexlify(hex_COMMAND1))
s.send(unhexlify(hex_COMMAND6))
s.close()

==========

Leandro
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ