uftp(1)
π NAME π
uftp β Encrypted UDP based ftp with multicast β server ππ
Okay so listen, bestie, uftp(1) is literally the server side of the UFTP glow-up. It beams one or more files to one or more receivers over multicast, and yes, encryption is optional but highly iconic. No cap. β¨
β¨ SYNOPSIS β¨
uftp [ -R txrate ] [ -L logfile ] [ -B udp_buf_size ]
[ -g max_log_size ] [ -n max_log_count ]
[ -Y keytype ] [ -h hashtype ]
[ -k key_file ] [ -K key_length | curve ] [ -l ] [ -T ]
[ -b block_size ] [ -t ttl ] [ -Q dscp ] [ -z | -Z ]
[ -I interface ] [ -p port ] [ -u source_port ]
[ -j proxylist_file ] [ -q ] [ -f ] [ -y ] [ -U UID ]
[ -a max_passes ] [ -x log_level ] [ -W txweight ]
[ -H host[,host...] | -H @hostlist_file
| -F restart_file ] [ -X exclude_file ]
[ -M pub_multicast_addr ] [ -P priv_multicast_addr ]
[ -N max_nak_pct ] [ -C cc_type ] [ -o ][ -D dest_name ]
[ -E base_dir[,base_dir... ] ] [ -S status_file ]
[ -r init_grtt[:min_grtt:max_grtt] ] [ -s robust ]
{ -i list_file | file [ file... ] }
π¦ DESCRIPTION π¦
Bestie, uftp is the server process of the UFTP suite π It sends one or more files to one or more receivers via multicast with optional encryption. That's the whole vibe, fr fr. π«Ά
π OPTIONS π
The following options are supported, and we are going through every single one because we don't skip details in this house. Periodt. π
-R txrateβ The transmission speed in Kbps. Specifying-1for this value results in data being sent as fast as the network interface will allow. Using a value of-1is recommended only if the network path between the server and all clients is as fast as the server's local interface, and works best in a gigabit environment. Default is1000Kbps. Ignored if-Cis given any value other than"none".-L logfileβ Specifies the log file. Default is to write to stderr.-B buf_sizeβ The size in bytes of the UDP send buffer and receive buffer to use. Valid values are65536-104857600(64KB-100MB). Defaults to262144.-g max_log_sizeβ Specifies the maximum log file size in MB. Once the log file reaches this size, the file is renamed with a.1extension and a new log file is opened. For example, if the log file is/tmp/uftp.log, it will be renamed/tmp/uftp.log.1and a new/tmp/uftp.logwill be created. Ignored if-Lis not specified. Valid values are1-1024. Default is no log rolling.-n max_log_countβ Specifies the maximum number of archive log files to keep when log rolling is active. When the log file rolls, archive logs are renamed with an incrementing numerical extension until the max is reached. Archive log files beyond the maximum are deleted. Ignored if-Land-gare not specified. Valid values are1-1000. Default is5.-Y keytypeβ The symmetric encryption algorithm to use. Valid values are"aes128-gcm","aes256-gcm","aes128-ccm","aes256-ccm", or"none"to not set up encryption at all. Default is"aes256-gcm".-h hashtypeβ The hashing algorithm to use for key derivation. Valid values are"sha256"for SHA-256,"sha384"for SHA-384, and"sha512"for SHA-512. Defaults to"sha256". Ignored if-Yis"none".-e curveβ Specifies the EC curve used to generate an ECDH key for key exchange. Defaults tosecp256r1(see-kand-Kfor the list of available EC curves). Ignored if-Yis"none".-cβ If specified, forces clients to authenticate by sending their RSA / ECDSA public key in aCLIENT_KEYmessage. Client key fingerprints and proxy key fingerprints specified by-Hand-jrespectively will NOT be checked unless-cis specified. Ignored if-Yis"none".-m max_nak_countβ Specifies the number of times a client reports naks beyond the maximum percentage before getting dropped. Valid values are1-10. Default is1.-k key_fileand-K {rsa:key_len | ec:curve}β These two options are used to read and/or write the server's RSA/ECDSA private key. Both are ignored if-Yis"none". The-Koption creates an RSA or ECDSA private key. New keys are specified as eitherrsa:key_length, which creates an RSA private keykey_lengthbits wide, or asec:curve, which creates an EC key using the curve"curve". The supported EC curves aresecp256r1(prime256v1),secp384r1, andsecp521r1. If neither-knor-Kare specified, an EC private key using curvesecp256r1is generated and not persisted. If-kis specified but not-K, the RSA or ECDSA private key is read fromkey_file. If-kis not specified but-Kis, an RSA or ECDSA private key is generated but not persisted. If both-kand-Kare specified, an RSA or ECDSA private key is generated and stored inkey_file. The definition ofkey_fileis dependent on the crypto library UFTP is compiled to use. On Windows systems, UFTP uses CNG (Cryptography API: Next Generation). Under CNG, all RSA and EC private keys must be stored in a key container (technically only keys used to sign data, but for UFTP's purposes this is the case). Key containers are internal to Windows, and each user (and the system) has its own set of key containers. In this case,key_fileis actually the name of the key container. All other systems use OpenSSL for the crypto library (although under Windows UFTP can also be built to use it). In this case,key_filespecifies a file name where the RSA private key is stored unencrypted in PEM format (the OS is expected to protect this file). When both-kand-Kare specified, the file is only written to if it does not currently exist. If the file does exist, an error message will be returned and the server will exit. When-kis not specified, the generated key is not persisted. These PEM files may also be manipulated via theopenssl(1)command line tool. Keys can also be generated and viewed via theuftp_keymgt(1)utility.-lβ Follow symbolic links. By default, if the server encounters a symbolic link, it will send the link itself instead of the file it points to. Specifying this flag causes the server to send the file the link points to.-Tβ Print the timestamp on each line of output. If-Lis specified, this option is implied.-b block_sizeβ Specifies the size of a data block. This value should be around100-200bytes less than the path MTU to provide ample room for all headers and extensions, up to and including the IP and UDP headers. Prior to version4.0, this option specified the MTU and calculated the block size based on that. Default is1300.-t ttlβ Specifies the time-to-live for multicast packets. Default is1.-Q dscpβ Specifies the Differentiated Services Code Point (DSCP), formerly Type of Service (TOS), in the IP header for all outgoing packets. Valid values are0-63and may be specified in either decimal or hexadecimal. Default is0. Not currently supported on Windows.-zβ Enables sync mode. Clients will check if an incoming file exists. If so, the client will decline the incoming file if it either older than the existing file or the same age and the same size as the existing file. As of version4.1, parsable output that was previously generated by this option is now enabled separately via the-Soption.-Zβ Sync preview mode. Works like sync mode, except no files are actually transmitted, and theRESULTandSTATSlines reflect the status of each file had they actually been sent. The"time"and"speed"datapoints are approximated based on the transmission speed.-I interfaceβ The interface to send the data from. Can be specified either by interface name, by hostname, or by IP. If not specified, the default system interface is used.-p portβ The UDP port number to send to. Default is1044.-u source_portβ The UDP port number to send from. Default is0, which uses a random port number.-j proxylist_fileβ A file containing a list of proxies the server is expecting to hear from. The file should contain the ID of a proxy optionally followed by the proxy's public key fingerprint, with one on each line. If a key fingerprint is given, the key specified by the proxy must match the fingerprint. This option should not be used without-H. If-His specified,-jmust also be specified if proxies are expected to respond, otherwise the server will reject the proxies. Example contents:
0x00001111|66:1E:C9:1D:FC:99:DB:60:B0:1A:F0:8F:CA:F4:28:27:A6:BE:94:BC
0x00002222
-qβ Quit-on-error flag. Normally, the server will continue with a session as long as at least one client is still active. With this flag, the server will quit if any client aborts, drops out, or never responds. Most useful in conjunction with clients using the temp directory option (-T) so that clients that successfully receive at least one file before being told to abort don't have files from an aborted session in the destination directory.-fβ Restartable flag. If specified, and at least one client fails to receive all files, the server will write a restart file named"_group_{groupID}_restart"in the current directory to save the current state, which includes the group ID, list of files, and list of failed clients. This file can then be passed to-Fto restart the failed transfer.-yβ For Windows systems using CNG, private keys are normally stored in the key container of the running user. Specifying this option stores keys in the system key container. On non-Windows systems, this option has no effect.-U UIDβ The unique ID for this server, specified as an 8 digit hexadecimal number (0xnnnnnnnn). The default value is based on the IP address of the outgoing multicast address as specified by-I. If this address is IPv4, the UID is the address. If it is IPv6, the UID is the last 4 bytes of the address.-a max_passesβ The maximum number of passes that are made through the file for transmission before any clients that have not yet fully received the current file are aborted. Valid values are0-65535. Default is65535.-xlog_level β sets the current logging level, aka how much the server is yapping. π£οΈ Valid values are0-5, where0is the least verbose and5is the most verbose. Default is2, which is consistent with logging prior to version 3.5.-Wtxweight β sets the maximum file transfer time, expressed as a percentage of the optimal time. Valid values are110-10000. Ignored if congestion control is enabled. Default is no maximum time.-H{ host[,host...] | @hostlist_file }β specifies the clients for closed group membership, bestie. π«Ά You can give it either a comma separated list of client IDs, or read it from hostlist_file. That file is in the same format as proxylist_file. Heads up though: key fingerprints cannot be specified using the comma separated syntax. Clients that are behind a proxy don't need key fingerprints specified, since the proxy's key fingerprint will be checked instead. If unspecified, open group membership is used, and any client may register. π-Frestart_file β specifies the name of a restart file to use to resume a failed transfer. If specified,-Hmay not be specified and all files listed to send will be ignored, since the restart file contains both of these. All other command line options specified on the first attempt are not automatically applied, so you can alter them for the next attempt if need be. π-Xexclude_file β a file containing the names of files/paths to be excluded from the session, one per line. For example, if you send a directory calledd1containing subdirectoriesd2,d3, andd4, and you don't want to send the contents ofd4, the exclude_file should contain a line reading"d1/d4". π-Mpub_multicast_addr β the public address to announce on. May be either a multicast address or a unicast address, and either IPv4 or IPv6. If a unicast address is specified, the-Poption is ignored and all data moves over the specified unicast address. If a multicast IPv6 address is specified,-Pmust also be specified. Default is230.4.4.1.-Ppriv_multicast_addr β the private multicast address that the data is transferred to. One or more parts of the IP address (other than the first) may be replaced with the letter'x', resulting in a random number being chosen for that part, either0-255for IPv4 or0-0xFFFFfor IPv6. Default value is230.5.5.x. If clients are using source specific multicast (SSM), this and-Mmust specify valid SSM addresses, which fall in the range232.0.0.0/8for IPv4 andff3x::/32for IPv6 (herexspecifies the multicast scope). The values for-Mand-Pmust both be the same IP version. β¨-Nmax_nak_pct β specifies the maximum percentage of NAKs that a client can report for a particular section. This option works with the-moption, which specifies the number of times a client may exceed this limit before getting dropped. This allows the server to keep a very slow client from stalling the session for others β protecting the group chat from the one person who types at 2 wpm. π Valid values are0-100. Default is100.-Ccc_type β specifies the congestion control mode to use. Currently supported values are"none"and"tfmcc". Specifying"none"means data will be sent at a fixed rate as specified by the-Roption. Specifying"tfmcc"will use the TCP Friendly Multicast Congestion Control scheme as specified in RFC 4654. Normally TFMCC will limit the rate based strictly on loss, however a minimum, maximum, and initial rate in Kbps may each be optionally specified for TFMCC mode as"tfmcc:min=min_rate:init=init_rate:max=max_rate", and any or all of these may be applied and in any order. Default value is"none".
TFMCC will make use of the Explicit Congestion Notification (ECN) bits in the IP header on systems that support it natively. Known supported systems are Linux, FreeBSD, Windows XP (sender only), Windows Vista and later (receiver only), and Solaris (sender only). π
-oand-Ddest_name β these options specify the name given to the sent file(s) on the client side. If only one file/directory is specified to send and-ois not specified, the name specified by-Dis given to that file/directory, and the effects of-Eare ignored. If more than one file/directory is specified to send, or if-ois specified, they are placed in a subdirectory with the name specified by-D.
This option may also specify an absolute path name. If so, clients must be either all Windows or all UNIX-like, since they have differing filesystem structures, otherwise the behavior is undefined π. The server, however, need not be the same OS as the clients. When specifying an absolute path name, the path must be contained in one of a client's destination directories, otherwise the client will reject the file. When sending to Windows clients, an absolute path may be either local (drive:\path\to\file) or remote (\\host\share\path\to\file).
-Ebase_dir[,base_dir...] β specifies one or more"base"directories for files. Normally, for any file/directory specified, any leading path elements are stripped from the name before sending. If the specified file/directory name matches one of the base directories, only the path elements of the base directory are stripped, and the remainder is sent as the file name. Any specified file/directory that does not match a base directory is skipped. π«
For example, without -E, if you pass /path/to/file to send, the transmitted filename is file. If you pass in -E /path, the transmitted file name is to/file. πΈ
-Sstatus_file β prints easily parsable status information to a file. This information was previously only available in sync mode (-z) and was mixed with the normal logging output. Setting this option to@LOGresults in status info being mixed with normal logging output.
The following is printed for each client after all have registered:
CONNECT;status;target
Where "status" is either "success" or "failed", and "target" is the name of the client. π
The following is printed after each file:
RESULT;target;filename;size;status;speed
Where "target" is the name of the client, "filename" is the name of the current file, "size" is the size of the file in kilobytes (i.e. 1234KB), "speed" is the transmission speed for that file in KB/s, and status is:
copy: The file was sent. πoverwrite: The file was sent, and overwrote an existing file. Only generated in sync mode.skipped: The file was declined by the client because it is older that the existing file. Only generated in sync mode.rejected: The file was rejected, because the file was sent with an absolute pathname and either the client is using a temp directory or the filename doesn't match one of the client's destination directories.
The following is printed at the end of the session:
STATS;target;num_copy;num_overwrite;num_skip;total_size;time;speed
Where "target" is the name of the client, "num_copy" is the number of files sent with "copy" status, "num_overwrite" is the number of files sent with "overwrite" status, "num_skip" is the number of files sent with "skipped" status, "total_size" is the total size of all files sent in kilobytes, "time" is the total transmission time for all files, and "speed" is the overall transmission speed for all files.
Also, the following line is printed verbatim prior to the STATS lines for ease of reading:
HSTATS;target;copy;overwrite;skip;totalKB;time;speedKB/s
-rinit_grtt[:min_grtt:max_grtt] β specifies the initial value, and optionally the min and max values, of the Group Round Trip Time (GRTT) used in timing calculations. The GRTT changes dynamically based on the network conditions. This option is useful if the initial connection period is too short or long, if receivers are getting bogged down and cannot respond to the server quick enough before timing out, or if receivers are getting flagged with too high of an RTT and take too long to recover to a reasonable value. Valid values are0.001to1000. Defaults are0.5for init_grtt,0.01for min_grtt, and15.0for max_grtt. β-srobust β specifies the robustness factor for message retransmission. The server will resend particular messages up to robust times while waiting for client responses. Valid values are10-50. Default is20.-ilist_file β name of a file containing a list of files to send, one per line. Empty lines are ignored. Passing in'-'for list_file reads files from stdin. Other files specified on the command line are ignored if-iis given. π¦file [file...]β the file(s) or directory(ies) to send. Any special files (block/character devices, pipes, sockets, etc.) are skipped. By default, any symbolic links are sent as links (see-l). Any Windows client will silently refuse to create them. If-For-iis specified, any files listed will be ignored.
There are also special metafile names that can send commands to the clients. π¨ The @DELETE:{filename} metafile instructs the client to delete the given filename. The usual rules regarding which of the client's destination directories to use also applies here. The @FREESPACE metafile will cause the client to report back the amount of free disk space in the primary destination directory. π
π EXAMPLES π
Okay bestie, this is the fun part. Let's actually do things. β¨
Starting with the default options:
uftp the_file
So here's the tea: the server sends the_file with no encryption at 1000 Kbps, sending announcements over 230.4.4.1 and later messages over 230.5.5.x (where x is randomly selected π²). Any client that responds to the announcement will be accepted β no bouncer at this club. And the payload portion of the packets will be 1300 bytes. Slay.
To send at 50 Mbps:
uftp -R 50000 the_file
Or to allow the transmission rate to be determined dynamically:
uftp -C tfmcc the_file
Let the algorithm cook. π
To send multiple files:
uftp file_1 file_2 file_3
or:
uftp dir_1 dir_2 file_3
To send multiple files that all land in a certain subdirectory on each client:
uftp -D dest_dir file_1 file_2
Everyone gets the same little home. π
To send announcements over multicast address 224.1.2.3 and later messages over 224.4.5.6:
uftp -M 224.1.2.3 -P 224.4.5.6 file
Or for IPv6:
uftp -M ff02::1:2:3 -P ff02::4:5:6 file
Or in unicast mode:
uftp -M host_or_ip file
Where host_or_ip is the hostname or unicast IP address of the host to send to. π
To send only to certain hosts:
uftp -H client_id_1,client_id_2,client_id_3 file_to_send
or:
uftp -H @file_containing_list_of_clients file_to_send
Private party, invite list only. π
If you want to use jumbo ethernet frames of 9000 bytes (leaving 200 bytes of space for headers):
uftp -b 8800 file_to_send
To send /path/to/file1 and /path/to/file2, and have them appear on clients as /remote/dir/to/file1 and /remote/dir/to/file2:
uftp -E /path -D /remote/dir /path/to/file1 /path/to/file2
Glow-up: the path on the other side is completely different. π
To send a file encrypted with AES-256-CBC and SHA-1 hashing, using an autogenerated 512-bit RSA key to negotiate the session:
uftp -Y aes256-cbc -h sha1 file_to_send
To do the above with a previously generated RSA key stored in key_file_or_container (under Windows, the name of an internal key container, otherwise the name of a file containing the key in PEM format):
uftp -Y aes256-cbc -h sha1 -k key_file_or_container file_to_send
No cap: under Windows that's an internal key container name, but everywhere else it's a file holding the key in PEM format. Don't mix them up bestie. π«Ά
π¦ EXIT STATUS π¦
The following exit values are returned:
0β The file transfer session finished with at least one client receiving at least one file. Mission accomplished, we ate. π₯1β An invalid command line parameter was specified. You typed something unhinged, bestie. π2β An error occurred while attempting to initialize network connections.3β An error occurred while reading or generating cryptographic key data.4β An error occurred while opening or rolling the log file.5β A memory allocation error occurred.6β The server was interrupted by the user. That was you. You did that. π7β No client responded to theANNOUNCEmessage. Nobody came to the party. π8β No client responded to aFILEINFOmessage.9β All client either dropped out of the session or aborted. Also returned if one client drops out or aborts when-qis specified.10β The session completed, but none of the specified files were received by any client. The session ran, and yetβ¦ nothing landed. Tragic. π
π SEE ALSO π
uftpd(1), uftpproxyd(1), uftp_keymgt(1).
Go read those too, they're the supporting cast. π
β NOTES β
The latest version of UFTP can be found at http://uftp-multicast.sourceforge.net. UFTP is covered by the GNU General Public License. Commercial licenses and support are available from Dennis Bush (bush@tcnj.edu). π
And that's the whole page, bestie β you made it to the end, which is very main character of you. π This is from UFTP 5.0, dated 22 April 2020, for uftp(1). Periodt. πβ¨
π¦ where this page comes from
- nixpkgs unstable: uftp 5.0.3
- ubuntu stonking: uftp 5.0.3-0.1build1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms