Subject: Re: Other Socket Tunnels (Was: New draft Possibilities)

From: "Sara Golemon" <[email-masked]>
Date: Wed, 31 Aug 2005 10:00:07 -0700

> I was just wondering if there has ever been any
> thought put to making a draft of a UDP tunnel like the
> TCP forwarding function.
>
I was tossing this idea along with unix domain sockets/windows named pipes 
and thought it might make more sense to define a generic "socket tunnel" 
session or subsystem.  Something like:

   byte      SSH_MSG_CHANNEL_OPEN
   string    "direct-socket"
   string    socket type name (e.g. "udp","unix","named-pipe")
   uint32    sender channel
   uint32    initial window size
   uint32    maximum packet size
   ...          socket type specific data

"udp" (might as well support "tcp" as well for completeness)
   string    host to connect
   uint32    port to connect
   string    originator IP address
   uint32    originator port

"unix"
  string     path to socket
  bool      datagram    (Never seen a use for AF_UNIX/SOCK_DGRAM personally 
but it is possible...)

"named-pipe"
  string     hostname
  string     pipename
  uint32    flags

Obviously still issues to work out with connection based vs. connectionless 
and reliability etc...  But at the very least, the "unix"(SOCK_STREAM 
version) and "named-pipe" sockets could prove useful.

-Sara

---

From: Jeffrey Hutzelman <[email-masked]>
Date: Wed, 31 Aug 2005 13:31:21 -0400

On Wednesday, August 31, 2005 10:00:07 -0700 Sara Golemon 
<[email-masked]> wrote:

> I was tossing this idea along with unix domain sockets/windows named
> pipes and thought it might make more sense to define a generic "socket
> tunnel" session or subsystem.  Something like:

I think something along these lines is a good idea.

If you want to support forwarding in the reverse direction, you also need a 
generalized request for the server to listen on whatever sort of resource, 
and forward the connection back.

>   bool      datagram    (Never seen a use for AF_UNIX/SOCK_DGRAM
> personally but it is possible...)

I'm pretty sure I have; I just can't remember what offhand.

-- Jeffrey T. Hutzelman (N3NHS) <[email-masked]>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA

---

From: der Mouse <[email-masked]>
Date: Wed, 31 Aug 2005 13:57:48 -0400 (EDT)

> I'm pretty sure I have; I just can't remember what offhand.

Doing "fstat | egrep 'unix dgram'", I see syslog, plus a bunch of stuff
of my own (most of my code using such sockets uses them to transfer
file descriptors between processes at run time with SCM_RIGHTS, though
there are exceptions).

Whether there is value in forwarding AF_LOCAL sockets is questionable.
Such forwarding will necessarily break certain facilities which some
users of AF_LOCAL assume will work, such as SCM_CREDS, and I don't
think it's unreasonable for code using AF_LOCAL sockets to blindly
assume that both ends are running on the same machine (and thus, for
example, agree on the size and byte order of ints)....

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       [email-masked]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B