CN109639535A - A kind of routing relation detection method and device - Google Patents

A kind of routing relation detection method and device Download PDF

Info

Publication number
CN109639535A
CN109639535A CN201910049851.8A CN201910049851A CN109639535A CN 109639535 A CN109639535 A CN 109639535A CN 201910049851 A CN201910049851 A CN 201910049851A CN 109639535 A CN109639535 A CN 109639535A
Authority
CN
China
Prior art keywords
message
port
identity
data
measured
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
Application number
CN201910049851.8A
Other languages
Chinese (zh)
Other versions
CN109639535B (en
Inventor
梁灵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Xiaopeng Motors Technology Co Ltd
Original Assignee
Guangzhou Xiaopeng Motors Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Xiaopeng Motors Technology Co Ltd filed Critical Guangzhou Xiaopeng Motors Technology Co Ltd
Priority to CN201910049851.8A priority Critical patent/CN109639535B/en
Publication of CN109639535A publication Critical patent/CN109639535A/en
Application granted granted Critical
Publication of CN109639535B publication Critical patent/CN109639535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Abstract

The embodiment of the present application provides a kind of routing relation detection method and device, it include: that the test packet for carrying jth identity to be measured is sent to the i-th port of message forwarding equipment, the message forwarding equipment includes M port, the positive integer that the value of i is 1 to M, the positive integer that the value of j is 1 to N, N are the sum of identity to be measured;The message that a port (M-1) in addition to the i-th port issues is monitored, port output is judged whether there is and carries E-Packeting for the jth identity to be measured;If it exists, then message routing relationship of the port to E-Packet described in i-th port and output about jth identity to be measured is established.The message routing relationship of available routing forwarding equipment whole by way of traversal, though the case where being not detected without two ports there are message routing relationship, to carry out the detection of routing relation more fully hereinafter.

Description

A kind of routing relation detection method and device
Technical field
This application involves fields of communication technology, in particular to a kind of routing relation detection method and device.
Background technique
In auto communication, message forwarding equipment such as gateway serves as the angle of bridge joint different segment signal, progress signal forwarding Color.It can be realized by the routing table of intra-gateway without the forwarding behavior of network segment signal.Supplier when carrying out development, The routing function that gateway is realized generally according to routing table is closed this requires gateway can be realized all routings existing for routing table System, and gateway cannot execute not in any routing relation of routing table record.Therefore, it is necessary to the routing relations of clear gateway.
The test method of gateway routing relation existing in the prior art is to generate corresponding survey based on known routing table Examination file is tested, that is, the routing relation recorded in verifying routing table whether there is.Although existing test method energy Enough measure gateway whether be able to achieve in routing table should existing whole routing relations, but be unable to test whether gateway more forwarded Originally the data that should not turn.Therefore existing test method is there are blind area, cannot all cover gateway routing line be with The one-to-one relationship of routing table.
Apply for content
In view of this, the embodiment of the present application provides a kind of routing relation detection method and device, to improve existing survey Method for testing can not all cover the problem of gateway routing line is the corresponding relationship with routing table.
In a first aspect, the embodiment of the present application provides a kind of routing relation detection method, which comprises turn to message The i-th port for sending out equipment sends the test packet for carrying jth identity to be measured, and the message forwarding equipment includes M port, The positive integer that the value of i is 1 to M, the positive integer that the value of j is 1 to N, N are the sum of identity to be measured;It monitors and removes the i-th end The message that a port (M-1) except mouthful issues judges whether there is port output and carries turning for the jth identity to be measured It transmits messages text;If it exists, then the port to E-Packet described in i-th port and output is established about jth identity mark to be measured The message routing relationship of knowledge.
Routing relation detection method provided by the embodiments of the present application using traversal form to each port about it is each to The test packet for surveying identity is tested, and for one of port, sends the survey for carrying a certain identity to be measured Message is tried, other ports of routing forwarding equipment are then monitored, port is seen if there is and exports forwarding corresponding with test packet Message, if so, then establishing message routing relationship of two ports about above-mentioned identity to be measured.For each port about every A identity to be measured proceeds as described above, to obtain message routing relationship whole in routing forwarding equipment, by time The message routing relationship of the available routing forwarding equipment whole of the mode gone through, though without two ports, there are message roads The case where by relationship but being not detected, to carry out the detection of routing relation more fully hereinafter.
In a possible design, the method also includes: port output if it exists carries the jth identity mark to be measured That knows E-Packets, and obtains the period 1 of the port for exporting and E-Packeting;It obtains i-th port and receives test packet Second round;Judge whether the period 1 is greater than the second round;If so, determining and recording that the routing forwarding is set The standby processing that the fixed cycle was carried out to the test packet.After obtaining the port that output E-Packets, it can also obtain The port exports the period to E-Packet, and the period is compared with the period that the i-th port receives test packet, if output turns Transmit messages text port period be greater than the i-th port period, it is meant that routing forwarding equipment has carried out fixed week to test packet The processing of phase, so that the test packet of input is from the period of output to E-Packet, there are different.
In a possible design, at least one port is configured with pre- in M port of the message forwarding equipment If message, the port for being configured with default message will export the default message when not receiving the test packet;? After sending the test packet for carrying jth identity to be measured to the i-th port of message forwarding equipment, the method also includes: It monitors and is configured with the message that the port of default message issues, judge the default message of being configured with of the message forwarding equipment In port, if there are the message datas of the default message of port to change;If so, establishing i-th port and message Position signal routing relation of the changed port of data about jth identity to be measured, wherein institute's bit signal routing Relationship is that an at least message data changes with the variation of at least one message data in the test packet in default message Relationship.Whole position signal routing relations of routing forwarding equipment are obtained by way of traversal, thus more fully hereinafter into The detection of row routing relation.
In a possible design, it is described establish i-th port and the changed port of message data about After the position signal routing relation of the jth identity to be measured, the method also includes: obtain multiple and different content changes Message, wherein the message of the message data of the content change message and the test packet for carrying jth identity to be measured Data are compared, and there are the contents of a data to change;The plurality of different content change message is sent to the i-th port; The secondary that obtaining is influenced by each of multiple content change messages presets message, and the message data of the secondary default message is deposited A possibility that different from the initial message data of default message;By the message data difference of the multiple secondary default message XOR operation is carried out with the message data of initial default message, calculates and records the number changed in default message with test packet According to position.
After acquiring and establishing a port for signal routing relation, it can start specifically to judge configured with default report Which specific data bit of the default message of the port of text with whether input test message and change, and the relationship is also recorded Come, further improving road has the comprehensive of relationship detection.
In a possible design, described send to the i-th port of message forwarding equipment carries jth identity to be measured Test packet, comprising: the i-th port Xiang Suoshu send have data length corresponding with communication protocol type test packet, The test packet carries jth identity to be measured.Due to not knowing the data length of message forwarding equipment forwarding, need Each data length is tested, improve the comprehensive of test.
Second aspect, the embodiment of the present application provide a kind of device, and described device includes: test packet sending module, use In the test packet for sending carrying jth identity to be measured to the i-th port of message forwarding equipment, the message forwarding equipment packet M port is included, the positive integer that the value of i is 1 to M, the positive integer that the value of j is 1 to N, N is the sum of identity to be measured; E-Packet output module, and the message issued for monitoring a port (M-1) in addition to the i-th port judges whether there is end Mouth output carries E-Packeting for the jth identity to be measured;Message routing establishes module, for establishing i-th port Message routing relationship with the port that E-Packets described in output about jth identity to be measured.
Routing relation detection method provided by the embodiments of the present application using traversal form to each port about it is each to The test packet for surveying identity is tested, and for one of port, sends the survey for carrying a certain identity to be measured Message is tried, other ports of routing forwarding equipment are then monitored, port is seen if there is and exports forwarding corresponding with test packet Message, if so, then establishing message routing relationship of two ports about above-mentioned identity to be measured.For each port about every A identity to be measured proceeds as described above, to obtain message routing relationship whole in routing forwarding equipment, by time The message routing relationship of the available routing forwarding equipment whole of the mode gone through, though without two ports, there are message roads The case where by relationship but being not detected, to carry out the detection of routing relation more fully hereinafter.
In a possible design, described device includes: the period 1 to obtain module, is taken for the output of port if it exists With E-Packeting for jth identity to be measured, the period 1 of the port for exporting and E-Packeting is obtained;Second round Module is obtained, the second round of test packet is received for obtaining i-th port;Period judgment module, it is described for judging Whether the period 1 is greater than the second round;Fixed cycle determining module, for determining and recording the routing forwarding equipment The processing of fixed cycle was carried out to the test packet.
After obtaining the port that output E-Packets, the port can also be obtained and export the period to E-Packet, and will The period is compared with the period that the i-th port receives test packet, if the period for the port that output E-Packets is greater than the i-th port Period, it is meant that routing forwarding equipment has carried out the processing of fixed cycle to test packet so that input test packet There are different from the period of output to E-Packet.
In a possible design, described device further include: message data changes judgment module, is configured for monitoring The message for having the port of default message to issue, judges being configured in the port of default message for the message forwarding equipment, is The no message data there are the default message of port changes;Position signal Route establishment module, for establishing i-th end Position signal routing relation of the mouth with the changed port of message data about jth identity to be measured, wherein institute's rheme Signal routing relation be in default message an at least message data with the change of at least one message data in the test packet The relationship changed and changed.
The port of default message is configured with when message forwarding equipment does not receive the message of input, port still can be with Export the default message of configuration.When message forwarding equipment receives the test packet for carrying a certain identity to be measured, sentence Whether the message data of the default message of the disconnected port for being configured with default message changes, if there is the default report of at least one port The message data of text changes, and can establish the port of input test message with the changed port of message data about upper The position signal routing relation of identity to be measured is stated, position signal routing relation is an at least message data in default message with institute The relationship stating the variation of at least one message data in test packet and changing.It is set by way of traversal to obtain routing forwarding Standby whole position signal routing relations, to carry out the detection of routing relation more fully hereinafter.
In a possible design, described device further include: content change message obtain module, for obtain it is multiple not Same content change message, wherein the message data of the content change message and the survey for carrying jth identity to be measured The message data of examination message is compared, and there are the contents of a data to change;Content change message sending module, for the The port i sends the plurality of different content change message;The default message module of secondary, for obtaining by multiple content change reports The secondary of each influence in text presets message, and the message data of the secondary default message exists and initial default message A possibility that message data is different;XOR operation module, for by the message data of the multiple secondary default message respectively with The message data of initial default message carries out XOR operation, calculates and records the data changed in default message with test packet Position.
After acquiring and establishing a port for signal routing relation, it can start specifically to judge configured with default report Which specific data bit of the default message of the port of text with whether input test message and change, and the relationship is also recorded Come, further improving road has the comprehensive of relationship detection.
In a possible design, the test packet sending module be also used to i-th port send have with The test packet of the corresponding data length of communication protocol type, the test packet carry jth identity to be measured.
For different communication protocol types, there can be the test packet for the data length that is corresponding to it, for example, for control Device local area network (Controller Area Network, CAN) communication protocol, the message for being 8byte with data length;It is right In controller local area network (the Controller Area Network with Flexible with Flexible Data Rate Data-Rate, CAN FD) communication protocol, have data length be respectively 8byte, 12byte, 16byte, 20byte, The message of 24byte, 32byte, 48byte, 64byte are needed due to not knowing the data length of message forwarding equipment forwarding Each data length is tested, improve the comprehensive of test.
The third aspect, the application provide a kind of electronic equipment, comprising: processor, memory and bus, the memory are deposited Contain the executable machine readable instructions of the processor, when described device operation, the processor and the memory it Between by bus communication, any of execution first aspect or first aspect when the machine readable instructions are executed by the processor Method described in optional implementation.
Fourth aspect, the application provide a kind of computer readable storage medium, store on the computer readable storage medium There is computer program, any optional realization of first aspect or first aspect is executed when which is run by processor Method described in mode.
5th aspect, the application provide a kind of computer program product, and the computer program product is transported on computers When row, so that computer executes the method in any possible implementation of first aspect or first aspect.
Above objects, features, and advantages to enable the embodiment of the present application to be realized are clearer and more comprehensible, be cited below particularly compared with Good embodiment, and cooperate appended attached drawing, it is described in detail below.
Detailed description of the invention
Illustrate the technical solutions in the embodiments of the present application or in the prior art in order to clearer, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the flow diagram for the routing relation detection method that the application first embodiment provides;
Fig. 2 is the step flow chart after step S130;
Fig. 3 is the flow chart for the routing relation detection method part steps that the application first embodiment provides;
Fig. 4 is the structural block diagram for the routing relation detection device that the application second embodiment provides.
Specific embodiment
In the prior art, it when the routing relation to the routing forwardings equipment such as such as gateway detects, often first obtains The routing table of the routing forwarding equipment, then the routing relation of another verifying routing table record whether there is;However for road By the Unrecorded routing relation of table, existing detection method can not verify it and be not present, that is to say, that whether gateway more forwarded Originally the data that should not be forwarded are that existing detection method can not be verified.
Drawbacks described above existing in the prior art, applicants contemplate that being inventor after practicing and carefully studying It is obtaining as a result, therefore, what the discovery procedure of the above problem and the hereinafter embodiment of the present invention were proposed regarding to the issue above Solution all should be the contribution that inventor makes the present invention in process of the present invention.
In order to solve the above technical problems, the embodiment of the present application provides following routing relation detection method and device, under Face will describe to the routing relation detection method and device in the embodiment of the present application in detail in conjunction with attached drawing.
First embodiment
Referring to Figure 1, Fig. 1 shows the process signal of the routing relation detection method of the application first embodiment offer Figure, specifically comprises the following steps:
Step S110 sends the test packet for carrying jth identity to be measured to the i-th port of message forwarding equipment.
Message forwarding equipment is the equipment for realizing the function that E-Packets, and can be gateway, such as can be router. The message forwarding equipment includes M port, the positive integer that the value of i is 1 to M, the positive integer that the value of j is 1 to N, N be to Survey the sum of identity.Identity to be measured be message ID to be detected, optionally, message ID can from 0x00 to 0x7ff, Total 8*16*16=2048.Test packet is the message for routing relation between the port of detection messages forwarding device.
In a specific embodiment, step S110 can have and communication protocol class to send to i-th port The test packet of the corresponding data length of type, the test packet carry jth identity to be measured.
For different communication protocol types, there can be the test packet for the data length that is corresponding to it, for example, for control Device local area network (Controller Area Network, CAN) communication protocol, the message for being 8byte with data length;It is right In controller local area network (the Controller Area Network with Flexible with Flexible Data Rate Data-Rate, CAN FD) communication protocol, have data length be respectively 8byte, 12byte, 16byte, 20byte, The message of 24byte, 32byte, 48byte, 64byte.
The test packet of two kinds of contents can be sent for every kind of data length, a kind of is 0 data entirely for data, separately A kind of is 1 data entirely for data.
That is, in CAN communication agreement, to each port and each identity to be measured, transmittable data Length is 8byte, and data content is all 0 test packet;And data length is 8byte, data content is all 1 test report Text, the test packet of the transmittable two kinds of data contents of every kind of data length.
In CAN FD communication protocol, to each port and each identity to be measured, transmittable data length is 8byte, data content be all 0 and data content be all 1 test packet;It is 12byte, data that data length, which can also be sent, Content be all 0 and data content be all 1 test packet;Data length is 16byte, data content be all 0 and data content it is complete For 1 test packet;Data length is 20byte, data content be all 0 and data content be all 1 test packet;Data are long Degree be 24byte, data content be all 0 and data content be all 1 test packet;Data length is 32byte, and data content is complete For 0 and data content be all 1 test packet;Data length is 48byte, data content be all 0 and data content be all 1 Test packet;Data length is 64byte, data content be all 0 and data content be all 1 test packet;Totally 16 kinds of test reports Text.
Due to not knowing the data length of message forwarding equipment forwarding, it is therefore desirable to be surveyed to each data length Examination, improves the comprehensive of test.
Step S120 monitors the message that a port (M-1) in addition to the i-th port issues, it is defeated to judge whether there is port E-Packeting for jth identity to be measured is carried out, if so, executing step S130.
In routing relation detection method provided by the present application, a processing equipment and routing relation to be detected can be passed through Whole ports of routing forwarding equipment are separately connected, and then after processing equipment sends test packet to the i-th port, are set by processing Standby a port (M-1) in addition to the i-th port to monitor routing forwarding equipment.Under normal conditions, from routing forwarding equipment A port input message will not be exported from identical port, therefore processing equipment can monitor except incoming message port it Other outer ports, certainly, processing equipment can also monitor whole ports of routing forwarding equipment, the port that processing equipment is monitored Quantity to should not be construed be limitation to the application.
After through the i-th port input test message, other ports of message forwarding equipment can be monitored, judge that message turns Whether send out in other ports of equipment, which has port to export, carries E-Packeting for identical identity to be measured with test packet, if Have, the port for showing that output E-Packets is connected with the i-th port, the message inputted from the i-th port can be exported and be forwarded To other equipment, S130 is thened follow the steps.
Step S130 establishes the port to E-Packet described in i-th port and output about jth identity mark to be measured The message routing relationship of knowledge.
Message routing relationship is the signal link or concatenated adjacent that message is used for transmission between sending point to destination Link.Above-mentioned steps are detected to the message for carrying jth identity to be measured, therefore, can clear i-th port and output About jth identity to be measured, there are message routing relationships for the port to E-Packet, for the message of other identity to be measured It also needs to be detected accordingly with the presence or absence of message routing relationship.
Routing relation detection method provided by the embodiments of the present application using traversal form to each port about it is each to The test packet for surveying identity is tested, and for one of port, sends the survey for carrying a certain identity to be measured Message is tried, other ports of routing forwarding equipment are then monitored, port is seen if there is and exports forwarding corresponding with test packet Message, if so, then establishing message routing relationship of two ports about above-mentioned identity to be measured.For each port about every A identity to be measured proceeds as described above, to obtain message routing relationship whole in routing forwarding equipment, by time The message routing relationship of the available routing forwarding equipment whole of the mode gone through, though without two ports, there are message roads The case where by relationship but being not detected, to carry out the detection of routing relation more fully hereinafter.
Fig. 2 is referred to, Fig. 2 shows the part steps of the routing relation detection method of the application first embodiment offer to show It is intended to, specifically comprises the following steps:
Step S140, if it exists port output carry E-Packeting for the jth identity to be measured, obtain the output The period 1 of the port to E-Packet.
After by monitoring the port for acquiring and exporting and E-Packeting, the port can be calculated and send two neighboring forwarding The time interval of message, the time interval can be denoted as the period 1.
Step S150 obtains the second round that i-th port receives test packet.
When the i-th port receives test packet, the time interval that the i-th port receives two neighboring test packet is calculated, it should Time interval can be denoted as second round.
Step S160, judges whether the period 1 is greater than the second round, if so, executing step S170.
Compare the size of period 1 and second round, if the period 1 is bigger than second round, shows that message forwarding is set It is standby that adjustment was carried out to the sending cycle to E-Packet, if the period 1 should be equal to second round without adjustment, then execute step Rapid S170.
Step S170 determines and records that the routing forwarding equipment carried out the place of fixed cycle to the test packet Reason.
Determine and record that routing forwarding equipment carried out the processing of fixed cycle to test packet, if what output E-Packeted The period of port is greater than the period of the i-th port, it is meant that and routing forwarding equipment has carried out the processing of fixed cycle to test packet, So that the test packet of input is from the period of output to E-Packet, there are different.
Optionally, Fig. 3 is referred to, can also include following step after step silo in a specific embodiment It is rapid:
Step S210 monitors and is configured with the message that the port of default message issues, judges the message forwarding equipment It is configured in the port of default message, if there are the message datas of the default message of port to change, if so, executing Step S220.
At least one port is configured with default message in M port of message forwarding equipment, is configured with default message Port the default message will be exported when not receiving the test packet.Processing equipment can be monitored only and is configured with The port of default message, certainly, processing equipment can also monitor whole ports of routing forwarding equipment, the end that processing equipment is monitored Mouthful quantity to should not be construed be limitation to the application.
The content of default message is preset data.In a kind of specific embodiment, do not connect within a certain period of time When receiving test packet, the content for presetting message can be initial value;If message forwarding equipment does not connect still after certain period of time Test packet is received, the content of default message can be changed to missing value, and missing value can be about fixed invalid data.For For the receiving device communicated with message forwarding equipment, initial value is usually to meet Message processing logic, is virtual value, if Receiving device one directly receives the default message that message content is initial value, and receiving end will be considered that the default message comes from always In source device, to perform corresponding processing movement to it;Missing value is usually not meet Message processing logic, is invalid Value, receiving device receive the default message that message content is missing value, processing movement can not be executed, so as to save Calculation resources.
After message forwarding equipment receives test packet, processing equipment monitors message forwarding equipment and is configured with default report The port of text, judges whether the message content for the default message that above-mentioned port issues becomes compared with preset data Change.If changing, shows to produce influence whether the presence or absence of test packet changes the message content of default message, then hold Row step S220.
Step S220 establishes i-th port and the changed port of message data about jth identity mark to be measured The position signal routing relation of knowledge.
Wherein, institute's bit signal routing relation be in default message an at least message data in the test packet extremely The relationship lacking the variation of a message data and changing.It might as well be by taking data length is the default message of 5byte as an example, when message turns When hair equipment does not receive test packet, the message content for presetting message is 11 11 11 11 11, when message forwarding equipment connects When receiving test packet, the message content of default message is changed to 10 00 00 00 00.Due to presetting the message content of message Changed, then can establish the identity to be measured of the i-th port and the changed port of message data about carrying Position signal routing relation.
The port of default message is configured with when message forwarding equipment does not receive the message of input, port still can be with Export the default message of configuration.When message forwarding equipment receives the test packet for carrying a certain identity to be measured, sentence Whether the message data of the default message of the disconnected port for being configured with default message changes, if there is the default report of at least one port The message data of text changes, and can establish the port of input test message with the changed port of message data about upper State the position signal routing relation of identity to be measured.Whole position signals road of routing forwarding equipment is obtained by way of traversal By relationship, to carry out the detection of routing relation more fully hereinafter.
Step S230 obtains multiple and different content change messages.
Wherein, the message data of the content change message and the test packet for carrying jth identity to be measured Message data is compared, and there are the contents of a data bit to change, i.e., a bit changes.Multiple and different contents becomes Change message to change corresponding to difference bit in message content.
Step S240 sends the plurality of different content change message to the i-th port.
Step S250, the secondary that obtaining is influenced by each of multiple content change messages preset message.
There is a possibility that different from the initial message data of default message in the message data of the secondary default message. For being configured with the port of default message, when message forwarding equipment receives multiple and different content change messages, matched The port for being equipped with default message can export default message accordingly, which can be denoted as secondary default message.It is secondary The message data of default message may be different from the initial message data of default message, it is also possible to initial default message Message data it is identical.
Step S260, by the message data of the multiple secondary default message message number with initial default message respectively According to XOR operation is carried out, calculates and record the data bit changed in default message with test packet.
By the message datas of the secondary default message of each of multiple secondary default messages respectively with initial default message Message data carry out XOR operation, to calculate the data bit changed in default message with the input of test packet.
Specific XOR operation process is as follows, might as well be by taking data length is 5Byte as an example:
The message content of initial default message are as follows: 0,0A8 00 00 00, when message forwarding equipment receives test packet Or after content change message, the message content change of message is preset are as follows: 00 28 00 00 00, then next to above-mentioned two report Literary content carries out XOR operation.The binary system of 0xA8 is 10100000, the binary system of 0x28 is 00100000, the two are counted different Or the result is that 10000000, the number of corresponding 16 systems of the exclusive or result is 0x80;Two 0x00 XOR operation obtain result according to It is so 0x00.Therefore, the result that above-mentioned two message content XOR operation obtains is 00 80 00 00 00.
The process of the two exclusive or be 10100000 and 00100000 the position data bit of third from left to right from 1 become 0 mistake Journey.For the result 00 80 00 00 00 that exclusive or obtains, it is converted into binary number, can be obtained:
0000 0000 1000 0000 0000 0000 0000 0000 0000 0000
1 in above-mentioned binary number is turned left from the right side and is constantly moved to left, every time a mobile data bit, judges to need through excessive Few time is mobile, can obtain following binary number:
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
By moving it is found that moving to left a data bit for 1 every time, above-mentioned binary number can be obtained by moving 9 times, will be moved Dynamic number subtracts 1 and can be obtained the data bit changed in default message with test packet, for the example, presets in message with test The data bit that message or content change message change is the 8th Bit data bit.
After acquiring and establishing a port for signal routing relation, it can start specifically to judge configured with default report Which specific data bit of the default message of the port of text with whether input test message and change, and the relationship is also recorded Come, further improving road has the comprehensive of relationship detection.
Second embodiment
Fig. 4 is referred to, Fig. 4 shows the device of the application second embodiment offer, and described device 300 includes:
Test packet sending module 310 carries jth identity mark to be measured for sending to the i-th port of message forwarding equipment The test packet of knowledge, the message forwarding equipment include M port, and the positive integer that the value of i is 1 to M, the value of j is 1 to N Positive integer, N be identity to be measured sum.
E-Packet output module 320, the message issued for monitoring a port (M-1) in addition to the i-th port, judgement It is exported with the presence or absence of port and carries E-Packeting for the jth identity to be measured.
Message routing establishes module 330, for establishing the port to E-Packet described in i-th port and output about institute State the message routing relationship of jth identity to be measured.
Test packet sending module 310, which is also used to send to i-th port, has number corresponding with communication protocol type According to the test packet of length, the test packet carries jth identity to be measured.
Described device further include:
Period 1 obtains module, exports for port if it exists and carries E-Packeting for the jth identity to be measured, Obtain the period 1 of the port for exporting and E-Packeting.
Second round obtains module, and the second round of test packet is received for obtaining i-th port.
Period judgment module, for judging whether the period 1 is greater than the second round.
Fixed cycle determining module carried out the test packet for determining and recording the routing forwarding equipment solid The processing of fixed cycle.
Message data changes judgment module, for monitoring the message for being configured with the port of default message and issuing, judges institute State being configured in the port of default message for message forwarding equipment, if there are the message data of the default message of port hairs Changing.
Position signal Route establishment module, for establishing i-th port and the changed port of message data about institute State the position signal routing relation of jth identity to be measured, wherein institute's bit signal routing relation is at least one in default message The relationship that message data changes with the variation of at least one message data in the test packet.
Content change message obtains module, for obtaining multiple and different content change messages, wherein the content change The message data of message is compared with the message data of the test packet for carrying jth identity to be measured, and there are a data Content change.
Content change message sending module, for sending the plurality of different content change message to the i-th port.
The default message module of secondary, for obtaining the default report of secondary influenced by each of multiple content change messages There is a possibility that different from the initial message data of default message in the message data of text, the secondary default message.
XOR operation module, for the multiple secondary to be preset to the message data of message and the report of initial default message Literary data carry out XOR operation, calculate and record the data bit changed in default message with test packet.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description Specific work process, no longer can excessively be repeated herein with reference to the corresponding process in preceding method.
The application also provides a kind of electronic equipment, comprising: processor, memory and bus, the memory storage is The executable machine readable instructions of processor are stated, when described device operation, are passed through between the processor and the memory Bus communication executes method described in first embodiment when the machine readable instructions are executed by the processor.
The application also provides a kind of computer readable storage medium, is stored with computer on the computer readable storage medium Program executes method described in first embodiment when the computer program is run by processor.
The application also provides a kind of computer program product to be made when the computer program product is run on computers It obtains computer and executes method described in first embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description Specific work process, no longer can excessively be repeated herein with reference to the corresponding process in preceding method.
Under the background that telematics continue to develop, routing forwarding equipment can connect the logical of various different communication protocols Road, the routing between each different communication protocol also can gradually increase.Detection method provided by the embodiments of the present application can basis The configuration in routing forwarding equipment difference channel, realization be extended to CAN (FD), between LIN, MOST, Flexray, Ethernet not Routing with communication protocol is tested.Since traversal test takes a long time, if gateway channels number is more, multiple routings can be closed It is that identical routing forwarding equipment is performed both by routing relation detection method provided by the embodiments of the present application, for different roads Different channels are traversed by forwarding device, to reduce test speed, improve testing efficiency.
The embodiment of the present application provides a kind of routing relation detection method and device, comprising: to the i-th of message forwarding equipment Port sends the test packet for carrying jth identity to be measured, and the message forwarding equipment includes M port, and the value of i is 1 To the positive integer of M, the positive integer that the value of j is 1 to N, N is the sum of identity to be measured;It monitors in addition to the i-th port (M-1) message that a port issues judges whether there is port output and carries E-Packeting for the jth identity to be measured; If it exists, then message of the port to E-Packet described in i-th port and output about jth identity to be measured is established Routing relation.The message routing relationship of available routing forwarding equipment whole by way of traversal, without two Though port is there are message routing relationship but the case where be not detected, to carry out the detection of routing relation more fully hereinafter.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through it Its mode is realized.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are aobvious The device of multiple embodiments according to the application, architectural framework in the cards, the function of method and computer program product are shown It can and operate.In this regard, each box in flowchart or block diagram can represent one of a module, section or code Point, a part of the module, section or code includes one or more for implementing the specified logical function executable Instruction.It should also be noted that function marked in the box can also be attached to be different from some implementations as replacement The sequence marked in figure occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes may be used To execute in the opposite order, this depends on the function involved.It is also noted that each of block diagram and or flow chart The combination of box in box and block diagram and or flow chart can be based on the defined function of execution or the dedicated of movement The system of hardware is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the application can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.It needs Illustrate, herein, relational terms such as first and second and the like be used merely to by an entity or operation with Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities The relationship or sequence on border.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, article or equipment for including a series of elements not only includes those elements, but also including Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, article or equipment in there is also other identical elements.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.It should also be noted that similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain Lid is within the scope of protection of this application.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.

Claims (10)

1. a kind of routing relation detection method, which is characterized in that the described method includes:
The test packet for carrying jth identity to be measured, the message forwarding equipment are sent to the i-th port of message forwarding equipment Including M port, the positive integer that the value of i is 1 to M, the positive integer that the value of j is 1 to N, N is the total of identity to be measured Number;
The message that a port (M-1) in addition to the i-th port issues is monitored, port output is judged whether there is and carries the jth Identity to be measured E-Packets;
If it exists, then the port to E-Packet described in i-th port and output is established about jth identity to be measured Message routing relationship.
2. the method according to claim 1, wherein the method also includes:
Port output if it exists carries E-Packeting for the jth identity to be measured, obtains the end for exporting and E-Packeting The period 1 of mouth;
Obtain the second round that i-th port receives test packet;
Judge whether the period 1 is greater than the second round;
If so, determining and recording that the routing forwarding equipment carried out the processing of fixed cycle to the test packet.
3. the method according to claim 1, wherein at least one in M port of the message forwarding equipment Port is configured with default message, and the port for being configured with default message will export institute when not receiving the test packet State default message;
After sending the test packet for carrying jth identity to be measured to the i-th port of message forwarding equipment, the method is also Include:
It monitors and is configured with the message that the port of default message issues, judge the message forwarding equipment is configured with default report In the port of text, if there are the message datas of the default message of port to change;
If so, the position for establishing i-th port and the changed port of message data about jth identity to be measured is believed Number routing relation, wherein institute's bit signal routing relation be in default message an at least message data with the test packet In at least one message data variation and the relationship that changes.
4. according to the method described in claim 3, it is characterized in that, establishing i-th port and message data generation described After the port of variation is about the position signal routing relation of jth identity to be measured, the method also includes:
Obtain multiple and different content change messages, wherein the message data of the content change message is waited for the carrying jth The message data for surveying the test packet of identity is compared, and there are the contents of a data to change;
The plurality of different content change message is sent to the i-th port;
The secondary that obtaining is influenced by each of multiple content change messages presets message, the message number of the secondary default message A possibility that different from the initial message data of default message according to presence;
The message data of the multiple secondary default message is subjected to exclusive or fortune with the message data of initial default message respectively It calculates, calculate and records the data bit changed in default message with test packet.
5. the method according to claim 1, wherein described send to the i-th port of message forwarding equipment carries The test packet of jth identity to be measured, comprising:
The test packet with data length corresponding with communication protocol type, the test packet are sent to i-th port Carry jth identity to be measured.
6. a kind of routing relation detection device, which is characterized in that described device includes:
Test packet sending module, for sending the test for carrying jth identity to be measured to the i-th port of message forwarding equipment Message, the message forwarding equipment include M port, the positive integer that the value of i is 1 to M, the positive integer that the value of j is 1 to N, N is the sum of identity to be measured;
E-Packet output module, and the message of f is issued for monitoring a port (M-1) in addition to the i-th port, judges whether to deposit It is exported in port and carries E-Packeting for the jth identity to be measured;
Message routing establishes module, waits for the port to E-Packet described in output about the jth for establishing i-th port Survey the message routing relationship of identity.
7. device according to claim 6, which is characterized in that described device includes:
Period 1 obtains module, exports for port if it exists and carries E-Packeting for the jth identity to be measured, obtains The period 1 for exporting the port to E-Packet;
Second round obtains module, and the second round of test packet is received for obtaining i-th port;
Period judgment module, for judging whether the period 1 is greater than the second round;
Fixed cycle determining module, for determining and recording that the routing forwarding equipment is fixed week to the test packet excessively The processing of phase.
8. device according to claim 6, which is characterized in that described device further include:
Message data changes judgment module, for monitoring the message for being configured with the port of default message and issuing, judges the report Literary forwarding device is configured in the port of default message, if there are the message datas of the default message of port to become Change;
Position signal Route establishment module, for establishing i-th port and the changed port of message data about the jth The position signal routing relation of identity to be measured, wherein institute's bit signal routing relation is an at least message in default message The relationship that data change with the variation of at least one message data in the test packet.
9. device according to claim 8, which is characterized in that described device further include:
Content change message obtains module, for obtaining multiple and different content change messages, wherein the content change message Message data compared with the message data of the test packet for carrying jth identity to be measured, there are the interior of data Appearance changes;
Content change message sending module, for sending the plurality of different content change message to the i-th port;
The default message module of secondary presets message, institute for obtaining the secondary influenced by each of multiple content change messages There is a possibility that different from the initial message data of default message in the message data for stating secondary default message;
XOR operation module, for by the message data of the multiple secondary default message report with initial default message respectively Literary data carry out XOR operation, calculate and record the data bit changed in default message with test packet.
10. device according to claim 6, which is characterized in that the test packet sending module is also used to described i-th Port sends the test packet with data length corresponding with communication protocol type, and it is to be measured that the test packet carries jth Identity.
CN201910049851.8A 2019-01-18 2019-01-18 Routing relation detection method and device Active CN109639535B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910049851.8A CN109639535B (en) 2019-01-18 2019-01-18 Routing relation detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910049851.8A CN109639535B (en) 2019-01-18 2019-01-18 Routing relation detection method and device

Publications (2)

Publication Number Publication Date
CN109639535A true CN109639535A (en) 2019-04-16
CN109639535B CN109639535B (en) 2020-09-11

Family

ID=66061338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910049851.8A Active CN109639535B (en) 2019-01-18 2019-01-18 Routing relation detection method and device

Country Status (1)

Country Link
CN (1) CN109639535B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110048910A (en) * 2019-04-24 2019-07-23 重庆长安汽车股份有限公司 A kind of vehicle-mounted ethernet gateway test macro and method
CN111343051A (en) * 2020-03-05 2020-06-26 中国第一汽车股份有限公司 Message routing test method, device and storage medium
CN112333038A (en) * 2020-09-29 2021-02-05 北京软慧科技有限公司 Vehicle gateway detection method and device
CN114760227A (en) * 2021-03-16 2022-07-15 广州汽车集团股份有限公司 Message sending delay test method, test upper computer and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7096251B2 (en) * 2002-01-23 2006-08-22 Sun Microsystems, Inc. Calculation of layered routes in a distributed manner
CN101056225A (en) * 2007-05-31 2007-10-17 中兴通讯股份有限公司 A router test method and its onsite simulation test device
US7916734B2 (en) * 2007-09-03 2011-03-29 Electronics And Telecommunications Research Institute Method for determining transmission path of router system
CN103973554A (en) * 2013-01-29 2014-08-06 华为技术有限公司 Routing method, routing system and related equipment
CN106059932A (en) * 2016-08-08 2016-10-26 杭州华三通信技术有限公司 Routing table item generation method and device
CN106953750A (en) * 2017-03-09 2017-07-14 新华三技术有限公司 One kind detection path establishment method and device
US10091099B2 (en) * 2016-05-31 2018-10-02 128 Technology, Inc. Session continuity in the presence of network address translation
CN109150645A (en) * 2017-06-28 2019-01-04 中航光电科技股份有限公司 A kind of test method and system of exchange chip

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7096251B2 (en) * 2002-01-23 2006-08-22 Sun Microsystems, Inc. Calculation of layered routes in a distributed manner
CN101056225A (en) * 2007-05-31 2007-10-17 中兴通讯股份有限公司 A router test method and its onsite simulation test device
US7916734B2 (en) * 2007-09-03 2011-03-29 Electronics And Telecommunications Research Institute Method for determining transmission path of router system
CN103973554A (en) * 2013-01-29 2014-08-06 华为技术有限公司 Routing method, routing system and related equipment
US10091099B2 (en) * 2016-05-31 2018-10-02 128 Technology, Inc. Session continuity in the presence of network address translation
CN106059932A (en) * 2016-08-08 2016-10-26 杭州华三通信技术有限公司 Routing table item generation method and device
CN106953750A (en) * 2017-03-09 2017-07-14 新华三技术有限公司 One kind detection path establishment method and device
CN109150645A (en) * 2017-06-28 2019-01-04 中航光电科技股份有限公司 A kind of test method and system of exchange chip

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110048910A (en) * 2019-04-24 2019-07-23 重庆长安汽车股份有限公司 A kind of vehicle-mounted ethernet gateway test macro and method
CN111343051A (en) * 2020-03-05 2020-06-26 中国第一汽车股份有限公司 Message routing test method, device and storage medium
WO2021175314A1 (en) * 2020-03-05 2021-09-10 中国第一汽车股份有限公司 Message routing testing method and device, and storage medium
CN112333038A (en) * 2020-09-29 2021-02-05 北京软慧科技有限公司 Vehicle gateway detection method and device
CN114760227A (en) * 2021-03-16 2022-07-15 广州汽车集团股份有限公司 Message sending delay test method, test upper computer and storage medium
CN114760227B (en) * 2021-03-16 2023-02-28 广州汽车集团股份有限公司 Message sending delay test method, test upper computer and storage medium

Also Published As

Publication number Publication date
CN109639535B (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN109639535A (en) A kind of routing relation detection method and device
EP3528429A1 (en) Quantum key relay method and device based on centralized management and control network
EP1861963B1 (en) System and methods for identifying network path performance
CN106656801A (en) Method and device for redirection of forwarding path of business flow and business flow forwarding system
US20060242292A1 (en) System, apparatus and method for characterizing messages to discover dependencies of services in service-oriented architectures
US7903657B2 (en) Method for classifying applications and detecting network abnormality by statistical information of packets and apparatus therefor
US11856006B2 (en) Abnormal communication detection apparatus, abnormal communication detection method and program
RU2005141590A (en) TIRE ABSTRACTION
US20210058306A1 (en) Application performance management integration with network assurance
CN104486236B (en) The method and routing device of load balancing
CN103891217A (en) Service assurance using network measurement triggers
CN110177054A (en) A kind of port queue dispatching method, device, network controller and storage medium
CN104270282B (en) A kind of IP network end-to-end test method and apparatus
CN106533973A (en) Method and system for distributing service message, and equipment
WO2019087858A1 (en) Attack communication detection device, attack communication detection method, and program
CN109327356A (en) A kind of generation method and device of user's portrait
CN107579981A (en) A kind of network flow monitoring method and system
CN102714652B (en) Monitoring Data network comprises the conversational communication of multiple data flow
CN108199913A (en) A kind of method and apparatus for realizing delay testing
CN102083094A (en) Interference measuring method and apparatus in wireless communication system
CN102158422A (en) Message forwarding method and equipment for layer 2 ring network
CN109617972A (en) A kind of connection method for building up, device, electronic equipment and storage medium
CN110166320A (en) MPLS-TP OAM realization method and system based on OpenFlow interchanger
CN102752169B (en) Transmitting, monitoring method and device
CN101159955B (en) Service quality measuring method and system based on media gateway control protocol network

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510000 No.8 Songgang street, Cencun, Tianhe District, Guangzhou City, Guangdong Province

Applicant after: GUANGZHOU XPENG AUTOMOBILE TECHNOLOGY Co.,Ltd.

Address before: Room 245, 333 Jiufojian Road, Zhongxin Guangzhou Knowledge City, Luogang District, Guangzhou City, Guangdong 510000

Applicant before: GUANGZHOU XPENG AUTOMOBILE TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant