CN108965122A - Route selection method, equipment and computer readable storage medium - Google Patents
Route selection method, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN108965122A CN108965122A CN201710361783.XA CN201710361783A CN108965122A CN 108965122 A CN108965122 A CN 108965122A CN 201710361783 A CN201710361783 A CN 201710361783A CN 108965122 A CN108965122 A CN 108965122A
- Authority
- CN
- China
- Prior art keywords
- routing
- message
- router
- pmtu
- route selection
- 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.)
- Granted
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/24—Multipath
-
- 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/70—Routing based on monitoring results
-
- 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/745—Address table lookup; Address filtering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of route selection method, equipment and computer readable storage medium, route selection method includes: reception message, extracts the corresponding destination IP of the message and message length;According to the destination IP, the corresponding routing iinformation of the destination IP is searched in preset routing table;The target routing for being greater than or equal to the message length there are PMTU value is detected whether according to the routing iinformation;The target that PMTU value is greater than or equal to the message length if it exists routes, then determines the routing of optimal path in target routing according to preset routing algorithm.It can avoid message in transmission process to a certain extent through the invention, routing device MTU value is dropped or routing device carries out fragment and generation the case where influence transmission rate to message because message length is greater than, thus improve data transfer efficiency.
Description
Technical field
The present invention relates to field of communication technology more particularly to route selection methods, equipment and computer readable storage medium.
Background technique
Under complicated network environment and service logic, transmission data may need to dispose several routing devices, and these
MTU (Maximum Transport Unit, maximum transmission unit) value of routing device default may be different.It is calculated when according to routing
When being less than message length there are the MTU value of equipment in the transmission path that method determines, it is likely to result in customer service exception.For example,
Part routing device does not support IPv4 fragment in transmission path, when the message received is greater than its MTU, even if in heading
DF (Don't Fragment) identifies no set, also can directly abandon, to cause customer service abnormal;When in transmission path
Routing device supports IPv4 fragment, and when the message received is greater than its MTU, routing device can carry out IPv4 fragment to message,
Under the scene of mass data stream, transmission rate will affect.
Summary of the invention
The main purpose of the present invention is to provide a kind of route selection methods, it is intended to solve to be calculated according to routing in the prior art
When being less than message length there are the MTU value of equipment in the transmission path that method determines, it is likely to result in the technology of customer service exception
Problem.
To achieve the above object, the present invention provides a kind of route selection method, and the route selection method includes:
Message is received, the corresponding destination IP of the message and message length are extracted;
According to the destination IP, the corresponding routing iinformation of the destination IP is searched in preset routing table;
The target routing for being greater than or equal to the message length there are PMTU value is detected whether according to the routing iinformation;
The target that PMTU value is greater than or equal to the message length if it exists routes, then according to preset routing algorithm described
The routing of optimal path is determined in target routing.
Optionally, the reception message, extracts the corresponding destination IP of the message and message length includes: before
Routing iinformation message is generated according to local routing table;
Local router MTU value information is filled into routing iinformation message, and is sent to the adjacent road of local router
By device.
Optionally, the reception message, before extracting the corresponding destination IP of the message and message length further include:
The routing iinformation message that neighboring router is sent is received, detects whether the routing iinformation message includes adjacent routing
Device MTU value information;
If the routing iinformation message includes neighboring router MTU value information, the routing iinformation message is saved to originally
Ground routing table, and according to routing iinformation message calculating, update local routing table information.
Optionally, whether the routing iinformation message for receiving neighboring router and sending, detect the routing iinformation message
Comprising including: after neighboring router MTU value information
If the routing iinformation message does not include neighboring router MTU value information, the routing iinformation message is saved extremely
Local routing table, and according to routing iinformation message calculating, update local routing table information, it is adjacent described in local routing table
Router MTU value is set to zero.
Optionally, described to detect whether that there are PMTU values to be greater than or equal to the message length according to the routing iinformation
Include: after target routing
The target that PMTU value is greater than or equal to the message length if it does not exist routes, then according to preset routing algorithm in institute
It states routing iinformation and corresponds to the routing for determining optimal path in all routings;
According to the routing forwarding message of the optimal path.
Optionally, described to detect whether that there are PMTU values to be greater than or equal to the message length according to the routing iinformation
Target routes
Detect whether there is the different routing of at least two PMTU values according to the routing iinformation;
The different routing of at least two PMTU values if it exists, then detecting in the different routing of at least two PMTU values is
It is no that there are the target routings that PMTU value is greater than or equal to the message length.
Optionally, described to detect whether to wrap after there is the different routing of at least two PMTU values according to the routing iinformation
It includes:
The different routing of at least two PMTU values if it does not exist, then it is corresponding in the routing iinformation according to preset routing algorithm
The routing of optimal path is determined in all routings;
The corresponding outgoing interface of routing and next-hop of the optimal path are determined according to the routing of the optimal path;
According to the outgoing interface and next-hop, E-Packet.
In addition, to achieve the above object, the present invention also provides a kind of route selection equipment, the route selection equipment packet
It includes: memory, processor and being stored in the route selection program that can be run on the memory and on the processor, it is described
Route selection program realizes the step of route selection method as described above when being executed by the processor.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
Route selection program is stored on storage medium, the route selection program realizes road as described above when being executed by processor
The step of by route selecting method.
In the present invention, when receiving message, extract the corresponding destination IP of message and message length, according to destination IP with
And message length searches the routing that destination IP corresponding PMTU (path mtu) value is greater than or equal to message length in the routing table,
The routing that optimal path is determined according to routing algorithm, according to the routing forwarding message of optimal path.In the present invention, by PMTU value
Routing algorithm is added as a factor, the preferential routing for selecting PMTU value to be greater than or equal to message length avoids message from passing
During defeated, because message length is greater than, routing device MTU value is dropped (routing device does not support IPv4 fragment) or routing is set
Standby the case where carrying out fragment to message and influencing transmission rate (routing device supports IPv4 fragment), occurs.
Detailed description of the invention
Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of route selection method first embodiment of the present invention;
Fig. 3 be this router to receiving end A one embodiment of transmission path schematic diagram of a scenario;
Fig. 4 is the flow diagram of route selection method second embodiment of the present invention;
Fig. 5 is the refinement flow diagram of step S30 in Fig. 2.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in Figure 1, Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
Equipment of the embodiment of the present invention can be gateway, for example, router.
As shown in Figure 1, the equipment may include: processor 1001, such as CPU, network interface 1004 (several), Yong Hujie
Mouth 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is logical for realizing the connection between these components
Letter.User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), and optional user connects
Mouth 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include the wired of standard
Interface, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory
(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor
1001 storage device.
It will be understood by those skilled in the art that device structure shown in Fig. 1 does not constitute the restriction to equipment, can wrap
It includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium
Believe module, Subscriber Interface Module SIM and route selection program.
In equipment shown in Fig. 1, network interface 1004 is mainly used for connecting background server, carries out with background server
Data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor
1001 can be used for calling the route selection program stored in memory 1005, and execute following operation:
Message is received, the corresponding destination IP of the message and message length are extracted;
In the present embodiment, message refers to the data cell exchanged in network with transmission, contains to be sent complete
Data information.When this router receives message, the corresponding destination IP of message is extracted, such as the destination IP of the message is to receive
Hold A, message length L.
According to the destination IP, the corresponding routing iinformation of the destination IP is searched in preset routing table;
According to the corresponding destination IP of message, such as the destination IP of the message is receiving end A, then searches in preset routing table
Routing iinformation (i.e. the transmission path of this router to receiving end A) from this router to receiving end A.As shown in figure 3, Fig. 3 is
This router to receiving end A one embodiment of transmission path schematic diagram of a scenario.In one embodiment, by this router to reception
Holding A, there are 3 routing iinformations.
The target routing for being greater than or equal to the message length there are PMTU value is detected whether according to the routing iinformation;
In the present embodiment, if by this router to receiving end A there are 3 routing iinformations, five routing iinformations are corresponding
PMTU value is respectively as follows: path a, 1000 bytes;Path b, 1200 bytes;Path c, 1300 bytes;Path d, 1400 bytes;Path
E, 1500 bytes.If message length L is 1300 bytes, there are the PMTU values of path c, path d, tri- paths of path e to be greater than
Equal to message length L.
The target that PMTU value is greater than or equal to the message length if it exists routes, then according to preset routing algorithm described
The routing of optimal path is determined in target routing;
In the present embodiment, when detecting the presence of routing of the PMTU value more than or equal to message length L, for example, message is long
Degree L is 1300 bytes, and there are path c (PMTU value is 1300 bytes), path d (PMTU value is 1400 bytes), path e (PMTU
Value be 1500 bytes) three paths PMTU value be more than or equal to message length L, then according to preset routing algorithm in path c, path
D, the routing of optimal path is determined in tri- paths of path e.In the present embodiment, routing algorithm, that is, Routing Algorithm, the purpose of algorithm
It is to find one from source router to purpose router (i.e. this router to the corresponding receiving end A of message destination IP) optimal path
Routing." optimal routing " consider parameter include such as number of hops (packet data package in a network from a router or in
Stroke of the intermediate node to other node), delay and packet data package transmission communication it is time-consuming.In the present embodiment, preset road
LS algorithm, dijkstra's algorithm, link vector Routing Algorithm etc. can be by algorithm, herein with no restrictions, with specific reference to reality
It is selected.
In the present embodiment, in path of several PMTU values more than or equal to message length L, according to preset routing
Algorithm has determined the routing of an optimal path.For example, the routing of the optimal path determined according to preset routing algorithm is path
E determines outgoing interface and next-hop according to the position of the information of path e and this routing in the e of path, according to outgoing interface and next
Jump E-Packets.
In the present invention, when receiving message, extract the corresponding destination IP of message and message length, according to destination IP with
And message length searches the routing that destination IP corresponding PMTU (path mtu) value is greater than or equal to message length in the routing table,
In the routing that PMTU value is greater than or equal to message length, the routing of optimal path is determined according to routing algorithm, according to optimal road
The routing forwarding message of diameter.In the present invention, routing algorithm is added using PMTU value as a factor, it is preferential to select PMTU value big
In or equal to message length routing, avoid message in transmission process because message length be greater than routing device MTU value lost
(routing device does not support IPv4 fragment) or routing device is abandoned to carry out fragment to message and influence transmission rate (routing device support
IPv4 fragment) the case where occur, avoid data transmission service abnormal, improve data transfer efficiency occur to a certain extent.
Further, processor 1001 can call the route selection program stored in memory 1005, also execute following
Operation:
Routing iinformation message is generated according to local routing table;
Local router MTU value information is filled into routing iinformation message, and is sent to the adjacent road of local router
By device.
In the present embodiment, above-mentioned steps are to send the process of the routing iinformation of this router.For example, using the road of OSPF
The link information of whole network is exchanged by device and saved each other, so that the topological structure of the whole network is grasped, it is independent to calculate routing.OSPF
It is a kind of typical link-state routing protocol, that widely used at present is the OSPF second edition, newest standards RFC2328.I.e.
All routing iinformations that this router routing table is stored be sent to the process on this router neighboring router, send road
Before information, the MTU information of this router is filled to routing iinformation (the existing routers exchange routing iinformation using OSPF
Do not include the MTU value information of router) in, it is then sent to together and this router neighboring router.It is generated in the present invention
The information that routing iinformation message includes is as shown in table 1.
Table 1
Wherein, RA to RD is router, and N1 to N4 is network.
In the present embodiment, send this router routing iinformation message when, by this router MTU value information fill to
In routing iinformation message, in this way, each router MTU value can know about one another on whole network transmission link, thus it is subsequent into
It is preferential that PMTU value is selected to be greater than or equal to report using the PMTU value of each path as a factor of routing when row route selection
The routing of literary length, avoids message in transmission process, because message length is dropped greater than routing device MTU value, (routing is set
It is standby not support IPv4 fragment) or routing device fragment is carried out on message and influences transmission rate (routing device supports IPv4 fragment)
The case where occur, avoid data transmission service to occur to a certain extent abnormal.
Further, processor 1001 can call the route selection program stored in memory 1005, also execute following
Operation:
The routing iinformation message that neighboring router is sent is received, detects whether the routing iinformation message includes adjacent routing
Device MTU value information;
If the routing iinformation message includes neighboring router MTU value information, the routing iinformation message is saved to originally
Ground routing table, and according to routing iinformation message calculating, update local routing table information.
In the present embodiment, above-mentioned steps are the routing iinformation message for receiving neighboring router and sending, and update this router
The process of routing table.For example, a router a, the MTU value of its own is 1300, and router adjacent thereto is respectively router
B, router c, router d.Router a receives the routing iinformation respectively from router b, router c, router d.If
Detected according to routing iinformation: the MTU value of router b is 1200, and the MTU value of router c is unknown, and the MTU value of router d is
1500.Then this router routing table information is updated at this time, the PMTU value of a to the path b is PMTU of 1200, a to the path c
Value is that the PMTU value in 0, a to the path d is 1300.
In the present embodiment, receive neighboring router transmission includes the routing iinformation of neighboring router MTU value information
Message obtains the path P MTU value information between neighboring router according to neighboring router MTU value information, to know entire net
The PMTU value information of network link each path, thus in subsequent progress route selection, using the PMTU value of each path as choosing
One factor on road, the preferential routing for selecting PMTU value to be greater than or equal to message length, avoids message in transmission process, because
Message length is dropped (routing device does not support IPv4 fragment) greater than routing device MTU value or routing device divides message
Piece and the case where influencing transmission rate (routing device support IPv4 fragment), occurs, avoid data transmission service from going out to a certain extent
It is now abnormal.
Further, processor 1001 can call the route selection program stored in memory 1005, also execute following
Operation:
If the routing iinformation message does not include neighboring router MTU value information, the routing iinformation message is saved extremely
Local routing table, and according to routing iinformation message calculating, update local routing table information, it is adjacent described in local routing table
Router MTU value is set to zero.
In the present embodiment, this router receives the routing iinformation message of neighboring router transmission, if detecting a phase
Do not include the MTU value of router c in the routing iinformation message that adjacent router c is sent, i.e. the MTU value of router c be it is unknown, then
The path P MTU value of this router to router c be it is unknown, then calculated according to the routing iinformation message that receives, update this road
The neighboring router MTU value is set to zero by device routing table information, and in the routing table.
In the present embodiment, not including in the routing iinformation message of the neighboring router transmission received when this router should
The path P MTU value of the MTU value of neighboring router, i.e. this router to the neighboring router be it is unknown, then in the routing table will
The neighboring router MTU value is set to zero, subsequent in routing, learns this router to the neighboring router according to routing table information
Path P MTU value be zero, when there are PMTU value be greater than message length L path when, be greater than in line with path P MTU value is paid the utmost attention to
The principle of message length L, the path which is zero will be ignored, it is ensured that the accuracy of scheme.
Further, processor 1001 can call the route selection program stored in memory 1005, also execute following
Operation:
The target that PMTU value is greater than or equal to the message length if it does not exist routes, then according to preset routing algorithm in institute
It states routing iinformation and corresponds to the routing for determining optimal path in all routings;
According to the routing forwarding message of the optimal path.
In the present embodiment, for example, when message length L be 1500 byte when, if in network path all paths PMTU value
Respectively less than 1500 bytes, i.e., there is no the routings that PMTU value is greater than or equal to message length L, then according to Predistribution Algorithm and routing
Information determines the routing of optimal path.In the present embodiment, the parameter that " optimal routing " considers includes such as number of hops (packet data
Packet is in a network from a router or intermediate node to the stroke of other node), delay and packet data package transmission it is logical
Letter is time-consuming.In the present embodiment, preset routing algorithm can be LS algorithm, dijkstra's algorithm, link vector Routing Algorithm etc.,
Herein with no restrictions, it is selected with specific reference to actual needs.In the present embodiment, when according to Predistribution Algorithm and routing iinformation
Determine the routing of optimal path.For example, the routing of the optimal path determined according to preset routing algorithm is path e, according to path e
Position in the e of path of information and this routing determine outgoing interface and next-hop, E-Packeted according to outgoing interface and next-hop.
In the present embodiment, when there is no the routings that PMTU value is greater than or equal to message length L, then according to preset routing algorithm
And routing iinformation determines the routing of optimal path, it is ensured that the integrality of the present invention program, so that the present invention program is in network
When the PMTU value in all paths is respectively less than message length L in path, the present invention program is still valid feasible.
Further, processor 1001 can call the route selection program stored in memory 1005, also execute following
Operation:
Detect whether there is the different routing of at least two PMTU values according to the routing iinformation;
The different routing of at least two PMTU values if it exists, then detecting in the different routing of at least two PMTU values is
It is no that there are the target routings that PMTU value is greater than or equal to the message length.
In the present embodiment, it when the message that a length is L is transferred to this router, needs to determine outgoing interface for the message
And next-hop.According to the destination IP of the message, routing letter corresponding with the IP is searched in the routing table of this router storage
Breath, for example, finding routing iinformation (the i.e. corresponding transmission road the IP corresponding with the IP in the routing table of this router storage
Diameter) it is path a, path b, path c.Wherein, path a, path b, the path P MTU value of path c are different, then further detection
It is greater than or equal to the routing of message length L with the presence or absence of PMTU value.
In the present embodiment, before determining the routing of optimal path, it is determined whether there are PMTU values to be greater than or equal to message
The routing of length, the preferential routing for selecting PMTU value to be greater than or equal to message length, avoids message in transmission process, because of report
Literary length is greater than routing device MTU value and is dropped (routing device does not support IPv4 fragment) or routing device to message progress fragment
And the case where influencing transmission rate (routing device supports IPv4 fragment), occurs, and avoids data transmission service from occurring to a certain extent
It is abnormal.
Further, processor 1001 can call the route selection program stored in memory 1005, also execute following
Operation:
The different routing of at least two PMTU values if it does not exist, then it is corresponding in the routing iinformation according to preset routing algorithm
The routing of optimal path is determined in all routings;
The corresponding outgoing interface of routing and next-hop of the optimal path are determined according to the routing of the optimal path;
According to the outgoing interface and next-hop, E-Packet.
In the present embodiment, it when the message that a length is L is transferred to this router, needs to determine outgoing interface for the message
And next-hop.According to the destination IP of the message, routing letter corresponding with the IP is searched in the routing table of this router storage
Breath, for example, finding routing iinformation (the i.e. corresponding transmission road the IP corresponding with the IP in the routing table of this router storage
Diameter) it is path a, path b, path c.When there is no at least two PMTU values different routings (i.e. path a, path b, path c
Path P MTU value is all the same) when, no matter the PMTU value is more than or equal to message length or is less than message length, all directly according to routing
Information (routing iinformation of path a, path b, path c) and preset routing algorithm determine the routing of optimal path.
In the present embodiment, routing algorithm, that is, Routing Algorithm, the purpose of algorithm is to find one from source router to purpose road
By device (the i.e. routing of this router to the corresponding receiving end A of message destination IP) optimal path.The parameter that " optimal routing " considers
Including such as number of hops (packet data package is in a network from a router or intermediate node to the stroke of other node), prolong
When and packet data package transmission communication it is time-consuming.In the present embodiment, preset routing algorithm can be LS algorithm, Dijkstra is calculated
Method, link vector Routing Algorithm etc., herein with no restrictions, are selected with specific reference to actual needs.For example, according to preset routing
The routing for the optimal path that algorithm determines is path e, is determined according to the position of the information of path e and this routing in the e of path
Outgoing interface and next-hop, E-Packet according to outgoing interface and next-hop.
In the present embodiment, when the different routing of at least two PMTU values is not present, then according to preset routing algorithm and
Routing iinformation determines the routing of optimal path, it is ensured that the integrality of the present invention program, so that the present invention program is in network path
In all paths PMTU value it is consistent when, the present invention program is still valid feasible.
It is the flow diagram of route selection method first embodiment of the present invention referring to Fig. 2, Fig. 2.
In one embodiment, route selection method includes:
Step S10 receives message, extracts the corresponding destination IP of the message and message length;
In the present embodiment, message refers to the data cell exchanged in network with transmission, contains to be sent complete
Data information.When this router receives message, the corresponding destination IP of message is extracted, such as the destination IP of the message is to receive
Hold A, message length L.
Step S20 searches the corresponding routing iinformation of the destination IP according to the destination IP in preset routing table;
According to the corresponding destination IP of message, such as the destination IP of the message is receiving end A, then searches in preset routing table
Routing iinformation (i.e. the transmission path of this router to receiving end A) from this router to receiving end A.As shown in figure 3, Fig. 3 is
This router to receiving end A one embodiment of transmission path schematic diagram of a scenario.In one embodiment, by this router to reception
Holding A, there are 3 routing iinformations.
Step S30 detects whether that there are the mesh that PMTU value is greater than or equal to the message length according to the routing iinformation
Mark routing;
In the present embodiment, if by this router to receiving end A there are 3 routing iinformations, five routing iinformations are corresponding
PMTU value is respectively as follows: path a, 1000 bytes;Path b, 1200 bytes;Path c, 1300 bytes;Path d, 1400 bytes;Path
E, 1500 bytes.If message length L is 1300 bytes, there are the PMTU values of path c, path d, tri- paths of path e to be greater than
Equal to message length L.
Step S40, the target that PMTU value is greater than or equal to the message length if it exists are routed, are then calculated according to preset routing
Method determines the routing of optimal path in target routing;
In the present embodiment, when detecting the presence of routing of the PMTU value more than or equal to message length L, for example, message is long
Degree L is 1300 bytes, and there are path c (PMTU value is 1300 bytes), path d (PMTU value is 1400 bytes), path e (PMTU
Value be 1500 bytes) three paths PMTU value be more than or equal to message length L, then according to preset routing algorithm in path c, path
D, the routing of optimal path is determined in tri- paths of path e.In the present embodiment, routing algorithm, that is, Routing Algorithm, the purpose of algorithm
It is to find one from source router to purpose router (i.e. this router to the corresponding receiving end A of message destination IP) optimal path
Routing." optimal routing " consider parameter include such as number of hops (packet data package in a network from a router or in
Stroke of the intermediate node to other node), delay and packet data package transmission communication it is time-consuming.In the present embodiment, preset road
LS algorithm, dijkstra's algorithm, link vector Routing Algorithm etc. can be by algorithm, herein with no restrictions, with specific reference to reality
It is selected.
In the present embodiment, in path of several PMTU values more than or equal to message length L, according to preset routing
Algorithm has determined the routing of an optimal path.For example, the routing of the optimal path determined according to preset routing algorithm is path
E determines outgoing interface and next-hop according to the position of the information of path e and this routing in the e of path, according to outgoing interface and next
Jump E-Packets.
In the present invention, when receiving message, extract the corresponding destination IP of message and message length, according to destination IP with
And message length searches the routing that destination IP corresponding PMTU (path mtu) value is greater than or equal to message length in the routing table,
In the routing that PMTU value is greater than or equal to message length, the routing of optimal path is determined according to routing algorithm, according to optimal road
The routing forwarding message of diameter.In the present invention, routing algorithm is added using PMTU value as a factor, it is preferential to select PMTU value big
In or equal to message length routing, avoid message in transmission process because message length be greater than routing device MTU value lost
(routing device does not support IPv4 fragment) or routing device is abandoned to carry out fragment to message and influence transmission rate (routing device support
IPv4 fragment) the case where occur, avoid data transmission service to occur to a certain extent abnormal.
Further, include: before step S10 in an alternate embodiment of the present invention
Routing iinformation message is generated according to local routing table;
Local router MTU value information is filled into routing iinformation message, and is sent to the adjacent road of local router
By device.
In the present embodiment, above-mentioned steps are to send the process of the routing iinformation of this router.For example, using the road of OSPF
The link information of whole network is exchanged by device and saved each other, so that the topological structure of the whole network is grasped, it is independent to calculate routing.OSPF
It is a kind of typical link-state routing protocol, that widely used at present is the OSPF second edition, newest standards RFC2328.I.e.
All routing iinformations that this router routing table is stored be sent to the process on this router neighboring router, send road
Before information, the MTU information of this router is filled to routing iinformation (the existing routers exchange routing iinformation using OSPF
Do not include the MTU value information of router) in, it is then sent to together and this router neighboring router.It is generated in the present invention
The information that routing iinformation message includes is as shown in table 1.
Table 1
Wherein, RA to RD is router, and N1 to N4 is network.
In the present embodiment, send this router routing iinformation message when, by this router MTU value information fill to
In routing iinformation message, in this way, each router MTU value can know about one another on whole network transmission link, thus it is subsequent into
It is preferential that PMTU value is selected to be greater than or equal to report using the PMTU value of each path as a factor of routing when row route selection
The routing of literary length, avoids message in transmission process, because message length is dropped greater than routing device MTU value, (routing is set
It is standby not support IPv4 fragment) or routing device fragment is carried out on message and influences transmission rate (routing device supports IPv4 fragment)
The case where occur, avoid data transmission service to occur to a certain extent abnormal.
Further, in an alternate embodiment of the present invention before step S10 further include:
The routing iinformation message that neighboring router is sent is received, detects whether the routing iinformation message includes adjacent routing
Device MTU value information;
If the routing iinformation message includes neighboring router MTU value information, the routing iinformation message is saved to originally
Ground routing table, and according to routing iinformation message calculating, update local routing table information.
In the present embodiment, above-mentioned steps are the routing iinformation message for receiving neighboring router and sending, and update this router
The process of routing table.For example, a router a, the MTU value of its own is 1300, and router adjacent thereto is respectively router
B, router c, router d.Router a receives the routing iinformation respectively from router b, router c, router d.If
Detected according to routing iinformation: the MTU value of router b is 1200, and the MTU value of router c is unknown, and the MTU value of router d is
1500.Then this router routing table information is updated at this time, the PMTU value of a to the path b is PMTU of 1200, a to the path c
Value is that the PMTU value in 0, a to the path d is 1300.
In the present embodiment, receive neighboring router transmission includes the routing iinformation of neighboring router MTU value information
Message obtains the path P MTU value information between neighboring router according to neighboring router MTU value information, to know entire net
The PMTU value information of network link each path, thus in subsequent progress route selection, using the PMTU value of each path as choosing
One factor on road, the preferential routing for selecting PMTU value to be greater than or equal to message length, avoids message in transmission process, because
Message length is dropped (routing device does not support IPv4 fragment) greater than routing device MTU value or routing device divides message
Piece and the case where influencing transmission rate (routing device support IPv4 fragment), occurs, avoid data transmission service from going out to a certain extent
It is now abnormal.
Further, in another alternative embodiment of the present invention, route selection method of the present invention further include:
If the routing iinformation message does not include neighboring router MTU value information, the routing iinformation message is saved extremely
Local routing table, and according to routing iinformation message calculating, update local routing table information, it is adjacent described in local routing table
Router MTU value is set to zero.
In the present embodiment, this router receives the routing iinformation message of neighboring router transmission, if detecting a phase
Do not include the MTU value of router c in the routing iinformation message that adjacent router c is sent, i.e. the MTU value of router c be it is unknown, then
The path P MTU value of this router to router c be it is unknown, then calculated according to the routing iinformation message that receives, update this road
The neighboring router MTU value is set to zero by device routing table information, and in the routing table.
In the present embodiment, not including in the routing iinformation message of the neighboring router transmission received when this router should
The path P MTU value of the MTU value of neighboring router, i.e. this router to the neighboring router be it is unknown, then in the routing table will
The neighboring router MTU value is set to zero, subsequent in routing, learns this router to the neighboring router according to routing table information
Path P MTU value be zero, when there are PMTU value be greater than message length L path when, be greater than in line with path P MTU value is paid the utmost attention to
The principle of message length L, the path which is zero will be ignored, it is ensured that the accuracy of scheme.
It is the flow diagram of route selection method second embodiment of the present invention referring to Fig. 4, Fig. 4.
In one embodiment, include: after step S30
Step S60, the target that PMTU value is greater than or equal to the message length if it does not exist routes, then according to preset routing
Algorithm corresponds to the routing that optimal path is determined in all routings in the routing iinformation;
Step S70, according to the routing forwarding message of the optimal path.
In the present embodiment, for example, when message length L be 1500 byte when, if in network path all paths PMTU value
Respectively less than 1500 bytes, i.e., there is no the routings that PMTU value is greater than or equal to message length L, then according to Predistribution Algorithm and routing
Information determines the routing of optimal path.In the present embodiment, the parameter that " optimal routing " considers includes such as number of hops (packet data
Packet is in a network from a router or intermediate node to the stroke of other node), delay and packet data package transmission it is logical
Letter is time-consuming.In the present embodiment, preset routing algorithm can be LS algorithm, dijkstra's algorithm, link vector Routing Algorithm etc.,
Herein with no restrictions, it is selected with specific reference to actual needs.In the present embodiment, when according to Predistribution Algorithm and routing iinformation
Determine the routing of optimal path.For example, the routing of the optimal path determined according to preset routing algorithm is path e, according to path e
Position in the e of path of information and this routing determine outgoing interface and next-hop, E-Packeted according to outgoing interface and next-hop.
In the present embodiment, when there is no the routings that PMTU value is greater than or equal to message length L, then according to preset routing algorithm
And routing iinformation determines the routing of optimal path, it is ensured that the integrality of the present invention program, so that the present invention program is in network
When the PMTU value in all paths is respectively less than message length L in path, the present invention program is still valid feasible.
It is the refinement flow diagram of step S30 in Fig. 2 referring to Fig. 5, Fig. 5.
In one embodiment, step S30 includes:
Step S301 detects whether there is the different routing of at least two PMTU values according to the routing iinformation;
Step S302, the different routing of at least two PMTU values if it exists, then detection at least two PMTU values are different
Routing in the presence or absence of PMTU value be greater than or equal to the message length target route.
In the present embodiment, it when the message that a length is L is transferred to this router, needs to determine outgoing interface for the message
And next-hop.According to the destination IP of the message, routing letter corresponding with the IP is searched in the routing table of this router storage
Breath, for example, finding routing iinformation (the i.e. corresponding transmission road the IP corresponding with the IP in the routing table of this router storage
Diameter) it is path a, path b, path c.Wherein, path a, path b, the path P MTU value of path c are different, then further detection
It is greater than or equal to the routing of message length L with the presence or absence of PMTU value.
In the present embodiment, before determining the routing of optimal path, it is determined whether there are PMTU values to be greater than or equal to message
The routing of length, the preferential routing for selecting PMTU value to be greater than or equal to message length, avoids message in transmission process, because of report
Literary length is greater than routing device MTU value and is dropped (routing device does not support IPv4 fragment) or routing device to message progress fragment
And the case where influencing transmission rate (routing device supports IPv4 fragment), occurs, and avoids data transmission service from occurring to a certain extent
It is abnormal.
Further, in another alternative embodiment of the present invention, include after step S301;
The different routing of at least two PMTU values if it does not exist, then it is corresponding in the routing iinformation according to preset routing algorithm
The routing of optimal path is determined in all routings;
The corresponding outgoing interface of routing and next-hop of the optimal path are determined according to the routing of the optimal path;
According to the outgoing interface and next-hop, E-Packet.
In the present embodiment, it when the message that a length is L is transferred to this router, needs to determine outgoing interface for the message
And next-hop.According to the destination IP of the message, routing letter corresponding with the IP is searched in the routing table of this router storage
Breath, for example, finding routing iinformation (the i.e. corresponding transmission road the IP corresponding with the IP in the routing table of this router storage
Diameter) it is path a, path b, path c.When there is no at least two PMTU values different routings (i.e. path a, path b, path c
Path P MTU value is all the same) when, no matter the PMTU value is more than or equal to message length or is less than message length, all directly according to routing
Information (routing iinformation of path a, path b, path c) and preset routing algorithm determine the routing of optimal path.
In the present embodiment, routing algorithm, that is, Routing Algorithm, the purpose of algorithm is to find one from source router to purpose road
By device (the i.e. routing of this router to the corresponding receiving end A of message destination IP) optimal path.The parameter that " optimal routing " considers
Including such as number of hops (packet data package is in a network from a router or intermediate node to the stroke of other node), prolong
When and packet data package transmission communication it is time-consuming.In the present embodiment, preset routing algorithm can be LS algorithm, Dijkstra is calculated
Method, link vector Routing Algorithm etc., herein with no restrictions, are selected with specific reference to actual needs.For example, according to preset routing
The routing for the optimal path that algorithm determines is path e, is determined according to the position of the information of path e and this routing in the e of path
Outgoing interface and next-hop, E-Packet according to outgoing interface and next-hop
In the present embodiment, when the different routing of at least two PMTU values is not present, then according to preset routing algorithm and
Routing iinformation determines the routing of optimal path, it is ensured that the integrality of the present invention program, so that the present invention program is in network path
In all paths PMTU value it is consistent when, the present invention program is still valid feasible.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, which is characterized in that computer-readable to deposit
Route selection program is stored on storage media, the route selection program realizes routing as described above when being executed by processor
The step of route selecting method.
The specific embodiment of computer readable storage medium of the present invention is the same as the basic phase of each embodiment of above-mentioned route selection method
Together, this will not be repeated here.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of route selection method, which is characterized in that the route selection method includes:
Message is received, the corresponding destination IP of the message and message length are extracted;
According to the destination IP, the corresponding routing iinformation of the destination IP is searched in preset routing table;
The target routing for being greater than or equal to the message length there are PMTU value is detected whether according to the routing iinformation;
The target that PMTU value is greater than or equal to the message length if it exists routes, then according to preset routing algorithm in the target
The routing of optimal path is determined in routing.
2. route selection method as described in claim 1, which is characterized in that it is corresponding to extract the message for the reception message
Destination IP and message length before include:
Routing iinformation message is generated according to local routing table;
Local router MTU value information is filled into routing iinformation message, and is sent to the neighboring router of local router.
3. route selection method as described in claim 1, which is characterized in that it is corresponding to extract the message for the reception message
Destination IP and message length before further include:
The routing iinformation message that neighboring router is sent is received, detects whether the routing iinformation message includes neighboring router
MTU value information;
If the routing iinformation message includes neighboring router MTU value information, the routing iinformation message is saved to local road
By table, and according to routing iinformation message calculating, update local routing table information.
4. route selection method as claimed in claim 3, which is characterized in that the routing letter for receiving neighboring router and sending
Message is ceased, detects whether the routing iinformation message includes that neighboring router MTU value information includes: later
If the routing iinformation message does not include neighboring router MTU value information, the routing iinformation message is saved to local
Routing table, and according to routing iinformation message calculating, update local routing table information, adjacent routing described in local routing table
Device MTU value is set to zero.
5. method method is selected in routing as described in claim 1, which is characterized in that described to detect whether to deposit according to the routing iinformation
Include: after PMTU value is greater than or equal to the target routing of the message length
The target that PMTU value is greater than or equal to the message length if it does not exist routes, then according to preset routing algorithm on the road
The routing that optimal path is determined in all routings is corresponded to by information;
According to the routing forwarding message of the optimal path.
6. route selection method as described in claim 1, which is characterized in that described to detect whether to deposit according to the routing iinformation
Include: in the target routing that PMTU value is greater than or equal to the message length
Detect whether there is the different routing of at least two PMTU values according to the routing iinformation;
Whether the different routing of at least two PMTU values if it exists then detects and deposits in the different routing of at least two PMTU values
It is routed in the target that PMTU value is greater than or equal to the message length.
7. route selection method as claimed in claim 6, which is characterized in that described to detect whether to deposit according to the routing iinformation
Include: after the different routing of at least two PMTU values
The different routing of at least two PMTU values if it does not exist, then it is corresponding all in the routing iinformation according to preset routing algorithm
The routing of optimal path is determined in routing;
The corresponding outgoing interface of routing and next-hop of the optimal path are determined according to the routing of the optimal path;
According to the outgoing interface and next-hop, E-Packet.
8. a kind of route selection equipment, which is characterized in that the route selection equipment includes: memory, processor and is stored in
On the memory and the route selection program that can run on the processor, the route selection program is by the processor
Step as described below is realized when execution:
Message is received, the corresponding destination IP of the message and message length are extracted;
According to the destination IP, the corresponding routing iinformation of the destination IP is searched in preset routing table;
The target routing for being greater than or equal to the message length there are PMTU value is detected whether according to the routing iinformation;
The target that PMTU value is greater than or equal to the message length if it exists routes, then according to preset routing algorithm in the target
The routing of optimal path is determined in routing.
9. route selection equipment as claimed in claim 8, which is characterized in that the route selection program is held by the processor
Step as described below is also realized when row:
Routing iinformation message is generated according to local routing table;
Local router MTU value information is filled into routing iinformation message, and is sent to the neighboring router of local router.
10. a kind of computer readable storage medium, which is characterized in that be stored with routing choosing on the computer readable storage medium
Distance sequence realizes the route selection as described in any one of claims 1 to 7 when the route selection program is executed by processor
The step of method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710361783.XA CN108965122B (en) | 2017-05-19 | 2017-05-19 | Routing method, device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710361783.XA CN108965122B (en) | 2017-05-19 | 2017-05-19 | Routing method, device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108965122A true CN108965122A (en) | 2018-12-07 |
CN108965122B CN108965122B (en) | 2022-03-11 |
Family
ID=64463082
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710361783.XA Active CN108965122B (en) | 2017-05-19 | 2017-05-19 | Routing method, device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108965122B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110177045A (en) * | 2019-05-15 | 2019-08-27 | 浙江启程电子科技股份有限公司 | A kind of transmission data configuration method based on MTU value |
CN112333094A (en) * | 2020-11-27 | 2021-02-05 | 迈普通信技术股份有限公司 | Data transmission processing method and device, network equipment and readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030046336A1 (en) * | 2001-08-31 | 2003-03-06 | D'annunzio Michael A. | Persistent link for broadband mobile platform communicatons systems using proxy servers |
US20090225758A1 (en) * | 2006-03-31 | 2009-09-10 | Tetsuro Morimoto | Network relay apparatus, data receiving apparatus, data transmitting apparatus, multipath mtu finding method and multipath mtu finding system |
CN101577709A (en) * | 2008-08-06 | 2009-11-11 | 中兴通讯股份有限公司 | IP packet multiplexing method and equipment capable of avoiding fragmentation |
CN101977156A (en) * | 2010-11-18 | 2011-02-16 | 北京星网锐捷网络技术有限公司 | Method, device and routing equipment for learning maximum transmission unit |
CN102325076A (en) * | 2011-05-24 | 2012-01-18 | 中兴通讯股份有限公司 | Method for discovering PMTU (Path Maximum Transfer Unit) and node |
CN102868609A (en) * | 2012-09-27 | 2013-01-09 | 中兴通讯股份有限公司 | Maximum transmission unit consultation method and data terminal |
-
2017
- 2017-05-19 CN CN201710361783.XA patent/CN108965122B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030046336A1 (en) * | 2001-08-31 | 2003-03-06 | D'annunzio Michael A. | Persistent link for broadband mobile platform communicatons systems using proxy servers |
US20090225758A1 (en) * | 2006-03-31 | 2009-09-10 | Tetsuro Morimoto | Network relay apparatus, data receiving apparatus, data transmitting apparatus, multipath mtu finding method and multipath mtu finding system |
CN101577709A (en) * | 2008-08-06 | 2009-11-11 | 中兴通讯股份有限公司 | IP packet multiplexing method and equipment capable of avoiding fragmentation |
CN101977156A (en) * | 2010-11-18 | 2011-02-16 | 北京星网锐捷网络技术有限公司 | Method, device and routing equipment for learning maximum transmission unit |
CN102325076A (en) * | 2011-05-24 | 2012-01-18 | 中兴通讯股份有限公司 | Method for discovering PMTU (Path Maximum Transfer Unit) and node |
CN102868609A (en) * | 2012-09-27 | 2013-01-09 | 中兴通讯股份有限公司 | Maximum transmission unit consultation method and data terminal |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110177045A (en) * | 2019-05-15 | 2019-08-27 | 浙江启程电子科技股份有限公司 | A kind of transmission data configuration method based on MTU value |
CN112333094A (en) * | 2020-11-27 | 2021-02-05 | 迈普通信技术股份有限公司 | Data transmission processing method and device, network equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108965122B (en) | 2022-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101496348B (en) | Technique for multiple path forwarding of label-switched data traffic | |
US8842522B2 (en) | Incremental deployment of MRT based IPFRR | |
US9602428B2 (en) | Method and apparatus for locality sensitive hash-based load balancing | |
CN104247371A (en) | Name-based neighbor discovery and multi-hop service discovery in information-centric networks | |
EP2254284A1 (en) | Method and device for route installation and distribution | |
WO2018036254A1 (en) | Packet forwarding method and device | |
CN109714274B (en) | Method for acquiring corresponding relation and routing equipment | |
CN109039919A (en) | Forward-path determines method, apparatus, system, computer equipment and storage medium | |
US10659350B2 (en) | Data routing method and apparatus | |
CN108234320B (en) | Message transmission method and switch | |
CN106470158A (en) | Message forwarding method and device | |
CN105991793B (en) | The method and apparatus of message forwarding | |
CN102571587A (en) | Method and equipment for forwarding messages | |
CN103201987A (en) | Prioritization of routing information updates | |
JP5725236B2 (en) | Communication system, node, packet transfer method and program | |
US9548921B2 (en) | Compression of routing information exchanges | |
CN108965122A (en) | Route selection method, equipment and computer readable storage medium | |
CN105634776A (en) | Method and device for determining message forwarding interface | |
CN111464440A (en) | Communication method and device | |
CN103716236A (en) | Route calculation method based on IS-IS protocol and equipment | |
CN101820391A (en) | Route forwarding method used for IP network and network equipment | |
CN101909005A (en) | Method and device for processing forwarding table | |
CN104412548B (en) | The method and apparatus for keeping user equipment (UE) IP address to fix | |
CN111464441A (en) | Communication method and device | |
CN105591932A (en) | Method and device for identifying neighbor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |