Bug 1604 - SCTP support for openssh
Summary: SCTP support for openssh
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 5.2p1
Hardware: All Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
: 2016 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-10 00:38 AEST by jchadima
Modified: 2021-08-21 03:34 AEST (History)
15 users (show)

See Also:


Attachments
patch which solves the problem (8.50 KB, patch)
2009-06-10 00:38 AEST, jchadima
no flags Details | Diff
openssh-6.8_p1-sctp.patch (23.69 KB, patch)
2015-03-19 12:28 AEDT, Mike Frysinger
no flags Details | Diff
openssh-6.8_p1-sctp.patch (25.53 KB, patch)
2015-03-20 11:55 AEDT, Mike Frysinger
no flags Details | Diff
openssh-8.1-0248ec7c763dee9ff730a589e3d166eac5c74d7c.patch (25.36 KB, text/plain)
2020-01-02 17:18 AEDT, Mike Frysinger
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jchadima 2009-06-10 00:38:40 AEST
Created attachment 1646 [details]
patch which solves the problem

SCTP is network protocol similar to TCP. Openssh traffic can be transmited by SCTP instead of TCP.
Comment 1 Maciej Żenczykowski 2009-06-19 04:36:58 AEST
(outside observer)

While I agree that getting SCTP support for SSH would be real nice.  The presented patch merely uses SCTP in (what is effectively) TCP emulation mode.

SCTP offers a lot of features that mesh well with ssh, ie.:
 - seperate channels for stdin/stdout/stderr, for every port forward, for authentication agents, X forwarding, etc.
 - the ability to monitor IP addresses available on the machine the client or server is running on and add these to the existing connection
 - others?

I realize of course that implementing all these 'features' would be a *lot* more work than simply using TCP emulation mode.  However if we start off with TCP emulation mode won't we than have to support it for ever more - wouldn't it make sense to start of with a _real_ implementation?  Is there a benefit to supporting ssh over sctp in tcp emulation mode?  Won't performance be pretty much identical to using tcp?

(really just food for thought...)
Comment 2 jchadima 2009-06-19 07:06:51 AEST
The main benefit from using SCTP is access to non TCP accessible sites. Or blocked by firewalls or connected via pure SCTP network.
Comment 3 Maciej Żenczykowski 2009-06-19 08:10:58 AEST
> The main benefit from using SCTP is access to non TCP accessible sites.
> Or blocked by firewalls or connected via pure SCTP network.

SCTP is not a new protocol the likes of ipv6, as such I'm not quite sure what you mean by a pure SCTP network.  The only reasonable case of a pure SCTP network I can think of is in a test lab, where UDP & TCP have been blocked to promote SCTP.

If a firewall is really restrictive enough to block ssh/tcp traffic then it will probably also block unknown protocols (ie. sctp) anyway - or it will implement the same policy for ssh/sctp as for ssh/tcp.  Thus switching ssh from tcp to sctp will rarely help avoid the firewall.

Since using SCTP requires both SCTP capable client ssh and server sshd binaries, with sctp access enabled, I fail to see how in all but very very rare cases this is an easier solution than getting a tcp port opened.

(I've actually run sshd/ssh over sctp with an ld_preload tcp->sctp converter, and I'm mostly commenting here out of curiosity, since I'd really like to see a real ssh over sctp implementation)
Comment 4 jchadima 2009-06-22 02:50:57 AEST
a) many "firewals" are not so restrictive, so unknown => pass
b) this is the first try of SCTP. If success there are other goals as QoS requirements.
Comment 5 Maciej Żenczykowski 2009-06-22 05:08:59 AEST
OK, I guess I'm just hoping that this doesn't prevent a full-fledged implementation later on due to the need to maintain backward compatibility.
Comment 6 jchadima 2009-06-22 16:49:31 AEST
I think that this is a basis of it. This patch brings a possibility to play with other SCTP features.
Comment 7 Samuel Thibault 2010-02-10 04:02:32 AEDT
What I need most is roaming between IP addresses, when e.g. switching
between various wired and wireless networks.
Comment 8 Mark van Cuijk 2010-02-11 07:01:27 AEDT
I'm interested in exploring the options for the SSH protocol to make use of the multi-streaming capability of SCTP as a Master thesis.

As part of the project I'd like to explore several methods of mapping logical channels in the Connection Protocol to individual streams in SCTP, research the possible effect on confidentiality and integrity of these choices and implement at least on of the methods in OpenSSH.
Comment 9 Mike Frysinger 2015-03-19 12:27:44 AEDT
*** Bug 2016 has been marked as a duplicate of this bug. ***
Comment 10 Mike Frysinger 2015-03-19 12:28:32 AEDT
Created attachment 2572 [details]
openssh-6.8_p1-sctp.patch

more complete patch for 6.8p1 ported from bug 2016
Comment 11 Bert Wesarg 2015-03-19 17:44:21 AEDT
--- a/readconf.c
+++ b/readconf.c
@@ -130,6 +130,9 @@ typedef enum {
 	oPasswordAuthentication, oRSAAuthentication,
 	oChallengeResponseAuthentication, oXAuthLocation,
 	oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
+#ifdef SCTP
+	oTransport,
+#endif
 	oUser, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
 	oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
 	oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
@@ -198,6 +201,9 @@ static struct {
 	{ "hostname", oHostName },
 	{ "hostkeyalias", oHostKeyAlias },
 	{ "proxycommand", oProxyCommand },
+#ifdef SCTP
+	{ "transport", oTransport },
+#endif
 	{ "port", oPort },
 	{ "cipher", oCipher },
 	{ "ciphers", oCiphers },

The common way to add conditional options is:

#ifdef FEATURE
	{ "feature", oFeature },
#else
	{ "feature", oUnsupported },
#endif

and adding the oFeature unconditionally to the OpCodes.
Comment 12 Mike Frysinger 2015-03-20 11:55:04 AEDT
Created attachment 2573 [details]
openssh-6.8_p1-sctp.patch

i've removed some of the #ifdef's in favor of the unsupported option

not sure how to handle the getopt() logic in the main programs short of not supporting it as a short option at all ...
Comment 13 Mike Frysinger 2020-01-02 17:18:25 AEDT
Created attachment 3346 [details]
openssh-8.1-0248ec7c763dee9ff730a589e3d166eac5c74d7c.patch

refreshed patch to latest git tree

i changed the short option behavior so that z is always passed to getopt, but we display an explicit error message that sctp support isn't enabled.  this makes the code simpler, follows the man pages better (which always list the z option), and makes it more obvious to the user what's going on (vs a generic "unknown option" error).