CN110166313B - Method for simulating protocol server - Google Patents
Method for simulating protocol server Download PDFInfo
- Publication number
- CN110166313B CN110166313B CN201910218633.2A CN201910218633A CN110166313B CN 110166313 B CN110166313 B CN 110166313B CN 201910218633 A CN201910218633 A CN 201910218633A CN 110166313 B CN110166313 B CN 110166313B
- Authority
- CN
- China
- Prior art keywords
- client
- protocol
- computer
- port
- computer port
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/18—Protocol analysers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention belongs to the technical field of computer networks, and particularly relates to a method for simulating a protocol server, which comprises the steps of inquiring the characteristics of each protocol and associating the protocol with a computer port for receiving a client connection request; monitoring the computer port; judging whether the connection request sent by the client corresponds to the computer port or not; judging whether the packet sending format of the client corresponds to the protocol or not; and the simulation protocol server sends a packet to the client. The system comprises a computer and a simulated package sending terminal; the computer is provided with a computer port for receiving a client connection request; the simulation package sending terminal is installed on the computer and used for sending a package to the client side by the simulation protocol server side. The invention can simulate the protocol server to send packets to the client, and is convenient for the client to identify the protocol corresponding to the computer port.
Description
Technical Field
The invention belongs to the technical field of computer networks, and particularly relates to a method for simulating a protocol server.
Background
There are hundreds of protocols on the internet, each with its own characteristics. Some are that the server sends the data packet first, and some are that the client needs to send a specific data packet, and the server can return. Therefore, in order to know a certain protocol return data packet, we need to simulate a server according to the protocol characteristics to send the packet to a client. However, when the client matches with the server, the client cannot identify which protocol the port of the server is, and therefore a method for simulating the protocol server is needed to help the client identify the protocol of the port of the server.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method for simulating a protocol server, which has the following technical scheme:
a method for emulating a protocol server, comprising:
the method comprises the following steps: inquiring the characteristics of each protocol, including a default port of the protocol, a protocol client-side packet transmission and a protocol server-side packet transmission, and associating the protocol with a computer port for receiving a client-side connection request;
step two: monitoring the computer port;
step three: judging whether the connection request sent by the client corresponds to the computer port or not;
step four: judging whether the packet sending format of the client corresponds to the protocol or not;
step five: if the third step and the fourth step meet the corresponding relation, the simulation protocol server sends a packet to the client;
if the third step does not meet the corresponding relationship, the computer port does not accept the connection request of the client and does not send a packet to the client;
if the third step meets the corresponding relation, the computer port receives the connection request of the client and carries out the fourth step;
if the third step meets the corresponding relation and the fourth step does not meet the corresponding relation, the computer port disconnects the connection request of the client and does not send a packet to the client;
if the third step meets the corresponding relation and the fourth step meets the corresponding relation, performing the fifth step;
in the first step, the protocols are uniquely matched with the computer ports, and each protocol corresponds to a unique computer port;
in the second step, the monitored computer port is used as a protocol server;
in the third step, the client is connected with the computer port through a TCP/IP protocol or a UDP/IP protocol;
in the fourth step, whether the packet format of the client corresponds to the protocol is determined according to the IP address of the client, the IP address of the computer port, the port number of the client and the port number of the computer port;
the method is realized by the following system, comprising the following steps:
a computer and a simulated package sending terminal;
the computer is provided with a computer port for receiving a client connection request;
the simulation package sending terminal is installed on the computer and used for simulating a protocol server to send packages to the client;
the computer port is a plurality of ports, the computer is provided with protocols, and each protocol is uniquely matched with the computer port.
Analysis shows that compared with the prior art, the invention has the advantages and beneficial effects that:
the invention simulates the protocol server to send packets to the client through the programming software on the computer, so that the client can conveniently identify the protocol corresponding to the computer port, and the problem that the client cannot identify the protocol on the computer port is solved.
Drawings
Fig. 1 is a first connection diagram of a system for simulating a protocol server according to the present invention.
Fig. 2 is a second connection diagram of the system of the simulation protocol server according to the present invention.
Fig. 3 is a schematic diagram of an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, the terms "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, which are for convenience of description of the present invention only and do not require that the present invention must be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. The terms "connected" and "connected" used herein should be interpreted broadly, and may include, for example, a fixed connection or a detachable connection; they may be directly connected or indirectly connected through intermediate members, and specific meanings of the above terms will be understood by those skilled in the art as appropriate.
As shown in fig. 1 and fig. 2, the present invention provides a method for simulating a protocol server for solving the problem that a client cannot identify a port protocol of the server, including the following steps:
the method comprises the following steps: the characteristics of each protocol are queried and the protocol is associated with the computer port that received the client connection request.
And inquiring the characteristics of the protocol disclosed on the Internet, wherein the characteristics comprise a default port of the protocol, a protocol client-side packet transmission and a protocol server-side packet transmission. When the protocol is associated with the computer port, the protocol is uniquely matched with the computer port, and each protocol corresponds to a unique computer port.
Step two: and monitoring the computer port.
The invention realizes the monitoring of the computer port, the packet sending of the simulation server side and the communication with the client side by installing the simulation packet sending terminal on the computer, and the simulation packet sending terminal is a program client side manufactured by network programming. The invention takes the monitored computer port as a protocol server, does not limit the computer port, and the computer can be selected from a tablet computer, a notebook computer, a desktop computer and a server, and the port can be a port which is communicated with the outside on the tablet computer, the notebook computer, the desktop computer and the server.
Step three: and judging whether the connection request sent by the client corresponds to the computer port or not.
If the corresponding relation is not satisfied in the step, the computer port does not accept the connection request of the client and does not transmit a packet to the client; if the corresponding relation is satisfied, the computer port receives the connection request of the client, and the step four is carried out.
When the client is connected with the computer port, the invention provides two methods, namely, the client is connected with the computer port through a TCP/IP protocol; the second method is that the client is connected with the computer port through UDP/IP protocol.
Step four: and judging whether the packet sending format of the client corresponds to the protocol.
If the third step meets the corresponding relation and the fourth step does not meet the corresponding relation, the computer port disconnects the connection request of the client and does not send a packet to the client; and if the third step meets the corresponding relation and the fourth step meets the corresponding relation, performing the fifth step.
When judging whether the packet format of the client corresponds to the protocol, the invention judges according to the following four parameters, namely the IP address of the client, the IP address of the computer port, the port number of the client and the port number of the computer port.
Step five: and if the third step and the fourth step meet the corresponding relation, the simulation protocol server sends a packet to the client.
As shown in fig. 1 and fig. 2, the present invention further provides a system for simulating a protocol server by using the above method, which mainly comprises a computer and a simulation packet sending terminal; the computer is provided with a computer port for receiving the client connection request; the simulation package sending terminal is installed on the computer and used for sending a package to the client side by the simulation protocol server side.
By way of further limitation, the computer port of the present invention is multiple, and the computer is installed with protocols, each of which is uniquely matched with the computer port.
Examples
As shown in fig. 1 to fig. 3, taking the beanstalk protocol as an example, step one is performed to query feature information of the beanstalk protocol, and query that the default port of the protocol is 11300, that is, the port that needs to be monitored in the local computer in the following steps. At this time, if the client needs to send a packet, i.e. send a stats \ r \ n data packet, the server will send the service information to the client (the server response packet is shown in fig. 3). If the protocol server is simulated, the second step is performed, that is, the 11300 port (computer port) is monitored, and the third step and the fourth step are performed. And judging and matching the packet sending format of the client through the codes, and if the packet sending format meets the requirement of the protocol data packet, simulating the server and returning the information required by the client to the client. Furthermore, the simulation server program (simulation package sending terminal) mainly matches the package sent by the client and returns service information. And the execution is concurrent, the computer can monitor the ports of a plurality of protocols and simulate the starting of the plurality of protocols on the computer.
It will be appreciated by those skilled in the art that the invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The embodiments disclosed above are therefore to be considered in all respects as illustrative and not restrictive. All changes which come within the scope of or equivalence to the invention are intended to be embraced therein.
Claims (1)
1. A method for emulating a protocol server, comprising:
the method comprises the following steps: inquiring the characteristics of each protocol, including a default port of the protocol, a protocol client-side packet transmission and a protocol server-side packet transmission, and associating the protocol with a computer port for receiving a client-side connection request;
step two: monitoring the computer port;
step three: judging whether the connection request sent by the client corresponds to the computer port or not;
step four: judging whether the packet sending format of the client corresponds to the protocol or not;
step five: if the third step and the fourth step meet the corresponding relation, the simulation protocol server sends a packet to the client;
if the third step does not meet the corresponding relationship, the computer port does not accept the connection request of the client and does not send a packet to the client;
if the third step meets the corresponding relation, the computer port receives the connection request of the client and carries out the fourth step;
if the third step meets the corresponding relation and the fourth step does not meet the corresponding relation, the computer port disconnects the connection request of the client and does not send a packet to the client;
if the third step meets the corresponding relation and the fourth step meets the corresponding relation, performing the fifth step;
in the first step, the protocols are uniquely matched with the computer ports, and each protocol corresponds to a unique computer port;
in the second step, the monitored computer port is used as a protocol server;
in the third step, the client is connected with the computer port through a TCP/IP protocol or a UDP/IP protocol;
in the fourth step, whether the packet format of the client corresponds to the protocol is determined according to the IP address of the client, the IP address of the computer port, the port number of the client and the port number of the computer port;
the method is realized by the following system, comprising the following steps:
a computer and a simulated package sending terminal;
the computer is provided with a computer port for receiving a client connection request;
the simulation package sending terminal is installed on the computer and used for simulating a protocol server to send packages to the client;
the computer port is a plurality of ports, the computer is provided with protocols, and each protocol is uniquely matched with the computer port.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910218633.2A CN110166313B (en) | 2019-03-21 | 2019-03-21 | Method for simulating protocol server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910218633.2A CN110166313B (en) | 2019-03-21 | 2019-03-21 | Method for simulating protocol server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110166313A CN110166313A (en) | 2019-08-23 |
CN110166313B true CN110166313B (en) | 2022-03-18 |
Family
ID=67638459
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910218633.2A Active CN110166313B (en) | 2019-03-21 | 2019-03-21 | Method for simulating protocol server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110166313B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185952A1 (en) * | 2016-04-28 | 2017-11-02 | 广州广电运通金融电子股份有限公司 | Hardware device access management method and system |
CN109005150A (en) * | 2018-06-11 | 2018-12-14 | 烽火通信科技股份有限公司 | Based on ethernet mac address without linking communications method and system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8266677B2 (en) * | 2000-12-20 | 2012-09-11 | Intellisync Corporation | UDP communication with a programmer interface over wireless networks |
CN101287010A (en) * | 2008-06-12 | 2008-10-15 | 华为技术有限公司 | Method and apparatus for identifying and verifying type of message protocol |
CN102510347B (en) * | 2011-12-13 | 2015-11-11 | 曙光信息产业(北京)有限公司 | A kind of system and method to Intelligent Network Element Function detection |
CN103179100B (en) * | 2011-12-26 | 2016-09-07 | 中国移动通信集团广西有限公司 | A kind of method and apparatus preventing domain name system Tunnel Attack |
CN106487879A (en) * | 2016-09-20 | 2017-03-08 | 北京知道未来信息技术有限公司 | A kind of network equipment recognition methodss based on device-fingerprint storehouse and device |
-
2019
- 2019-03-21 CN CN201910218633.2A patent/CN110166313B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185952A1 (en) * | 2016-04-28 | 2017-11-02 | 广州广电运通金融电子股份有限公司 | Hardware device access management method and system |
CN109005150A (en) * | 2018-06-11 | 2018-12-14 | 烽火通信科技股份有限公司 | Based on ethernet mac address without linking communications method and system |
Non-Patent Citations (1)
Title |
---|
基于报文过滤系统的RPC协议研究与应用;石元泉等;《计算机与现代化》;20090315(第03期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110166313A (en) | 2019-08-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7440415B2 (en) | Virtual network addresses | |
CN101425938B (en) | Method and apparatus for network apparatus test | |
CN101848235B (en) | Real-time multimedia data P2P transmission scheme for supporting NAT traversal | |
CN103236960A (en) | Method and system for data interaction between home server and plurality of terminals | |
CN106851513B (en) | Method and system for testing electronic product | |
CN108270882A (en) | The analysis method and device of domain name, storage medium, electronic device | |
CN105794152B (en) | The system and method and device of the interaction based on web are carried out with building automatic | |
CN111796858A (en) | Method, system and related equipment for access detection of application programs in Kubernetes cluster | |
CN106330483B (en) | Information acquisition method, client device and server device | |
US20140156852A1 (en) | Method and system for sharing testing resources through the web | |
CN104301161A (en) | Computing method, computing device and communication system for business quality index | |
CN109474614A (en) | A kind of analytic method and system of multi-protocols | |
US9270550B2 (en) | Session-based traffic analysis system | |
CN110166313B (en) | Method for simulating protocol server | |
CN103080913B (en) | Method for finding communication devices connected to communication network, and management device | |
CN112822208A (en) | Internet of things equipment identification method and system based on block chain | |
CN103997416B (en) | The error correction method and error correction device of mobile terminal Internet access | |
US9400729B2 (en) | System and method for determining topology of monitored entities | |
CN102387516A (en) | PS operation analog system and test method for NodeB test | |
CN104184729A (en) | Message processing method and device | |
CN114172815B (en) | Behavior traffic transmission method, device, computer equipment and computer readable storage medium | |
CN103152195B (en) | Collecting method and device | |
CN108924237A (en) | A kind of information transferring method, server, system and computer storage medium | |
CN112367411A (en) | Intelligent POCT detection equipment and management method thereof | |
CN105323088A (en) | Springboard processing method and springboard processing device |
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 |