网络编程,Windows OS的RARP协议实现 [英] Network programming, RARP protocol implementation for windows os

查看:323
本文介绍了网络编程,Windows OS的RARP协议实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一些连接到本地网络的设备,并且拥有所有的mac地址.
我想向每个设备发送rarp数据包以分配IP地址.

我没有使用winpcap的权限,因此应该手动进行.

我已经手动为rarp(42字节)制作了以太网数据包,但是当我用raw_sock发送以太网数据包时,我通过Wireshark监视了网络,并且可以看到ip数据包而不是rarp.

请给我您的建议.

Hi all,

I have some devices connected to my local network and I have all the mac addresses.
I want to send rarp packet to each device to assign ip address.

I do not have the permission to use winpcap so I should do it manually.

I have made the ethernet packet for rarp (42 byte)manually, but when I send it with raw_sock I monitor the network by Wireshark and can see ip packet and not rarp.

please give me your advice.

推荐答案

RARP(revrse ARP)不是"over IP"协议,而是MAC层协议(因此套接字库可能是没有帮助),并且非常过时.

动态分配IP地址的正确方法是通过BOOTP/DHCP(请在 http://www.rfc- editor.org/rfcxx00.html [^ ])
The RARP (revrse ARP) is not an "over IP" protocol, but a MAC layer protocol (so the socket library may be not helpful) and is very outdated.

The proper way to dynamically assign an IP address is through BOOTP / DHCP (check the corresponding description at http://www.rfc-editor.org/rfcxx00.html[^])


我不认为这样做是正确的方法,原始套接字倾向于在某些OS上起作用而在其他OS上不起作用,为了实现此目的,您需要开发一个NDSI协议驱动程序(或类似的示例:TDI)将使您能够在OSI模型的数据链路层发送数据包.


问候,

K.D
I don''t believe this the right way to do this, raw sockets tend to work on some OSs and not work on others, in order accomplish this you need to develop an NDSI Protocol driver (or something similar example: TDI) this will allow you to send packets at the data link layer of the OSI model.


Regards,

K.D


感谢您的回答,我想NDSI协议驱动程序将完全响应我需要开发的内容.我将采用这种方式,如果您有一些教程或代码示例,请提供给我.

谢谢大家.
Thanks for your answers, i guess that the NDSI Protocol driver will respond exactely to what i need to develop. I will go this way, if you have some tutorials or code exemples please provide it to me.

thanks all.


这篇关于网络编程,Windows OS的RARP协议实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