From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net Date: Sun, 9 Jan 2011 01:31:42 +0100 From: cinap_lenrek@gmx.de In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-amiclliquecajbegzvrfpnbgll" Subject: Re: [9fans] Streaming 9P is out Topicbox-Message-UUID: 923b045e-ead6-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-amiclliquecajbegzvrfpnbgll Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit the use of tcp to get flow control is an interesting idea. some remaks: the client only gets the dial string of a new tcp connection. an attacker could guess the port numbers and take over the stream. or the client might be delayed before it makes the dial() causing it to get the wrong stream or some other random tcp connection at the same port. the initial 9p channel might be encrypted (common when you use cpu), but the stream data excapes as cleartext... compromising security. on the implementation, the server might give the wrong ip address (because he is behind some nat gateway) causing the dial to fail. i think the stream() call should fallback to the original filedescriptor then. why do we pass the offset and mode in the pstream syscall? devmnt should know the current offset and mode from the Chan structure right? i think you could simplify the userspace interface a little bit further. for example, i see no use for the Stream structure and sread/swrite as they never fall back on the old filedescriptor and all the decisions are already made in the stream() call (except the isread check). what about this: newfd = stream(oldfd, ....); int stream(int fd, vlong offset, char isread) { for(;;){ char addr[Maxstring]; int r; if((r = pstream(fd, addr, offset, isread)) < 0) break; if(addr[0] == 0) break; if((r = dial(addr, 0, 0, 0)) < 0) break; return r; } /* server doesnt support Tstream */ if((fd = dup(fd, -1)) >= 0) seek(fd, offset, 0); return fd; } -- cinap --upas-amiclliquecajbegzvrfpnbgll Content-Type: message/rfc822 Content-Disposition: inline Return-Path: <9fans-bounces@9fans.net> Delivered-To: GMX delivery to cinap_lenrek@gmx.de Received: (qmail invoked by alias); 08 Jan 2011 07:25:52 -0000 Received: from mail.9fans.net (EHLO mail.9fans.net) [67.207.142.3] by mx0.gmx.net (mx004) with SMTP; 08 Jan 2011 08:25:52 +0100 Received: from localhost ([127.0.0.1] helo=[67.207.142.3]) by mail.9fans.net with esmtp (Exim 4.71) (envelope-from <9fans-bounces@9fans.net>) id 1PbTCD-0000n1-HY; Sat, 08 Jan 2011 07:26:41 +0000 Received: from mail-bw0-f49.google.com ([209.85.214.49]) by mail.9fans.net with esmtp (Exim 4.71) (envelope-from ) id 1PbTCB-0000mw-23 for 9fans@9fans.net; Sat, 08 Jan 2011 07:26:39 +0000 Received: by bwz5 with SMTP id 5so18165764bwz.36 for <9fans@9fans.net>; Fri, 07 Jan 2011 23:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=Q0O9vkKXS0sx/o0BcQ8OHDFM/LUg8s+ViT206eHyVCw=; b=qixBU4IfEBLzkFzk05EnFc3a0QLhM/QQOVxhw/tbEF+/tyLul92CYUC9MeQMoeaCoQ i/rc1Er3TZegyh46Rb5E9akW59SZgCaoWWVEkFrVM1RPCWiB54ON5k0/2rbU9GNSpYnl 1Y3MEBpr4fNToG2Olw9yJvpOE/8RsMkYf+dM4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kYuYcE34PNhJwNyrqVKX5c/gjYcBoDMAfDzUKl8wim6B6/RCr3tkDOyu/pSex96N8D 5M8fsqb1Or5qPq0HLQ3GioVJTNRfACrxXCCO1v2F++1Kg2g8d4lvbUP1J5fnPmzNM/iA X7l/oVGcQaxAU7kV4sa+YPmSXO+J1s1Q58l+s= MIME-Version: 1.0 Received: by 10.204.102.146 with SMTP id g18mr12657883bko.163.1294471477950; Fri, 07 Jan 2011 23:24:37 -0800 (PST) Received: by 10.204.232.71 with HTTP; Fri, 7 Jan 2011 23:24:37 -0800 (PST) Date: Fri, 7 Jan 2011 23:24:37 -0800 Message-ID: From: John Floren To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: [9fans] Streaming 9P is out X-BeenThere: 9fans@9fans.net X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.9fans.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces@9fans.net Errors-To: 9fans-bounces@9fans.net X-GMX-Antivirus: 0 (no virus found) X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4WX0t+AtsdW7Rkpq2CocXbjmEjLnML/Jh/D5PE3azF+tWbav9NfRPdBjN7A hu2kMqFTMtXwLrawGj72VauG7H+vnQAR+OuQR9OR0XCVwaIInzy4fEfJqoaNwHPgkYGDpJSbT4Wu eSUcQ==V1; Ok, now that the thesis is signed, I feel ready to release my work on streaming for 9P, as outlined in my talk at IWP9; things have changed a lot since that talk, but the general idea remains the same. The repository at https://bitbucket.org/floren/tstream/ contains my code and the thesis documents. I used divergefs to keep my root clean, so that's what's distributed--use divergefs to mount the sys/ in my repo over the /sys on your fs, and you'll probably also want to set up a /386 divergefs mount too. I forgot to add my modified cp, and I'd add it but I'm on a bad wifi connection that seems to be giving hg a bad time. There is a modified exportfs in /sys/src/cmd/exportfs, and really it's not that hard to modify user programs like cp to do streaming, it's all explained in the thesis document. When I get a better connection I'll add the streaming cp to the repo anyway. Anyway, it's far from perfect, but any comments, patches, or suggestions are appreciated. John --upas-amiclliquecajbegzvrfpnbgll--