ImageVerifierCode 换一换
格式:DOC , 页数:38 ,大小:1.40MB ,
资源ID:13044821      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/13044821.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(简单路由器设计与实现Word文件下载.doc)为本站会员(b****9)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

简单路由器设计与实现Word文件下载.doc

1、 推荐开发工具:Visual Studio 2010; 推荐编程语言:C+/ Visual C+; 函数库/开发包:Winpcap。3.实验内容(1) 学习并掌握winpcap编程:自行完成WinPcap教程中的内容,从而掌握winpcap编程。内容包括但不限于:a) 获取设备列表;b) 打开一个适配器并抓包(分组);c) 解析分组;d) 发送分组;学习内容及源程序参见WinPcap官方教程:http:/www.winpcap.org/docs/docs_412/html/group_wpcap_tut.html。(2) 利用winpcap开发包实现简单路由程序,该路由程序应该至少包括以下功能

2、:a) IP数据包捕获和转发;b) ARP请求与解析;c) 重新计算IP数据包的头部校验和;d) 处理IP数据包的头部校验和;处理IP数据包的TTL值;e) 静态路由表维护。在下图所示的完了过拓扑结构中,当所开发的路由器程序部署并运行在计算机C上时,它将(作为一个路由器)能够连通两个子网,正确地捕获、转发来自计算机A和计算机B的分组,使得两个子网中的主机能够互相访问图5-1 实验验证环境配置示意图4.实验方式每位同学独立上机编程实验,实验指导教师现场指导。5.参考内容(1) WinPcap简介Winpcap (windows packet capture)是windows平台下一个免费、公共的

3、网络访问系统。开发Winpcap项目的目的在于为win32应用程序提供访问网络底层的能力。它用于windows系统下的直接的网络编程。关于Winpcap的介绍请参阅Winpcap开发包可以在http:/www.winpcap.org/上下载,Winpcap的技术文档可以从http:/www.winpcap.org/docs/default.htm下载。附录中给出了主要函数的说明文档。(2) Winpcap主要函数及功能介绍Winpcap部分主要函数及其功能介绍如下:(1).int pcap_findalldevs_ex(char * source, struct pcap_rmtauth *

4、auth, pcap_if_t * alldevs, char * errbuf)函数功能:Create a list of network devices that can be opened withpcap_open().参数说明:source:a char* buffer that keeps the source localtion, according to the new WinPcap syntax. This source will be examined looking for adapters (local or remote) or pcap files,The str

5、ings that must be prepended to the source in order to define if we want local/remote adapters or files is defined in the new Source Specification Syntax .auth:a pointer to a pcap_rmtauth structure. This pointer keeps the information required to authenticate the RPCAP connection to the remote host. T

6、his parameter is not meaningful in case of a query to the local host: in that case it can be NULL.alldevs:a struct pcap_if_t pointer, which will be properly allocated inside this function. When the function returns, it is set to point to the first element of the interface list; each element of the l

7、ist is of type .errbuf: a pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one).返回值:0 if everything is fine, -1 if some errors occurred. The list of the devices is returned in the alldevs variable. When the function returns correctly

8、, cannot be NULL. In other words, this function returns also in case the system does not have any interface to list.(2).void pcap_freealldevs_ex(pcap_if_t * alldevsp)函数功能:Free an interface list returned by pcap_findalldevs().(3).pcap_t* pcap_open(const char * source, int snaplen, int flags, int read

9、_timeout, struct pcap_rmtauth * auth, char * errbuf)Open a generic source in order to capture / send (WinPcap only) traffic.zero-terminated string containing the source name to open. The source name has to include the format prefix according to the new Source Specification Syntax and it cannot be NU

10、LL.On on Linux systems with 2.2 or later kernels, a device argument of any can be used to capture packets from all interfaces. In order to makes the source syntax easier, please remember that:the adapters returned by the pcap_findalldevs_ex() can be used immediately by the pcap_open()in case the use

11、r wants to pass its own source string to the pcap_open(), the pcap_createsrcstr() helps in creating the correct source identifier.snaplen:length of the packet that has to be retained. For each packet received by the filter, only the first snaplen bytes are stored in the buffer and passed to the user

12、 application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.flags:keeps several flags that can be needed for capturing packets. The allowed flags are defined in the pcap_open() flags .read_timeout:read timeout in milliseconds. The read timeout is us

13、ed to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that dont, the read

14、 timeout is ignored.a pointer to a struct pcap_rmtauth that keeps the information required to authenticate the user on a remote machine. In case this is not a remote capture, this pointer can be set to NULL.a pointer to a user-allocated buffer which will contain the error in case this function fails

15、. The pcap_open() and findalldevs() are the only two functions which have this parameter, since they do not have (yet) a pointer to a pcap_t structure, which reserves space for the error string. Since these functions do not have (yet) a pcap_t pointer (the pcap_t pointer is NULL in case of errors), they need an expl

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1