Question performnace of SSH v1 vs SSH v2

Markus Friedl markus at openbsd.org
Tue Mar 1 04:19:41 EST 2005


On Mon, Feb 28, 2005 at 11:09:26AM -0500, Christopher Rapier wrote:
> bandwidth = (MIN(tcp rwin, SSH2 FC buf))
> 	    ----------------------------
>                       RTT
> 
> Since the effective SSH2 flow control buffer is 64K (its actually 
> defined as 128K but only 1/2 of it is actually used) and most TCP 

well this can be changed.

Index: channels.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/channels.c,v
retrieving revision 1.211
diff -u -r1.211 channels.c
--- channels.c	29 Oct 2004 21:47:15 -0000	1.211
+++ channels.c	27 Nov 2004 14:56:18 -0000
@@ -1518,10 +1518,13 @@
 static int
 channel_check_window(Channel *c)
 {
-	if (c->type == SSH_CHANNEL_OPEN &&
-	    !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) &&
-	    c->local_window < c->local_window_max/2 &&
-	    c->local_consumed > 0) {
+	if (c->type != SSH_CHANNEL_OPEN ||
+	    c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD) ||
+	    c->local_consumed <= 0)
+		return 1;
+	if ((c->local_window_max - c->local_window <
+	    3 * CHAN_SES_PACKET_DEFAULT) ||
+	    c->local_window <  c->local_window_max/2) {
 		packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);
 		packet_put_int(c->remote_id);
 		packet_put_int(c->local_consumed);
Index: channels.h
===================================================================
RCS file: /cvs/src/usr.bin/ssh/channels.h,v
retrieving revision 1.75
diff -u -r1.75 channels.h
--- channels.h	29 Oct 2004 21:47:15 -0000	1.75
+++ channels.h	27 Nov 2004 14:55:27 -0000
@@ -118,7 +118,7 @@
 
 /* default window/packet sizes for tcp/x11-fwd-channel */
 #define CHAN_SES_PACKET_DEFAULT	(32*1024)
-#define CHAN_SES_WINDOW_DEFAULT	(4*CHAN_SES_PACKET_DEFAULT)
+#define CHAN_SES_WINDOW_DEFAULT	(40*CHAN_SES_PACKET_DEFAULT)
 #define CHAN_TCP_PACKET_DEFAULT	(32*1024)
 #define CHAN_TCP_WINDOW_DEFAULT	(4*CHAN_TCP_PACKET_DEFAULT)
 #define CHAN_X11_PACKET_DEFAULT	(16*1024)




More information about the openssh-unix-dev mailing list