WO2017067408A1 - Methods for sending and receiving messages, and network equipment - Google Patents
Methods for sending and receiving messages, and network equipment Download PDFInfo
- Publication number
- WO2017067408A1 WO2017067408A1 PCT/CN2016/101812 CN2016101812W WO2017067408A1 WO 2017067408 A1 WO2017067408 A1 WO 2017067408A1 CN 2016101812 W CN2016101812 W CN 2016101812W WO 2017067408 A1 WO2017067408 A1 WO 2017067408A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- packet
- network device
- time period
- service flow
- packets
- 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.)
- Ceased
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]
Definitions
- the present application relates to the field of communications, and in particular, to a packet sending and receiving method and a network device.
- VXLAN Virtual Extensible local area network
- OSI Open Systems Interconnection
- UDP User Datagram Protocol
- a Layer 2 Ethernet frame based on media access control (MAC) is encapsulated in the message with a specific destination UDP port number.
- VXLAN has the following features:
- VNI 24-bit VXLAN Network Identifier
- VXLAN virtualized extensible network
- individual tenants can use their own services independently.
- testing of network performance may be involved to determine how to use the service based on the performance of the current network.
- the present application provides a packet sending and receiving method and a network device, which are used to solve the technical problem that the granularity is relatively large when performing performance testing on the network.
- the first aspect provides a packet sending method, including:
- the first network device encapsulates the VXLAN header and the outer IP header in the first packet to obtain a second packet, where the reserved bit in the VXLAN header is set to the first label value.
- the first flag value is used to indicate that the time that the first network device sends the second packet is in a first time period, where the first time period is that the first network device collects a service flow of the second packet One of a plurality of statistical periods of the number of messages;
- the first network device sends the second packet.
- the reserved bit in the VXLAN header is set to indicate which statistical period the time at which the second message is sent is located, so that the message can be distinguished according to the reserved bits in the VXLAN header of the message.
- the method further includes:
- the first network device sends the determined number of sent packets to the control device.
- the number of the packets of the service flow in which the second packet is sent in the first time period may be counted, and the number of the packets of the service flow in the first time period may be counted.
- the statistically obtained quantity is sent to the control device.
- the network device that receives the packet of the service flow in which the second packet is located may also send the number of the service packet of the service packet that is received in the first time period to the control device, so that the control device can calculate The number of lost packets in the first time period of the service flow in which the second packet is located is obtained.
- the method further includes:
- the first network device may be the source device, and for another service flow, the first network device may also be the destination device.
- the first network device When the first network device is the destination device, it can receive the packets sent by the other source devices.
- the first network device may also have measurement packets in the packets.
- the first network device determines the reserved bits in the VXLAN header of the received packet. Whether it is marked or not can determine which messages are measurement messages, that is, the measurement message is marked, otherwise it is an ordinary message.
- the method further includes:
- the first network device sends the determined number of received messages to the control device.
- the service flow of the third packet received in the second time period may be counted from the packet that receives the service flow of the first third packet, and has a third The number of packets marked with the same packet, so that the first network device can send the statistics to the control device.
- the network device that sends the packet of the service flow where the third packet is located can also be used.
- the number of packets of the service flow in which the third packet is sent in a period of time is sent to the control device, so that the control device can calculate the number of packets lost in the second period of the service flow in which the third packet is located.
- the second aspect provides a packet receiving method, including:
- the first network device determines the second network according to the second tag value.
- the time period in which the device sends the third packet is in a second time period; the second time period is one of a plurality of statistical periods in which the first network device collects the number of packets of the service flow in which the third packet is located;
- the first network device starts timing to receive the third packet, to count the number of packets in the service flow of the third packet received in the second time period.
- the first network device can determine which messages are measurement messages by determining whether the reserved bits in the VXLAN header of the received message are marked, that is, the measurement message is marked, otherwise it is an ordinary message. 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 second network device sends the third packet according to the second tag value. In addition to the time period, the device may start counting from the third packet to collect the number of packets in the service flow of the third packet received in the second time period, so that the control device can obtain the service where the third packet is located. The number of lost packets in the second time period.
- the method further includes:
- the first network device adds 1 to the number of packets in the service flow in which the third packet is received in the second time period.
- a method for collecting the number of statistics 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 the 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 collect the statistics of the third packet received in the second time period. And the number of messages with the second tag value is increased by one.
- the method further includes:
- the first network device sends the determined number of received messages to the control device.
- the first network device may count the number of packets of the service flow in which the third packet received in the second time period is the same as that of the third packet, and the number of statistics that the first network device can obtain.
- the network device that sends the packet of the service flow in which the third packet is sent may also send the number of the service packet of the service packet in the first time period to the control device. Therefore, the control device can calculate the number of lost packets of the service flow in which the third packet is located in the second time period.
- a third aspect provides a network device, including a first interface, a forwarding chip, and a second interface, where the forwarding chip is configured to:
- the network device further includes a third interface; the forwarding chip is further configured to:
- the forwarding chip is further configured to:
- the second time period is the network device statistics.
- the forwarding chip is further configured to:
- a fourth aspect provides a network device, including an interface and a forwarding chip, where the forwarding chip is configured to:
- the second time period is one of a plurality of statistical periods in which the network device counts the number of packets of the service flow in which the third packet is located;
- the forwarding chip is further configured to:
- the forwarding chip is further configured to:
- a network device for transmitting a message comprising means for performing the method of the first aspect.
- a network device for receiving a message comprising means for performing the method of the second aspect.
- FIG. 1 is a schematic diagram of a scenario of a VXLAN network according to an embodiment of the present invention
- FIG. 2 is a flowchart of a method for sending a message according to an embodiment of the present invention
- FIG. 3 is a schematic structural diagram of a second packet according to an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a first network device according to an embodiment of the present invention.
- a network device which 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.
- control device the control device may be a stand-alone device, such as a server or a router, or a function module located in another device, for example, a function module located in a device such as a server or a router, as long as The control device can communicate with the network device.
- a set of features is defined, and any message that satisfies this set of characteristics belongs to a service flow.
- a tuple of the header of a message can be used as a set of features, and packets with the same value of the tuple belong to the same service flow.
- the tuple as a feature is a quintuple, and the quintuple may include: a source Internet Protocol (IP) address, a source port number, a destination IP address, a destination port number, and a transport layer protocol type.
- IP Internet Protocol
- FIG. 1 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, where 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.
- virtual machine VM1 is running in device H.
- the device I is a server connected to the network through the device G, for example, the virtual machine VM2 is running in the device 1.
- the control device A is able to communicate with each of the network devices. Alternatively, the control device can also communicate only with a portion of the network device.
- virtual machine VM1 wants to send message 1 to virtual machine VM2
- virtual machine VM1 sends message 1 to device D through device H.
- the device D determines the destination VXLAN gateway of the packet 1 according to the destination address and other information of the packet 1.
- the destination VXLAN gateway of the packet 1 is the device G
- the device D is the packet.
- the VXLAN header and the outer IP header are added to obtain the packet 2
- the destination network device of the packet 2 is the device G
- the device D sends the packet 2 to the device G.
- 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.
- an embodiment of the present invention provides a packet sending method, which may be performed by a network device, for example, the device D or the device G in FIG. 1, for example, the network device is referred to as a first Internet equipment.
- a packet sending method which may be performed by a network device, for example, the device D or the device G in FIG. 1, for example, the network device is referred to as a first Internet equipment.
- the flow of the method is described below.
- Step 201 The first network device receives the first packet.
- Step 202 The first network device encapsulates the VXLAN header and the outer IP header in the first packet to obtain the second packet.
- Step 203 The first network device sends the second packet.
- the first network device receives the packet sent by the virtual machine, for example, the packet is referred to as the first packet, and the first packet has an IP header, and the destination address of the first packet is the address of another virtual machine.
- the virtual machine that sends the first message is, for example, in a device such as a terminal or server connected to the first network device.
- the virtual machine 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 is located in the same VXLAN network as the first network device.
- the first network device is, for example, the device D in FIG.
- the network device ie, the second network device serving the server running the virtual machine that receives the first packet
- the network device ie, the second network device serving the server running the virtual machine that receives the first packet
- Device G or the first network device is, for example, device G in FIG. 1
- the second network device is, for example, device D in FIG.
- the packet header of the first packet it can be determined that the first packet belongs to service stream 1.
- the first network device After receiving the first packet, the first network device determines a VXLAN gateway address by using a lookup table (for example, a forwarding table or a flow table), and uses the address as the destination address of the outer IP header.
- a lookup table for example, a forwarding table or a flow table
- the first network device After determining the destination address of the second packet, the first network device encapsulates the outer VXLAN header outside the first packet, and 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.
- the first network device may mark the second packet, for example, marking the second packet with the first tag value, then the first network device is to be in the second packet. Select one or more bits in the outer VXLAN header to mark it.
- the first network device may mark a reserved bit in an outer VXLAN header (hereinafter referred to as a VXLAN header) of the second message.
- the reserved bits in the VXLAN header have 32 bits.
- 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, two reserved bits may be marked.
- the first network device may mark at least two of the reserved bits of the VXLAN header of the second message. After the first network device marks at least two of the reserved bits of the VXLAN header of the second message, the reserved bit of the VXLAN header of the second message is set to the first tag value.
- the tag 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 a tag value.
- the default value of this bit is 0, then the value of this bit is modified to 1 after the bit is marked.
- the first network device may mark the first bit and the second bit in the reserved bits of the VXLAN header of the second packet, and the default values of the first bit and the second bit are both 0, for example, the tag value may be It is any one of 01, 10, and 11.
- the reserved bit in the VXLAN header is set to a first tag value, for example, 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 second time in the first network device.
- 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 second time in the first network device.
- the plurality of statistical periods may be consecutive periods, for example, the first period is 0s to 10s, the second period is 10s to 20s, the third period is 20s to 30s, and the like. Of course, the duration of each statistical period may also be unequal.
- the second packet is a packet sent by the first network device after the start of the first time period.
- the second packet may be any packet that belongs to the service flow of the second packet sent by the first network device in the first time period.
- the first flag value of the reserved bit of 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 packet belonging to the service flow in which the second packet is located in the second time period is marked. It is also possible to mark the reserved bits of the VXLAN header of these messages.
- the tag value set in the packet of the service flow in which the second packet is located in the second time period is different from the first tag value to distinguish the packets in the adjacent time period.
- the message reserved bit of the service flow in which the second packet is located in the two time periods may be set as the second tag value.
- the performance of the message that belongs to the service flow in which the second packet is located in the third time period is marked. It is also possible to mark the reserved bits of the VXLAN header of these messages.
- the value of the tag set in the packet corresponding to the service flow in which the second packet is located in the third time period is different from the value of the second tag, so as to distinguish the packet in the adjacent time period, and the second packet belongs to the second packet.
- the tag value set by the message of the service flow may be the same as or different from the first tag value. That is, when the tag value is set, as long as the tag values of the adjacent time periods are different, the tag values can be reused for the non-adjacent time periods to reduce the complexity of the tag values.
- FIG. 3 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 first packet is encapsulated in a VXLAN header (English: VXLAN header) and an outer UDP header (English: outer UDP header) to obtain a second packet.
- the VXLAN header includes VXLAN flag bits (English: VXLAN Flags), VXLAN network identifier (VXLAN Network Identifier, VNI), and two reserved (English: Reserved) bits.
- the reserved bits are respectively referred to as a first segment reserved bit (for example, a reserved bit of 24 bits in FIG. 3) and a second reserved bit (for example, a reserved bit of 8 bits in FIG. 3).
- VXLAN Flags occupies 8 bits.
- the I bit for example, the right-to-left fourth bit in Figure 3
- the remaining 7 bits are R bits, which are reserved bits ( These reserved bits may not be reserved bits for marking in the embodiment of the present invention, and the default setting is 0.
- the first reserved bit occupies 24 bits.
- VNI occupies 24 bits.
- each tenant can be identified by a unique VNI, or multiple tenants can be assigned to a single tenant.
- the second reserved position occupies 8 bits.
- the first reserved bit and the second reserved bit in the VXLAN header of the second message can be used for marking.
- the first network device can arbitrarily select at least two of them for marking.
- Marking the reserved bits in the VXLAN header can be used to indicate two layers of meaning: 1.
- the message is a measurement message; 2.
- the tag value corresponding to the reserved bit after the tag (for example, the first tag value) It is used to indicate the statistical period in which the packet is located, that is, the statistical period in which the time when the first network device sends the packet is indicated.
- the first network device selects to mark the first bit and the second bit of the first reserved bit in the VXLAN header of the message 1, for example, changing the value of the two bits from 00 to 01. Then, the message 1 belongs to the measurement message, and the statistical period in which the message 1 is located is the statistical period corresponding to the tag value of the VXLAN header. For example, the statistical period is the statistical period 1.
- the first network device takes the first bit and the second bit of the first reserved bit in the VXLAN header of the message 2. If the value is changed from 00 to 10, the message 2 belongs to the measurement message, and the statistical period in which the message 2 is located is, for example, the statistical period 2, and the statistical period 2 is adjacent to the statistical period 1.
- the first network device changes the value of the first bit and the second bit in the first reserved bit in the VXLAN header of the packet 3 from 00 to 01 or 11, and the packet 3 belongs to the measurement packet.
- the statistical period in which the message 3 is located is, for example, a statistical period 3, and the statistical period 3 is adjacent to the statistical period 2.
- the above enumeration means for indicating the statistical period is only an example.
- the statistical period can also be indicated by other means by using the flag value of the reserved bit.
- VXLAN header of the message instead of marking the outer IP header prevents mis-marking of non-VXLAN messages.
- the method further includes:
- the first network device sends the determined number of transmitted messages to the control device.
- the first network device may collect the number of packets of the service flow in which the second packet is sent in the first time period, and obtain the statistics. The quantity is sent to the control device.
- the second network device receives the first packet of the service flow where the second packet is located, according to the VXLAN header of the packet.
- the flag value of the reserved bit may determine that the message is a measurement message, and may determine a statistical period in which the message is located, for example, as the first time period, then the second network device receives the message. And the number of the packet with the first tag value of the service flow in which the second packet received in the first time period is received by the packet with the first tag value in the service flow where the first second packet is located. In this way, the second network device can send the statistically obtained quantity to the control device.
- the control device receives the statistics of the first network device and the second network device, where the first network device sends the packet with the first tag value of the service flow where the second packet sent in the first time period is located.
- the number of the packets with the first tag value of the service flow in which the second packet received in the first time period is sent by the second network device and the control device can obtain the number according to the two statistics.
- the number of lost packets in the service flow of the second packet in the first time period (for example, the number of packets sent by the first network device minus the number of packets received by the second network device can obtain the number of lost packets) Therefore, the packet loss rate of the service flow in which the second packet is located in the first time period can be obtained.
- the method further includes:
- the first network device determines that the second packet is a packet for measuring the delay; wherein the delay is a delay of the service flow where the second packet is located in the first time period;
- the first network device sends the time when the second packet is sent to the control device.
- the source device of the service flow 1 is the first network device
- 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 the service flow 1 to measure the service.
- the delay of stream 1 during the first time period For example, if the first packet belonging to the service flow 1 sent by the first network device in the first time period is the message 1, the first network device marks the message 1 (for example, the pre-VXLAN header of the message 1) After the location is set to the flag value 1), the message 2 is obtained, and the message 2 is sent.
- the manner of marking the message 1 is as described above.
- the first network device sends the time when the message 2 is sent to the control device.
- the second network device may send the time when the first message with the tag value 1 is received to the control device (the first message with the tag value 1 received by the second network device may be the message 2 or not the message. 2). For example, when the control device subtracts the time of sending the message sent by the first network device by using the time of receiving the message sent by the second network device, the time delay of the service stream 1 in the first time period can be obtained.
- the method further includes:
- the first network device receives the third packet sent by the second network device, where the reserved bit in the VXLAN header of the third packet is set with a tag value, where the tag value is used to instruct the second network device to send the third packet.
- the statistical period in which the time of the text is located for example, if the flag value is the first tag value, indicating that the time period in which the second network device sends the third message is the first time period, if the tag value is the first time
- the second flag value indicates that the statistical period in which the second network device sends the third message is the second time period, and so on.
- the first network device determines, according to the second flag value in the VXLAN header of the third packet, that the time that the second network device sends the third packet is in the second time period, where the second time period is that the first network device collects the service of the third packet One of a plurality of statistical periods of the number of streams of the stream.
- the first network device may be the source device, and for another service flow, the first network device may also be the destination device.
- the first network device can receive the packets sent by the other source devices.
- the first network device may also have measurement packets in the packets.
- the first network device determines the reserved bits in the VXLAN header of the received packet. Whether it is marked or not can determine which messages are measurement messages, that is, the measurement message is marked, otherwise it is an ordinary message. The way of marking, as well as the information indicated by the reserved bits after marking, are described above.
- the first network device determines that the second network device sends the third packet according to the second tag value.
- timing may also be started from receiving the third message to count the number of messages in the service flow in which the third message received in the second time period is located.
- the method further includes:
- the first network device adds 1 to the number of packets in the service flow in which the third packet received in the second time period is located.
- the first network device may receive a message every time. Determine 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, 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, and the first network device may collect the service flow of the third packet received in the second time period. The number of messages in and with the second tag value is increased by one.
- the method further includes:
- the first network device sends the determined number of received messages to the control device.
- the VXLAN header of the packet can determine that the packet is a measurement packet, and can determine The statistical period in which the packet is located, for example, is determined to be the second time period, and the first network device may start counting the third report received in the second time period from the message of the service flow in which the first third message is received. The number of packets of the service flow and having the same tag as the third packet, so that the first network device can send the statistically obtained quantity to the control device.
- the first network device is the destination device of the service flow where the third packet is located
- the second network device is the source device of the service flow where the third packet is located
- the second network device may also be counted in the second time period.
- the number of the marked packets that are the same as the third packet, and the second network device may also send the statistics to the control device, and the details are not described.
- the time delay of the service flow in which the third packet is located in the second time period may be measured, and the manner of measuring the delay is as described above.
- the method for measuring the delay of the service flow in which the second packet is located in the first time period is similar, and is not described in detail.
- the source device or the destination device of the service flow can send statistics and the number of received and sent packets to the control device, and according to the introduction of FIG. 1, the packet is transmitted in the VXLAN network. It is also possible to go through some intermediate devices (for example, in Figure 1, if device D is the source network device and device G is the destination network device, then device B and device C may be a group of intermediate devices, or in another path, device F and The device E can be a group of intermediate devices. In actual applications, the intermediate devices can also send information to the control device. For example, when the device B is used as the intermediate device, the device can also collect the packets with the tag value sent in any statistical period.
- the device may also send the time of the message with a certain tag value sent in any statistical period to the control device, or send the time of the message with a certain tag value received in any statistical period to the control device.
- the manner of statistics, the manner of sending, etc. can be referred to the previous introduction.
- the intermediate device does not need to add a VXLAN header and an outer IP header to the packet, and does not need to remove the VXLAN header and the outer IP header of the packet to forward the packet.
- the intermediate device also needs to send information for measuring the performance of the service flow to the control device, and if necessary, which intermediate device sends the information for measuring the performance of the service flow to the control device, which can be pre-defined, for example, Pre-specified by the control device, or may be pre-defined by the protocol, and the like.
- an embodiment of the present invention provides a network device, which may be a first network device as described above.
- the first network device may include a first interface 401, a forwarding chip 402, and a second interface 403.
- the first interface 401 can be used for the first network device to send and receive packets of the unencapsulated VXLAN header.
- the first interface 401 can be considered as a user-oriented interface.
- the second interface 403 can be used by the first network device to receive the packet encapsulated by the VXLAN header sent by the other network device, and can be used to send the packet encapsulating the VXLAN header to the other network device.
- the second interface 403 can be considered.
- the first interface 401 and the second interface 403 are network interfaces of the network devices, and are respectively connected to different devices.
- the network interface can be a wired interface, a wireless interface, or a combination thereof.
- the wired interface can for example be an Ethernet interface.
- the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
- the wireless interface may be, for example, a wireless local area network (English: wireless local area network, abbreviation: WLAN) interface.
- the forwarding chip 402 can be configured to send and receive packets through the first interface 401 and the second interface 403, respectively encapsulate the VXLAN header and the outer IP header of the packet received through the first interface 401, and mark the VXLAN header, and count the statistics in any statistics. The number of messages with tag values sent during the time period, the number of messages with tag values received during any statistical period, and so on.
- the forwarding chip 402 can be an application-specific integrated circuit (ASIC), a programmable logic device (English: programmable logic device, abbreviation: PLD), a network processor (English: network processor), a multi-core central The processor (English: central processing unit, CPU for short) is used to implement the core of the forwarding plane or a combination thereof.
- the above PLD may be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD).
- Field-programmable gate array English: field-programmable gate array, abbreviation: FPGA
- general array logic English: general array logic, abbreviation: GAL
- the second interface 403 may include one interface or multiple interfaces. Then, the second interface 403 can send and receive packets, and the second interface 403 can send and receive packets through one interface or multiple interfaces included in the second interface 403.
- the forwarding chip 402 can send information to the control device through the second interface 403.
- the information sent by the forwarding chip 402 to the control device can be used to count performance of a certain service flow in any statistical period, such as the number of lost packets, Delay and so on.
- the interface that interacts with other network devices, and the interface that interacts with the control device may use the same interface in the second interface 403, or may use different interfaces included in the second interface 403.
- each interface in FIG. 4 is only an example. In practical applications, the form of the interface, the deployment mode, and the like are obviously not limited thereto.
- the device in FIG. 4 in the embodiment of the present invention corresponds to the method described in the process of FIG. 3, and the work performed by each module in the device, and the detailed description in the execution process, etc., may be referred to the method part, and details are not described herein.
- the first network device when it encapsulates the VXLAN header for the first packet, it may be a reserved bit flag in the VXLAN header, that is, the reserved bit in the VXLAN header is set to the first tag value, and the first tag is used.
- the value may indicate which statistical period the second network device sends the second packet, and the different packets may 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 periods. The test granularity of network performance is refined, the accuracy of network performance testing is improved, and the value available for test results is higher.
- the disclosed apparatus and method can be implemented in other ways.
- the device embodiments described above are merely illustrative.
- the division of the unit or unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
- the units described as separate components may or may not be physically separated, and the 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.
- the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may also be an independent physical module.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- all or part of the technical solution of the present invention may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (which may be a personal computer, A server, or network device, or the like, or a processor (English: processor) performs all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing 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)
- 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
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
本申请要求于2015年10月20日提交中国专利局、申请号为201510682620.2、发明名称为“一种报文发送、接收方法及网络设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 20151068262, filed on October 20, 2015, entitled "A Message Transmission, Receiving Method, and Network Equipment", the entire contents of which are incorporated by reference. In this application.
本申请涉及通信领域,特别涉及一种报文发送、接收方法及网络设备。The present application relates to the field of communications, and in particular, to a packet sending and receiving method and a network device.
虚拟扩展局域网(英文:Virtual Extensible local area network,VXLAN)是一种覆盖(英文:overlay)的网络技术,可用于改善大型云计算部署的扩展性问题。VXLAN技术使用类似虚拟局域网(英文:virtual local area network,VLAN)的封装技术,在开放式系统互联(英文:Open Systems Interconnection,OSI)4层的用户数据报协议(英文:User Datagram Protocol,UDP)报文内用特定的目的UDP端口号封装基于媒体访问控制(英文:media access control,MAC)的二层以太网帧。Virtual Extensible local area network (VXLAN) is a coverage (English: overlay) network technology that can be used to improve the scalability of large cloud computing deployments. VXLAN technology uses a virtual local area network (VLAN) encapsulation technology in the open system interconnection (English: Open Systems Interconnection, OSI) 4 layer user datagram protocol (English: User Datagram Protocol, UDP) A Layer 2 Ethernet frame based on media access control (MAC) is encapsulated in the message with a specific destination UDP port number.
VXLAN具有以下特点:VXLAN has the following features:
24位的VXLAN网络标识符(英文:VXLAN Network Identifier,VNI),可用于指示通信系统中的虚拟机(英文:virtual machine,VM)所在的独立的VXLAN overlay网络,位于不同的VXLAN overlay网络中的虚拟机之间无法通信。24-bit VXLAN Network Identifier (VNI), which can be used to indicate the independent VXLAN overlay network where virtual machines (VMs) in the communication system are located, located in different VXLAN overlay networks. Unable to communicate between virtual machines.
在VXLAN网络中,各个租户可以独立使用各自的业务。在业务的使用过程中,可能涉及到对网络性能的测试,以在了解当前网络的性能的基础上确定如何使用业务。In a VXLAN network, individual tenants can use their own services independently. During the use of the service, testing of network performance may be involved to determine how to use the service based on the performance of the current network.
目前,测试网络性能时,只能测试物理网络,然而各个租户来说,各自的网络状况可能是相同的。可见,对物理网络进行性能测试的粒度较粗,得到的测试结果不够准确。Currently, when testing network performance, only the physical network can be tested. However, for each tenant, the respective network conditions may be the same. It can be seen that the performance test of the physical network is coarser, and the obtained test result is not accurate enough.
发明内容Summary of the invention
本申请提供一种报文发送、接收方法及网络设备,用于解决目前在对网络进行性能测试时粒度较粗的技术问题。The present application provides a packet sending and receiving method and a network device, which are used to solve the technical problem that the granularity is relatively large when performing performance testing on the network.
第一方面,提供一种报文发送方法,包括:The first aspect provides a packet sending method, including:
第一网络设备接收第一报文; Receiving, by the first network device, the first packet;
所述第一网络设备在所述第一报文外封装VXLAN头及外层IP头,以得到第二报文;其中,所述VXLAN头中的预留位被设置为第一标记值,所述第一标记值用于指示所述第一网络设备发送所述第二报文的时间处于第一时段,所述第一时段为所述第一网络设备统计所述第二报文所在业务流的报文数量的多个统计时段中的一个;The first network device encapsulates the VXLAN header and the outer IP header in the first packet to obtain a second packet, where the reserved bit in the VXLAN header is set to the first label value. The first flag value is used to indicate that the time that the first network device sends the second packet is in a first time period, where the first time period is that the first network device collects a service flow of the second packet One of a plurality of statistical periods of the number of messages;
所述第一网络设备发送所述第二报文。The first network device sends the second packet.
VXLAN头中的预留位被设置为用于指示发送第二报文的时间位于哪个统计时段,从而可以根据报文的VXLAN头里的预留位来区分报文。在进行网络性能测量时,可以测试VXLAN网络在不同的统计时段内的性能,而不是只能测试物理网络,细化了对网络性能的测试粒度。The reserved bit in the VXLAN header is set to indicate which statistical period the time at which the second message is sent is located, so that the message can be distinguished according to the reserved bits in the VXLAN header of the message. When performing network performance measurement, you can test the performance of the VXLAN network in different statistical periods, instead of only testing the physical network, and refine the test granularity of network performance.
结合第一方面,在第一方面的第一种可能的实现方式中,所述方法还包括:In conjunction with the first aspect, in a first possible implementation of the first aspect, the method further includes:
所述第一网络设备确定在所述第一时段内发送的所述第二报文所在业务流中的报文的数量;Determining, by the first network device, the number of packets in the service flow in which the second packet is sent in the first time period;
所述第一网络设备向控制设备发送所述确定的发送的报文的数量。The first network device sends the determined number of sent packets to the control device.
若要统计第二报文所在的业务流在第一时段内的丢包数量,那么,第一网络设备可以统计在第一时段内发送的第二报文所在的业务流的报文的数量,并将统计得到的数量发送给控制设备。另外,接收第二报文所在的业务流的报文的网络设备也可以将第一时段内接收的第二报文所在的业务流的报文的数量发送给控制设备,从而控制设备就可以计算得到第二报文所在的业务流在第一时段内的丢包数量。The number of the packets of the service flow in which the second packet is sent in the first time period may be counted, and the number of the packets of the service flow in the first time period may be counted. The statistically obtained quantity is sent to the control device. In addition, the network device that receives the packet of the service flow in which the second packet is located may also send the number of the service packet of the service packet that is received in the first time period to the control device, so that the control device can calculate The number of lost packets in the first time period of the service flow in which the second packet is located is obtained.
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述方法还包括:In conjunction with the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the method further includes:
所述第一网络设备接收第二网络设备发送的第三报文;其中,所述第三报文的VXLAN头中的预留位被设置为第二标记值;Receiving, by the first network device, a third packet sent by the second network device, where the reserved bit in the VXLAN header of the third packet is set to a second tag value;
所述第一网络设备根据所述第三报文的VXLAN头中的所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段,所述第二时段为所述第一网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个。Determining, by the first network device, that the time that the second network device sends the third packet is in a second time period according to the second tag value in the VXLAN header of the third packet, where the second time period is And counting, by the first network device, one of a plurality of statistical periods of the number of packets of the service flow in which 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 is the destination device, it can receive the packets sent by the other source devices. The first network device may also have measurement packets in the packets. The first network device determines the reserved bits in the VXLAN header of the received packet. Whether it is marked or not can determine which messages are measurement messages, that is, the measurement message is marked, otherwise it is an ordinary message.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述方法还包括:In conjunction with the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the method further includes:
所述第一网络设备确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量;Determining, by the first network device, the number of packets in the service flow of the third packet received in the second time period;
所述第一网络设备向控制设备发送所述确定的接收的报文的数量。The first network device sends the determined number of received messages to the control device.
第一网络设备作为目的设备时,可以从接收到第一个第三报文所在的业务流的报文开始统计在第二时段内接收的第三报文所在的业务流的且具有与第三报文相同的标记的报文的数量,这样,第一网络设备可以将统计得到的数量发送给控制设备,同样的,发送第三报文所在的业务流的报文的网络设备也可以将第一时段内发送的第三报文所在的业务流的报文的数量发送给控制设备,从而控制设备就可以计算得到第三报文所在的业务流在第二时段内的丢包数量。When the first network device is used as the destination device, the service flow of the third packet received in the second time period may be counted from the packet that receives the service flow of the first third packet, and has a third The number of packets marked with the same packet, so that the first network device can send the statistics to the control device. Similarly, the network device that sends the packet of the service flow where the third packet is located can also be used. The number of packets of the service flow in which the third packet is sent in a period of time is sent to the control device, so that the control device can calculate the number of packets lost in the second period of the service flow in which the third packet is located.
第二方面,提供一种报文接收方法,包括:The second aspect provides a packet receiving method, including:
第一网络设备接收第二网络设备发送的第三报文;其中,所述第三报文的VXLAN头中的预留位被设置为第二标记值;Receiving, by the first network device, a third packet sent by the second network device, where the reserved bit in the VXLAN header of the third packet is set to a second tag 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 according to the second tag value. The time period in which the device sends the third packet is in a second time period; the second time period is one of a plurality of statistical periods in which the first network device collects the number of packets of the service flow in which the third packet is located;
所述第一网络设备从接收所述第三报文开始计时,以统计在所述第二时段内接收的所述第三报文所在业务流中的报文的数量。The first network device starts timing to receive the third packet, to count the number of packets in the service flow of the third packet received in the second time period.
第一网络设备通过确定接收的报文的VXLAN头中的预留位是否被标记就可以确定哪些报文是测量报文,即,被标记的就是测量报文,否则就是普通报文。如果第三报文为第一网络设备接收的第一个具有第二标记值的报文,那么第一网络设备除了根据第二标记值确定第二网络设备发送第三报文的时间处于第二时段之外,还可以从接收第三报文开始计时,以统计在第二时段内接收的第三报文所在业务流中的报文的数量,从而控制设备可以获得第三报文所在的业务流在第二时段内的丢包数量。The first network device can determine which messages are measurement messages by determining whether the reserved bits in the VXLAN header of the received message are marked, that is, the measurement message is marked, otherwise it is an ordinary message. 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 second network device sends the third packet according to the second tag value. In addition to the time period, the device may start counting from the third packet to collect the number of packets in the service flow of the third packet received in the second time period, so that the control device can obtain the service where the third packet is located. The number of lost packets in the second time period.
结合第二方面,在第二方面的第一种可能的实现方式中,在所述第一网络设备从接收所述第三报文开始计时之后,还包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, after the first network device starts timing to receive the third packet, the method further includes:
所述第一网络设备接收所述第二网络设备发送的第四报文; Receiving, by the first network device, a fourth packet sent by the second network device;
所述第一网络设备根据所述第四报文的VXLAN头确定所述第四报文的VXLAN头中的预留位被设置为所述第二标记值;Determining, by the first network device, that a reserved bit in the VXLAN header of the fourth packet is set to the second tag value according to a VXLAN header of the fourth packet;
所述第一网络设备将在所述第二时段内接收的所述第三报文所在业务流中的报文的数量加1。The first network device adds 1 to the number of packets in the service flow in which the third packet is received in the second time period.
在这种实现方式中,提供了一种统计报文数量的方式,即,第一网络设备每接收到一个报文,都可以确定该报文是否属于第三报文所在的业务流以及该报文是否具有第二标记值。若第一网络设备确定第四报文属于第三报文所在的业务流且具有第二标记值,那么第一网络设备可以将统计的在第二时段内接收的第三报文所在业务流中的且具有第二标记值的报文的数量加1。In this implementation manner, a method for collecting the number of statistics 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 the 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 collect the statistics of the third packet received in the second time period. And the number of messages with the second tag value is increased by one.
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述方法还包括: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 of the third packet received in the second time period;
所述第一网络设备向控制设备发送所述确定的接收的报文的数量。The first network device sends the determined number of received messages to the control device.
即,第一网络设备可以统计在第二时段内接收的第三报文所在的业务流的且具有与第三报文相同的标记的报文的数量,第一网络设备可以将统计得到的数量发送给控制设备,同样的,发送第三报文所在的业务流的报文的网络设备也可以将第一时段内发送的第三报文所在的业务流的报文的数量发送给控制设备,从而控制设备就可以计算得到第三报文所在的业务流在第二时段内的丢包数量。That is, the first network device may count the number of packets of the service flow in which the third packet received in the second time period is the same as that of the third packet, and the number of statistics that the first network device can obtain. The network device that sends the packet of the service flow in which the third packet is sent may also send the number of the service packet of the service packet in the first time period to the control device. Therefore, the control device can calculate the number of lost packets of the service flow in which the third packet is located in the second time period.
第三方面,提供一种网络设备,包括第一接口、转发芯片及第二接口;其中,所述转发芯片用于:A third aspect provides a network device, including a first interface, a forwarding chip, and a second interface, where the forwarding chip is configured to:
通过所述第一接口接收第一报文;Receiving, by the first interface, a first packet;
在所述第一报文外封装VXLAN头及外层IP头,以得到第二报文;其中,所述VXLAN头中的预留位被设置为第一标记值,所述第一标记值用于指示所述网络设备发送所述第二报文的时间处于第一时段,所述第一时段为所述网络设备统计所述第二报文所在业务流的报文数量的多个统计时段中的一个;Encapsulating the VXLAN header and the outer IP header outside the first packet to obtain a second packet, where the reserved bit in the VXLAN header is set to a first tag value, and the first tag value is used by The time period for indicating that the network device sends the second packet is in a first period, where the first time period is that the network device collects statistics of the number of packets of the service flow where the second packet is located. one of;
通过所述第二接口发送所述第二报文。Sending the second packet by using the second interface.
结合第三方面,在第三方面的第一种可能的实现方式中,所述网络设备还包括第三接口;所述转发芯片还用于:In conjunction with 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, in the first time period, the number of packets in the service flow where the second packet is sent;
通过所述第三接口向控制设备发送所述确定的发送的报文的数量。Sending, by the third interface, the determined number of sent messages to the control device.
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述转发芯片还用于:In conjunction with the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the forwarding chip is further configured to:
通过所述第二接口接收第二网络设备发送的第三报文;其中,所述第三报文的VXLAN头中的预留位被设置为第二标记值;Receiving, by the second interface, a third packet sent by the second network device, where the reserved bit in the VXLAN header of the third packet is set to a second tag value;
根据所述第三报文的VXLAN头中的所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段,所述第二时段为所述网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个。Determining, according to the second tag value in the VXLAN header of the third packet, that the time that the second network device sends the third packet is in a second time period, where the second time period is the network device statistics. One of a plurality of statistical periods of the number of packets of the service flow in which the third packet is located.
结合第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,所述转发芯片还用于:In conjunction with the second possible implementation of the third aspect, in a third possible implementation manner of the third aspect, the forwarding chip is further configured to:
确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量;Determining, by the number of packets in the service flow, where the third packet is received in the second time period;
通过所述第二接口向控制设备发送所述确定的接收的报文的数量。Sending, by the second interface, the determined number of received messages to the control device.
第四方面,提供一种网络设备,包括接口及转发芯片;其中所述转发芯片用于:A fourth aspect provides a network device, including an interface and a forwarding chip, where the forwarding chip is configured to:
通过所述接口接收第二网络设备发送的第三报文;所述第三报文的VXLAN头中的预留位被设置为第二标记值;Receiving, by the interface, a third packet sent by the second network device; the reserved bit in the VXLAN header of the third packet is set to a second tag value;
若所述第三报文为所述网络设备接收的第一个具有所述第二标记值的报文,则根据所述第二标记值确定所述第二网络设备发送所述第三报文的时间处于第二时段;所述第二时段为所述网络设备统计所述第三报文所在业务流的报文数量的多个统计时段中的一个;If the third packet is the first packet that is received by the network device and has the second tag value, determining, by the second tag value, that the second network device sends the third packet The second time period is one of a plurality of statistical periods in which the network device counts the number of packets of the service flow in which the third packet is located;
从接收所述第三报文开始计时,以统计在所述第二时段内接收的所述第三报文所在业务流中的报文的数量。And counting from the receipt of the third packet, to count the number of packets in the service flow of the third packet received in the second time period.
结合第四方面,在第四方面的第一种可能的实现方式中,所述转发芯片还用于:In conjunction with the fourth aspect, in a first possible implementation manner of the fourth aspect, the forwarding chip is further configured to:
在从接收所述第三报文开始计时之后,通过所述接口接收所述第二网络设备发送的第四报文;Receiving, by the interface, the fourth packet sent by the second network device after receiving the timing of receiving the third packet;
根据所述第四报文的VXLAN头确定所述第四报文的VXLAN头中的预留位被设置为所述第二标记值;将在所述第二时段内接收的所述第三报文所在业务流中的报文的数量加1。Determining, according to the VXLAN header of the fourth packet, that a reserved bit in the VXLAN header of the fourth packet is set to the second flag value; and the third packet to be received in the second time period Add 1 to the number of packets in the service flow.
结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述转发芯片还用于:In conjunction with the fourth aspect, or the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the forwarding chip is further configured to:
确定在所述第二时段内接收的所述第三报文所在业务流中的报文的数量; Determining, by the number of packets in the service flow, where the third packet is received in the second time period;
通过所述接口向控制设备发送所述确定的接收的报文的数量。And transmitting, by the interface, the determined number of received messages to the control device.
第五方面,提供一种用于进行报文发送的网络设备,该网络设备包括用于执行第一方面的方法的模块。In a fifth aspect, a network device for transmitting a message is provided, the network device comprising means for performing the method of the first aspect.
第六方面,提供一种用于进行报文接收的网络设备,该网络设备包括用于执行第二方面的方法的模块。In a sixth aspect, a network device for receiving a message is provided, the network device comprising means for performing the method of the second aspect.
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所介绍的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly described below. It is obvious that the following drawings are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1为本发明实施例中VXLAN网络的一种场景示意图;FIG. 1 is a schematic diagram of a scenario of a VXLAN network according to an embodiment of the present invention;
图2为本发明实施例中报文发送方法的流程图;2 is a flowchart of a method for sending a message according to an embodiment of the present invention;
图3为本发明实施例中第二报文的结构示意图;3 is a schematic structural diagram of a second packet according to an embodiment of the present invention;
图4为本发明实施例中第一网络设备的结构示意图。FIG. 4 is a schematic structural diagram of a first network device according to an embodiment of the present invention.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述。The technical solutions in the embodiments of the present invention will be clearly described below in conjunction with the accompanying drawings in the embodiments of the present invention.
以下,对本发明中的部分用语进行解释说明。Hereinafter, some of the terms in the present invention will be explained.
1)网络设备,可以是交换机(英文:switch)或路由器(英文:router)等网络中的物理设备,也可以是虚拟交换机等网络中的虚拟设备。1) A network device, which 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) The control device, the control device may be a stand-alone device, such as a server or a router, or a function module located in another device, for example, a function module located in a device such as a server or a router, as long as The control device can communicate with the network device.
3)业务流。定义一组特征,凡是满足这一组特征的报文就属于一个业务流。比如,可以用一个报文的头的元组作为一组特征,元组的值相同的报文就属于同一个业务流。例如,作为特征的元组为五元组,该五元组可以包括:源网际协议(英文:Internet Protocol,IP)地址、源端口号、目的IP地址、目的端口号和传输层协议类型。3) Business flow. A set of features is defined, and any message that satisfies this set of characteristics belongs to a service flow. For example, a tuple of the header of a message can be used as a set of features, and packets with the same value of the tuple belong to the same service flow. For example, the tuple as a feature is a quintuple, and the quintuple may include: a source Internet Protocol (IP) address, a source port number, a destination IP address, a destination port number, and a transport layer protocol type.
4)“多个”是指两个或两个以上。 4) "Multiple" means two or more.
首先介绍一下本发明的应用场景。First, the application scenario of the present invention will be introduced.
请参见图1,为本发明实施例中的一种可能的VXLAN网络示意图。图1中的VXLAN网络包括A~I等设备,其中设备B~G为网络设备,设备A为控制设备,设备H为通过设备D连入网络的服务器,例如在设备H中运行有虚拟机VM1,设备I为通过设备G连入网络的服务器,例如在设备I中运行有虚拟机VM2。从图1中的连接关系可以看出,控制设备A能够与其中每个网络设备通信。可替换地,控制设备也可以只与部分网络设备通信。FIG. 1 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, where 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, virtual machine VM1 is running in device H. The device I is a server connected to the network through the device G, for example, the virtual machine VM2 is running in the device 1. As can be seen from the connection relationship in Fig. 1, the control device A is able to communicate with each of the network devices. Alternatively, the control device can also communicate only with a portion of the network device.
例如,虚拟机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 virtual machine VM1 wants to send message 1 to virtual machine VM2, virtual machine VM1 sends message 1 to device D through device H. After receiving the packet 1, the 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 the device G, and the device D is the packet. The VXLAN header and the outer IP header are added to obtain the packet 2, the destination network device of the packet 2 is the device G, and the device D sends the packet 2 to the device G. When sending packet 2 to device G, it will pass through other devices in the middle. 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 in conjunction with the drawings.
请参见图2,本发明实施例提供一种报文发送方法,该方法可以由网络设备执行,该网络设备例如可以是图1中的设备D或者设备G,例如将该网络设备称为第一网络设备。该方法的流程描述如下。Referring to FIG. 2, an embodiment of the present invention provides a packet sending method, which may be performed by a network device, for example, the device D or the device G in FIG. 1, for example, the network device is referred to as a first Internet equipment. The flow of the 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 in 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 the packet sent by the virtual machine, for example, the packet is referred to as the first packet, and the first packet has an IP header, and the destination address of the first packet is the address of another virtual machine. The virtual machine that sends the first message is, for example, in a device such as a terminal or server connected to the first network device. The virtual machine 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 is located in the same VXLAN network as the first network device. For example, in FIG. 1 , the first network device is, for example, the device D in FIG. 1 , and the network device (ie, the second network device) serving the server running the virtual machine that receives the first packet may be the one 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。For example, according to the packet header of the first packet, it can be determined that the first packet belongs to service stream 1.
第一网络设备在接收第一报文后,查表(例如转发表或流表)确定VXLAN网关的地址,将该地址作为外层IP头的目的地址。 After receiving the first packet, the first network device determines a VXLAN gateway address by using a lookup table (for example, a forwarding table or a flow table), 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 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 to be measured, the first network device may mark the second packet, for example, marking the second packet with the first tag value, then the first network device is to be in the second packet. Select one or more bits in the outer VXLAN header to mark it.
例如,第一网络设备可以标记第二报文的外层VXLAN头(以下简称VXLAN头)中的预留位。VXLAN头中的预留位有32位。第一网络设备可以标记VXLAN头中的全部预留位,也可以标记VXLAN头中的一些预留位,比如可以标记其中的两个预留位。第一网络设备可以标记第二报文的VXLAN头的预留位中的至少两个位。在第一网络设备对第二报文的VXLAN头的预留位中的至少两个位标记后,第二报文的VXLAN头的预留位被设置为第一标记值。For example, the first network device may mark a reserved bit in an outer VXLAN header (hereinafter referred to as a VXLAN header) of the second message. The reserved bits in the VXLAN header have 32 bits. 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, two reserved bits may be marked. The first network device may mark at least two of the reserved bits of the VXLAN header of the second message. After the first network device marks at least two of the reserved bits of the VXLAN header of the second message, the reserved bit of the VXLAN header of the second message is set to the first tag value.
本发明实施例中,标记是指将VXLAN头中的一个或多个位的值修改为默认值之外的值,修改后的值为标记值。例如要标记VXLAN头中的一个位,该位的默认值为0,则标记该位后,该位的值被修改为1。例如,第一网络设备可以对第二报文的VXLAN头的预留位中的第一位和第二位进行标记,第一位和第二位的默认值例如均为0,则标记值可以为01,10,11中的任意一个。In the embodiment of the present invention, the tag 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 a tag value. For example, to mark a bit in the VXLAN header, the default value of this bit is 0, then the value of this bit is modified to 1 after the bit is marked. For example, the first network device may mark the first bit and the second bit in the reserved bits of the VXLAN header of the second packet, and the default values of the first bit and the second bit are both 0, for example, the tag value may be It is any one of 01, 10, and 11.
VXLAN头中的预留位例如被设置为第一标记值,第一标记值用于指示第一网络设备发送第二报文的时间处于第一时段,第一时段为第一网络设备统计第二报文所在业务流的报文数量的多个统计时段中的一个。The reserved bit in the VXLAN header is set to a first tag value, for example, 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 second time in the first network device. One of the multiple statistical periods of the number of packets in the service flow of the packet.
多个统计时段可以为连续的多个时段,例如第一时段为0s~10s,第二时段为10s~20s,第三时段为20s~30s,等等。当然各统计时段的时长也可以不相等。The plurality of statistical periods may be consecutive periods, for example, the first period is 0s to 10s, the second period is 10s to 20s, the third period is 20s to 30s, and the like. Of course, the duration of each statistical period may also be unequal.
第二报文是第一时段开始后第一网络设备发送的报文,例如第二报文可以是第一时段内第一网络设备发送的属于第二报文所在的业务流的任意一个报文。第二报文的VXLAN头的预留位的第一标记值可以用于指示第一网络设备发送第二报文的时间处于第一时段。如果还要测量第二时段内第二报文所在的业务流的性能,就对第二时段内属于第二报文所在的业务流的报文进行标记。同样的也可以对这些报文的VXLAN头的预留位进行标记。对第二时段内属于第二报文所在的业务流的报文设置的标记值与第一标记值需不同,以区分相邻时段的报文。例如可以将二时段内属于第二报文所在的业务流的报文预留位设置为第二标记值。再例如,如果还要测量第三时段内第二报文所在的业务流 的性能,就对第三时段内属于第二报文所在的业务流的报文进行标记。同样的也可以对这些报文的VXLAN头的预留位进行标记。对第三时段内属于第二报文所在的业务流的报文设置的标记值与第二标记值需不同,以区分相邻时段的报文,对第三时段内属于第二报文所在的业务流的报文设置的标记值与第一标记值可以相同或者也可以不同。即,在设置标记值时,只要相邻时段的标记值不同即可,对于不相邻的时段,标记值可重复使用,以减少标记值的复杂度。The second packet is a packet sent by the first network device after the start of the first time period. For example, the second packet may be any packet that belongs to the service flow of the second packet sent by the first network device in the first time period. . The first flag value of the reserved bit of 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 packet belonging to the service flow in which the second packet is located in the second time period is marked. It is also possible to mark the reserved bits of the VXLAN header of these messages. The tag value set in the packet of the service flow in which the second packet is located in the second time period is different from the first tag value to distinguish the packets in the adjacent time period. For example, the message reserved bit of the service flow in which the second packet is located in the two time periods may be set as the second tag value. For another example, if the traffic of the second message in the third time period is also measured, The performance of the message that belongs to the service flow in which the second packet is located in the third time period is marked. It is also possible to mark the reserved bits of the VXLAN header of these messages. The value of the tag set in the packet corresponding to the service flow in which the second packet is located in the third time period is different from the value of the second tag, so as to distinguish the packet in the adjacent time period, and the second packet belongs to the second packet. The tag value set by the message of the service flow may be the same as or different from the first tag value. That is, when the tag value is set, as long as the tag values of the adjacent time periods are different, the tag values can be reused for the non-adjacent time periods to reduce the complexity of the tag values.
例如请参见图3,为第二报文的结构示意图,第一报文(即图3中的原始报文)中包括内层以太网头(英文:inner Ethernet header)以及净荷(英文:payload)。第一报文被封装VXLAN头(英文:VXLAN header)和外层UDP头(英文:outer UDP header)后得到第二报文。For example, 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 first packet is encapsulated in a VXLAN header (English: VXLAN header) and an outer UDP header (English: outer UDP header) to obtain a second packet.
图3中,VXLAN头中包括VXLAN标志位(英文:VXLAN Flags)、VXLAN网络标识(英文:VXLAN Network Identifier,VNI)以及两段预留(英文:Reserved)位,为描述方便,将这两段预留位分别称为第一段预留位(例如为图3中的24bits的预留位)和第二段预留位(例如为图3中的8bits的预留位)。In Figure 3, the VXLAN header includes VXLAN flag bits (English: VXLAN Flags), VXLAN network identifier (VXLAN Network Identifier, VNI), and two reserved (English: Reserved) bits. The reserved bits are respectively referred to as a first segment reserved bit (for example, a reserved bit of 24 bits in FIG. 3) and a second reserved bit (for example, a reserved bit of 8 bits in FIG. 3).
VXLAN Flags占据8位,这8位中,I位(例如为图3中从右至左第四位)为1,以示报文有效,其余7位均为R位,均为预留位(这些预留位可以不是本发明实施例中用于进行标记的预留位),默认设置为0。VXLAN Flags occupies 8 bits. Among the 8 bits, the I bit (for example, the right-to-left fourth bit in Figure 3) is 1, to indicate that the message is valid, and the remaining 7 bits are R bits, which are reserved bits ( These reserved bits may not be reserved bits for marking in the embodiment of the present invention, and the default setting is 0.
第一段预留位占据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 multiple tenants can be assigned to a single tenant.
第二段预留位占据8位。The second reserved position occupies 8 bits.
第二报文的VXLAN头中的第一段预留位和第二段预留位均可以用于标记。第一网络设备可以任意选择其中的至少两位进行标记。The first reserved bit and the second reserved bit in the VXLAN header of the second message can be used for marking. The first network device can arbitrarily select at least two of them for marking.
对VXLAN头中的预留位进行标记,可以用于指示两层含义:一、该报文是测量报文;二、标记后的预留位所对应的标记值(例如为第一标记值)用于指示该报文所在的统计时段,即用于指示第一网络设备发送该报文的时间所处的统计时段。Marking the reserved bits in the VXLAN header can be used to indicate two layers of meaning: 1. The message is a measurement message; 2. The tag value corresponding to the reserved bit after the tag (for example, the first tag value) It is used to indicate the statistical period in which the packet is located, that is, the statistical period in which the time when the first network device sends the packet is indicated.
比如,第一网络设备选择将报文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 selects to mark the first bit and the second bit of the first reserved bit in the VXLAN header of the message 1, for example, changing the value of the two bits from 00 to 01. Then, the message 1 belongs to the measurement message, and the statistical period in which the message 1 is located is the statistical period corresponding to the tag value of the VXLAN header. For example, the statistical period is the statistical period 1. For example, the first network device takes the first bit and the second bit of the first reserved bit in the VXLAN header of the message 2. If the value is changed from 00 to 10, the message 2 belongs to the measurement message, and the statistical period in which the message 2 is located is, for example, the statistical period 2, and the statistical period 2 is adjacent to the statistical period 1. For example, the first network device changes the value of the first bit and the second bit in the first reserved bit in the VXLAN header of the packet 3 from 00 to 01 or 11, and the packet 3 belongs to the measurement packet. The statistical period in which the message 3 is located is, for example, a statistical period 3, and the statistical period 3 is adjacent to the statistical period 2.
当然,以上列举指示统计时段的方式只是举例,在实际应用中也可以通过预留位的标记值,采用其他方式来指示统计时段。Of course, the above enumeration means for indicating the statistical period is only an example. In the actual application, the statistical period can also be indicated by other means by using the flag value of the reserved bit.
对报文的VXLAN头进行标记,而不是对外层IP头进行标记,可以防止对非VXLAN报文进行误标记。Marking the VXLAN header of the message instead of marking the outer IP header prevents mis-marking of non-VXLAN messages.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备确定在第一时段内发送的第二报文所在业务流中的报文的数量;Determining, by the first network device, the number of the packets in the service flow where the second packet sent in the first time period is located;
第一网络设备向控制设备发送确定的发送的报文的数量。The first network device sends the determined number of transmitted messages to the control device.
若要统计第二报文所在的业务流的丢包数量,那么,第一网络设备可以统计在第一时段内发送的第二报文所在的业务流的报文的数量,并将统计得到的数量发送给控制设备。To count the number of packets of the service flow in which the second packet is located, the first network device may collect the number of packets of the service flow in which the second packet is sent in the first time period, and obtain the statistics. 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, the second network device receives the first packet of the service flow where the second packet is located, according to the VXLAN header of the packet. The flag value of the reserved bit (for example, the first tag value) may determine that the message is a measurement message, and may determine a statistical period in which the message is located, for example, as the first time period, then the second network device receives the message. And the number of the packet with the first tag value of the service flow in which the second packet received in the first time period is received by the packet with the first tag value in the service flow where the first second packet is located. In this way, the second network device can send the statistically obtained quantity to the control device.
控制设备分别接收第一网络设备和第二网络设备发送的统计数量,其中第一网络设备发送的是在第一时段内发送的第二报文所在的业务流的具有第一标记值的报文的数量,第二网络设备发送的是在第一时段内接收的第二报文所在的业务流的具有第一标记值的报文的数量,则控制设备根据这两个统计数量就可以得到第二报文所在的业务流在第一时段内的丢包数量(例如用第一网络设备发送的报文的数量减去第二网络设备接收的报文的数量就可以得到该丢包数量),从而可以得到第二报文所在的业务流在第一时段内的丢包率。The control device receives the statistics of the first network device and the second network device, where the first network device sends the packet with the first tag value of the service flow where the second packet sent in the first time period is located. The number of the packets with the first tag value of the service flow in which the second packet received in the first time period is sent by the second network device, and the control device can obtain the number according to the two statistics. The number of lost packets in the service flow of the second packet in the first time period (for example, the number of packets sent by the first network device minus the number of packets received by the second network device can obtain the number of lost packets) Therefore, the packet loss rate of the service flow in which the second packet is located in the first time period 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 a delay of the service flow where the second packet is located in the first time period;
第一网络设备将发送第二报文的时刻发送给控制设备。The first network device sends the time when the second packet 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 the service flow 1 is the first network device, and the destination device is the second network device, and the first network device and the second network device agree in advance to select the first sent packet in the service flow 1 to measure the service. The delay of stream 1 during the first time period. For example, if the first packet belonging to the service flow 1 sent by the first network device in the first time period is the message 1, the first network device marks the message 1 (for example, the pre-VXLAN header of the message 1) After the location is set to the flag value 1), the message 2 is obtained, and the message 2 is sent. The manner of marking the message 1 is as described above. The first network device sends the time when the message 2 is sent to the control device. The second network device may send the time when the first message with the tag value 1 is received to the control device (the first message with the tag value 1 received by the second network device may be the message 2 or not the message. 2). For example, when the control device subtracts the time of sending the message sent by the first network device by using the time of receiving the message sent by the second network device, the time delay of the service stream 1 in the first time period can be obtained.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备接收第二网络设备发送的第三报文;其中,第三报文的VXLAN头中的预留位设置有标记值,其中,标记值用于指示第二网络设备发送第三报文的时间所处的统计时段,例如,若该标记值为第一标记值,则指示第二网络设备发送第三报文的时间所处的统计时段为第一时段,若该标记值为第二标记值,则指示第二网络设备发送第三报文的时间所处的统计时段为第二时段,等等。The first network device receives the third packet sent by the second network device, where the reserved bit in the VXLAN header of the third packet is set with a tag value, where the tag value is used to instruct the second network device to send the third packet. The statistical period in which the time of the text is located, for example, if the flag value is the first tag value, indicating that the time period in which the second network device sends the third message is the first time period, if the tag value is the first time The second flag value indicates that the statistical period in which the second network device sends the third message is the second time period, and so on.
第一网络设备根据第三报文的VXLAN头中的第二标记值确定第二网络设备发送第三报文的时间处于第二时段,第二时段为第一网络设备统计第三报文所在业务流的报文数量的多个统计时段中的一个。The first network device determines, according to the second flag value in the VXLAN header of the third packet, that the time that the second network device sends the third packet is in the second time period, where the second time period is that the first network device collects the service of the third packet One of a plurality of statistical periods of the number of streams of the stream.
即,对于一个业务流来说,第一网络设备可以是源设备,而对于另外的业务流来说,第一网络设备也可以是目的设备。第一网络设备在作为目的设备时,可以接收另外的源设备发送的报文,这些报文里也可能有测量报文,第一网络设备通过确定接收的报文的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 is the destination device, it can receive the packets sent by the other source devices. The first network device may also have measurement packets in the packets. The first network device determines the reserved bits in the VXLAN header of the received packet. Whether it is marked or not can determine which messages are measurement messages, that is, the measurement message is marked, otherwise it is an ordinary message. The way of marking, as well as the information indicated by the reserved bits after marking, 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 second network device sends the third packet according to the second tag value. In addition to the second time period, timing may also be started from receiving the third message to count the number of messages in the service flow in which the third message received in the second time period is located.
可选的,在第一网络设备从接收第三报文开始计时之后,还包括: Optionally, after the first network device starts timing by 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头中的预留位被设置为第二标记值;Determining, by the first network device, that the reserved bit in the VXLAN header of the fourth packet is set to the second tag value according to the VXLAN header of the fourth packet;
第一网络设备将在第二时段内接收的第三报文所在业务流中的报文的数量加1。The first network device adds 1 to the number of packets in the service flow in which the third packet received in the second time period is located.
即,若第一网络设备要统计在第二时段内接收的第三报文所在的业务流的具有第二标记值的报文的数量,那么第一网络设备每接收到一个报文,都可以确定该报文是否属于第三报文所在的业务流以及该报文是否具有第二标记值。例如,第一网络设备确定第四报文属于第三报文所在的业务流且具有第二标记值,那么第一网络设备可以将统计的在第二时段内接收的第三报文所在业务流中的且具有第二标记值的报文的数量加1。That is, if the first network device is to count the number of packets with the second tag value of the service flow in which the third packet received in the second time period is located, the first network device may receive a message every time. Determine 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, 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, and the first network device may collect the service flow of the third packet received in the second time period. The number of messages in and with the second tag value is increased by one.
可选的,所述方法还包括:Optionally, the method further includes:
第一网络设备确定在第二时段内接收的第三报文所在业务流中的报文的数量;Determining, by the first network device, the number of the packets in the service flow in which the third packet received in the second time period is located;
第一网络设备向控制设备发送确定的接收的报文的数量。The first network device sends the determined number of received messages to the control device.
即,第一网络设备作为目的设备时,在接收到第一个第三报文所在的业务流的报文时,根据该报文的VXLAN头可以确定该报文为测量报文,及可以确定该报文所处的统计时段,例如确定为第二时段,第一网络设备可以从接收到第一个第三报文所在的业务流的报文开始统计在第二时段内接收的第三报文所在的业务流的且具有与第三报文相同的标记的报文的数量,这样,第一网络设备可以将统计得到的数量发送给控制设备。That is, when the first network device is the destination device, when receiving the packet of the service flow in which the first third packet is located, the VXLAN header of the packet can determine that the packet is a measurement packet, and can determine The statistical period in which the packet is located, for example, is determined to be the second time period, and the first network device may start counting the third report received in the second time period from the message of the service flow in which the first third message is received. The number of packets of the service flow and having the same tag as the third packet, so that the first network device can send the statistically obtained quantity to the control device.
同样的,例如第一网络设备为第三报文所在的业务流的目的设备,第二网络设备为第三报文所在的业务流的源设备,则第二网络设备也可以统计在第二时段内发送的第三报文所在的业务流的且具有与第三报文相同的标记报文的数量,及,第二网络设备也可以将统计得到数量发送给控制设备,不多赘述。Similarly, for example, 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, and the second network device may also be counted in the second time period. The number of the marked packets that are the same as the third packet, and the second network device may also send the statistics to the control device, and the details are not described.
另外,在第一网络设备作为目的设备、第二网络设备作为源设备时,也可以测量第三报文所在的业务流在第二时段内的时延,测量时延的方式与如前所述的测量第二报文所在的业务流在第一时段内的时延的方式类似,不多赘述。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 time delay of the service flow in which the third packet is located in the second time period may be measured, and the manner of measuring the delay is as described above. The method for measuring the delay of the service flow in which the second packet is located in the first time period is similar, and is not described in detail.
另外,如前介绍的都是业务流的源设备或目的设备可以向控制设备发送统计的收发报文的数量等信息,而根据对图1的介绍可知,报文在VXLAN网络中的传输过程中还可能经过一些中间设备(例如图1中,若设备D作为源网络设备、设备G作为目的网络设备,则设备B和设备C可以是一组中间设备,或在另一条路径下,设备F和设备E可以是一组中间设备),在实际应用中,这些中间设备也可以向控制设备发送信息,比如设备B作为中间设备时,也可以统计在任一统计时段内发送的具有标记值的报文的数量,或统计在 任一统计时段内接收的具有标记值的报文的数量,并将统计的数量发送给控制设备,以获得该统计时段内该报文所在的业务流的丢包数量,或者比如设备B作为中间设备时,也可以将在任一统计时段发送的具有某个标记值的报文的时刻发送给控制设备,或将在任一统计时段接收的具有某个标记值的报文的时刻发送给控制设备,以获得该统计时段内该报文所在的业务流的时延,等等,统计的方式、发送的方式等均可参考如前的介绍。只是中间设备无需对报文添加VXLAN头和外层IP头,也无需移除报文的VXLAN头和外层IP头,转发报文即可。In addition, as described above, the source device or the destination device of the service flow can send statistics and the number of received and sent packets to the control device, and according to the introduction of FIG. 1, the packet is transmitted in the VXLAN network. It is also possible to go through some intermediate devices (for example, in Figure 1, if device D is the source network device and device G is the destination network device, then device B and device C may be a group of intermediate devices, or in another path, device F and The device E can be a group of intermediate devices. In actual applications, the intermediate devices can also send information to the control device. For example, when the device B is used as the intermediate device, the device can also collect the packets with the tag value sent in any statistical period. Quantity, or statistics in The number of packets with the tagged value received in any statistical period, and the number of statistics is sent to the control device to obtain the number of lost packets of the service flow in which the packet is located during the statistical period, or, for example, device B as the middle The device may also send the time of the message with a certain tag value sent in any statistical period to the control device, or send the time of the message with a certain tag value received in any statistical period to the control device. To obtain the delay of the service flow in which the packet is located during the statistical period, and so on, the manner of statistics, the manner of sending, etc. can be referred to the previous introduction. The intermediate device does not need to add a VXLAN header and an outer IP header to the packet, and does not need to remove the VXLAN header and the outer IP header of the packet to forward the packet.
关于中间设备是否也需发送用于测量业务流性能的信息给控制设备,以及若需要的话,具体由哪些中间设备发送用于测量业务流性能的信息给控制设备,都可以预先规定好,例如可以由控制设备预先规定,或者可以由协议预先规定等等。Whether the intermediate device also needs to send information for measuring the performance of the service flow to the control device, and if necessary, which intermediate device sends the information for measuring the performance of the service flow to the control device, which can be pre-defined, for example, Pre-specified by the control device, or may be pre-defined by the protocol, and the like.
以下结合附图介绍本发明实施例中的设备。The device in the embodiment of the present invention is 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, which may be a 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都是网络设备的网络接口,分别和不同的设备连接。网络接口可以是有线接口,无线接口或其组合。有线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线接口例如可以为无线局域网(英文:wireless local area network,缩写:WLAN)接口。The
转发芯片402可以用于分别通过第一接口401和第二接口403收发报文,对通过第一接口401接收的报文封装VXLAN头及外层IP头,对VXLAN头进行标记,统计在任一统计时段内发送的具有标记值的报文的数量,统计在任一统计时段内接收的具有标记值的报文的数量,等等。转发芯片402可以由专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD),网络处理器(英文:network processor),多核中央处理器(英文:central processing unit,简称CPU)中用于实现转发面的核心或其组合实现。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),
现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic array logic,缩写:GAL)或其任意组合。The
可选的,第二接口403可以包括一个接口或多个接口,那么,通过第二接口403收发报文,可以是通过第二接口403包括的一个接口或多个接口来收发报文。Optionally, the
可选的,转发芯片402可以通过第二接口403向控制设备发送信息,例如转发芯片402向控制设备发送的信息可以用于统计在任一统计时段内某个业务流的性能,例如丢包数量、时延等等。Optionally, the
其中,与其他网络设备交互的接口,和与控制设备交互的接口,可以使用第二接口403中的同一接口,或者也可以使用第二接口403中包括的不同的接口。The interface that interacts with other network devices, and the interface that interacts with the control device, may use the same interface in the
图4中各个接口的形态和位置关系等只是一种示例,在实际应用中,接口的形态以及部署方式等显然不限于此。The morphological and positional relationship of each interface in FIG. 4 is only an example. In practical applications, the form of the interface, the deployment mode, and the like are obviously not limited thereto.
本发明实施例中图4中的设备与图3流程所述的方法相对应,设备中的每个模块所完成的工作,以及执行过程中的细节描述等,可参考方法部分,不多赘述。The device in FIG. 4 in the embodiment of the present invention corresponds to the method described in the process of FIG. 3, and the work performed by each module in the device, and the detailed description in the execution process, etc., may be referred to the method part, and details are not described herein.
本发明实施例中,第一网络设备在为第一报文封装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 be a reserved bit flag in the VXLAN header, that is, the reserved bit in the VXLAN header is set to the first tag value, and the first tag is used. The value may indicate which statistical period the second network device sends the second packet, and the different packets may 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 periods. The test granularity of network performance is refined, the accuracy of network performance testing is improved, and the value available for test results is higher.
在本发明中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the present invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit or unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例。The units described as separate components may or may not be physically separated, and the 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.
在本发明实施例中的各功能单元可以集成在一个处理单元中,或者各个单元也可以均是独立的物理模块。 The functional units in the embodiments 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 a standalone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the technical solution of the present invention may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (which may be a personal computer, A server, or network device, or the like, or a processor (English: processor) performs all or part of the steps of the methods described in various embodiments of the present invention. The foregoing 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) A medium that can store program code, such as memory, RAM, or a disk.
以上所述,以上实施例仅用以对本发明的技术方案进行了详细介绍,但以上实施例的说明只是用于帮助理解本发明实施例的方法,不应理解为对本发明实施例的限制。本技术领域的技术人员可轻易想到的变化或替换,都应涵盖在本发明实施例的保护范围之内。 The above embodiments are only used to describe the technical solutions of the present invention in detail, but the description of the above embodiments is only for the purpose of facilitating the understanding of the embodiments of the present invention, and should not be construed as limiting the embodiments of the present invention. Variations or substitutions that may be readily conceived by those skilled in the art are intended to be included within the scope of the present invention.
Claims (21)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510682620.2 | 2015-10-20 | ||
| CN201510682620.2A CN106603322B (en) | 2015-10-20 | 2015-10-20 | A message sending and receiving method and network device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017067408A1 true WO2017067408A1 (en) | 2017-04-27 |
Family
ID=58554786
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/101812 Ceased WO2017067408A1 (en) | 2015-10-20 | 2016-10-11 | Methods for sending and receiving messages, and network equipment |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106603322B (en) |
| WO (1) | WO2017067408A1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10992496B2 (en) | 2019-05-14 | 2021-04-27 | International Business Machines Corporation | Tuning TCP largesend parameter in VXLan cloud environments |
Families Citing this family (4)
| 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 |
| 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 (4)
| 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 |
| CN103179618A (en) * | 2013-03-19 | 2013-06-26 | 福建三元达通讯股份有限公司 | Method for improving QoS (Quality of Service) of backhaul network based on LTE (Long Term Evolution) Femto system |
| CN104410541A (en) * | 2014-11-18 | 2015-03-11 | 盛科网络(苏州)有限公司 | Method and device for counting VXLAN inner layer virtual machine flux on intermediate switch |
| US9137119B2 (en) * | 2013-03-07 | 2015-09-15 | Cisco Technology, Inc. | Efficient handling of multi-destination traffic in an internet protocol fabric data center |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2425018A (en) * | 2005-04-04 | 2006-10-11 | Agilent Technologies Inc | Method of sharing measurement data |
| CN101753717A (en) * | 2009-11-27 | 2010-06-23 | 华为终端有限公司 | Terminal traffic statistic method and communication terminal |
| 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 (4)
| 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 |
| US9137119B2 (en) * | 2013-03-07 | 2015-09-15 | Cisco Technology, Inc. | Efficient handling of multi-destination traffic in an internet protocol fabric data center |
| CN103179618A (en) * | 2013-03-19 | 2013-06-26 | 福建三元达通讯股份有限公司 | Method for improving QoS (Quality of Service) of backhaul network based on LTE (Long Term Evolution) Femto system |
| CN104410541A (en) * | 2014-11-18 | 2015-03-11 | 盛科网络(苏州)有限公司 | Method and device for counting VXLAN inner layer virtual machine flux on intermediate switch |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10992496B2 (en) | 2019-05-14 | 2021-04-27 | International Business Machines Corporation | Tuning TCP largesend parameter in VXLan cloud environments |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106603322B (en) | 2020-08-14 |
| CN106603322A (en) | 2017-04-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3958521B1 (en) | Method and apparatus for providing service for service flow | |
| US10684885B2 (en) | Port mirroring in a virtualized computing environment | |
| US10868699B2 (en) | Method for generating forwarding information, controller, and service forwarding entity | |
| US12021741B2 (en) | Packet measurement method, device, and system | |
| US20190222431A1 (en) | Vxlan packet processing method, device, and system | |
| CN111385121B (en) | A kind of transmission method and corresponding device of operation management and maintenance iOAM message | |
| WO2017067408A1 (en) | Methods for sending and receiving messages, and network equipment | |
| CN105634942B (en) | Method and switch for forwarding message | |
| US10505759B2 (en) | Access layer-2 virtual private network from layer-3 virtual private network | |
| WO2021083332A1 (en) | Method, apparatus and system for sending message | |
| WO2015085748A1 (en) | Switching device and packet loss method therefor | |
| WO2022078293A1 (en) | Method for detecting multicast service flow and related apparatus | |
| CN107872332A (en) | The detection method and relevant apparatus of a kind of message forwarding path | |
| WO2020135087A1 (en) | Communication method, apparatus and system | |
| CN106130825A (en) | A kind of data transmission quality detection method and device | |
| CN103746874B (en) | Method and equipment for IP (Internet protocol) FPM (flow performance monitor) | |
| CN104954165A (en) | Link analysis method, device and system | |
| CN115941816A (en) | Packet loss processing method and device and storage medium | |
| CN115150308B (en) | Flow statistics method and device | |
| WO2022048466A1 (en) | Operation administration and maintenance (oam) packet processing method and device | |
| CN116260756A (en) | Method, device and network system for message forwarding | |
| CN114915564A (en) | Network state measuring method, device and system | |
| CN104683240B (en) | A kind of method and device of Data Stream Processing | |
| WO2023125774A1 (en) | Vxlan packet transmission method, network device, and system | |
| CN115459942A (en) | A flow monitoring method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16856840 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16856840 Country of ref document: EP Kind code of ref document: A1 |