您好,欢迎访问三七文档
1TFTPTFTPTrivialFileTransferProtocolTrivialFileTransferProtocolReferences:References:RFC783RFC783TFTPUsageandDesignTFTPUsageandDesignTransferfilesbetweenprocesses.Transferfilesbetweenprocesses.Minimaloverhead(nosecurity)Minimaloverhead(nosecurity)DesignedforUDP,althoughcouldbeusedDesignedforUDP,althoughcouldbeusedwithmanytransportprotocols.withmanytransportprotocols.EasytoimplementEasytoimplementSmallSmall--possibletoincludeinfirmwarepossibletoincludeinfirmwareOftenusestobootstrapworkstationsandOftenusestobootstrapworkstationsandnetworkdevices.networkdevices.2TFTPProtocolTFTPProtocol55messagetypesmessagetypes––ReadrequestReadrequest––WriterequestWriterequest––DataData––ACK(acknowledgment)ACK(acknowledgment)––ErrorErrorReadRequestReadRequest0101filenamefilename00modemode0022bytebyteopcodeopcodenetworkbyteordernetworkbyteordernullterminatednullterminatedasciiasciistringstringcontainingnameoffilecontainingnameoffilenullterminatednullterminatedasciiasciistringstringcontainingtransfermodecontainingtransfermodevariablelengthfields!variablelengthfields!3WriteRequestWriteRequest0202filenamefilename00modemode0022bytebyteopcodeopcodenetworkbyteordernetworkbyteordernullterminatednullterminatedasciiasciistringstringcontainingnameoffilecontainingnameoffilenullterminatednullterminatedasciiasciistringstringcontainingtransfermodecontainingtransfermodevariablelengthfields!variablelengthfields!TFTPDataPacketTFTPDataPacket0303block#block#data0to512bytesdata0to512bytes22bytebyteopcodeopcodenetworkbyteordernetworkbyteorder22byteblocknumberbyteblocknumbernetworkbyteordernetworkbyteorderalldatapacketshave512bytesalldatapacketshave512bytesexceptthelastone.exceptthelastone.4TFTPAcknowledgmentTFTPAcknowledgment0404block#block#22bytebyteopcodeopcodenetworkbyteordernetworkbyteorder22byteblocknumberbyteblocknumbernetworkbyteordernetworkbyteorderTFTPErrorPacketTFTPErrorPacket0505errcodeerrcodeerrstringerrstring22bytebyteopcodeopcodenetworkbyteordernetworkbyteorder22byteerrorcodebyteerrorcodenetworkbyteordernetworkbyteordernullterminatednullterminatedasciiasciierrorstringerrorstring00ErrorCodes0-notdefined1-Filenotfound2-Accessviolation3-Diskfull4-IllegalTFTPoperation5-Unknownport6-Filealreadyexists7-nosuchuserErrorCodesErrorCodes00--notdefinednotdefined11--FilenotfoundFilenotfound22--AccessviolationAccessviolation33--DiskfullDiskfull44--IllegalTFTPoperationIllegalTFTPoperation55--UnknownportUnknownport66--FilealreadyexistsFilealreadyexists77--nosuchusernosuchuser5TFTPtransfermodesTFTPtransfermodes““netasciinetascii””:fortransferringtextfiles.:fortransferringtextfiles.––alllinesendwithalllinesendwith\\rr\\n(CR,LF).n(CR,LF).––providesstandardformatfortransferringtextprovidesstandardformatfortransferringtextfiles.files.––bothendsresponsibleforconvertingto/frombothendsresponsibleforconvertingto/fromnetasciinetasciiformat.format.““octetoctet””:fortransferringbinaryfiles.:fortransferringbinaryfiles.––notranslationdone.notranslationdone.LostDataPacketsLostDataPackets--OriginalProtocolSpecificationOriginalProtocolSpecificationSenderusesatimeoutwithSenderusesatimeoutwithrestransmissionrestransmission..––sendercouldbeclientorserver.sendercouldbeclientorserver.DuplicatedatapacketsmustberecognizedDuplicatedatapacketsmustberecognized(ignored)andACKretransmitted.(ignored)andACKretransmitted.ThisoriginalprotocolsuffersfromtheThisoriginalprotocolsuffersfromthe““sorcerersorcerer’’sapprenticesyndrome.sapprenticesyndrome.6SorcererSorcerer’’sApprenticeSyndromesApprenticeSyndromesendDATA[n](timeout)restransmitDATA[n]receiveACK[n]sendDATA[n+1]receiveACK[n](dup)sendDATA[n+1](dup)...receiveDATA[n]sendACK[n]receiveDATA[n](dup)sendACK[n](dup)receiveDATA[n+1]sendACK[n+1]receiveDATA[n+1](dup)sendACK[n+1](dup)TheFixTheFixSendershouldnotSendershouldnotresendresendadatapacketinadatapacketinresponsetoaduplicateACK.responsetoaduplicateACK.IfsenderreceivesACK[n]IfsenderreceivesACK[n]--dondon’’tsendtsendDATA[n+1]iftheACKwasaduplicate.DATA[n+1]iftheACKwasaduplicate.
本文标题:tftp介绍
链接地址:https://www.777doc.com/doc-1725047 .html