Bug 1314744

Summary: RFE: Evaluate RFC7440 for tftp
Product: [Fedora] Fedora Reporter: Noel McLoughlin <noel.mcloughlin>
Component: tftpAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: rawhideCC: akarlsso, lzaoral
Target Milestone: ---Keywords: FutureFeature, Patch, Performance, RFE
Target Release: ---   
Hardware: All   
OS: All   
URL: https://tools.ietf.org/html/rfc7440
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1328827 (view as bug list) Environment:
Last Closed: 2021-10-25 08:29:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1328827    
Attachments:
Description Flags
patch-v1 none

Description Noel McLoughlin 2016-03-04 11:43:55 UTC
Description of problem:

** I could not find a duplicate bug. **

I was wondering if RFC7440 (TFTP Windowsize Option) will be supported as it offers performance improvements over RFC2348 (TFTP blocksize option).  Image transfer time is quite slow but traditionally rom images are quite small.

- With BIOS, pxelinux.0 is only circa 27K in size.
- With uEFI, the images are getting bigger: shim.efi (1.3M), grubx86.efi (986K)

There is no sign of TFTP becoming obsolete in cloud/IoT era.



Version-Release number of selected component (if applicable):
N/A

How reproducible:
N/A

Steps to Reproduce:
N/A

Actual results:
Slow PXE/TFTP transfer times for larger uEFI images.

Expected results:

Most likely we configure '--windowsize nnn' server argument on daemon. 

service tftp
{
    socket_type	= dgram
    protocol	= udp
    wait	= yes
    user	= root
    server	= /usr/sbin/in.tftpd
    server_args	= -s /var/lib/tftpboot --blocksize 1478 --windowsize nnnn
    disable	= no
    per_source	= 11
    cps		= 100 2
    flags	= IPv4
}

I understand IPv6 has some efficiencies over IPv4 but I think the option would be required as IPv6 network boot becomes more established.

service tftp
{
    socket_type	= dgram
    protocol	= udp
    wait	= yes
    user	= root
    server	= /usr/sbin/in.tftpd
    server_args	= -s /var/lib/tftpboot --blocksize 1478 --windowsize nnnn
    disable	= no
    per_source	= 11
    cps		= 100 2
    flags	= IPv6
}


Additional info:

Comment 2 Jan Synacek 2016-04-04 08:35:22 UTC
Looks like a valuable addition. I'll take a look at it.

Comment 3 Jan Synacek 2016-04-06 13:50:41 UTC
There seems to be a misunderstanding in how the reporter understands the --blocksize (and subsequently the suggested --windowsize) addition. The --blocksize specifies the *maximum allowed* blocksize, should there be any request for the blocksize TFTP option (see RFC2348). The blocksize (or windowsize) option itself is always present in the initial read/write request packet. Therefore, no additional option will be added to the server parameters, but the server will be improved to also understand the windowsize TFTP option, as specified in RFC7440.

Comment 4 Jan Synacek 2016-04-06 13:54:27 UTC
Created attachment 1144234 [details]
patch-v1

Implement RFC7440 in both server and the client.

This needs a lot of testing! Especially on error conditions and duplicate packets.

Note that the client improvement was a bit forced, since it hadn't implemented any TFTP options before. It still uses the default TFTP blocksize of 512.

Comment 5 Jan Synacek 2016-04-06 13:55:56 UTC
The patch was created against the current F24 (and rawhide, they are the same) code base.

Comment 7 Jan Synacek 2016-04-07 06:53:31 UTC
I've created builds for F24 and F25 that can be downloaded from:
https://jsynacek.fedorapeople.org/tftp/f24/
https://jsynacek.fedorapeople.org/tftp/f25/

Comment 8 Noel McLoughlin 2016-04-20 12:02:03 UTC
Kudos for the fast analysis and turnaround. Unfortunately I not be able to test his (no time) but hopefully wider Fedora community will pick this up.

Comment 9 Fedora Admin XMLRPC Client 2020-04-06 19:33:54 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 10 Dominik 'Rathann' Mierzejewski 2021-07-09 09:54:58 UTC
If there's still interest in applying Jan's patch, let me know and I'll make
a new build with the patch applied.

The patch needs some revision, though. Here's a quick review:

@@ -191,14 +192,14 @@ char *xstrdup(const char *);
 
 const char *program;
 
-static inline void usage(int errcode)
+static void usage(int errcode)
 {
     fprintf(stderr,
 #ifdef HAVE_IPV6

This looks unrelated, please explain why you're removing the inline attribute?

+                sa_set_port(&peeraddr, SOCKPORT(&from));  /* added */

The comment doesn't explain anything, either expand it or drop it, please.

In multiple places, the only change is indentation. Please keep the original
indentation in the functional patch and send a separate patch for whitespace-only
changes.

Comment 11 Dominik 'Rathann' Mierzejewski 2021-10-25 08:29:30 UTC
Closing due to no interest from reporter or patch submitter. Feel free to reopen.