9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] HTTP forwarding with aux/trampoline
@ 2009-09-26 18:12 Akshat Kumar
  2009-09-27 17:22 ` Russ Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Akshat Kumar @ 2009-09-26 18:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

'httpserver' is a server on a remote connection from
where the following is run:

aux/listen1 tcp!*!80 aux/trampoline tcp!httpserver!442

where httpserver is running httpd that listens on port 442.
All is well, until it comes time for data transfer exceeding
1666 bytes (images and any other file, really). Through
port 80 on the computer running trampoline, apparently
only 1666 bytes of data can be transferred at once, from
httpserver. The transfer just hangs after that. Getting
the same data from httpserver directly, yields no such
problem.


ak



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

* Re: [9fans] HTTP forwarding with aux/trampoline
  2009-09-26 18:12 [9fans] HTTP forwarding with aux/trampoline Akshat Kumar
@ 2009-09-27 17:22 ` Russ Cox
  2009-09-27 20:32   ` Akshat Kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Russ Cox @ 2009-09-27 17:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Saturday, September 26, 2009, Akshat Kumar
<akumar@mail.nanosouffle.net> wrote:
> 'httpserver' is a server on a remote connection from
> where the following is run:
>
> aux/listen1 tcp!*!80 aux/trampoline tcp!httpserver!442

The thing to do is try to break the problem down
so that you can eliminate either the httpserver or listen1.

First, if you are not using hget to fetch the URL in question,
use hget.  That eliminates the browser.

Second, if you run

aux/listen1 tcp!*!80 rc -c 'sleep 1; cat /lib/words'

can you use con -l tcp!yourserver!80 to get all of /lib/words?

Third, if you run hget on the machine where you normally
run listen1, can you fetch the page normally?

I think Erik is right that you have MTU problems.  I think that
either the connection from 442 to listen1 or the connection
from listen1 to your client machine has its device MTU set
larger than some intermediate piece of network hardware
allows, so that once the packets get too big they just start
dropping on the floor, and for some reason the ICMP packets
you'd need to do path MTU discovery on that connection are
not getting through either.  But you need to isolate the
problem with a simpler test case first.

Russ


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

* Re: [9fans] HTTP forwarding with aux/trampoline
  2009-09-27 17:22 ` Russ Cox
@ 2009-09-27 20:32   ` Akshat Kumar
  0 siblings, 0 replies; 7+ messages in thread
From: Akshat Kumar @ 2009-09-27 20:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> First, if you are not using hget to fetch the URL in question,
> use hget.  That eliminates the browser.

I've tried with wget in the httpserver network. That's how I
got the 1666 bytes value.

> Second, if you run
>
> aux/listen1 tcp!*!80 rc -c 'sleep 1; cat /lib/words'
>
> can you use con -l tcp!yourserver!80 to get all of /lib/words?

No. I ran further test cases, and the outcome was that I get
all the data from:

aux/listen1 tcp!*!80 rc -c 'sleep 1; sed 170q /lib/words'

(and any amount of lines less than 170, from /lib/words)
but I get *no* output (using con(1) from outside the network)
with:

aux/listen1 tcp!*!80 rc -c 'sleep 1; sed 171q /lib/words'

(that is, the con(1) connection just waits and waits). With that
threshold, I found:

--rw-rw-r-- M 9714 akumar akumar 1447 Sep 27 12:52 tmp/170words
--rw-rw-r-- M 9714 akumar akumar 1454 Sep 27 12:53 tmp/171words

> Third, if you run hget on the machine where you normally
> run listen1, can you fetch the page normally?

I can get all of the data normally, *from* the httpserver, using
hget on the computer running listen1.

> I think Erik is right that you have MTU problems.  I think that
> either the connection from 442 to listen1 or the connection
> from listen1 to your client machine has its device MTU set
> larger than some intermediate piece of network hardware
> allows, so that once the packets get too big they just start
> dropping on the floor, and for some reason the ICMP packets
> you'd need to do path MTU discovery on that connection are
> not getting through either.  But you need to isolate the
> problem with a simpler test case first.

With the above test case of the first 171 lines of /lib/words,
I tried `{echo mtu 1492 > /n/ipifc/0/ctl}, as well as other MTU
settings (the default being 1514), but with none of them could
I send all (well, I didn't get *any* output from con(1), so I don't
think partial data was being sent either?) of the data out of the
network (it worked fine on the machine running listen1, itself,
of course).


Thanks,
ak



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

* Re: [9fans] HTTP forwarding with aux/trampoline
  2009-09-27 20:56 ` erik quanstrom
@ 2009-09-28  0:52   ` Russ Cox
  0 siblings, 0 replies; 7+ messages in thread
From: Russ Cox @ 2009-09-28  0:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> why didn't you set the mtu to 1454?

better, set it to 1000.
and remember that you have to set it on
the machine doing the transmitting,
i.e. the machine running aux/listen1.

russ


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

* Re: [9fans] HTTP forwarding with aux/trampoline
       [not found] <<fe41879c0909271332hb322102nfb75dc7bffd0208@mail.gmail.com>
@ 2009-09-27 20:56 ` erik quanstrom
  2009-09-28  0:52   ` Russ Cox
  0 siblings, 1 reply; 7+ messages in thread
From: erik quanstrom @ 2009-09-27 20:56 UTC (permalink / raw)
  To: 9fans

> aux/listen1 tcp!*!80 rc -c 'sleep 1; cat /lib/words'
what's the sleep for?

> (that is, the con(1) connection just waits and waits). With that
> threshold, I found:
>
> --rw-rw-r-- M 9714 akumar akumar 1447 Sep 27 12:52 tmp/170words
> --rw-rw-r-- M 9714 akumar akumar 1454 Sep 27 12:53 tmp/171words
>
> > Third, if you run hget on the machine where you normally
> > run listen1, can you fetch the page normally?
>
> I can get all of the data normally, *from* the httpserver, using
> hget on the computer running listen1.
[...]
> With the above test case of the first 171 lines of /lib/words,
> I tried `{echo mtu 1492 > /n/ipifc/0/ctl}, as well as other MTU
> settings (the default being 1514), but with none of them could
> I send all (well, I didn't get *any* output from con(1), so I don't
> think partial data was being sent either?) of the data out of the
> network (it worked fine on the machine running listen1, itself,
> of course).

why didn't you set the mtu to 1454?  you're setting the mtu on
the external interface, right?  if you set the mtu on the wrong
interface, the machine running trampoline will buffer and
refragment for the new mtu.

you could also use ip/ping -s $n to do a search for an acceptable
mtu.

- erik



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

* Re: [9fans] HTTP forwarding with aux/trampoline
  2009-09-27  0:32 ` erik quanstrom
@ 2009-09-27  2:24   ` Lyndon Nerenberg - VE6BBM/VE7TFX
  0 siblings, 0 replies; 7+ messages in thread
From: Lyndon Nerenberg - VE6BBM/VE7TFX @ 2009-09-27  2:24 UTC (permalink / raw)
  To: 9fans

> is t possible that the path mtu is < 1500 bytes?  if
> so, trampoline isn't going to forward icmp messages.

Trampoline just copies the sequence of data bytes.  It doesn't know
anything about IP or ICMP datagrams.




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

* Re: [9fans] HTTP forwarding with aux/trampoline
       [not found] <<fe41879c0909261112td0ee5e9s27959535cc94cbbd@mail.gmail.com>
@ 2009-09-27  0:32 ` erik quanstrom
  2009-09-27  2:24   ` Lyndon Nerenberg - VE6BBM/VE7TFX
  0 siblings, 1 reply; 7+ messages in thread
From: erik quanstrom @ 2009-09-27  0:32 UTC (permalink / raw)
  To: 9fans

On Sat Sep 26 14:14:16 EDT 2009, akumar@mail.nanosouffle.net wrote:
> 'httpserver' is a server on a remote connection from
> where the following is run:
>
> aux/listen1 tcp!*!80 aux/trampoline tcp!httpserver!442
>
> where httpserver is running httpd that listens on port 442.
> All is well, until it comes time for data transfer exceeding
> 1666 bytes (images and any other file, really). Through
> port 80 on the computer running trampoline, apparently
> only 1666 bytes of data can be transferred at once, from
> httpserver. The transfer just hangs after that. Getting
> the same data from httpserver directly, yields no such
> problem.

is t possible that the path mtu is < 1500 bytes?  if
so, trampoline isn't going to forward icmp messages.

- erik



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

end of thread, other threads:[~2009-09-28  0:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-26 18:12 [9fans] HTTP forwarding with aux/trampoline Akshat Kumar
2009-09-27 17:22 ` Russ Cox
2009-09-27 20:32   ` Akshat Kumar
     [not found] <<fe41879c0909261112td0ee5e9s27959535cc94cbbd@mail.gmail.com>
2009-09-27  0:32 ` erik quanstrom
2009-09-27  2:24   ` Lyndon Nerenberg - VE6BBM/VE7TFX
     [not found] <<fe41879c0909271332hb322102nfb75dc7bffd0208@mail.gmail.com>
2009-09-27 20:56 ` erik quanstrom
2009-09-28  0:52   ` Russ Cox

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).