CN106603322B - A message sending and receiving method and network device - Google Patents
A message sending and receiving method and network device Download PDFInfo
- Publication number
- CN106603322B CN106603322B CN201510682620.2A CN201510682620A CN106603322B CN 106603322 B CN106603322 B CN 106603322B CN 201510682620 A CN201510682620 A CN 201510682620A CN 106603322 B CN106603322 B CN 106603322B
- Authority
- CN
- China
- Prior art keywords
- message
- network device
- packet
- service flow
- time period
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及通信领域,特别涉及一种报文发送、接收方法及网络设备。The present invention relates to the field of communications, and in particular, to a message sending and receiving method and network equipment.
背景技术Background technique
虚拟扩展局域网(英文:Virtual Extensible local area network,VXLAN)是一种覆盖(英文:overlay)的网络技术,可用于改善大型云计算部署的扩展性问题。VXLAN技术使用类似虚拟局域网(英文:virtual local area network,VLAN)的封装技术,在开放式系统互联(英文:Open Systems Interconnection,OSI)4层的用户数据报协议(英文:UserDatagram Protocol,UDP)报文内用特定的目的UDP端口号封装基于媒体访问控制(英文:media access control,MAC)的二层以太网帧。Virtual Extensible Local Area Network (English: Virtual Extensible local area network, VXLAN) is an overlay (English: overlay) network technology that can be used to improve the scalability of large-scale cloud computing deployments. VXLAN technology uses the encapsulation technology similar to virtual local area network (VLAN), in the Open Systems Interconnection (English: Open Systems Interconnection, OSI) layer 4 User Datagram Protocol (English: UserDatagram Protocol, UDP) report In the text, a Layer 2 Ethernet frame based on media access control (English: media access control, MAC) is encapsulated with a specific destination UDP port number.
VXLAN具有以下特点:VXLAN has the following characteristics:
24位的VXLAN网络标识符(英文:VXLAN Network Identifier,VNI),可用于指示通信系统中的虚拟机(英文:virtual machine,VM)所在的独立的VXLAN overlay网络,位于不同的VXLAN overlay网络中的虚拟机之间无法通信。24-bit VXLAN Network Identifier (English: VXLAN Network Identifier, VNI), which can be used to indicate the independent VXLAN overlay network where the virtual machine (English: virtual machine, VM) in the communication system is located, located in different VXLAN overlay networks. Communication between virtual machines is not possible.
在VXLAN网络中,各个租户可以独立使用各自的业务。在业务的使用过程中,可能涉及到对网络性能的测试,以在了解当前网络的性能的基础上确定如何使用业务。In a VXLAN network, each tenant can use their own services independently. In the process of using the service, it may involve testing the network performance, so as to determine how to use the service on the basis of knowing the performance of the current network.
目前,测试网络性能时,只能测试物理网络,然而各个租户来说,各自的网络状况可能是相同的。可见,对物理网络进行性能测试的粒度较粗,得到的测试结果不够准确。Currently, when testing network performance, only the physical network can be tested. However, the network conditions of each tenant may be the same. It can be seen that the granularity of the performance test on the physical network is relatively coarse, and the obtained test results are not accurate enough.
发明内容SUMMARY OF THE INVENTION
本申请提供一种报文发送、接收方法及网络设备,用于解决目前在对网络进行性能测试时粒度较粗的技术问题。The present application provides a method for sending and receiving a message and a network device, which are used to solve the technical problem of relatively coarse granularity when performing performance testing on a network at present.
第一方面,提供一种报文发送方法,包括:In a first aspect, a method for sending a message is provided, including:
第一网络设备接收第一报文;the first network device receives the first packet;
所述第一网络设备在所述第一报文外封装VXLAN头及外层IP头,以得到第二报文;其中,所述VXLAN头中的预留位被设置为第一标记值,所述第一标记值用于指示所述第一网络设备发送所述第二报文的时间处于第一时段,所述第一时段为所述第一网络设备统计所述第二报文所在业务流的报文数量的多个统计时段中的一个;The first network device encapsulates the VXLAN header and the outer IP header outside the first message to obtain the second message; wherein, the reserved bit in the VXLAN header is set as the first mark value, so The first tag value is used to indicate that the time when the first network device sends the second packet is in the first time period, and the first time period is the service flow where the first network device counts the second packet. One of multiple statistical periods for the number of packets;
所述第一网络设备发送所述第二报文。The first network device sends the second packet.
VXLAN头中的预留位被设置为用于指示发送第二报文的时间位于哪个统计时段,从而可以根据报文的VXLAN头里的预留位来区分报文。在进行网络性能测量时,可以测试VXLAN网络在不同的统计时段内的性能,而不是只能测试物理网络,细化了对网络性能的测试粒度。The reserved bits in the VXLAN header are set to indicate which statistical period the second packet is sent in, so that the packets can be distinguished according to the reserved bits in the VXLAN header of the packets. When performing network performance measurement, the performance of the VXLAN network in different statistical periods can be tested, instead of only testing the physical network, which refines the test granularity of network performance.
结合第一方面,在第一方面的第一种可能的实现方式中,所述方法还包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the method further includes:
所述第一网络设备确定在所述第一时段内发送的所述第二报文所在业务流中的报文的数量;determining, by the first network device, the number of packets in the service flow where the second packet is sent within the first time period;
所述第一网络设备向控制设备发送所述确定的发送的报文的数量。The first network device sends the determined number of sent packets to the control device.
若要统计第二报文所在的业务流在第一时段内的丢包数量,那么,第一网络设备可以统计在第一时段内发送的第二报文所在的业务流的报文的数量,并将统计得到的数量发送给控制设备。另外,接收第二报文所在的业务流的报文的网络设备也可以将第一时段内接收的第二报文所在的业务流的报文的数量发送给控制设备,从而控制设备就可以计算得到第二报文所在的业务流在第一时段内的丢包数量。To count the number of lost packets of the service flow in which the second packet is located in the first time period, the first network device may count the number of packets of the service flow in which the second packet is sent during the first time period, And send the counted number to the control device. In addition, the network device that receives the packets of the service flow in which the second packet is located may also send the number of packets of the service flow in which the second packet is received within the first period to the control device, so that the control device can calculate Obtain the number of lost packets in the first period of time in the service flow where the second packet is located.
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述方法还包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the method further includes:
所述第一网络设备接收第二网络设备发送的第三报文;其中,所述第三报文的VXLAN头中的预留位被设置为第二标记值;receiving, by the first network device, a third packet sent by the second network device; wherein, a reserved bit in the VXLAN header of the third packet is set as a second flag value;
所述第一网络设备根据所述第三报文的VXLAN头中的所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段,所述第二时段为所述第一网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个。The first network device determines, according to the second tag value in the VXLAN header of the third packet, that the time when the second network device sends the third packet is in a second time period, and the second time period One of a plurality of statistical periods for the first network device to count the number of packets in the service flow where the third packet is located.
对于一个业务流来说,第一网络设备可以是源设备,而对于另外的业务流来说,第一网络设备也可以是目的设备。第一网络设备在作为目的设备时,可以接收另外的源设备发送的报文,这些报文里也可能有测量报文,第一网络设备通过确定接收的报文的VXLAN头中的预留位是否被标记就可以确定哪些报文是测量报文,即,被标记的就是测量报文,否则就是普通报文。For one service flow, the first network device may be the source device, and for another service flow, the first network device may also be the destination device. When the first network device acts as a destination device, it can receive packets sent by other source devices, and these packets may also contain measurement packets. The first network device determines the reserved bits in the VXLAN header of the received packets by determining Whether it is marked or not can determine which packets are measurement packets, that is, the marked packets are measurement packets, otherwise, they are ordinary packets.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述方法还包括:With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the method further includes:
所述第一网络设备确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量;determining, by the first network device, the number of packets in the service flow where the third packet is received within the second time period;
所述第一网络设备向控制设备发送所述确定的接收的报文的数量。The first network device sends the determined number of received packets to the control device.
第一网络设备作为目的设备时,可以从接收到第一个第三报文所在的业务流的报文开始统计在第二时段内接收的第三报文所在的业务流的且具有与第三报文相同的标记的报文的数量,这样,第一网络设备可以将统计得到的数量发送给控制设备,同样的,发送第三报文所在的业务流的报文的网络设备也可以将第一时段内发送的第三报文所在的业务流的报文的数量发送给控制设备,从而控制设备就可以计算得到第三报文所在的业务流在第二时段内的丢包数量。When the first network device is used as the destination device, it can start from receiving the packet of the service flow in which the first third packet is located, and count the service flow in which the third packet received in the second time period is located and has the same value as the third packet. In this way, the first network device can send the counted number to the control device. Similarly, the network device that sends the packets of the service flow in which the third packet is located can also send the number of the first network device to the control device. The number of packets of the service flow in which the third packet is located in a period of time is sent to the control device, so that the control device can calculate the number of lost packets of the service flow in which the third packet is located in the second period of time.
第二方面,提供一种报文接收方法,包括:In a second aspect, a method for receiving a message is provided, including:
第一网络设备接收第二网络设备发送的第三报文;其中,所述第三报文的VXLAN头中的预留位被设置为第二标记值;The first network device receives the third packet sent by the second network device; wherein, the reserved bit in the VXLAN header of the third packet is set as the second flag value;
若所述第三报文为所述第一网络设备接收的第一个具有所述第二标记值的报文,则所述第一网络设备根据所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段;所述第二时段为所述第一网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个;If the third packet is the first packet with the second tag value received by the first network device, the first network device determines the second network device according to the second tag value The time when the device sends the third packet is in a second period; the second period is one of multiple statistical periods in which the first network device counts the number of packets in the service flow where the third packet is located;
所述第一网络设备从接收所述第三报文开始计时,以统计在所述第二时段内接收的所述第三报文所在业务流中的报文的数量。The first network device starts timing from receiving the third packet to count the number of packets in the service flow where the third packet is received within the second time period.
第一网络设备通过确定接收的报文的VXLAN头中的预留位是否被标记就可以确定哪些报文是测量报文,即,被标记的就是测量报文,否则就是普通报文。如果第三报文为第一网络设备接收的第一个具有第二标记值的报文,那么第一网络设备除了根据第二标记值确定第二网络设备发送第三报文的时间处于第二时段之外,还可以从接收第三报文开始计时,以统计在第二时段内接收的第三报文所在业务流中的报文的数量,从而控制设备可以获得第三报文所在的业务流在第二时段内的丢包数量。The first network device can determine which packets are measurement packets by determining whether the reserved bits in the VXLAN header of the received packets are marked, that is, the marked packets are measurement packets, otherwise they are ordinary packets. If the third packet is the first packet with the second tag value received by the first network device, the first network device determines that the time when the second network device sends the third packet is in the second In addition to the time period, the time can also be counted from the time when the third packet is received to count the number of packets in the service flow where the third packet is received within the second time period, so that the control device can obtain the service where the third packet is located. The number of packets dropped by the flow during the second period.
结合第二方面,在第二方面的第一种可能的实现方式中,在所述第一网络设备从接收所述第三报文开始计时之后,还包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, after the first network device starts timing from receiving the third packet, the method further includes:
所述第一网络设备接收所述第二网络设备发送的第四报文;receiving, by the first network device, a fourth packet sent by the second network device;
所述第一网络设备根据所述第四报文的VXLAN头确定所述第四报文的VXLAN头中的预留位被设置为所述第二标记值;The first network device determines, according to the VXLAN header of the fourth packet, that the reserved bit in the VXLAN header of the fourth packet is set as the second flag value;
所述第一网络设备将在所述第二时段内接收的所述第三报文所在业务流中的报文的数量加1。The first network device adds 1 to the number of packets in the service flow where the third packet is received within the second time period.
在这种实现方式中,提供了一种统计报文数量的方式,即,第一网络设备每接收到一个报文,都可以确定该报文是否属于第三报文所在的业务流以及该报文是否具有第二标记值。若第一网络设备确定第四报文属于第三报文所在的业务流且具有第二标记值,那么第一网络设备可以将统计的在第二时段内接收的第三报文所在业务流中的且具有第二标记值的报文的数量加1。In this implementation manner, a method of counting the number of packets is provided, that is, each time the first network device receives a packet, it can determine whether the packet belongs to the service flow where the third packet is located and whether the packet belongs to the service flow of the third packet. Whether the text has a second tag value. If the first network device determines that the fourth packet belongs to the service flow where the third packet is located and has the second tag value, the first network device may count the third packet received within the second time period in the service flow where the third packet is located. The number of packets with the second tag value is incremented by 1.
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述方法还包括:With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the method further includes:
所述第一网络设备确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量;determining, by the first network device, the number of packets in the service flow where the third packet is received within the second time period;
所述第一网络设备向控制设备发送所述确定的接收的报文的数量。The first network device sends the determined number of received packets to the control device.
即,第一网络设备可以统计在第二时段内接收的第三报文所在的业务流的且具有与第三报文相同的标记的报文的数量,第一网络设备可以将统计得到的数量发送给控制设备,同样的,发送第三报文所在的业务流的报文的网络设备也可以将第一时段内发送的第三报文所在的业务流的报文的数量发送给控制设备,从而控制设备就可以计算得到第三报文所在的业务流在第二时段内的丢包数量。That is, the first network device may count the number of packets with the same label as the third packet in the service flow of the third packet received in the second time period, and the first network device may count the number obtained by sent to the control device, and similarly, the network device that sends the packets of the service flow in which the third packet is located may also send the number of packets of the service flow in which the third packet is located within the first period of time to the control device, Therefore, the control device can calculate and obtain the number of lost packets of the service flow in which the third packet is located in the second time period.
第三方面,提供一种网络设备,包括第一接口、转发芯片及第二接口;其中,所述转发芯片用于:In a third aspect, a network device is provided, including a first interface, a forwarding chip, and a second interface; wherein the forwarding chip is used for:
通过所述第一接口接收第一报文;receiving a first packet through the first interface;
在所述第一报文外封装VXLAN头及外层IP头,以得到第二报文;其中,所述VXLAN头中的预留位被设置为第一标记值,所述第一标记值用于指示所述网络设备发送所述第二报文的时间处于第一时段,所述第一时段为所述网络设备统计所述第二报文所在业务流的报文数量的多个统计时段中的一个;A VXLAN header and an outer IP header are encapsulated outside the first packet to obtain a second packet; wherein the reserved bit in the VXLAN header is set as a first tag value, and the first tag value is When the time at which the network device is instructed to send the second packet is in a first period, the first period is in a plurality of statistical periods in which the network device counts the number of packets of the service flow in which the second packet is located one of;
通过所述第二接口发送所述第二报文。The second packet is sent through the second interface.
结合第三方面,在第三方面的第一种可能的实现方式中,所述网络设备还包括第三接口;所述转发芯片还用于:With reference to the third aspect, in a first possible implementation manner of the third aspect, the network device further includes a third interface; the forwarding chip is further configured to:
确定在所述第一时段内发送的所述第二报文所在业务流中的报文的数量;determining the number of packets in the service flow where the second packet is sent within the first time period;
通过所述第三接口向控制设备发送所述确定的发送的报文的数量。The determined number of sent packets is sent to the control device through the third interface.
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述转发芯片还用于:With reference to the third aspect or the first possible implementation manner of the third aspect, in the second possible implementation manner of the third aspect, the forwarding chip is further used for:
通过所述第二接口接收第二网络设备发送的第三报文;其中,所述第三报文的VXLAN头中的预留位被设置为第二标记值;Receive a third packet sent by the second network device through the second interface; wherein, the reserved bit in the VXLAN header of the third packet is set as the second flag value;
根据所述第三报文的VXLAN头中的所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段,所述第二时段为所述网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个。According to the second tag value in the VXLAN header of the third packet, it is determined that the time when the second network device sends the third packet is in the second time period, and the second time period is the statistics of the network device One of multiple statistical periods for the number of packets in the service flow where the third packet is located.
结合第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,所述转发芯片还用于:With reference to the second possible implementation manner of the third aspect, in the third possible implementation manner of the third aspect, the forwarding chip is further used for:
确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量;determining the number of packets in the service flow where the third packet is received within the second time period;
通过所述第二接口向控制设备发送所述确定的接收的报文的数量。The determined number of received packets is sent to the control device through the second interface.
第四方面,提供一种网络设备,包括接口及转发芯片;其中所述转发芯片用于:In a fourth aspect, a network device is provided, including an interface and a forwarding chip; wherein the forwarding chip is used for:
通过所述接口接收第二网络设备发送的第三报文;所述第三报文的VXLAN头中的预留位被设置为第二标记值;Receive a third packet sent by the second network device through the interface; the reserved bit in the VXLAN header of the third packet is set as the second flag value;
若所述第三报文为所述网络设备接收的第一个具有所述第二标记值的报文,则根据所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段;所述第二时段为所述网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个;If the third packet is the first packet with the second tag value received by the network device, determining that the second network device sends the third packet according to the second tag value The time is in the second period; the second period is one of multiple statistical periods in which the network device counts the number of packets of the service flow where the third packet is located;
从接收所述第三报文开始计时,以统计在所述第二时段内接收的所述第三报文所在业务流中的报文的数量。Timing starts from receiving the third packet to count the number of packets in the service flow where the third packet is received within the second time period.
结合第四方面,在第四方面的第一种可能的实现方式中,所述转发芯片还用于:With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the forwarding chip is further used for:
在从接收所述第三报文开始计时之后,通过所述接口接收所述第二网络设备发送的第四报文;receiving, through the interface, a fourth packet sent by the second network device after timing from receiving the third packet;
根据所述第四报文的VXLAN头确定所述第四报文的VXLAN头中的预留位被设置为所述第二标记值;将在所述第二时段内接收的所述第三报文所在业务流中的报文的数量加1。It is determined according to the VXLAN header of the fourth packet that the reserved bit in the VXLAN header of the fourth packet is set as the second flag value; the third packet to be received within the second time period Add 1 to the number of packets in the service flow where the text belongs.
结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述转发芯片还用于:With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in the second possible implementation manner of the fourth aspect, the forwarding chip is further used for:
确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量;determining the number of packets in the service flow where the third packet is received within the second time period;
通过所述接口向控制设备发送所述确定的接收的报文的数量。The determined number of received packets is sent to the control device through the interface.
第五方面,提供一种用于进行报文发送的网络设备,该网络设备包括用于执行第一方面的方法的模块。In a fifth aspect, a network device for sending a message is provided, the network device including a module for performing the method of the first aspect.
第六方面,提供一种用于进行报文接收的网络设备,该网络设备包括用于执行第二方面的方法的模块。In a sixth aspect, a network device for receiving a message is provided, the network device including a module for performing the method of the second aspect.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所介绍的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the embodiments of the present invention. Obviously, the drawings introduced below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本发明实施例中VXLAN网络的一种场景示意图;FIG. 1 is a schematic diagram of a scenario of a VXLAN network in an embodiment of the present invention;
图2为本发明实施例中报文发送方法的流程图;2 is a flowchart of a method for sending a message in an embodiment of the present invention;
图3为本发明实施例中第二报文的结构示意图;3 is a schematic structural diagram of a second packet in an embodiment of the present invention;
图4为本发明实施例中第一网络设备的结构示意图。FIG. 4 is a schematic structural diagram of a first network device in an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述。To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention.
以下,对本发明中的部分用语进行解释说明。Hereinafter, some terms in the present invention will be explained.
1)网络设备,可以是交换机(英文:switch)或路由器(英文:router)等网络中的物理设备,也可以是虚拟交换机等网络中的虚拟设备。1) The network device may be a physical device in a network such as a switch (English: switch) or a router (English: router), or a virtual device in a network such as a virtual switch.
2)控制设备,控制设备可以是一个独立的设备,比如可以是服务器或者路由器等设备,或者也可以是位于其他设备中的功能模块,例如可以是位于服务器或路由器等设备中的功能模块,只要控制设备能与网络设备通信即可。2) Control device. The control device can be an independent device, such as a server or a router, or a functional module located in other devices, such as a functional module located in a server or router, as long as The control device can communicate with the network device.
3)业务流。定义一组特征,凡是满足这一组特征的报文就属于一个业务流。比如,可以用一个报文的头的元组作为一组特征,元组的值相同的报文就属于同一个业务流。例如,作为特征的元组为五元组,该五元组可以包括:源网际协议(英文:Internet Protocol,IP)地址、源端口号、目的IP地址、目的端口号和传输层协议类型。3) business flow. A set of characteristics is defined, and all packets that satisfy this set of characteristics belong to a service flow. For example, a tuple in the header of a packet can be used as a set of features, and packets with the same tuple value belong to the same service flow. For example, the characteristic tuple is a quintuple, and the quintuple may include: source Internet Protocol (English: Internet Protocol, IP) address, source port number, destination IP address, destination port number, and transport layer protocol type.
4)“多个”是指两个或两个以上。4) "Plural" means two or more.
首先介绍一下本发明的应用场景。First, the application scenarios of the present invention are introduced.
请参见图1,为本发明实施例中的一种可能的VXLAN网络示意图。图1中的VXLAN网络包括A~I等设备,其中设备B~G为网络设备,设备A为控制设备,设备H为通过设备D连入网络的服务器,例如在设备H中运行有虚拟机VM1,设备I为通过设备G连入网络的服务器,例如在设备I中运行有虚拟机VM2。从图1中的连接关系可以看出,控制设备A能够与其中每个网络设备通信。可替换地,控制设备也可以只与部分网络设备通信。Please refer to FIG. 1 , which is a schematic diagram of a possible VXLAN network in an embodiment of the present invention. The VXLAN network in Figure 1 includes devices A to I, among which devices B to G are network devices, device A is a control device, and device H is a server connected to the network through device D. For example, device H runs a virtual machine VM1 , the device I is a server connected to the network through the device G, for example, a virtual machine VM2 runs in the device I. It can be seen from the connection relationship in FIG. 1 that the control device A can communicate with each of the network devices. Alternatively, the control device can also communicate with only some of the network devices.
例如,虚拟机VM1要向虚拟机VM2发送报文1,则虚拟机VM1通过设备H将报文1发送给设备D。设备D收到报文1后,根据报文1的目的地址等信息,通过查表等方式确定报文1的目的VXLAN网关,例如报文1的目的VXLAN网关为设备G,那么设备D为报文1添加VXLAN头及外层IP头,以得到报文2,报文2的目的网络设备就是设备G,设备D将报文2发送给设备G。在将报文2发送给设备G时,中途要经过其他的设备,这些设备称为中间设备。设备G接收报文2后,可移除报文2的外层IP头及VXLAN头以得到报文1,将报文1发送给设备I中的虚拟机VM2。For example, if the virtual machine VM1 wants to send the message 1 to the virtual machine VM2, the virtual machine VM1 sends the message 1 to the device D through the device H. After receiving the packet 1, device D determines the destination VXLAN gateway of the packet 1 according to the destination address and other information of the packet 1. For example, the destination VXLAN gateway of the packet 1 is device G, then the device D is the The VXLAN header and the outer IP header are added to the message 1 to obtain the message 2. The destination network device of the message 2 is the device G, and the device D sends the message 2 to the device G. When the packet 2 is sent to the device G, it will pass through other devices on the way, and these devices are called intermediate devices. After receiving the packet 2, the device G can remove the outer IP header and the VXLAN header of the packet 2 to obtain the packet 1, and send the packet 1 to the virtual machine VM2 in the device 1.
下面结合说明书附图描述本发明实施例。Embodiments of the present invention are described below with reference to the accompanying drawings.
请参见图2,本发明实施例提供一种报文发送方法,该方法可以由网络设备执行,该网络设备例如可以是图1中的设备D或者设备G,例如将该网络设备称为第一网络设备。该方法的流程描述如下。Referring to FIG. 2 , an embodiment of the present invention provides a method for sending a message, and the method may be executed by a network device. For example, the network device may be device D or device G in FIG. 1 . For example, the network device is referred to as the first Network equipment. The flow of this method is described below.
步骤201:第一网络设备接收第一报文。Step 201: The first network device receives the first packet.
步骤202:第一网络设备在第一报文外封装VXLAN头及外层IP头,以得到第二报文。Step 202: The first network device encapsulates the VXLAN header and the outer IP header outside the first packet to obtain the second packet.
步骤203:第一网络设备发送第二报文。Step 203: The first network device sends the second packet.
第一网络设备接收虚拟机发送的报文,例如将该报文称为第一报文,第一报文具有IP头,第一报文的目的地址为另一虚拟机的地址。发送第一报文的虚拟机例如在与第一网络设备连接的终端或服务器等设备中。待接收第一报文的虚拟机运行在与第二网络设备连接的终端或服务器等设备中。该第二网络设备与第一网络设备位于同一VXLAN网络中。比如以图1为例,第一网络设备例如为图1中的设备D,为接收第一报文的虚拟机运行的服务器提供服务的网络设备(即第二网络设备)可以是图1中的设备G,或者,第一网络设备例如为图1中的设备G,第二网络设备例如为图1中的设备D。The first network device receives a packet sent by the virtual machine, for example, the packet is called a first packet, the first packet has an IP header, and the destination address of the first packet is an address of another virtual machine. The virtual machine that sends the first packet is, for example, a terminal or a server connected to the first network device. The virtual machine that is to receive the first packet runs in a device such as a terminal or a server connected to the second network device. The second network device and the first network device are located in the same VXLAN network. For example, taking FIG. 1 as an example, the first network device is, for example, device D in FIG. 1 , and the network device (ie, the second network device) that provides services for the server running by the virtual machine that receives the first packet may be the device D in FIG. 1 . Device G, or the first network device is, for example, device G in FIG. 1 , and the second network device is, for example, device D in FIG. 1 .
例如根据第一报文的报文头可以确定第一报文属于业务流1。For example, it can be determined that the first packet belongs to service flow 1 according to the packet header of the first packet.
第一网络设备在接收第一报文后,查表(例如转发表或流表)确定VXLAN网关的地址,将该地址作为外层IP头的目的地址。After receiving the first packet, the first network device looks up a table (for example, a forwarding table or a flow table) to determine the address of the VXLAN gateway, and uses the address as the destination address of the outer IP header.
在确定第二报文的目的地址后,第一网络设备在第一报文外封装外层VXLAN头,以及在外层VXLAN头外再封装外层IP头,将封装完成后得到的报文称为第二报文。第一网络设备可以根据第二报文的目的地址发送第二报文。After determining the destination address of the second packet, the first network device encapsulates the outer VXLAN header outside the first packet, and re-encapsulates the outer IP header outside the outer VXLAN header, and the packet obtained after the encapsulation is completed is called Second message. The first network device may send the second packet according to the destination address of the second packet.
如果要测量第二报文所在的业务流的性能,第一网络设备可以标记第二报文,例如以第一标记值来标记第二报文,那么,第一网络设备要在第二报文的外层VXLAN头中选择一个或多个位做标记。If the performance of the service flow in which the second packet is located is to be measured, the first network device may mark the second packet, for example, mark the second packet with the first mark value, then the first network device should Select one or more bits in the outer VXLAN header for marking.
例如,第一网络设备可以标记第二报文的外层VXLAN头(以下简称VXLAN头)中的预留位。VXLAN头中的预留位有32位。第一网络设备可以标记VXLAN头中的全部预留位,也可以标记VXLAN头中的一些预留位,比如可以标记其中的两个预留位。第一网络设备可以标记第二报文的VXLAN头的预留位中的至少两个位。在第一网络设备对第二报文的VXLAN头的预留位中的至少两个位标记后,第二报文的VXLAN头的预留位被设置为第一标记值。For example, the first network device may mark the reserved bits in the outer VXLAN header (hereinafter referred to as the VXLAN header) of the second packet. There are 32 reserved bits in the VXLAN header. The first network device may mark all reserved bits in the VXLAN header, and may also mark some reserved bits in the VXLAN header, for example, may mark two reserved bits. The first network device may mark at least two bits in the reserved bits of the VXLAN header of the second packet. After the first network device marks at least two bits in the reserved bits of the VXLAN header of the second packet, the reserved bits of the VXLAN header of the second packet are set as the first mark value.
本发明实施例中,标记是指将VXLAN头中的一个或多个位的值修改为默认值之外的值,修改后的值为标记值。例如要标记VXLAN头中的一个位,该位的默认值为0,则标记该位后,该位的值被修改为1。例如,第一网络设备可以对第二报文的VXLAN头的预留位中的第一位和第二位进行标记,第一位和第二位的默认值例如均为0,则标记值可以为01,10,11中的任意一个。In this embodiment of the present invention, the mark refers to modifying the value of one or more bits in the VXLAN header to a value other than the default value, and the modified value is the mark value. For example, to mark a bit in the VXLAN header, the default value of this bit is 0, after marking this bit, the value of this bit is modified to 1. For example, the first network device may mark the first and second bits in the reserved bits of the VXLAN header of the second packet. The default values of the first and second bits are both 0, for example, and the mark value may be It is any one of 01, 10, and 11.
VXLAN头中的预留位例如被设置为第一标记值,第一标记值用于指示第一网络设备发送第二报文的时间处于第一时段,第一时段为第一网络设备统计第二报文所在业务流的报文数量的多个统计时段中的一个。For example, the reserved bit in the VXLAN header is set as the first flag value, and the first flag value is used to indicate that the time when the first network device sends the second packet is in the first time period, and the first time period is for the first network device to count the second One of multiple statistical periods for the number of packets in the service flow where the packets are located.
多个统计时段可以为连续的多个时段,例如第一时段为0s~10s,第二时段为10s~20s,第三时段为20s~30s,等等。当然各统计时段的时长也可以不相等。The plurality of statistical periods may be consecutive periods, for example, the first period is 0s-10s, the second period is 10s-20s, the third period is 20s-30s, and so on. Of course, the duration of each statistical period may not be equal.
第二报文是第一时段开始后第一网络设备发送的报文,例如第二报文可以是第一时段内第一网络设备发送的属于第二报文所在的业务流的任意一个报文。第二报文的VXLAN头的预留位的第一标记值可以用于指示第一网络设备发送第二报文的时间处于第一时段。如果还要测量第二时段内第二报文所在的业务流的性能,就对第二时段内属于第二报文所在的业务流的报文进行标记。同样的也可以对这些报文的VXLAN头的预留位进行标记。对第二时段内属于第二报文所在的业务流的报文设置的标记值与第一标记值需不同,以区分相邻时段的报文。例如可以将二时段内属于第二报文所在的业务流的报文预留位设置为第二标记值。再例如,如果还要测量第三时段内第二报文所在的业务流的性能,就对第三时段内属于第二报文所在的业务流的报文进行标记。同样的也可以对这些报文的VXLAN头的预留位进行标记。对第三时段内属于第二报文所在的业务流的报文设置的标记值与第二标记值需不同,以区分相邻时段的报文,对第三时段内属于第二报文所在的业务流的报文设置的标记值与第一标记值可以相同或者也可以不同。即,在设置标记值时,只要相邻时段的标记值不同即可,对于不相邻的时段,标记值可重复使用,以减少标记值的复杂度。The second packet is a packet sent by the first network device after the first period of time. For example, the second packet may be any packet sent by the first network device within the first period and belonging to the service flow where the second packet is located. . The first flag value of the reserved bit in the VXLAN header of the second packet may be used to indicate that the time when the first network device sends the second packet is in the first time period. If the performance of the service flow in which the second packet is located in the second time period is also to be measured, the packets belonging to the service flow in which the second packet is located in the second time period are marked. Similarly, the reserved bits of the VXLAN header of these packets can also be marked. The tag value set for the packets belonging to the service flow in which the second packet is located in the second time period needs to be different from the first tag value, so as to distinguish the packets in adjacent time periods. For example, the reserved bit of the message belonging to the service flow in which the second message is located in the two time periods may be set as the second flag value. For another example, if the performance of the service flow in which the second packet is located in the third time period is also to be measured, the packets belonging to the service flow in which the second packet is located in the third time period are marked. Similarly, the reserved bits of the VXLAN header of these packets can also be marked. The flag value set for the packets belonging to the service flow where the second packet is located in the third time period must be different from the second flag value, so as to distinguish the packets in adjacent time periods. The flag value set in the packet of the service flow may be the same as or different from the first flag value. That is, when setting the flag value, as long as the flag values of adjacent time periods are different, the flag values can be reused for non-adjacent time periods to reduce the complexity of the flag values.
例如请参见图3,为第二报文的结构示意图,第一报文(即图3中的原始报文)中包括内层以太网头(英文:inner Ethernet header)以及净荷(英文:payload)。第一报文被封装VXLAN头(英文:VXLAN header)和外层UDP头(英文:outer UDP header)后得到第二报文。For example, please refer to FIG. 3 , which is a schematic structural diagram of a second packet. The first packet (ie, the original packet in FIG. 3 ) includes an inner Ethernet header (English: inner Ethernet header) and a payload (English: payload). ). The second packet is obtained after the first packet is encapsulated with a VXLAN header (English: VXLAN header) and an outer UDP header (English: outer UDP header).
图3中,VXLAN头中包括VXLAN标志位(英文:VXLAN Flags)、VXLAN网络标识(英文:VXLAN Network Identifier,VNI)以及两段预留(英文:Reserved)位,为描述方便,将这两段预留位分别称为第一段预留位(例如为图3中的24bits的预留位)和第二段预留位(例如为图3中的8bits的预留位)。In Figure 3, the VXLAN header includes VXLAN flags (English: VXLAN Flags), VXLAN network identifier (English: VXLAN Network Identifier, VNI) and two reserved (English: Reserved) bits. The reserved bits are respectively referred to as the first-stage reserved bits (for example, the reserved bits of 24 bits in FIG. 3 ) and the second-stage reserved bits (for example, the reserved bits of 8 bits in FIG. 3 ).
VXLAN Flags占据8位,这8位中,I位(例如为图3中从右至左第四位)为1,以示报文有效,其余7位均为R位,均为预留位(这些预留位可以不是本发明实施例中用于进行标记的预留位),默认设置为0。VXLAN Flags occupies 8 bits. Among these 8 bits, the I bit (for example, the fourth bit from right to left in Figure 3) is 1 to indicate that the message is valid, and the remaining 7 bits are all R bits, which are reserved bits ( These reserved bits may not be reserved bits used for marking in this embodiment of the present invention), and are set to 0 by default.
第一段预留位占据24位。The first reserved bit occupies 24 bits.
VNI占据24位。在VXLAN网络中,每个租户可以使用一个唯一的VNI来标识,或者,也可以为一个租户分配多个VNI。VNI occupies 24 bits. In a VXLAN network, each tenant can be identified by a unique VNI, or a tenant can be assigned multiple VNIs.
第二段预留位占据8位。The second segment of reserved bits occupies 8 bits.
第二报文的VXLAN头中的第一段预留位和第二段预留位均可以用于标记。第一网络设备可以任意选择其中的至少两位进行标记。Both the first-segment reserved bits and the second-segment reserved bits in the VXLAN header of the second packet can be used for marking. The first network device may arbitrarily select at least two of them for marking.
对VXLAN头中的预留位进行标记,可以用于指示两层含义:一、该报文是测量报文;二、标记后的预留位所对应的标记值(例如为第一标记值)用于指示该报文所在的统计时段,即用于指示第一网络设备发送该报文的时间所处的统计时段。Marking the reserved bits in the VXLAN header can be used to indicate two meanings: first, the packet is a measurement packet; second, the marked value corresponding to the reserved bit (for example, the first marked value) It is used to indicate the statistical period in which the packet is located, that is, used to indicate the statistical period in which the first network device sends the packet.
比如,第一网络设备选择将报文1的VXLAN头中的第一段预留位中的第一位和第二位进行标记,例如是将该这两个位的取值从00修改为01,那么报文1属于测量报文,且报文1所在的统计时段为VXLAN头的标记值所对应的统计时段,例如该统计时段为统计时段1。比如,第一网络设备将报文2的VXLAN头中的第一段预留位中的第一位和第二位的取值从00修改为10,则报文2属于测量报文,且报文2所在的统计时段例如为统计时段2,统计时段2与统计时段1相邻。比如,第一网络设备将报文3的VXLAN头中的第一段预留位中的第一位和第二位的取值从00修改为01或11,则报文3属于测量报文,且报文3所在的统计时段例如为统计时段3,统计时段3与统计时段2相邻。For example, the first network device chooses to mark the first and second bits of the first reserved bits in the VXLAN header of packet 1, for example, by modifying the values of these two bits from 00 to 01 , then the packet 1 belongs to the measurement packet, and the statistics period in which the packet 1 is located is the statistics period corresponding to the tag value of the VXLAN header, for example, the statistics period is the statistics period 1. For example, if the first network device modifies the value of the first and second bits in the first reserved bit in the VXLAN header of packet 2 from 00 to 10, then packet 2 is a measurement packet, and the The statistical period in which the text 2 is located is, for example, the statistical period 2, and the statistical period 2 is adjacent to the statistical period 1. For example, if the first network device modifies the value of the first and second bits in the first reserved bit in the VXLAN header of packet 3 from 00 to 01 or 11, packet 3 is a measurement packet. And the statistics period in which the packet 3 is located is, for example, the statistics period 3 , and the statistics period 3 is adjacent to the statistics period 2 .
当然,以上列举指示统计时段的方式只是举例,在实际应用中也可以通过预留位的标记值,采用其他方式来指示统计时段。Of course, the above-mentioned manners for indicating the statistics period are just examples, and in practical applications, other manners may also be used to indicate the statistics period by using the flag value of the reserved bits.
对报文的VXLAN头进行标记,而不是对外层IP头进行标记,可以防止对非VXLAN报文进行误标记。Marking the VXLAN header of the packet instead of the outer IP header can prevent incorrect marking of non-VXLAN packets.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备确定在第一时段内发送的第二报文所在业务流中的报文的数量;The first network device determines the number of packets in the service flow where the second packet sent within the first period is located;
第一网络设备向控制设备发送确定的发送的报文的数量。The first network device sends the determined number of sent packets to the control device.
若要统计第二报文所在的业务流的丢包数量,那么,第一网络设备可以统计在第一时段内发送的第二报文所在的业务流的报文的数量,并将统计得到的数量发送给控制设备。To count the number of packets lost in the service flow where the second packet is located, the first network device can count the number of packets in the service flow where the second packet is sent during the first period, and count the obtained packets. The quantity is sent to the control device.
比如,第二报文的目的地址是第二网络设备的地址,那么,第二网络设备在接收到第二报文所在的业务流的第一个报文时,根据该报文的VXLAN头的预留位的标记值(例如为第一标记值)可以确定该报文为测量报文,并且可以确定该报文所处的统计时段,例如确定为第一时段,那么第二网络设备从接收到第一个第二报文所在的业务流的具有第一标记值报文开始统计在第一时段内接收的第二报文所在的业务流的具有第一标记值的报文的数量。这样,第二网络设备可以将统计得到的数量发送给控制设备。For example, if the destination address of the second packet is the address of the second network device, then, when the second network device receives the first packet of the service flow where the second packet is located, it will The mark value of the reserved bit (for example, the first mark value) can determine that the packet is a measurement packet, and can determine the statistical period in which the packet is located, for example, the first period, then the second network device receives the From the packets with the first tag value of the service flow in which the first second packet is located, start counting the number of packets with the first tag value in the service flow in which the second packet is located and received within the first period. In this way, the second network device can send the counted quantity to the control device.
控制设备分别接收第一网络设备和第二网络设备发送的统计数量,其中第一网络设备发送的是在第一时段内发送的第二报文所在的业务流的具有第一标记值的报文的数量,第二网络设备发送的是在第一时段内接收的第二报文所在的业务流的具有第一标记值的报文的数量,则控制设备根据这两个统计数量就可以得到第二报文所在的业务流在第一时段内的丢包数量(例如用第一网络设备发送的报文的数量减去第二网络设备接收的报文的数量就可以得到该丢包数量),从而可以得到第二报文所在的业务流在第一时段内的丢包率。The control device respectively receives the statistical quantities sent by the first network device and the second network device, where the first network device sends the packets with the first tag value of the service flow in which the second packet sent within the first time period is located The second network device sends the number of packets with the first tag value of the service flow in which the second packet received in the first time period is located, and the control device can obtain the first The number of lost packets of the service flow where the second packet is located in the first period (for example, the number of lost packets can be obtained by subtracting the number of packets received by the second network device from the number of packets sent by the first network device), Thus, the packet loss rate of the service flow in which the second packet is located in the first period of time can be obtained.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备确定第二报文为用于测量时延的报文;其中,该时延为第二报文所在的业务流在第一时段内的时延;The first network device determines that the second packet is a packet for measuring the delay; wherein, the delay is the delay of the service flow in which the second packet is located within the first time period;
第一网络设备将发送第二报文的时刻发送给控制设备。The first network device sends the time when the second message is sent to the control device.
例如,业务流1的源设备为第一网络设备,目的设备为第二网络设备,第一网络设备和第二网络设备事先约定选取业务流1中的第一个被发送的报文来测量业务流1在第一时段内的时延。例如第一网络设备在第一时段中发送的属于业务流1的第一个报文为报文1,那么第一网络设备在对报文1进行标记(例如将报文1的VXLAN头的预留位设置为标记值1)后得到报文2,且发送报文2,对报文1进行标记的方式参考如前的描述。第一网络设备将发送报文2的时刻发送给控制设备。第二网络设备可以将接收第一个具有标记值1的报文的时刻发送给控制设备(第二网络设备接收的第一个具有标记值1的报文可能是报文2也可能不是报文2)。例如,控制设备用第二网络设备发送的接收报文的时刻减去第一网络设备发送的发送报文的时刻,就可以得到业务流1在第一时段内的时延。For example, the source device of service flow 1 is the first network device, and the destination device is the second network device. The first network device and the second network device agree in advance to select the first sent packet in service flow 1 to measure the service The delay of stream 1 in the first period. For example, the first packet belonging to service flow 1 sent by the first network device in the first period is packet 1, then the first network device is marking packet 1 (for example, pre-processing the VXLAN header of packet 1). After the reserved bit is set to the mark value 1), the packet 2 is obtained, and the packet 2 is sent, and the method of marking the packet 1 refers to the above description. The first network device sends the time when the packet 2 is sent to the control device. The second network device may send the moment of receiving the first packet with the tag value 1 to the control device (the first packet with the tag value 1 received by the second network device may or may not be the packet 2 2). For example, the control device can obtain the time delay of service flow 1 in the first period by subtracting the time of sending the message sent by the first network device from the time of receiving the message sent by the second network device.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备接收第二网络设备发送的第三报文;其中,第三报文的VXLAN头中的预留位设置有标记值,其中,标记值用于指示第二网络设备发送第三报文的时间所处的统计时段,例如,若该标记值为第一标记值,则指示第二网络设备发送第三报文的时间所处的统计时段为第一时段,若该标记值为第二标记值,则指示第二网络设备发送第三报文的时间所处的统计时段为第二时段,等等。The first network device receives the third packet sent by the second network device; wherein a reserved bit in the VXLAN header of the third packet is set with a flag value, where the flag value is used to instruct the second network device to send the third message The statistical period in which the time of the message is located. For example, if the marked value is the first marked value, it indicates that the statistical period in which the second network device sends the third packet is the first period. If the marked value is the first marked value If the flag value is two, it indicates that the statistical period in which the time when the second network device sends the third packet is the second period, and so on.
第一网络设备根据第三报文的VXLAN头中的第二标记值确定第二网络设备发送第三报文的时间处于第二时段,第二时段为第一网络设备统计第三报文所在业务流的报文数量的多个统计时段中的一个。The first network device determines, according to the second tag value in the VXLAN header of the third packet, that the time when the second network device sends the third packet is in the second time period, and the second time period is for the first network device to count the services in which the third packet is located. One of multiple statistical periods for the number of packets in the flow.
即,对于一个业务流来说,第一网络设备可以是源设备,而对于另外的业务流来说,第一网络设备也可以是目的设备。第一网络设备在作为目的设备时,可以接收另外的源设备发送的报文,这些报文里也可能有测量报文,第一网络设备通过确定接收的报文的VXLAN头中的预留位是否被标记就可以确定哪些报文是测量报文,即,被标记的就是测量报文,否则就是普通报文。标记的方式,以及标记后的预留位所指示的信息等,如前都有介绍。That is, for one service flow, the first network device may be the source device, and for another service flow, the first network device may also be the destination device. When the first network device acts as a destination device, it can receive packets sent by other source devices, and these packets may also contain measurement packets. The first network device determines the reserved bits in the VXLAN header of the received packets by determining Whether it is marked or not can determine which packets are measurement packets, that is, the marked packets are measurement packets, otherwise, they are ordinary packets. The way of marking, and the information indicated by the reserved bits after the marking, etc., are described above.
另外,如果第三报文为第一网络设备接收的第一个具有第二标记值的报文,那么第一网络设备除了根据第二标记值确定第二网络设备发送第三报文的时间处于第二时段之外,还可以从接收第三报文开始计时,以统计在第二时段内接收的第三报文所在业务流中的报文的数量。In addition, if the third packet is the first packet with the second tag value received by the first network device, the first network device determines that the time when the second network device sends the third packet is within the In addition to the second period, timing may also be started from receiving the third packet, so as to count the number of packets in the service flow where the third packet received within the second period is located.
可选的,在第一网络设备从接收第三报文开始计时之后,还包括:Optionally, after the first network device starts timing from receiving the third packet, the method further includes:
第一网络设备接收第二网络设备发送的第四报文;The first network device receives the fourth packet sent by the second network device;
第一网络设备根据第四报文的VXLAN头确定第四报文的VXLAN头中的预留位被设置为第二标记值;The first network device determines, according to the VXLAN header of the fourth packet, that the reserved bit in the VXLAN header of the fourth packet is set as the second flag value;
第一网络设备将在第二时段内接收的第三报文所在业务流中的报文的数量加1。The first network device adds 1 to the number of packets in the service flow where the third packet is received within the second period.
即,若第一网络设备要统计在第二时段内接收的第三报文所在的业务流的具有第二标记值的报文的数量,那么第一网络设备每接收到一个报文,都可以确定该报文是否属于第三报文所在的业务流以及该报文是否具有第二标记值。例如,第一网络设备确定第四报文属于第三报文所在的业务流且具有第二标记值,那么第一网络设备可以将统计的在第二时段内接收的第三报文所在业务流中的且具有第二标记值的报文的数量加1。That is, if the first network device wants to count the number of packets with the second tag value in the service flow in which the third packet received in the second time period is located, the first network device can count the number of packets with the second tag value each time it receives a packet. It is determined whether the packet belongs to the service flow where the third packet is located and whether the packet has the second tag value. For example, if the first network device determines that the fourth packet belongs to the service flow where the third packet is located and has the second tag value, then the first network device can count the service flow where the third packet received in the second time period is located. The number of packets in and with the second tag value is incremented by 1.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备确定在第二时段内接收的第三报文所在业务流中的报文的数量;The first network device determines the number of packets in the service flow where the third packet received within the second time period is located;
第一网络设备向控制设备发送确定的接收的报文的数量。The first network device sends the determined number of received packets to the control device.
即,第一网络设备作为目的设备时,在接收到第一个第三报文所在的业务流的报文时,根据该报文的VXLAN头可以确定该报文为测量报文,及可以确定该报文所处的统计时段,例如确定为第二时段,第一网络设备可以从接收到第一个第三报文所在的业务流的报文开始统计在第二时段内接收的第三报文所在的业务流的且具有与第三报文相同的标记的报文的数量,这样,第一网络设备可以将统计得到的数量发送给控制设备。That is, when the first network device is used as the destination device, when receiving the packet of the service flow where the first third packet is located, it can be determined that the packet is a measurement packet according to the VXLAN header of the packet, and it can be determined that the packet is a measurement packet. The statistics period in which the packet is located is determined to be, for example, the second period, and the first network device may start to count the third packets received in the second period from the packet of the service flow in which the first third packet is received. In this way, the first network device can send the counted number to the control device.
同样的,例如第一网络设备为第三报文所在的业务流的目的设备,第二网络设备为第三报文所在的业务流的源设备,则第二网络设备也可以统计在第二时段内发送的第三报文所在的业务流的且具有与第三报文相同的标记报文的数量,及,第二网络设备也可以将统计得到数量发送给控制设备,不多赘述。Similarly, for example, if the first network device is the destination device of the service flow where the third packet is located, and the second network device is the source device of the service flow where the third packet is located, the second network device can also count the second time period. In addition, the second network device may also send the counted number to the control device, which is not repeated here.
另外,在第一网络设备作为目的设备、第二网络设备作为源设备时,也可以测量第三报文所在的业务流在第二时段内的时延,测量时延的方式与如前所述的测量第二报文所在的业务流在第一时段内的时延的方式类似,不多赘述。In addition, when the first network device is used as the destination device and the second network device is used as the source device, the delay of the service flow in which the third packet is located in the second time period can also be measured. The method of measuring the delay is the same as that described above. The method of measuring the delay of the service flow in which the second packet is located in the first time period is similar, and details are not repeated here.
另外,如前介绍的都是业务流的源设备或目的设备可以向控制设备发送统计的收发报文的数量等信息,而根据对图1的介绍可知,报文在VXLAN网络中的传输过程中还可能经过一些中间设备(例如图1中,若设备D作为源网络设备、设备G作为目的网络设备,则设备B和设备C可以是一组中间设备,或在另一条路径下,设备F和设备E可以是一组中间设备),在实际应用中,这些中间设备也可以向控制设备发送信息,比如设备B作为中间设备时,也可以统计在任一统计时段内发送的具有标记值的报文的数量,或统计在任一统计时段内接收的具有标记值的报文的数量,并将统计的数量发送给控制设备,以获得该统计时段内该报文所在的业务流的丢包数量,或者比如设备B作为中间设备时,也可以将在任一统计时段发送的具有某个标记值的报文的时刻发送给控制设备,或将在任一统计时段接收的具有某个标记值的报文的时刻发送给控制设备,以获得该统计时段内该报文所在的业务流的时延,等等,统计的方式、发送的方式等均可参考如前的介绍。只是中间设备无需对报文添加VXLAN头和外层IP头,也无需移除报文的VXLAN头和外层IP头,转发报文即可。In addition, as described above, the source device or destination device of the service flow can send statistics such as the number of sent and received packets to the control device. According to the description of Figure 1, the packets are transmitted in the VXLAN network during the transmission process. It may also pass through some intermediate devices (for example, in Figure 1, if device D is used as the source network device and device G is used as the destination network device, then device B and device C can be a group of intermediate devices, or in another path, device F and Device E can be a group of intermediate devices), in practical applications, these intermediate devices can also send information to the control device. For example, when device B acts as an intermediate device, it can also count packets with marked values sent in any statistical period , or count the number of packets with marked values received during any statistical period, and send the counted number to the control device to obtain the number of lost packets of the service flow in which the packet belongs during the statistical period, or For example, when device B acts as an intermediate device, it can also send the time of the packet with a certain tag value sent in any statistical period to the control device, or the time of the packet with a certain tag value received in any statistical period It is sent to the control device to obtain the delay of the service flow in which the packet belongs within the statistical period, and so on. For the statistical method and the sending method, please refer to the previous introduction. It is just that the intermediate device does not need to add the VXLAN header and the outer IP header to the packet, nor does it need to remove the VXLAN header and the outer IP header of the packet, and can forward the packet.
关于中间设备是否也需发送用于测量业务流性能的信息给控制设备,以及若需要的话,具体由哪些中间设备发送用于测量业务流性能的信息给控制设备,都可以预先规定好,例如可以由控制设备预先规定,或者可以由协议预先规定等等。Whether the intermediate device also needs to send the information for measuring the performance of the service flow to the control device, and if necessary, which intermediate devices send the information for measuring the performance of the service flow to the control device, can be pre-specified. For example, you can It is pre-specified by the control device, or can be pre-specified by a protocol or the like.
以下结合附图介绍本发明实施例中的设备。The devices in the embodiments of the present invention are described below with reference to the accompanying drawings.
请参见图4,本发明实施例提供一种网络设备,该网络设备可以是如前所述的第一网络设备。该第一网络设备可以包括第一接口401、转发芯片402和第二接口403。Referring to FIG. 4 , an embodiment of the present invention provides a network device, and the network device may be the first network device as described above. The first network device may include a
其中,第一接口401可以用于第一网络设备收发未封装VXLAN头的报文,例如,可以认为第一接口401为面向用户的接口。The
第二接口403可以用于第一网络设备接收其他网络设备发送的封装了VXLAN头的报文,以及可以用于向其他网络设备发送封装了VXLAN头的报文,例如,可以认为第二接口403属于VXLAN隧道侧的接口。The
第一接口401和第二接口403都是网络设备的网络接口,分别和不同的设备连接。网络接口可以是有线接口,无线接口或其组合。有线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线接口例如可以为无线局域网(英文:wirelesslocal area network,缩写:WLAN)接口。Both the
转发芯片402可以用于分别通过第一接口401和第二接口403收发报文,对通过第一接口401接收的报文封装VXLAN头及外层IP头,对VXLAN头进行标记,统计在任一统计时段内发送的具有标记值的报文的数量,统计在任一统计时段内接收的具有标记值的报文的数量,等等。转发芯片402可以由专用集成电路(英文:application-specific integratedcircuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD),网络处理器(英文:network processor),多核中央处理器(英文:central processing unit,简称CPU)中用于实现转发面的核心或其组合实现。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic arraylogic,缩写:GAL)或其任意组合。The
可选的,第二接口403可以包括一个接口或多个接口,那么,通过第二接口403收发报文,可以是通过第二接口403包括的一个接口或多个接口来收发报文。Optionally, the
可选的,转发芯片402可以通过第二接口403向控制设备发送信息,例如转发芯片402向控制设备发送的信息可以用于统计在任一统计时段内某个业务流的性能,例如丢包数量、时延等等。Optionally, the
其中,与其他网络设备交互的接口,和与控制设备交互的接口,可以使用第二接口403中的同一接口,或者也可以使用第二接口403中包括的不同的接口。The interface for interacting with other network devices and the interface for interacting with the control device may use the same interface in the
图4中各个接口的形态和位置关系等只是一种示例,在实际应用中,接口的形态以及部署方式等显然不限于此。The shape and positional relationship of each interface in FIG. 4 is just an example, and in practical applications, the shape and deployment mode of the interface are obviously not limited to this.
本发明实施例中图4中的设备与图3流程所述的方法相对应,设备中的每个模块所完成的工作,以及执行过程中的细节描述等,可参考方法部分,不多赘述。In this embodiment of the present invention, the device in FIG. 4 corresponds to the method described in the flowchart in FIG. 3 . The work performed by each module in the device and the detailed description of the execution process can be referred to the method section, and details are not repeated.
本发明实施例中,第一网络设备在为第一报文封装VXLAN头时,可以为VXLAN头中的预留位标记,即将VXLAN头中的预留位设置为第一标记值,第一标记值就可以指示第一网络设备发送第二报文的时间位于哪个统计时段,则,可以根据报文的VXLAN头里的预留位来区分不同的报文,在进行网络性能测量时,可以根据不同的报文来测试不同的网段在不同的统计时段内的性能,细化了对网络性能的测试粒度,提高了对网络性能测试的准确性,对于测试结果可利用的价值更高。In the embodiment of the present invention, when the first network device encapsulates the VXLAN header for the first packet, it may mark the reserved bit in the VXLAN header, that is, set the reserved bit in the VXLAN header as the first mark value, the first mark The value can indicate which statistical period the first network device sends the second packet in. Then, different packets can be distinguished according to the reserved bits in the VXLAN header of the packet. Different packets are used to test the performance of different network segments in different statistical time periods, which refines the test granularity of network performance, improves the accuracy of network performance testing, and has higher value for test results.
在本发明中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the unit or the unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to implement the embodiments of the present invention.
在本发明实施例中的各功能单元可以集成在一个处理单元中,或者各个单元也可以均是独立的物理模块。Each functional unit in this embodiment of the present invention may be integrated into one processing unit, or each unit may also be an independent physical module.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(英文:processor)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:通用串行总线闪存盘(英文:Universal Serial Bus flash drive)、移动硬盘、只读存储器(英文:read-only memory,ROM)、随机存取存储器(英文:random-access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solutions of the present invention may be embodied in the form of software products, and the computer software products are stored in a storage medium and include several instructions to enable a computer device (which may be a personal computer, A server, or a network device, etc.) or a processor (English: processor) executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: Universal Serial Bus flash drive (English: Universal Serial Bus flash drive), mobile hard disk, read-only memory (English: read-only memory, ROM), random access memory (English: random-access memory) Various media that can store program codes, such as memory, RAM), magnetic disks or optical disks.
以上所述,以上实施例仅用以对本发明的技术方案进行了详细介绍,但以上实施例的说明只是用于帮助理解本发明实施例的方法,不应理解为对本发明实施例的限制。本技术领域的技术人员可轻易想到的变化或替换,都应涵盖在本发明实施例的保护范围之内。As described above, the above embodiments are only used to describe the technical solutions of the present invention in detail, but the descriptions of the above embodiments are only used to help understand the methods of the embodiments of the present invention, and should not be construed as limitations on the embodiments of the present invention. Changes or substitutions that can be easily conceived by those skilled in the art should all fall within the protection scope of the embodiments of the present invention.
Claims (21)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510682620.2A CN106603322B (en) | 2015-10-20 | 2015-10-20 | A message sending and receiving method and network device |
| PCT/CN2016/101812 WO2017067408A1 (en) | 2015-10-20 | 2016-10-11 | Methods for sending and receiving messages, and network equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510682620.2A CN106603322B (en) | 2015-10-20 | 2015-10-20 | A message sending and receiving method and network device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN106603322A CN106603322A (en) | 2017-04-26 |
| CN106603322B true CN106603322B (en) | 2020-08-14 |
Family
ID=58554786
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510682620.2A Active CN106603322B (en) | 2015-10-20 | 2015-10-20 | A message sending and receiving method and network device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106603322B (en) |
| WO (1) | WO2017067408A1 (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109412922B (en) * | 2017-08-15 | 2021-07-20 | 华为技术有限公司 | Method, forwarding device, controller and system for transmitting message |
| CN109995603B (en) * | 2017-12-29 | 2020-12-15 | 中国移动通信集团山东有限公司 | A method, device and electronic device for packet loss measurement under Tag model |
| US10992496B2 (en) | 2019-05-14 | 2021-04-27 | International Business Machines Corporation | Tuning TCP largesend parameter in VXLan cloud environments |
| CN113708985B (en) * | 2020-05-20 | 2023-01-06 | 华为技术有限公司 | A flow detection method, device and system |
| CN116455704B (en) * | 2023-06-15 | 2023-08-11 | 北京城建智控科技股份有限公司 | Message sending method, message receiving method and message sending device based on VXLAN |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101056221A (en) * | 2007-03-29 | 2007-10-17 | 北京中星微电子有限公司 | A method for computing the data loss in the network transfer |
| CN101753717A (en) * | 2009-11-27 | 2010-06-23 | 华为终端有限公司 | Terminal traffic statistic method and communication terminal |
| CN104410541A (en) * | 2014-11-18 | 2015-03-11 | 盛科网络(苏州)有限公司 | Method and device for counting VXLAN inner layer virtual machine flux on intermediate switch |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2425018A (en) * | 2005-04-04 | 2006-10-11 | Agilent Technologies Inc | Method of sharing measurement data |
| US9137119B2 (en) * | 2013-03-07 | 2015-09-15 | Cisco Technology, Inc. | Efficient handling of multi-destination traffic in an internet protocol fabric data center |
| CN103179618B (en) * | 2013-03-19 | 2015-09-23 | 福建三元达通讯股份有限公司 | A kind of method based on improving the QoS of backhaul network in LTE Femto system |
| CN104917641B (en) * | 2014-03-11 | 2019-06-25 | 中国电信股份有限公司 | It is a kind of for testing the method, test equipment and system of packet loss |
-
2015
- 2015-10-20 CN CN201510682620.2A patent/CN106603322B/en active Active
-
2016
- 2016-10-11 WO PCT/CN2016/101812 patent/WO2017067408A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101056221A (en) * | 2007-03-29 | 2007-10-17 | 北京中星微电子有限公司 | A method for computing the data loss in the network transfer |
| CN101753717A (en) * | 2009-11-27 | 2010-06-23 | 华为终端有限公司 | Terminal traffic statistic method and communication terminal |
| CN104410541A (en) * | 2014-11-18 | 2015-03-11 | 盛科网络(苏州)有限公司 | Method and device for counting VXLAN inner layer virtual machine flux on intermediate switch |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2017067408A1 (en) | 2017-04-27 |
| CN106603322A (en) | 2017-04-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11792046B2 (en) | Method for generating forwarding information, controller, and service forwarding entity | |
| US11979322B2 (en) | Method and apparatus for providing service for traffic flow | |
| US10684885B2 (en) | Port mirroring in a virtualized computing environment | |
| US12021741B2 (en) | Packet measurement method, device, and system | |
| CN108259291B (en) | VXLAN message processing method, device and system | |
| CN102907049B (en) | Find based on phantom station interface and configuration protocol response carrys out assigned priority | |
| CN106603322B (en) | A message sending and receiving method and network device | |
| CN108462646B (en) | Message processing method and device | |
| CN111385121B (en) | A kind of transmission method and corresponding device of operation management and maintenance iOAM message | |
| CN106375158B (en) | A packet loss detection method, network equipment and system | |
| CN107872332A (en) | The detection method and relevant apparatus of a kind of message forwarding path | |
| US20180006842A1 (en) | Access Layer-2 Virtual Private Network From Layer-3 Virtual Private Network | |
| CN105634942A (en) | Method and switch for forwarding message | |
| WO2020135087A1 (en) | Communication method, apparatus and system | |
| CN103746874B (en) | Method and equipment for IP (Internet protocol) FPM (flow performance monitor) | |
| CN114189564A (en) | Message transmission method, device and system | |
| CN115941816A (en) | Packet loss processing method and device and storage medium | |
| WO2023005927A1 (en) | Srv6-based tunnel quality measurement method and related apparatus | |
| WO2022048466A1 (en) | Operation administration and maintenance (oam) packet processing method and device | |
| CN114915564A (en) | Network state measuring method, device and system | |
| CN115459942A (en) | A flow monitoring method and device | |
| CN111835644A (en) | Packet forwarding method and switch | |
| CN118282802A (en) | A communication method and related equipment | |
| WO2023231438A1 (en) | Message sending method, network device and system | |
| CN119854067A (en) | Data transmission method and 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |