文档介绍:密级:
学士学位论文
THESIS OF BACHELOR
题目网络流量测量软件的设计与实现
学院:
专业: 计算机科学与技术
班级:
学号:
学生姓名:
指导教师:
起讫日期:
网络流量测量软件的设计与实现
摘要:为了方便网络编程,90年代初,由Microsoft联合了其他几家公司共同制定了一套WINDOWS下的网络编程接口,即Windows Sockets规范,它不是一种网络协议,而是一套开放的、支持多种协议的Windows下的网络编程接口。本篇论文主要是介绍了在TCP/IP基础上利用winsock2对网卡进行编程,以达到网络流量监测的目的。论文首先介绍了TCP/IP协议,旨在介绍IP,TCP,UDP等比较重要的协议。主要是介绍IP头,TCP头,UDP头的特点,以便从IP头中可以获取源地址,目的地址,协议类型等信息。在随后的章节中提出了Socket的概念,Socket实际上提供了一个通信端口使所有拥有Socket的端口的计算机之间能够相互通信,在本论文中主要说明了socket的建立,监听和撤销的过程。具体到程序实现中,对网卡混杂模式的设置是通过原始套接字(raw socket)来实现的。为了让原始套接字能接受所有的数据,还需要通过将SOCK_RAW设置成SIO_RCVALL。对数据包的获取通过recv()函数来完成。最后要完成的工作就是对所捕获的IP数据包进行分析以提取出我们所需要的信息。在论文的最后是旨在说明进一步工作的展开。
关键字: TCP/IP,Winsock,Bios
Abstract: For convenience work programming, in the early 1990s, a new set work programming interface using under WINDOWS was established by panies united by Microsoft. It is known as Windows Socket Norm. It isn't a kind work protocol, but an work programming interface support multiple protocols under WINDOWS. The main purpose of the thesis is to introduce how to use Winsock2 program work adapter under the protocol of TCP/IP. This is for the purpose of measure work discharge. At the beginning of the thesis, we introduce all important protocols of TCP/IP, like IP, TCP, and UDP. We introduce IP header, TCP header and UDP header for the most important because we need acquire the information of source address, destination address, and protocol type from the IP header.
In the following section, we give the concept of Socket. Sockets actually provide munication port to allow all puters that have Socket port municate with each other. In the thesis, we talk on the process of the Socket’s building listening and canceling. In the program, we use RAW Socket to set adapter on the mixed mode. To let the Socket receive all data, we also need to set the on SIO_RCVALL. Then we use the function recv () to get data pack. At last we need analyze the data pack to get the information we need.
KEY WORDS:TCP/IP, Winsock,RA