Data transmission method, device, medium and product
By implementing an authentication mechanism in a delivery data center, unauthenticated client access is denied and only authenticated clients are allowed to access the server, solving the problem of security risks exposed to the underlying network of the cloud platform and significantly reducing the risk of network attacks.
Patent Information
- Application Number
- CN202210273119.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In a delivery data center, the underlying network of the cloud platform is exposed to users' management and protection, resulting in a sharp increase in the risk of network attacks, including network sniffing, message hijacking, monitoring port scanning and port attacks.
When the client sends a data packet to the destination port of the server for the first time, the server refuses to receive and sends an unreachable message to instruct the client to initiate authentication; after the client responds, the server generates and returns an authentication data packet carrying authentication information, and the server is based on Authentication information determines the client's access rights, and if passed, access will be open.
The ports on the server are effectively hidden, and only certified clients can access them, significantly reducing the security risks of the underlying network in the delivery data center and protecting the cloud platform.
Smart Images

Figure CN114726513B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of communication technology, and in particular to a data transmission method, device, medium and product. Background Art
[0002] In the new delivery data center scenario, the cloud platform service provider will deploy physical servers and other physical networks in the user's computer room, and deploy cloud products on these physical servers. In this way, the cloud platform's underlay network will be exposed outside the service provider's network isolation and security operation and maintenance boundaries, which is highly dependent on the user's management and protection methods. The risk of attacking the cloud platform through the underlying network has increased dramatically. The east-west and north-south communications of the cloud platform are exposed to the underlying network, which can be attacked by network sniffing, message hijacking / tampering, listening port scanning and port attacks. Therefore, how to reduce the security risks of the underlying network exposure in the delivery data center and protect the cloud platform has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present disclosure provide a data transmission method, device, medium and product.
[0004] In a first aspect, a data transmission method is provided in an embodiment of the present disclosure.
[0005] Specifically, the data transmission method includes:
[0006] Send the first data packet to the destination port of the destination server for the first time;
[0007] Receiving a destination unreachable message sent by the destination server, where the destination unreachable message is used to instruct the client to initiate authentication;
[0008] In response to receiving the destination unreachable message, generating and returning an authentication data packet, wherein the authentication data packet carries authentication information;
[0009] The first data packet is resent to the destination port of the destination server.
[0010] In a possible implementation manner, the destination unreachable message carries a random value, and the method further includes:
[0011] Obtaining a shared key of the client;
[0012] Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, wherein the information to be encrypted includes a client identifier or also includes a current timestamp;
[0013] The generating and returning of the authentication data packet comprises:
[0014] Encapsulating the information to be encrypted and the authentication code in a data packet to generate an authentication data packet;
[0015] Send the authentication data packet to the destination server.
[0016] In a possible implementation, in response to receiving the destination unreachable message, generating and returning an authentication data packet includes:
[0017] The transport layer or socket layer of the client responds to the destination unreachable message, generates and returns an authentication data packet, and the socket layer is located between the transport layer and the application layer in the protocol stack.
[0018] In a possible implementation, the method further includes:
[0019] Periodically receive a destination unreachable message sent by the destination server.
[0020] In a possible implementation, the using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain the authentication code includes:
[0021] The random value, the information to be encrypted and the number of authentications are encrypted and calculated using the shared key to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication.
[0022] In a second aspect, a data transmission method is provided in an embodiment of the present disclosure.
[0023] Specifically, the data transmission method includes:
[0024] When receiving a first data packet sent by a client for the first time, discarding the first data packet;
[0025] Returning a destination unreachable message to the client, wherein the destination unreachable message is used to instruct the client to initiate authentication;
[0026] Receiving an authentication data packet sent by the client, wherein the authentication data packet carries authentication information;
[0027] When it is determined based on the authentication information that the client has the authority to access the destination port, allowing the client to access the destination port;
[0028] The first data packet resent by the client is received through the destination port.
[0029] In a possible implementation, the destination unreachable message carries a random value, the authentication information includes information to be encrypted and an authentication code, the information to be encrypted includes a client identifier, or also includes a current timestamp; and determining, based on the authentication information, that the client has permission to access the destination port includes:
[0030] Obtaining a shared key and access rights of the client based on the client identification query, wherein the access rights are used to limit the accessible port of the client on the destination server;
[0031] Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code;
[0032] When the verification code and the authentication code are the same, if the accessible port of the client on the destination server includes the destination port to which the first data packet is to arrive, it is determined that the client has the authority to access the destination port.
[0033] In a possible implementation manner, after enabling access to the destination port for the client, the method further includes:
[0034] Periodically sending a destination unreachable message to the client.
[0035] In a possible implementation manner, the using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code includes:
[0036] The random value, the information to be encrypted and the number of verifications are encrypted and calculated using the shared key to obtain a verification code, wherein the number of verifications includes the number of times the destination server verifies whether the client has the authority to access the destination port.
[0037] In a third aspect, a data transmission method is provided in an embodiment of the present disclosure.
[0038] Specifically, the data transmission method includes:
[0039] The client executes the method described in the first aspect, and the destination server executes the method described in the second aspect.
[0040] In a fourth aspect, a data transmission device is provided in an embodiment of the present disclosure.
[0041] Specifically, the data transmission device includes:
[0042] A first sending module is configured to send a first data packet to a destination port of a destination server for the first time;
[0043] A first receiving module is configured to receive a destination unreachable message sent by the destination server, wherein the destination unreachable message is used to instruct the client to initiate authentication;
[0044] a response module, configured to generate and return an authentication data packet in response to receiving the destination unreachable message, wherein the authentication data packet carries authentication information;
[0045] The second sending module is configured to resend the first data packet to the destination port of the destination server.
[0046] In a possible implementation manner, the destination unreachable message carries a random value, and the device further includes:
[0047] A first acquisition module is configured to acquire a shared key of the client;
[0048] A first calculation module is configured to use the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, wherein the information to be encrypted includes a client identifier or also includes a current timestamp;
[0049] The part of the response module that generates and returns the authentication data packet is configured as follows:
[0050] Encapsulating the information to be encrypted and the authentication code in a data packet to generate an authentication data packet;
[0051] Send the authentication data packet to the destination server.
[0052] In a possible implementation, the part of the response module that generates and returns the authentication data packet in response to receiving the destination unreachable message is configured as follows:
[0053] The transport layer or socket layer of the client responds to the destination unreachable message, generates and returns an authentication data packet, and the socket layer is located between the transport layer and the application layer in the protocol stack.
[0054] In a possible implementation manner, the device further includes:
[0055] The second receiving module is configured to periodically receive a destination unreachable message sent by the destination server.
[0056] In a possible implementation manner, the first calculation module is configured as follows:
[0057] The random value, the information to be encrypted and the number of authentications are encrypted and calculated using the shared key to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication.
[0058] In a fourth aspect, a data transmission device is provided in an embodiment of the present disclosure.
[0059] Specifically, the data transmission device includes:
[0060] A discarding module, configured to discard the first data packet when receiving the first data packet sent by the client for the first time;
[0061] A third sending module is configured to return a destination unreachable message to the client, wherein the destination unreachable message is used to instruct the client to initiate authentication;
[0062] A third receiving module is configured to receive an authentication data packet sent by the client, wherein the authentication data packet carries authentication information;
[0063] an opening module, configured to allow the client to access the destination port when it is determined based on the authentication information that the client has the authority to access the destination port;
[0064] The fourth receiving module is configured to receive the first data packet resent by the client through the destination port.
[0065] In a possible implementation, the destination unreachable message carries a random value, the authentication information includes information to be encrypted and an authentication code, the information to be encrypted includes a client identifier, or also includes a current timestamp; and the part of the open module that determines that the client has permission to access the destination port based on the authentication information is configured as follows:
[0066] Obtaining a shared key and access rights of the client based on the client identification query, wherein the access rights are used to limit the accessible port of the client on the destination server;
[0067] Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code;
[0068] When the verification code and the authentication code are the same, if the accessible port of the client on the destination server includes the destination port to which the first data packet is to arrive, it is determined that the client has the authority to access the destination port.
[0069] In a possible implementation, the device further includes:
[0070] The fourth sending module is configured to periodically send a destination unreachable message to the client.
[0071] In a possible implementation manner, the using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code includes:
[0072] The random value, the information to be encrypted and the number of verifications are encrypted and calculated using the shared key to obtain a verification code, wherein the number of verifications includes the number of times the destination server verifies whether the client has the authority to access the destination port.
[0073] In a sixth aspect, a data transmission device is provided in an embodiment of the present disclosure.
[0074] Specifically, the data transmission device includes:
[0075] A client, configured to execute the method described in the first aspect;
[0076] The destination server is configured to execute the method described in the second aspect.
[0077] In the seventh aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions that support the above-mentioned device to execute the above-mentioned method, and the processor is configured to execute the computer instructions stored in the memory.
[0078] In an eighth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the method steps described in any of the above aspects.
[0079] In a ninth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program / instructions, wherein the computer program / instructions, when executed by a processor, implement the method steps described in any of the above aspects.
[0080] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0081] The above technical solution can be that when the client sends the first data packet to the destination port of the server for the first time, the server refuses to receive it and sends a destination unreachable message to the client, instructing the client to initiate authentication; the client generates and returns an authentication data packet carrying authentication information in response to receiving the destination unreachable message, and the server determines based on the authentication information that the client has the authority to access the destination port, and then opens access to the destination port for the client. At this time, the client can legally access the destination port of the server, and the client can resend the first data packet to the destination port of the server for access. In this way, by setting the server to completely refuse to receive access from unauthenticated clients, the server's port is hidden, and the server's port can only be accessed after passing the authentication, thereby reducing the security risk of the underlying network exposure in the delivery-based data center and protecting the cloud platform.
[0082] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Other features, purposes and advantages of the embodiments of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:
[0084] Figure 1 A structural block diagram of a cloud platform according to an embodiment of the present disclosure is shown.
[0085] Figure 2 A flow chart of a data transmission method applied to a client according to an embodiment of the present disclosure is shown.
[0086] Figure 3 A flow chart of a data transmission method applied to a destination server according to an embodiment of the present disclosure is shown.
[0087] Figure 4 An overall flow chart of a data transmission method according to an embodiment of the present disclosure is shown.
[0088] Figure 5 A structural block diagram of a data transmission device applied to a client according to an embodiment of the present disclosure is shown.
[0089] Figure 6 A structural block diagram of a data transmission device applied to a destination server according to an embodiment of the present disclosure is shown.
[0090] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0091] Figure 8 It is a structural diagram of a computer system suitable for implementing the method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0092] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0093] In the embodiments of the present disclosure, it should be understood that terms such as "including" or "having" are intended to indicate the existence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in this specification, and are not intended to exclude the possibility of one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof existing or being added.
[0094] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0095] In the present disclosure, the acquisition of user information or user data is an operation authorized and confirmed by the user, or actively selected by the user.
[0096] As mentioned above, in the new delivery-oriented data center scenario, the cloud platform service provider will deploy physical servers and other physical networks in the user's computer room, and deploy cloud products on these physical servers. In this way, the cloud platform's underlay network will be exposed outside the service provider's network isolation and security operation and maintenance boundaries, which is highly dependent on the user's management and protection methods. The risk of attacking the cloud platform through the underlying network has increased dramatically. The east-west and north-south communications of the cloud platform are exposed to the underlying network, which can be attacked by network sniffing, message hijacking / tampering, listening port scanning and port attacks. Therefore, how to reduce the security risks of the underlying network exposure in the delivery-oriented data center and protect the cloud platform has become a technical problem that needs to be solved urgently.
[0097] Figure 1 A structural block diagram of a cloud platform according to an embodiment of the present disclosure is shown.
[0098] like Figure 1 As shown in the figure, the service provider side provides various cloud products for the enterprises on the enterprise user side. These cloud products will be deployed on the user-side servers on the enterprise user side. The east-west traffic of the underlying network is completed in the local switching network on the enterprise user side. The northbound traffic of the underlying network requires the service provider side to open the southbound port of the service provider side server for the enterprise user side. The southbound traffic of the underlying network requires the enterprise user side to open the northbound port of the user-side server for the service provider side. The service provider side will configure network isolation and security operation and maintenance to protect the network on the service provider side, while the network on the enterprise user side is highly dependent on the user's management and protection measures. In the process of port access from one server to another, since both the east-west and southbound ports are exposed to the enterprise user side, network attacks such as network sniffing, message hijacking / tampering, listening port scanning and port attacks can be implemented, which sharply increases the risk of attacking the cloud platform through the underlying network.
[0099] In view of the above problems, the present disclosure proposes a data transmission method, when the client sends the first data packet to the destination port of the server for the first time, the server refuses to receive and sends a destination unreachable message to the client, instructing the client to initiate authentication; the client generates and returns an authentication data packet carrying authentication information in response to receiving the destination unreachable message, and the server determines based on the authentication information that the client has the authority to access the destination port, and then opens the access of the destination port to the client. At this time, the client can legally access the destination port of the server, and the client can resend the first data packet to the destination port of the server for access. In this way, by setting the server to completely refuse to receive access from unauthenticated clients, the server's port is hidden, and the server's port can only be accessed after passing the authentication, thereby reducing the security risk of the underlying network exposure in the delivery-type data center and protecting the cloud platform.
[0100] Figure 2 A flow chart of a data transmission method applied to a client according to an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the data transmission method includes the following steps S201-S204:
[0101] In step S201, a first data packet is sent to a destination port of a destination server for the first time;
[0102] In step S202, a destination unreachable message sent by the destination server is received, where the destination unreachable message is used to instruct the client to initiate authentication;
[0103] In step S203, in response to receiving the destination unreachable message, an authentication data packet is generated and returned, wherein the authentication data packet carries authentication information;
[0104] In step S204, the first data packet is resent to the destination port of the destination server.
[0105] In one embodiment of the present disclosure, the data transmission method can be applied to data transmission in an underlying network in a delivery-type data center. Figure 1As shown, it includes the access between the east-west ports between the user-side servers on the enterprise user side, and the access of the user-side servers on the enterprise user side to the southbound ports of the service provider side servers. Each server in the network is installed with multiple applications, and different applications can provide different services. In this embodiment, the application in the source server that initiates the access is called the client, which can also be called the IH (Initiating Host) process, and the application of the destination server that receives the access is called the server, which can also be called the AH (Accepting Host) process. Each client that initiates the access has its own IHIP and IHport (IH port), that is, the source IP and source port, and the server that receives the access also has its own AHIP and AHport, that is, the destination IP and destination port. The data packet sent by the client to the server carries the source IP, source port, destination IP, and destination port to indicate the source and destination of the data packet.
[0106] In one embodiment of the present disclosure, when the client wants to initiate access to the server, it will send the first data packet to the destination port of the destination server where the server is located (i.e., the port corresponding to the server), and the first data packet at this time is sent for the first time. When the client passes through each protocol layer in the process of sending data, it must attach the protocol header and protocol tail of the corresponding layer, that is, it must perform protocol encapsulation on the data to identify the communication protocol used by the corresponding layer. In TCP / IP, there are two main transport layer protocols, namely TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), so the first data packet sent by the client can be a TCP packet or a UDP packet. For example, if the data transmission protocol between the client and the server is the TCP protocol, the client needs to first perform a three-way handshake with the server to establish a connection. At this time, the first data packet sent by the client is the TCP SYN (Synchronize Sequence Numbers) packet. The transport layer of the client protocol stack will construct a TCP SYN packet and send it to the lower protocol stack for data transmission. If the data transmission protocol between the client and the server is the UDP protocol, the transport layer of the client protocol stack will directly encapsulate the UDP data packet and send it to the lower protocol stack for data transmission.
[0107] In one embodiment of the present disclosure, each server in the underlying network is configured with a firewall, such as an SDP (Software Defined Perimeter) firewall. The client's access to each server on the server must pass through the firewall. The firewall has a deny all policy, that is, it denies access to all unverified clients. Therefore, each port of the server is invisible to the network. Therefore, when the destination server receives the first data packet sent by the client for the first time, it will directly discard the first data packet and send a destination unreachable message to the client, instructing the client to initiate authentication. For example, the destination unreachable message can be an ICMP (Internet Control Message Protocol) message, and the ICMP message carries an identifier, which is an identifier indicating that the client initiated authentication.
[0108] In one embodiment of the present disclosure, after receiving the destination unreachable message, the client will immediately construct an authentication data packet and send the authentication data packet to the destination server for authentication. The authentication data packet carries authentication information. After receiving the authentication data packet, the destination server will determine whether the client has the authority to access its destination port based on the authentication information. If it is determined that the client has the authority to access its destination port, it means that the client is a legitimate visitor to the destination port. At this time, the destination server will authorize the client's IHIP and IHport to access the server's AHIP and AHport. The IHIP refers to the IP of the destination server where the client is located, and the IHport refers to the port corresponding to the client on the destination server. The AHIP refers to the IP of the destination server where the server is located, and the AHport refers to the destination port corresponding to the server on the destination server. In this way, the destination server opens access to the destination port for the client, and the client can send a data packet to the destination port. The data packet sent by the client carries the IHIP and IHport of the client and the AHIP and AHport of the server to be accessed. After the destination server receives the data packet, since it has authorized the IHIP and IHport of the client to access the AHIP and AHport of the server, the firewall of the destination server will allow the data packet carrying the source IP and source port of the client's IHIP and IHport and the destination IP and destination port of the server's AHIP and AHport to pass. The AHport of the server, that is, the destination port, can receive the data packet, so that the server can provide corresponding services to the client.
[0109] In one embodiment of the present disclosure, after the client sends an authentication data packet to the destination server, the client will directly start the retransmission mechanism and resend the first data packet to the destination port of the destination server. If the destination server determines that the client has the authority to access its destination port based on the authentication information, the destination server can receive the first data packet through the destination port. Of course, if the destination server determines that the client does not have the authority to access its destination port based on the authentication information, the destination server will discard the first data packet.
[0110] This implementation method sets the server to refuse access from all unauthenticated clients, hides the server's ports, and allows authorized ports to be accessed only after authentication, thereby reducing the security risk of the underlying network exposure in the delivery data center and protecting the cloud platform. In addition, the authorization granularity for access rights to each port is at the client level, and the policy control granularity is refined to the client, i.e., the IH process. After an illegal application client invades the destination server, it cannot access the service of the destination port of the destination server without authorization. It also provides authentication capabilities for the firewall of each server, rather than setting up an independent authentication server for authentication, thus avoiding single point failures.
[0111] In a possible implementation, in the above data transmission method, the destination unreachable message carries a random value, and the method further includes:
[0112] Obtaining a shared key of the client;
[0113] Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, wherein the information to be encrypted includes a client identifier or also includes a current timestamp;
[0114] The generating and returning of the authentication data packet comprises:
[0115] Encapsulating the information to be encrypted and the authentication code in a data packet to generate an authentication data packet;
[0116] Send the authentication data packet to the destination server.
[0117] In this implementation manner, for example, the destination unreachable message may be an ICMP destination unreachable message, and the message format of the ICMP destination unreachable message may be as shown in the following Table 1:
[0118]
[0119] Table 1
[0120] As shown in Table 1, the type field in the message of the ICMP destination unreachable message has 8 bits, which are used to identify the type of this message as an ICMP error report message, and the code field has 8 bits, which are used to identify the type of the error report message. In this embodiment, the type of the error report message is destination unreachable, which can be identified by a predetermined code field. The checksum field has 16 bits, which is the checksum of the entire ICMP data packet including the data part. The ICMP error report message complies with the RFC (Request For Comments) 792 protocol. In the prior art, if the ICMP error report message is of the destination unreachable type, the data part is unused. The ICMP destination unreachable message provided in this embodiment is different from the existing destination unreachable message, and an identifier needs to be filled in the data part to indicate that the ICMP destination unreachable message instructs the client to initiate authentication.
[0121] In this implementation, the destination unreachable message carries a random value, which is a Nonce (Numberonce) value. In cryptography, Nonce is an arbitrary or non-repeated random value that is used only once. The random value is used for subsequent authentication. For example, the random value can be filled in the corresponding field of the data part of the ICMP unreachable message.
[0122] In this embodiment, after receiving the destination unreachable message, the client can take out the random value from the destination unreachable message, and then start to build an authentication data packet, which can be a SPA (Single Packet Authorization) packet, and the authentication data packet includes information to be encrypted and an authentication code, and the information to be encrypted can include a client identifier (Client ID), or can also include a current timestamp. The Client ID is an identity identifier assigned to the client, which can index the shared key and port access rights of the client, that is, the destination port that the client is authorized to access. The shared key of the client is known to both the client and the server of the destination port that it can access. The authentication code is calculated by encrypting the random value and the information to be encrypted using the shared key of the client. For example, the authentication code can be an HMAC (Hash-based Message Authentication Code), which is used for identity authentication, message integrity protection, and message replay attack prevention.
[0123] In this implementation, the client needs to encapsulate the information to be encrypted and the authentication code in a data packet, construct an authentication data packet, and then send the authentication data packet to the destination server. When the firewall of the destination server receives the authentication data packet, it can obtain the information to be encrypted and the authentication code in the data packet. The destination server can query the shared key and access rights of the client based on the ClientID in the information to be encrypted, and use the shared key to encrypt and calculate the random value (sent by the destination server to the client, so the destination server knows the random value) and the information to be encrypted to obtain the verification code. If the verification code and the authentication code are the same, it indicates that the client is a legitimate client. At this time, the destination server will query the access rights of the client to determine whether the client has the authority to access the destination port. If the client has the authority to access the destination port, the destination server will open the destination port for the client, that is, allow the IHIP and IHport of the client to access the AHIP and AHport (i.e., the destination port) of the server. If the client does not have the authority to access the destination port, the destination server will not open the destination port for the client and refuse to receive the data packet sent by the client to the destination port. If the verification code is different from the authentication code, it indicates that the client is not a legitimate client. At this time, the destination server will continue to reject data packets sent by the client.
[0124] In a possible implementation, step S103 in the above data transmission method may include the following steps:
[0125] The transport layer or socket layer of the client responds to the destination unreachable message, generates and returns an authentication data packet, and the socket layer is located between the transport layer and the application layer in the client protocol stack.
[0126] In this implementation, in order to achieve transparency of the authentication process to the client, this implementation needs to modify the transport layer, or add a socket layer between the transport layer and the application layer to process the destination unreachable message and construct the authentication data packet.
[0127] In the prior art, when the client's protocol stack receives a destination unreachable message, it will process it level by level and finally feed it back to the application layer for processing. This will be opaque to the application and require the client to explicitly send an authentication data packet and then resend the first data packet. In order to achieve transparency to the client, the present implementation method, when the client's protocol stack receives a destination unreachable message, it will process it level by level. When it reaches the transport layer or socket layer, the transport layer or socket layer can directly respond to the destination unreachable message and generate and return an authentication data packet.
[0128] In a possible implementation manner, the above data transmission method may further include the following steps:
[0129] Periodically receive a destination unreachable message sent by the destination server.
[0130] In this implementation, when the client passes the authentication, the destination server will authorize the client's IHIP, IHport to access the server's AHIP, AHport. At this time, if the attacker blocks the legitimate client's data packet and pretends to be the client's IHIP, IHport, the attacker can access the server's AHIP, AHport. In order to avoid man-in-the-middle attacks, a continuous authentication mechanism is introduced. The firewall in the destination server will periodically send a destination unreachable message and require the client that sent the data packet to continue to authenticate. If the other party does not respond or the returned authentication data packet is wrong, the connection will be terminated and the client's data packet will be refused.
[0131] In this embodiment, if there is no attack, the client will periodically receive the destination unreachable message sent by the destination server, and in response to receiving the destination unreachable message, generate and return an authentication data packet, wherein the authentication data packet carries authentication information; after the firewall in the destination server passes the authentication, it will maintain the connection with the client and continue to open the destination port of the server for the client.
[0132] In a possible implementation manner, the part of the data transmission method using the shared key to encrypt and calculate the random value and the information to be encrypted to obtain the authentication code may also include the following steps:
[0133] The random value, the information to be encrypted and the number of authentications are encrypted and calculated using the shared key to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed to initiate authentication when accessing the port of the destination server.
[0134] In this embodiment, when the destination server periodically sends a destination unreachable message, in order to make the authentication safer and more accurate, the shared key can be used to encrypt and calculate the random value, the information to be encrypted, and the number of authentications to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication. In this way, when the destination server receives the authentication data packet, it can use the found shared key to encrypt and calculate the random value (known), the number of verifications (i.e., the number of times the destination server verifies whether the client has the authority to access the destination port, which the destination server can record) and the information to be encrypted to obtain a verification code. If the number of verifications is the same as the number of authentications, the calculated verification code is the same as the authentication code, indicating that the client is a legitimate client.
[0135] Figure 3A flow chart of a data transmission method applied to a destination server according to an embodiment of the present disclosure is shown as follows: Figure 3 As shown, the data transmission method includes the following steps S301-S305:
[0136] In step S301, when a first data packet sent by a client for the first time is received, the first data packet is discarded;
[0137] In step S302, a destination unreachable message is returned to the client, where the destination unreachable message is used to instruct the client to initiate authentication;
[0138] In step S303, receiving an authentication data packet sent by the client, wherein the authentication data packet carries authentication information;
[0139] In step S304, when it is determined based on the authentication information that the client has the authority to access the destination port, the client is allowed to access the destination port;
[0140] In step S305, the first data packet resent by the client is received through the destination port.
[0141] In one embodiment of the present disclosure, when the client wants to initiate access to the server, it will send the first data packet to the destination port of the destination server where the server is located (i.e., the port corresponding to the server), and the first data packet at this time is sent for the first time. Each server in the underlying network is configured with a firewall, such as an SDP (Software Defined Perimeter) firewall, which has a deny all policy, that is, it denies access to all unverified clients, so the ports of the server are invisible to the network. Therefore, when the destination server receives the first data packet sent by the client for the first time, it will directly discard the first data packet and send a destination unreachable message to the client, instructing the client to initiate authentication. For example, the destination unreachable message can be an ICMP (Internet Control Message Protocol) message, and the ICMP message carries an identifier, which is an identifier indicating that the client initiates authentication.
[0142] In one embodiment of the present disclosure, after receiving the destination unreachable message, the client will immediately construct an authentication data packet and send the authentication data packet to the destination server for authentication. The authentication data packet carries authentication information. After receiving the authentication data packet, the destination server will determine whether the client has the authority to access its destination port based on the authentication information. If it is determined that the client has the authority to access its destination port, it means that the client is a legitimate visitor to the destination port. At this time, the destination server will authorize the client's IHIP and IHport to access the server's AHIP and AHport. The IHIP refers to the IP of the destination server where the client is located, and the IHport refers to the port corresponding to the client on the destination server. The AHIP refers to the IP of the destination server where the server is located, and the AHport refers to the destination port corresponding to the server on the destination server. In this way, the destination server opens access to the destination port for the client, and the client can send a data packet to the destination port. The data packet sent by the client carries the IHIP and IHport of the client and the AHIP and AHport of the server to be accessed. After the destination server receives the data packet, since it has authorized the IHIP and IHport of the client to access the AHIP and AHport of the server, the firewall of the destination server will allow the data packet carrying the source IP and source port of the client's IHIP and IHport and the destination IP and destination port of the server's AHIP and AHport to pass. The AHport of the server, that is, the destination port, can receive the data packet, so that the server can provide corresponding services to the client.
[0143] In one embodiment of the present disclosure, after the client sends an authentication data packet to the destination server, the client will directly start the retransmission mechanism and resend the first data packet to the destination port of the destination server. If the destination server determines that the client has the authority to access its destination port based on the authentication information, the destination server can receive the first data packet through the destination port. Of course, if the destination server determines that the client does not have the authority to access its destination port based on the authentication information, the destination server will discard the first data packet.
[0144] It should be noted here that after the destination server authenticates the client, its firewall will restore the Deny ALL state, and the established connection will be maintained by the Connection Tracking mechanism.
[0145] This implementation method sets the server to reject all access from unverified clients, hides the server's ports, and allows authorized ports to be accessed only after authentication, thereby reducing the security risks of the underlying network exposure in the delivery-based data center and protecting the cloud platform.
[0146] In a possible implementation, the destination unreachable message carries a random value, the authentication information includes information to be encrypted and an authentication code, the information to be encrypted includes a client identifier, or also includes a current timestamp; and determining, based on the authentication information, that the client has permission to access the destination port includes:
[0147] Obtaining a shared key and access rights of the client based on the client identification query, wherein the access rights are used to limit the accessible ports of the client on the server;
[0148] Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code;
[0149] When the verification code and the authentication code are the same, if the accessible port of the client on the server includes the destination port to which the first data packet is to arrive, it is determined that the client has the authority to access the destination port.
[0150] In this implementation, the destination unreachable message carries a random value, which is a Nonce (Numberonce) value. In cryptography, Nonce is an arbitrary or non-repeated random value that is used only once. The random value is used for subsequent authentication. For example, the random value can be filled in the corresponding field of the data part of the ICMP unreachable message.
[0151] In this embodiment, after receiving the destination unreachable message, the client can take out the random value from the destination unreachable message, and then start to build an authentication data packet, which includes information to be encrypted and an authentication code. The information to be encrypted may include a client identifier (ClientID), or may also include a current timestamp. The ClientID is an identity identifier assigned to the client, which can index the shared key and port access rights of the client, that is, the destination port that the client is authorized to access. The authentication code is calculated by encrypting the random value and the information to be encrypted using the shared key of the client. For example, the authentication code can be HMAC, which is used for identity authentication, message integrity protection, and message replay attack prevention.
[0152] In this implementation, the client needs to encapsulate the information to be encrypted and the authentication code in a data packet, construct an authentication data packet, and then send the authentication data packet to the destination server. When the firewall of the destination server receives the authentication data packet, it can obtain the information to be encrypted and the authentication code in the data packet. The destination server can query the shared key and access rights of the client based on the ClientID in the information to be encrypted, and use the shared key to encrypt and calculate the random value (sent by the destination server to the client, so the destination server knows the random value) and the information to be encrypted to obtain the verification code. If the verification code and the authentication code are the same, it indicates that the client is a legitimate client. At this time, the destination server will query the access rights of the client to determine whether the client has the authority to access the destination port. If the client has the authority to access the destination port, the destination server will open the destination port for the client, that is, allow the IHIP and IHport of the client to access the AHIP and AHport (i.e., the destination port) of the server. If the client does not have the authority to access the destination port, the destination server will not open the destination port for the client and refuse to receive the data packet sent by the client to the destination port. If the verification code is different from the authentication code, it indicates that the client is not a legitimate client. At this time, the destination server will continue to reject data packets sent by the client.
[0153] It should be noted here that when defining access rights, it is not necessary to know the client's information. It is sufficient to define the source IP and source port that have access rights to the destination IP and destination port. As long as the source IP and source port in the sPort (source port) field of the IP layer of the authentication data packet are the source IP and source port with such access rights, the client can be considered to have the right to access the destination port.
[0154] In a possible implementation manner, after enabling access to the destination port for the client, the method further includes:
[0155] Periodically sending a destination unreachable message to the client.
[0156] In this implementation, when the client passes the authentication, the destination server will authorize the client's IHIP, IHport to access the server's AHIP, AHport. At this time, if the attacker blocks the legitimate client's data packet and pretends to be the client's IHIP, IHport, the attacker can access the server's AHIP, AHport. In order to avoid man-in-the-middle attacks, a continuous authentication mechanism is introduced. The firewall in the destination server will periodically send a destination unreachable message and require the client that sent the data packet to continue to authenticate. If the other party does not respond or the returned authentication data packet is wrong, the connection will be terminated and the client's data packet will be refused.
[0157] In this embodiment, if there is no attack, the client will periodically receive the destination unreachable message sent by the destination server, and in response to receiving the destination unreachable message, generate and return an authentication data packet, wherein the authentication data packet carries authentication information; after the firewall in the destination server passes the authentication, it will maintain the connection with the client and continue to open the destination port of the server for the client.
[0158] In a possible implementation manner, the using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code includes:
[0159] The random value, the information to be encrypted and the number of verifications are encrypted and calculated using the shared key to obtain a verification code, wherein the number of verifications includes the number of times the server verifies whether the client has the authority to access the destination port.
[0160] In this implementation, when the destination server periodically sends a destination unreachable message, in order to make the authentication safer and more accurate, the shared key can be used to encrypt and calculate the random value, the information to be encrypted, and the number of authentications to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication. In this way, when the destination server receives the authentication data packet, it can use the found shared key to encrypt and calculate the random value (known), the number of verifications (i.e., the number of times the destination server verifies whether the client has the authority to access the destination port, which the destination server can record) and the information to be encrypted to obtain a verification code. If the number of verifications is the same as the number of authentications, then the calculated verification code is the same as the authentication code, indicating that the client is a legitimate client.
[0161] Figure 4 The overall flow chart of the data transmission method according to an embodiment of the present disclosure is shown as follows: Figure 4 As shown, the data transmission method includes the following steps S401-S406:
[0162] In step S401, the client sends a first data packet to a destination port of a destination server for the first time;
[0163] In step S402, when receiving the first data packet sent by the client for the first time, the destination server discards the first data packet;
[0164] In step S403, the destination server returns a destination unreachable message to the client, where the destination unreachable message is used to instruct the client to initiate authentication;
[0165] In step S404, the client generates and returns an authentication data packet in response to receiving the destination unreachable message, wherein the authentication data packet carries authentication information;
[0166] In step S405, when the destination server determines that the client has the authority to access the destination port based on the authentication information, the destination server allows the client to access the destination port;
[0167] In step S406, the client re-sends the first data packet to the destination port of the destination server, and the destination server receives the first data packet re-sent by the client through the destination port.
[0168] In a possible implementation, Figure 4 As shown, the first data packet sent by the client to the destination port of the destination server for the first time will be intercepted and discarded by the firewall on the destination server, and the firewall on the destination server will return a destination unreachable message to the client, instructing the client to initiate authentication; the client generates and returns an authentication data packet in response to receiving the destination unreachable message, and when the destination server determines that the client has the authority to access the destination port based on the authentication information, it allows the client to access the destination port; in this way, the client can send the first data packet to the destination port of the destination server again, which can be sent to the destination port of the destination server through the firewall and received by the server.
[0169] In a possible implementation manner, the destination unreachable message carries a random value, and the method further includes:
[0170] The client obtains a shared key of the client, and uses the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, where the information to be encrypted includes a client identifier or also includes a current timestamp;
[0171] The client generates and returns an authentication data packet, including:
[0172] The client encapsulates the information to be encrypted and the authentication code in a data packet to generate an authentication data packet; and sends the authentication data packet to the destination server.
[0173] The destination server determines, based on the authentication information, that the client has the authority to access the destination port, including:
[0174] The destination server obtains the shared key and access rights of the client based on the client identifier query, and the access rights are used to limit the accessible port of the client on the destination server; the random value and the information to be encrypted are encrypted and calculated using the shared key to obtain a verification code; when the verification code and the authentication code are the same, if the accessible port of the client on the destination server includes the destination port to which the first data packet is to arrive, it is determined that the client has the right to access the destination port.
[0175] In a possible implementation, the client generates and returns an authentication data packet in response to receiving the destination unreachable message, including:
[0176] The client responds to the destination unreachable message through the transport layer or socket layer of the client, generates and returns an authentication data packet, and the socket layer is located between the transport layer and the application layer in the protocol stack.
[0177] In a possible implementation, the method further includes:
[0178] The destination server periodically sends a destination unreachable message to the client.
[0179] In a possible implementation manner, the client uses the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, including:
[0180] The client uses the shared key to encrypt and calculate the random value, the information to be encrypted, and the number of authentications to obtain an authentication code, where the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication;
[0181] The destination server uses the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code, including:
[0182] The destination server uses the shared key to encrypt and calculate the random value, the information to be encrypted, and the number of verifications to obtain a verification code, where the number of verifications includes the number of times the destination server verifies whether the client has permission to access the destination port.
[0183] Figure 4The technical terms and technical features involved in the embodiments shown and related Figure 1-Figure 3 The technical terms and technical features mentioned in the embodiments shown and related are the same or similar. Figure 4 The explanation and description of the technical terms and technical features involved in the embodiments shown and related can refer to the above Figure 1-Figure 3 The explanations of the illustrated and related embodiments will not be repeated here.
[0184] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.
[0185] Figure 5 The structure block diagram of a data transmission device applied to a client according to an embodiment of the present disclosure is shown. The device can be implemented as part or all of an electronic device through software, hardware or a combination of both. Figure 5 As shown, the data transmission device includes:
[0186] The first sending module 501 is configured to send a first data packet to a destination port of a destination server for the first time;
[0187] A first receiving module 502 is configured to receive a destination unreachable message sent by the destination server, where the destination unreachable message is used to instruct the client to initiate authentication;
[0188] The response module 503 is configured to generate and return an authentication data packet in response to receiving the destination unreachable message, wherein the authentication data packet carries authentication information;
[0189] The second sending module 504 is configured to resend the first data packet to the destination port of the destination server.
[0190] In a possible implementation manner, the destination unreachable message carries a random value, and the device further includes:
[0191] A first acquisition module is configured to acquire a shared key of the client;
[0192] A first calculation module is configured to use the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, wherein the information to be encrypted includes a client identifier or also includes a current timestamp;
[0193] The part of the response module that generates and returns the authentication data packet is configured as follows:
[0194] Encapsulating the information to be encrypted and the authentication code in a data packet to generate an authentication data packet;
[0195] Send the authentication data packet to the destination server.
[0196] In a possible implementation, the part of the response module that generates and returns the authentication data packet in response to receiving the destination unreachable message is configured as follows:
[0197] The transport layer or socket layer of the client responds to the destination unreachable message, generates and returns an authentication data packet, and the socket layer is located between the transport layer and the application layer in the protocol stack.
[0198] In a possible implementation manner, the device further includes:
[0199] The second receiving module is configured to periodically receive a destination unreachable message sent by the destination server.
[0200] In a possible implementation manner, the first calculation module is configured as follows:
[0201] The random value, the information to be encrypted and the number of authentications are encrypted and calculated using the shared key to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication.
[0202] Figure 5 The technical terms and technical features involved in the embodiments shown and related Figure 1-Figure 3 The technical terms and technical features mentioned in the embodiments shown and related are the same or similar. Figure 5 The explanation and description of the technical terms and technical features involved in the embodiments shown and related can refer to the above Figure 1-Figure 3 The explanations of the illustrated and related embodiments will not be repeated here.
[0203] Figure 6 The structure block diagram of a data transmission device applied to a destination server according to an embodiment of the present disclosure is shown. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 6 As shown, the data transmission device includes:
[0204] The discarding module 601 is configured to discard the first data packet when receiving the first data packet sent by the client for the first time;
[0205] A third sending module 602 is configured to return a destination unreachable message to the client, where the destination unreachable message is used to instruct the client to initiate authentication;
[0206] The third receiving module 603 is configured to receive an authentication data packet sent by the client, wherein the authentication data packet carries authentication information;
[0207] The opening module 604 is configured to allow the client to access the destination port when it is determined based on the authentication information that the client has the authority to access the destination port;
[0208] The fourth receiving module 605 is configured to receive the first data packet resent by the client through the destination port.
[0209] The destination unreachable message carries a random value, the authentication information includes information to be encrypted and an authentication code, the information to be encrypted includes a client identifier, or also includes a current timestamp; and the part of the open module that determines whether the client has the right to access the destination port based on the authentication information is configured as follows:
[0210] Obtaining a shared key and access rights of the client based on the client identification query, wherein the access rights are used to limit the accessible port of the client on the destination server;
[0211] Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code;
[0212] When the verification code and the authentication code are the same, if the accessible port of the client on the destination server includes the destination port to which the first data packet is to arrive, it is determined that the client has the authority to access the destination port.
[0213] In a possible implementation, the device further includes:
[0214] The fourth sending module is configured to periodically send a destination unreachable message to the client.
[0215] In a possible implementation manner, the using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code includes:
[0216] The random value, the information to be encrypted and the number of verifications are encrypted and calculated using the shared key to obtain a verification code, wherein the number of verifications includes the number of times the destination server verifies whether the client has the authority to access the destination port.
[0217] Figure 6 The technical terms and technical features involved in the embodiments shown and related Figure 1-Figure 3 The technical terms and technical features mentioned in the embodiments shown and related are the same or similar. Figure 6 The explanation and description of the technical terms and technical features involved in the embodiments shown and related can refer to the above Figure 1-Figure 3 The explanations of the illustrated and related embodiments will not be repeated here.
[0218] The present disclosure also discloses an electronic device, Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 7 As shown, the electronic device 700 includes a memory 701 and a processor 702; wherein,
[0219] The memory 701 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 702 to implement the above method steps.
[0220] Figure 8 It is a structural diagram of a computer system suitable for implementing the method according to an embodiment of the present disclosure.
[0221] like Figure 8 As shown, the computer system 800 includes a processing unit 801, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The processing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0222] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. The drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that the computer program read therefrom is installed into the storage section 808 as needed. Among them, the processing unit 801 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0223] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing the method described above. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 809, and / or installed from a removable medium 811.
[0224] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0225] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0226] As another aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above-mentioned embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods described in the embodiments of the present disclosure.
[0227] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A data transmission method, wherein: include: Send the first data packet to the destination port of the destination server for the first time; Receiving a destination unreachable message sent by the destination server, where the destination unreachable message is used to instruct the client to initiate authentication; Responding to the destination unreachable message through the transport layer or socket layer of the client, generating and returning an authentication data packet, wherein the authentication data packet carries authentication information; The socket layer is located between the transport layer and the application layer in the protocol stack; Resending the first data packet to the destination port of the destination server, so that the destination server receives the resent first data packet through the destination port when determining that the client has the authority to access the destination port based on the authentication information; The destination unreachable message carries a random value, and the method further includes: Obtaining a shared key of the client; Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code, wherein the information to be encrypted includes a client identifier or also includes a current timestamp; The generating and returning of the authentication data packet comprises: Encapsulating the information to be encrypted and the authentication code in a data packet to generate an authentication data packet; Sending the authentication data packet to the destination server; The method further comprises: Regularly receiving a destination unreachable message sent by the destination server; The step of using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain an authentication code includes: The random value, the information to be encrypted and the number of authentications are encrypted and calculated using the shared key to obtain an authentication code, wherein the number of authentications includes the number of times the client is instructed by the destination server to initiate authentication.
2. A data transmission method, wherein: include: When receiving a first data packet sent by a client for the first time, discarding the first data packet; Returning a destination unreachable message to the client, wherein the destination unreachable message is used to instruct the client to initiate authentication, so that the client responds to the destination unreachable message through a transport layer or a socket layer, generates and sends an authentication data packet, and the socket layer is located between the transport layer and the application layer in the protocol stack; Receiving an authentication data packet sent by the client, wherein the authentication data packet carries authentication information; When it is determined based on the authentication information that the client has the authority to access the destination port, allowing the client to access the destination port; receiving, through the destination port, the first data packet resent by the client, wherein the resent first data packet is sent by the client after sending the authentication data packet; The destination unreachable message carries a random value, the authentication information includes information to be encrypted and an authentication code, the information to be encrypted includes a client identifier, or also includes a current timestamp; and determining that the client has permission to access the destination port based on the authentication information includes: Obtaining a shared key and access rights of the client based on the client identification query, wherein the access rights are used to limit the accessible port of the client on the destination server; Using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code; When the verification code and the authentication code are the same, if the accessible port of the client on the destination server includes the destination port to which the first data packet is to arrive, it is determined that the client has the authority to access the destination port; After enabling access to the destination port for the client, the method further includes: Periodically sending a destination unreachable message to the client; The step of using the shared key to perform encryption calculation on the random value and the information to be encrypted to obtain a verification code includes: The random value, the information to be encrypted and the number of verifications are encrypted and calculated using the shared key to obtain a verification code, wherein the number of verifications includes the number of times the destination server verifies whether the client has the authority to access the destination port.
3. A data transmission method, wherein: include: The client executes the method described in claim 1, and the destination server executes the method described in claim 2.
4. An electronic device comprising a memory and at least one processor; wherein: The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the at least one processor to implement the method steps described in any one of claims 1-3.
5. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method steps described in any one of claims 1 to 3.
6. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method steps described in any one of claims 1 to 3 are implemented.
