查看: 15464|回复: 3

DHCP过程包问题

[复制链接]
发表于 2012-7-22 00:12:44 | 显示全部楼层 |阅读模式
offer包使用的是单播包,文档说法是客户端FLAG的置位可以改变服务器使用单播或多播方式发送offer包,但问题是客户端在此时根本没有拿到地址,offer包目的的地址却是待分配的地址,这样的话客户端为什么能收到此包?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?CSNA会员注册

×
回复

使用道具 举报

发表于 2012-7-24 15:01:58 | 显示全部楼层
分析一下包头,你会发现目的IP地址是中继设备的IP,到了中继设备,通过MAC地址查找。
回复

使用道具 举报

 楼主| 发表于 2012-7-25 10:25:47 | 显示全部楼层
中间没任何中继,DHCP服务器与客户端对接的
回复

使用道具 举报

发表于 2012-7-25 13:38:16 | 显示全部楼层
If the 'giaddr' field in a DHCP message from a client is non-zero,
   the server sends any return messages to the 'DHCP server' port on the
   BOOTP relay agent whose address appears in 'giaddr'. If the 'giaddr'
   field is zero and the 'ciaddr' field is nonzero, then the server
   unicasts DHCPOFFER and DHCPACK messages to the address in 'ciaddr'.
   If 'giaddr' is zero and 'ciaddr' is zero, and the broadcast bit is
   set, then the server broadcasts DHCPOFFER and DHCPACK messages to
   0xffffffff. If the broadcast bit is not set and 'giaddr' is zero and
   'ciaddr' is zero, then the server unicasts DHCPOFFER and DHCPACK
   messages to the client's hardware address and 'yiaddr' address.  In
   all cases, when 'giaddr' is zero, the server broadcasts any DHCPNAK
   messages to 0xffffffff.
giaddr就是客户端discover包bootp层“网关IP地址”;ciaddr是“客户端已知的IP地址”。你的discover包应该是这两个值和flag都是0,所以服务器用单播回应offer。客户机没有置位flag标识说明他的IP层能够在没有地址的时候处理这样单播。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | CSNA会员注册

本版积分规则

快速回复 返回顶部 返回列表