資源簡介
在實現(xiàn)TCP/IP協(xié)議的網(wǎng)絡(luò)環(huán)境下,一個ip包走到哪里,要怎么走是靠路由表定義,但是,當(dāng)ip包到達(dá)該網(wǎng)絡(luò)后,哪臺機(jī)器響應(yīng)這個ip包卻是靠該ip包中所包含的硬件mac地址來識別。也就是說,只有機(jī)器的硬件mac地址和該ip包中的硬件mac地址相同的機(jī)器才會應(yīng)答這個ip包,因為在網(wǎng)絡(luò)中,每一臺主機(jī)都會有發(fā)送ip包的時候,所以,在每臺主機(jī)的內(nèi)存中,都有一個 arp--> 硬件mac 的轉(zhuǎn)換表。通常是動態(tài)的轉(zhuǎn)換表(該arp表可以手工添加靜態(tài)條目)。也就是說,該對應(yīng)表會被主機(jī)在一定的時間間隔后刷新。這個時間間隔就是ARP高速緩存的超時時間。
通常主機(jī)在發(fā)送一個ip包之前,它要到該轉(zhuǎn)換表中尋找和ip包對應(yīng)的硬件mac地址,如果沒有找到,該主機(jī)就發(fā)送一個ARP廣播包,于是,主機(jī)刷新自己的ARP緩存。然后發(fā)出該ip包。

代碼片段和文件信息
//?Arptest.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Arptest.h“
#include?“ArptestDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CArptestApp
BEGIN_MESSAGE_MAP(CArptestApp?CWinApp)
//{{AFX_MSG_MAP(CArptestApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CArptestApp?construction
CArptestApp::CArptestApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CArptestApp?object
CArptestApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CArptestApp?initialization
BOOL?CArptestApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CArptestDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????338944??2010-06-27?16:29??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\08.ppt
?????文件??????37828??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.aps
?????文件???????2417??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.clw
?????文件???????2077??2008-06-22?21:06??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.cpp
?????文件???????4453??2010-06-27?09:15??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.dsp
?????文件????????539??2008-06-22?21:06??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.dsw
?????文件???????1335??2008-06-22?21:06??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.h
?????文件?????254976??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.ncb
?????文件??????51712??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.opt
?????文件???????1474??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.plg
?????文件???????7240??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Arptest.rc
?????文件??????10775??2010-06-27?09:08??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\ArptestDlg.cpp
?????文件???????1740??2009-06-18?14:53??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\ArptestDlg.h
?????文件????2138157??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Arptest.exe
?????文件??????12978??2010-06-27?09:09??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Arptest.obj
?????文件????3589120??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Arptest.pdb
?????文件???????9752??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Arptest.res
?????文件??????????0??2010-06-27?09:09??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Arptest.sbr
?????文件??????43613??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\ArptestDlg.obj
?????文件??????????0??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\ArptestDlg.sbr
?????文件??????13769??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Sender.obj
?????文件??????????0??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\Sender.sbr
?????文件?????106744??2010-06-27?09:09??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\StdAfx.obj
?????文件????1374446??2010-06-27?09:09??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\StdAfx.sbr
?????文件??????17646??2010-06-27?09:12??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\SysInfo.obj
?????文件??????????0??2010-06-27?09:12??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\SysInfo.sbr
?????文件?????389120??2010-06-27?09:40??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Debug\vc60.pdb
?????文件???????3963??2002-04-10?13:45??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Devioctl.h
?????文件???????9512??2002-01-30?17:32??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\IPEXPORT.H
?????文件??????15896??2009-06-18?22:11??計算機(jī)網(wǎng)絡(luò)課設(shè)代碼\Arptest\Iphlpapi.h
............此處省略363個文件信息
評論
共有 條評論