A USBoIP-based dual-agent network isolation transmission method and device and storage medium
By introducing a proxy machine between the user terminal and the host and adopting a dual-proxy network isolation transmission method, the security problem of USBoIP network connection in high-security situations is solved, and secure data transmission on the USB bus is realized.
Patent Information
- Application Number
- CN202511086874.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-05
AI Technical Summary
In high-security scenarios, the network connection between remote USB devices and the host based on USBoIP is limited and cannot meet security requirements.
The dual-proxy network isolation transmission method is adopted. By introducing a proxy machine between the user terminal and the host, and using network proxy technology and dual proxy technology, the direct network connection is isolated, and data is transmitted securely on the basis of USB bus.
It enables secure and confidential data transmission in high-security scenarios by using dual proxy technology to isolate the direct network connection between the user terminal and the host, thus ensuring the security and confidentiality of data transmission.
Smart Images

Figure CN120602226B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of network transmission, in particular to a double-agent network isolation transmission method and device based on USBoIP and a storage medium. BACKGROUND
[0002] Currently, the remote USB device and the host based on USBoIP technology are directly connected by Ethernet. In general application scenarios, the remote USB device is inserted into the USB interface of the user terminal; the user terminal and the host are connected by a network. The specific network connection process is as follows:
[0003] 1) The user terminal acts as a USBoIP server and listens to the TCP connection on a specified port (usually 3240 port).
[0004] 2) The user connects the remote USB device to the USB interface of the user terminal, thereby obtaining the BUSID of the device.
[0005] 3) The user calls the usbip attach command (with the newly obtained BUSID as the parameter) on the host. At this time, the VHCI (USB virtual controller) will newly create a socket connection to the USBoIP server port of the user terminal.
[0006] After the connection is established, the USB data packets between the host and the newly inserted remote USB device flow on the newly obtained socket.
[0007] However, in high-security scenarios, the user terminal connected to the remote USB device and the host cannot be connected by a network. At this time, the application of USBoIP is limited. SUMMARY
[0008] The present application provides a double-agent network isolation transmission method and device based on USBoIP and a storage medium, aiming to at least solve one of the technical problems existing in the prior art.
[0009] The technical solution of the present application is a double-agent network isolation transmission method based on USBoIP, applied to a double-agent network isolation transmission device based on USBoIP. The double-agent network isolation transmission device based on USBoIP includes a remote USB device, a user terminal, a proxy machine and a host connected in sequence. The proxy machine is provided with a proxy machine network proxy program, and the host is provided with a host network proxy program. The double-agent network isolation transmission method based on USBoIP includes the following steps:
[0010] S100, the user terminal, the agent machine and the host machine continuously detect remote USB device access, and if remote USB device access is detected, a connection link is established, and after the connection link is established, the user terminal, the agent machine and the host machine communicate based on communication data packets;
[0011] S200, the host machine establishes a signal connection with the remote USB device connected to the user terminal through the agent machine;
[0012] S300, the host machine and the remote USB device perform data interaction, and the data interaction between the host machine and the remote USB device includes that a virtual host controller interface VHCI of the host machine sends data to a USBIP server of the user terminal and the USBIP server of the user terminal sends data to the virtual host controller interface VHCI of the host machine;
[0013] S400, after the data interaction is completed, the host machine deletes the signal connection with the remote USB device connected to the user terminal through the agent machine.
[0014] Further, step S100 includes the following steps:
[0015] S110, the user terminal, an agent machine network agent program of the agent machine and a host machine network agent program on the host machine side continuously listen to a TCP connection signal established by a remote USB device connected to the user terminal;
[0016] S120, if it is detected that the remote USB device is connected to the USB interface of the user terminal, a bus identifier BUSID of the remote USB device is allocated;
[0017] S130, the host machine network agent program waits for a virtual host controller interface VHCI connection through a USB over IP (USBoIP) protocol service port, the host machine calls an usbip attach command containing a bus identifier BUSID parameter, and a virtual host controller interface VHCI of the host machine connects with the host machine network agent program on the local host based on a transmission control protocol TCP to newly create a first socket (socket A);
[0018] S140, a virtual channel is established between the host machine network agent program of the host machine and the agent machine network agent program of the agent machine;
[0019] S150, the agent machine network agent program of the agent machine newly creates a second socket (socket B) based on a transmission control protocol TCP to connect with the USBoIP service port of the user terminal.
[0020] Further, in step S110,
[0021] The agent machine network agent program connects to the user terminal as a client, and the host network agent program listens to a TCP connection through a USBoIP service port.
[0022] Further, step S200 includes the following steps:
[0023] S210, the virtual host controller interface VHCI of the host initiates a second socket (socket B) connection request to a local USBoIP protocol service port;
[0024] S220, the host network agent program of the host accepts the connection request and applies for a corresponding channel number, and sends a connection establishment data packet to the agent machine network agent program of the agent machine;
[0025] S230, the agent machine network agent program of the agent machine receives the connection establishment data packet and extracts the target port number, and initiates a connection request to the USBoIP service end of the user terminal through the first socket (socket A);
[0026] S240, the USBoIP service end of the user terminal accepts the connection request and returns information to the agent machine network agent program of the agent machine;
[0027] S250, the agent machine network agent program saves the channel number and replies to the host network agent program that the connection establishment is successful;
[0028] S260, the agent machine network agent program of the host saves the channel number, and feeds back the connection acceptance information to the virtual host controller interface VHCI of the host.
[0029] Further, in step S300, the virtual host controller interface VHCI of the host sends data to the USBIP service end of the user terminal, including the following steps:
[0030] S310, the virtual host controller interface VHCI of the host sends data to the second socket (socket B);
[0031] S320, the host network agent program of the host indexes the channel number cN according to the second socket (socket B) value, and performs packet processing on the data;
[0032] S330, the host network agent program of the host sends a transmission data packet to the agent machine network agent program of the agent machine;
[0033] S340, the agent network agent of the agent machine obtains a second socket (socket B) value according to the channel number cN index, disassembles the transmission data packet, and sends data to the USBIP server of the user terminal through the first socket (socket A).
[0034] Further, in step S300, the USBIP server of the user terminal sends data to the virtual host controller interface VHCI of the host, including the following steps:
[0035] S350, the USBIP server of the user terminal sends data to the agent network agent of the agent machine through the first socket (socket A);
[0036] S360, the agent network agent of the agent machine obtains a channel number cN according to the first socket (socket A) value index, and performs packet processing on the data;
[0037] S370, the agent network agent of the agent machine sends a transmission data packet to the host network agent of the host;
[0038] S380, the host network agent of the host obtains a second socket (socket B) value according to the channel number cN index, disassembles the transmission data packet, and sends data to the virtual host controller interface VHCI of the host through the second socket (socket B).
[0039] Further, step S400 includes the following steps:
[0040] S410, the virtual host controller interface VHCI of the host disconnects the second socket (socket B) connection;
[0041] S420, the host network agent of the host obtains a channel number cN according to the second socket (socket B) value index, and sends a delete connection data packet to the agent network agent of the agent machine;
[0042] S430, the agent network agent of the agent machine receives the delete connection data packet, and obtains a first socket (socket A) value according to the channel number cN index;
[0043] S440, the agent network agent of the agent machine disconnects the first socket (socket A) connection with the USBIP server of the user terminal;
[0044] S450, the agent network agent of the agent machine deletes the channel number cN and the first socket (socket A) value pair;
[0045] S460、the agent network agent program of the agent machine replies to the host network agent program of the host machine with a message of successful deletion of connection.
[0046] Further, in step S100,
[0047] The packet structure of the communication data packet comprises a packet header identification field, a message serial number field, a packet type field, a load length field and a load field connected in sequence, wherein,
[0048] The packet type field comprises a heartbeat type, a heartbeat reply type, a connection establishment type, a connection establishment reply type, a connection deletion type, a connection deletion reply type and a data transmission type.
[0049] Further, the application further provides a dual-agent network isolation transmission device based on USBoIP, which is used for executing the dual-agent network isolation transmission method based on USBoIP.
[0050] A remote USB device;
[0051] A user terminal, wherein the remote USB device is electrically connected with the user terminal;
[0052] An agent machine, wherein the user terminal is connected with the agent machine through an Ethernet, and the agent machine is provided with an agent network agent program, and the agent network agent program is electrically connected with the user terminal through the Ethernet;
[0053] A host, wherein the agent machine is connected with the host through a USB bus, and the host is provided with a host network agent program, and the host network agent program is electrically connected with the agent machine through the USB bus.
[0054] Further, the application further provides a computer readable storage medium, which is provided with program instructions, and the program instructions are executed by a processor to implement the dual-agent network isolation transmission method based on USBoIP.
[0055] The application has the following beneficial effects:
[0056] The USB over IP (USBoIP) based double-agent network isolation transmission method, device and storage medium are particularly suitable for high-security level scenes requiring physical network isolation, the network agent technology is used, USBoIP is used in the isolated network, the direct network connection between the user terminal and the host in USBoIP is isolated through the double-agent technology, the data of the specified port of the two agents is forwarded on the basis of the USB bus, and the technical effect of safe and secret data transmission is achieved. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 The flowchart of the USB over IP (USBoIP) based double-agent network isolation transmission method.
[0058] Figure 2 The structural schematic diagram of the prior art user terminal and the host connected by a network.
[0059] Figure 3 The structural schematic diagram of the USB over IP (USBoIP) based double-agent network isolation transmission device.
[0060] Figure 4 The flowchart of connection establishment in the USB over IP (USBoIP) based double-agent network isolation transmission method.
[0061] Figure 5 The flowchart of data transmission from the virtual host controller interface VHCI of the host to the USBIP server of the user terminal in the USB over IP (USBoIP) based double-agent network isolation transmission method.
[0062] Figure 6 The flowchart of data transmission from the USBIP server of the user terminal to the virtual host controller interface VHCI of the host in the USB over IP (USBoIP) based double-agent network isolation transmission method.
[0063] Figure 7 The flowchart of connection deletion in the USB over IP (USBoIP) based double-agent network isolation transmission method. DETAILED DESCRIPTION
[0064] The concept, specific structure and generated technical effects of the present application will be described clearly and completely in combination with the embodiments and the drawings, so that the purpose, scheme and effect of the present application can be fully understood. It should be noted that, in the case of no conflict, the embodiments and the features in the embodiments in the present application can be combined with each other.
[0065] It should be noted that, unless otherwise specified, when a certain feature is referred to as being "fixed", "connected" to another feature, it can be directly fixed, connected to the other feature, or indirectly fixed, connected to the other feature. In addition, the up, down, left, right, top, bottom and other descriptions used in the present application are only relative to the mutual position relationship of the components of the present application in the drawings.
[0066] In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the specification of the present application is only for the purpose of describing specific embodiments and is not intended to limit the present application. The term "and / or" used herein includes any combination of one or more related listed items.
[0067] It should be understood that although the terms first, second, third, etc. can be used in the present disclosure to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, without departing from the scope of the present disclosure, the first element can also be referred to as the second element, and similarly, the second element can also be referred to as the first element.
[0068] Referring to Figures 1 to 7 In some embodiments, the technical solution of the present application is a USBoIP-based dual-agent network isolation transmission method applied to a USBoIP-based dual-agent network isolation transmission device, which comprises a remote USB device, a user terminal, an agent and a host connected in sequence. The agent is provided with an agent network agent program, and the host is provided with a host network agent program. Referring to Figure 1 The USBoIP-based dual-agent network isolation transmission method comprises the following steps:
[0069] S100, the user terminal, the agent and the host continuously detect the access of the remote USB device. If the remote USB device is detected to be accessed, a connection link is established. After the connection link is established, the user terminal, the agent and the host communicate based on communication data packets;
[0070] S200, the host establishes a signal connection with the remote USB device accessed to the user terminal through the agent;
[0071] S300, the host and the remote USB device perform data interaction, which includes that the virtual host controller interface VHCI of the host sends data to the USBIP server of the user terminal and the USBIP server of the user terminal sends data to the virtual host controller interface VHCI of the host;
[0072] S400. After the data exchange is completed, the host deletes the signal connection with the remote USB device connected to the user terminal through the agent machine.
[0073] The beneficial effects of this invention are:
[0074] The aforementioned USBoIP-based dual-proxy network isolation transmission method, device, and storage medium are specifically a remote device access security solution based on the USB over IP (USBoIP) protocol. It is particularly suitable for high-security scenarios requiring physical network isolation. This invention uses network proxy technology to enable the use of USBoIP in isolated networks. By using dual proxy technology to isolate the direct network connection between the user terminal and the host in USBoIP, data from designated ports of both proxies is forwarded on the basis of the USB bus, thereby achieving the technical effect of secure and confidential data transmission.
[0075] The aforementioned USBoIP-based dual-proxy network isolation transmission method, device, and storage medium use dual-proxy technology to isolate the direct network connection between the user terminal and the host in USBoIP; and forward data from designated ports of both proxies on the basis of the USB bus.
[0076] In contrast, the reference Figure 2 In general applications, existing technologies involve plugging a remote USB device into the USB port of a user terminal, with the user terminal and the host connected directly via a network.
[0077] Reference Figure 2 The existing network connection process between user terminals and hosts is as follows:
[0078] 1) The user terminal acts as the USBoIP server, listening for TCP connections on a specified port (usually port 3240);
[0079] 2) The user connects the remote USB device to the USB port of the user terminal to obtain the device's bus identifier (BUSID);
[0080] 3) When the user calls the usbip attach command on the host (using the newly obtained bus identifier BUSID as a parameter), the host's virtual host controller interface VHCI will create a new socket to connect to the user terminal's USBoIP service port.
[0081] USB data packets between the host and the newly inserted remote USB device circulate on this newly acquired socket.
[0082] Reference Figure 3The USBoIP-based double-agent network isolation transmission method, device and storage medium add an agent between the user terminal and the host, and cut off the direct network connection between the user terminal and the host in the USBoIP through double-agent technology.
[0083] In a specific embodiment, the user terminal and the agent are connected through an Ethernet, and the agent and the host are connected through a USB bus, and the network connection process is as follows:
[0084] 1) The user terminal acts as a USBoIP server, and listens to a TCP connection at a specified port (usually 3240);
[0085] 2) The network agent on the host side also listens to a TCP connection at the USBoIP service port (usually 3240);
[0086] 3) After the user connects a remote USB device to the USB interface of the user terminal, the BUSID of the USB device is obtained;
[0087] 4) The user calls the usbip attach command (with the BUSID as a parameter) on the host, and the VHCI connects a new TCP socket (referred to as socket B) to the USBoIP service port (3240) locally listened to by the network agent on the host;
[0088] 5) The network agent on the host establishes a virtual channel with the network agent on the agent;
[0089] 6) Then the network agent on the agent connects a new TCP socket (referred to as socket A) to the USBoIP service port of the user terminal.
[0090] After the above process is completed, the user terminal and the network agent on the agent communicate through socket A; the network agent on the agent and the network agent on the host communicate through the virtual channel; and the network agent on the host and the VHCI communicate through socket B.
[0091] The role of the network agent on the agent is to forward the received data of socket A and the virtual channel; and the role of the network agent on the host is to forward the received data of the virtual channel and socket B. In this way, after a new remote USB device is inserted, the user terminal and the VHCI of the host are equivalent to a socket communication link.
[0092] Further, step S100 comprises the following steps:
[0093] S110, the user terminal, the proxy machine network agent of the proxy machine and the host network agent of the host side continuously listen to the TCP connection signal established by the remote USB device connecting to the user terminal;
[0094] S120, if the remote USB device is detected to connect to the USB interface of the user terminal, a bus identifier BUSID of the remote USB device is allocated;
[0095] S130, the host network agent waits for a virtual host controller interface VHCI connection through a USB over IP (USBoIP) protocol service port, the host calls an usbip attach command containing a bus identifier BUSID parameter, and the virtual host controller interface VHCI of the host connects to the host network agent in the local host based on a transmission control protocol TCP to newly build a second socket (socket B);
[0096] S140, a virtual channel is established between the host network agent of the host and the proxy machine network agent of the proxy machine;
[0097] S150, the proxy machine network agent of the proxy machine connects to the USBoIP service port of the user terminal based on the transmission control protocol TCP to newly build a first socket (socket A).
[0098] In the step S130, the host calls an usbip attach command containing a bus identifier BUSID parameter, and the virtual host controller interface VHCI of the host newly builds a second socket (socket B) based on a transmission control protocol TCP to connect to the USB over IP (USBoIP) protocol service port listened to by the host end.
[0099] Specifically, in the step S100, referring to Table 1, the structure of the data communication packet is as follows:
[0100] Table 1:
[0101] Header identification (H_CODE) Message session number (Session_ID) Packet type (dataType) Data load length (dataLen) Data load (payload) 2 byte 2 byte 1 byte 4 byte n byte
[0102] Wherein, H_CODE is a packet header identifier (such as 0xAA55), Session_ID is a serial number of a message, dataType is a packet type, dataLen is a length of a data load, and payload is a data load.
[0103] The dataType can be assigned as follows:
[0104] enum {
[0105] BY USBIP PK TYPE HEATBEAT 0x01, / * Heartbeat * /
[0106] BY USBIP PK TYPE HEATBEAT ACK 0x02, / * Heartbeat reply * /
[0107] BY USBIP PK TYPE CONNECT 0x03, / * Connect * /
[0108] BY USBIP PK TYPE CONNECT ACK 0x04, / * Connect reply * /
[0109] BY USBIP PK TYPE DISCONNECT 0x05, / * Disconnect * /
[0110] BY USBIP PK TYPE DISCONNECT ACK 0x06, / * Disconnect reply * /
[0111] BY USBIP PK TYPE DATA 0x07 / * Data transfer * /
[0112] }
[0113] Further, in step S110,
[0114] The agent network agent program connects to the user terminal as a client, and the host network agent program listens to TCP connection through the USBoIP service port.
[0115] Specifically, the agent network agent program connects to the user terminal as a client and listens to the user terminal.
[0116] Further, referring to Figure 4 , step S200 includes the following steps:
[0117] S210, the virtual host controller interface VHCI of the host initiates a second socket (socket B) connection request to the local USBoIP protocol service port;
[0118] S220, the host network agent program of the host accepts the connection request and applies for a corresponding channel number, and sends a connection establishment data packet to the agent network agent program of the agent;
[0119] S230, the proxy network agent of the proxy machine receives the connection establishment data packet and extracts the target port number, and initiates a connection request to the USBoIP service end of the user terminal through a first socket (socket A);
[0120] S240, the USBoIP service end of the user terminal accepts the connection request and returns to the proxy network agent of the proxy machine;
[0121] S250, the proxy network agent saves the channel number and returns to the host network agent that the connection establishment is successful;
[0122] S260, the host network agent saves the channel number and feeds back the connection acceptance information to the virtual host controller interface VHCI of the host.
[0123] Specifically, in step S220, the connection establishment data packet is one of the communication data packets. After the host network agent receives the socket connection on the USBoIP service port (3240), it sends a connection establishment data packet to the network agent on the proxy machine side. The network agent on the proxy machine side extracts the relevant information and establishes a socket connection with the USBoIP service port (3240) of the user terminal in the data packet. Referring to Table 2, the structure of the connection establishment data packet is as follows:
[0124] Table 2:
[0125] Header identification (H_CODE) Message session number (Session_ID) Packet type (dataType) Data load length (dataLen) Port number of target network object (Port num) Transport layer protocol type (TCP or UDP) Transport channel number (Chnnum) 2 byte 2 byte 1 byte (0x03) 4 byte 2 byte 1 byte 2 byte
[0126] Wherein, port num is the port number of the target network object to be connected, TCP or UDP is the transmission layer protocol, which is TCP (value 1) or UDP (value 2), and chn num is the transmission channel number.
[0127] After responding to the command, the proxy network agent will reply an ACK to the host network agent. Referring to Table 3, the format of the reply ACK is as follows:
[0128] Table 3:
[0129] Header identification (H_CODE) Message session number (Session_ID) Packet type (dataType) Data load length (dataLen) Data load (payload) 2 byte 2 byte 1 byte (0x04) 4 byte 1 byte
[0130] Further, in step S300, referring to Figure 5 , the virtual host controller interface VHCI of the host sends data to the USBIP service end of the user terminal, including the following steps:
[0131] S310, the virtual host controller interface VHCI of the host sends data to a second socket (socket B);
[0132] S320, the host network agent of the host indexes the channel number cN according to the second socket (socket B) value, and performs packet processing on the data;
[0133] S330, the host network agent of the host sends the transmission data packet to the proxy network agent of the proxy;
[0134] S340, the proxy network agent of the proxy indexes the second socket (socket B) value according to the channel number cN, disassembles the transmission data packet, and sends the data to the USBIP server of the user terminal through the first socket (socket A).
[0135] Further, in step S300, referring to Figure 6 , the USBIP server of the user terminal sends data to the virtual host controller interface VHCI of the host, including the following steps:
[0136] S350, the USBIP server of the user terminal sends data to the proxy network agent of the proxy through the first socket (socket A);
[0137] S360, the proxy network agent of the proxy indexes the channel number cN according to the first socket (socket A) value, and performs packet processing on the data;
[0138] S370, the proxy network agent of the proxy sends the transmission data packet to the host network agent of the host;
[0139] S380, the host network agent of the host indexes the second socket (socket B) value according to the channel number cN, disassembles the transmission data packet, and sends the data to the virtual host controller interface VHCI of the host through the second socket (socket B).
[0140] Specifically, referring to Table 4, the transmission data packet format is:
[0141] Table 4:
[0142] Header identification (H_CODE) Message session number (Session_ID) Packet type (dataType) Data load length (dataLen) Channel number (Chnnum) Data load (payload) 2 byte 2 byte 1 byte (0x07) 4 byte 2 byte n byte
[0143] Regardless of the host or the proxy network agent receives any data on the connection socket, the corresponding channel number needs to be indexed according to the socket value, and the data is encapsulated into a data packet and sent to the USB bus.
[0144] After receiving such a packet, the network agent of the host or the proxy machine needs to extract the channel number (chn num) from the packet, then index the corresponding socket value by the channel number, and finally send the data load on the socket.
[0145] Further, referring to Figure 7 , step S400 comprises the following steps:
[0146] S410, the virtual host controller interface VHCI of the host disconnects the second socket (socket B) connection;
[0147] S420, the host network agent of the host indexes the channel number cN according to the second socket (socket B) value, and sends a delete connection packet to the proxy network agent of the proxy machine;
[0148] S430, the proxy network agent of the proxy machine receives the delete connection packet, and indexes the first socket (socket A) value according to the channel number cN;
[0149] S440, the proxy network agent of the proxy machine disconnects the first socket (socket A) connection with the USBoIP server of the user terminal;
[0150] S450, the proxy network agent of the proxy machine deletes the channel number cN and the first socket (socket A) value pair;
[0151] S460, the proxy network agent of the proxy machine replies to the host network agent of the host with a message of successful deletion of the connection.
[0152] Specifically, referring to Table 5, the format of the delete connection packet is as follows:
[0153] Table 5:
[0154] Header identification (H_CODE) Message session number (Session_ID) Packet type (dataType) Data load length (dataLen) Channel number to be deleted (Chnnum) 2 byte 2 byte 1 byte (0x05) 4 byte 2 byte
[0155] Wherein, Chn num is the channel number to be deleted.
[0156] In one specific embodiment, after the deletion of the connection is completed, an ACK needs to be replied to the host. Referring to Table 6, the format is as follows:
[0157] Table 6:
[0158] Header identification (H_CODE) Message session number (Session_ID) Packet type (dataType) Data load length (dataLen) Data load (payload) 2 byte 2 byte 1 byte (0x06) 4 byte 2 byte
[0159] Further, in step S100,
[0160] The packet structure of the communication data packet comprises a packet header identification field, a message serial number field, a packet type field, a load length field and a load field connected in sequence, wherein,
[0161] The packet type field comprises a heartbeat type, a heartbeat reply type, a connection establishment type, a connection establishment reply type, a connection deletion type, a connection deletion reply type and a data transmission type.
[0162] Further, the application also provides a dual-agent network isolation transmission device based on USBoIP, which is used for executing the dual-agent network isolation transmission method based on USBoIP.
[0163] A remote USB device;
[0164] A user terminal, wherein the remote USB device is electrically connected with the user terminal;
[0165] An agent machine, wherein the user terminal is connected with the agent machine through an Ethernet, and the agent machine is provided with an agent machine network agent program, and the agent machine network agent program is electrically connected with the user terminal through the Ethernet;
[0166] A host, wherein the agent machine is connected with the host through a USB bus, and the host is provided with a host network agent program, and the host network agent program is electrically connected with the agent machine through the USB bus.
[0167] Further, the application also provides a computer readable storage medium, which is provided with program instructions, and the program instructions are executed by a processor to implement the dual-agent network isolation transmission method based on USBoIP. The above is only the preferred embodiment of the application, and the application is not limited to the above-mentioned embodiments, as long as the same means can achieve the technical effects of the application, any modification, equivalent replacement, improvement, etc. within the spirit and principle of the disclosure should be included in the protection scope of the disclosure.
Claims
1. A USBoIP-based dual-proxy network isolation transmission method, applied to a USBoIP-based dual-proxy network isolation transmission device, wherein the USBoIP-based dual-proxy network isolation transmission device comprises a remote USB device, a user terminal, a proxy machine, and a host machine connected in sequence, wherein the proxy machine is equipped with a proxy machine network proxy program, and the host machine is equipped with a host machine network proxy program, characterized in that, The USBoIP-based dual-proxy network isolation transmission method includes the following steps: S100: The user terminal, the agent machine, and the host continuously detect the access status of the remote USB device. When the access of the remote USB device is detected, a connection link is established. After the connection link is established, the user terminal, the agent machine, and the host communicate based on communication data packets. Step S100 includes the following steps: S110, the user terminal, the proxy network proxy program of the proxy machine, and the host network proxy program on the host side continuously listen for the TCP connection signal established by the remote USB device connected to the user terminal; S120. If a remote USB device is detected connected to the USB interface of the user terminal, assign a bus identifier (BUSID) to the remote USB device. S130. The host network agent program waits for the virtual host controller interface VHCI to connect through the USB over IP protocol service port. The host calls the usbip attach command containing the bus identifier BUSID parameter. The host's virtual host controller interface VHCI establishes a new second socket based on the transmission control protocol TCP and connects to the host network agent program on the host's local machine. S140. A virtual channel is established between the host network agent program of the host and the agent network agent program of the agent machine; S150, The proxy network proxy program of the proxy machine establishes a new first socket based on the Transmission Control Protocol (TCP) and connects to the USBoIP service port of the user terminal; S200: The host network proxy program set on the host establishes a signal connection with the remote USB device connected to the user terminal through the proxy network proxy program set on the proxy machine; S300, The host interacts with the remote USB device through the host network proxy program. The data interaction between the host and the remote USB device through the host network proxy program includes the host's Virtual Host Controller Interface (VHCI) sending data to the user terminal's USBIP server and the user terminal's USBIP server sending data to the host's Virtual Host Controller Interface (VHCI). S400. After the data interaction is completed, the host network proxy program of the host computer connects to the remote USB device deletion signal connected to the user terminal through the proxy network proxy program of the proxy machine.
2. The dual-proxy network isolation transmission method based on USBoIP according to claim 1, characterized in that, In step S110, The proxy machine network proxy program connects to the user terminal as a client, and the host network proxy program listens for TCP connections through the USBoIP service port.
3. The dual-proxy network isolation transmission method based on USBoIP according to claim 1, characterized in that, Step S200 includes the following steps: S210. The virtual host controller interface (VHCI) of the host initiates a second socket connection request to the local listening USB over IP protocol service port. S220. The host network proxy program of the host accepts the connection request and requests the corresponding channel number, and sends a connection establishment data packet to the proxy network proxy program of the proxy machine. S230. The proxy network proxy program of the proxy machine receives the connection establishment data packet and extracts the target port number, and initiates a connection request to the USBoIP server of the user terminal through the first socket. S240. The USBoIP server of the user terminal accepts the connection request and returns information to the proxy network proxy program of the proxy machine. S250, The proxy machine network proxy program saves the channel number and replies to the host network proxy program that the connection has been successfully established; S260. The proxy network agent program of the host saves the channel number and sends the connection acceptance information back to the virtual host controller interface (VHCI) of the host.
4. The dual-proxy network isolation transmission method based on USBoIP according to claim 1, characterized in that, In step S300, the virtual host controller interface (VHCI) of the host sends data to the USB IP server of the user terminal, including the following steps: S310, The host's Virtual Host Controller Interface (VHCI) sends data to the second socket; S320: The host network agent program of the host obtains the channel number cN according to the second socket value index and performs packet processing on the data. S330, The host network agent program of the host sends transmission data packets to the agent network agent program of the agent machine; The S340 proxy network proxy program obtains the second socket value based on the channel number cN index, disassembles the transmission data packet, and sends the data to the USBoIP server of the user terminal through the first socket.
5. The dual-proxy network isolation transmission method based on USBoIP according to claim 1, characterized in that, In step S300, the process of the user terminal's USBIP server sending data to the host's Virtual Host Controller Interface (VHCI) includes the following steps: S350, the user terminal's USBoIP server sends data to the agent's agent network agent program through the first socket; The S360 and the proxy machine's network proxy program obtain the channel number cN based on the first socket value index and encapsulate the data. S370, the agent machine's agent network agent program sends transmission data packets to the host machine's host network agent program; S380: The host network agent program of the host obtains the second socket value according to the channel number cN index, disassembles the transmission data packet, and sends the data to the host's virtual host controller interface VHCI through the second socket.
6. The dual-proxy network isolation transmission method based on USBoIP according to claim 1, characterized in that, Step S400 includes the following steps: S410, The virtual host controller interface (VHCI) of the host disconnects the second socket connection; S420. The host network proxy program of the host obtains the channel number cN according to the second socket value index, and sends a delete connection data packet to the proxy network proxy program of the proxy machine. S430. The proxy network proxy program of the proxy machine receives the delete connection data packet and obtains the first socket value according to the channel number cN index. S440, The proxy network proxy program of the proxy machine disconnects from the first socket connection of the USBoIP server of the user terminal; S450, The proxy network proxy program of the proxy machine deletes the channel number cN and the first socket value pair; S460, The proxy network proxy program of the proxy machine replies to the host network proxy program of the host with a message that the connection was successfully deleted.
7. The dual-proxy network isolation transmission method based on USBoIP according to claim 1, characterized in that, In step S100, The packet structure of the communication data packet includes, in sequence, a packet header identifier field, a message sequence number field, a packet type field, a payload length field, and a payload field, wherein, The packet type field includes heartbeat type, heartbeat response type, connection establishment type, connection establishment response type, connection deletion type, connection deletion response type, and data transmission type.
8. A USBoIP-based dual-proxy network isolation transmission device, used to execute the USBoIP-based dual-proxy network isolation transmission method as described in any one of claims 1 to 7, characterized in that, The USBoIP-based dual-proxy network isolation transmission device includes: Remote USB device; The remote USB device is electrically connected to the user terminal; The proxy machine is connected to the user terminal via Ethernet. The proxy machine is equipped with a proxy machine network proxy program, which is electrically connected to the user terminal via Ethernet. The host computer is connected to the agent computer via a USB bus. The host computer is equipped with a host network agent program, which is electrically connected to the agent computer via the USB bus.
9. A computer-readable storage medium, characterized in that, It stores program instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Host device coupled to a USB peripheral and method of operating the same
CN103299285A
USB device sharing method and system based on virtualization
CN116955236A