Mosh (software)
Mosh, showing warning about intermittent network connection and local echoing feature. | |
Original author(s) | Keith Winstein |
---|---|
Initial release | March 12, 2012 |
Stable release | 1.2.4 / March 27, 2013 |
Operating system | Unix-like systems |
Type | Utility software |
License | GNU GPLv3 with OpenSSL and iOS exceptions |
Website | http://mosh.mit.edu |
In computing, Mosh (mobile shell) is a tool used to connect from a client computer to a server over the Internet, to run a remote terminal.[1] Mosh is similar[2] to SSH, with additional features meant to improve usability for mobile users. The major features are:
- Mosh keeps its connection when a user "roams" to different IP addresses, for example by moving to a different Wi-Fi network or when changing from Wi-Fi to 3G.[3]
- Mosh keeps the connection open (not in the TCP-sense though, Mosh uses UDP) when a user loses their Internet connection or puts their client to "sleep." SSH can lose its connection in such cases because TCP times out.[4]
- Mosh tries to show a user the keys they have typed, and deletions they have made to text, immediately, without waiting for network lag. It uses an adaptive system that predicts whether the application running on the server will decide to echo the user's keystrokes or deletions.[5][6]
The main drawbacks of mosh are additional prerequisites to the server and that some special features of SSH are not available anymore.
Design
Mosh works at a different layer from SSH. Whereas SSH transmits a stream of bytes in each direction (from server to client or client to server) using TCP, Mosh runs a terminal emulator at the server to figure out what should be on the screen.[1] The server then transmits this screen to the client at a varying frame rate, depending on the speed of the network.[7] This allows Mosh to save on network traffic on slow or intermittent connections.
Supported platforms
Mosh is available for most Linux distributions, Mac OS X, FreeBSD, NetBSD, and OpenBSD, Android, Solaris, Cygwin, and as a Chrome App.[1] The iOS program iSSH included an independent implementation of the Mosh protocol as an optional add-on,[8] but it is no longer available on the Apple App Store.
Performance
Roaming
Mosh is built on the State-Synchronization Protocol (SSP),[9] which supports single-packet roaming.[10] After the client has switched to a new IP address, a single packet that successfully reaches the server is enough to "roam" the connection. The client does not need to know it has roamed. (The client may be using NAT and the NAT roamed instead.)[7]
Packet loss
In the Mosh research paper,[7] the creators tested SSP on a link with 29% packet loss, and found that SSP reduced the average response time by a factor of 50 (from 16.8 seconds to 0.33 seconds) compared with SSH, which uses TCP. However, another study by students at Stanford University found that SSP reduced the average response time by a factor of 30 (from 5.9 seconds to 0.19 seconds).[11]
Local echo
According to mosh's developers, the program was found to be able to predict and immediately display 70% of user keystrokes,[1][7] reducing the median response time to a keystroke to less than 5 milliseconds (masking the latency of the network). A different study by students at Stanford University found that Mosh was able to quickly echo 55% of user keystrokes[12]
Drawbacks
Prerequisites to the server
The major drawback of mosh is that it requires the server to fulfill additional prerequisites which are not needed by ssh itself. Due to its design, mosh needs the server to allow direct connections via UDP.[13] Servers not fulfilling these prerequisites cannot be used by mosh. Examples for such systems include servers behind firewalls which restrict connections to the ssh-port via TCP. Problematic are also servers which are only indirectly reachable. The later is usually accommodated by ssh via option 'ProxyCommand', but this is not supported by mosh.[14]
One port per connection
By default, the server tries to allocate the first free UDP port in the range 60000-61000, per connection. This dynamic port allocation is considered an extra burden and risk for firewall maintenance.[15] A significant part of the firewall-filtering happens through connection tracking, so called stateful filtering, this is based on the SYN/ACK flags in TCP segments, UDP packets don't have such flags.[16]
Mitigation:
- The UDP port on the server can be set per mosh connection, so that only a limited number of ports need to be opened [17]
- Deep packet inspection firewalls and Application firewalls can handle this better by looking at content of the packet and associate it to the initial connection.
IPv6 support
Mosh does not support IPv6 yet.[18] There exists an experimental, multipath capable version of Mosh that supports IPv6 and dynamically switching between IPv4 and IPv6.[19]
Terminal scrollback and output drops
Scrollback is not supported in the current release of mosh, and when using it in a terminal emulator with scrollbars they disappear, but is planned for the 1.3 release.[20] This functionality is trade-off for garbage cleaning, as binary output is wiped away. One way to mitigate this currently is by using mosh in combination with a terminal multiplexer like screen or tmux.[21]
ssh-agent forwarding
SSH-agent forwarding is not currently supported.[22]
X11 forwarding.
X11 Forwarding not yet supported.[23]
See also
References
- ↑ 1.0 1.1 1.2 1.3 "Mosh: the mobile shell". Retrieved on 28 March 2013.
- ↑ Brockmeier, Joe. "Into the Mosh Pit: A Mobile Shell Replacement for SSH", linux.com, 10 April 2012. Retrieved on 28 March 2013.
- ↑ Delony, David. "Mosh: Secure Shell Without the Pain", Technopedia, 19 October 2012. Retrieved on 28 March 2013.
- ↑ Cox, John. "MIT researchers chart a new approach for mobile Internet protocols", Network World, 6 July 2012. Retrieved on 28 March 2013.
- ↑ Beckert, Axel. "Mosh and AutoSSH: Remote shell tools that make your life easier on a slow or constantly morphing network", Linux Magazine, November 2012.
- ↑ Leyden, John. "MIT's mind-reading Mosh pits itself against SSH daemons", The Register, 13 April 2012. Retrieved on 28 March 2013.
- ↑ 7.0 7.1 7.2 7.3 Winstein, Keith. "Mosh: An Interactive Remote Shell for Mobile Clients", USENIX Annual Technical Conference 2012, Boston, Mass., 14 June 2012.
- ↑ "iSSH Features", Zingersoft. Retrieved on 28 March 2013.
- ↑ "MIT unveils a new Internet protocol for mobile clients"
- ↑ Winstein, Keith and Balakrishnan, Hari. "Mosh: An Interactive Remote Shell for Mobile Clients (more detailed draft)". Retrieved on 28 March 2013.
- ↑ Nagaraj, Kanthi and McMilin, Emily. "Mosh", Reproducing Network Research, 14 March 2013. Retrieved on 28 March 2013.
- ↑ Aljunied, Ahmed. "Evaluation of Mosh 'Mobile Shell' Performance Results", Reproducing Network Research, 13 March 2013. Retrieved on 28 March 2013.
- ↑ "'Mosh will log the user in via SSH, then start a connection on a UDP port between 60000 and 61000.'", Retrieved on 19 June 2014.
- ↑ "Mosh bug report #285: Can't use a ProxyCommand-based SSH connection", Retrieved on 18 June 2014
- ↑ "Dangers of opening up a wide range of ports? (mosh)", IT Security (Stack Exchange), 13 April 2012. Retrieved on 28 March 2013.
- ↑ Multiplexing more sessions into same UDP port
- ↑ "use -p to define remote UDP port"
- ↑ https://github.com/keithw/mosh/issues/81
- ↑ https://github.com/boutier/mosh
- ↑ https://github.com/keithw/mosh/issues/2 "Scrollback support is planned for version 1.3"
- ↑ "Scrollback and alternate screen (was: Use alternate screen on smcup/rmcup)"
- ↑ "SSH Agent Forwarding"
- ↑ "Support X forwarding"
|