Embodiment
Make further more detailed description to technical scheme with reference to embodiment.Obviously, retouched
The embodiment stated is only the part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention,
Those of ordinary skill in the art's all other embodiments obtained on the premise of creative work is not made, should all belong to
The scope of protection of the invention.
Refering to Fig. 1, Fig. 1 is a kind of the first reality of the automatic test device of DSCP-to-CoS mappings provided by the invention
Apply the structure diagram of mode.The device 100 of the automatic test includes:Generation module 110, sending module 120, receiving module
130, contrast module 140.
Wherein, generation module 110, for generating the mapping table between DSCP-to-CoS.Specifically, according to current system
Middle DSCP can value range, and CoS can value range, generate the mapping table from DSCP values to CoS values.
For example, the value range that the value range of DSCP is 0~63, CoS is 0~7, a mapping table such as table 1 of generation
It is shown.
1 DSCP-to-CoS of table maps table example 1
DSCP values |
0~6 |
6~15 |
16~23 |
24~31 |
32~39 |
40~47 |
48~55 |
56~63 |
CoS values |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
In the embodiment of the present invention, an automatic test can be carried out, so as to carry out with one different mapping table of every generation
Multiple automatic test.
Sending module 120 connects generation module 110, and the mapping table generated according to generation module 110, which produces, needs what is tested
DSCP values, the DSCP values which tests are included in data message and are sent to interchanger.
Specifically, in the data message of interchanger is sent to, by carrying DSCP values in third layer (i.e. IP) heading,
Optionally, in the data message, also by including User Priority bits fields in the second layer heading of message, from
And the CoS values of carrying system acquiescence.
Receiving module 130 is used for the result message that desampler returns, and interchanger is included in the result message according to number
The CoS values generated according to the DSCP values for needing to test in message.
Specifically, in the result message that interchanger returns, by including User in the second layer heading of message
Priority bits fields, carry the CoS values for the DSCP values generation tested as needed, also, are reported by third layer (i.e. IP)
The DSCP values of needs test are returned in literary head.
Contrast module 140, for parsing the CoS of interchanger generation from the result message that receiving module 130 obtains
Value, determines that the DSCP values of needs test and the CoS values mapping of the generation are correct.
Optionally, if contrast module 140, which performs, determines that the DSCP values of needs test are mapped with the CoS values of the generation
Correct operation fails, and illustrates that interchanger cannot generate correct mapping value, the EOT end of test simultaneously provides miscue.
The prior art is different from, the device of automatic test of the invention generates the mapping table between DSCP-to-CoS, and
Interchanger, the knot that desampler returns are sent to after including the data message for needing to test DSCP values according to mapping table generation
Fruit message, goes out CoS value of the interchanger according to DSCP values generation to be tested from result packet parsing, determines the DSCP values and CoS
The mapping of value is correct, it is achieved thereby that to the automatic test of DSCP-to-CoS mappings, improves testing efficiency.
Refering to Fig. 2, Fig. 2 is a kind of the second reality of the automatic test device of DSCP-to-CoS mappings provided by the invention
Apply the structure diagram of mode.The device 200 includes:Generation module 210, sending module 220, receiving module 230, contrast module
240。
Wherein, generation module 210 includes generation unit 211 and chooses unit 212, the generation unit 211, for basis
The mode of permutation and combination, generates a variety of possible mapping tables between DSCP-to-CoS;The selection unit, in life
The mapping table to be tested is chosen in a variety of possible mapping tables generated into unit 211.A mapping table can be chosen with every,
An automatic test is carried out, so as to carry out multiple automatic test.
For example, the value range of DSCP is that the value range of 0~40, CoS is 0~7 in current system, various groups are set out
Conjunction mode (for example, only 1 group of data are 1 pair of 1 mappings, two groups of data are 1 pair of 1 mappings, and three groups of data are 1 couple of 1 mapping ...),
Then a kind of mapping relations are therefrom chosen as the mapping table to be tested.
In the present embodiment, a mapping table of selection is as shown in table 2.
2 DSCP-to-CoS of table maps table example 2
DSCP values |
0~1 |
2~3 |
4~10 |
11~15 |
16~20 |
21~25 |
25~30 |
30~40 |
CoS values |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Sending module 220 connects generation module 210, and the mapping table generated according to generation module 210, which produces, needs what is tested
DSCP values, the DSCP values which tests are included in data message and are sent to interchanger.
Specifically, in the data message of interchanger is sent to, by carrying DSCP values in third layer (i.e. IP) heading,
Optionally, in the data message, also by including User Priority bits fields in the second layer heading of message, from
And the CoS values of carrying system acquiescence.
, it is necessary to mapping table bag of the DSCP values of test between DSCP-to-CoS in first example of the present embodiment
The DSCP values contained, such as DSCP=40.
In second example of the present embodiment, it is necessary to mapping table of the DSCP values between DSCP-to-CoS of test not
Comprising DSCP values, such as DSCP=50.
Receiving module 230 is used for the result message that desampler returns, and interchanger is included in the result message according to number
The CoS values generated according to the DSCP values for needing to test in message.
Specifically, in the result message that interchanger returns, by including User in the second layer heading of message
Priority bits fields, carry the CoS values for the DSCP values generation tested as needed, also, are reported by third layer (i.e. IP)
The DSCP values of needs test are returned in literary head.
Contrast module 240 includes resolution unit 241, query unit 242, determination unit 243;The resolution unit 241, is used
The CoS that the DSCP values that interchanger is tested according to the needs generate is parsed in the result message received from receiving module 230
Value;Query unit 242 is used to inquire about the corresponding CoS values of DSCP values for needing to test;Determination unit 243 is used to determine parsing
The CoS values that module 241 parses CoS values with the inquiry of enquiry module 242 obtains are identical.
, it is necessary to which the DSCP values of test are included between DSCP-to-CoS in first example of the present embodiment as described above
Mapping table in, query unit 242 inquired about from the mapping table between the DSCP-to-CoS needs test DSCP values pair
The CoS values answered, i.e. DSCP=40, corresponding CoS=7.
, it is necessary to which the DSCP values of test are not included in DSCP-to-CoS in second example of the present embodiment as described above
Between mapping table in, the interchanger includes default map table, which includes between the DSCP-to-CoS
The DSCP values that mapping table does not include are worth mapping relations with CoS, for example, default map table is as shown in table 3, shown query unit
242 inquire about the corresponding CoS values of DSCP values of needs test, i.e. DSCP=50, corresponding CoS=6 from the default map table.
3 DSCP-to-CoS default map tables of table
DSCP values |
0~7 |
8~15 |
16~23 |
24~31 |
32~39 |
40~47 |
48~55 |
56~63 |
CoS values |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Optionally, when determination unit 243 determines that parsing module 241 parses CoS values and inquires about what is obtained with enquiry module 242
After the identical failure of CoS values, illustrate that interchanger cannot generate correct mapping value, the EOT end of test simultaneously provides miscue.
Optionally, the automatic test device of DSCP-to-CoS mappings also includes display module 250, for contrasting mould
Block 240 determines the DSCP values for needing to test with after the CoS values mapping correctly generated according to the DSCP values, passing through one
Display interface shows the CoS values and test result.
The prior art is different from, the device of automatic test of the invention generates the mapping table between DSCP-to-CoS, and
Interchanger, the knot that desampler returns are sent to after including the data message for needing to test DSCP values according to mapping table generation
Fruit message, goes out CoS value of the interchanger according to DSCP values generation to be tested from result packet parsing, determines the DSCP values and CoS
The mapping of value is correct, it is achieved thereby that to the automatic test of DSCP-to-CoS mappings, improves testing efficiency.
Refering to Fig. 3, Fig. 3 is that a kind of method first of the automatic test of DSCP-to-CoS mappings provided by the invention is real
Apply the flow diagram of mode.The step of this method, includes:
S301:Generate the mapping table between DSCP-to-CoS.
Specifically, the step can be the mode according to permutation and combination, a variety of between DSCP-to-CoS possible reflect is generated
Penetrate relation table;The mapping table to be tested is chosen in a variety of possible mapping tables.A mapping table is often chosen, carries out one
Secondary automatic test, so as to carry out multiple automatic test.
For example, the value range of DSCP is that the value range of 0~40, CoS is 0~7 in current system, various groups are set out
Conjunction mode (for example, only 1 group of data are 1 pair of 1 mappings, two groups of data are 1 pair of 1 mappings, and three groups of data are 1 couple of 1 mapping ...),
Then a kind of mapping relations are therefrom chosen as the mapping table to be tested.
In the present embodiment, a mapping table of selection is as shown in table 4.
4 DSCP-to-CoS of table maps table example 3
DSCP values |
0~1 |
2~3 |
4~10 |
11~15 |
16~20 |
21~25 |
25~30 |
30~40 |
CoS values |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
S302:Send according to the data message that the mapping table generates to interchanger, the data message, which includes, to be needed to survey
The DSCP values of examination.
Specifically, in the data message of interchanger is sent to, by carrying DSCP values in third layer (i.e. IP) heading,
Optionally, in the data message, also by including User Priority bits fields in the second layer heading of message, from
And the CoS values of carrying system acquiescence.
, it is necessary to mapping table bag of the DSCP values of test between DSCP-to-CoS in first example of the present embodiment
The DSCP values contained, such as DSCP=40.
In second example of the present embodiment, it is necessary to mapping table of the DSCP values between DSCP-to-CoS of test not
Comprising DSCP values, such as DSCP=50.
S303:The result message that the interchanger returns is received, the result message includes the interchanger according to
The CoS values of DSCP values generation.
Specifically, in the result message that interchanger returns, by including User in the second layer heading of message
Priority bits fields, carry the CoS values for the DSCP values generation tested as needed, also, are reported by third layer (i.e. IP)
The DSCP values of needs test are returned in literary head.
S304:The result message is parsed, determines that the DSCP values and the CoS values mapping of the generation are correct.
Specifically, the step can parse the DSCP values that interchanger is tested according to the needs in result message to generate
CoS values, inquire about it is described need the corresponding CoS values of DSCP values tested, determine that the two CoS values are identical.
, it is necessary to which the DSCP values of test are included between DSCP-to-CoS in first example of the present embodiment as described above
Mapping table in, inquired about from the mapping table between the DSCP-to-CoS needs test the corresponding CoS values of DSCP values,
That is DSCP=40, corresponding CoS=7.
, it is necessary to which the DSCP values of test are not included in DSCP-to-CoS in second example of the present embodiment as described above
Between mapping table in, the interchanger includes default map table, which includes between the DSCP-to-CoS
The DSCP values that mapping table does not include are worth mapping relations with CoS, for example, default map table is as described in Table 5, from the default map
The corresponding CoS values of DSCP values of needs test, i.e. DSCP=50, corresponding CoS=6 are inquired about in table.
5 DSCP-to-CoS default map tables of table
DSCP values |
0~7 |
8~15 |
16~23 |
24~31 |
32~39 |
40~47 |
48~55 |
56~63 |
CoS values |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Optionally, if it is determined that the DSCP values and the correct failure of CoS values mapping of the generation, illustrate to hand in this step
Correct mapping value cannot be generated by changing planes, and the EOT end of test simultaneously provides miscue.
Optionally, this method further comprises shows that the interchanger needs to test according to described by a display interface
DSCP values generation CoS values and test result.
The prior art is different from, the method for automatic test of the invention, generates the mapping table between DSCP-to-CoS,
And according to mapping table generation comprising being sent to interchanger after the data message for needing to test DSCP values, desampler return
As a result message, goes out the CoS values that interchanger generates according to the DSCP values to be tested from result packet parsing, determine the DSCP values with
The mapping of CoS values is correct, it is achieved thereby that to the automatic test of DSCP-to-CoS mappings, improves testing efficiency.
The foregoing is merely embodiments of the present invention, are not intended to limit the scope of the invention, every to utilize this
The equivalent structure or equivalent flow shift that description of the invention and accompanying drawing content are made, it is relevant to be directly or indirectly used in other
Technical field, is included within the scope of the present invention.