Summary of the invention
The present invention is intended at least one of solve the problems of the technologies described above.
For this reason, first object of the present invention is the real-time dynamic Decomposition storage means proposing a kind of routing table.
Second object of the present invention is to propose a kind of route data retransmission method.
To achieve these goals, the embodiment of first aspect present invention discloses a kind of real-time dynamic Decomposition storage means of routing table, comprise the following steps: S1: obtain the new unit prefix arriving route, wherein, described unit prefix is newly arrive numerical value corresponding to the routing address prefix first eight bits of route; S2: the unit prefix that described unit prefix and each line card have stored is compared, if stored the unit prefix identical with described new arrival route entry in certain line card, then described new arrival route is stored in line card corresponding to described unit prefix; If each line card does not all exist the unit prefix identical with described route entry, then enter step S3; S3: obtain all line card route memory capacity; And S4: described new arrival route is stored in the minimum line card of route memory capacity.
According to the real-time dynamic Decomposition storage means of the routing table of the embodiment of the present invention, according to different unit prefixes, by the route entry dynamic memory of arrival to each line card, realize the load balancing of each line card; Meanwhile, this design can both realize dynamic Decomposition for the route entry that any time arrives and store, strong with capabilities, more adapts to routing table from the unknown to known change procedure, real-time.
In addition, the real-time dynamic Decomposition storage means of routing table according to the above embodiment of the present invention, can also have following additional technical characteristic:
Further, described step S4 comprises further: S41: if the minimum line card of described route memory capacity is multiple, then obtain the quantity of the unit prefix stored in described multiple line card; S42: add up the different units prefix number that described multiple line card stores respectively, wherein, described different units prefix number is all unit prefix number stored in described multiple line card; And S43: described new arrival route is stored in the minimum line card of described different units prefix number.
Further, described step S43 comprises further: S431: if the minimum line card of described different units prefix number is multiple, then obtain the sequence number of described multiple line card; S432: by the sequence number sequential storage of described new arrival route according to described multiple line card.
To achieve these goals, the embodiment of second aspect present invention discloses a kind of route data retransmission method, comprises the following steps: it is receive line card that definition receives the new line card arriving route; Obtain host's line card of described new arrival route, wherein, described host's line card is the line card mated with the destination address of described new arrival route, and described host's line card is determined by the real-time dynamic Decomposition storage means of above-mentioned routing table; Judge whether described reception line card and described host's line card are same line card, if so, then described reception line card forwards described new arrival route after carrying out longest prefix match to described new arrival route; If not, then described new arrival routing forwarding is given described host's line card by described reception line card, forwards described new arrival route after described host's line card carries out longest prefix match.
According to the route data retransmission method of the embodiment of the present invention, according to different unit prefixes, by the route entry dynamic memory of arrival to each line card, realize the load balancing of each line card; Meanwhile, this design can both realize dynamic Decomposition for the route entry that any time arrives and store, strong with capabilities, more adapts to routing table from the unknown to known change procedure, real-time.
Additional aspect of the present invention and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by practice of the present invention.
Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.
In describing the invention, it will be appreciated that, term " " center ", " longitudinal direction ", " transverse direction ", " on ", D score, " front ", " afterwards ", " left side ", " right side ", " vertically ", " level ", " top ", " end ", " interior ", orientation or the position relationship of the instruction such as " outward " are based on orientation shown in the drawings or position relationship, only the present invention for convenience of description and simplified characterization, instead of indicate or imply that the device of indication or element must have specific orientation, with specific azimuth configuration and operation, therefore limitation of the present invention can not be interpreted as.In addition, term " first ", " second " only for describing object, and can not be interpreted as instruction or hint relative importance.
In describing the invention, it should be noted that, unless otherwise clearly defined and limited, term " installation ", " being connected ", " connection " should be interpreted broadly, and such as, can be fixedly connected with, also can be removably connect, or connect integratedly; Can be mechanical connection, also can be electrical connection; Can be directly be connected, also indirectly can be connected by intermediary, can be the connection of two element internals.For the ordinary skill in the art, concrete condition above-mentioned term concrete meaning in the present invention can be understood.
With reference to description below and accompanying drawing, these and other aspects of embodiments of the invention will be known.Describe at these and in accompanying drawing, specifically disclose some particular implementation in embodiments of the invention, representing some modes of the principle implementing embodiments of the invention, but should be appreciated that the scope of embodiments of the invention is not limited.On the contrary, embodiments of the invention comprise fall into attached claims spirit and intension within the scope of all changes, amendment and equivalent.
Below in conjunction with accompanying drawing, the real-time dynamic Decomposition storage means according to the routing table of the embodiment of the present invention is described.
Please refer to Fig. 1, the real-time dynamic Decomposition storage means of routing table comprises the following steps:
S1: obtain the new unit prefix arriving route, wherein, unit prefix is newly arrive numerical value corresponding to the routing address prefix first eight bits of route.
In an example of the present invention, the new address arriving route is 192.154.0.0/14, and wherein " 14 " are route prefix length, and unit prefix can be the front n position in routing address prefix.In one embodiment of the invention, unit prefix is first 8 of route entry address prefix, is the first byte value of decimal system routing address, and namely unit prefix is " 192 ".
S2: the numerical value of the unit prefix stored by line card each in unit prefix and routing table compares, if stored the unit prefix identical with described new arrival route entry in certain line card, then described new arrival route is stored in line card corresponding to described unit prefix; If each line card does not all exist the unit prefix identical with described route entry, then enter step S3.
In an example of the present invention, suppose that router has four line cards, be respectively line card LC0, LC1, LC2, LC3.If store the unit prefix that value is ' 192 ' in certain line card in four line cards, then newly arrive route and be stored in line card corresponding to this unit prefix; If all do not have in four line cards storing value be ' 192 ' unit prefix, then enter step S3.
S3: the route memory capacity obtaining all line cards, namely obtains the route quantity that all line cards have stored.
S4: be stored in newly arriving route in the minimum line card of route memory capacity.
In an example of the present invention, the route stored number of line card LC0 is 301, the route stored number of line card LC1 is 299, the route stored number of line card LC2 is 300, the route stored number of line card LC3 is 302, then be stored in line card LC1 by newly arriving route, to reach the balanced object stored.
In one embodiment of the invention, step S4 comprises further:
S41: if the minimum line card of route memory capacity is multiple, then obtain the number of the unit prefix stored in multiple line card.
In an example of the present invention, the route memory capacity of line card LC0 is 301, and the route memory capacity of line card LC1 is 300, and the route memory capacity of line card LC2 is 300, and the route memory capacity of line card LC3 is 302.Then get rid of line card LC0 and line card LC3, determine by following step the memory location newly arriving route.
S42: add up multiple line card different units prefix number respectively, wherein, different units prefix number is the quantity of the unit prefix stored in multiple line card.
In an example of the present invention, the then example of step S41, adds up the quantity of the unit prefix that line card LC1 and line card LC2 stores separately respectively.Such as, it is ' 131 ' that line card LC1 stores value, ' 135 ', ' 128 ', ' 56 ', ' 220 ', and the unit prefix of ' 98 ', then the number of the unit prefix stored in line card LC1 is 6.And line card LC2 only to store value be ' 110 ', the unit prefix of ' 21 ', then the number of the unit prefix stored in line card LC2 is just 2.
S43: be stored in newly arriving route in the minimum line card of described different units prefix number.
In an example of the present invention, the then example of step S42, is stored in newly arriving route in line card LC2.
In one embodiment of the invention, step S43 comprises further:
S431: if the minimum line card of different units prefix number is multiple, then obtain the sequence number of described multiple line card.
In an example of the present invention, the then example of step S41, the different units prefix number of statistics line card LC1 and line card LC2.Such as, the number of the different units prefix stored in line card LC1 is 6, and the number of the different units prefix that line card LC2 stores also is 6.Obtain the sequence number " 1 " of line card LC1 and the sequence number " 2 " of line card LC2.
S432: will newly arrive the sequence number sequential storage of route according to multiple line card.
In an example of the present invention, the then example of step S431, is stored in newly arriving route in line card LC1.
By the real-time dynamic Decomposition storage means of routing table in the present embodiment, according to different unit prefixes, by the route entry dynamic memory of arrival to each line card, realize the load balancing of each line card; Meanwhile, this design can both realize dynamic Decomposition for the route entry that any time arrives and store, strong with capabilities, more adapts to routing table from the unknown to known change procedure, real-time.
In addition, can arrange equilibrium degree ED, compression ratio RR analyzes the harmony of dynamic memory and corresponding compression performance.
Wherein, ED represents the equilibrium degree that route dynamic Decomposition stores, RE_LC
mrepresent each line card route memory capacity, RE
averepresent the average route memory capacity of line card.
Wherein, RR represents compression ratio, and RE is each line card route memory capacity under representing dynamic Decomposition memory model, RE
fulleach line card route memory capacity under representing complete storage mode.Such as, under complete storage mode (FullBackupStorage), for 500 route table items, if be stored on 4 pieces of line cards, each line card all stores 500, and decomposes in memory model at this dynamic equalization, the route memory capacity of 4 pieces of line cards is respectively: 126,126,121,127, corresponding compression ratio is respectively: 0.252,0.252,0.242,0.254.
Below in conjunction with accompanying drawing, the route data retransmission method according to the embodiment of the present invention is described.
Please refer to Fig. 2, route data retransmission method comprises the following steps:
It is receive line card that definition receives the new line card arriving route.
Obtain host's line card of described new arrival route, wherein, host's line card is the line card mated with the destination address newly arriving route, and host's line card is determined by the embodiment of the real-time dynamic Decomposition storage means of above-mentioned routing table.
Judge whether reception line card and host's line card are same line card, if so, then receive line card and described new arrival route is forwarded to new arrival after route carries out longest prefix match; If not, then receive line card and newly will arrive routing forwarding to host's line card, host's line card forwards described new arrival route after carrying out longest prefix match.
In addition, other of the real-time dynamic Decomposition storage means of the routing table of the embodiment of the present invention and route data retransmission method is formed and effect is all known for a person skilled in the art, in order to reduce redundancy, does not repeat.
In the description of this specification, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple change, amendment, replacement and modification to these embodiments when not departing from principle of the present invention and aim, scope of the present invention is by claim and equivalency thereof.