網(wǎng)絡(luò)流量測(cè)量軟件的設(shè)計(jì)與實(shí)現(xiàn).doc
網(wǎng)絡(luò)流量測(cè)量軟件的設(shè)計(jì)與實(shí)現(xiàn),摘 要:為了方便網(wǎng)絡(luò)編程,90年代初,由microsoft聯(lián)合了其他幾家公司共同制定了一套windows下的網(wǎng)絡(luò)編程接口,即windows sockets規(guī)范,它不是一種網(wǎng)絡(luò)協(xié)議,而是一套開放的、支持多種協(xié)議的windows下的網(wǎng)絡(luò)編程接口。本篇論文主要是介紹了在tcp/ip基礎(chǔ)上利用win...
內(nèi)容介紹
此文檔由會(huì)員 bshhty 發(fā)布網(wǎng)絡(luò)流量測(cè)量軟件的設(shè)計(jì)與實(shí)現(xiàn)
摘 要:為了方便網(wǎng)絡(luò)編程,90年代初,由Microsoft聯(lián)合了其他幾家公司共同制定了一套WINDOWS下的網(wǎng)絡(luò)編程接口,即Windows Sockets規(guī)范,它不是一種網(wǎng)絡(luò)協(xié)議,而是一套開放的、支持多種協(xié)議的Windows下的網(wǎng)絡(luò)編程接口。本篇論文主要是介紹了在TCP/IP基礎(chǔ)上利用winsock2對(duì)網(wǎng)卡進(jìn)行編程,以達(dá)到網(wǎng)絡(luò)流量監(jiān)測(cè)的目的。論文首先介紹了TCP/IP協(xié)議,旨在介紹IP,TCP,UDP等比較重要的協(xié)議。主要是介紹IP頭,TCP頭,UDP頭的特點(diǎn),以便從IP頭中可以獲取源地址,目的地址,協(xié)議類型等信息。在隨后的章節(jié)中提出了Socket的概念,Socket實(shí)際上提供了一個(gè)通信端口使所有擁有Socket的端口的計(jì)算機(jī)之間能夠相互通信,在本論文中主要說明了socket的建立,監(jiān)聽和撤銷的過程。具體到程序?qū)崿F(xiàn)中,對(duì)網(wǎng)卡混雜模式的設(shè)置是通過原始套接字(raw socket)來實(shí)現(xiàn)的。為了讓原始套接字能接受所有的數(shù)據(jù),還需要通過將SOCK_RAW設(shè)置成SIO_RCVALL。對(duì)數(shù)據(jù)包的獲取通過recv()函數(shù)來完成。最后要完成的工作就是對(duì)所捕獲的IP數(shù)據(jù)包進(jìn)行分析以提取出我們所需要的信息。在論文的最后是旨在說明進(jìn)一步工作的展開。
關(guān)鍵字: TCP/IP,Winsock,原始套接字,NetBios
Abstract: For convenience of network programming, in the early 1990s, a new set of network programming interface using under WINDOWS was established by some companies united by Microsoft. It is known as Windows Socket Norm. It isn't a kind of network protocol, but an open network programming interface support multiple protocols under WINDOWS. The main purpose of the thesis is to introduce how to use Winsock2 program on network adapter under the protocol of TCP/IP. This is for the purpose of measure the network 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 a communication port to allow all the computers that have Socket port to communicate 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,RAW SOCKET, NetBIOS
目錄
摘要…………………………………………………………………….1
Abstract………………………………………………………..2
前言…………………………………………………………………….4
第一章緒論……………………………………………………………5
1.1TCP/IP協(xié)議及其協(xié)議分析方法……………………………….5
1.1.1分層…………………………………………………………..5
1.1.2IP地址……………………………………………………….6
1.1.3端口…………………………………………………………..6
1.1.4TCP/IP協(xié)議在Windows中的實(shí)現(xiàn)………………………….7
1.2Winsock編程…………………………………………………...7
1.3網(wǎng)絡(luò)流量測(cè)量的程序?qū)崿F(xiàn)原理………………………………..8
第二章TCP/IP協(xié)議集………………………………………………9
2.1TCP/IP協(xié)議簡(jiǎn)介……………………………………………….9
2.2IP協(xié)議………………………………………………………….9
2.3TCP協(xié)議………………………………………………………..10
2.3.1TCP服務(wù)模型………………………………………………..10
2.3.2TCP數(shù)據(jù)段頭………………………………………………..11
2.3.3TCP協(xié)議的建立……………………………………………..12
2.4UDP協(xié)議………………………………………………………..13
第三章WINSOCK編程概述…………………………………………14
3.1套接字的概念………………………………………………….14
3.2套接字的種類………………………………………………….14
3.3套接字的建立………………………………………………….14
第四章網(wǎng)絡(luò)流量測(cè)量的程序?qū)崿F(xiàn)……………………………….16
4.1網(wǎng)卡初始化…………………………………………………….16
4.1.1NetBios概述…………………………………………………16
4.1.2利用NetBios來初始化網(wǎng)卡………………………………..16
4.2原始套接字的設(shè)置…………………………………………….16
4.3IP包的協(xié)議分析………………………………………………17
4.4結(jié)果與測(cè)試…………………………………………………….19
結(jié) 論…………………………………………………………………….21
結(jié)束語…………………………………………………………………….22
參考文獻(xiàn)…………………………………………………………………23
TA們正在看...
- 新進(jìn)員工工作意識(shí)培訓(xùn).ppt
- 動(dòng)作經(jīng)濟(jì)法則.ppt
- 日資iso體系三級(jí)文件--異常管理基準(zhǔn).xls
- 臺(tái)資iso體系三階文件--模具qc工程表.doc
- 臺(tái)資iso體系二階文件--量測(cè)儀器管制作業(yè)程序.doc
- 防呆法則.ppt
- 鄉(xiāng)鎮(zhèn)2014年春運(yùn)期間道路交通安全綜合治理方案.doc
- 鄉(xiāng)鎮(zhèn)2014年第一季度農(nóng)機(jī)安全大檢查實(shí)施方案.doc
- 鄉(xiāng)鎮(zhèn)2014年元旦春節(jié)前安全大檢查活動(dòng)的工作方案.doc
- “閱讀中外經(jīng)典,享受讀書樂趣”課題實(shí)驗(yàn)方案.doc