CN110233779A - Test method, test macro and computer readable storage medium - Google Patents

Test method, test macro and computer readable storage medium Download PDF

Info

Publication number
CN110233779A
CN110233779A CN201910644109.1A CN201910644109A CN110233779A CN 110233779 A CN110233779 A CN 110233779A CN 201910644109 A CN201910644109 A CN 201910644109A CN 110233779 A CN110233779 A CN 110233779A
Authority
CN
China
Prior art keywords
interface
test
network equipment
data packet
path information
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
CN201910644109.1A
Other languages
Chinese (zh)
Other versions
CN110233779B (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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201910644109.1A priority Critical patent/CN110233779B/en
Publication of CN110233779A publication Critical patent/CN110233779A/en
Application granted granted Critical
Publication of CN110233779B publication Critical patent/CN110233779B/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/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/34Source routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a kind of test method, test macro and computer readable storage medium.This method can be applied to test macro, and test macro includes first network equipment, second network equipment;Multiple first interfaces in first network equipment are connect with multiple second interfaces in second network equipment according to preset path information to form test path.This method comprises: first network equipment is when receiving data packet, to packet encapsulation preset path information, to obtain test data packet;Based on preset path information, first network equipment and second network equipment mutual transmitted test data packet in test path;When second network equipment determines that the second interface for receiving test data packet is the last one interface in test path, second network equipment is based on test data packet output data packet to test equipment, the testing result for determining preset path information based on data packet for test equipment can improve inconvenient the problem of testing forward-path process.

Description

Test method, test macro and computer readable storage medium
Technical field
The present invention relates to communication test technical fields, in particular to a kind of test method, test macro and computer Readable storage medium storing program for executing.
Background technique
Segment routing (Segment Routing, SR) is a provenance routing mechanism, selects forward-path by node, and And guidance E-Packets and forwards along forward-path.Ingress needs insertion segmentation (Segment) list in data packet header, Indicate that the node for receiving data packet is based on the Segment list processing forward data packet, Segment list can be understood as turning Send out path.Due to the forward-path interior joint of a Segment routing (node is a network equipment) quantity in real network It is larger, it does not satisfy the requirements in the test environment in laboratory and biggish at forwarding pathdepth in original simulation actual user's network Situation, so that inconvenient test forward-path process.
Summary of the invention
The application provides a kind of test method, test macro and computer readable storage medium, and it is inconvenient to turning to improve The problem of sending out the test of path process.
To achieve the goals above, technical solution provided by the embodiment of the present application is as follows:
In a first aspect, the embodiment of the present application provides a kind of test method, it is applied to test macro, the test macro includes First network equipment, second network equipment;The first network equipment includes multiple first interfaces, second network equipment packet Multiple second interfaces are included, the multiple first interface is connect to be formed and be surveyed according to preset path information with the multiple second interface Try path, which comprises
The first network equipment is when receiving data packet, to preset path information described in the packet encapsulation, with Obtain test data packet;Based on the preset path information, the first network equipment is with second network equipment described The test data packet is mutually forwarded in test path;It is determined in second network equipment and receives the of the test data packet When two interfaces are the last one interface in the test path, second network equipment is exported based on the test data packet Data packet wraps the detection knot for determining the preset path information for the test equipment to test equipment based on the data Fruit.
In the above-described embodiment, first network equipment and second network equipment cooperate, and are built into pre- for detecting If the test path of routing information, so that participating in test data packet without other network equipments when testing preset path information Forwarding can realize the test to preset path information, inconvenient forward-path process test is asked so as to improve Topic.
With reference to first aspect, in some alternative embodiments, the preset path information, the first network are based on Equipment and second network equipment mutually forward the test data packet in the test path, comprising:
The first network equipment determines current the according to the preset path information in the multiple first interface One output interface;The first network equipment is sent to described the by first output interface, by the test data packet Two network equipments;Second network equipment judges to receive the test data packet when receiving the test data packet Whether second interface is the last one interface in the test path;When second network equipment receives the test data When the second interface of packet is not the last one interface in the test path, second network equipment is according to the preset path Information determines the second current output interface in the multiple second interface, and by second output interface by the survey Examination data packet is sent to the first network equipment, believes to repeat the first network equipment according to the preset path It ceases and determines that current the first output interface to second network equipment is receiving the survey in the multiple first interface When trying data packet, whether the second interface for judging to receive the test data packet is the last one interface in the test path The step of, until second network equipment determine the second interface for receiving the test data packet be it is described the last one connect Mouthful.
In the above-described embodiment, first network equipment and second network equipment pass through mutual transmitted test data packet, nothing It needs other network equipments to participate in the forwarding of test data packet, is just able to achieve the test to preset path information, help to simplify survey Operating process is tried, testing cost is reduced.
With reference to first aspect, in some alternative embodiments, the first network equipment is when receiving data packet, To preset path information described in the packet encapsulation, comprising:
The first network equipment is when receiving the data packet that the test equipment is sent, to the packet encapsulation institute Preset path information is stated, the preset path information includes multiple MPLS labels, for inquiring forward-path according to MPLS label Described in the interface message and the multiple first interface of multiple first interfaces and the multiple second interface and the multiple Interfacing order of the second interface in the test path.
In the above-described embodiment, by facilitating first network equipment, the second net to packet encapsulation preset path information Measurement of the network equipment according to preset path information come transmitted test data packet, with realization to preset path information.
With reference to first aspect, in some alternative embodiments, the test macro further includes the test equipment;Institute It states test equipment and wraps the testing result for determining the preset path information based on the data, comprising:
When the data packet of second network equipment output includes that the test data packet passes through in repeating process First interface and/or second interface quantity when, the test equipment according to the first interface or the quantity of second interface, Determine the depth of forward-path corresponding to the preset path information;Pass through in repeating process when the test data packet When the quantity of first interface in the quantity of first interface and the preset path information is not identical, and/or, when the test number The quantity of the quantity of second interface passed through in repeating process according to packet and the second interface in the preset path information not phase Meanwhile it is abnormal to determine that the preset path information exists.
In the above-described embodiment, the first interface and/or second passed through in repeating process by test data packet connects The quantity of mouth, can determine whether budget routing information is normal, can facilitate the determination to testing result.
With reference to first aspect, in some alternative embodiments, the preset path information, first net are being based on Before network equipment and second network equipment mutually forward the test data packet in the test path, the method is also Include:
The first network equipment controls the multiple first interface and is in connected state;Second network equipment control The multiple second interface is in connected state.
It in the above-described embodiment, can be to avoid connecing because of multiple first by by multiple first interfaces, second interface connection There is the interface that cannot be normally connected in mouth, second interface, and data packet can not be forwarded, to can not achieve default road The problem of test of diameter information.
Second aspect, the embodiment of the present application also provide a kind of test method, are applied to first network equipment, first net Network equipment is connect with the second network device communications, and the first network equipment includes multiple first interfaces, and second network is set Standby includes multiple second interfaces, and the multiple first interface is connect with the multiple second interface according to preset path information with shape At test path, which comprises
When receiving data packet, to preset path information described in the packet encapsulation, to obtain test data packet;Base In the preset path information, the test data packet is mutually forwarded in the test path with second network equipment, And determine that the second interface for receiving the test data packet is last in the test path in second network equipment When a interface, for being based on the test data packet output data packet to test equipment, so that institute for second network equipment It states test equipment and wraps the testing result for determining the preset path information based on the data.
The third aspect, the embodiment of the present application also provide a kind of test method, are applied to second network equipment, second net Network equipment and first network equipment communicate to connect, and the first network equipment includes multiple first interfaces, and second network is set Standby includes multiple second interfaces, and the multiple first interface is connect with the multiple second interface according to preset path information with shape At test path, which comprises
When receiving the test data packet that the first network equipment is sent, based on default in the test data packet Routing information mutually forwards the test data packet, the test number with the first network equipment in the test path It is the first network equipment when receiving data packet for the first time according to packet, preset path information described in the packet encapsulation is obtained The data packet arrived;Determining that the second interface for receiving the test data packet is the last one interface in the test path When, based on the test data packet output data packet to test equipment, determination is wrapped based on the data for the test equipment The testing result of the preset path information.
Fourth aspect, the embodiment of the present application also provide a kind of test macro, the test macro include first network equipment, Second network equipment;The first network equipment includes multiple first interfaces, and second network equipment includes multiple second connecing Mouthful, the multiple first interface is connect with the multiple second interface according to preset path information to form test path;
The first network equipment is used for when receiving data packet, is believed preset path described in the packet encapsulation Breath, to obtain test data packet;The first network equipment is also used to based on the preset path information and second network Equipment mutually forwards the test data packet in the test path;Second network equipment is determining the reception test When the second interface of data packet is the last one interface in the test path, second network equipment is used for based on described Test data packet output data packet to test equipment, the test equipment determines the preset path for packet based on the data The testing result of information.
In conjunction with fourth aspect, in some alternative embodiments, the first network equipment is also used to according to described pre- If routing information determines the first current output interface in the multiple first interface;
The first network equipment is also used to be sent to the test data packet described by first output interface Second network equipment;Second network equipment is also used to when receiving the test data packet, judges to receive the test Whether the second interface of data packet is the last one interface in the test path;Described in being received when second network equipment When the second interface of test data packet is not the last one interface in the test path, second network equipment is also used to root The second current output interface is determined in the multiple second interface according to the preset path information, and defeated by described second The test data packet is sent to the first network equipment by outgoing interface, so as to repeat the first network equipment according to The preset path information determines the first current output interface to second network equipment in the multiple first interface When receiving the test data packet, whether the second interface for judging to receive the test data packet is in the test path The last one interface the step of, until second network equipment determines that receiving the second interface of the test data packet is institute State the last one interface.
In conjunction with fourth aspect, in some alternative embodiments, the first network equipment is receiving the test When the data packet that equipment is sent, it is also used to preset path information described in the packet encapsulation, the preset path packet Multiple MPLS label information are included, for inquiring multiple first interfaces described in forward-path and the multiple the according to label information The interface of the interface message of two interfaces and the multiple first interface and the multiple second interface in the test path Sequentially.
In conjunction with fourth aspect, in some alternative embodiments, the test macro further includes the test equipment;
The test equipment is also used to when the data packet of second network equipment output include the test data When the quantity of the packet first interface passed through in repeating process and/or second interface, according to the first interface or second interface Quantity, determine the depth of forward-path corresponding to the preset path information;The test equipment is also used to when the survey The quantity for the first interface that examination data packet is passed through in repeating process and the quantity of the first interface in the preset path information When not identical, and/or, when the quantity and the preset path of the second interface that the test data packet passes through in repeating process When the quantity of second interface in information is not identical, it is abnormal to determine that the preset path information exists.
In conjunction with fourth aspect, in some alternative embodiments, in the first network equipment and second network Before equipment mutually forwards the test data packet in the test path, the first network equipment is also used to control described Multiple first interfaces are in connected state, and second network equipment is also used to control the multiple second interface and is in connected state State.
5th aspect, the embodiment of the present application also provide a kind of computer readable storage medium, in the readable storage medium storing program for executing It is stored with computer program, when the computer program is run on computers, so that the computer executes above-mentioned side Method.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described.It should be appreciated that the following drawings illustrates only some embodiments of the application, therefore it is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is one of the structural schematic diagram of test macro provided by the embodiments of the present application.
Fig. 2 is the second structural representation of test macro provided by the embodiments of the present application.
Fig. 3 is one of the flow diagram of test method provided by the embodiments of the present application.
Fig. 4 is the two of the flow diagram of test method provided by the embodiments of the present application.
Fig. 5 is the three of the flow diagram of test method provided by the embodiments of the present application.
Icon: 10- test macro;20- first network equipment;Second network equipment of 30-;40- test equipment.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application is described.It needs It is noted that term " first ", " second " etc. are only used for distinguishing description, it is not understood to indicate or imply relatively important Property.
Fig. 1 is please referred to, the embodiment of the present application provides a kind of test macro 10, can be used for executing or realizing following tests Method can test Segment list.
Wherein, test macro 10 may include first network equipment 20 and second network equipment 30.First network equipment 20 It may include multiple first interfaces, second network equipment 30 includes multiple second interfaces, and multiple first interfaces connect with multiple second Mouth is according to the snakelike connection of preset path information to form test path.
Understandably, multiple first interfaces can be the total interface in first network equipment 20, or the first net A part of interface in network equipment 20.Multiple second interfaces can be the total interface in second network equipment 30, or A part of interface in second network equipment 30.
First network equipment 20 can be but not limited to router, interchanger etc., second network equipment 30 and first network Equipment 20 is same or like, for example second network equipment 30 can be router, interchanger etc..
Referring to figure 2., as an alternative embodiment, test macro 10 can also include test equipment 40.Test The quantity of equipment 40 can be one, or two.For example, the test equipment 40 can be with if test equipment 40 is one It is connect simultaneously with first network equipment 20 and second network equipment 30.If test equipment 40 is two, wherein a test equipment 40 can connect with first network equipment 20, for sending the data for being forwarded path testing to first network equipment 20 Packet;Another test equipment 40 is connect with second network equipment 30, for receiving the data packet of second network equipment 30 feedback, and The integrality and validity of forward-path are detected according to received data packet.
Test equipment 40 may be, but not limited to, PC (Personal Computer, PC), personal digital assistant (Personal Digital Assistant, PDA), mobile internet surfing equipment (Mobile Internet Device, MID) etc., It can be used for sending the data packet for measuring Segment list to the network equipment, then pass through first network equipment 20, second The network equipment 30 forwards the data packet, and according to the complete of the data packet measurement Segment list of second network equipment 30 feedback Property and validity.Wherein, Segment list can be regarded as forward-path.
Referring to figure 3., the embodiment of the present application also provides a kind of test method, which can be applied to above-mentioned survey In test system 10.Each equipment in test macro 10 can cooperate to realize each step of test method, to realize The test of Segment list.
Test method shown in Fig. 3 will be described in detail below:
Step S210, the first network equipment 20 are preset when receiving data packet to described in the packet encapsulation Routing information, to obtain test data packet.
First network equipment 20 can parse data packet when receiving data packet, to judge whether needs pair Packet encapsulation preset path information, alternatively, first network equipment 20 is directly to received packet encapsulation preset path information. Wherein, preset path information can be in advance by the Segment list artificially designed, Segment list be used as counting According to the forward-path of packet.Data packet can be used for testing the forward-path of Segment list, and the content of data packet can be with It is configured, is not especially limited here according to the actual situation.
Judging whether to need can be with to the principle of packet encapsulation preset path information are as follows: for example, if received data Packet is directly from the received data packet of test equipment 40, or for when receiving the data packet for the first time, just to the packet encapsulation Preset path information.
Step S210 may include: the first network equipment 20 in the data packet for receiving the transmission of test equipment 40 When, to preset path information described in the packet encapsulation, the preset path information includes the MPLS (multi-protocols of forward-path Tag switching, Multi-Protocol Label Switching) label information, for being inquired according to the MPLS label information It the interface message of multiple first interfaces described in the forward-path and the multiple second interface and the multiple first connects Mouth and interfacing order of the multiple second interface in the test path.Wherein, the MPLS label information can basis Actual conditions are configured.
In the present embodiment, first network equipment 20 can be when receiving data packet from test equipment 40, to being connect The packet encapsulation preset path information of receipts, and for other situation received data packets, it may not need and encapsulate default road again Diameter information.For example, first network equipment 20 is just not necessarily to the second net when receiving the data packet of second network equipment 30 transmission The packet encapsulation preset path information that network equipment 30 is sent.
Data packet after encapsulating preset path information can be used as test data packet.Understandably, in test data packet Including preset path information, in order to which test data coating first network equipment 20, second network equipment 30 are according to preset path Forward-path in information is forwarded.First network equipment 20 or second network equipment 30 after receiving test data packet, It no longer needs to test data encapsulation preset path information.
In the present embodiment, the interface message of preset path information can include but is not limited to the IP address of interface, interface Number etc..Interfacing order in test path can be configured according to the forwarding interface sequence in Segment list.
For example, in Segment list, the sequencing of setting test data packet forwarding are as follows: from first network equipment 20 In first interface N be sent to the second interface N in second network equipment 30, then again from second in second network equipment 30 Interface N+1 is sent to the first interface N+1 in first network equipment 20, then from the first interface in first network equipment 20 N+2 is sent to the second interface N+2 in second network equipment 30, connects until having traversed multiple first in first network equipment 20 Multiple second interfaces in mouth, second network equipment 30.Wherein, N is positive integer more than or equal to 1, for refer to first interface, The number of second interface.
When connecting first network equipment 20 and second network equipment 30, the first interface that can be N by interface index It is connected with the second interface that interface index is N, and configures the first interface being connected, second interface to the IP of phase same network segment Address, the first interface being not connected with, second interface are configured to the IP address of different segment.
As an alternative embodiment, setting test data packet forwards successive suitable when designing Segment list Sequence can also be other sequences, such as: it is sent in second network equipment 30 from the first interface N in first network equipment 20 Second interface N+1, first be then sent to again from the second interface N+2 in second network equipment 30 in first network equipment 20 Interface N+1, then in the second interface being sent to from the first interface N+2 in first network equipment 20 in second network equipment 30 N+3, that is, data packet are forwarded in the different first interface of interface index, second interface.In connection first network When equipment 20 and second network equipment 30, the interfacing order just corresponded in the forward-path in Segment list is attached.Than Such as, the first interface that interface index is N is connected with the second interface that interface index is N+1, by interface index is N+1 the One interface is connected with the second interface that interface index is N+2.Wherein, the first interface being connected, second interface are configured For the IP address of phase same network segment, the first interface being not connected with, second interface are configured to the IP address of different segment.
Step S220 is based on the preset path information, the first network equipment 20 and second network equipment 30 The test data packet is mutually forwarded in the test path.
In the present embodiment, first network equipment 20 and second network equipment 30 can surveyed according to preset path information Try mutual transmitted test data packet in path.
For example, step 220 may include:
The first network equipment 20 determines in the multiple first interface current according to the preset path information First output interface;
The test data packet is sent to described second by first output interface by the first network equipment 20 The network equipment 30;
Second network equipment 30 judges receive the test data packet when receiving the test data packet Whether two interfaces are the last one interface in the test path;
When the second interface that second network equipment 30 receives the test data packet be not in the test path most When the latter interface, second network equipment 30 according to the preset path information, work as by the determination in the multiple second interface The second preceding output interface, and the test data packet is sent to by the first network equipment by second output interface 20, it is determined in the multiple first interface to repeat the first network equipment 20 according to the preset path information The first current output interface, when receiving the test data packet, judges to receive the survey to second network equipment 30 The step of whether second interface for trying data packet is the last one interface in the test path, until second network is set Standby 30 determine that the second interface for receiving the test data packet is the last one described interface.
It understandably, may include that data packet successively passes through the sequencing of each interface and corresponding in preset path information Interface index.Such as, it is assumed that the forward-path of preset path information is identical as test path, as follows: first interface 1, second Interface 1;Second interface 2, first interface 2;First interface 3, second interface 3, but assume second interface 3 be test path in most The latter interface.Based on the sequence, it is the first current output interface that first network equipment 20, which can determine first interface 1 just, Then first network equipment 20 is sent to second network equipment 30 by the first output interface, second interface 1.
Second network equipment 30 is when receiving test data packet, it can be determined that receive the test data packet second connects Whether mouthful 1 be the last one interface in the test path.Because second interface 1 is not that the last one in test path connects Mouthful, so, second network equipment 30 is based on preset path information, can determine that second interface 2 is that the second current output connects Mouthful, and test data packet is sent to by the first network equipment 20 by the second output interface, first interface 2, then again by First network equipment 20, second network equipment 30 repeat above-mentioned test data packet forwarding step.When second interface 3 receives survey When trying data packet, second network equipment 30 may determine that the second interface for receiving test data packet is last in test path One interface, at this point, can stop to 20 transmitted test data packet of first network equipment.
As an alternative embodiment, first network equipment 20 can be to packet encapsulation preset path information When, based on the first interface for each jump that preset path information determines;Similarly, second network equipment 30 can be connects for the first time When receiving the test data packet for being packaged with preset path information, based on the second interface for each jump that preset path information determines. It, can first interface, second based on determined by first network equipment 20, second network equipment 30 in transmitted test data packet Interfacing order carrys out mutual transmitted test data packet.Based on this, first network equipment 20, which may not need, is receiving test number every time When according to packet, the first current output interface is just determined;Similarly, second network equipment 30, which may not need, is receiving test every time When data packet, the second current output interface is just determined.
Before step S220, method may include: that the first network equipment 20 controls at the multiple first interface In connection (UP) state;Second network equipment 30 controls the multiple second interface and is in connection (UP) state.
In the present embodiment, first network equipment 20 can control itself all first interface and be in connected state, It can be control multiple first interfaces in need of test and be in connected state.Similarly, second network equipment 30 can be controlled It makes itself all second interface and is in connected state, be also possible to control multiple second interfaces in need of test and be in connect Logical state.The particular number of the first interface, second interface that need to control connection can be configured according to the actual situation, here It is not especially limited.
In the present embodiment, before testing preset path information, it usually needs ensure more in first network equipment 20 A first interface can be normally connected to, and multiple second interfaces in second network equipment 30 can be normally connected to, to avoid because of There is the interface that cannot be normally connected in one interface, second interface, and data packet can not be forwarded, to can not achieve pre- If the problem of test of routing information.
Step S230 determines that the second interface for receiving the test data packet is the survey in second network equipment 30 When trying the last one interface in path, second network equipment 30 is based on the test data packet output data packet to test Equipment 40 wraps the testing result for determining the preset path information for the test equipment 40 based on the data.
In the present embodiment, second network equipment 30 can export the result data packet after forwarding to test equipment 40, should Result data packet may include the data packet that test equipment 40 is sent to first network equipment 20.Test equipment 40 can be by right Result data packet is parsed, and the testing result of preset path information is obtained.Testing result can be expression preset path information Normal first as a result, the second result to indicate preset path Information abnormity.Wherein, preset path information can normally manage Solution is that the actual depth of forward-path in preset path information is identical as the depth that test obtains, and can pass through forward-path reality The forwarding of existing test data packet, that is, forward-path are complete and correct.If forward-path is imperfect or incorrect, will Obtain indicating the testing result of preset path Information abnormity.
For example, step S230 may include: when the data packet of second network equipment 30 output includes the survey When the quantity of the examination data packet first interface passed through in repeating process and/or second interface, the test equipment 40 is according to institute The quantity for stating first interface or second interface determines the depth of forward-path corresponding to the preset path information.
It may include: test data packet in the data packet that second network equipment 30 is exported to test equipment 40 in repeating process The quantity of the quantity of the first interface of the middle process first interface that perhaps test data packet passes through in repeating process is surveyed The quantity for the first interface that examination data packet is passed through in repeating process and the quantity of second interface.
Test equipment 40 can be according to the quantity for the first interface that test data packet is passed through, or according to the number of second interface Amount, or according to the quantity of first interface and the quantity of second interface, determine the depth of forward-path.The depth of forward-path is just The quantity of first interface or second interface.For example, if the quantity for the first interface that test data packet is passed through is 255, then in advance If the depth of forward-path corresponding to routing information is 255.
When in the quantity and the preset path information for the first interface that the test data packet passes through in repeating process First interface quantity it is not identical when, alternatively, the number for the second interface passed through in repeating process when the test data packet When amount is not identical as the quantity of the second interface in the preset path information, alternatively, when the test data packet is forwarded over The quantity of the first interface passed through in journey is not identical as the quantity of the first interface in the preset path information, and the test The quantity of second interface in the quantity for the second interface that data packet is passed through in repeating process and the preset path information is not When identical, it is abnormal to determine that the preset path information exists.
In the present embodiment, for test data packet in one first interface of every process, second network equipment 30 can be in number According to the interface message for recording the first interface successfully passed through in packet;Or test data packet it is every by a second interface when, First network equipment 20 records the interface message of the first interface successfully passed through in the packet;Alternatively, test data packet is every When by a first interface, second network equipment 30 can record the interface letter of the first interface successfully passed through in the packet Breath, meanwhile, in one second interface of every process, first network equipment 20 records successfully pass through in the packet test data packet First interface interface message.Second network equipment 30 can pass through the expression test data packet recorded in test data packet First interface, second interface interface message (such as IP address) be sent to test equipment 40.
Test equipment 40 can be according to indicate that test data packet passes through in the data packet that second network equipment 30 is sent the The interface message of one interface, second interface, to determine first interface quantity, the second interface quantity of test data packet process.
For the ease of the understanding of those skilled in the art, citing is illustrated to the process of test method below:
Referring once again to Fig. 2, first, it is assumed that needing the actual depth of Segment list (preset path information) to be tested It is 255, when connecting two network equipments, the interface identical with the interface index of second network equipment 30 of first network equipment 20 Pairing, and IP address is set;It is a1 that IP address, which is arranged, in the interface 1 of first network equipment 20, and the interface 1 of second network equipment 30 is set Set IP address b1;It is a2 that IP address, which is arranged, in the interface 2 of first network equipment 20, and the interface 2 of second network equipment 30 is with being arranged IP Location is b2, a1 and b1 phase same network segment, different segment between a1 and a2, and so on, until meeting needed for test Segment list The interface wanted.
Secondly, the identical number interface between first network equipment 20 and second network equipment 30 is passed through into physical connection, Guarantee that interface is in connected state;Segment routing is configured in first network equipment 20, corresponding Segment list stack top information goes out Interface is interface 1, next hop address b1;Segment routing, the corresponding Segment list second layer are configured on second network equipment 30 The outgoing interface of information be interface 2, next-hop a2, and so on, first network equipment 20 is each with second network equipment 30 Interface is by snakelike networking, until 255 interfaces have been respectively configured on first network equipment 20, second network equipment 30.
Again, during the test, the data packet that test equipment 40 is sent encapsulates completely in first network equipment 20 The Segment list of 255 layer depths is interface 1, next-hop according to the stack top information searching of Segment list to outgoing interface Location is b1, is set the second network is sent to by interface 1 after the Segment list pop-up stack top first layer Segment of data packet Standby 30.
Second network equipment 30 checks current Segment list stack top information after receiving data packet, is arranged according to Segment The stack top information searching of table is interface 2 to outgoing interface, and the Segment list of data packet is popped up stack top by next hop address a2 First network equipment 20 is sent to by interface 2 after first layer Segment, and so on, finally assume second network equipment 30 Interface 255 receive data packet, be then based on the path IP that data packet is passed through, output result data packet to test equipment 40, Test equipment 40 can determine the quantity or for the first interface that data packet is passed through according to the path IP in result data packet The quantity of two interfaces, so that it is determined that the depth of Segment list.
Based on above-mentioned design, first network equipment 20 and second network equipment 30 cooperate, and are built into pre- for detecting If the test path of routing information, so that can be realized without other network equipments to pre- when testing preset path information If the test of routing information, so as to improve inconvenient the problem of testing forward-path process.Compared to traditional needs 255 The Segment list that the platform network equipment realizes that depth is 255 is tested, and in the application, can be realized by two network equipments The test for the Segment list that depth is 255, to advantageously reduce the number for needing to participate in the network equipment of forwarding data packet Amount reduces testing cost.
Referring to figure 4., the embodiment of the present application also provides a kind of test method applied to first network equipment 20, the first net Network equipment 20 can execute or realize each step of the test method.
Step S310, when receiving data packet, to preset path information described in the packet encapsulation, to be tested Data packet;
Step S320, be based on the preset path information, with second network equipment 30 in the test path phase The test data packet is mutually forwarded, and determines that the second interface for receiving the test data packet is in second network equipment 30 When the last one interface in the test path, for being based on test data packet output for second network equipment 30 Data packet is to test equipment 40, so that the test equipment 40 wraps the detection for determining the preset path information based on the data As a result.
Understandably, first network equipment 20 can cooperate with second network equipment 30, realize and survey to forward-path Examination.Wherein, the detailed content that first network equipment 20 executes each step of test method is referred to test side as shown in Figure 3 Corresponding step in method, which is not described herein again.
Referring to figure 5., the embodiment of the present application also provides a kind of test method applied to second network equipment 30, the second net Network equipment 30 can execute or realize each step of the test method.
Step S410 is based on the test number when receiving the test data packet that the first network equipment 20 is sent According to the preset path information in packet, the test data is mutually forwarded in the test path with the first network equipment 20 Packet, the test data packet is the first network equipment 20 when receiving data packet for the first time, to the packet encapsulation institute State the data packet that preset path information obtains;
Step S420 is determining that the second interface for receiving the test data packet is the last one in the test path When interface, based on the test data packet output data packet to test equipment 40, the number is based on for the test equipment 40 The testing result of the preset path information is determined according to packet.
Understandably, second network equipment 30 can cooperate with first network equipment 20, realize and survey to forward-path Examination.Wherein, the detailed content that second network equipment 30 executes each step of test method is referred to test side as shown in Figure 3 Corresponding step in method, which is not described herein again.
Referring once again to Fig. 1, in test macro 10 provided by the embodiments of the present application, above-mentioned test method is being executed When, the function of each equipment can be such that
The first network equipment 20 is used for when receiving data packet, is believed preset path described in the packet encapsulation Breath, to obtain test data packet.
The first network equipment 20 is also used to based on the preset path information and second network equipment 30 in institute It states and mutually forwards the test data packet in test path.
Second network equipment 30 is determining that the second interface for receiving the test data packet is in the test path The last one interface when, second network equipment 30 is used for based on the test data packet output data packet to test equipment 40, the test equipment 40 determines the testing result of the preset path information for packet based on the data.
Optionally, the first network equipment 20 is also used to according to the preset path information in the multiple first interface The first current output interface of middle determination.
The first network equipment 20 is also used to through first output interface, and the test data packet is sent to institute State second network equipment 30.
Second network equipment 30 is also used to when receiving the test data packet, judges to receive the test data Whether the second interface of packet is the last one interface in the test path.
When the second interface that second network equipment 30 receives the test data packet be not in the test path most When the latter interface, second network equipment 30 is also used to according to the preset path information in the multiple second interface It determines the second current output interface, and the test data packet is sent to by first net by second output interface Network equipment 20, to repeat the first network equipment 20 according to the preset path information in the multiple first interface The first current output interface of middle determination, when receiving the test data packet, judges to receive to second network equipment 30 The step of whether second interface of the test data packet is the last one interface in the test path, until described second The network equipment 30 determines that the second interface for receiving the test data packet is the last one described interface.
Optionally, the first network equipment 20 is also used to when receiving the data packet that the test equipment 40 is sent To preset path information described in the packet encapsulation, the preset path information includes the MPLS label information of forward-path, For inquiring multiple first interfaces and the multiple second interface described in the forward-path according to the MPLS label information Interfacing order in the test path of interface message and the multiple first interface and the multiple second interface.
Optionally, the test macro 10 further includes the test equipment 40.The test equipment 40 is also used to when described The data packet of second network equipment 30 output include the first interface that passes through in repeating process of the test data packet and/ Or second interface quantity when, according to the first interface or the quantity of second interface, determine that the preset path information institute is right The depth for the forward-path answered;
The test equipment 40 is also used to work as the quantity for the first interface that the test data packet passes through in repeating process When not identical as the quantity of the first interface in the preset path information, and/or, when the test data packet is in repeating process When the quantity of second interface in the quantity of the second interface of middle process and the preset path information is not identical, determine described pre- If routing information exists abnormal.
Optionally, mutually turn in the test path in the first network equipment 20 and second network equipment 30 Before sending out test data packet described, the first network equipment 20 is also used to control the multiple first interface and is in connected state State, second network equipment 30 are also used to control the multiple second interface and are in connected state.
It should be noted that it is apparent to those skilled in the art that, for convenience and simplicity of description, on The specific work process of the test macro 10 of description is stated, it can be with reference to each step corresponding process in preceding method, herein no longer Excessively repeat.
The embodiment of the present application also provides a kind of computer readable storage medium.Computer journey is stored in readable storage medium storing program for executing Sequence, when computer program is run on computers, so that computer executes such as above-mentioned test method as described in the examples.
Through the above description of the embodiments, those skilled in the art can be understood that the application can lead to Hardware realization is crossed, the mode of necessary general hardware platform can also be added to realize by software, based on this understanding, this Shen Technical solution please can be embodied in the form of software products, which can store in a non-volatile memories In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions are used so that a computer equipment (can be Personal computer, server or network equipment etc.) execute method described in each implement scene of the application.
In conclusion the application provides a kind of test method, test macro and computer readable storage medium.This method can To be applied to test macro, test macro includes first network equipment, second network equipment;First network equipment includes multiple One interface, second network equipment include multiple second interfaces, and multiple first interfaces are believed with multiple second interfaces according to preset path To form test path, method includes: first network equipment when receiving data packet, presets road to packet encapsulation for breath connection Diameter information, to obtain test data packet;Based on preset path information, first network equipment and second network equipment are in test path In mutual transmitted test data packet;Determine that the second interface for receiving test data packet is in test path in second network equipment When the last one interface, second network equipment is based on test data packet output data packet to test equipment, is used for test equipment base The testing result of preset path information is determined in data packet.In the present solution, first network equipment and second network equipment are mutual Cooperation, is built into the test path for detecting preset path information, so that being not necessarily to other nets when testing preset path information The forwarding that network equipment participates in test data packet can realize the test to preset path information, so as to improve it is inconvenient to turn The problem of sending out the test of path process.
In embodiment provided herein, it should be understood that disclosed equipment, system and method can also lead to Other modes are crossed to realize.Equipment, system and method embodiment described above is only schematical, for example, in attached drawing Flow chart and block diagram show that the system of multiple embodiments according to the application, the possibility of method and computer program product are real Existing architecture, function and operation.In this regard, each box in flowchart or block diagram can represent module, a journey A part of sequence section or code, a part of the module, section or code include one or more for realizing defined The executable instruction of logic function.
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.

Claims (11)

1. a kind of test method, which is characterized in that be applied to test macro, the test macro includes first network equipment, the Two network equipments;The first network equipment includes multiple first interfaces, and second network equipment includes multiple second interfaces, The multiple first interface is connect according to preset path information with the multiple second interface to form test path, the method Include:
The first network equipment is when receiving data packet, to preset path information described in the packet encapsulation, to obtain Test data packet;
Based on the preset path information, first network equipment phase in the test path with second network equipment Mutually forward the test data packet;
Determine that the second interface for receiving the test data packet is last in the test path in second network equipment When one interface, second network equipment is based on the test data packet output data packet to test equipment, is used for the survey Examination equipment wraps the testing result for determining the preset path information based on the data.
2. the first network is set the method according to claim 1, wherein being based on the preset path information It is standby that the test data packet is mutually forwarded in the test path with second network equipment, comprising:
The first network equipment determines that current first is defeated according to the preset path information in the multiple first interface Outgoing interface;
The test data packet is sent to second network and is set by the first network equipment by first output interface It is standby;
Second network equipment judges the second interface for receiving the test data packet when receiving the test data packet It whether is the last one interface in the test path;
When the second interface that second network equipment receives the test data packet is not the last one in the test path When interface, second network equipment determines current second according to the preset path information in the multiple second interface Output interface, and the test data packet is sent to by the first network equipment by second output interface, so as to weight The first network equipment is executed again, and current first is determined in the multiple first interface according to the preset path information Output interface, when receiving the test data packet, judges receive the test data packet to second network equipment The step of whether two interfaces are the last one interface in the test path, until second network equipment, which determines, receives institute The second interface for stating test data packet is the last one described interface.
3. right the method according to claim 1, wherein the first network equipment is when receiving data packet Preset path information described in the packet encapsulation, comprising:
The first network equipment is when receiving the data packet that the test equipment is sent, to pre- described in the packet encapsulation If routing information, the preset path information includes the MPLS label information of forward-path, for being believed according to the MPLS label Breath inquires the interface message of multiple first interfaces described in the forward-path and the multiple second interface and the multiple The interfacing order of first interface and the multiple second interface in the test path.
4. the method according to claim 1, wherein the test macro further includes the test equipment;
The test equipment wraps the testing result for determining the preset path information based on the data, comprising:
When the data packet of second network equipment output includes that the test data packet passes through in repeating process When the quantity of one interface and/or second interface, the test equipment is determined according to the first interface or the quantity of second interface The depth of forward-path corresponding to the preset path information;
The in the quantity and the preset path information for the first interface that the test data packet passes through in repeating process When the quantity of one interface is not identical, and/or, when the second interface that the test data packet passes through in repeating process quantity with When the quantity of second interface in the preset path information is not identical, it is abnormal to determine that the preset path information exists.
5. a kind of test method, which is characterized in that be applied to first network equipment, the first network equipment is set with the second network Standby communication connection, the first network equipment includes multiple first interfaces, and second network equipment includes multiple second interfaces, The multiple first interface is connect according to preset path information with the multiple second interface to form test path, the method Include:
When receiving data packet, to preset path information described in the packet encapsulation, to obtain test data packet;
Based on the preset path information, the test number is mutually forwarded in the test path with second network equipment According to packet, and second network equipment determine the second interface for receiving the test data packet be in the test path most When the latter interface, for being based on the test data packet output data packet to test equipment for second network equipment, with The test equipment is set to wrap the testing result for determining the preset path information based on the data.
6. a kind of test method, which is characterized in that be applied to second network equipment, second network equipment is set with first network Standby communication connection, the first network equipment includes multiple first interfaces, and second network equipment includes multiple second interfaces, The multiple first interface is connect according to preset path information with the multiple second interface to form test path, the method Include:
When receiving the test data packet that the first network equipment is sent, based on the preset path in the test data packet Information mutually forwards the test data packet, the test data packet with the first network equipment in the test path It is the first network equipment when receiving data packet for the first time, preset path information described in the packet encapsulation is obtained Data packet;
When determining the second interface for receiving the test data packet is the last one interface in the test path, it is based on institute Test data packet output data packet is stated to test equipment, is wrapped based on the data for the test equipment and determines the default road The testing result of diameter information.
7. a kind of test macro, which is characterized in that the test macro includes first network equipment, second network equipment;It is described First network equipment includes multiple first interfaces, and second network equipment includes multiple second interfaces, and the multiple first connects Mouth is connect with the multiple second interface according to preset path information to form test path;
The first network equipment is used for when receiving data packet, to preset path information described in the packet encapsulation, with Obtain test data packet;
The first network equipment is also used to based on the preset path information and second network equipment on the test road The test data packet is mutually forwarded in diameter;
Second network equipment is determining that the second interface for receiving the test data packet is last in the test path When one interface, second network equipment is used for based on the test data packet output data packet to test equipment, the survey Try the testing result that equipment determines the preset path information for packet based on the data.
8. test macro according to claim 7, which is characterized in that the first network equipment is also used to according to described pre- If routing information determines the first current output interface in the multiple first interface;
The first network equipment is also used to through first output interface, and the test data packet is sent to described second The network equipment;
Second network equipment is also used to when receiving the test data packet, judges receive the test data packet Whether two interfaces are the last one interface in the test path;
When the second interface that second network equipment receives the test data packet is not the last one in the test path When interface, second network equipment is also used to be determined in the multiple second interface according to the preset path information current The second output interface, and the test data packet is sent to by the first network equipment by second output interface, It is determined currently in the multiple first interface to repeat the first network equipment according to the preset path information The first output interface to second network equipment when receiving the test data packet, judge to receive the test data The step of whether second interface of packet is the last one interface in the test path, until second network equipment determines The second interface for receiving the test data packet is the last one described interface.
9. test macro according to claim 7, which is characterized in that the first network equipment is receiving the test When the data packet that equipment is sent, it is also used to preset path information described in the packet encapsulation, the preset path packet The MPLS label information of forward-path is included, for inquiring multiple the described in the forward-path according to the MPLS label information The interface message and the multiple first interface and the multiple second interface of one interface and the multiple second interface are in institute State the interfacing order in test path.
10. test macro according to claim 7, which is characterized in that the test macro further includes the test equipment;
The test equipment is also used to when the data packet of second network equipment output include that the test data packet exists When the quantity of the first interface passed through in repeating process and/or second interface, according to the first interface or the number of second interface Amount, determines the depth of forward-path corresponding to the preset path information;
The quantity for the first interface that the test equipment is also used to pass through in repeating process when the test data packet with it is described When the quantity of first interface in preset path information is not identical, and/or, when the test data packet passes through in repeating process Second interface quantity and the preset path information in second interface quantity it is not identical when, determine the preset path Information exists abnormal.
11. a kind of computer readable storage medium, which is characterized in that it is stored with computer program in the readable storage medium storing program for executing, When the computer program is run on computers, so that the computer is executed such as any one of claim 1-6 institute The method stated.
CN201910644109.1A 2019-07-16 2019-07-16 Test method, test system and computer readable storage medium Active CN110233779B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910644109.1A CN110233779B (en) 2019-07-16 2019-07-16 Test method, test system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910644109.1A CN110233779B (en) 2019-07-16 2019-07-16 Test method, test system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110233779A true CN110233779A (en) 2019-09-13
CN110233779B CN110233779B (en) 2021-08-06

Family

ID=67855645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910644109.1A Active CN110233779B (en) 2019-07-16 2019-07-16 Test method, test system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110233779B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037581A (en) * 2019-12-24 2021-06-25 迈普通信技术股份有限公司 Backboard channel testing method and device, board card and computer readable storage medium
CN114465924A (en) * 2021-12-24 2022-05-10 阿里巴巴(中国)有限公司 Network equipment testing method, data packet generating method and switching chip
CN115333980A (en) * 2021-05-11 2022-11-11 中国联合网络通信集团有限公司 Test method, second edge node equipment and edge gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070064597A1 (en) * 2005-09-16 2007-03-22 Bernick David L Globally fair polling for packet switched routers using dynamically biased arbitration
CN102355377A (en) * 2011-06-30 2012-02-15 迈普通信技术股份有限公司 Entire test system and method for Ethernet switch
CN104954205A (en) * 2015-07-22 2015-09-30 上海斐讯数据通信技术有限公司 Soft routing performance test method
CN107222332A (en) * 2017-05-05 2017-09-29 北京神州新桥科技有限公司 Method of testing, device, system and machinable medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070064597A1 (en) * 2005-09-16 2007-03-22 Bernick David L Globally fair polling for packet switched routers using dynamically biased arbitration
CN102355377A (en) * 2011-06-30 2012-02-15 迈普通信技术股份有限公司 Entire test system and method for Ethernet switch
CN104954205A (en) * 2015-07-22 2015-09-30 上海斐讯数据通信技术有限公司 Soft routing performance test method
CN107222332A (en) * 2017-05-05 2017-09-29 北京神州新桥科技有限公司 Method of testing, device, system and machinable medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037581A (en) * 2019-12-24 2021-06-25 迈普通信技术股份有限公司 Backboard channel testing method and device, board card and computer readable storage medium
CN113037581B (en) * 2019-12-24 2024-02-27 迈普通信技术股份有限公司 Backboard channel testing method and device, board card and computer readable storage medium
CN115333980A (en) * 2021-05-11 2022-11-11 中国联合网络通信集团有限公司 Test method, second edge node equipment and edge gateway
CN115333980B (en) * 2021-05-11 2023-10-20 中国联合网络通信集团有限公司 Test method, second edge node equipment and edge gateway
CN114465924A (en) * 2021-12-24 2022-05-10 阿里巴巴(中国)有限公司 Network equipment testing method, data packet generating method and switching chip
CN114465924B (en) * 2021-12-24 2023-12-22 阿里巴巴(中国)有限公司 Network equipment testing method, data packet generating method and switching chip

Also Published As

Publication number Publication date
CN110233779B (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN110233779A (en) Test method, test macro and computer readable storage medium
CN106209490B (en) Select and monitor the method and system of multiple service key performance indicators
CN102638407B (en) Message forwarding method, device and network equipment
US9001668B2 (en) Endpoint selection in a network test system
US10355971B2 (en) System and method for data path validation and verification
CN107517119B (en) Virtual network detection method and device in VPC environment
CN109525451A (en) A kind of implementation method, device, the network equipment and the controller of MPLS network detection
CN107547304A (en) Network card testing method, device and machinable medium
CN108306783A (en) Retransmission method, device based on SDN and computer readable storage medium
CN103888351A (en) Method and device used for managing multiple conversations in network based on multi-path routing
CN109218200A (en) A kind of message processing method and device
US8654654B2 (en) Traffic distribution control
US20230179510A1 (en) Method for sending and forwarding packet, head node, forwarding node and storage medium
CN102891803A (en) Congestion processing method and network device
CN105409169A (en) Construction method, device and system for multi-path forwarding rules
CN108900420B (en) Ductility limit speed method, apparatus and server
CN108183838A (en) The method and device of one introduces a collection nat feature test
CN104486361A (en) Online game connection building method, game terminal and system
CN107547346A (en) A kind of message transmitting method and device
CN114513429A (en) Transmission method for detection message, and method and equipment for determining reverse path
CN108259348A (en) A kind of message transmitting method and device
CN110248379A (en) The performance test methods and device of base station in WLAN
CN108259335A (en) Path detection method and apparatus
US20130148516A1 (en) Choosing Connectable End Points for Network Test
CN105634839B (en) A kind of method and apparatus for obtaining network reachable address space

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