TOS byte for bulk transfers

Catalin Patulea cat at vv.carleton.ca
Sun Nov 24 07:23:12 WST 2013


On Sat, Nov 23, 2013 at 4:26 PM, Dave Taht <dave.taht at gmail.com> wrote:
> While obsolete (don't use it!) , wondershaper was the root of all
> these systems a decade ago, and is a lot easier to study and
> understand than these successors.
Thanks for the pointers. Indeed, I use a simplified variant of
wondershaper at my gateway. TBF at the root to take control of the
queue, PRIO to respect the TOS byte, then FIFO in the low latency band
(I want it to starve anything else - which is exactly what happened),
fq_codel in the rest. In a sense, my gateway worked exactly as
intended - it's just that the application layer was giving it mixed
signals.

I guess the direction I'm trying to go is patching dropbear in some
way to cooperate better with this sort of shaping. In a way, I'm
asking, "Matt, what kind of patch would you accept here?"

Another idea that occurred to me offline (I swear, I only later
checked what OpenSSH does) would be to key off things like PTY
requests. Most likely those sessions are interactive, while others
that request a subsystem or no PTY are probably bulk.

In fact this is one of the main things OpenSSH does. There's two sides
to the story, so let me start client first:

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/clientloop.c?rev=1.256
In client_session2_setup():
-> packet_set_interactive(want_tty, ...)

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ssh.c?rev=1.393
In ssh_session():
-> packet_set_interactive(interactive /* = request_pty_succeeded ||
x11_forwarding */,)

In ssh_session2_setup()
-> packet_set_interactive(interactive /* = similar logic as ssh_session */)

and now server:

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/session.c?rev=1.268
In do_exec_no_pty():
-> packet_set_interactive(s->display != NULL, ...);
// Haven't verified where s->display comes from, but I get it amounts
to "x11 forwarding is enabled".

In do_exec_pty():
-> packet_set_interactive(1, ...);

packet_set_interactive just ends up doing setsockopt.

So there is precedent for doing a bit of cleverness at the application
layer to help the network layer.

For myself, just keying off pty requests would have been enough to
trigger the correct whole-system behaviour.

Matt, would you accept a patch that keys the TOS setting off PTY requests?


More information about the Dropbear mailing list