TFTP - a UDP (connectionless protocol)

mattsthe2mattsthe2 Member Posts: 304
Ok so in my book it says that FTP is a connection oriented protocol where TFTP is not..


Why is TFTP not TCP.

If im transferring a file from a FTP server i need to make sure i recieve every packet to make up a workable file for me to look at. Which makes sense, the entire data-stream needs to be all there.

But wouldnt the same type of rule apply to TFTP.
If im upgrading my router to a new IOS version, the data file wouldnt work if it was corrupted...??

It makes more sense to me to TFTP run on TCP not UDP.

Comments

  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    tftp is used for quick "best-effort" delivery of data. tftp is used when security and data integrity are not an issue. Also tftp is used for quick transfers so UDP has less overhead and is faster than tcp.

    FTP is a much more robust protocol and needs more security and reliable delivery.

    UDP is still a good protocol and while it doesn't guarantee delivery, it will still get data from point A to point B most of the time. The term "reliable" is used kinda loosely in protocol jargon, and i think udp is pretty reliable, just not as much as as TCP.

    Also if you are upgradin your IOS like in your example, the data would only be passing from a TFTP server on your network, sraight to the ethernet interface of your router. thats really not going very far so TCP isn't really needed.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    While UDP is connectionless it does not mean that TFTP is not, it means the transport layer protocol is connectionless. In this case TFTP has it's own built in flow control, error detection, acknowledgements, and error recovery mechanisims so it does not need to rely on a protocol suc as TCP. Why did Cisco choose to use tftp for many file copy operations? simple, it takes far less programming code to write the TFTP and UDP protocols than the TCP and FTP or HTTP protocols. When a router had only 128KB of rom (routers will boot to the rom if no IOS is found, this allows an administrator to copy an IOS to the router with a limited TCP/IP stack) it was important to have these things as streamlined as you could.
    The only easy day was yesterday!
  • mattsthe2mattsthe2 Member Posts: 304
    dtlokee wrote:
    While UDP is connectionless it does not mean that TFTP is not, it means the transport layer protocol is connectionless. In this case TFTP has it's own built in flow control, error detection, acknowledgements, and error recovery mechanisims so it does not need to rely on a protocol suc as TCP. Why did Cisco choose to use tftp for many file copy operations? simple, it takes far less programming code to write the TFTP and UDP protocols than the TCP and FTP or HTTP protocols. When a router had only 128KB of rom (routers will boot to the rom if no IOS is found, this allows an administrator to copy an IOS to the router with a limited TCP/IP stack) it was important to have these things as streamlined as you could.


    So basically its easier to write error dection, flow control etc etc at the Application level than at the Transport Layer?

    If that is true then the only advantage to have the transport layer do the "cool stuff" is so it doesnt have to bounce up to Layer 7 to find out if there is a problem.

    So the difference is basically a trade off between.

    Easier code writing to do at the application layer Vs. bounching up to L7?
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    mattsthe2 wrote:
    dtlokee wrote:
    While UDP is connectionless it does not mean that TFTP is not, it means the transport layer protocol is connectionless. In this case TFTP has it's own built in flow control, error detection, acknowledgements, and error recovery mechanisims so it does not need to rely on a protocol suc as TCP. Why did Cisco choose to use tftp for many file copy operations? simple, it takes far less programming code to write the TFTP and UDP protocols than the TCP and FTP or HTTP protocols. When a router had only 128KB of rom (routers will boot to the rom if no IOS is found, this allows an administrator to copy an IOS to the router with a limited TCP/IP stack) it was important to have these things as streamlined as you could.


    So basically its easier to write error dection, flow control etc etc at the Application level than at the Transport Layer?

    If that is true then the only advantage to have the transport layer do the "cool stuff" is so it doesnt have to bounce up to Layer 7 to find out if there is a problem.

    So the difference is basically a trade off between.

    Easier code writing to do at the application layer Vs. bounching up to L7?

    Not that it's easier but TCP needs to be able to handle the connection oriented services for ANY application layer protocol which makes it very bulky. In the case of TFTP the error detection and correction is only concerned with 512B blocks of data and can be done more efficently at the application layer. TCP has mechanisms for negotiating the window sizes, slow start algorithm, maintaining sequence numbers, and so on. All of this requires more code space than is necessary in this case.
    The only easy day was yesterday!
  • mattsthe2mattsthe2 Member Posts: 304
    dtlokee wrote:
    mattsthe2 wrote:
    dtlokee wrote:
    While UDP is connectionless it does not mean that TFTP is not, it means the transport layer protocol is connectionless. In this case TFTP has it's own built in flow control, error detection, acknowledgements, and error recovery mechanisims so it does not need to rely on a protocol suc as TCP. Why did Cisco choose to use tftp for many file copy operations? simple, it takes far less programming code to write the TFTP and UDP protocols than the TCP and FTP or HTTP protocols. When a router had only 128KB of rom (routers will boot to the rom if no IOS is found, this allows an administrator to copy an IOS to the router with a limited TCP/IP stack) it was important to have these things as streamlined as you could.


    So basically its easier to write error dection, flow control etc etc at the Application level than at the Transport Layer?

    If that is true then the only advantage to have the transport layer do the "cool stuff" is so it doesnt have to bounce up to Layer 7 to find out if there is a problem.

    So the difference is basically a trade off between.

    Easier code writing to do at the application layer Vs. bounching up to L7?

    Not that it's easier but TCP needs to be able to handle the connection oriented services for ANY application layer protocol which makes it very bulky. In the case of TFTP the error detection and correction is only concerned with 512B blocks of data and can be done more efficently at the application layer. TCP has mechanisms for negotiating the window sizes, slow start algorithm, maintaining sequence numbers, and so on. All of this requires more code space than is necessary in this case.


    I'm sure theres some CCNP stuff in there dtlokee, lol. 512B blocks??

    So basically in the TFTP situation TCP provides more overhead than is needed so UDP together with error dection at the Application layer is a better fit?
  • sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    Here was a pretty good summary of comparing FTP to TFTP. Much of it follows along the lines of what the others were saying:

    Warning - Pop-Ups on the site
    http://www.tcpipguide.com/free/t_TFTPOverviewHistoryandStandards-2.htm
    All things are possible, only believe.
  • mattsthe2mattsthe2 Member Posts: 304
    sprkymrk wrote:
    Here was a pretty good summary of comparing FTP to TFTP. Much of it follows along the lines of what the others were saying:

    Warning - Pop-Ups on the site
    http://www.tcpipguide.com/free/t_TFTPOverviewHistoryandStandards-2.htm


    Thanks sprkymrk,

    I just did an IOS upgrade using TFTP and FTP. Can i say that FTP was so much more quickier.
    Why is that?
  • mattsthe2mattsthe2 Member Posts: 304
    This is a good article on the difference between TCP and UDP.
    While some of it is at the Application layer where us Data Guys dont care about, it talks about a good comparision between TCP and UPD and file transfer.


    http://www.laynetworks.com/Comparative%20analysis_TCP%20Vs%20UDP.htm
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    mattsthe2 wrote:
    sprkymrk wrote:
    Here was a pretty good summary of comparing FTP to TFTP. Much of it follows along the lines of what the others were saying:

    Warning - Pop-Ups on the site
    http://www.tcpipguide.com/free/t_TFTPOverviewHistoryandStandards-2.htm


    Thanks sprkymrk,

    I just did an IOS upgrade using TFTP and FTP. Can i say that FTP was so much more quickier.
    Why is that?

    The ability for FTP (really TCP) to send a bout 8 - 12 segments at a time before waiting for an acknowledgement instead of TFTP/UDP sending 1 segment then waiting for an ACK has an effect on the performance.
    The only easy day was yesterday!
Sign In or Register to comment.