[Asterisk-Users] TFTP - Good or Bad?
Giles Scott
gscott at scott.swiftserve.net
Fri Aug 5 06:07:38 MST 2005
There is error correction in TFTP. Its done at the application layer and not
the transport layer.
TFTP uses two UDP ports for control and data transfer, this is probably
where there are problems with NAT devices.
The control connection is ;
client - sport dynamic(x) -> server dport 69
client asks for a file
server then sends data to the client
server -> sport dynmaic -> client dport (x)
Each data packet includes a block number.
When the client receives a good block it then ACKs the block. The server
will then send the next block,
If the server does not get an ACK for a block it will re-transmitt the
block.
I have seen issues with certain implementations (including busybox) where
the server/client does not properly re-send blocks.
To test specific TFTP implementations something like 'dummynet' (included in
FreeBSD kernel) can be used to simulate poor network conditions.
TFTP does have some limitations;
Max file size is 32MB (due to the size of the block counter in the standard)
default payload is 512 bytes (RFC 1783 introduced block size negotiation)
Its can be very slow over wide area networks due to the server not sending
data until previous ACK has been received.
Giles
----- Original Message -----
From: "Rich Adamson" <radamson at routers.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion"
<asterisk-users at lists.digium.com>
Sent: Friday, August 05, 2005 2:02 PM
Subject: Re: [Asterisk-Users] TFTP - Good or Bad?
>
>> > I don't post here often but I read with interest all the postings. -
>> > I've
>> > been on a lot of mailing lists, but this one is by far the most
>> > interesting.
>> >
>> > I've been doing a lot of work with 'tftp' loading Cisco 79xx phones
>> > with
>> > firmware, configs. for asterisk, etc.
>> >
>> > And I see where a lot of folks have trouble with 'tftp', use alternate
>> > port
>> > numbers (probably to get around firewall issues), etc. - And I've even
>> > seen
>> > where some folks complain that 'tftp' is one of the 'worst' protocols
>> > on the
>> > Internet.
>> >
>> > At the end of this posting, I've included a little tid-bit on
>> > 'primary/alternate' 'tftp' servers for the Cisco 79xx phone setup.
>> >
>> > This next part is mainly for 'newbies' who are new to asterisk &
>> > haven't got
>> > a clue as to what 'tftp' is. - Advanced users, geeks, etc., please
>> > disregard
>> > the next part if you want.
>> >
>> > Apologize in advance if this is boring.
>> >
>> > Going back to 'Networking 101', just exactly what is 'tftp'? - Is there
>> > any
>> > reason WHY it came into being in the first place?
>> >
>> > 'tftp' stands for 'Trivial File Transfer Protocol'. - Unlike the more
>> > popular 'ftp' protocol, 'tftp' is considered 'non-secure'. - Meaning
>> > that no
>> > login name/password challenge is require. - The 'device' (computer,
>> > phone,
>> > whatever) sends a request to the 'tftp' server for the file & the
>> > server
>> > sends it. - Plain and simple.
>> >
>> > 'tftp' also uses the 'UDP' (User Datagram Protocol). - The main
>> > difference
>> > between 'UDP' and 'TCP' is that 'UDP' uses NO ERROR CORRECTION. - No
>> > 'acks'
>> > & 'naks' to make sure all the packets arrive okay at the receiving
>> > end. -
>> > It's up the receiving end to make sure everything was received okay.
>>
>> It also makes it relatively simpler for someone on the same LAN (mostly)
>> to fake being a tftp server for that client (or vice versa). A UDP
>> packet is generally more predictable, so if I wanted to send the phone
>> bogus firmware or bogus config, it would generally be easier for me than
>> if the server has read the files using, e.g. HTTP.
>>
>> HTTP is simple, well-supported and supports all the "file transfers"
>> operations TFTP supports.
>
> And, FWIW, there are a large number of tftp implementations (mostly in
> the non-linux pc arena) that have issues dealing with the last packet
> in a tftp transfer causing failures. (Based on about 15 years of using
> various tftp products as a mechanism to upgrade cisco ios's.)
>
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
--
This message has been scanned for viruses and
dangerous content by Swift Internet, and is
believed to be clean.
More information about the asterisk-users
mailing list