CN1177437C - A method for implementing fast forwarding and supporting load sharing - Google Patents
A method for implementing fast forwarding and supporting load sharing Download PDFInfo
- Publication number
- CN1177437C CN1177437C CNB021178747A CN02117874A CN1177437C CN 1177437 C CN1177437 C CN 1177437C CN B021178747 A CNB021178747 A CN B021178747A CN 02117874 A CN02117874 A CN 02117874A CN 1177437 C CN1177437 C CN 1177437C
- Authority
- CN
- China
- Prior art keywords
- output interface
- interface information
- node
- information
- pointer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种实现快速转发并支持负载分担的方法,属于IP网络通信技术领域。The invention relates to a method for realizing fast forwarding and supporting load sharing, and belongs to the technical field of IP network communication.
背景技术Background technique
参见图1和图2,路由器中快速转发模块(Fast Switch)和负载分担模块(LoadBalance)的位置如图中所示。这两个模块的特性是相互独立的。下面分别介绍现有设备中快速转发模块和负载分担模块的基本处理流程。Referring to Figure 1 and Figure 2, the positions of the fast forwarding module (Fast Switch) and the load balancing module (LoadBalance) in the router are shown in the figure. The features of these two modules are independent of each other. The basic processing procedures of the fast forwarding module and the load sharing module in the existing equipment are respectively introduced below.
在路由器未使能快速转发功能时,其接收到的报文将经过链路层直接送交IP层进行转发处理:该报文在IP层查找路由表,根据相应的路由信息选择对应的接口发送。该报文经IP层输出到链路层后,将更换新的链路层帧头信息,然后从物理层发出。在路由器使能了快速转发功能之后,其接收到的报文在链路层将进行如下处理:首先查找路由缓存表(又称:快速转发表)。如果未发现与其匹配的表项,该报文将被送交IP层进行上述的转发处理。所不同的是,当该报文经IP层输出到链路层处理完毕,即将交给物理层时,将把其链路层帧头等信息添加到路由缓存表项目中,然后再从物理层发出该报文。这样,当链路层再次收到和该报文有相同特征的报文(如目的地址相同的报文),就会在查找路由缓存表时,发现与其匹配的表项。此时,新报文将不再走IP层处理,直接根据路由缓存表中保存的信息,更换其帧头信息,从相应输出接口中发出。When the router does not enable the fast forwarding function, the received message will be directly sent to the IP layer for forwarding processing through the link layer: the message searches the routing table at the IP layer, and selects the corresponding interface to send according to the corresponding routing information . After the message is output to the link layer through the IP layer, the new link layer frame header information will be replaced, and then sent from the physical layer. After the router enables the fast forwarding function, the packets received by it will be processed as follows at the link layer: Firstly, the routing cache table (also known as: fast forwarding table) is searched. If no matching entry is found, the packet will be sent to the IP layer for the above forwarding processing. The difference is that when the message is output to the link layer through the IP layer and is about to be handed over to the physical layer, its link layer frame header and other information will be added to the routing cache table item, and then sent from the physical layer the message. In this way, when the link layer receives a message with the same characteristics as the message again (such as a message with the same destination address), it will find a matching entry when searching the routing cache table. At this point, the new message will no longer be processed at the IP layer, and its frame header information will be replaced directly according to the information stored in the routing cache table, and sent out from the corresponding output interface.
在路由器使能了负载分担功能之后,路由器的路由表将发生如下变化:原来路由表中到达某一地址的路由项目只有一条;而使能了负载分担功能后,路由表中到达某一地址的路由项目将有多条(参见图2,为便于描述,以设置三条路由表项为例,分别命名为:分担路由1、分担路由2、分担路由3;它们分别对应不同的输出接口)。当具有相同目的地址的一组IP报文(简称一条IP数据流)依次经过IP层查找路由处理时,将轮流选用这三个分担路由,从三个不同输出接口轮流发出,从而实现了分担流量的功能After the router enables the load sharing function, the routing table of the router will undergo the following changes: the original routing table has only one routing item to a certain address; There will be multiple routing items (refer to Figure 2, for the convenience of description, take setting three routing entries as an example, respectively named: shared route 1, shared route 2, shared route 3; they correspond to different output interfaces). When a group of IP packets with the same destination address (referred to as an IP data stream) are sequentially processed by the IP layer search route, the three sharing routes will be selected in turn, and sent out from three different output interfaces in turn, thus realizing the sharing of traffic function of
在图2中,虚线描述的是未使能快速转发和负载分担功能时,IP报文的一般处理流程;图2的中间和下方实线描述的是使能快速转发功能时,IP报文的处理流程,特点是通过简化报文处理流程,提高路由器转发报文的效率;图2上方的实线描述的是使能负载分担功能时,IP报文的处理流程,特点是通过配置多条分担路由,使业务流量被多条链路负载分担。In Figure 2, the dotted line describes the general processing flow of IP packets when the fast forwarding and load sharing functions are not enabled; the middle and lower solid lines in Figure 2 describe the IP packet processing flow when the fast forwarding function is enabled The processing flow is characterized by improving the efficiency of router forwarding packets by simplifying the packet processing flow; the solid line at the top of Figure 2 describes the processing flow of IP packets when the load sharing function is enabled, which is characterized by configuring multiple Routing enables service traffic to be load-balanced by multiple links.
现在市场上销售的路由器产品,包括申请人研制的路由器和业界绝大多数公司的路由器,其快速转发都不支持负载分担特性。例如业界权威思科(cisco)公司的快速转发也不支持负载分担功能。虽然cisco公司特有的CEF转发(CiscoExpress Forwarding)特性既能支持高速数据转发,又能支持负载分担;但它是通过采用路由分级索引来加快路由查找速度的,同时,在相同平台的路由器中,CEF转发性能较快速转发要低得多,也就是说通过CEF来支持负载分担没有通过快速转发支持负载分担的效率高。The router products currently on the market, including the routers developed by the applicant and the routers of most companies in the industry, do not support the load sharing feature in their fast forwarding. For example, the fast forwarding of Cisco (cisco), an industry authority, also does not support the load sharing function. Although Cisco's unique CEF forwarding (CiscoExpress Forwarding) feature can support both high-speed data forwarding and load sharing; it uses routing hierarchical indexes to speed up routing lookups. At the same time, in routers on the same platform, CEF The forwarding performance is much lower than that of fast forwarding, that is to say, the load sharing supported by CEF is not as efficient as the load sharing supported by fast forwarding.
在现有技术中,当用户使能快速转发模块,同时配置了多条路由分担负载时,由于现有快速转发缓存表的数据结构仅保存一条输出接口信息(参见图3),所以路由器在处理需要转发的报文是按照如下方式进行的:当链路层接收到一条IP流的第一个IP报文时,先会查找到其没有保存快速转发缓存信息,就把该报文送交IP过程转发处理。然后,检查到第一条负载分担路由时,将根据该路由信息进行转发,同时,生成并添加相应的快速转发路由缓存项目(包括该IP报文对应的输出接口、输出接口的帧头信息、帧头长度信息等)。当链路层接收到该IP流的第二个IP报文后,由于它们具有相同的索引,会直接查找到相应的转发路由缓存信息。所以从第二个报文开始,该IP流的所有报文都将被直接贴上对应输出接口的帧头信息,从同一输出接口发送出去。也就是说,由于有了快速转发,这些IP报文流都将按照第一条负载分担路由,从相同的输出接口被转发,导致路由负载分担失效,数据流量不能按照用户设置的负载分担要求得到分流。In the prior art, when the user enables the fast forwarding module and configures multiple routes to share the load at the same time, since the data structure of the existing fast forwarding cache table only saves one piece of output interface information (see Figure 3), the router is processing The message that needs to be forwarded is carried out in the following way: when the link layer receives the first IP message of an IP flow, it will first find out that it does not save the fast forwarding cache information, and then send the message to the IP Process forwarding processing. Then, when the first load sharing route is detected, it will be forwarded according to the routing information, and at the same time, generate and add the corresponding fast forwarding route cache item (including the output interface corresponding to the IP message, the frame header information of the output interface, frame header length information, etc.). When the link layer receives the second IP message of the IP flow, since they have the same index, it will directly find the corresponding forwarding route cache information. Therefore, starting from the second packet, all packets of the IP flow will be directly pasted with the frame header information of the corresponding output interface, and sent out from the same output interface. That is to say, due to the fast forwarding, these IP packets will be forwarded from the same output interface according to the first load sharing route, resulting in the failure of routing load sharing, and the data traffic cannot be obtained according to the load sharing requirements set by users. shunt.
图3展示了现有的快速转发路由缓存表的数据结构,其中每一组缓存项目与一条IP流相对应,每一组缓存项目由一个索引项和对应的输出接口信息单元所组成,其特点是在该输出接口信息单元里仅静态地保存了一个输出接口的信息。Figure 3 shows the data structure of the existing fast forwarding routing cache table, wherein each group of cache items corresponds to an IP flow, and each group of cache items is composed of an index item and a corresponding output interface information unit, and its characteristics The information of only one output interface is statically stored in the output interface information unit.
发明内容Contents of the invention
本发明的目的是提供一种实现快速转发并支持负载分担的方法,其是通过简单地修改现有的快速转发路由缓存表的数据结构,即可同时实现快速转发和负载分担的功能,利用快速转发机制来提高负载分担的处理效率。The purpose of the present invention is to provide a method for implementing fast forwarding and supporting load sharing, which can realize the functions of fast forwarding and load sharing at the same time by simply modifying the data structure of the existing fast forwarding routing cache table, and utilize fast Forwarding mechanism to improve the processing efficiency of load sharing.
本发明的目的是这样实现的:一种实现快速转发并支持负载分担的方法,其特征在于:The purpose of the present invention is achieved in that a method for realizing fast forwarding and supporting load sharing is characterized in that:
(1)设置环行链表:在由多个缓存表项所组成的快速转发路由缓存表中的每个缓存信息单元的数据结构中,设置缓存有“输出接口信息”和“指向下一个输出接口的指针”;该“输出接口信息”的数据结构是由支持该IP数据流负载分担的若干个“输出接口信息节点”组成,其中每个“输出接口信息节点”均采用动态生成,并用“输出接口信息节点”中的尾指针相连成环而形成环行链表结构,每个链表的节点对应一个“输出接口信息节点”;(1) Ring linked list is set: in the data structure of each cache information unit in the fast forwarding routing cache table composed of multiple cache entries, set the cache with "output interface information" and "pointing to the next output interface" Pointer"; the data structure of the "output interface information" is composed of several "output interface information nodes" that support the load sharing of the IP data flow, and each "output interface information node" is dynamically generated, and uses the "output interface information node" The tail pointers in the "Information Node" are connected to form a ring to form a circular linked list structure, and each node of the linked list corresponds to an "Output Interface Information Node";
(2)将输出接口信息存储在该环行链表中;(2) storing the output interface information in the circular linked list;
(3)数据报文根据存储在该环行链表中的输出接口信息从相应的输出接口直接转发。(3) The data message is directly forwarded from the corresponding output interface according to the output interface information stored in the ring list.
所述的多个缓存表项中的每一个缓存项目对应于一条IP数据流,所述每一个缓存项目包括一个索引项和对应的缓存信息单元。Each cache entry in the plurality of cache entries corresponds to an IP data flow, and each cache entry includes an index entry and a corresponding cache information unit.
所述的每一个缓存项目中的缓存信息单元存储有:“指向下一个输出接口的指针”和由若干个“输出接口信息节点”组成的“输出接口信息”。The cache information unit in each cache item stores: "pointer to the next output interface" and "output interface information" composed of several "output interface information nodes".
所述的每个“输出接口信息节点”存储有:该IP流的帧头信息、对应的输出接口和尾指针。Each of the "output interface information nodes" stores: the frame header information of the IP flow, the corresponding output interface and the tail pointer.
所述的数据报文根据存储在该环行链表中的输出接口信息从相应的输出接口直接转发的处理流程进一步包括有下列步骤:The processing flow in which the data message is directly forwarded from the corresponding output interface according to the output interface information stored in the ring list further includes the following steps:
(A)在系统初试化时,首先将路由缓存表中的第一个“输出接口信息”及其“指向下一个输出接口的指针”均初试化为“空”;(A) When initializing the system, the first "output interface information" and its "pointer to the next output interface" in the routing cache table are initially initialized as "empty";
(B)当链路层接收到某条IP流的第一个报文时,先检查其输出接口信息,发现它为“空”,则将该报文转交IP层处理,选择该IP流第一条负载分担路由进行转发;并在该接口发送报文前,把该输出接口信息保存在路由缓存表第一个节点,同时把该节点的尾指针指向自身,而“指向下一个输出接口的指针”仍为“空”;(B) When the link layer receives the first message of a certain IP flow, it first checks its output interface information and finds that it is "empty", then transfers the message to the IP layer for processing, and selects the first message of the IP flow. A load-sharing route is forwarded; and before the interface sends a message, save the output interface information in the first node of the routing cache table, and at the same time point the node's tail pointer to itself, and "point to the next output interface's pointer" is still "null";
(C)当链路层接收到某条IP流的第二个及其后续报文时,都是先检查其输出接口信息,若不为“空”,则立刻检查“指向下一个输出接口的指针”,发现它为“空”;则将该报文转交IP层处理,每次按顺序地选择该IP流的一条负载分担路由进行转发;并在其相应接口发送报文前,比较该输出接口信息与路由缓存表中已经保存的接口信息是否不同,若不存在相同的接口信息,则每次在输出接口信息的双向链表中创建一个新节点,再通过各节点的头尾指针将该输出接口信息中的各个节点顺序连接成环;其中“指向下一个输出接口的指针”在各个负载分担的不同路由没有全部缓存到该输出接口信息中时,每次均为“空”;(C) When the link layer receives the second and subsequent packets of an IP flow, it first checks the output interface information, if it is not "null", then immediately checks the "pointing to the next output interface" If it is found to be "empty", the message will be forwarded to the IP layer for processing, and a load sharing route of the IP flow will be sequentially selected each time for forwarding; and before the corresponding interface sends the message, compare the output Whether the interface information is different from the interface information already saved in the routing cache table. If there is no identical interface information, a new node is created in the doubly linked list of the output interface information each time, and then output through the head and tail pointers of each node. Each node in the interface information is sequentially connected to form a ring; the "pointer to the next output interface" is "empty" every time when the different routes of each load sharing are not all cached in the output interface information;
(D)在所有负载分担的不同路由全部分流传输过一次该IP流的报文之后,该IP流的第二次循环的第一个报文在对应的链路层接口转发报文前,发现以前已经保存过该输出接口信息,就不再生成新节点;而是把该“输出接口信息”尾指针对应的值赋给“指向下一个输出接口的指针”;(D) After all the different routes of load sharing have transmitted the packet of the IP flow once, the first packet of the second cycle of the IP flow is found before the packet is forwarded by the corresponding link layer interface. If the output interface information has been saved before, no new node will be generated; instead, the value corresponding to the tail pointer of the "output interface information" will be assigned to the "pointer to the next output interface";
(E)当这条IP流的后续报文再次到来时,检查到“指向下一个输出接口的指针”不为“空”,即直接从它所指向的节点对应的输出接口信息,找到当前报文的输出接口,并依据该输出接口信息更换帧头,从相应的输出接口直接转发出去;同时,把“指向下一个输出接口的指针”内容修改为该节点尾指针中的值。(E) When the follow-up message of this IP flow arrives again, it is checked that the "pointer to the next output interface" is not "empty", that is, the current message is found directly from the output interface information corresponding to the node it points to. The output interface of the text, and replace the frame header according to the output interface information, and forward it directly from the corresponding output interface; at the same time, modify the content of "pointer to the next output interface" to the value in the node tail pointer.
本发明的创新关键是对快速转发缓存中保存的缓存信息单元的数据结构进行修改,增加一个“指向下一个输出接口的指针”,同时将其中的“输出接口信息”的数据结构修改成由支持该IP数据流负载分担的若干个“输出接口信息节点”组成,其中每个“输出接口信息节点”均采用动态生成,并用该“输出接口信息节点”中的尾指针顺序连接成环而形成环型链表结构;不同于以往的静态存储,且只存储一个输出接口信息;再辅以相应的处理方法,就可以实现快速转发支持负载分担的特性。The innovation key of the present invention is to modify the data structure of the cache information unit stored in the fast forwarding cache, add a "pointer to the next output interface", and modify the data structure of the "output interface information" to be supported by The IP data flow load sharing is composed of several "output interface information nodes", each of which is dynamically generated, and is sequentially connected with the tail pointers in the "output interface information nodes" to form a ring Type linked list structure; different from the previous static storage, and only one output interface information is stored; supplemented by corresponding processing methods, it can realize the characteristics of fast forwarding and support load sharing.
本发明的优点是在保证高速转发效率的同时,可以充分利用网络带宽的资源来平衡业务流量。该方法对现有的快速转发流程修改很简单,容易实现;且由于快速转发是在中断中执行的,故本发明对现有快速转发流程的处理效率影响也很小,理论分析的结果是:比cisco的CEF特性在支持负载分担情况下的转发处理效率要高。The invention has the advantage that while ensuring high-speed forwarding efficiency, it can make full use of network bandwidth resources to balance service flow. The method is very simple to modify the existing fast forwarding process and is easy to implement; and because the fast forwarding is executed in an interruption, the present invention has little influence on the processing efficiency of the existing fast forwarding process, and the result of theoretical analysis is: Compared with Cisco's CEF feature, the forwarding processing efficiency is higher in the case of supporting load sharing.
附图说明Description of drawings
图1是在现有的路由器系统中负载分担和快速转发特性所处的位置示意图。FIG. 1 is a schematic diagram of locations of load sharing and fast forwarding features in an existing router system.
图2是现有的IP报文的快速转发和负载分担的处理流程示意图。FIG. 2 is a schematic diagram of an existing processing flow of fast forwarding and load sharing of IP packets.
图3是现有的快速转发路由缓存表的数据结构示意图。FIG. 3 is a schematic diagram of a data structure of an existing fast forwarding routing cache table.
图4是本发明的实现快速转发并支持负载分担的方法的流程图。Fig. 4 is a flow chart of the method for implementing fast forwarding and supporting load sharing in the present invention.
图5是本发明中快速转发路由缓存表中路由缓存项数据结构的示意图。Fig. 5 is a schematic diagram of the data structure of the routing cache item in the fast forwarding routing cache table in the present invention.
具体实施方式Detailed ways
参见图4,本发明是一种实现快速转发并支持负载分担的方法,其包括下列步骤:(1)设置环行链表;Referring to Fig. 4, the present invention is a kind of method that realizes fast forwarding and supports load sharing, and it comprises the following steps: (1) ring linked list is set;
(2)将输出接口信息存储在该环行链表中;(2) storing the output interface information in the circular linked list;
(3)数据报文根据存储在该环行链表中的输出接口信息从相应的输出接口直接转发。(3) The data message is directly forwarded from the corresponding output interface according to the output interface information stored in the ring list.
本发明是一种采用环行链表实现快速转发并支持负载分担的方法,其快速转发路由缓存表的数据结构是由多个缓存表项所组成,其中每一组缓存项目对应于一条IP数据流,每一组缓存项目包括一个索引项和对应的缓存信息单元;本发明的创新点是在该快速转发路由缓存表中的每个缓存信息单元的数据结构中,除了缓存的“输出接口信息”以外,还设置一个“指向下一个输出接口的指针”;且路由缓存表中的该“输出接口信息”的数据结构也修改为由支持该IP数据流负载分担的若干个“输出接口信息节点”组成,其中每个“输出接口信息节点”均采用动态生成,并用“输出接口信息节点”中的尾指针相连成环而形成环行链表结构,每个链表的节点对应一个“输出接口信息节点”;再辅以相应的报文处理流程而实现的。The present invention is a method for implementing fast forwarding and supporting load sharing by adopting a circular linked list. The data structure of the fast forwarding routing cache table is composed of a plurality of cache entries, wherein each group of cache entries corresponds to an IP data flow. Each group of cache items includes an index item and a corresponding cache information unit; the innovation of the present invention is that in the data structure of each cache information unit in the fast forwarding routing cache table, in addition to the cached "output interface information" , also set a "pointer to the next output interface"; and the data structure of the "output interface information" in the routing cache table is also modified to be composed of several "output interface information nodes" that support the load sharing of the IP data flow , wherein each "output interface information node" is dynamically generated, and is connected with the tail pointer in the "output interface information node" to form a circular linked list structure, and each linked list node corresponds to an "output interface information node"; It is realized with the help of corresponding message processing flow.
本发明的数据报文根据存储在该环行链表中的输出接口信息从相应的输出接口直接转发的处理流程进一步包括有下列步骤:The data message of the present invention further includes the following steps according to the output interface information stored in the ring list and forwarded directly from the corresponding output interface:
(A)在系统初试化时,首先将路由缓存表中的第一个“输出接口信息”及其“指向下一个输出接口的指针”均初试化为“空”;(A) When initializing the system, the first "output interface information" and its "pointer to the next output interface" in the routing cache table are initially initialized as "empty";
(B)当链路层接收到某条IP流的第一个报文时,先检查其输出接口信息,发现它为“空”,则将该报文转交IP层处理,选择该IP流第一条负载分担路由进行转发;并在该接口发送报文前,把该输出接口信息保存在路由缓存表第一个节点,同时把该节点的尾指针指向自身,而“指向下一个输出接口的指针”仍为“空”;(B) When the link layer receives the first message of a certain IP flow, it first checks its output interface information and finds that it is "empty", then transfers the message to the IP layer for processing, and selects the first message of the IP flow. A load-sharing route is forwarded; and before the interface sends a message, save the output interface information in the first node of the routing cache table, and at the same time point the node's tail pointer to itself, and "point to the next output interface's pointer" is still "null";
(C)当链路层接收到某条IP流的第二个及其后续报文时,都是先检查其输出接口信息,若不为“空”,则立刻检查“指向下一个输出接口的指针”,发现它为“空”;则将该报文转交IP层处理,每次按顺序地选择该IP流的一条负载分担路由进行转发;并在其相应接口发送报文前,比较该输出接口信息与路由缓存表中已经保存的接口信息是否不同,若不存在相同的接口信息,则每次在输出接口信息的双向链表中创建一个新节点,再通过各节点的头尾指针将该输出接口信息中的各个节点顺序连接成环;其中“指向下一个输出接口的指针”在各个负载分担的不同路由没有全部缓存到该输出接口信息中时,每次均为“空”;(C) When the link layer receives the second and subsequent packets of an IP flow, it first checks the output interface information, if it is not "null", then immediately checks the "pointing to the next output interface" If it is found to be "empty", the message will be forwarded to the IP layer for processing, and a load sharing route of the IP flow will be sequentially selected each time for forwarding; and before the corresponding interface sends the message, compare the output Whether the interface information is different from the interface information already saved in the routing cache table. If there is no identical interface information, a new node is created in the doubly linked list of the output interface information each time, and then output through the head and tail pointers of each node. Each node in the interface information is sequentially connected to form a ring; the "pointer to the next output interface" is "empty" every time when the different routes of each load sharing are not all cached in the output interface information;
(D)在所有负载分担的不同路由全部分流传输过一次该IP流的报文之后,该IP流的第二次循环的第一个报文在对应的链路层接口转发报文前,发现以前已经保存过该输出接口信息,就不再生成新节点;而是把该“输出接口信息”尾指针对应的值赋给“指向下一个输出接口的指针”,也就是说,此时“指向下一个输出接口的指针”不再为“空”,而是指向了负载分担的第二个“输出接口信息”;(D) After all the different routes of load sharing have transmitted the packet of the IP flow once, the first packet of the second cycle of the IP flow is found before the packet is forwarded by the corresponding link layer interface. If the output interface information has been saved before, no new node will be generated; instead, the value corresponding to the tail pointer of the "output interface information" will be assigned to the "pointer to the next output interface", that is to say, at this time "pointer to The pointer to the next output interface" is no longer "null", but points to the second "output interface information" of load sharing;
(E)当这条IP流的后续报文再次到来时,检查到“指向下一个输出接口的指针”不为“空”,即直接从它所指向的节点对应的输出接口信息,找到当前报文的输出接口,并依据该输出接口信息更换帧头,从相应的输出接口直接转发出去;同时,把“指向下一个输出接口的指针”内容修改为该节点尾指针中的值;这样,后续的报文就能够顺序轮流地从配置的各个负载分担接口中高速转发出去,实现了快速转发支持负载分担的功能。(E) When the follow-up message of this IP flow arrives again, it is checked that the "pointer to the next output interface" is not "empty", that is, the current message is found directly from the output interface information corresponding to the node it points to. The output interface of the text, and replace the frame header according to the output interface information, and forward it directly from the corresponding output interface; at the same time, modify the content of the "pointer to the next output interface" to the value in the node's tail pointer; in this way, the subsequent The packets can be forwarded sequentially and in turn from each configured load sharing interface at high speed, realizing the function of fast forwarding supporting load sharing.
下面结合图5介绍本发明的一个实施例(其配置了三条负载分担路由):An embodiment of the present invention is introduced below in conjunction with Fig. 5 (it is configured three load sharing routes):
首先启动路由器,系统初试化,路由缓存表中的第一项“输出接口信息”及其“指向下一个输出接口的指针”均初试化为“空”;此时“输出接口信息”里的“输出接口信息节点1”、及其后面的“输出接口信息节点2”和“输出接口信息节点3”都还未生成。First start the router, the system is initialized, the first item "Output Interface Information" and its "pointer to the next output interface" in the routing cache table are initially turned into "empty"; at this time, the "Output Interface Information" in the " The output interface information node 1", and the subsequent "output interface information node 2" and "output interface information node 3" have not been generated yet.
当链路层接收到某条IP流的第一个报文时,检查到“输出接口信息”为“空”,则将该报文转交IP过程转发,进行路由查找时会查到第一条负载分担路由,即“输出接口信息节点1”;在链路层即将发送该报文前,把其相应的输出接口的信息数据(包括该IP流的帧头信息、输出接口和尾指针)保存在路由缓存表对应索引项的“输出接口信息节点1”的节点中,同时把该节点的尾指针指向自身;此时,其“指向下一个输出接口的指针”仍为“空”;When the link layer receives the first message of a certain IP flow, it checks that the "output interface information" is "null", then forwards the message to the IP process for forwarding, and finds the first message when performing routing search Load sharing routing, that is, "output interface information node 1"; before the link layer is about to send the message, save the information data of its corresponding output interface (including the frame header information, output interface and tail pointer of the IP flow) In the node of "output interface information node 1" corresponding to the index item of the routing cache table, point the tail pointer of this node to itself; at this time, its "pointer to the next output interface" is still "empty";
当该IP流的第二个报文到来时,先检查“输出接口信息”不为“空”,然后立刻检查“指向下一个输出接口的指针”,发现它还是为“空”;则将该报文转交IP层处理,此时使能了的负载分担软件功能模块就会将该报文从第二条负载分担路由的输出接口转发出去;在链路层发送该报文之前,比较该输出接口信息和路由缓存中已经保存的信息时,发现当前输出接口信息没有保存,则创建一个新节点“输出接口信息节点2”,同时,修改“输出接口信息节点1”的尾指针指向“输出接口信息节点2”,而“输出接口信息节点2”的尾指针指向“输出接口信息节点1”,两个节点连接成环;而“指向下一个输出接口的指针”仍为“空”。When the second message of the IP flow arrives, first check that the "output interface information" is not "null", then immediately check the "pointer to the next output interface", and find that it is still "null"; The message is forwarded to the IP layer for processing. At this time, the enabled load sharing software function module will forward the message from the output interface of the second load sharing route; before the link layer sends the message, compare the output When the interface information and the information already saved in the routing cache are found that the current output interface information has not been saved, a new node "output interface information node 2" is created, and at the same time, the tail pointer of "output interface information node 1" is modified to point to "output interface information node 1". Information node 2", and the tail pointer of "output interface information node 2" points to "output interface information node 1", and the two nodes are connected to form a ring; while the "pointer to the next output interface" is still "null".
当该IP流的第三个报文到来时,如同第二个报文进行处理。即上交IP层处理,查找到第三条负载分担路由。在对应链路层接口发出报文前,发现以前没有保存过该输出接口信息,于是在路由缓存中添加新节点“输出接口信息节点3”。同时,修改“输出接口信息节点2”的尾指针指向“输出接口信息节点3”,“输出接口信息节点3”的尾指针指向“输出接口信息节点1”,连接成环。“指向下一个输出接口的指针”仍为“空”。When the third packet of the IP flow arrives, it is processed as the second packet. That is, it is handed over to the IP layer for processing, and the third load sharing route is found. Before the corresponding link layer interface sends a message, it is found that the output interface information has not been saved before, so a new node "output interface information node 3" is added in the routing cache. At the same time, modify the tail pointer of "output interface information node 2" to point to "output interface information node 3", and the tail pointer of "output interface information node 3" to point to "output interface information node 1", and connect to form a ring. The "pointer to next output interface" is still "null".
当这条流的第四个报文到来时,也是如同第二个报文进行同样处理。即上交IP层处理,此时负载分担软件功能模块就会将该报文送交第一条分担路由转发。在对应链路层接口发出报文前,发现以前已经保存过该接口信息,于是不再生成新节点;而是把“输出接口信息节点1”尾指针对应的值赋给“指向下一个输出接口的指针”,也就是说此时“指向下一个输出接口的指针”不再为“空”,指向了“输出接口信息节点2”。When the fourth packet of this flow arrives, it is also processed in the same way as the second packet. That is, it is handed over to the IP layer for processing. At this time, the load sharing software function module will send the message to the first sharing route for forwarding. Before the corresponding link layer interface sends a message, it is found that the interface information has been saved before, so no new node is generated; instead, the value corresponding to the tail pointer of "output interface information node 1" is assigned to the "point to the next output interface Pointer to ", that is to say, "pointer to the next output interface" is no longer "null" at this time, and points to "output interface information node 2".
当这条流的后续报文到来时,检查到“指向下一个输出接口的指针”不为“空”,即根据它所指向节点对应的输出接口信息,更换帧头,从相应的输出接口直接转发出去。同时,把“指向下一个输出接口的指针”内容修改为该节点尾指针中的值。例如在本实施例中,第五个报文就不再被上交IP层处理,而是直接从“指向下一个输出接口的指针”找到输出接口2,依据“输出接口信息节点2”更换帧头后直接转发。同时修改“指向下一个输出接口的指针”指向“输出接口信息节点3”When the follow-up message of this stream arrives, it is checked that the "pointer to the next output interface" is not "empty", that is, according to the output interface information corresponding to the node it points to, the frame header is replaced, and the corresponding output interface directly Forward it. At the same time, modify the content of "pointer to the next output interface" to the value in the node tail pointer. For example, in this embodiment, the fifth message is no longer handed over to the IP layer for processing, but directly finds the output interface 2 from the "pointer to the next output interface", and replaces the frame according to the "output interface information node 2" Forward directly after the header. At the same time, modify the "pointer to the next output interface" to point to "output interface information node 3"
这样,后续的IP报文就能够轮流从配置的负载分担接口中高速转发出去了,从而实现了快速转发支持负载分担的功能。In this way, subsequent IP packets can be forwarded at high speed through the configured load-sharing interface in turn, thereby realizing the function of fast forwarding supporting load sharing.
Claims (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB021178747A CN1177437C (en) | 2002-05-24 | 2002-05-24 | A method for implementing fast forwarding and supporting load sharing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB021178747A CN1177437C (en) | 2002-05-24 | 2002-05-24 | A method for implementing fast forwarding and supporting load sharing |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1414736A CN1414736A (en) | 2003-04-30 |
| CN1177437C true CN1177437C (en) | 2004-11-24 |
Family
ID=4744555
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB021178747A Expired - Fee Related CN1177437C (en) | 2002-05-24 | 2002-05-24 | A method for implementing fast forwarding and supporting load sharing |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1177437C (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7761569B2 (en) * | 2004-01-23 | 2010-07-20 | Tiversa, Inc. | Method for monitoring and providing information over a peer to peer network |
| CN100364279C (en) * | 2005-12-07 | 2008-01-23 | 中国科学院计算技术研究所 | Distributed Load Balancing Method for Structured P2P System |
| CN101273590B (en) * | 2005-12-29 | 2012-01-18 | 中兴通讯股份有限公司 | Packet fast forwarding method and system |
| CN100450038C (en) * | 2006-09-29 | 2009-01-07 | 杭州华三通信技术有限公司 | Link load sharing method and relay device |
| CN102316012B (en) * | 2010-06-30 | 2014-05-14 | 杭州华三通信技术有限公司 | Method for realizing Internet protocol (IP) express forwarding and three-layer forwarding equipment |
| CN106656811A (en) * | 2016-12-06 | 2017-05-10 | 上海斐讯数据通信技术有限公司 | Method and system for processing remote call based on AllJoyn frame |
| CN108924050A (en) * | 2018-06-29 | 2018-11-30 | 优刻得科技股份有限公司 | Data forwarding method and its device, storage medium and network card equipment |
-
2002
- 2002-05-24 CN CNB021178747A patent/CN1177437C/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| CN1414736A (en) | 2003-04-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7031320B2 (en) | Apparatus and method for performing high-speed IP route lookup and managing routing/forwarding tables | |
| US7039018B2 (en) | Technique to improve network routing using best-match and exact-match techniques | |
| EP2214356A1 (en) | System for forwarding a packet with a hierarchically structured variable-length identifier | |
| CN1242548A (en) | Quality of service improvement of internet real-time media transmission by transmitting redundant voice/media frames | |
| CN108848032B (en) | An Implementation Method of Named Object Network Supporting Multi-interest Type Processing | |
| US20050195831A1 (en) | Apparatus and method for forwarding mixed data packet types in a high-speed router | |
| CN103491006A (en) | Method for forwarding data of virtual network router in centralized mode | |
| US20170237689A1 (en) | Two-Stage Port-Channel Resolution in a Multistage Fabric Switch | |
| CN104917681B (en) | System and method for packet forwarding in content-centric networks | |
| CN113726907A (en) | Routing processing method, network element equipment, device and readable storage medium | |
| CN1177437C (en) | A method for implementing fast forwarding and supporting load sharing | |
| US7564841B2 (en) | Apparatus and method for performing forwarding table searches using consecutive symbols tables | |
| CN101035059A (en) | Method for improving the classification searching speed of the three-folded content addressable memory message | |
| US20070106640A1 (en) | Searching for strings in messages | |
| US7702882B2 (en) | Apparatus and method for performing high-speed lookups in a routing table | |
| RU2233473C2 (en) | Device and method for performing high-speed search for routes of internet protocol and controlling routing/transfer tables | |
| CN100450100C (en) | A routing method and routing device | |
| CN1893393A (en) | Method for realizing retransmission business of data communication equipment | |
| Chen et al. | Improving NDN forwarding engine performance by rendezvous-based caching and forwarding | |
| CN1897562A (en) | Method for storing routing hop and next skip list by routing hop | |
| CN1553651A (en) | Implementation method of user equipment dual-homing based on multi-protocol label switching | |
| CN1885820A (en) | Engine apparatus for route forwarding table address searching | |
| CN1705286A (en) | Data message transmission method | |
| CN117014501A (en) | Stateless SRv6 service chain proxy method and system based on programmable switch | |
| CN1874305A (en) | Method of IP route selection |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| C17 | Cessation of patent right | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20041124 Termination date: 20110524 |