9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 9P - Meaning of iounit
@ 2016-10-03 13:52 Chris McGee
  2016-10-03 15:05 ` Richard Miller
  2016-10-03 15:08 ` James A. Robinson
  0 siblings, 2 replies; 6+ messages in thread
From: Chris McGee @ 2016-10-03 13:52 UTC (permalink / raw)
  To: 9fans

Hello All,

I am learning the 9p protocol and implementing a 9P server. After reading the 9p manual page, the types of messages and much of the overview is clear. There are a number of items that are less clear.

For example, it took some time to figure out how to provide a directory structure on a Tread.

Lately, I’m looking at the “iounit.” Initially, I had thought of it as a way to give the size of a file on Topen. After some testing I realized that the network subsystem in plan9 is expecting the iounit to be large enough to write commands into a /net/tcp ctl file. With a small iounit, the network subsystem truncates the commands, such as “connect xyz|1234” to match the size of the iounit.

So, what is this mysterious iounit? Is there another man page or plan9 document that describes it in more detail?

Thanks,
Chris


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] 9P - Meaning of iounit
  2016-10-03 13:52 [9fans] 9P - Meaning of iounit Chris McGee
@ 2016-10-03 15:05 ` Richard Miller
  2016-10-03 22:55   ` Chris McGee
  2016-10-03 15:08 ` James A. Robinson
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Miller @ 2016-10-03 15:05 UTC (permalink / raw)
  To: 9fans

term% lookman iounit
man 2 fcall # fcall(2)
man 2 iounit # iounit(2)
man 3 proc # proc(3)
man 5 0intro # 0intro(5)
man 5 open # open(5)
man 5 read # read(5)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] 9P - Meaning of iounit
  2016-10-03 13:52 [9fans] 9P - Meaning of iounit Chris McGee
  2016-10-03 15:05 ` Richard Miller
@ 2016-10-03 15:08 ` James A. Robinson
  2016-10-03 21:11   ` Jules Merit
  1 sibling, 1 reply; 6+ messages in thread
From: James A. Robinson @ 2016-10-03 15:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]

On Mon, Oct 3, 2016 at 6:54 AM Chris McGee <newton688@gmail.com> wrote:

> Lately, I’m looking at the “iounit.” Initially, I had thought of it as a
> way to give the size of a file on Topen. After some testing I realized that
> the network subsystem in plan9 is expecting the iounit to be large enough
> to write commands into a /net/tcp ctl file. With a small iounit, the
> network subsystem truncates the commands, such as “connect xyz|1234” to
> match the size of the iounit.
>
> So, what is this mysterious iounit? Is there another man page or plan9
> document that describes it in more detail?
>

Given that there are comments like this:

/* ample room for Twrite/Rread header (iounit) */

paired with an old message from Mr. Quanstrom below, I suspect the
value is "as large as your network / disk can manage, but at least as large
as the protocol overhead".  But that's just a WAG.

---------- Forwarded message ---------
From: erik quanstrom <quanstro@quanstro.net>
Date: Sat, Nov 16, 2013 at 6:45 PM
Subject: [9fans] simple gofast trick
To: <9fans@9fans.net>


this is a one-liner.  here's a little demo:

        chula; sed 's:8192:64*1024:g' </sys/src/cmd/cat.c > fatcat.c && tmk
fatcat.c
        6c -FVTw fatcat.c
        6l -o 6.fatcat fatcat.6
        chula; cat /bin/gs>/dev/null;for(i in cat 6.fatcat)time $i /bin/gs
> /dev/null
        0.00u 0.01s 0.41r        cat /bin/gs
        0.00u 0.00s 0.23r        6.fatcat /bin/gs

the trick is only to increase IOUNIT to 48k in both file server and cpu
server.

this works since the mtu of the network is 1500 bytes and the Rread messages
are up to 48k + 9p overhead, the network layer has multiple outstanding
messages and overlapping acks at the network layer much of the time, even
though the mount driver continues keeping a single outstanding message
per system call.

- erik

[-- Attachment #2: Type: text/html, Size: 2707 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] 9P - Meaning of iounit
  2016-10-03 15:08 ` James A. Robinson
@ 2016-10-03 21:11   ` Jules Merit
  0 siblings, 0 replies; 6+ messages in thread
From: Jules Merit @ 2016-10-03 21:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]

