Detailed description of the invention
For the technical scheme making those skilled in the art be more fully understood that in the embodiment of the present invention, and makeThe above-mentioned purpose of the embodiment of the present invention, feature and advantage can become apparent from understandable, the most rightIn the embodiment of the present invention, technical scheme is described in further detail.
Refer to Fig. 1, the schematic flow sheet of a kind of file transmitting method provided for the embodiment of the present invention,As it is shown in figure 1, this file transmitting method may comprise steps of:
Step 101, when route change being detected, it is judged that whether the change of this route influences whether to presetThe route searching result of destination address.If so, step 102 is gone to;Otherwise, current process is terminated.
In the embodiment of the present invention, said method can apply to have IP (Internet Protocol, interconnectionFidonetFido) equipment of forwarding capability, such as router, three-tier switch etc., for ease of describing, below withThe executive agent of said method is to illustrate as a example by the network equipment.
In the embodiment of the present invention, if non-specified otherwise, involved address refers both to IP address, and the present invention is realExecute that example is follow-up no longer to be repeated.
In the embodiment of the present invention, can pre-set in the network equipment one or more needs cache routing to look intoLook for the destination address (destination address i.e. preset) of result, such as, the address of large server or gatewayAddress etc..The destination address preset for this, can search routing table according to this destination address preset,And cache the route searching result of correspondence.For the message that destination address is this destination address preset, canIt is transmitted with the route searching result according to caching.
In order to ensure the correctness that message sends, need when route changes, in time the road to cachingIt is updated by lookup result.In embodiments of the present invention, there occurs routing variable when the network equipment detectsDuring change, it can be determined that whether the change of this route influences whether the route searching result of the destination address preset,The route searching result of default destination address the most whether can be caused to change, determine whether needsThe route searching result of caching is updated.
In one embodiment, when route change being detected, it is judged that whether route change can affect pre-If destination address lookup result before, it is also possible to including:
Judge whether the destination address needing cache routing lookup result preset;
If, it is determined that perform to judge the route querying whether route change can affect default destination addressResult.
In this embodiment, when the network equipment detects route change, when changing such as network topology,Can decide whether to there is the destination address needing cache routing lookup result preset, if existing, then needingDetermine whether whether the change of this route can cause this route searching result of destination address preset correspondingChange;Otherwise, the network equipment only needs to update routing table according to route change, and it is specifically realNow do not repeat them here.
Step 102, the route searching result of the destination address preset cached according to route change renewal.
In the embodiment of the present invention, when the network equipment determines that the route change detected can affect default purposeDuring the route searching result of address, the network equipment can update the mesh preset of caching according to the change of this routeThe route searching result of address, to ensure that the route searching result according to caching is carried out when message sendsCorrectness.
In the embodiment of the present invention, when route change does not interferes with the route querying knot of default destination addressTime really, the network equipment can need not update the route searching result of caching, and only needs according to routing variableChanging and update routing table, it implements and does not repeats them here.
Step 103, according to caching route searching result carry out message transmission.
In the embodiment of the present invention, for being cached with destination address (the default destination of route searching resultLocation), when the network equipment needs the message sending address for the purpose of this destination address preset, permissibleNeed not table of query and routing, and can directly look into according to the corresponding route in the route searching result of cachingResult is looked for be transmitted.
In one embodiment, carry out message transmission according to the route searching result of caching, can be concreteIncluding:
When needs send message, it is judged that whether the destination address of message is default destination address;
If so, the route querying knot that the destination address of query message is corresponding from the route searching result of cachingReally;
Message is transmitted by the route searching result that destination address according to this message is corresponding.
In this embodiment, when the network equipment needs to send message, the network equipment can be according to this reportThe route searching result of the destination address query caching of literary composition, the road corresponding to determine the destination address of this messageBy lookup result, and according to the route searching result that the destination address of this message is corresponding, message is transmitted.
In the embodiment of the present invention, it is not belonging to, when needing the destination address of message sent, the destination address presetTime, the network equipment can carry out message transmission according to other message sending strategy, such as the purpose according to messageAddress lookup routing table, and carry out message forwarding according to Query Result, it implements the embodiment of the present inventionDo not repeat them here.
Visible, in the method flow described by Fig. 1, when route change being detected, it can be determined that shouldWhether route change influences whether the route searching result of the destination address preset, and when being judged as YES,The route searching result of destination address being cached to preset is updated, due to specify for someDestination address, be at most only possible to mask-length from 0 to 32 33 routes can affect this addressRoute searching result, when route change does not affects route searching result, it is not necessary to route searching resultIt is updated, shields unrelated route change, reduce the useless renewal of route searching result, ensureingWhile the correctness of the route searching result of caching, reduce the renewal band to cache routing lookup resultThe performance loss come;Simultaneously as the network equipment can carry out message according to the route searching result of cachingSend, all carry out routing table lookup without sending message every time, improve the transmitting efficiency of message.
Refer to Fig. 2, the schematic flow sheet of another kind of file transmitting method provided for the embodiment of the present invention,As in figure 2 it is shown, this file transmitting method may comprise steps of:
Step 201, the default destination address needing cache routing lookup result.
The route searching result of the destination address that step 202, caching are preset.
In the embodiment of the present invention, in order to improve the efficiency that message sends, the network equipment can pre-set oneIndividual or multiple destination addresses needing cache routing lookup result, such as, the address of large server or netClose address etc..The destination address preset for this, the network equipment can be looked into according to this destination address presetLook for routing table, and cache corresponding route searching result, as route corresponding for default destination address looked intoLook for result cache in the internal memory of the network equipment.For the message that destination address is this destination address preset,Can be transmitted according to the route searching result of caching.
Step 203, when route change being detected, it is judged that whether the change of this route influences whether to presetThe route searching result of destination address.If being judged as YES, go to step 204;Otherwise, current stream is terminatedJourney.
In the embodiment of the present invention, in order to ensure the correctness that message sends, need when route changes,In time the route searching result of caching is updated.
When the network equipment detects and there occurs route change, it can be determined that whether the change of this route can affectTo the route searching result of the destination address preset, the route of default destination address the most whether can be caused to look intoLook for result to change, determine whether to need the route searching result of caching is updated.
Step 204, the route searching result of the destination address preset cached according to route change renewal.
In the embodiment of the present invention, when the network equipment determines that the route change detected can affect default purposeDuring the route searching result of address, the network equipment can update the mesh preset of caching according to the change of this routeThe route searching result of address, to ensure that the route searching result according to caching is carried out when message sendsCorrectness.
In the embodiment of the present invention, when route change does not interferes with the route querying knot of default destination addressTime really, the network equipment can need not update the route searching result of caching, and only needs according to routing variableChanging and update routing table, it implements and does not repeats them here.
In the embodiment of the present invention, owing to only can affect the route of the destination address preset cached in generationWhen the route of lookup result changes, the route searching result of the destination address just preset caching is carried out moreNewly, when there is other route change, it is not necessary to the route searching result of caching is updated, shieldingUnrelated route change, reduces the useless renewal of route searching result, in the route querying ensureing cachingWhile the correctness of result, reduce the performance loss that the renewal to cache routing lookup result brings.
Step 205, when needs send message time, it is judged that whether the destination address of this message is default meshAddress.If so, step 206 is gone to;Otherwise, step 208 is gone to.
In the embodiment of the present invention, when the network equipment needs to send message, the network equipment can be according to this reportThe destination address of literary composition judges whether it belongs to default destination address;The most then the network equipment can basisMessage is transmitted by the route searching result of caching;Otherwise, the network equipment needs to pass through table of query and routingCarry out message transmission.
Step 206, from the route searching result of caching, inquire about the route that the destination address of this message is correspondingLookup result.
Step 207, according to the route searching result that the destination address of this message is corresponding, message is transmitted.
In the embodiment of the present invention, when the network equipment determines that the destination address needing the message sent is defaultDuring destination address, the network equipment can according to the route searching result of the destination address query caching of this message,The route searching result corresponding to determine the destination address of this message, and according to the destination address pair of this messageThe route searching result answered carries out message transmission.
In the embodiment of the present invention, due to for the message that destination address is default destination address, Ke YizhiConnect the route searching result according to caching and carry out message transmission, without table of query and routing, therefore, canTo improve the efficiency that message sends.
Step 208, destination address table of query and routing according to message, and carry out message according to Query ResultSend.
In the embodiment of the present invention, when the network equipment determines that the destination address needing the message sent is not belonging to pre-If destination address, during route searching result corresponding to the destination address of this message the most uncached, network setsFor according to the destination address table of query and routing of this message, and message forwarding being carried out according to Query Result.
By above description it can be seen that the embodiment of the present invention provide technical scheme in, when detectingDuring route change, it can be determined that whether the change of this route influences whether the route querying of the destination address presetAs a result, and when being judged as YES, the route searching result of destination address being cached to preset is updated,When route change does not affects route searching result, it is not necessary to route searching result is updated, shieldingUnrelated route change, reduces the useless renewal of route searching result, in the route querying ensureing cachingWhile the correctness of result, reduce the performance loss that the renewal to cache routing lookup result brings;Simultaneously as the network equipment can carry out message transmission according to the route searching result of caching, withoutSend message every time and all carry out routing table lookup, improve the transmitting efficiency of message.
Corresponding with aforementioned file transmitting method embodiment, present invention also offers the reality of packet transmission deviceExecute example.
In the embodiment of the present invention, packet transmission device can be applied on the equipment with IP forwarding capability.Device embodiment can be realized by software, it is also possible to realizes by the way of hardware or software and hardware combining.As a example by implemented in software, as the device on a logical meaning, it it is the processor by its place equipmentComputer program instructions corresponding in nonvolatile memory is read in internal memory and run formation.From firmlyFor part aspect, as it is shown on figure 3, the packet transmission device place equipment provided for the embodiment of the present inventionA kind of hardware structure diagram, except the processor shown in Fig. 3, network interface, internal memory and non-volatile depositOutside reservoir, in embodiment, the equipment at device place generally can also include other hardware, such as responsible processForwarding chip of message etc.;This equipment from the point of view of from hardware configuration, can it is also possible that distributed equipmentMultiple interface card can be included, in order to carry out the extension of Message processing at hardware view.
Refer to Fig. 4, the structural representation of a kind of packet transmission device provided for the embodiment of the present invention,Wherein, described device can apply to the equipment can with IP forwarding capability, as shown in Figure 4, this reportLiterary composition dispensing device may include that
Judging unit 410, for when detecting route change, it is judged that whether the change of described route can shadowRing the route searching result of the destination address preset;
Updating block 420, for affecting the route querying of default destination address when described route changeDuring result, update the route searching result of the described default destination address of caching according to described route change;
Transmitting element 430, for carrying out message transmission according to the route searching result of caching.
In one embodiment, described judging unit 410, it is also possible to be used for when route change being detected,Judge whether the destination address needing cache routing lookup result preset;
Correspondingly, described judging unit 410, can be specifically for needing cache routing when what existence was presetDuring the destination address of lookup result, it is judged that whether the change of described route can affect the road of default destination addressBy lookup result.
Please also refer to Fig. 5, the structure for the another kind of packet transmission device of embodiment of the present invention offer is shownBeing intended to, this embodiment is on the basis of aforementioned embodiment illustrated in fig. 4, and described device can also include: setsPut unit 440 and buffer unit 450.Wherein:
Unit 440 is set, for presetting the destination address needing cache routing lookup result;
Buffer unit 450, for caching the route searching result of described default destination address.
Please also refer to Fig. 6, the structure for the another kind of packet transmission device of embodiment of the present invention offer is shownBeing intended to, this embodiment is on the basis of aforementioned embodiment illustrated in fig. 4, and described transmitting element may include thatJudgment sub-unit 431, inquiry subelement 432 and transmission subelement 433;Wherein:
Judgment sub-unit 431, for when needs send message, it is judged that the destination address of described message isThe no destination address for presetting;
Inquiry subelement 432, is used for when the destination address of described message is default destination address, fromThe route searching result of caching is inquired about the route searching result that the destination address of described message is corresponding;
Send subelement 433, for the route searching result pair corresponding according to the destination address of described messageDescribed message is transmitted.
In one embodiment, described inquiry subelement 432, it is also possible to for when the destination of described messageWhen location is not default destination address, according to the destination address table of query and routing of described message;
Described transmission subelement 433, is additionally operable to the Query Result according to described inquiry subelement 432 and carries outMessage sends.
In said apparatus, the function of unit and the process that realizes of effect specifically refer in said method correspondingStep realize process, do not repeat them here.
For device embodiment, owing to it corresponds essentially to embodiment of the method, so relevant part ginsengSee that the part of embodiment of the method illustrates.Device embodiment described above is only schematically,The wherein said unit illustrated as separating component can be or may not be physically separate, makeesThe parts shown for unit can be or may not be physical location, i.e. may be located at a place,Or can also be distributed on multiple NE.Can select according to the actual needs part therein orThe whole module of person realizes the purpose of the present invention program.Those of ordinary skill in the art are not paying creativenessIn the case of work, i.e. it is appreciated that and implements.
As seen from the above-described embodiment, when route change being detected, it can be determined that whether the change of this route canHave influence on the route searching result of default destination address, and when being judged as YES, to be cached to presetThe route searching result of destination address is updated, when route change does not affects route searching result, noNeed route searching result is updated, shield unrelated route change, reduce route searching resultUseless renewal, ensure caching route searching result correctness while, reduce cache wayThe performance loss brought by the renewal of lookup result;Simultaneously as the network equipment can be according to the road of cachingCarried out message transmission by lookup result, all carry out routing table lookup without sending message every time, improveThe transmitting efficiency of message.
Those skilled in the art, after considering description and putting into practice invention disclosed herein, will readily occur to thisOther embodiment of invention.The application is intended to any modification, purposes or the adaptability of the present inventionChange, these modification, purposes or adaptations are followed the general principle of the present invention and include thisBright undocumented common knowledge in the art or conventional techniques means.Description and embodiments only byBeing considered as exemplary, true scope and spirit of the invention are pointed out by claim below.
It should be appreciated that the invention is not limited in described above and illustrated in the accompanying drawings accuratelyStructure, and various modifications and changes can carried out without departing from the scope.The scope of the present invention is only by instituteAttached claim limits.