CN106411744B - A kind of method and apparatus for route processing - Google Patents
A kind of method and apparatus for route processing Download PDFInfo
- Publication number
- CN106411744B CN106411744B CN201510469382.7A CN201510469382A CN106411744B CN 106411744 B CN106411744 B CN 106411744B CN 201510469382 A CN201510469382 A CN 201510469382A CN 106411744 B CN106411744 B CN 106411744B
- Authority
- CN
- China
- Prior art keywords
- address
- routing
- caching
- route
- external
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/742—Route cache; Operation thereof
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The purpose of the application is to provide a kind of method and apparatus for route processing.The application obtains external address by detection, and the external address is mapped to obtain corresponding presumptive address, and matching inquiry is then carried out in route-caching or routing table to obtain routing iinformation, finally according to the processing of the complete paired data packet of the routing iinformation.It, can be by the way that a large amount of external address to be mapped to the presumptive address of limited range, so that route-caching quantity is maintained at a lower level because of the controllable quantity of presumptive address described herein;And as caching quantity is reduced, hot cache entry can improve cache hit speed to a certain extent, reduce the utilization rate of CPU, to ensure that the performance of system while reducing route-caching quantity without release is re-established.
Description
Technical field
This application involves computer field more particularly to a kind of technologies for route processing.
Background technique
Routing subsystem in operating system nucleus is faced in the case where flow increasingly increases, due to a large amount of external IPs
Route-caching capacity rises suddenly and sharply caused by location, so that system performance declines, stability is affected.There are two types of solutions in the prior art
Certainly scheme, the first is optimized to the path of table of query and routing, for example, by using dictionary tree (trie tree) etc., to improve
Search efficiency;Second is to turn off route-caching function in the case of necessary.However, the first scheme is related to the tune on framework
It is whole, it may be necessary to major change to be carried out to kernel version, this potential shadow to a large amount of basic businesses based on original kernel version
Sound is huge;Even if second scheme solves stability problem to a certain extent, but also brings huge performance and open
Pin, such as the cpu busy percentage obviously risen.
Summary of the invention
This application provides a kind of method and apparatus for route processing, with effectively solve route-caching capacity rise suddenly and sharply with
The problem of causing system performance decline.
According to the one aspect of the application, a kind of route processing method is provided, wherein this method comprises:
It detects to which whether the routing address of routing packets is external address;
When the routing address be external address, the routing address is mapped into obtain corresponding presumptive address;
Matching inquiry is carried out in route-caching according to the presumptive address to obtain corresponding routing iinformation;
To routing packets according to the routing information processing.
Further, described to work as the routing address for external address, the routing address is mapped corresponding predetermined
Address include: when the routing address be external address, according to corresponding mask information the routing address is mapped corresponding
Presumptive address.
Further, this method further include: corresponding cover is determined according to the corresponding caching relevant information of the route-caching
Code information;Wherein, described to work as the routing address for external address, the routing address is mapped into obtain corresponding presumptive address packet
Include: when the routing address be external address, the routing address is mapped to obtain by corresponding reservation place according to the mask information
Location.
Further, the caching relevant information includes following at least any one: the capacity information of the route-caching;Institute
State the present available capacity information of route-caching;The maximum quantity information for the caching record that the route-caching is supported;The road
By the quantity information of the existing caching record cached.
Further, the matching inquiry that carried out in route-caching according to the presumptive address is to obtain corresponding routing
Information further include: when the routing address matches miss in the route-caching, according to the routing address in correspondence
Matching inquiry is carried out in routing table to obtain corresponding routing iinformation.
Further, this method further include: according to route-caching described in the presumptive address and the updating route information.
Further, the detection includes: according to corresponding subnet to which whether the routing address of routing packets is external address
Infomation detection waits for whether the routing address of routing packets is external address.
Further, whether the detection is external address to the routing address of routing packets further include: detects the road
It whether is legal address by address;Wherein, it is described when the routing address be external address, by the routing address map pair
The presumptive address answered includes: to map the routing address when the routing address is external address and to belong to legal address
Corresponding presumptive address.
Further, the routing address includes following at least any one: the source address to routing packets, wherein
Described to routing packets is from external received grouping;The destination address to routing packets, wherein described to routing packets
External grouping is forwarded to be quasi-.
Further, the routing address includes the source address to routing packets, and described to routing packets is from outer
The received grouping in portion;Wherein, the detection includes: when described wait route to which whether the routing address of routing packets is external address
When grouping is not required to be forwarded, whether the detection routing address to routing packets is external address.
According to further aspect of the application, a kind of route processing equipment is provided, wherein the equipment includes:
Detection device, for detecting to which whether the routing address of routing packets is external address;
The routing address is mapped corresponding predetermined by mapping device for being external address when the routing address
Address;
Inquiry unit, for carrying out matching inquiry in route-caching according to the presumptive address to obtain corresponding routing
Information;
Processing unit is used for according to the routing information processing to routing packets.
Further, the mapping device is used for: when the routing address is external address, according to corresponding mask information
The routing address is mapped into obtain corresponding presumptive address.
Further, the equipment further include: mask determining device, for related according to the corresponding caching of the route-caching
Information determines corresponding mask information;Wherein, the mapping device is used for: when the routing address is external address, according to institute
It states mask information and the routing address is mapped into obtain corresponding presumptive address.
Further, the caching relevant information includes following at least any one: the capacity information of the route-caching;Institute
State the present available capacity information of route-caching;The maximum quantity information for the caching record that the route-caching is supported;The road
By the quantity information of the existing caching record cached.
Further, the inquiry unit is also used to: when the routing address matches miss in the route-caching
When, matching inquiry is carried out in corresponding routing table to obtain corresponding routing iinformation according to the routing address.
Further, the equipment further include: updating device, for according to the presumptive address and the updating route information
The route-caching.
Further, the detection device is used for: being to the routing address of routing packets according to corresponding subnet information detection
No is external address.
Further, the detection device is also used to: detecting whether the routing address is legal address;Wherein, described
Mapping device is used for: when the routing address is external address and to belong to legal address, mapping corresponding by the routing address
Presumptive address.
Further, the routing address includes following at least any one: the source address to routing packets, wherein
Described to routing packets is from external received grouping;The destination address to routing packets, wherein described to routing packets
External grouping is forwarded to be quasi-.
Further, the routing address includes the source address to routing packets, and described to routing packets is from outer
The received grouping in portion;Wherein, the detection device is used for: when described when routing packets are not required to be forwarded, detection it is described to
Whether the routing address of routing packets is external address.
Present invention also provides a kind of route processing equipment, which includes:
Processor;
And it is arranged to the memory of storage computer executable instructions, the executable instruction makes institute when executed
It states processor: detecting to which whether the routing address of routing packets is external address;When the routing address is external address, by institute
It states routing address and maps to obtain corresponding presumptive address;Matching inquiry is carried out in route-caching according to the presumptive address to obtain
Corresponding routing iinformation;To routing packets according to the routing information processing.
Compared with prior art, the application obtains external address by detection, maps corresponding by the external address
Then presumptive address carries out matching inquiry to obtain routing iinformation, finally according to the routing in route-caching or routing table
The processing of the complete paired data packet of information.It, can be a large amount of external by inciting somebody to action because of the controllable quantity of presumptive address described herein
Address of cache to limited range presumptive address so that route-caching quantity is maintained at a lower level;Even if flowing greatly
In the case that amount is concurrent, route-caching quantity can also be made to reduce several orders of magnitude, and as caching quantity is reduced, it is hot
Cache entry can improve cache hit speed to a certain extent, reduce the utilization rate of CPU without release is re-established, from
And it ensure that the performance of system while reducing route-caching quantity.Further, the application can also utilize mask information
Address of cache operation is carried out, to be further reduced route-caching quantity;Moreover, it is also possible in conjunction with the caching phase of route-caching
Information is closed to determine used mask information, to further avoid cache overflow to ensure system performance.In addition, the application
Can also detect whether the routing address is legal address before address of cache, such as exclude the address Martian, thus further
Route-caching quantity is reduced, also there is certain defense reaction to ddos attack.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 shows a kind of method flow diagram for route processing according to the application one aspect;
Fig. 2 shows a kind of method flow diagrams for route processing according to one preferred embodiment of the application;
Fig. 3 shows a kind of equipment schematic diagram for route processing according to the application other side;
Fig. 4 shows a kind of equipment schematic diagram for route processing according to one preferred embodiment of the application;
The same or similar appended drawing reference represents the same or similar component in attached drawing.
Specific embodiment
The application is described in further detail with reference to the accompanying drawing.
In a typical configuration of this application, terminal, the equipment of service network and trusted party include one or more
Processor (CPU), input/output interface, network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or
Any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, computer
Readable medium does not include non-temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
In this application, firstly, whether the source address for the data packet that detection obtains or destination address are external address.Its
In, for detecting its source address from external received data packet;Its destination is detected for the quasi- data packet for being forwarded to outside
Location.Next, by a large amount of external address is mapped limited range presumptive address, thus reach reduce route-caching number
The purpose of amount.Finally, according to the processing of the complete paired data packet of the routing iinformation inquired from route-caching or routing table.
Route processing equipment in the application can include but is not limited to: in the routing subsystem in operating system nucleus
Standalone module in module, operating system nucleus, application program, router or interchanger that routing function may be implemented etc. can be with
The equipment for realizing routing function.
Those skilled in the art will be understood that above-mentioned route processing equipment is only for example, other are existing or from now on may
The route processing equipment of appearance is such as applicable to the application, should also be included within the application protection scope, and herein with reference
Mode is incorporated herein.
Fig. 1 shows a kind of method flow diagram for route processing according to the application one aspect.
The method comprising the steps of S11, step S12, step S13 and step S14.Specifically, in step s 11, equipment 1 is examined
It surveys to which whether the routing address of routing packets is external address;In step s 12, when the routing address be external address, if
The routing address is mapped to obtain corresponding presumptive address by standby 1;In step s 13, equipment 1 is being routed according to the presumptive address
Matching inquiry is carried out in caching to obtain corresponding routing iinformation;In step S14, equipment 1 is according to the routing information processing
It is described to routing packets.
Here, the equipment 1 includes but is not limited to that user equipment, the network equipment or user equipment and the network equipment pass through
Network is integrated constituted equipment.The user equipment its include but is not limited to any one can with user by touch tablet into
Mobile electronic product of row human-computer interaction, such as smart phone, PDA etc., the mobile electronic product can use any operation
System, such as android operating system, iOS operating system.Wherein, the network equipment includes that one kind can be according to setting in advance
Fixed or storage instruction, the automatic electronic equipment for carrying out numerical value calculating and information processing, hardware includes but is not limited to micro process
Device, specific integrated circuit (ASIC), programmable gate array (FPGA), digital processing unit (DSP), embedded device etc..The net
Network equipment its include but is not limited to computer, network host, single network server, multiple network server collection or multiple services
The cloud that device is constituted;Here, cloud is made of a large number of computers or network servers based on cloud computing (Cloud Computing),
Wherein, cloud computing is one kind of distributed computing, a virtual supercomputing consisting of a loosely coupled set of computers
Machine.The network includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, VPN network, wireless self-organization network (Ad
Hoc network) etc..Preferably, equipment 1 can also be that running on the user equipment, the network equipment or user equipment and network sets
The standby, network equipment, touch terminal or the network equipment and touch terminal are integrated the script journey in constituted equipment by network
Sequence.Certainly, those skilled in the art will be understood that above equipment 1 is only for example, other are existing or what is be likely to occur from now on sets
Standby 1 is such as applicable to the application, should also be included within the application protection scope, and be incorporated herein by reference.
It constantly works between each step of equipment 1.Specifically, in step s 11, equipment 1 persistently detects
Whether the routing address to routing packets is external address;In step s 12, when the routing address is external address, equipment 1
Continue the routing address mapping to obtain corresponding presumptive address;In step s 13, equipment 1 continues according to the presumptive address
Matching inquiry is carried out in route-caching to obtain corresponding routing iinformation;In step S14, equipment 1 continues according to the road
To routing packets as described in information processing, until in step S11 equipment 1 stop detection to routing packets routing address whether be
External address.
In step s 11, whether the detection of equipment 1 is external address to the routing address of routing packets.
Specifically, the routing address includes following at least any one: the source address to routing packets, wherein institute
Stating to routing packets is from external received grouping;The destination address to routing packets, wherein described to be to routing packets
It is quasi- to be forwarded to external grouping.That is, routing packets include: from external received grouping and the quasi- grouping for being forwarded to outside.Here,
Grouping will be received from outside to be known as into direction (ingress), and the quasi- external packet that is forwarded to is known as direction (egress).Entering
On direction, the routing address is source address, and whether detection source address is external address;On direction out, the routing address
For purpose address, whether testing goal address is external address.
In the particular embodiment, the routing address includes the source address to routing packets, described wait route point
Group is from external received grouping;Wherein, in step s 11, when described when routing packets are not required to be forwarded, equipment 1 is examined
Survey whether the routing address to routing packets is external address.
For example, the routing subsystem in operating system nucleus can turn the data packet received according to its destination address
It sends out, includes source address and destination address in the data packet.If destination address is that locally, which does not need to be turned
Hair;If destination address is not that locally, which needs to be forwarded to next stage equipment.
For example, first judge whether data packet belonging to the routing address needs to be forwarded on entering direction, when not needing
When being forwarded, it is further continued for detecting whether the routing address is external address.And on direction out, because clearly knowing its purpose
Address is non-local, therefore does not have to judge whether to need to be forwarded.
Specifically, in step s 11, equipment 1 according to corresponding subnet information detection to routing packets routing address whether
For external address.Here, entering on direction, whether detection source address is IP address in subnet;Out on direction, testing goal address is
No is IP address in subnet.
Preferably, in step s 11, equipment 1 also detects whether the routing address is legal address;Wherein, in step
In S12, when the routing address is external address and belongs to legal address, the routing address is mapped corresponding by equipment 1
Presumptive address.
Here, the equipment 1 only maps legal external address.It whether is not by detecting the routing address
Legal address, can be by martian packet (a packet that has an impossible source or
Destination IP, the data packet comprising impossible source address or destination address) it filters out, such as source address is
0.0.0.0 IP address is such illegal address.Illegal address is filtered, thus to DDoS (Distributed
Denial of Service, distributed denial of service) attack play certain defense reaction.
In step s 12, when the routing address is external address, the routing address is mapped corresponding by equipment 1
Presumptive address.Here, mapping the external address of IP address in non-subnet, non-illegal address, obtain described pre-
Determine address.
Specifically, in step s 12, the routing address is mapped corresponding by equipment 1 according to corresponding mask information
Presumptive address.
For example, it is assumed that mapping external address 202.114.1.*, mask is set as 24, and 202.114.1.*'s is all
Address is mapped into this presumptive address of 202.114.1.0.If mask is set as 16, all addresses of 202.114.*.*
It is mapped into this presumptive address of 202.114.0.0.If mask is set as 0 in extreme circumstances, then theoretically, owning
External address all will be mapped to that this presumptive address of 0.0.0.0.It is right in order to reduce the dependence to special address 0.0.0.0
In mask is 0 the case where, presumptive address can be modified as other addresses (such as 1.1.1.1) for being easy mark with specially treated.
Those skilled in the art will be understood that above-mentioned mapping mode is only for example, other are existing or are likely to occur from now on
Mapping mode be such as applicable to the application, should also be included within the application protection scope, and include by reference herein
In this.
In step s 13, it is corresponding to obtain to carry out matching inquiry according to the presumptive address in route-caching for equipment 1
Routing iinformation.
Here, the routing iinformation includes source address and destination address, it include the routing iinformation in the route-caching
The presumptive address obtained with mapping.If having the corresponding routing iinformation in route-caching, do not need again to routing
Table is inquired.If the external address completely new for one, because not saving its corresponding routing iinformation in route-caching,
So in route-caching carry out matching inquiry the result is that cache miss, needs in the case where cache miss to routing
Table carries out matching inquiry.Because table of query and routing includes that various validity checkings and the distribution of memory discharge, speed is slower, therefore claims to look into
The mode for asking routing table is slow-path, and correspondingly, the mode of query routing caching is referred to as fast path.
In the particular embodiment, for any one external address, all it is first query routing caching, that is, enters through street
Diameter, the poll-final if cache hit.If the external address is a completely new address, there is no outside this in route-caching
At this moment the corresponding routing iinformation in address just needs to pass through slow-path then the query result of fast path is cache miss
Routing table is inquired.
Specifically, in step s 13, when miss is matched in the route-caching when the routing address, equipment 1
Matching inquiry is carried out to obtain corresponding routing iinformation in corresponding routing table according to the routing address.Here, complete for one
New external address needs to carry out matching inquiry in corresponding routing table to obtain corresponding routing iinformation.
Preferably, the method can also include: equipment 1 according to the presumptive address and the updating route information
Route-caching.
In the particular embodiment, the external address completely new for one, after carrying out matching inquiry in corresponding routing table
Corresponding routing iinformation is obtained, route-caching, i.e. handle according to the presumptive address and the updating route information are needed
Route-caching is written in the result of table of query and routing.So when next fast path query routing caches, because in route-caching
Have the relative recording of the external address, thus the query result of fast path be cache hit, do not need again to routing table into
Row inquiry, to improve search efficiency.
In step S14, equipment 1 is according to the routing information processing to routing packets.
Here, according to the obtained routing iinformation of inquiry, to from external received data packet and it is quasi- be forwarded to it is external
Data packet performs corresponding processing.
Fig. 2 shows a kind of method flow diagrams for route processing according to one preferred embodiment of the application.
The method comprising the steps of S21, step S25, step S22, step S23 and step S24.Here, step S21, step
Step S11, step S13, the content of step S14 are identical or essentially identical in S23, step S24 and Fig. 1, for simplicity, no longer
It repeats.
Specifically, in step s 25, equipment 1 determines corresponding according to the corresponding caching relevant information of the route-caching
Mask information.Wherein, in step S22, when the routing address is external address, equipment 1 is according to the mask information by institute
It states routing address and maps to obtain corresponding presumptive address.
Here, the caching relevant information includes following at least any one: the capacity information of the route-caching;The road
By the present available capacity information cached;The maximum quantity information for the caching record that the route-caching is supported;The routing is slow
The quantity information for the existing caching record deposited.
In the particular embodiment, the digit of mask can be adjusted according to the actual use situation of route-caching.When available
When caching more, then external address can be mapped to more presumptive address, mask digit can take that big (such as mask is set as
24);When available cache memory is less, then external address can be mapped to less presumptive address, mask digit take it is smaller (such as
0) mask is set as.
Fig. 3 shows a kind of equipment 1 for route processing according to the application other side, wherein equipment 1 includes inspection
Survey device 11, mapping device 12, inquiry unit 13 and processing unit 14.
Specifically, whether the detection of detection device 11 is external address to the routing address of routing packets;When the road
It is external address by address, the routing address is mapped to obtain corresponding presumptive address by the mapping device 12;The inquiry dress
It sets 13 and carries out matching inquiry in route-caching according to the presumptive address to obtain corresponding routing iinformation;The processing unit
14 according to the routing information processing to routing packets.
Here, the equipment 1 includes but is not limited to that user equipment, the network equipment or user equipment and the network equipment pass through
Network is integrated constituted equipment.The user equipment its include but is not limited to any one can with user by touch tablet into
Mobile electronic product of row human-computer interaction, such as smart phone, PDA etc., the mobile electronic product can use any operation
System, such as android operating system, iOS operating system.Wherein, the network equipment includes that one kind can be according to setting in advance
Fixed or storage instruction, the automatic electronic equipment for carrying out numerical value calculating and information processing, hardware includes but is not limited to micro process
Device, specific integrated circuit (ASIC), programmable gate array (FPGA), digital processing unit (DSP), embedded device etc..The net
Network equipment its include but is not limited to computer, network host, single network server, multiple network server collection or multiple services
The cloud that device is constituted;Here, cloud is made of a large number of computers or network servers based on cloud computing (Cloud Computing),
Wherein, cloud computing is one kind of distributed computing, a virtual supercomputing consisting of a loosely coupled set of computers
Machine.The network includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, VPN network, wireless self-organization network (Ad
Hoc network) etc..Preferably, equipment 1 can also be that running on the user equipment, the network equipment or user equipment and network sets
The standby, network equipment, touch terminal or the network equipment and touch terminal are integrated the script journey in constituted equipment by network
Sequence.Certainly, those skilled in the art will be understood that above equipment 1 is only for example, other are existing or what is be likely to occur from now on sets
Standby 1 is such as applicable to the application, should also be included within the application protection scope, and be incorporated herein by reference.
It constantly works between above-mentioned each device, here, it will be understood by those skilled in the art that " lasting " refers to
State each device respectively in real time or according to setting or real-time adjustment operating mode requirement, such as the detection device 11 holds
Whether continuous detection is external address to the routing address of routing packets;When the routing address is external address, the mapping is filled
12 are set to continue the routing address mapping to obtain corresponding presumptive address;The inquiry unit 13 continues according to the presumptive address
Matching inquiry is carried out in route-caching to obtain corresponding routing iinformation;The processing unit 14 continues to be believed according to the routing
Breath processing is described to routing packets, until whether it is external that the detection device 11 stops detection to the routing address of routing packets
Address.
Whether the detection of detection device 11 is external address to the routing address of routing packets.
Specifically, the routing address includes following at least any one: the source address to routing packets, wherein institute
Stating to routing packets is from external received grouping;The destination address to routing packets, wherein described to be to routing packets
It is quasi- to be forwarded to external grouping.That is, routing packets include: from external received grouping and the quasi- grouping for being forwarded to outside.Here,
Grouping will be received from outside to be known as into direction (ingress), and the quasi- external packet that is forwarded to is known as direction (egress).Entering
On direction, the routing address is source address, and whether detection source address is external address;On direction out, the routing address
For purpose address, whether testing goal address is external address.
In the particular embodiment, the routing address includes the source address to routing packets, described wait route point
Group is from external received grouping;Wherein, when described when routing packets are not required to be forwarded, the detection device 11 detects institute
It states to which whether the routing address of routing packets is external address.
For example, the routing subsystem in operating system nucleus can turn the data packet received according to its destination address
It sends out, includes source address and destination address in the data packet.If destination address is that locally, which does not need to be turned
Hair;If destination address is not that locally, which needs to be forwarded to next stage equipment.
For example, first judge whether data packet belonging to the routing address needs to be forwarded on entering direction, when not needing
When being forwarded, it is further continued for detecting whether the routing address is external address.And on direction out, because clearly knowing its purpose
Address is non-local, therefore does not have to judge whether to need to be forwarded.
Specifically, whether the detection device 11 is outer to the routing address of routing packets according to corresponding subnet information detection
Portion address.Here, entering on direction, whether detection source address is IP address in subnet;Out on direction, testing goal address whether be
IP address in subnet.
Preferably, the detection device 11 also detects whether the routing address is legal address;Wherein, the mapping dress
It sets 12 to work as the routing address for external address and belong to legal address, the routing address is mapped into obtain corresponding reservation place
Location.
Here, the mapping device 12 only maps legal external address.It is by detecting the routing address
No is illegal address, can be by martian packet (a packet that has an impossible source or
Destination IP, the data packet comprising impossible source address or destination address) it filters out, such as source address is
0.0.0.0 IP address is such illegal address.Illegal address is filtered, thus to DDoS (Distributed
Denial of Service, distributed denial of service) attack play certain defense reaction.
When the routing address is external address, the routing address is mapped corresponding predetermined by the mapping device 12
Address.Here, mapping the external address of IP address in non-subnet, non-illegal address, the reservation place is obtained
Location.
Specifically, the routing address is mapped corresponding predetermined by the mapping device 12 according to corresponding mask information
Address.
For example, it is assumed that mapping external address 202.114.1.*, mask is set as 24, and 202.114.1.*'s is all
Address is mapped into this presumptive address of 202.114.1.0.If mask is set as 16, all addresses of 202.114.*.*
It is mapped into this presumptive address of 202.114.0.0.If mask is set as 0 in extreme circumstances, then theoretically, owning
External address all will be mapped to that this presumptive address of 0.0.0.0.It is right in order to reduce the dependence to special address 0.0.0.0
In mask is 0 the case where, presumptive address can be modified as other addresses (such as 1.1.1.1) for being easy mark with specially treated.
Those skilled in the art will be understood that above-mentioned mapping mode is only for example, other are existing or are likely to occur from now on
Mapping mode be such as applicable to the application, should also be included within the application protection scope, and include by reference herein
In this.
The inquiry unit 13 carries out matching inquiry in route-caching according to the presumptive address to obtain corresponding road
By information.
Here, the routing iinformation includes source address and destination address, it include the routing iinformation in the route-caching
The presumptive address obtained with mapping.If having the corresponding routing iinformation in route-caching, do not need again to routing
Table is inquired.If the external address completely new for one, because not saving its corresponding routing iinformation in route-caching,
So in route-caching carry out matching inquiry the result is that cache miss, needs in the case where cache miss to routing
Table carries out matching inquiry.Because table of query and routing includes that various validity checkings and the distribution of memory discharge, speed is slower, therefore claims to look into
The mode for asking routing table is slow-path, and correspondingly, the mode of query routing caching is referred to as fast path.
In the particular embodiment, for any one external address, all it is first query routing caching, that is, enters through street
Diameter, the poll-final if cache hit.If the external address is a completely new address, there is no outside this in route-caching
At this moment the corresponding routing iinformation in address just needs to pass through slow-path then the query result of fast path is cache miss
Routing table is inquired.
Specifically, when miss is matched in the route-caching when the routing address, 13 basis of inquiry unit
The routing address carries out matching inquiry in corresponding routing table to obtain corresponding routing iinformation.Here, completely new for one
External address, need to carry out matching inquiry in corresponding routing table to obtain corresponding routing iinformation.
Preferably, the equipment 1 can also include updating device (not shown), and the updating device is according to the reservation place
Route-caching described in location and the updating route information.
In the particular embodiment, the external address completely new for one, after carrying out matching inquiry in corresponding routing table
Corresponding routing iinformation is obtained, route-caching, i.e. handle according to the presumptive address and the updating route information are needed
Route-caching is written in the result of table of query and routing.So when next fast path query routing caches, because in route-caching
Have the relative recording of the external address, thus the query result of fast path be cache hit, do not need again to routing table into
Row inquiry, to improve search efficiency.
The processing unit 14 is according to the routing information processing to routing packets.
Here, according to the obtained routing iinformation of inquiry, to from external received data packet and it is quasi- be forwarded to it is external
Data packet performs corresponding processing.
Fig. 4 shows a kind of equipment 1 for route processing according to one preferred embodiment of the application, wherein described to set
Standby 1 includes detection device 11 ', mapping device 12 ', inquiry unit 13 ', processing unit 14 ' and mask determining device 15 '.
Here, detection device 11, inquiry fill in the detection device 11 ', inquiry unit 13 ', processing unit 14 ' and Fig. 3
The content for setting 13, processing unit 14 is identical or essentially identical, for simplicity, repeats no more.
Specifically, the mask determining device 15 ' is determined according to the corresponding caching relevant information of the route-caching and is corresponded to
Mask information.Wherein, when the routing address is external address, the mapping device 12 ' is according to the mask information by institute
It states routing address and maps to obtain corresponding presumptive address.
Here, the caching relevant information includes following at least any one: the capacity information of the route-caching;The road
By the present available capacity information cached;The maximum quantity information for the caching record that the route-caching is supported;The routing is slow
The quantity information for the existing caching record deposited.
In the particular embodiment, the digit of mask can be adjusted according to the actual use situation of route-caching.When available
When caching more, then external address can be mapped to more presumptive address, mask digit can take that big (such as mask is set as
24);When available cache memory is less, then external address can be mapped to less presumptive address, mask digit take it is smaller (such as
0) mask is set as.
In addition, the embodiment of the present application also provides a kind of route processing equipment, which includes:
Processor;
And it is arranged to the memory of storage computer executable instructions, the executable instruction makes institute when executed
It states processor: detecting to which whether the routing address of routing packets is external address;When the routing address is external address, by institute
It states routing address and maps to obtain corresponding presumptive address;Matching inquiry is carried out in route-caching according to the presumptive address to obtain
Corresponding routing iinformation;To routing packets according to the routing information processing.
Compared with prior art, the application obtains external address by detection, maps corresponding by the external address
Then presumptive address carries out matching inquiry to obtain routing iinformation, finally according to the routing in route-caching or routing table
The processing of the complete paired data packet of information.It, can be a large amount of external by inciting somebody to action because of the controllable quantity of presumptive address described herein
Address of cache to limited range presumptive address so that route-caching quantity is maintained at a lower level;Even if flowing greatly
In the case that amount is concurrent, route-caching quantity can also be made to reduce several orders of magnitude, and as caching quantity is reduced, it is hot
Cache entry can improve cache hit speed to a certain extent, reduce the utilization rate of CPU without release is re-established, from
And it ensure that the performance of system while reducing route-caching quantity.Further, the application can also utilize mask information
Address of cache operation is carried out, to be further reduced route-caching quantity;Moreover, it is also possible in conjunction with the caching phase of route-caching
Information is closed to determine used mask information, to further avoid cache overflow to ensure system performance.In addition, the application
Can also detect whether the routing address is legal address before address of cache, such as exclude the address Martian, thus further
Route-caching quantity is reduced, also there is certain defense reaction to ddos attack.
Obviously, those skilled in the art can carry out various modification and variations without departing from the essence of the application to the application
Mind and range.In this way, if these modifications and variations of the application belong to the range of the claim of this application and its equivalent technologies
Within, then the application is also intended to include these modifications and variations.
It should be noted that the application can be carried out in the assembly of software and/or software and hardware, for example, can adopt
With specific integrated circuit (ASIC), general purpose computer or any other realized similar to hardware device.In one embodiment
In, the software program of the application can be executed to implement the above steps or functions by processor.Similarly, the application
Software program (including relevant data structure) can be stored in computer readable recording medium, for example, RAM memory,
Magnetic or optical driver or floppy disc and similar devices.In addition, hardware can be used to realize in some steps or function of the application, example
Such as, as the circuit cooperated with processor thereby executing each step or function.
In addition, a part of the application can be applied to computer program product, such as computer program instructions, when its quilt
When computer executes, by the operation of the computer, it can call or provide according to the present processes and/or technical solution.
And the program instruction of the present processes is called, it is possibly stored in fixed or moveable recording medium, and/or pass through
Broadcast or the data flow in other signal-bearing mediums and transmitted, and/or be stored according to described program instruction operation
In the working storage of computer equipment.Here, including a device according to one embodiment of the application, which includes using
Memory in storage computer program instructions and processor for executing program instructions, wherein when the computer program refers to
When enabling by processor execution, method and/or skill of the device operation based on aforementioned multiple embodiments according to the application are triggered
Art scheme.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned exemplary embodiment, Er Qie
In the case where without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and scope of the present application is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the application.Any reference signs in the claims should not be construed as limiting the involved claims.This
Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.That states in device claim is multiple
Unit or device can also be implemented through software or hardware by a unit or device.The first, the second equal words are used to table
Show title, and does not indicate any particular order.
Claims (21)
1. a kind of route processing method, wherein this method comprises:
It detects to which whether the routing address of routing packets is external address;
When the routing address is external address, the routing address is mapped into obtain corresponding presumptive address, wherein described predetermined
Address is the address in limited range;
Matching inquiry is carried out in route-caching according to the presumptive address to obtain corresponding routing iinformation;
To routing packets according to the routing information processing.
It is described when the routing address is external address 2. according to the method described in claim 1, wherein, by the routing
Location map corresponding presumptive address includes:
When the routing address is external address, according to corresponding mask information the routing address is mapped corresponding predetermined
Address.
3. according to the method described in claim 2, wherein, this method further include:
Corresponding mask information is determined according to the corresponding caching relevant information of the route-caching;
Wherein, it is described when the routing address be external address, by the routing address map corresponding presumptive address includes:
When the routing address be external address, the routing address is mapped to obtain by corresponding reservation place according to the mask information
Location.
4. according to the method described in claim 3, wherein, the caching relevant information includes following at least any one:
The capacity information of the route-caching;
The present available capacity information of the route-caching;
The maximum quantity information for the caching record that the route-caching is supported;
The quantity information of the existing caching record of the route-caching.
5. method according to claim 1 to 4, wherein it is described according to the presumptive address in route-caching
Middle progress matching inquiry is to obtain corresponding routing iinformation further include:
When the routing address matches miss in the route-caching, according to the routing address in corresponding routing table
Matching inquiry is carried out to obtain corresponding routing iinformation.
6. according to the method described in claim 5, wherein, this method further include:
According to route-caching described in the presumptive address and the updating route information.
7. method according to any one of claim 1 to 6, wherein the detection is to the routing address of routing packets
It is no to include: for external address
It is detected according to corresponding subnet information to which whether the routing address of routing packets is external address.
8. according to the method described in claim 7, wherein, whether the detection is external address to the routing address of routing packets
Further include:
Detect whether the routing address is legal address;
Wherein, it is described when the routing address be external address, by the routing address map corresponding presumptive address includes:
When the routing address is external address and to belong to legal address, the routing address is mapped into obtain corresponding reservation place
Location.
9. method according to any one of claim 1 to 8, wherein the routing address includes following at least any one:
The source address to routing packets, wherein described to routing packets is from external received grouping;
The destination address to routing packets, wherein described to routing packets is quasi- to be forwarded to external grouping.
10. according to the method described in claim 9, wherein, the routing address includes the source address to routing packets, institute
Stating to routing packets is from external received grouping;
Wherein, whether the detection is that external address includes: to the routing address of routing packets
When described when routing packets are not required to be forwarded, whether the detection routing address to routing packets is externally
Location.
11. a kind of route processing equipment, wherein the equipment includes:
Detection device, for detecting to which whether the routing address of routing packets is external address;
Mapping device is external address for working as the routing address, the routing address is mapped to obtain corresponding presumptive address,
Wherein, the presumptive address is the address in limited range;
Inquiry unit obtains corresponding routing letter for carrying out matching inquiry in route-caching according to the presumptive address
Breath;
Processing unit is used for according to the routing information processing to routing packets.
12. equipment according to claim 11, wherein the mapping device is used for:
When the routing address is external address, according to corresponding mask information the routing address is mapped corresponding predetermined
Address.
13. equipment according to claim 12, wherein the equipment further include:
Mask determining device, for determining corresponding mask information according to the corresponding caching relevant information of the route-caching;
Wherein, the mapping device is used for:
When the routing address be external address, the routing address is mapped to obtain by corresponding reservation place according to the mask information
Location.
14. equipment according to claim 13, wherein the caching relevant information includes following at least any one:
The capacity information of the route-caching;
The present available capacity information of the route-caching;
The maximum quantity information for the caching record that the route-caching is supported;
The quantity information of the existing caching record of the route-caching.
15. equipment described in any one of 1 to 14 according to claim 1, wherein the inquiry unit is also used to:
When the routing address matches miss in the route-caching, according to the routing address in corresponding routing table
Matching inquiry is carried out to obtain corresponding routing iinformation.
16. equipment according to claim 15, wherein the equipment further include:
Updating device is used for the route-caching according to the presumptive address and the updating route information.
17. equipment described in any one of 1 to 16 according to claim 1, wherein the detection device is used for:
It is detected according to corresponding subnet information to which whether the routing address of routing packets is external address.
18. equipment according to claim 17, wherein the detection device is also used to:
Detect whether the routing address is legal address;
Wherein, the mapping device is used for:
When the routing address is external address and to belong to legal address, the routing address is mapped into obtain corresponding reservation place
Location.
19. equipment described in any one of 1 to 18 according to claim 1, wherein the routing address includes following at least any
:
The source address to routing packets, wherein described to routing packets is from external received grouping;
The destination address to routing packets, wherein described to routing packets is quasi- to be forwarded to external grouping.
20. equipment according to claim 19, wherein the routing address includes the source address to routing packets,
Described to routing packets is from external received grouping;
Wherein, the detection device is used for:
When described when routing packets are not required to be forwarded, whether the detection routing address to routing packets is externally
Location.
21. a kind of route processing equipment, wherein the equipment includes:
Processor;
And it is arranged to the memory of storage computer executable instructions, the executable instruction makes the place when executed
It manages device: detecting to which whether the routing address of routing packets is external address;When the routing address is external address, by the road
Corresponding presumptive address is obtained by address of cache, wherein the presumptive address is the address in limited range;According to the reservation place
Location carries out matching inquiry in route-caching to obtain corresponding routing iinformation;Wait route according to the routing information processing
Grouping.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510469382.7A CN106411744B (en) | 2015-08-03 | 2015-08-03 | A kind of method and apparatus for route processing |
PCT/CN2016/090819 WO2017020718A1 (en) | 2015-08-03 | 2016-07-21 | Method and device for routing processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510469382.7A CN106411744B (en) | 2015-08-03 | 2015-08-03 | A kind of method and apparatus for route processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106411744A CN106411744A (en) | 2017-02-15 |
CN106411744B true CN106411744B (en) | 2019-10-18 |
Family
ID=57942379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510469382.7A Active CN106411744B (en) | 2015-08-03 | 2015-08-03 | A kind of method and apparatus for route processing |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106411744B (en) |
WO (1) | WO2017020718A1 (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102447747A (en) * | 2010-10-09 | 2012-05-09 | 中国移动通信集团公司 | Method, device and system for interacting with private network |
CN103686696A (en) * | 2012-09-19 | 2014-03-26 | 华为技术有限公司 | Method for sending data, gateway and sensor node |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101394333B (en) * | 2007-09-17 | 2016-01-20 | 华为技术有限公司 | The method E-Packeted, device and network system |
CN102045234B (en) * | 2009-10-09 | 2013-04-03 | 中国移动通信集团公司 | Buffering and overtime processing methods of route address mapping information as well as tunnel router |
US9008096B2 (en) * | 2012-11-13 | 2015-04-14 | Microsoft Technology Licensing, Llc | Data packet routing |
-
2015
- 2015-08-03 CN CN201510469382.7A patent/CN106411744B/en active Active
-
2016
- 2016-07-21 WO PCT/CN2016/090819 patent/WO2017020718A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102447747A (en) * | 2010-10-09 | 2012-05-09 | 中国移动通信集团公司 | Method, device and system for interacting with private network |
CN103686696A (en) * | 2012-09-19 | 2014-03-26 | 华为技术有限公司 | Method for sending data, gateway and sensor node |
Also Published As
Publication number | Publication date |
---|---|
CN106411744A (en) | 2017-02-15 |
WO2017020718A1 (en) | 2017-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Jin et al. | Netcache: Balancing key-value stores with fast in-network caching | |
US9667754B2 (en) | Data structure and associated management routines for TCP control block (TCB) table in network stacks | |
TWI606340B (en) | Method, computer readable storage medium and system for data caching | |
US20160269442A1 (en) | Methods and systems for improving analytics in distributed networks | |
CN102708060B (en) | Method, device and system for accessing image files | |
US20120102269A1 (en) | Using speculative cache requests to reduce cache miss delays | |
US20180139224A1 (en) | Collecting domain name system traffic | |
EP2388705A1 (en) | Method and apparatus for accessing cache memory | |
CN105677580A (en) | Method and device for accessing cache | |
Kamimoto et al. | Cache protection method based on prefix hierarchy for content-oriented network | |
US20150326674A1 (en) | Device and session identification | |
CN103049392B (en) | The implementation method of CACHE DIRECTORY and device | |
US20110271057A1 (en) | Cache access filtering for processors without secondary miss detection | |
WO2014204495A1 (en) | Locating cached data in a multi-core processor | |
US10467217B2 (en) | Loop detection in cuckoo hashtables | |
US9772881B2 (en) | Hardware resource allocation for applications | |
Yamaki et al. | Data prediction for response flows in packet processing cache | |
US10242318B2 (en) | System and method for hierarchical and chained internet security analysis | |
CN106411744B (en) | A kind of method and apparatus for route processing | |
WO2016091086A1 (en) | Virtualization security detection method and system | |
Suksomboon et al. | Towards performance prediction of multicore software routers | |
US9916086B2 (en) | Content-addressable memory device | |
CN105282236B (en) | A kind of distributed caching method and device | |
US20140137135A1 (en) | Multi-core-based load balancing data processing methods | |
CN114584623B (en) | Flow request cleaning method and device, storage medium and computer equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |