[go: up one dir, main page]

CN108092843B - General test method for router - Google Patents

General test method for router Download PDF

Info

Publication number
CN108092843B
CN108092843B CN201710180928.6A CN201710180928A CN108092843B CN 108092843 B CN108092843 B CN 108092843B CN 201710180928 A CN201710180928 A CN 201710180928A CN 108092843 B CN108092843 B CN 108092843B
Authority
CN
China
Prior art keywords
returning
test system
processing
router
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710180928.6A
Other languages
Chinese (zh)
Other versions
CN108092843A (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.)
B Link Electronic Co ltd
Original Assignee
B Link Electronic 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 B Link Electronic Co ltd filed Critical B Link Electronic Co ltd
Priority to CN201710180928.6A priority Critical patent/CN108092843B/en
Publication of CN108092843A publication Critical patent/CN108092843A/en
Application granted granted Critical
Publication of CN108092843B publication Critical patent/CN108092843B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

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

Abstract

The invention discloses a general test method of a router, which comprises the following steps: the router establishes connection with a test system and automatically pulls up a UDP process inside the router; starting a thread by a test system process, and creating a UDP socket to monitor a port; sequentially receiving UDP data sent by a test system client in a thread, judging the length, analyzing and processing if the length is successful, returning unsucess if the length is failed, and monitoring the data again; according to the data processed in the step S3, the request type is obtained first, and then the processing function corresponding to the type is entered for processing, and if the processing is successful, the required character string is returned; if the success is successful, returning the required character strings, splicing success, and returning the character strings to the test system client through the socket; and if the processing fails, directly returning unsucess to the test system client through the socket.

Description

General test method for router
Technical Field
The invention relates to a test method for testing gateway equipment, in particular to a general test method for a router.
Background
Routers (routers), also called Gateway devices (gateways), are used to connect multiple logically separate networks, so-called logical networks representing a single network or a sub-network. This may be accomplished by the routing function of the router when data is transferred from one subnet to another. Therefore, the router has the functions of judging network addresses and selecting IP paths, can establish flexible connection in a multi-network interconnection environment, can be used for connecting various subnets by completely different data grouping and medium access methods, only receives information of a source station or other routers, and belongs to interconnection equipment of a network layer.
At present, the test of the router is usually realized by testing the traditional TDM switching device by using a socket packet (HTTP/Telnet/SerialComm), however, for different router products, the prior art can only be realized by different test systems, which results in more complex and difficult post-maintenance.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides the universal router test method which is simple and convenient to operate and can be used for sharing the same test system, and only needs to be simply set through a configuration file, so that testers are reduced to adapt to various test methods.
The purpose of the invention is realized by the following technical scheme:
a general test method for a router comprises the following steps:
s1, the router establishes connection with the test system, and automatically pulls up the UDP process inside the router;
s2, testing the system process start thread, creating UDP socket to monitor port;
s3, the thread sequentially receives UDP data sent by the test system client, length judgment is carried out, and success returned is analyzed and processed if success is carried out; if the failure happens, returning unsuccess, and monitoring the data again;
s4, according to the data processed in the step S3, acquiring the request type, entering a processing function corresponding to the type for processing, if the processing is successful, returning the required character string, splicing the returned success, and returning the character string to the test system client through the socket; and if the processing fails, directly returning the returned unsucess to the test system client through the socket.
Specifically, the step S4 is followed by the following steps:
returning to step S2, the port listening is resumed.
Optionally, the following steps are further included between the step S3 and the step S4:
entering a login request, verifying whether the user name and the password of the login client are consistent, if so, returning the PASS to the test system client, and entering the next step; otherwise, prompting the client of the test system to fail login.
Specifically, the request type is one or a combination of a set function, a get function, a write function, a reboot function, a restore function, and an eprorm function.
Compared with the prior art, the invention has the following advantages and beneficial effects:
based on the above, the universal testing method of the invention can directly enable the tester to electrically connect the router to be tested to the testing system, and carry out the test through the port, compared with the existing testing system which needs to independently develop the product testing software for each product, the modular universal testing system of the embodiment adopts the UDP data to carry out the length judgment, and returns the required character string in combination with the request type to realize the test, thereby effectively improving the testing efficiency and greatly reducing the testing cost.
Drawings
Fig. 1 is a flowchart of an implementation of a general router testing method provided in the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
Examples
A general test method for a router comprises the following steps:
s1, the router establishes connection with the test system, and automatically pulls up the UDP process inside the router;
s2, testing the system process start thread, creating UDP socket to monitor port;
s3, the thread sequentially receives UDP data sent by the test system client, length judgment is carried out, and success returned is analyzed and processed if success is carried out; if the failure happens, returning unsuccess, and monitoring the data again;
s4, according to the data processed in the step S3, acquiring the request type, entering a processing function corresponding to the type for processing, if the processing is successful, returning the required character string, splicing the returned success, and returning the character string to the test system client through the socket; and if the processing fails, directly returning the returned unsucess to the test system client through the socket.
Specifically, the step S4 is followed by the following steps:
returning to step S2, the port listening is resumed.
Optionally, the following steps are further included between the step S3 and the step S4:
entering a login request, verifying whether the user name and the password of the login client are consistent, if so, returning the PASS to the test system client, and entering the next step; otherwise, prompting the client of the test system to fail to log in;
specifically, the request type is one or a combination of a set function, a get function, a write function, a reboot function, a restore function, and an eprorm function.
The modular universal test system of the embodiment adopts UDP data to judge the length, and returns required character strings by combining with the request type to realize the test, so that a plurality of router products can share one set of test system and only need to be simply set through configuration files, on one hand, a production line operator does not need to adapt to various product test flows, and the operation becomes simple; on the other hand, the later maintenance of production test is simplified, the newly added function only needs to modify one test parameter, the test efficiency can be effectively improved, and the test cost is greatly reduced.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (4)

1. A general router test method is characterized by comprising the following steps:
s1, the router establishes connection with the test system, and automatically pulls up the UDP process inside the router;
s2, testing the system process start thread, creating UDP socket to monitor port;
s3, sequentially receiving UDP data sent by the test system client in the thread, judging the length, returning success if the length is successful, analyzing and processing; if the failure happens, returning unsuccess, and monitoring the data again;
s4, according to the data processed in the step S3, acquiring the request type, entering a processing function corresponding to the type for processing, if the processing is successful, returning the required character string, splicing the returned success, and returning the character string to the test system client through the socket; and if the processing fails, directly returning the returned unsucess to the test system client through the socket.
2. The universal test method for routers according to claim 1, characterized in that: the step S4 is followed by the following steps:
returning to step S2, the port listening is resumed.
3. The universal test method for routers according to claim 1, characterized in that: the steps between the step S3 and the step S4 further include the following steps:
entering a login request, verifying whether the user name and the password of the login client are consistent, if so, returning the PASS to the test system client, and entering the next step; otherwise, prompting the client of the test system to fail login.
4. A general router test method according to any one of claims 1-3, characterized in that: the request type is one or a combination of several of a set function, a get function, a write function, a reboot function, a restore function and an eeprom function.
CN201710180928.6A 2017-03-24 2017-03-24 General test method for router Active CN108092843B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710180928.6A CN108092843B (en) 2017-03-24 2017-03-24 General test method for router

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710180928.6A CN108092843B (en) 2017-03-24 2017-03-24 General test method for router

Publications (2)

Publication Number Publication Date
CN108092843A CN108092843A (en) 2018-05-29
CN108092843B true CN108092843B (en) 2020-04-24

Family

ID=62170046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710180928.6A Active CN108092843B (en) 2017-03-24 2017-03-24 General test method for router

Country Status (1)

Country Link
CN (1) CN108092843B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115996182B (en) * 2021-10-15 2025-08-26 腾讯科技(深圳)有限公司 Gateway device testing method, device, electronic device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100564756B1 (en) * 2003-12-03 2006-03-27 한국전자통신연구원 MEAC protocol test apparatus and method
CN101820329B (en) * 2010-01-28 2013-01-02 东南大学 COM (port communication port)-based test control method
CN102609341A (en) * 2011-07-08 2012-07-25 李康 Hardware equipment automation testing system and testing method thereof
CN102708042A (en) * 2011-08-12 2012-10-03 华南理工大学 Service-oriented embedded software test system
CN106301993A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 A kind of method and apparatus of test router
CN105490875A (en) * 2015-11-25 2016-04-13 广州视源电子科技股份有限公司 Automatic testing method, device, product to be tested and system

Also Published As

Publication number Publication date
CN108092843A (en) 2018-05-29

Similar Documents

Publication Publication Date Title
US9813323B2 (en) Systems and methods for controlling switches to capture and monitor network traffic
US9313116B2 (en) Enhanced retry method
US10419322B2 (en) Method of collecting information about test devices in a network
US11153185B2 (en) Network device snapshots
CN104158701A (en) Gateway function testing method and device
US10110556B2 (en) Methods, systems, and computer readable media for initiating and executing performance tests of a private network and/or components thereof
CN105429841B (en) NNI PING implementation method and device
US9077618B2 (en) Service level mirroring in ethernet network
CN101431447B (en) A method and device for testing virtual private network server capacity and performance
WO2005053230A2 (en) Methods and systems for collecting information relating to a communication network and for collecting information relating to operating systems operating on nodes in a communication network
US11190405B2 (en) Network topology generation based on network device information
EP3588859A1 (en) Network device configuration versioning
CN114465931A (en) Network detection method, device, electronic equipment and storage medium
US7324454B2 (en) Router
CN118055052A (en) Dynamic host configuration protocol test method, electronic device and computer readable medium
CN103312765B (en) The accessibility of the node of the network of checking industrial automation and control system
CN106341249A (en) Redundant port switching method and device
CN106685817A (en) A method and device for traffic switching of box-side equipment
CN114124675B (en) Home-wide service fault diagnosis method and device based on metropolitan area network
CN108092843B (en) General test method for router
CN104168132B (en) Method for diagnosing faults, equipment and system
CN107769979B (en) Method for synchronous configuration between routers
CN103117880A (en) Web technology based network topological generation method
CN108306792B (en) Method, device and system for testing VPN function of equipment and test equipment
Shimonski The Wireshark field guide: analyzing and troubleshooting network traffic

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