I agree with Eric*com. Rice rice baby, popo. Don't Tread on my 9p server.

On Mon, Oct 3, 2016 at 8:08 AM, James A. Robinson <jimr@highwire.org> wrote:

> On Mon, Oct 3, 2016 at 6:54 AM Chris McGee <newton688@gmail.com> wrote:
>
>> Lately, I’m looking at the “iounit.” Initially, I had thought of it as a
>> way to give the size of a file on Topen. After some testing I realized that
>> the network subsystem in plan9 is expecting the iounit to be large enough
>> to write commands into a /net/tcp ctl file. With a small iounit, the
>> network subsystem truncates the commands, such as “connect xyz|1234” to
>> match the size of the iounit.
>>
>> So, what is this mysterious iounit? Is there another man page or plan9
>> document that describes it in more detail?
>>
>
> Given that there are comments like this:
>
> /* ample room for Twrite/Rread header (iounit) */
>
> paired with an old message from Mr. Quanstrom below, I suspect the
> value is "as large as your network / disk can manage, but at least as
> large as the protocol overhead".  But that's just a WAG.
>
> ---------- Forwarded message ---------
> From: erik quanstrom <quanstro@quanstro.net>
> Date: Sat, Nov 16, 2013 at 6:45 PM
> Subject: [9fans] simple gofast trick
> To: <9fans@9fans.net>
>
>
> this is a one-liner.  here's a little demo:
>
>         chula; sed 's:8192:64*1024:g' </sys/src/cmd/cat.c > fatcat.c &&
> tmk fatcat.c
>         6c -FVTw fatcat.c
>         6l -o 6.fatcat fatcat.6
>         chula; cat /bin/gs>/dev/null;for(i in cat 6.fatcat)time $i /bin/gs
> > /dev/null
>         0.00u 0.01s 0.41r        cat /bin/gs
>         0.00u 0.00s 0.23r        6.fatcat /bin/gs
>
> the trick is only to increase IOUNIT to 48k in both file server and cpu
> server.
>
> this works since the mtu of the network is 1500 bytes and the Rread
> messages
> are up to 48k + 9p overhead, the network layer has multiple outstanding
> messages and overlapping acks at the network layer much of the time, even
> though the mount driver continues keeping a single outstanding message
> per system call.
>
> - erik
>
>

[-- Attachment #2: Type: text/html, Size: 3289 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] 9P - Meaning of iounit
  2016-10-03 15:05 ` Richard Miller
@ 2016-10-03 22:55   ` Chris McGee
  0 siblings, 0 replies; 6+ messages in thread
From: Chris McGee @ 2016-10-03 22:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks Richard, James,

Chris

> On Oct 3, 2016, at 11:05 AM, Richard Miller <9fans@hamnavoe.com> wrote:
>
> term% lookman iounit
> man 2 fcall # fcall(2)
> man 2 iounit # iounit(2)
> man 3 proc # proc(3)
> man 5 0intro # 0intro(5)
> man 5 open # open(5)
> man 5 read # read(5)
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [9fans] 9p - meaning of iounit
@ 2016-10-03  1:59 Chris McGee
  0 siblings, 0 replies; 6+ messages in thread
From: Chris McGee @ 2016-10-03  1:59 UTC (permalink / raw)


Hello All,

I am learning the 9p protocol and implementing a 9P server. After reading the 9p manual page, the types of messages and much of the overview is clear. There are a number of items that are less clear.

For example, it took some time to figure out how to provide a directory structure on a Tread.

Lately, I?m looking at the ?iounit.? Initially, I had thought of it as a way to give the size of a file on Topen. After some testing I realized that the network subsystem in plan9 is expecting the iounit to be large enough to write commands into a /net/tcp ctl file. With a small iounit, the network subsystem truncates the commands, such as ?connect xyz|1234? to match the size of the iounit.

So, what is this mysterious iounit? Is there another man page or plan9 document that describes it in more detail?

Thanks,
Chris


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-03 22:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-03 13:52 [9fans] 9P - Meaning of iounit Chris McGee
2016-10-03 15:05 ` Richard Miller
2016-10-03 22:55   ` Chris McGee
2016-10-03 15:08 ` James A. Robinson
2016-10-03 21:11   ` Jules Merit
  -- strict thread matches above, loose matches on Subject: below --
2016-10-03  1:59 [9fans] 9p - meaning " Chris McGee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).