?? rfc1433.txt
字號(hào):
組織:中國(guó)互動(dòng)出版網(wǎng)(http://www.china-pub.com/)
RFC文檔中文翻譯計(jì)劃(http://www.china-pub.com/compters/emook/aboutemook.htm)
E-mail:ouyang@china-pub.com
譯者:董士嬋(董士嬋 dsc_0522@sina.com)
譯文發(fā)布時(shí)間:2001-3-27
版權(quán):本中文翻譯文檔版權(quán)歸中國(guó)互動(dòng)出版網(wǎng)所有。可以用于非商業(yè)用途自由轉(zhuǎn)載,但必須保留本文檔的翻譯及版權(quán)信息。
Network Working Group J. Garrett
Request for Comments: 1433 AT&T Bell Laboratories
J. Hagan
University of Pennsylvania
J. Wong
AT&T Bell Laboratories
March 1993
直接ARP
(Directed ARP)
本備忘錄狀態(tài)
這個(gè)備忘錄為internet通信定義了一個(gè)實(shí)驗(yàn)的協(xié)議。為需求的增長(zhǎng)提出討論、建議。標(biāo)準(zhǔn)的說(shuō)明和協(xié)議的狀態(tài)請(qǐng)參照“IAB Official Protocol Standards”當(dāng)前的版本。這個(gè)備忘錄的表述是不受限制的。
摘要
路由器的一個(gè)接口通過(guò)同一個(gè)鏈路層接口到達(dá)兩個(gè)IP網(wǎng)絡(luò)時(shí)可以觀察到那兩個(gè)IP網(wǎng)絡(luò)共享了那個(gè)鏈路層網(wǎng)絡(luò), 并且能通告信息到主機(jī)(via ICMP Redirects)和路由器(via dynamic routing protocols)。然而一個(gè)主機(jī)或路由器如果在“foreign”IP 網(wǎng)絡(luò)到他們的響應(yīng)鏈路地址不能夠解析IP地址則不能用來(lái)與其他主機(jī)和路由器在僅僅一個(gè)IP網(wǎng)絡(luò)上直接通信。直接ARP是一個(gè)動(dòng)態(tài)地址解析過(guò)程可以使主機(jī)和路由器在外部IP網(wǎng)絡(luò)到他們的鏈路地址上解決可能的通告到next-hop IP地址。
鳴謝
作者感激Network Ssystems Corporation的Joel Halpern和David O'Leary,他給作者提供了寶貴的評(píng)論和見(jiàn)解,而且給予了精神上的支持并通過(guò)草稿給予了物質(zhì)上的支援。IPLPDN工作組的成員通過(guò)IPLPDN郵件列表和介紹也提供了有價(jià)值的觀點(diǎn)。Rutgers University 的Chuck Hedrick,Bell Communications Research的PaulTsuchiya,AT&T Bell Laboratories的Doris Tillman提供了早期的洞察作為早期的草稿。
1 術(shù)語(yǔ)
鏈路層網(wǎng)絡(luò)是時(shí)常參照子網(wǎng)(e.g.OSIparlance)以上的那層例如IP以下的那層。術(shù)語(yǔ)“鏈路層”被用來(lái)區(qū)別與“IP子網(wǎng)”可能引起的混亂,并傳輸IP數(shù)據(jù)報(bào)識(shí)別網(wǎng)絡(luò)組地址。
從主機(jī)路由器的遠(yuǎn)景, 如果主機(jī)或路由器沒(méi)有IP網(wǎng)絡(luò)地址,IP網(wǎng)絡(luò)是外部的。
2 介紹
多個(gè)IP網(wǎng)絡(luò)可以在同一個(gè)鏈路層被管理(例如:在大的公共數(shù)據(jù)網(wǎng)絡(luò))。在兩個(gè)IP網(wǎng)絡(luò)上的單獨(dú)接口的路由器用現(xiàn)行的路由更新過(guò)程去通告那兩個(gè)IP網(wǎng)絡(luò)共享那個(gè)鏈路層網(wǎng)絡(luò)。Cost/performance的益處是可以實(shí)現(xiàn)如果主機(jī)和路由器不在同一個(gè)IP網(wǎng)絡(luò)上也可以通告信息,直接交換數(shù)據(jù),不如通過(guò)雙重路由地址。但是如果不首先解決IP地址到數(shù)據(jù)鏈路層地址的映射,主機(jī)或路由器不能直接通訊。
控制ARP烘泛的蔓延。路由器執(zhí)行的直接ARP過(guò)程能限制同一ARP請(qǐng)求的數(shù)量(例如:同一源IP地址和同一目的IP地址)則他將每隔一小段時(shí)間轉(zhuǎn)發(fā)(例如:每秒不超過(guò)一個(gè)ARP請(qǐng)求)。在[5]中一貫建議的阻止ARP洪泛的過(guò)程。
為每一個(gè)IP網(wǎng)絡(luò)獨(dú)立的建立IP地址解決過(guò)程。例如:在SMDS網(wǎng)絡(luò),解決地址可以用ARP實(shí)現(xiàn),獨(dú)立的SMDS ARP請(qǐng)求地址與每個(gè)IP網(wǎng)絡(luò)映射。如果主機(jī)或路由器沒(méi)有配置ARP請(qǐng)求地址,無(wú)法知道每個(gè)IP網(wǎng)絡(luò)的ARP請(qǐng)求地址,不能給正確的ARP請(qǐng)求地址發(fā)送ARP請(qǐng)求。以太網(wǎng)的主機(jī)或路由器通過(guò)發(fā)送ARP請(qǐng)求到廣播地址解析IP地址去猜測(cè)鏈路層地址。但是如果IP網(wǎng)絡(luò)用不同的解析過(guò)程(例如:實(shí)施地址解析表),ARP回應(yīng)不回應(yīng)。
直接ARP是能使路由器在共享的鏈路層網(wǎng)絡(luò)能通告一個(gè)IP地址也能幫助解決IP地址到鏈路層地址的映射的過(guò)程
在解除地址解析的限制,直接ARP能通告和應(yīng)用動(dòng)態(tài)的路由協(xié)議如BGP、OSPF的路由信息中的外部網(wǎng)絡(luò)的下一跳地址。另外,直接ARP能使路由器通告(通過(guò)ICMP )外部主機(jī)的下一跳地址,主機(jī)能用直接ARP去解決外部的下一跳地址。
3 直接ARP
直接ARP用正常的ARP包格式,并用ARP過(guò)程的協(xié)助,在[1],[2]中定義,路由器和主機(jī)運(yùn)行這些過(guò)程。
3.1 ARP求助地址
ARP求助地址主機(jī)路由器維護(hù)路由信息,定位路由表。每個(gè)路由表登記一個(gè)或多個(gè)到目的IP地址的下一跳IP地址和物理接口用來(lái)傳輸包到下一跳IP地址。如果目的地址是本地的(例如;沒(méi)有路由器的協(xié)助可以到達(dá)),下一跳IP地址是NULL(或本地設(shè)備,如IP地址映射到物理接口)。否則,下一跳IP地址是下一個(gè)路由器的地址。主機(jī)或路由器貫徹直接ARP過(guò)程映射ARP求助地址到路由表的每個(gè)記錄。如果主機(jī)或路由器已經(jīng)配置了到鏈路層地址的下一跳IP地址的解析(或如果下一跳IP地址為空,解析目的IP地址),則ARP求助地址的映射為空。否則,ARP求助地址是提供路由信息、指導(dǎo)下一跳地址的路由器的IP地址,是同一鏈路層網(wǎng)絡(luò)作為映射的物理接口第四張?zhí)峁﹦?dòng)態(tài)路由過(guò)程決定ARP求助地址的詳細(xì)范例
3.2地址解析過(guò)程
傳輸一個(gè)IP包,主機(jī)路由器搜索路由表的記錄,最優(yōu)路徑依靠目的IP地址和其他的因素(例如:服務(wù)類(lèi)型)。選擇路由表記錄包括:下一跳路由器的IP地址(可能為空),轉(zhuǎn)發(fā)IP包的物理接口,ARP求助地址(可能為空)和其他信息。路由功能通過(guò)下一跳IP地址、物理接口、ARP協(xié)助地址完成地址解析功能。地址解析功能必須能解析下一跳IP地址(或目的IP地址,如果下一跳IP地址為空)到鏈路層地址的映射。IP包被轉(zhuǎn)發(fā)的鏈路層地址,及應(yīng)該被轉(zhuǎn)發(fā)的鏈路層幀地址映射的鏈路層地址封裝IP包,并且轉(zhuǎn)發(fā)幀通過(guò)正確的物理接口。此功能的詳細(xì)描述通過(guò)以下C語(yǔ)言源代碼。
此過(guò)程被兩個(gè)函數(shù)組織。Route()和Resolve()各是路由和地址解決。另外,以下各層函數(shù)被應(yīng)用:
Get_Route(IP_Add,Other) returns a pointer to the routing table
entry with the destination field that best matches IP_Add. If no
matching entry is found, NULL is returned. Other information such
as Type of Service may be considered in selecting the best route.
Forward(Packet,Link_Level_Add,Phys_Int) fragments Packet (if
needed), and encapsulates Packet in one or more Link Level Frames
addressed to Link_Level_Add, and forwards the frame(s) through
interface, Phys_Int.
Look_Up_Add_Res_Table(IP_Add,Phys_Int) returns a pointer to the
link level address associated with IP_Add in the address
resolution table associated with interface, Phys_Int. If IP_Add
is not found in the address resolution table, NULL is returned.
Local_Add_Res(IP_Add,Phys_Int) returns a pointer to the Link Level
address associated with IP_Add, using address resolution
procedures associated with address, IP_Add, and interface,
Phys_Int. If address resolution is unsuccessful, NULL is
returned. Note that different address resolution procedures may
be used for different IP networks.
Receive_ARP_Response(IP_Add,Phys_Int) returns a pointer to an ARP
Response received through interface, Phys_Int, that resolves
IP_Add. If no ARP response is received, NULL is returned.
Dest_IP_Add(IP_Packet) returns the IP destination address from
IP_Packet.
Next_Hop(Entry) returns the IP address in the next-hop field of
(routing table) Entry.
Interface(Entry) returns the physical interface field of (routing
table) Entry.
ARP_Helper_Add(Entry) returns the IP address in the ARP Helper
Address field of (routing table) Entry.
ARP_Request(IP_Add) returns an ARP Request packet with IP_Add as
the Target IP address.
Source_Link_Level(ARP_Response) returns the link level address of
the sender of ARP_Response.
ROUTE(IP_Packet)
{
Entry = Get_Route(Dest_IP_Add(IP_Packet),Other(IP_Packet));
If (Entry == NULL) /* No matching entry in routing table */
Return; /* Discard IP_Packet */
else
{ /* Resolve next-hop IP address to link level address */
If (Next_Hop(Entry) != NULL) /* Route packet via next-hop router */
Next_IP = Next_Hop(Entry);
else /* Destination is local */
Next_IP = Dest_IP_Add(IP_Packet);
L_L_Add = Resolve(Next_IP,Interface(Entry),ARP_Helper_Add(Entry));
If (L_L_Add != NULL)
Forward(IP_Packet,L_L_Add,Interface(Entry));
else /* Couldn't resolve next-hop IP address */
Return; /* Discard IP_Packet */
Return;
}
}
路由功能的C語(yǔ)言源代碼.
Resolve(IP_Add,Interface,ARP_Help_Add)
{
If ((L_L_Add = Look_Up_Add_Res_Table(IP_Add,Interface)) != NULL)
{ /* Found it in Address Resolution Table */
Return L_L_Add;
}
else
{
If (ARP_Help_Add == NULL)
{ /* Do local Address Resolution Procedure */
Return Local_Add_Res(IP_Add,Interface);
}
else /* ARP_Help_Add != NULL */
{
L_L_ARP_Help_Add = Look_Up_Add_Res_Table(ARP_Help_Add,Interface);
If (L_L_ARP_Help_Add == NULL)
/* Not in Address Resolution Table */
L_L_ARP_Help_Add = Local_Add_Res(ARP_Help_Add,Interface);
If (L_L_ARP_Help_Add == NULL) /* Can't Resolve ARP Helper Add */
Return NULL; /* Address Resolution Failed */
else
{ /* ARP for IP_Add */
Forward(ARP_Request(IP_Add),L_L_ARP_Help_Add,Interface);
ARP_Resp = Receive_ARP_Response(IP_Add,Interface);
If (ARP_Resp == NULL) /* No ARP Response (after persistence) */
Return NULL; /* Address Resolution Failed */
else
Return Source_Link_Level(ARP_Resp);
}
}
}
}
}
地址解析功能的C語(yǔ)言源代碼。
3.3轉(zhuǎn)發(fā)ARP請(qǐng)求
主機(jī)執(zhí)行直接ARP過(guò)程用標(biāo)準(zhǔn)過(guò)程去處理收到的ARP回應(yīng)。就是說(shuō),如果目標(biāo)IP地址是主機(jī)的地址,主機(jī)用標(biāo)準(zhǔn)過(guò)程響應(yīng)ARP請(qǐng)求;如果目標(biāo)IP地址不是主機(jī)地址,主機(jī)立刻拋棄ARP請(qǐng)求。
如果被路由器收到目標(biāo)ARP請(qǐng)求的IP地址是路由器的地址,路由器用標(biāo)準(zhǔn)過(guò)程響應(yīng)ARP請(qǐng)求。但是如果目標(biāo)IP地址不是路由器的地址,路由器可以轉(zhuǎn)發(fā)回ARP請(qǐng)求通過(guò)接收的那個(gè)接口,到路由表中與鏈路層地址相符的ARP求助地址。以下C語(yǔ)言源代碼描述的過(guò)程用來(lái)處理ARP請(qǐng)求。函數(shù)Receive()描述跟隨主機(jī)路由器的過(guò)程,函數(shù)Direct()描述跟隨路由器的其他過(guò)程。另外,以下函數(shù)也被用到:
Is_Local_IP_Add(IP_Add,Phys_Int) returns TRUE if Phys_Int has been
assigned IP address, IP_Add. Otherwise, returns FALSE.
Do_ARP_Processing(ARP_Request,Interface) processes ARP_Request
using ARP procedures described in [2].
I_Am_Router returns TRUE if device is a router and False if device
is a host.
Target_IP(ARP_Request) returns the Target IP address from
ARP_Request.
Filter(ARP_Request,Phys_Int) returns TRUE if ARP_Request passes
filtering constraints, and FALSE if filtering constraints are not
passed. See section 3.4.
Forward(Packet,Link_Level_Add,Phys_Int) fragments Packet (if
needed), and encapsulates Packet in one or more Link Level Frames
addressed to Link_Level_Add, and forwards the frame(s) through
interface, Phys_Int.
Look_Up_Next_Hop_Route_Table(IP_Add) returns a pointer to the
routing table entry with the next-hop field that matches IP_Add.
If no matching entry is found, NULL is returned.
Look_Up_Dest_Route_Table(IP_Add) returns a pointer to the routing
table entry with the destination field that best matches IP_Add.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -