Secretarial knowledge > Graduation design

CNAPS-based serial number management method


Abstract: China's National Modern Payments Clearing System (CNAPS) is a central bank payment system under construction by the People's Bank of China with the support of the World Bank. The main function of the system is to finalize the liquidation of commercial banks. The article analyzes some imperfections in the current CNAPS system reliability, reverberation time, etc., and introduces the method to improve system reliability and shorten the system reverberation time, namely serial number management. Keywords: CNAPS SB branch system fund clearing stream number interface commercial bank between the collection and payment of funds, must be through the government-authorized central bank for fund clearing, in order to play the central bank's macro-control function, thereby stabilizing currency, stability market. The CNAPS system is composed of central banks at all levels. Therefore, the SB branch system must communicate with the CNAPS system to complete the final liquidation of funds through the CNAPS system. The reliable and effective operation of the CNAPS system will be related to the effective, timely and reliable transfer of funds from enterprises and individuals. It is essential to maintain and improve the banking system and improve the financial market. The transfer of data in the CNAPS system is full duplex. On the one hand, CNAPS transmits information or files to the SB; on the other hand, the SB also transmits information or files to the CNAPS. The following is an analysis of the situation when CNAPS transmits information or files to the SB. The situation when the SB transmits information or files to CNAPS is similar. 1 Some imperfections of the current CNAPS system Currently, there are the following shortcomings in the path that CNAPS transmits information or files to the SB: the receiving end cannot obtain independent information or files; the file request reverberation time is too long; the transport layer can provide Limited reliability. 1) Cannot get independent information and files Two applications exchange byte streams of 8-bit bytes over TCP connections. TCP does not insert a record identifier in a byte stream. We call this a byte stream service. If one application first transmits 10 bytes, then transmits 20 bytes, and then transmits 50 bytes, the other party connected will not know how many bytes each time the sender sends. The receiver can receive the 80 bytes in 4 times, receiving 20 bytes each time. One end will stream the byte to the TCP connection, and the same byte stream will appear on the other end of the TCP connection. TCP does not interpret the contents of the byte stream. The interpretation of the byte stream is explained by the applied layer on both sides of the TCP connection. When CNAPS transmits information or files to the SB, the SB obtains only the byte stream without the record identifier, and cannot restore the independent information or file. 2) File request reverberation time is too long In the CNAPS system, SB is the client, CNAPS is running as the server, the client is the application that actively initiates the communication request, and the server is the application that passively waits to receive the communication request. Therefore, on the path that CNAPS transmits information or files to the SB, CNAPS does not actively transmit information or files to the SB. It must first receive the SB request. On the path that CNAPS transmits information or files to the SB, the SB starts a timer at the same time as the CNAPS sends a message or file request, and when the timer expires, the SB considers that the request is lost or damaged and is retransmitted. When the data unit transmitted by CNAPS and SB is a file, since the amount of file data is large, it takes a long delay to transfer from the CNAPS end to the SB end under normal conditions, so the timer should be set to be relatively large. The value of the SB often has to wait a long time to determine whether to resend the request, and the SB's reverberation time is very long. In particular, when there is a small error in the file transmitted by CNAPS, the SB end TCP will check the verification and error and discard the entire file. Then the SB timer expires, the SB resends the request, and CNAPS resends the entire file again. It takes a long time for a request to start to receive a completely correct file. 3) The reliability that the transport layer can provide is limited. The transport layer of the CNAPS system uses the TCP transport control protocol. In theory, the TCP protocol is reliable, but the actual transport service is not without errors, but in an unreliable network. Providing a reliable service on top is exactly what the transport layer has to achieve. The transport layer is the quality of service provided by the enhanced network layer. It must compensate for the difference between the user requirements of the application layer and the services provided by the network layer. The user specifies a desired, acceptable minimum value for various service parameters when establishing a connection. The transport layer checks these parameters based on the type of network service or the services it can obtain to determine whether the required service can be provided. When the transport layer finds that some values ​​of the quality of service parameters are unreachable, the transport layer does not even connect to the destination machine, and directly informs the application layer that the connection request fails. Therefore, the reliability that the transport layer can provide is limited. 2 CNAPS system performance improvement method--The stream number management improved CNAPS system has increased the serial number management communication processing mechanism in the CNAPS transmission information or file path, further enhancing the CNAPS system reliability and shortening the file request/transmission The reverberation time. 1. The receiver information or file cannot be independent and the file request response time is too long. On the path of CNAPS to transmit information or files, the data is transmitted on the CNAPS side. In order to ensure that the SB end receives independent information or files, the communication adopts The SB requests once and the CNAPS is transmitted once. CNAPS assigns a serial number to each message it generates to identify the location of that information in the CNAPS data stream. On the communication, the SB requests a serial number, and the CNAPS transmits the information whose serial number is the corresponding value. This way the individual information can be separated. The process of transmitting the serial number on the information path of the CNAPS to the SB can be divided into three steps: 1) When the system starts, the SB sends an initialization serial number request to the CNAPS after the link is established, and then the CNAPS sends an initial serial number answer to the SB, and the SB is The serial number is initialized to 0. It is not the beginning of the system. If the faulty link is disconnected and established again, the SB will send a confirmation serial number request to CNAPS after the link is established. If CNAPS determines that the SB is running correctly, CNAPS will issue a confirmation serial number to answer. 2) Then the SB starts to continuously transmit information requests to the CNAPS and receives information from the CNAPS until receiving no information transmission message on the CNAPS side. When the SB end receives the CNAPS no message transmission message, the SB will send an information request to the CNAPS again after a period of time. 3) At the end of the day, the SB end will send an end serial number request to CNAPS. When the SB receives the end of the CNAPS serial number answer, the SB disconnects the link. Confirming the serial number request and confirming the serial number answer These two steps are called serial number synchronization. By serial number synchronization, the SB can know where the CNAPS transport data stream has been received. . In the three-step handshake protocol of TCP, since the data transmission is bidirectional, it takes three steps to complete the synchronization between the client and the server. In the CNAPS system, the data on the CNAPS transmission information path is unidirectionally transmitted from the CNAPS to the SB terminal, so the serial number synchronization of the CNAPS and the SB on this path requires only two steps. The following is the processing procedure when CNAPS transmits information path to the SB at the beginning of the system at the beginning of the day, and there are two untransmitted information at the CNAPS end: CNAPS SB Figure 2-1 The ideal situation without error such as message loss, repetition, etc. Figure 2 The value on both sides of the line is the serial number of the CNAPS end and the SB end, and the oblique line indicates the transmission message between SB and CNAPS. The CNAPS end stream number refers to the number of pieces of information that the CNAPS has transmitted and received correctly by the SB. The SB serial number is the number of messages that the SB has correctly received. The CNAPS serial number is updated when CNAPS receives the SB request for the next serial number. At this time, CNAPS knows that the previous serial number has been correctly received by the SB. The update of the SB-end serial number is when the SB correctly receives the information. It is stipulated that the SB must correctly receive a serial number to request the next serial number. The serial number requested in the SB information request message on the diagonal line is the serial number +1 of the SB end, that is, the serial number of the next CNAPS information that the SB wishes to receive. 2) The serial number process on the path where CNAPS transmits the file to the SB is similar to the process of the CNAPS transmitting the information path to the SB. The file generated by CNAPS is divided into several blocks, and each block is given a serial number to mark the position of the file block in the CNAPS data stream. On the communication, the SB requests a serial number, and the CNAPS transmits the archive block whose serial number is the corresponding value. When an error occurs during the file transfer, the SB can find it in time, and only needs the CNAPS to retransmit a file block without retransmission of the entire file. Since the data volume of the file partition is not large and the SB can handle the error in time, the response time of the SB correctly receiving the entire file is greatly shortened compared to the reverberation time when the serial number management is not used. When a file is received, the SB requests the next file, so that each file can be opened independently. The serial number processing process is similar to Figure 2-1. Second, the transmission layer can only provide limited reliability. The serial number management uses a mechanism similar to the transport layer TCP protocol, which is equivalent to further enhancing the reliability of the transport layer in the application layer. 1) Time-over-retransmission mechanism In order to solve packet loss in the TCP protocol, a time-out retransmission mechanism is adopted. The client initiates a timer at the same time as the connection request, and the timer will always overflow when the request or reverberation is lost. Once the timer expires, the client initiates a connection request again and restarts the timer. Until the connection is successfully established, or when the number of retransmissions reaches a certain limit, it is considered that the connection cannot be established and abandoned. The serial number management on the CNAPS to the SB to transmit information or file path uses a TCP-like timeout retransmission mechanism, and the SB initiates a timer while issuing a message or file blocking request. When the information or file block returned by CNAPS is damaged due to line noise, the SB side will detect an error and discard them. When the SB timer time arrives and the correct information or file block is not received, the SB will go offline. 2) Sequence Number Mechanism The TCP protocol detects duplicates by assigning a sequence number to each octet in the data stream and asking the receiver to remember the sequence number of the received octet. In order to avoid the confusion caused by late acknowledgement and duplicate acknowledgement, TCP's "positive acknowledgement with retransmission" protocol carries a sequence number in the acknowledgement so that the receiver can correctly associate the packet with the acknowledgement. The CNAPS numbers the information or archives on the SB transmission information or file path. This number is called the serial number, and each of the data to be transmitted corresponds to a serial number mechanism so that the receiving end can discern whether the received data is duplicated. 4 Conclusion The pivotal position of the CNAPS system in China's financial sector has determined that it must guarantee its reliability in many aspects. Otherwise, a mistake may lead to the loss of funds of tens of billions of yuan. It is necessary to use the serial number management method in the CNAPS system, which can further enhance the system reliability and shorten the reverberation time of the system. [References] [1] Zhou Mingyuan Wang Wenyong, "TCP/IP Network Principles and Technology", Tsinghua University Press, December 1993 [2] People's Bank of China Department of Payment and Technology, "China National Modern Payment System", China Financial Publishing House, August 1995

recommended article

popular articles