Skip to content

crazyscot/qcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Crates.io GitHub code size in bytes Build status Documentation License

The QUIC Copier (qcp) is an experimental high-performance remote file copy utility for long-distance internet connections.

πŸ“‹ Features

  • πŸ”§ Drop-in replacement for scp
  • πŸ›‘οΈ Similar security to scp, using existing, well-known mechanisms
  • πŸš€ Better throughput on congested networks
  • (New in 0.2) Configuration file support

For a full list of changes, see the changelog.

Platform support status

  • Well tested: Debian and Ubuntu on x86_64, using OpenSSH
  • Tested: Ubuntu on WSL; aarch64 (Raspbian)
  • Untested: OSX/BSD family
  • Not currently supported: Windows

🧰 Getting Started

  • You must have ssh access to the target machine.
    • You must be able to exchange UDP packets with the target on a given port.
    • If the local machine is behind connection-tracking NAT, things usually work just fine. This is the case for the vast majority of home and business network connections.
    • You can tell qcp to use a particular port range if you need to.
  • Install the qcp binary on both machines. It needs to be in your PATH on the remote machine.
  • Run qcp --help-buffers and follow its instructions.

Installing pre-built binaries

These can be found on the latest release.

  • Debian/Ubuntu packages are provided.
  • For other Linux x86_64: Use x86_64-unknown-linux-musl.tar.gz
  • For other Linux aarch64: Use aarch64-unknown-linux-musl.tar.gz

The binaries are statically linked. Linux builds should work on all recent distributions, as long as you have selected the correct CPU architecture.

Installation from source

Prerequisite: You need to have capnpc installed. Your distribution likely packages this, or see https://capnproto.org/.

You can install the package from source using cargo:

cargo install --locked qcp

If you are new to Rust and don't have the tools installed

  • Install the rustup tool via your package manager, or see Rust installation
  • rustup toolchain install stable
  • Proceed as above

βš™οΈ Usage

The basic syntax is the same as scp or rcp.

qcp [OPTIONS] <SOURCE> <DESTINATION>

The program has a comprehensive help message, accessed via qcp -h (brief) or qcp --help (long form).

For example:

$ qcp my-server:/tmp/testfile /tmp/
β ‚ Transferring data                                                           2.1MB/s (last 1s)
testfile β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 1s @ 6.71 MB/s [10.49 MB]

Things you should know:

  • qcp uses the ssh binary on your system to connect to the target machine. ssh will check the remote host key and prompt you for a password or passphrase in the usual way.

  • qcp will read your ssh config file to resolve any Hostname aliases you may have defined there. The idea is, if you can ssh to a host, you should also be able to qcp to it. However, some particularly complicated ssh config files may be too much for qcp to understand. (In particular, Match directives are not currently supported.) In that case, you can use --ssh-config to provide an alternative configuration (or set it in your qcp configuration file).

Tuning

By default qcp is tuned for a 100Mbit connection, with 300ms round-trip time to the target server.

Various network tuning options are available.

For example, if you have 300Mbit/s (37.5MB/s) download and 100Mbit/s (12.5MB/s) upload, you might use these options:

qcp my-server:/tmp/testfile /tmp/ --rx 37M --tx 12M

Performance tuning can be a tricky subject. See the performance documentation.

Persistent configuration

The useful options -- those you might want to use regularly including rx, tx and rtt -- can be specified in a configuration file. See config for details.

πŸ“– How qcp works

The brief version:

  1. We ssh to the remote machine and run qcp --server there
  2. Both sides generate a TLS key and exchange self-signed certs over the ssh pipe between them
  3. We use those certs to set up a QUIC session between the two
  4. We transfer files over QUIC

The protocol documentation contains more detail and a discussion of its security properties.

πŸ“˜ Project Policies

βš–οΈ License

This project is released publicly under the GNU Affero General Public License.

Alternative license terms can be made available on request on a commercial basis (see below).

πŸ§‘β€πŸ­ Bugs, Features & Contributions

Bug reports and feature requests are welcome, please use the issue tracker.

  • It may be useful to check the issues list and the discussions first in case somebody else has already raised it.
  • Please be aware that I mostly work on this project in my own time.

🚧 If you're thinking of contributing code, please read CONTRIBUTING.md.

Help wanted: MacOS/BSD

I'd particularly welcome performance reports from MacOS/BSD users as those are not platforms I use regularly.

πŸ“‘ Version number and compatibility

This project adheres to Semantic Versioning 2.0.0.

In its initial experimental phase, the major number will be kept at 0. Breaking changes will be noted in the changelog and will trigger a minor version bump.

The project will move to version 1.x when the protocol has stabilised. After 1.0, breaking changes will trigger a major version bump.

πŸ’Έ Supporting the project

If you find this software useful and would like to say thank you, please consider buying me a coffee or ko-fi. Github sponsorship is also available.

Please also consider supporting the galaxy of projects this work builds upon. Most notably, Quinn is a pure-Rust implementation of the QUIC protocol, without which qcp simply wouldn't exist in its current form.

If you're a business and need a formal invoice for your accountant, my freelancing company can issue the paperwork. For this, and any other commercial enquiries please get in touch, to [email protected]. We would be pleased to discuss commercial terms for:

  • Alternative licensing
  • Support
  • Sponsoring feature development

πŸ’‘ Future Directions

Some ideas for the future, in no particular order:

  • Support for copying multiple files (e.g. shell globs or scp -r)
  • Windows native support
  • Firewall/NAT traversal
  • Interactive file transfer (akin to ftp)
  • Smart file copy using the rsync protocol or similar (send only the sections you need to)
  • Graphical interface for ftp mode
  • Review the protocol and perhaps pivot to using capnp RPC
  • Bind a daemon to a fixed port, for better firewall/NAT traversal properties but at the cost of having to implement user authentication.
  • The same thing we do every night, Pinky. We try to take over the world!