CN111726201A - A solution for AIRT-ROS virtual network card packet loss - Google Patents
A solution for AIRT-ROS virtual network card packet loss Download PDFInfo
- Publication number
- CN111726201A CN111726201A CN202010542160.4A CN202010542160A CN111726201A CN 111726201 A CN111726201 A CN 111726201A CN 202010542160 A CN202010542160 A CN 202010542160A CN 111726201 A CN111726201 A CN 111726201A
- Authority
- CN
- China
- Prior art keywords
- network card
- virtual network
- ros
- airt
- operating system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0002—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/20—Traffic policing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/30—Flow control; Congestion control in combination with information about buffer occupancy at either end or at transit nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/36—Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Quality & Reliability (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及虚拟网卡的丢包领域,更具体涉及一种AIRT-ROS虚拟网卡丢包解决方法。The invention relates to the field of packet loss of a virtual network card, and more particularly to a solution method for packet loss of an AIRT-ROS virtual network card.
背景技术Background technique
目前,大多数虚拟网卡丢失数据包的情况可划分为如下几类:主机连接类故障包括主机与virtual connection(虚拟连接)连接断开,主机不能直接通过VIC(virtualInternet Connection,虚拟互联网连接)或SSH(Secure Shell,安全协议外壳)连接,故障切换/故障回复后的虚拟机网络丢失。vSwitch切换过程中内核或驱动类故障导致的丢包,包括部分虚拟机网络受阻,或者全部虚拟机、主机管理端口在内的网络受阻。虚拟网卡丢包场景可包括:当虚拟网卡出现故障后,上层应用不了解虚拟网卡状态,依然正常发送报文,导致丢包;主机出现故障后,上层应用默认虚拟网卡已经发送完毕,未能检测数据包实际是否发送成功;上层应用报文传输速率超过虚拟网卡驱动可传输速率,虚拟网卡上报操作系统丢包,再由操作系统通知上层应用已经丢包,上层应用再做相应调整,整个消息链传送丢包消息的过程中已经导致部分报文丢失。At present, most virtual network cards lose data packets can be divided into the following categories: host connection failures include disconnection between the host and the virtual connection (virtual connection), the host cannot directly connect through VIC (virtual Internet Connection, virtual Internet connection) or SSH (Secure Shell, Secure Protocol Shell) connection, virtual machine network loss after failover/failback. Packet loss caused by kernel or driver faults during vSwitch switching, including network blockage of some virtual machines, or network blockage of all virtual machines and host management ports. VNIC packet loss scenarios may include: when the virtual NIC fails, the upper-layer application does not know the status of the virtual NIC and still sends packets normally, resulting in packet loss; after the host fails, the upper-layer application defaults to the virtual NIC already sent and fails to detect Whether the data packet is actually sent successfully; the upper-layer application packet transmission rate exceeds the transmission rate of the virtual NIC driver, the virtual NIC reports the packet loss to the operating system, and then the operating system notifies the upper-layer application that the packet has been lost, and the upper-layer application makes corresponding adjustments. The entire message chain Some packets have been lost in the process of transmitting packet loss messages.
通过分析上述现象,虚拟网卡丢包的主要原因是虚拟网卡或者主机出现故障而导致的数据包丢失,以及虚拟网卡的转发能力不能满足上层应用程序发送、接收数据包的速率造成的,其实质是虚拟网卡和上层应用程序的发送、接收数据包速率不同步。By analyzing the above phenomena, the main reasons for the packet loss of the virtual network card are the loss of data packets caused by the failure of the virtual network card or the host, and the fact that the forwarding capability of the virtual network card cannot meet the rate at which the upper-layer application sends and receives data packets. The sending and receiving packet rates of the virtual network card and the upper-layer application are not synchronized.
发明内容SUMMARY OF THE INVENTION
本发明所要解决的技术问题在于现有技术虚拟网卡和上层应用程序的发送、接收数据包速率不同步导致丢包的问题。The technical problem to be solved by the present invention lies in the problem of packet loss caused by asynchronous transmission and reception of data packet rates between the virtual network card and the upper-layer application program in the prior art.
本发明是通过以下技术方案解决上述技术问题的:一种AIRT-ROS虚拟网卡丢包解决方法,所述方法包括:The present invention solves the above technical problems through the following technical solutions: a solution method for AIRT-ROS virtual network card packet loss, the method includes:
应用程序通过AIRT-ROS(Artificial Intelligence Real Time-RobotOperating System,人工智能实时机器人操作系统)向虚拟网卡发送数据包时,当虚拟网卡的接收队列超过最大传输单元值时,设置标志位并通知上层应用减慢发送速度;虚拟网卡通过AIRT-ROS向应用程序发送数据包时,虚拟网卡的发送队列超过最大传输单元值时,设置标志位并通知上层应用减慢发送速度。When the application sends data packets to the virtual network card through AIRT-ROS (Artificial Intelligence Real Time-Robot Operating System), when the receiving queue of the virtual network card exceeds the maximum transmission unit value, the flag is set and the upper-layer application is notified Slow down the sending speed; when the virtual network card sends data packets to the application through AIRT-ROS, when the sending queue of the virtual network card exceeds the maximum transmission unit value, the flag is set and the upper-layer application is notified to slow down the sending speed.
优选的,所述AIRT-ROS是基于AMP架构的多核双操作系统,其中一个操作系统是Linux,另一个操作系统是RTERS实时操作系统,所述AIRT-ROS包括Linux内核以及RTERS内核,所述Linux内核包括机器人操作系统、第一超文本传输协议、文件传输协议以及第一本地高级可编程中断控制器,所述RTERS内核包括机器人实时操作系统、第二超文本传输协议以及第二本地高级可编程中断控制器,所述Linux内核与所述RTERS内核通过IPI接口连接,所述机器人操作系统与所述机器人实时操作系统通过虚拟交换机进行虚拟连接,所述第一本地高级可编程中断控制器通过第一输入输出高级可编程中断控制器连接非实时设备以及虚拟网卡,所述第二本地高级可编程中断控制器通过第二输入输出高级可编程中断控制器连接实时设备,所述虚拟网卡通过AIRT-ROS向应用程序发送数据包,或者虚拟网卡通过AIRT-ROS接收应用程序发送的数据包。Preferably, the AIRT-ROS is a multi-core dual operating system based on AMP architecture, one operating system is Linux, and the other operating system is RTERS real-time operating system, the AIRT-ROS includes a Linux kernel and an RTERS kernel, the Linux The kernel includes a robot operating system, a first hypertext transfer protocol, a file transfer protocol, and a first local advanced programmable interrupt controller, the RTERS kernel includes a robot real-time operating system, a second hypertext transfer protocol, and a second local advanced programmable interrupt controller Interrupt controller, the Linux kernel and the RTERS kernel are connected through an IPI interface, the robot operating system and the robot real-time operating system are virtually connected through a virtual switch, and the first local advanced programmable interrupt controller is connected through the first local advanced programmable interrupt controller. An I/O advanced programmable interrupt controller is connected to the non-real-time device and the virtual network card, the second local advanced programmable interrupt controller is connected to the real-time device through the second I/O advanced programmable interrupt controller, and the virtual network card is connected to the real-time device through the AIRT- ROS sends data packets to the application, or the virtual network card receives the data packets sent by the application through AIRT-ROS.
优选的,所述虚拟网卡的驱动程序划分为四层结构,即网络协议接口层、网络设备接口层、网络驱动接口层、设备媒介层,通过在网络协议接口层和网络驱动接口层中设置钩子函数,预先判断虚拟网卡的接收队列的状态或者发送队列的状态,通知上层应用程序控制传输报文速率。Preferably, the driver of the virtual network card is divided into a four-layer structure, namely a network protocol interface layer, a network device interface layer, a network driver interface layer, and a device media layer. By setting hooks in the network protocol interface layer and the network driver interface layer The function, which pre-determines the status of the receiving queue or the sending queue of the virtual network card, and notifies the upper-layer application to control the transmission packet rate.
本发明相比现有技术具有以下优点:Compared with the prior art, the present invention has the following advantages:
(1)为解决虚拟网卡的丢包问题,本发明提出一种AIRT-ROS虚拟网卡丢包解决方案,通过在网络协议接口层和网络驱动接口层中设置钩子函数,预先判断发送队列的状态或者接收对列的状态,设置标志位并通知上层应用或远端应用调整发送速度,缓解上层应用和虚拟网卡因为发送速度不一致而导致的丢包。(1) In order to solve the packet loss problem of the virtual network card, the present invention proposes an AIRT-ROS virtual network card packet loss solution. By setting hook functions in the network protocol interface layer and the network driver interface layer, the state of the sending queue or Receive the status of the queue, set the flag bit and notify the upper-layer application or the remote application to adjust the sending speed, so as to alleviate the packet loss caused by the inconsistent sending speed between the upper-layer application and the virtual network card.
(2)提供一种基于AMP架构的多核双操作系统AIRT-ROS,AIRT-ROS的其中一个操作系统是Linux,另一个操作系统是RTERS实时操作系统,Linux和RTERS操作系统分别执行非实时进程和实时进程;分别响应非实时设备中断和实时设备中断;支持非实时进程和实时进程之间通信;集成了Linux众多驱动,极大的减轻了驱动通用外部设备的工作量。(2) Provide a multi-core dual operating system AIRT-ROS based on the AMP architecture. One of the operating systems of AIRT-ROS is Linux, and the other operating system is the RTERS real-time operating system. The Linux and RTERS operating systems respectively execute non-real-time processes and Real-time process; respond to non-real-time device interrupt and real-time device interrupt respectively; support communication between non-real-time process and real-time process; integrate many Linux drivers, which greatly reduces the workload of driving general external devices.
附图说明Description of drawings
图1为本发明实施例提供的一种AIRT-ROS虚拟网卡丢包解决方法的虚拟网卡的架构图;1 is an architecture diagram of a virtual network card of an AIRT-ROS virtual network card packet loss solution provided by an embodiment of the present invention;
图2为本发明实施例提供的一种AIRT-ROS虚拟网卡丢包解决方法的虚拟网卡接收报文驱动程序段流程图;2 is a flowchart of a virtual network card receiving message driver segment of an AIRT-ROS virtual network card packet loss solution provided by an embodiment of the present invention;
图3为本发明实施例提供的一种AIRT-ROS虚拟网卡丢包解决方法的虚拟网卡接收报文协议栈阶段流程图;3 is a flowchart of a protocol stack stage of a virtual network card receiving a packet of an AIRT-ROS virtual network card packet loss solution provided by an embodiment of the present invention;
图4为本发明实施例提供的一种AIRT-ROS虚拟网卡丢包解决方法的虚拟网卡发送数据包的流程图;4 is a flowchart of a virtual network card sending data packets of a solution method for AIRT-ROS virtual network card packet loss provided by an embodiment of the present invention;
图5为本发明实施例提供的一种AIRT-ROS虚拟网卡丢包解决方法的AIRT-ROS的架构图。FIG. 5 is an architecture diagram of AIRT-ROS according to an AIRT-ROS virtual network card packet loss solution provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面对本发明的实施例作详细说明,本实施例在以本发明技术方案为前提下进行实施,给出了详细的实施方式和具体的操作过程,但本发明的保护范围不限于下述的实施例。The embodiments of the present invention are described in detail below. This embodiment is implemented on the premise of the technical solution of the present invention, and provides a detailed implementation manner and a specific operation process, but the protection scope of the present invention is not limited to the following implementation. example.
本发明的AIRT-ROS虚拟网卡丢包解决方法分别包括虚拟网卡发送数据包过程的丢包解决方案以及虚拟网卡接收数据包过程的丢包解决方案,下面通过实例详细介绍。The AIRT-ROS virtual network card packet loss solution of the present invention respectively includes a packet loss solution in the process of sending data packets by the virtual network card and a packet loss solution in the process of receiving data packets by the virtual network card, which are described in detail below through examples.
一种AIRT-ROS虚拟网卡丢包解决方法,所述方法包括:An AIRT-ROS virtual network card packet loss solution, the method includes:
应用程序通过AIRT-ROS(Artificial Intelligence Real Time-RobotOperating System,人工智能实时机器人操作系统)向虚拟网卡发送数据包时,当虚拟网卡的接收队列超过最大传输单元值时,设置标志位并通知上层应用减慢发送速度;具体的,如图1所示,为虚拟网卡的架构图,所述虚拟网卡的驱动程序划分为四层结构,即网络协议接口层、网络设备接口层、网络驱动接口层、设备媒介层,通过在网络协议接口层和网络驱动接口层中设置钩子函数,预先判断虚拟网卡的接收队列的状态,通知上层应用程序控制传输报文速率。根据网络报文的流向,分别在报文作路由以前执行钩子函数,在报文转向另一个网络接口以前执行钩子函数,在报文流出以前执行钩子函数,在流入本地的报文作路由以后执行钩子函数以及在本地报文做流出路由前执行钩子函数,从而在整个数据传输过程中预判断虚拟网卡的接收、发送速率是否能满足上层应用程序需求。钩子函数经过处理后都将返回下列内容之一:继续正常的报文处理、将报文丢弃、由钩子函数处理了该报文,不要再继续传送、将报文入队,通常交由用户程序处理、再次调用该钩子函数,从而告知AIRT-ROS核心代码处理结果,以便对报文采取相应的动作。When the application sends data packets to the virtual network card through AIRT-ROS (Artificial Intelligence Real Time-Robot Operating System), when the receiving queue of the virtual network card exceeds the maximum transmission unit value, the flag is set and the upper-layer application is notified Slow down the sending speed; specifically, as shown in Figure 1, it is the architecture diagram of the virtual network card, and the driver of the virtual network card is divided into four-layer structure, namely the network protocol interface layer, the network device interface layer, the network driver interface layer, The device media layer, by setting hook functions in the network protocol interface layer and the network driver interface layer, pre-determines the status of the receiving queue of the virtual network card, and notifies the upper-layer application to control the transmission rate of the message. According to the flow direction of network packets, the hook function is executed before the packet is routed, the hook function is executed before the packet is transferred to another network interface, the hook function is executed before the packet flows out, and the inflowing local packet is executed after routing. The hook function and the hook function are executed before the outgoing routing of the local packet, so as to pre-determine whether the receiving and sending rates of the virtual network card can meet the requirements of the upper-layer application during the entire data transmission process. After the hook function is processed, it will return one of the following: continue normal packet processing, discard the packet, process the packet by the hook function, do not continue to transmit, queue the packet, usually handed over to the user program Process and call the hook function again to inform the AIRT-ROS core code of the processing result, so as to take corresponding actions on the message.
虚拟网卡接收数据包的流程分为两阶段,第一个阶段接收报文驱动程序段流程,第二个阶段接收报文协议栈阶段流程。首先介绍接收报文驱动程序段流程。如图2所示,为虚拟网卡接收报文驱动程序段流程图,数据包到达,启动中断服务程序,执行接收函数即AIRT_rx(),分配生成缓冲数据结构即skb结构,然后调用公共的报文接收函数,将缓冲数据结构放入cpu网络数据队列中,设置软中断,调用钩子函数判断报文速率是否超过最大传输单元值,并且设置标志位,等待cpu调度。The process of receiving data packets by the virtual network card is divided into two stages. The first stage receives the message driver segment process, and the second stage receives the message protocol stack stage process. First, the process of receiving the message driver segment is introduced. As shown in Figure 2, the flow chart of the driver segment for receiving the message for the virtual network card, the data packet arrives, the interrupt service routine is started, the receiving function is AIRT_rx(), the buffer data structure is allocated and generated, that is, the skb structure, and then the public message is called. The receiving function puts the buffered data structure into the CPU network data queue, sets the soft interrupt, calls the hook function to judge whether the message rate exceeds the maximum transmission unit value, and sets the flag bit to wait for the CPU to schedule.
第二个阶段接收报文协议栈阶段流程。如图3所示,为虚拟网卡接收报文协议栈阶段流程图,首先由调度程序按照登记的网络报文中断行为处理所有协议报文,将报文上送IP层处理,待通过有效性检查后,执行AIRT_HOOK(ip_rcv_finish)钩子函数判断报文速率,设置标志位,根据路由判断是否为组播报文,如果是组播,调用组播转发函数,如果是单播报文,则调用单播转发函数,按照IP报文序列号收集IP碎片,调用ip_local_deliver_finish钩子函数,重建缓冲数据结构,剥掉ip头,上送cpu处理,重新开始接收报文,接收所有报文后退出。The second stage receives the message protocol stack stage process. As shown in Figure 3, it is the flow chart of the protocol stack stage for the virtual network card to receive packets. First, the scheduler processes all protocol packets according to the registered network packet interruption behavior, and sends the packets to the IP layer for processing. The validity check is pending. After that, execute the AIRT_HOOK(ip_rcv_finish) hook function to judge the packet rate, set the flag bit, and judge whether it is a multicast packet according to the route. If it is multicast, call the multicast forwarding function. If it is a unicast packet, call unicast forwarding. The function collects IP fragments according to the IP packet serial number, calls the ip_local_deliver_finish hook function, rebuilds the buffer data structure, strips the IP header, sends it to the CPU for processing, restarts receiving packets, and exits after receiving all the packets.
虚拟网卡通过AIRT-ROS向应用程序发送数据包时,虚拟网卡的发送队列超过最大传输单元值时,设置标志位并通知上层应用减慢发送速度。如图1所示,所述虚拟网卡的驱动程序划分为四层结构,即网络协议接口层、网络设备接口层、网络驱动接口层、设备媒介层,通过在网络协议接口层和网络驱动接口层中设置钩子函数,预先判断虚拟网卡的发送队列的状态。钩子函数的设置以及执行过程同上,在此不做赘述。When the virtual network card sends data packets to the application through AIRT-ROS, when the sending queue of the virtual network card exceeds the maximum transmission unit value, the flag is set and the upper-layer application is notified to slow down the sending speed. As shown in Figure 1, the driver of the virtual network card is divided into a four-layer structure, namely the network protocol interface layer, the network device interface layer, the network driver interface layer, and the device media layer. Set a hook function in the NIC to pre-determine the status of the sending queue of the virtual network card. The setting and execution process of the hook function are the same as above, and will not be repeated here.
虚拟网卡发送数据包的流程图如图4所示,首先创建报文发送接口,然后决定路由信息,重建收发包的缓冲区域即重建缓冲数据结构,原报文头添加新IP头,按照路由返回结果设置IP头,调用LOCALOUT钩子函数判断报文速率,设置标志位,设置当前数据包的转发状态,在标记状态后执行后续发送数据包的步骤,判断报文和最大传输单元(MaximumTransmission Unit,MTU)的关系,如果缓冲数据结构大于等于MTU则数据包分片,小于MTU则报文不需要分片,最后发送请求进入网卡的缓冲队列等待调度后发送。The flow chart of the virtual network card sending data packets is shown in Figure 4. First, create a packet sending interface, then determine the routing information, rebuild the buffer area for sending and receiving packets, that is, rebuild the buffer data structure, add a new IP header to the original packet header, and return according to the route. As a result, the IP header is set, the LOCALOUT hook function is called to judge the packet rate, the flag bit is set, the forwarding status of the current packet is set, the subsequent steps of sending packets are performed after the status is marked, and the packet and the maximum transmission unit (MTU) are judged. ) relationship, if the buffered data structure is greater than or equal to the MTU, the packet will be fragmented, and if it is less than the MTU, the packet does not need to be fragmented, and finally the sending request enters the buffer queue of the network card and waits for scheduling to be sent.
本发明的虚拟网卡是应用于AIRT-ROS的,且虚拟网卡发送数据包和接收数据包均建立在AIRT-ROS的,下面5详细介绍AIRT-ROS,如图5所示,为AIRT-ROS的架构图,所述AIRT-ROS是基于AMP架构的多核双操作系统,其中一个操作系统是Linux,另一个操作系统是RTERS实时操作系统,所述AIRT-ROS包括Linux内核以及RTERS内核,所述Linux内核包括机器人操作系统(ROS,Robot Operating System)、第一超文本传输协议(HTTP,Hyper TextTransfer Protocol)、文件传输协议(FTP,File Transfer Protocol)以及第一本地高级可编程中断控制器(LAPIC,Local Advanced Programmable Interrupt Controller),所述RTERS内核包括机器人实时操作系统(RT-ROS,Real Time-Robot Operating System)、第二超文本传输协议(HTTP,Hyper Text Transfer Protocol)以及第二本地高级可编程中断控制器(LAPIC,Local Advanced Programmable Interrupt Controller),所述Linux内核与所述RTERS内核通过IPI接口连接,所述机器人操作系统与所述机器人实时操作系统通过虚拟交换机(vSwitch,Virtual Switch)进行虚拟连接,所述第一本地高级可编程中断控制器通过第一输入输出高级可编程中断控制器连接非实时设备以及虚拟网卡,所述第二本地高级可编程中断控制器通过第二输入输出高级可编程中断控制器连接实时设备,所述虚拟网卡通过AIRT-ROS向应用程序发送数据包,或者虚拟网卡通过AIRT-ROS接收应用程序发送的数据包。The virtual network card of the present invention is applied to AIRT-ROS, and the virtual network card sends data packets and receives data packets based on AIRT-ROS. The following 5 introduces AIRT-ROS in detail, as shown in Figure 5, for AIRT-ROS Architecture diagram, the AIRT-ROS is a multi-core dual operating system based on the AMP architecture, one operating system is Linux, the other operating system is the RTERS real-time operating system, the AIRT-ROS includes the Linux kernel and the RTERS kernel, the Linux The kernel includes a Robot Operating System (ROS, Robot Operating System), the first Hyper Text Transfer Protocol (HTTP, Hyper Text Transfer Protocol), the File Transfer Protocol (FTP, File Transfer Protocol), and the first Local Advanced Programmable Interrupt Controller (LAPIC, Local Advanced Programmable Interrupt Controller), the RTERS kernel includes a robot real-time operating system (RT-ROS, Real Time-Robot Operating System), a second hypertext transfer protocol (HTTP, Hyper Text Transfer Protocol) and a second local advanced programmable Interrupt controller (LAPIC, Local Advanced Programmable Interrupt Controller), the Linux kernel and the RTERS kernel are connected through an IPI interface, and the robot operating system and the robot real-time operating system are virtualized through a virtual switch (vSwitch, Virtual Switch). connection, the first local advanced programmable interrupt controller is connected to the non-real-time device and the virtual network card through the first input and output advanced programmable interrupt controller, and the second local advanced programmable interrupt controller is connected through the second input and output advanced programmable interrupt controller. The programming interrupt controller is connected to the real-time device, and the virtual network card sends data packets to the application program through AIRT-ROS, or the virtual network card receives data packets sent by the application program through AIRT-ROS.
通过以上技术方案,本发明提供的一种AIRT-ROS虚拟网卡丢包解决方法能够解决虚拟网卡数据丢包的问题,且本发明的虚拟网卡发送数据包和接收数据包均在AIRT-ROS系统上进行的,该系统允许Linux和RTERS操作系统分别执行非实时进程和实时进程;分别响应非实时设备中断和实时设备中断;支持非实时进程和实时进程之间通信;集成了Linux众多驱动,极大的减轻了驱动通用外部设备的工作量。AIRT-ROS在Linux系统的负载非常重的情况下,也不会影响RTERS对实时进程的执行速度。另一方面,AIRT-ROS在RTERS内核与Linux通讯连接,使得实时系统中可方便的调用ROS中封装的机器人控制算法,极大减轻了开发机器人控制算法的工作量。Through the above technical solutions, a solution method for AIRT-ROS virtual network card packet loss provided by the present invention can solve the problem of virtual network card data packet loss, and the virtual network card of the present invention sends and receives data packets on the AIRT-ROS system. The system allows Linux and RTERS operating systems to execute non-real-time processes and real-time processes respectively; respond to non-real-time device interrupts and real-time device interrupts respectively; support communication between non-real-time processes and real-time processes; It reduces the workload of driving general-purpose external devices. AIRT-ROS will not affect the execution speed of RTERS for real-time processes when the Linux system is under heavy load. On the other hand, AIRT-ROS communicates with Linux in the RTERS kernel, so that the robot control algorithm packaged in ROS can be easily called in the real-time system, which greatly reduces the workload of developing robot control algorithms.
在本发明实施例的一种具体实施方式中,当虚拟网卡A向目标虚拟网卡X发送数据包时,数据包从虚拟网卡A出发,依次经过设备B、设备C以及设备D抵达目标虚拟网卡X。In a specific implementation of the embodiment of the present invention, when the virtual network card A sends a data packet to the target virtual network card X, the data packet starts from the virtual network card A, passes through the device B, the device C and the device D in sequence to the target virtual network card X. .
当虚拟网卡A的发送队列超过最大传输单元值时,虚拟网卡A先向数据包传输链路上的各个转发节点发出带宽问询指令,即虚拟网卡A向设备B发出带宽问询指令,设备B向虚拟网卡A返回剩余带宽。When the sending queue of virtual network card A exceeds the maximum transmission unit value, virtual network card A first sends a bandwidth query command to each forwarding node on the data packet transmission link, that is, virtual network card A sends a bandwidth query command to device B, and device B sends a bandwidth query command to device B. Returns the remaining bandwidth to virtual NIC A.
虚拟网卡A在收到链路上的设备B的剩余带宽后,判断链路上的设备B的剩余带宽是否均大于待发送数据包的数据量,若是,虚拟网卡A使用备用链路将数据包发送至设备B,若否,设置标志位并通知上层应用减慢发送速度。设备B接收到数据包后再向设备C发出带宽问询指令,设备C向设备B返回其剩余带宽,设备B在收到链路上的设备C的剩余带宽后,判断链路上的设备C的剩余带宽是否均大于待发送数据包的数据量,若是,设备B使用备用链路将数据包发送至设备C,若否,设置标志位并通知设备B减慢发送速度;设备C接收到数据包后再向设备D发出带宽问询指令,设备D向设备C返回其剩余带宽,设备C在收到链路上的设备D的剩余带宽后,判断链路上的设备D的剩余带宽是否均大于待发送数据包的数据量,若是,设备C使用备用链路将数据包发送至设备D,若否,设置标志位并通知设备C减慢发送速度;设备D接收到数据包后再向虚拟网卡X发出带宽问询指令,虚拟网卡X向设备D返回其剩余带宽,设备D在收到链路上的虚拟网卡X的剩余带宽后,判断链路上的虚拟网卡X的剩余带宽是否均大于待发送数据包的数据量,若是,设备D使用备用链路将数据包发送至虚拟网卡X,若否,设置标志位并通知设备D减慢发送速度。After receiving the remaining bandwidth of device B on the link, virtual network card A determines whether the remaining bandwidth of device B on the link is greater than the data volume of the data packet to be sent. Send to device B, if not, set the flag and notify the upper application to slow down the sending speed. After receiving the data packet, device B sends a bandwidth query command to device C, and device C returns its remaining bandwidth to device B. After receiving the remaining bandwidth of device C on the link, device B determines the remaining bandwidth of device C on the link. Whether the remaining bandwidth is greater than the data volume of the data packet to be sent, if so, device B uses the backup link to send the data packet to device C; if not, sets the flag and informs device B to slow down the sending speed; device C receives the data After receiving the packet, it sends a bandwidth inquiry command to device D, and device D returns its remaining bandwidth to device C. After receiving the remaining bandwidth of device D on the link, device C determines whether the remaining bandwidth of device D on the link is equal. It is larger than the data volume of the data packet to be sent. If yes, device C uses the backup link to send the data packet to device D. If not, it sets the flag and informs device C to slow down the sending speed; Network card X sends a bandwidth query command, and virtual network card X returns its remaining bandwidth to device D. After receiving the remaining bandwidth of virtual network card X on the link, device D determines whether the remaining bandwidth of virtual network card X on the link is greater than or equal to The data volume of the data packet to be sent. If yes, device D uses the backup link to send the data packet to virtual network card X. If not, it sets the flag and informs device D to slow down the sending speed.
应用本发明上述实施例,在数据包传输链路上的各个设备的剩余带宽都满足需求时,并不减缓数据包的发送速度;只有在各个设备的剩余带宽并不都是满足需求时,才会减缓数据包的发送速度,保证了虚拟网卡发送数据包的实时性。Applying the above embodiments of the present invention, when the remaining bandwidth of each device on the data packet transmission link meets the requirements, the transmission speed of the data packet is not slowed down; only when the remaining bandwidth of each device does not meet the requirements. It will slow down the sending speed of data packets and ensure the real-time performance of data packets sent by the virtual network card.
进一步的,可以在虚拟网卡A的发送队列中的数据包的数据量达到最大传输单元的预设数量倍时,虚拟网卡A先向数据包传输链路上的转发节点发出带宽问询指令,且预设数量小于1。如果虚拟网卡A在收到链路上的位于其下一级的设备的剩余带宽后,判断链路上的该设备的剩余带宽是否大于待发送数据包的数据量,若虚拟网卡A使用备用链路将数据包发送至其下一级设备,若否,设置标志位并通知上层应用减慢发送速度。Further, when the data volume of the data packets in the sending queue of the virtual network card A reaches a preset number of times of the maximum transmission unit, the virtual network card A first sends a bandwidth inquiry instruction to the forwarding node on the data packet transmission link, and The preset number is less than 1. If virtual network card A receives the remaining bandwidth of the device at the next level on the link, it determines whether the remaining bandwidth of the device on the link is greater than the data volume of the data packet to be sent. If virtual network card A uses the backup link The channel sends the data packet to its next-level device, if not, sets the flag bit and informs the upper-layer application to slow down the sending speed.
例如,上层应用的数据包发送速度为15个/秒,在发送队列中的数据包的数据量达到最大传输单元的0.8倍时,将上层应用的数据包发送速度降至12个/秒,然后进行数据包的发送,由于上层应用响应指令需要一个过程,在此过程中,发送队列还会以原速度接收数据包,最大传输单元剩余的容量用于存储该过程中产生的数据包,进而可以避免在最大传输队列已经满的情况下,上层应用仍然以原速度发送数据包导致的最大传输队列无法进行数据包的存储导致的丢包的问题。For example, the data packet sending speed of the upper-layer application is 15/second. When the data volume of the data packets in the sending queue reaches 0.8 times the maximum transmission unit, the data packet sending speed of the upper-layer application is reduced to 12/second, and then Sending data packets, because the upper-layer application needs a process to respond to the command, during this process, the sending queue will also receive the data packets at the original speed, and the remaining capacity of the maximum transmission unit is used to store the data packets generated in the process, and then can To avoid the problem of packet loss caused by the fact that the upper-layer application still sends data packets at the original speed when the maximum transmission queue is full, the maximum transmission queue cannot store the data packets.
需要强调的是,最大传输队列已满的情况是指,虚拟网卡的发送队列超过最大传输单元值。It should be emphasized that the situation that the maximum transmission queue is full means that the sending queue of the virtual network card exceeds the maximum transmission unit value.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the protection of the present invention. within the range.
Claims (3)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010542160.4A CN111726201B (en) | 2020-06-15 | 2020-06-15 | AIRT-ROS virtual network card packet loss solving method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010542160.4A CN111726201B (en) | 2020-06-15 | 2020-06-15 | AIRT-ROS virtual network card packet loss solving method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111726201A true CN111726201A (en) | 2020-09-29 |
| CN111726201B CN111726201B (en) | 2023-09-12 |
Family
ID=72566721
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010542160.4A Active CN111726201B (en) | 2020-06-15 | 2020-06-15 | AIRT-ROS virtual network card packet loss solving method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111726201B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112445728A (en) * | 2020-11-30 | 2021-03-05 | 中科院软件研究所南京软件技术研究院 | Robot development board ROS communication system supporting various hardware interfaces |
| CN112799840A (en) * | 2021-01-29 | 2021-05-14 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for transmitting data |
Citations (25)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1303054A (en) * | 1999-10-28 | 2001-07-11 | 英业达集团(上海)电子技术有限公司 | Virtual network device and its communication method |
| CN1633130A (en) * | 2005-01-14 | 2005-06-29 | 清华大学 | Virtual interface structure user layer network communication system based on hardware support |
| CN101370009A (en) * | 2008-03-12 | 2009-02-18 | 武汉理工大学 | Construction Method of Virtual Network Block Framework Based on Linux Kernel Network Subsystem |
| US20090063698A1 (en) * | 2007-09-04 | 2009-03-05 | Aspera, Inc. | Method and system for aggregate bandwith control |
| CN101557420A (en) * | 2009-03-31 | 2009-10-14 | 北京航空航天大学 | Realization method of high-efficiency network communication of a virtual machine monitor |
| CN101887379A (en) * | 2010-06-18 | 2010-11-17 | 北京航空航天大学 | A Wireless Channel Simulation Method Based on Virtual Network Card |
| CN102325082A (en) * | 2011-07-19 | 2012-01-18 | 天津理工大学 | A Nomadic Application-Oriented Network Congestion Control Method |
| CN102711173A (en) * | 2012-06-10 | 2012-10-03 | 姚国良 | Data queue length-based channel access method for wireless sensor network |
| CN103299679A (en) * | 2012-06-27 | 2013-09-11 | 华为技术有限公司 | Access control method and device |
| CN103365758A (en) * | 2013-08-05 | 2013-10-23 | 北京搜狐新媒体信息技术有限公司 | Process monitoring method and system in virtualization environment |
| CN104104481A (en) * | 2013-04-01 | 2014-10-15 | 中兴通讯股份有限公司 | Wireless local area network message sending method and device |
| CN104219247A (en) * | 2014-09-22 | 2014-12-17 | 中国科学院上海微系统与信息技术研究所 | A method of wireless multimedia sensor network accessing IP network |
| CN104506548A (en) * | 2014-12-31 | 2015-04-08 | 北京天融信科技有限公司 | Data packet redirecting device as well as safety protection method and system for virtual machine |
| CN104539549A (en) * | 2014-12-30 | 2015-04-22 | 天津市锦标科技有限公司 | Data message processing method based on high-density network flow |
| CN105278940A (en) * | 2014-07-08 | 2016-01-27 | 北京航空航天大学 | An application framework for robot hybrid system based on multi-core processor architecture |
| CN106095580A (en) * | 2016-06-14 | 2016-11-09 | 上海交通大学 | A kind of efficient sending method of packet virtualizing network interface card for half |
| CN106453126A (en) * | 2016-11-29 | 2017-02-22 | 郑州云海信息技术有限公司 | Virtual machine traffic control method and device |
| WO2017052061A1 (en) * | 2015-09-21 | 2017-03-30 | 주식회사 레인보우 | Gpos-connected real-time robot control system and real-time device control system using same |
| US20170203436A1 (en) * | 2014-07-08 | 2017-07-20 | Hongxing Wei | Robotic hybrid system application framework based on multi-core processor architecture |
| CN108713311A (en) * | 2016-04-29 | 2018-10-26 | 华为技术有限公司 | Transmission method, device and system for transmission control protocol TCP message |
| CN109558174A (en) * | 2018-11-28 | 2019-04-02 | 江苏艾萨克机器人股份有限公司 | RTOS-GPOS dual operating systems robot controller based on ZYNQ dual core processor |
| CN110247859A (en) * | 2019-06-17 | 2019-09-17 | 哈工大机器人(合肥)国际创新研究院 | A kind of data transmission method for uplink and device based on AIRT-ROS node |
| CN110278157A (en) * | 2018-03-14 | 2019-09-24 | 华为技术有限公司 | Jamming control method and the network equipment |
| CN110730142A (en) * | 2019-10-14 | 2020-01-24 | 安徽工业大学 | An Adaptive Scheduling Method for Data Center Streams in the Case of Agnostic Information |
| EP3646997A2 (en) * | 2018-09-12 | 2020-05-06 | Erle Robotics, S.L. | Embedded open robot controller and robot control method employing same |
-
2020
- 2020-06-15 CN CN202010542160.4A patent/CN111726201B/en active Active
Patent Citations (25)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1303054A (en) * | 1999-10-28 | 2001-07-11 | 英业达集团(上海)电子技术有限公司 | Virtual network device and its communication method |
| CN1633130A (en) * | 2005-01-14 | 2005-06-29 | 清华大学 | Virtual interface structure user layer network communication system based on hardware support |
| US20090063698A1 (en) * | 2007-09-04 | 2009-03-05 | Aspera, Inc. | Method and system for aggregate bandwith control |
| CN101370009A (en) * | 2008-03-12 | 2009-02-18 | 武汉理工大学 | Construction Method of Virtual Network Block Framework Based on Linux Kernel Network Subsystem |
| CN101557420A (en) * | 2009-03-31 | 2009-10-14 | 北京航空航天大学 | Realization method of high-efficiency network communication of a virtual machine monitor |
| CN101887379A (en) * | 2010-06-18 | 2010-11-17 | 北京航空航天大学 | A Wireless Channel Simulation Method Based on Virtual Network Card |
| CN102325082A (en) * | 2011-07-19 | 2012-01-18 | 天津理工大学 | A Nomadic Application-Oriented Network Congestion Control Method |
| CN102711173A (en) * | 2012-06-10 | 2012-10-03 | 姚国良 | Data queue length-based channel access method for wireless sensor network |
| CN103299679A (en) * | 2012-06-27 | 2013-09-11 | 华为技术有限公司 | Access control method and device |
| CN104104481A (en) * | 2013-04-01 | 2014-10-15 | 中兴通讯股份有限公司 | Wireless local area network message sending method and device |
| CN103365758A (en) * | 2013-08-05 | 2013-10-23 | 北京搜狐新媒体信息技术有限公司 | Process monitoring method and system in virtualization environment |
| US20170203436A1 (en) * | 2014-07-08 | 2017-07-20 | Hongxing Wei | Robotic hybrid system application framework based on multi-core processor architecture |
| CN105278940A (en) * | 2014-07-08 | 2016-01-27 | 北京航空航天大学 | An application framework for robot hybrid system based on multi-core processor architecture |
| CN104219247A (en) * | 2014-09-22 | 2014-12-17 | 中国科学院上海微系统与信息技术研究所 | A method of wireless multimedia sensor network accessing IP network |
| CN104539549A (en) * | 2014-12-30 | 2015-04-22 | 天津市锦标科技有限公司 | Data message processing method based on high-density network flow |
| CN104506548A (en) * | 2014-12-31 | 2015-04-08 | 北京天融信科技有限公司 | Data packet redirecting device as well as safety protection method and system for virtual machine |
| WO2017052061A1 (en) * | 2015-09-21 | 2017-03-30 | 주식회사 레인보우 | Gpos-connected real-time robot control system and real-time device control system using same |
| CN108713311A (en) * | 2016-04-29 | 2018-10-26 | 华为技术有限公司 | Transmission method, device and system for transmission control protocol TCP message |
| CN106095580A (en) * | 2016-06-14 | 2016-11-09 | 上海交通大学 | A kind of efficient sending method of packet virtualizing network interface card for half |
| CN106453126A (en) * | 2016-11-29 | 2017-02-22 | 郑州云海信息技术有限公司 | Virtual machine traffic control method and device |
| CN110278157A (en) * | 2018-03-14 | 2019-09-24 | 华为技术有限公司 | Jamming control method and the network equipment |
| EP3646997A2 (en) * | 2018-09-12 | 2020-05-06 | Erle Robotics, S.L. | Embedded open robot controller and robot control method employing same |
| CN109558174A (en) * | 2018-11-28 | 2019-04-02 | 江苏艾萨克机器人股份有限公司 | RTOS-GPOS dual operating systems robot controller based on ZYNQ dual core processor |
| CN110247859A (en) * | 2019-06-17 | 2019-09-17 | 哈工大机器人(合肥)国际创新研究院 | A kind of data transmission method for uplink and device based on AIRT-ROS node |
| CN110730142A (en) * | 2019-10-14 | 2020-01-24 | 安徽工业大学 | An Adaptive Scheduling Method for Data Center Streams in the Case of Agnostic Information |
Non-Patent Citations (6)
| Title |
|---|
| 刘明剑等: "基于信道拥塞代价计算的车联网自适应消息发送速率控制方法", 《通信学报》 * |
| 刘明剑等: "基于信道拥塞代价计算的车联网自适应消息发送速率控制方法", 《通信学报》, no. 10, 25 October 2016 (2016-10-25) * |
| 刘正飞: ""自适应主动队列管理算法研究"", 《中国博士学位论文全文数据库信息科技辑》 * |
| 刘正飞: ""自适应主动队列管理算法研究"", 《中国博士学位论文全文数据库信息科技辑》, 1 June 2019 (2019-06-01) * |
| 赖明澈等: "具有拥塞缓解策略的动态虚拟通道研究及其VLSI实现", 《计算机学报》 * |
| 赖明澈等: "具有拥塞缓解策略的动态虚拟通道研究及其VLSI实现", 《计算机学报》, no. 11, 15 November 2008 (2008-11-15) * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112445728A (en) * | 2020-11-30 | 2021-03-05 | 中科院软件研究所南京软件技术研究院 | Robot development board ROS communication system supporting various hardware interfaces |
| CN112445728B (en) * | 2020-11-30 | 2023-07-21 | 中科院软件研究所南京软件技术研究院 | A robot development board ROS communication system that supports multiple hardware interfaces |
| CN112799840A (en) * | 2021-01-29 | 2021-05-14 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for transmitting data |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111726201B (en) | 2023-09-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10116574B2 (en) | System and method for improving TCP performance in virtualized environments | |
| US10868767B2 (en) | Data transmission method and apparatus in optoelectronic hybrid network | |
| US8886821B1 (en) | Failover and migration for full-offload network interface devices | |
| US10355997B2 (en) | System and method for improving TCP performance in virtualized environments | |
| EP1175065A2 (en) | Method and system for improving network performance enhancing proxy architecture with gateway redundancy | |
| JP5629954B2 (en) | Apparatus, method, and program capable of interrupting at least partial frame transmission | |
| JP2000036839A (en) | Flow control method, pause control system and node | |
| EP1782602A1 (en) | Apparatus and method for supporting connection establishment in an offload of network protocol processing | |
| US12132791B2 (en) | Communication protocol, and a method thereof for accelerating artificial intelligence processing tasks | |
| JP3807614B2 (en) | Packet order control method in multilink communication system | |
| EP3739784A1 (en) | Data packet sending method and related device | |
| CN101707599B (en) | DSP based Ethernet communication method in fault recording system | |
| US8838782B2 (en) | Network protocol processing system and network protocol processing method | |
| JP3214454B2 (en) | Packet processing device with built-in program | |
| CN103152251A (en) | Method and device for processing message | |
| CN111726201A (en) | A solution for AIRT-ROS virtual network card packet loss | |
| CN116723162B (en) | Network first packet processing method, system, device, medium and heterogeneous equipment | |
| JP4964666B2 (en) | Computer, program and method for switching redundant communication paths | |
| JP2020191621A (en) | Control method of virtual machine network qos and device of the same | |
| US11522762B2 (en) | Coordination device and method for providing control applications via a communication network for transmitting time-critical data | |
| CN116760504A (en) | Session synchronization method, device, service node, terminal and readable storage medium | |
| TWI724670B (en) | Fault-tolerant system and control method thereof | |
| CN118714183B (en) | Message transmission method and device | |
| EP1966950A2 (en) | Processing received data | |
| CN121125009A (en) | Method for optimizing Transmission Control Protocol (TCP) data stream and related device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20220921 Address after: 236000 room 316, building 3, Zone C, intelligent technology park, No. 3963 Susong Road, Hefei Economic and Technological Development Zone, Anhui Province Applicant after: Hefei Hagong Xuanyuan Intelligent Technology Co.,Ltd. Address before: Room 6012, Haiheng building, No.6 Cuiwei Road, Hefei Economic and Technological Development Zone, Anhui Province Applicant before: HRG INTERNATIONAL INSTITUTE FOR RESEARCH & INNOVATION |
|
| TA01 | Transfer of patent application right | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |