CN107733906B - RSSP-II communication method based on UDP communication - Google Patents
RSSP-II communication method based on UDP communication Download PDFInfo
- Publication number
- CN107733906B CN107733906B CN201711001735.6A CN201711001735A CN107733906B CN 107733906 B CN107733906 B CN 107733906B CN 201711001735 A CN201711001735 A CN 201711001735A CN 107733906 B CN107733906 B CN 107733906B
- Authority
- CN
- China
- Prior art keywords
- udp
- state
- state machine
- fin
- connection
- 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
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/164—Adaptation or special uses of UDP protocol
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/142—Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/24—Negotiation of communication capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
- H04L69/32—Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
- H04L69/322—Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
Abstract
The invention discloses a UDP communication-based RSSP-II communication method, which belongs to the technical field of communication and comprises the steps of numbering events in the UDP communication process and identifying and simulating the events in the UDP communication process by the numbering; triggering the conversion of the UDP state machine by utilizing the simulated event to obtain the current conversion state of the UDP state machine; the RSSP-II protocol stack acquires the conversion state of the UDP state machine by calling a corresponding interface function provided by the network adaptation layer and manages the UDP state machine. In the invention, the RSSP-II protocol stack regards UDP as equivalent connection with TCP, so that the RSSP-II protocol is suitable for equipment adopting a TCP mode for communication and equipment adopting a UDP mode for communication, and the universality of the RSSP-II protocol is greatly improved.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a UDP communication-based RSSP-II communication method.
Background
The RSSP-II safety communication protocol is a protocol used for communication between railway signal devices, and the safety integrity level of the RSSP-II safety communication protocol can reach SIL 4. At present, the existing RSSP-II protocol is based on TCP communication, but some railway signal devices adopt UDP mode for communication, and the RSSP-II protocol based on TCP mode can not be applied to the devices.
Disclosure of Invention
The invention aims to provide a UDP communication-based RSSP-II communication method to improve the universality of the RSSP-II protocol.
In order to realize the purpose, the invention adopts the technical scheme that: a method for RSSP-II communication based on UDP communication is provided, which comprises the following steps:
numbering events in the UDP communication process, and identifying and simulating the events in the UDP communication process through the numbering;
triggering the conversion of the UDP state machine by utilizing the simulated event to obtain the current conversion state of the UDP state machine;
the RSSP-II protocol stack acquires the conversion state of the UDP state machine by calling a corresponding interface function provided by the network adaptation layer and manages the UDP state machine.
Wherein, the conversion state of the UDP state machine comprises: disconnection, waiting for connection establishment, connection established and sending a FIN message.
Wherein, simulating events in the UDP communication process comprises: initiating connection, successfully establishing connection, disconnecting connection, receiving data, receiving FIN message, receiving FIN-ACK message and overtime sending FIN message.
The triggering, by using the simulated event, the conversion of the UDP state machine to obtain the current conversion state of the UDP state machine specifically includes:
when the analog event in the UDP communication process is identified as connection initiation, triggering the conversion state of the UDP state machine to be converted from a disconnection state to a connection waiting state;
when the simulation event in the UDP communication process is identified as successful connection establishment, triggering the conversion state of the UDP state machine to be converted from the connection waiting establishment state to the connection established state;
when the analog event is disconnected in the UDP communication process, triggering the conversion state of the UDP state machine to be converted from the connection established state into the state of sending the FIN message;
when the simulation event is recognized to be the time-out of receiving a FIN message, receiving a FIN-ACK message or sending a FIN message in the UDP communication process, triggering the conversion state of a UDP state machine to be converted from the state of sending the FIN message into the state of disconnection;
and when the simulated event is disconnected in the UDP communication process, triggering the state of the UDP state machine to be converted from the state of waiting for connection establishment into the state of disconnection.
Compared with the prior art, the invention has the following technical effects: the invention realizes the purpose of managing the UDP connection state by simulating the event in the UDP communication process and triggering the state conversion of the UDP state conversion machine through the event. Compared with the traditional RSSP-II protocol based on TCP, the RSSP-II protocol stack of the invention regards UDP as the connection equivalent to TCP, so that the RSSP-II protocol is suitable for both the equipment adopting TCP communication and the equipment adopting UDP communication, and the universality of the RSSP-II protocol is greatly improved.
Drawings
The following detailed description of embodiments of the invention refers to the accompanying drawings in which:
FIG. 1 is a flow chart of a method for UDP communication-based RSSP-II communication in the present invention;
fig. 2 is a schematic diagram of state transition of the UDP state machine in the present invention.
Detailed Description
To further illustrate the features of the present invention, refer to the following detailed description of the invention and the accompanying drawings. The drawings are for reference and illustration purposes only and are not intended to limit the scope of the present disclosure.
As shown in fig. 1, the present embodiment discloses a RSSP-II communication method based on UDP communication, which includes the following steps:
s1, numbering events in the UDP communication process, and identifying and simulating the events in the UDP communication process through the numbering;
s2, triggering the conversion of the UDP state machine by using the simulated event to obtain the current conversion state of the UDP state machine;
and S3, the RSSP-II protocol stack acquires the conversion state of the UDP state machine by calling a corresponding interface function provided by the network adaptation layer, and manages the UDP state machine.
It should be noted that the network adaptation layer function in this embodiment is used to return the state of the UDP to the RSSP-II protocol stack.
Further, the transition state of the UDP state machine includes: disconnection, waiting for connection establishment, connection established and sending a FIN message.
Further, the simulating events in the UDP communication process includes: initiating connection, successfully establishing connection, disconnecting connection, receiving data, receiving FIN message, receiving FIN-ACK message and overtime sending FIN message.
Specifically, in practical applications, since the UDP communication method does not actually establish a connection, in the present embodiment, by numbering each analog event, in the process of state management, when an event number is identified, the corresponding state transition of the UDP may be triggered.
It should be noted that initiating the connection time refers to: the RSSP-II protocol stack calls a network adaptation layer function and wants the other side to send data for applying for establishing connection.
The connection establishment success event refers to: and calling an interface function provided by the RSSP-II protocol stack to inform the protocol stack that the connection is established.
The disconnection event refers to: defining a message named FIN, and sending the FIN message to inform the other side of disconnection when the disconnection is needed. The FIN message is used for sending the FIN message to the opposite side to inform the opposite side of disconnection when one of the two communication sides needs to be disconnected.
The received data event refers to: the received data is reported to the RSSP-II protocol stack.
The receipt of the FIN message event refers to: and receiving the FIN message of the other party, and setting the connection state of the local party to be disconnected. Meanwhile, a message named FIN-ACK is defined, and a FIN-ACK message is replied to the opposite side.
The reception of the FIN-ACK message event means: the present connected state is set to disconnected.
Sending the FIN message timeout event means: after the FIN message is sent, the FIN-ACK message is not received in the specified time.
It should be noted that, each time UDP data is transmitted, the transmission time is recorded and the data is stored in the buffer. And the protocol stack checks whether data are transmitted within a specified time, and if no data are transmitted within overtime, the data are taken out from the buffer and retransmitted.
It should be noted that, in this embodiment, a counter is set, the counter starts timing after the FIN packet is sent, and stops timing when the FIN-ACK packet is received. If the counter is checked to exceed the specified time, the FIN-ACK message is not received in the specified time.
Further, as shown in fig. 2, step S2 specifically includes:
when the analog event in the UDP communication process is identified as connection initiation, triggering the conversion state of the UDP state machine to be converted from a disconnection state to a connection waiting state;
when the simulation event in the UDP communication process is identified as successful connection establishment, triggering the conversion state of the UDP state machine to be converted from the connection waiting establishment state to the connection established state;
when the analog event is disconnected in the UDP communication process, triggering the conversion state of the UDP state machine to be converted from the connection established state into the state of sending the FIN message;
when the simulation event is recognized to be the time-out of receiving a FIN message, receiving a FIN-ACK message or sending a FIN message in the UDP communication process, triggering the conversion state of a UDP state machine to be converted from the state of sending the FIN message into the state of disconnection;
and when the simulated event is disconnected in the UDP communication process, triggering the state of the UDP state machine to be converted from the state of waiting for connection establishment into the state of disconnection.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (2)
1. A method for RSSP-II communication based on UDP communication, which is characterized in that the method comprises the following steps:
numbering events in the UDP communication process, and identifying and simulating the events in the UDP communication process through the numbering;
triggering the conversion of the UDP state machine by utilizing the simulated event to obtain the current conversion state of the UDP state machine;
the RSSP-II protocol stack acquires the conversion state of the UDP state machine by calling a corresponding interface function provided by the network adaptation layer and manages the UDP state machine;
the triggering of the conversion of the UDP state machine by using the simulated event to obtain the current conversion state of the UDP state machine specifically includes:
when the analog event in the UDP communication process is identified as connection initiation, triggering the conversion state of the UDP state machine to be converted from a disconnection state to a connection waiting state;
when the simulation event in the UDP communication process is identified as successful connection establishment, triggering the conversion state of the UDP state machine to be converted from the connection waiting establishment state to the connection established state;
when the analog event is disconnected in the UDP communication process, triggering the conversion state of the UDP state machine to be converted from the connection established state into the state of sending the FIN message;
when the simulation event is recognized to be the time-out of receiving a FIN message, receiving a FIN-ACK message or sending a FIN message in the UDP communication process, triggering the conversion state of a UDP state machine to be converted from the state of sending the FIN message into the state of disconnection;
when the simulated event is disconnected in the UDP communication process, triggering the state of a UDP state machine to be converted from a waiting connection establishment state to a connection disconnection state;
when UDP data is sent each time, recording sending time and storing the data in a buffer area, checking whether data are sent within specified time by an RSSP-II protocol stack, if no data are sent within the specified time after time out, taking out the data from the buffer area and sending the data again, starting timing by a counter after a FIN message is sent, stopping timing when a FIN-ACK message is received, and if the counter is checked to exceed the specified time, indicating that the FIN-ACK message is not received within the specified time;
wherein the event in the simulated UDP communication process comprises: initiating connection, successfully establishing connection, disconnecting connection, receiving data, receiving FIN message, receiving FIN-ACK message and overtime sending FIN message.
2. The RSSP-II communication method based on UDP communication according to claim 1, wherein the transition state of the UDP state machine comprises: disconnection, waiting for connection establishment, connection established and sending a FIN message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711001735.6A CN107733906B (en) | 2017-10-24 | 2017-10-24 | RSSP-II communication method based on UDP communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711001735.6A CN107733906B (en) | 2017-10-24 | 2017-10-24 | RSSP-II communication method based on UDP communication |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107733906A CN107733906A (en) | 2018-02-23 |
CN107733906B true CN107733906B (en) | 2020-04-17 |
Family
ID=61213381
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711001735.6A Active CN107733906B (en) | 2017-10-24 | 2017-10-24 | RSSP-II communication method based on UDP communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107733906B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026510A (en) * | 2007-01-31 | 2007-08-29 | 华为技术有限公司 | Network flow abnormal detecting method and system |
CN102217258A (en) * | 2011-04-12 | 2011-10-12 | 华为技术有限公司 | Detection processing method, data transmitter, data receiver and communication system |
CN104580212A (en) * | 2015-01-08 | 2015-04-29 | 华侨大学 | Application layer protocol for achieving monitoring function on basis of UDP transmission |
CN105045603A (en) * | 2015-08-24 | 2015-11-11 | 北京金山安全软件有限公司 | Method and device for constructing finite-state machine model framework and electronic device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101048865B1 (en) * | 2009-03-16 | 2011-07-13 | 주식회사 팬택 | Transmission layer control device for improving transmission layer performance and packet transmission method that can guarantee transmission speed and reliability at the same time |
-
2017
- 2017-10-24 CN CN201711001735.6A patent/CN107733906B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026510A (en) * | 2007-01-31 | 2007-08-29 | 华为技术有限公司 | Network flow abnormal detecting method and system |
CN102217258A (en) * | 2011-04-12 | 2011-10-12 | 华为技术有限公司 | Detection processing method, data transmitter, data receiver and communication system |
CN104580212A (en) * | 2015-01-08 | 2015-04-29 | 华侨大学 | Application layer protocol for achieving monitoring function on basis of UDP transmission |
CN105045603A (en) * | 2015-08-24 | 2015-11-11 | 北京金山安全软件有限公司 | Method and device for constructing finite-state machine model framework and electronic device |
Non-Patent Citations (2)
Title |
---|
CBTC 中安全通信协议的设计与仿真研究;杨明等;《计算机工程》;20121030;第38卷(第19期);第241-246页 * |
CBTC数据通信系统性能分析模型及应用研究;张岩等;《铁道学报》;20110531;第33卷(第5期);第60-65页 * |
Also Published As
Publication number | Publication date |
---|---|
CN107733906A (en) | 2018-02-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105491084B (en) | Car networking system and its control method based on OTA agreement | |
EP2590348B1 (en) | Method and apparatus for transmitting and receiving media streams | |
JP2015511409A5 (en) | ||
JP2011518487A5 (en) | ||
CN102932364B (en) | A kind of register method, Apparatus and system | |
CN102801508A (en) | Control method for processing network packet loss | |
CN107567107A (en) | A kind of method and device for transmitting data | |
CN103973414B (en) | A kind of data transmission method and device | |
CN105790903A (en) | Terminal and terminal call soft handover method | |
CN102984493A (en) | Method, device and communication device for video data transmission | |
CN107733906B (en) | RSSP-II communication method based on UDP communication | |
CN110417604A (en) | A kind of monitoring device alarm method, monitoring device and server | |
CN104885523B (en) | Fault handling method, packet data network, mobile management entity and network system | |
CN104427551A (en) | A business message transmitting method and apparatus | |
CN102014520A (en) | Method for ensuring RRC (Radio Resource Control) signaling time sequence at UE (User Equipment) side | |
CN101001213B (en) | Short message transmission system and method | |
CN101548514B (en) | Method for exchanging messages in a mobile radio network | |
CN106900017B (en) | Data back transmission method and device | |
CN103957079A (en) | Negotiation method and equipment in HDLC network | |
CN108174458B (en) | Method and device for wireless connection between mobile terminal and wearable device, mobile terminal and wearable device | |
CN103179087A (en) | Asynchronous Socket data transmission method and system from application layer to transmission control protocol (TCP) layer | |
CN101009690A (en) | A method and device for the state confirmation of the physical terminal | |
CN111464514A (en) | TCP hot backup method and system | |
CN101931620A (en) | Service implementation method and system and service capability server | |
CN101257438B (en) | Method for keeping consistence of channel occlusion state among nodes |
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 |