⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc1433.txt

📁 最近的中文RFC文档
💻 TXT
📖 第 1 页 / 共 2 页
字号:
组织:中国互动出版网(http://www.china-pub.com/)
RFC文档中文翻译计划(http://www.china-pub.com/compters/emook/aboutemook.htm)
E-mail:ouyang@china-pub.com
译者:董士婵(董士婵 dsc_0522@sina.com)
译文发布时间:2001-3-27
版权:本中文翻译文档版权归中国互动出版网所有。可以用于非商业用途自由转载,但必须保留本文档的翻译及版权信息。
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)
本备忘录状态
这个备忘录为internet通信定义了一个实验的协议。为需求的增长提出讨论、建议。标准的说明和协议的状态请参照“IAB Official Protocol Standards”当前的版本。这个备忘录的表述是不受限制的。
摘要
路由器的一个接口通过同一个链路层接口到达两个IP网络时可以观察到那两个IP网络共享了那个链路层网络, 并且能通告信息到主机(via ICMP Redirects)和路由器(via dynamic routing protocols)。然而一个主机或路由器如果在“foreign”IP 网络到他们的响应链路地址不能够解析IP地址则不能用来与其他主机和路由器在仅仅一个IP网络上直接通信。直接ARP是一个动态地址解析过程可以使主机和路由器在外部IP网络到他们的链路地址上解决可能的通告到next-hop IP地址。
鸣谢  
作者感激Network Ssystems Corporation的Joel Halpern和David O'Leary,他给作者提供了宝贵的评论和见解,而且给予了精神上的支持并通过草稿给予了物质上的支援。IPLPDN工作组的成员通过IPLPDN邮件列表和介绍也提供了有价值的观点。Rutgers University 的Chuck Hedrick,Bell Communications Research的PaulTsuchiya,AT&T Bell Laboratories的Doris Tillman提供了早期的洞察作为早期的草稿。
1 术语  
链路层网络是时常参照子网(e.g.OSIparlance)以上的那层例如IP以下的那层。术语“链路层”被用来区别与“IP子网”可能引起的混乱,并传输IP数据报识别网络组地址。
从主机路由器的远景, 如果主机或路由器没有IP网络地址,IP网络是外部的。
2 介绍
多个IP网络可以在同一个链路层被管理(例如:在大的公共数据网络)。在两个IP网络上的单独接口的路由器用现行的路由更新过程去通告那两个IP网络共享那个链路层网络。Cost/performance的益处是可以实现如果主机和路由器不在同一个IP网络上也可以通告信息,直接交换数据,不如通过双重路由地址。但是如果不首先解决IP地址到数据链路层地址的映射,主机或路由器不能直接通讯。
控制ARP烘泛的蔓延。路由器执行的直接ARP过程能限制同一ARP请求的数量(例如:同一源IP地址和同一目的IP地址)则他将每隔一小段时间转发(例如:每秒不超过一个ARP请求)。在[5]中一贯建议的阻止ARP洪泛的过程。  
为每一个IP网络独立的建立IP地址解决过程。例如:在SMDS网络,解决地址可以用ARP实现,独立的SMDS ARP请求地址与每个IP网络映射。如果主机或路由器没有配置ARP请求地址,无法知道每个IP网络的ARP请求地址,不能给正确的ARP请求地址发送ARP请求。以太网的主机或路由器通过发送ARP请求到广播地址解析IP地址去猜测链路层地址。但是如果IP网络用不同的解析过程(例如:实施地址解析表),ARP回应不回应。 
直接ARP是能使路由器在共享的链路层网络能通告一个IP地址也能帮助解决IP地址到链路层地址的映射的过程
在解除地址解析的限制,直接ARP能通告和应用动态的路由协议如BGP、OSPF的路由信息中的外部网络的下一跳地址。另外,直接ARP能使路由器通告(通过ICMP   )外部主机的下一跳地址,主机能用直接ARP去解决外部的下一跳地址。
3 直接ARP
直接ARP用正常的ARP包格式,并用ARP过程的协助,在[1],[2]中定义,路由器和主机运行这些过程。
3.1 ARP求助地址
ARP求助地址主机路由器维护路由信息,定位路由表。每个路由表登记一个或多个到目的IP地址的下一跳IP地址和物理接口用来传输包到下一跳IP地址。如果目的地址是本地的(例如;没有路由器的协助可以到达),下一跳IP地址是NULL(或本地设备,如IP地址映射到物理接口)。否则,下一跳IP地址是下一个路由器的地址。主机或路由器贯彻直接ARP过程映射ARP求助地址到路由表的每个记录。如果主机或路由器已经配置了到链路层地址的下一跳IP地址的解析(或如果下一跳IP地址为空,解析目的IP地址),则ARP求助地址的映射为空。否则,ARP求助地址是提供路由信息、指导下一跳地址的路由器的IP地址,是同一链路层网络作为映射的物理接口第四张提供动态路由过程决定ARP求助地址的详细范例
3.2地址解析过程
传输一个IP包,主机路由器搜索路由表的记录,最优路径依靠目的IP地址和其他的因素(例如:服务类型)。选择路由表记录包括:下一跳路由器的IP地址(可能为空),转发IP包的物理接口,ARP求助地址(可能为空)和其他信息。路由功能通过下一跳IP地址、物理接口、ARP协助地址完成地址解析功能。地址解析功能必须能解析下一跳IP地址(或目的IP地址,如果下一跳IP地址为空)到链路层地址的映射。IP包被转发的链路层地址,及应该被转发的链路层帧地址映射的链路层地址封装IP包,并且转发帧通过正确的物理接口。此功能的详细描述通过以下C语言源代码。
此过程被两个函数组织。Route()和Resolve()各是路由和地址解决。另外,以下各层函数被应用:
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语言源代码.

   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语言源代码。
3.3转发ARP请求
主机执行直接ARP过程用标准过程去处理收到的ARP回应。就是说,如果目标IP地址是主机的地址,主机用标准过程响应ARP请求;如果目标IP地址不是主机地址,主机立刻抛弃ARP请求。
如果被路由器收到目标ARP请求的IP地址是路由器的地址,路由器用标准过程响应ARP请求。但是如果目标IP地址不是路由器的地址,路由器可以转发回ARP请求通过接收的那个接口,到路由表中与链路层地址相符的ARP求助地址。以下C语言源代码描述的过程用来处理ARP请求。函数Receive()描述跟随主机路由器的过程,函数Direct()描述跟随路由器的其他过程。另外,以下函数也被用到:
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.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -