tftp协议的实现 2012-09-16 17:56:04     http://blog.chinaunix.net/uid-26833883-id-3349499.html

外文讨论的option negotiation两篇文章。

http://reboot.pro/topic/3711-problem-with-option-negotation-and-pxe-booting/

http://www.911cd.net/forums//index.php?showtopic=15435&st=0

https://www.kernel.org/pub/software/network/tftp/tftp-hpa/  source code

在zlg i283单板的环境搭建中,和tftp杠上了。

window xp上,tftp32设置正常情况下,tftp传输断断续续,根本没法使用,经过尝试,uncheck option negotiation后,传输正常。

后来抓包发现传输的包序号不正常。刚开始以为是防火墙或者是其他网络服务包干扰引起。最后都一一排除,还是tftp协议本身的问题。

在ubuntu12.04上,安装tftpd-hpa并按照教程设置后,也是断断续续的。

方法:tftp协议流程参考tcpipguide. 网络上实际报文流程需要抓包来分析。然后 对比正常和非正常的tftp抓包结果看出是blksize差异导致的。xp情况下无option negotiation应答包。但ubuntu下不清楚如何取消此应答机制,只能通过修改-B 参数来限制客户端发起的大包传输。如何修改tftpd-hpa的参数,通过查看源码来了解到参数选项。然后去/etc/default/tftpd-hpa中修改TFTP_OPTIONS="-l -c -s"修改为“-l -c -s -B 558". 然后发起sudo /etc/init.d/tftpd-hpa restart即可。

netstat -a|grep tftp可以查看tftp服务是否打开。

另外,在使用nfs的过程中,很奇怪,需要修改成全双工100M的网卡设置,才可以使用,设置成自动检测则不行。

而在ubuntu中设置,可以通过mii-tool或者ethtool来修改和查看网卡参数。http://linux.chinaitlab.com/administer/838653.html

  ethtool -s DEVNAME

  [ speed 10|100|1000 ]

  [ duplex half|full ]

  [ port tp|aui|bnc|mii|fibre ]

  [ autoneg on|off ]

windows xp上的设置比较简单,直接去网卡设置里选择即可。

static struct option long_options[] = {
    { "ipv4",        0, NULL, '4' },
    { "ipv6",        0, NULL, '6' },
    { "create",      0, NULL, 'c' },
    { "secure",      0, NULL, 's' },
    { "permissive",  0, NULL, 'p' },
    { "verbose",     0, NULL, 'v' },
    { "verbosity",   1, NULL, OPT_VERBOSITY },
    { "version",     0, NULL, 'V' },
    { "listen",      0, NULL, 'l' },
    { "foreground",  0, NULL, 'L' },
    { "address",     1, NULL, 'a' },
    { "blocksize",   1, NULL, 'B' },
    { "user",        1, NULL, 'u' },
    { "umask",       1, NULL, 'U' },
    { "refuse",      1, NULL, 'r' },
    { "timeout",     1, NULL, 't' },
    { "retransmit",  1, NULL, 'T' },
    { "port-range",  1, NULL, 'R' },
    { "map-file",    1, NULL, 'm' },
    { "pidfile",     1, NULL, 'P' },
    { NULL, 0, NULL, 0 }
};

https://www.kernel.org/pub/software/network/tftp/tftp-hpa/   installed on ubuntu.here is the source code.

http://www.tcpipguide.com/free/t_TFTPOptionsandOptionNegotiation.htm

TFTP Options and Option Negotiation 
(Page 1 of 4)

One of the difficulties that designers of simple protocols and applications seem to have is keeping them simple. Many protocols start out small but over time, well-intentioned users suggest improvements that are added slowly but surely. Eventually, the program that was once “lean and mean” has become, well, shall we say, “well-marbled”. J In the software industry, this is called “feature creep” and it has happened to many protocols and applications.

The temptation to add features is especially strong when the program or protocol has few to begin with. Given this, the maintainers of the TFTP protocol have done a good job over the years of avoiding this pitfall. However, they did allow one new feature to be added to the protocol in 1995: the TFTP Option Extension, which describes how a TFTP client and server can negotiate options before transferring a file.

The reason for adding this capability is that the original TFTP protocol provided no way at all for the client and server to exchange important control information prior to sending a file. This limited the flexibility of the protocol to deal with special cases, such as the transfer of data over unusual network types. The TFTP option negotiation feature allows additional parameters to be exchanged between the client and server which govern how data is transferred. It does this without significantly complicating the protocol, and is backward-compatible with normal TFTP. It is only used if both client and server support it, and one device trying to use the feature will not cause problems if the other doesn't support it.

tftp negotiation相关推荐

  1. Windows下通过 Uboot TFTP 方式下载和启动rt-smart 内核

    Windows下通过 Uboot TFTP 方式下载和启动rt-smart 内核 i.MX6ULL 系列处理器启动方式多样,启动时会首先执行芯片内部 Boot ROM 中的程序.Boot ROM 会根 ...

  2. TFTP协议分析与实现

    闲暇之余做一个模块化的TFTP DEMO程序,记录一下. 1.TFTP协议与功能点介绍: TFTP采用UDP协议进行TFTP协议的文件传输,其默认的协议socket为:UDP + port 69:UD ...

  3. GO Negotiation流程分析

    本文为<深入理解Android Wi-Fi.NFC和GPS卷>读书笔记,Android源码为Android 5.1 P2pStateMachine收到P2P_PROV_DISC_PBC_R ...

  4. tftp:timeout问题解决 - 从Windows传输文件到开发板

    通过串口工具ping一下主机,确定是否能ping通,确保通信无问题,如下 ping通后,确保PC tftp软件打开, 检查防火墙是否关闭,专用网络是家庭网络,允许同网段下的数据传输,无需关闭,因此只需 ...

  5. 内容协商 (Content Negotiation)

    大多数响应包含一个实体,此实体包含人类用户能理解的信息.通常,希望提供给用户相应于请求最容易得到的实体.对服务器和缓存来说,不幸的是,并不是所有的用户都对这个最容易得到的实体有喜好,并且并不是所有的用 ...

  6. DHCP tftp PXE实现Ghost网络克隆

    概述: 加ghost参数,实现客户端只需连接网线,在无光驱.软驱的情况下,且无需其他配置,完成网络克隆. 所要用到的软件: 1.ghost 8.2 企业版中的Ghost Boot Wizard(其中的 ...

  7. 简单文件传输协议TFTP分析还原

    " 介绍TFTP协议及传输内容的还原." TFTP,全称为Trivial File Transfer Protocol,即简单文件传输协议,是一个用来在客户端与服务器之间进行简单文 ...

  8. 开发板tftp:timeout问题

    想要从PC上面tftp文件的时候遇到了tftp:timeout的问题: >: tftp -gr gprsapp 192.168.1.38 tftp: timeout 检查了网络,可以ping的通 ...

  9. FTP与TFTP的区别

    文件传输协议(FTP)实际上就是传输文件的协议,它可以应用在任意两台主机之间,但是FTP不仅仅是一个协议,它同时也是一个程序.作为协议,FTP是被应用程序所使用的;而作为程序,用户需要通过手动方式来使 ...

  10. POP3 SMTP DNS DHCP UDP HTTP FTP HTTPS Telnet WIDOWS TFTP 常用协议和默认端口,计算机网络的很需要!!!

    POP3协议用于接收或下载邮件,默认端口110 SMTP协议用于传输或发送邮件,默认端口25 DNS是域名解析的系统,默认端口53 DHCP是动态主机配置协议,默认端口67(服务器) 68(客户) D ...

最新文章

  1. Android Studio Gradle优化方法
  2. 从实例入手学习使用vue+axios配置代理进行跨域访问百度音乐API
  3. 大一新生开发的小工具火了!不一样的 Python 编程体验,还是可视化的那种
  4. 使用Windows software center进行在线更新的后台进程SCClient.exe
  5. mount NTFS FOR RHEL5
  6. [NodeJs] 如果发现node_modules中有个模块代码有bug,你该怎么办?
  7. iOS 网络与多线程--7.Performselector消息处理方法
  8. CentOS7安装VPP(FD.io)
  9. 新版淘宝宽屏轮播代码带缩略图
  10. android 的android httpClient详解
  11. cdr怎么转plt_win10系统怎么将cdr格式转换成plt?
  12. 电阻用计算机怎么算,电阻分压计算器_电阻分压计算公式_电阻分压计算软件 - 电子发烧友(www.elecfans.com)...
  13. 「超级右键」Mac上最强的右键菜单工具,让你效率飞起!
  14. 大学英语综合教程四 Unit 2 课文内容英译中 中英翻译
  15. 用于音频信号去噪的谱相减和陷波滤波的比较(Matlab代码实现)
  16. 膜拜!阿里内部学习的五大深入理解Java虚拟机PDF,真的强
  17. 快速实践大规模轻量级图片分类模型:飞桨识图 PP-ShiTu
  18. 畅销图书排行榜TOP10(2009上半年)
  19. Python金融系列第八篇:Fama-French 多因子模型
  20. 小米OV,明年靠什么冲刺KPI?

热门文章

  1. python酒店管理系统案例
  2. 【基于stm32f103c8t6RFID-RC522智能开关】
  3. wps中将二维表转换为一维表
  4. windows7无声音,提示扬声器、耳机未插入的解决办法!电脑右下角喇叭显示未插入扬声器或耳机怎么解决!
  5. 一图看懂编程语言分类
  6. Edsger W. Dijkstra -- 巨人的肩膀
  7. linux工作札记 - 查看发行版本命令
  8. java将pdf旋转(亲测有效)
  9. 计算机打印怎么取消,打印机如何取消打印作业?如何删除打印作业?
  10. 计算机打印机图标删除吗,故障之:打印图标消失及打印任务无法取消