Article delegate-en <_A2994@delegate-en.ML_>
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[delegate-en/2994] [Reference:]  
Re: delegate: mixed up window sizes
Thu, 30 Jun 2005     Yutaka Sato

Hi,

In message  on 06/30/05(21:40:45)
you "Benjamin Schweizer; dsb AG" wrote:
 |> |I've some more results:
 |> |- the banner message get's fragmented on some connections (this is a 
 |> |kernel issue, may be some special socket options?)
 |>
 |>Is it a banner meesage from a FTP server relayed by DeleGate ?
 |>
 |No, It's delegate's welcome message 
 |(src/builtin/mssgs/file/ftp-banner.dhtml).

On what OS are you runging the DeleGate ?
FTP-DeleGate does not change the default socket buffer size of the socket
for control-connection to a client, and it is expected to be large enough
(at least 1Kbytes or more).  So "780 bytes" restriction sounds strange.

For confirmation, I tested FTP-DeleGate with a patch like follows (A).
Observation with tcpdump shows that the window size is 64K and the
openning banner message of 825 bytes are sent at a time (B).
Shrinking the sending socket buffer to 512 bytes generates fragmentation
of the message into two packets, but it is not like to be in usual
environment.

(A)
*** ../delegate9.0.3-pre24/src/ftp.c	Mon Jun 20 13:31:09 2005
--- src/ftp.c	Thu Jun 30 22:22:30 2005
***************
*** 1898,1903 ****
--- 1898,1912 ----
  	buf[rcc] = 0;
  	insert_scode(buf,tc,220);
  
+ /*DEBUG*/{
+ 	int osi,oso,nsi,nso;
+ 	getsockbuf(fileno(tc),&osi,&oso);
+ 	//setsockbuf(fileno(tc),0,512);
+ 	getsockbuf(fileno(tc),&nsi,&nso);
+ 	syslog_ERROR("----- SOCK BUFSIZE i/o = %d/%d -> %d/%d\n",
+ 		osi,oso,nsi,nso);
+ 	fprintf(tc,"220 +++++++++++++++++PADDING+++++++++++++++++++\r\n");
+ }
  	if( !FCF.fc_noxdcCL )
  		fprintf(tc,"%s\r\n",XDC_OPENING_B64);

(B) on MacOSX 10.2
% delegated -P9999 -v SERVER=ftp
06/30 22:20:01.62 [6925] 1+0: ----- SOCK BUFSIZE i/o = 81660/81660 -> 81660/81660

% sudo tcpdump -i lo0 -n port 9999
22:20:01.455767 IP 127.0.0.1.57070 > 127.0.0.1.9999: S 3495804480:3000000000(X)
 win 65535 <mss 16344,nop,wscale 0,nop,nop,timestamp 3545919834 0>
22:20:01.455875 IP 127.0.0.1.9999 > 127.0.0.1.57070: S 1407379014:1000000000(X)
 ack 3495804481 win 65535 <mss 16344,nop,wscale 0,nop,nop,timestamp 3545919834
 3545919834>
22:20:01.455897 IP 127.0.0.1.57070 > 127.0.0.1.9999: . ack 1 win 65535 <nop,
nop,timestamp 3545919834 3545919834>
22:20:01.623465 IP 127.0.0.1.9999 > 127.0.0.1.57070: P 1:826(825) ack 1 win 65535
 <nop,nop,timestamp 3545919834 3545919834>
22:20:01.636488 IP 127.0.0.1.57070 > 127.0.0.1.9999: . ack 826 win 65535 <nop,
nop,timestamp 3545919834 3545919834>
22:20:02.319957 IP 127.0.0.1.57070 > 127.0.0.1.9999: F 1:1(0) ack 826 win 65535
 <nop,nop,timestamp 3545919835 3545919834>
22:20:02.320637 IP 127.0.0.1.9999 > 127.0.0.1.57070: . ack 2 win 65535 <nop,
nop,timestamp 3545919835 3545919835>
22:20:02.334916 IP 127.0.0.1.9999 > 127.0.0.1.57070: F 826:826(0) ack 2 win 65535
 <nop,nop,timestamp 3545919835 3545919835>
22:20:02.335064 IP 127.0.0.1.57070 > 127.0.0.1.9999: . ack 827 win 65535 <nop,
nop,timestamp 3545919835 3545919835>


(C)
06/30 22:18:16.89 [6829] 1+0: ----- SOCK BUFSIZE i/o = 81660/81660 -> 81660/512
...
22:18:16.700843 IP 127.0.0.1.57033 > 127.0.0.1.9999: S 3061634483:3000000000(X)
 win 65535 <mss 16344,nop,wscale 0,nop,nop,timestamp 3545919624 0>
22:18:16.700946 IP 127.0.0.1.9999 > 127.0.0.1.57033: S 2575199424:2000000000(X)
 ack 3061634484 win 65535 <mss 16344,nop,wscale 0,nop,nop,timestamp 3545919624
 3545919624>
22:18:16.700967 IP 127.0.0.1.57033 > 127.0.0.1.9999: . ack 1 win 65535 <nop,
nop,timestamp 3545919624 3545919624>
22:18:16.893615 IP 127.0.0.1.9999 > 127.0.0.1.57033: P 1:513(512) ack 1 win 65535
 <nop,nop,timestamp 3545919624 3545919624>
22:18:17.012534 IP 127.0.0.1.57033 > 127.0.0.1.9999: . ack 513 win 65535 <nop,
nop,timestamp 3545919625 3545919624>
22:18:17.028552 IP 127.0.0.1.9999 > 127.0.0.1.57033: P 513:826(313) ack 1 win
 65535 <nop,nop,timestamp 3545919625 3545919625>
22:18:17.212695 IP 127.0.0.1.57033 > 127.0.0.1.9999: . ack 826 win 65535 <nop,
nop,timestamp 3545919625 3545919625>
22:18:17.671928 IP 127.0.0.1.57033 > 127.0.0.1.9999: F 1:1(0) ack 826 win 65535
 <nop,nop,timestamp 3545919626 3545919625>
22:18:17.672679 IP 127.0.0.1.9999 > 127.0.0.1.57033: . ack 2 win 65535 <nop,
nop,timestamp 3545919626 3545919626>
22:18:17.684142 IP 127.0.0.1.9999 > 127.0.0.1.57033: F 826:826(0) ack 2 win 65535
 <nop,nop,timestamp 3545919626 3545919626>
22:18:17.684261 IP 127.0.0.1.57033 > 127.0.0.1.9999: . ack 827 win 65535 <nop,
nop,timestamp 3545919626 3545919626>



 |As I've mentioned before, I'm not sure what the bug is. Two different 
 |firewalls that reject, a strange socket setup or a slightly different 
 |understanding of the protocol. I'll check this, the next days.

Cheers,
Yutaka
--
  D G   Yutaka Sato http://delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller
  search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V