技术领域technical field
本公开的实施例涉及计算机技术领域,具体涉及用于转发VXLAN报文的方法和装置。The embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for forwarding VXLAN packets.
背景技术Background technique
随着当前互联网流量和带宽出现的爆炸性增长,负载均衡产品得到了越来越多的应用:对外能够提供单一的IP+Port,作为访问服务的统一入口;对内能够将流量均衡地分发到多个真实服务器中,使得每个真实服务器不会处理超过其能力范围的请求,并且当单个真实服务器无法提供服务时,流量能够被其它存活的真实服务器所分担,实现了服务的高可靠性。With the explosive growth of current Internet traffic and bandwidth, load balancing products have been applied more and more: externally, a single IP+Port can be provided as a unified entry for accessing services; internally, traffic can be distributed to multiple In a real server, each real server will not handle requests beyond its capacity, and when a single real server cannot provide services, the traffic can be shared by other surviving real servers, achieving high service reliability.
云计算领域广泛采用Overlay技术,在两个物理设备之上构建逻辑上的网络通信链路,相对于Underlay网络,Overlay技术可以非常灵活的构建多个虚拟子网以支持多租户、虚拟机迁移等服务。目前最流行的Overlay技术方案应该就是VXLAN(VirtualExtensibleLocalAreaNetwork,虚拟扩展局域网)协议。Overlay technology is widely used in cloud computing to build a logical network communication link on two physical devices. Compared with Underlay network, Overlay technology can flexibly build multiple virtual subnets to support multi-tenancy, virtual machine migration, etc. Serve. At present, the most popular Overlay technical solution should be the VXLAN (Virtual Extensible Local Area Network, virtual extended local area network) protocol.
从客户端来的入向流量,经过负载均衡设备时,普遍会进行从VIP+Vport(虚拟服务IP地址+端口)到RSIP+RSPort(真实服务器IP地址+端口)的DNAT(DestinationNetworkAddress,目的地址转换),有时为了隔离内外网的流量也会进行SNAT(SourceNetworkAddressTranslation,源地址转换),使用其它IP+Port来替换CIP+Cport(客户端IP地址+端口)。将CIP+CPort透传给后端的服务器,有时确实是业务的实际需要,譬如ACL(AccessControlList,访问控制列表)、QoS(QualityofService,服务质量)、计费等。When the inbound traffic from the client passes through the load balancing device, DNAT (DestinationNetworkAddress, destination address translation) is generally performed from VIP+Vport (virtual service IP address + port) to RSIP+RSPort (real server IP address + port). ), sometimes SNAT (SourceNetworkAddressTranslation, source address translation) is performed in order to isolate internal and external network traffic, and other IP+Port is used to replace CIP+Cport (client IP address + port). Transparent transmission of CIP+CPort to the back-end server is sometimes the actual need of the business, such as ACL (Access Control List, access control list), QoS (Quality of Service, quality of service), billing, etc.
发明内容SUMMARY OF THE INVENTION
本公开的实施例提出了用于转发VXLAN报文的方法和装置。Embodiments of the present disclosure propose methods and apparatuses for forwarding VXLAN packets.
第一方面,本公开的实施例提供了一种用于转发VXLAN报文的方法,应用于负载均衡设备,包括:响应于接收到来自客户端的VXLAN报文,从VXLAN报文中解析出客户端的真实IP地址和端口;使用指定的IP地址和端口替换掉VXLAN报文中的客户端的真实IP地址和端口;从至少一个真实服务器中选择出目标真实服务器;使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段;将修改后的VXLAN报文转发给目标真实服务器。In a first aspect, an embodiment of the present disclosure provides a method for forwarding a VXLAN packet, which is applied to a load balancing device, including: in response to receiving a VXLAN packet from a client, parsing the client's VXLAN packet from the VXLAN packet Real IP address and port; use the specified IP address and port to replace the real IP address and port of the client in the VXLAN packet; select the target real server from at least one real server; use the resolved real IP address and The port replaces a specific field in the VXLAN packet; forwards the modified VXLAN packet to the target real server.
在一些实施例中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption。In some embodiments, the specific field includes at least one of the following: source MAC address in the inner ether header, TCPoption, IPoption.
在一些实施例中,在使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段之前,该方法还包括:获取目标真实服务器的解析模式;根据解析模式确定待替换的特定字段。In some embodiments, before using the real IP address and port of the parsed client to replace the specific field in the VXLAN packet, the method further includes: acquiring the parsing mode of the target real server; determining the specific field to be replaced according to the parsing mode field.
在一些实施例中,从至少一个真实服务器中选择出目标真实服务器,包括:获取至少一个真实服务器的解析模式;从至少一个真实服务器选择解析模式与负载均衡设备的组包模式匹配的目标真实服务器。In some embodiments, selecting a target real server from the at least one real server includes: acquiring a parsing mode of the at least one real server; selecting a target real server whose parsing mode matches the grouping mode of the load balancing device from the at least one real server .
第二方面,本公开的实施例提供了一种用于转发VXLAN报文的方法,应用于真实服务器,包括:响应于接收到负载均衡设备转发的VXLAN报文,根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口,其中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption;基于解析出的客户端的真实IP地址和端口进行业务处理。In a second aspect, an embodiment of the present disclosure provides a method for forwarding a VXLAN packet, which is applied to a real server, including: in response to receiving a VXLAN packet forwarded by a load balancing device, according to a parsing mode of the real server, from the VXLAN The real IP address and port of the client are parsed from specific fields of the packet, wherein the specific fields include at least one of the following: source MAC address, TCPoption, and IPoption in the inner ether header; based on the real IP address and port for business processing.
在一些实施例中,该方法还包括:响应于接收到解析模式的配置命令,根据配置命令切换解析模式。In some embodiments, the method further includes: in response to receiving the configuration command for the parsing mode, switching the parsing mode according to the configuration command.
在一些实施例中,该方法还包括:对解析出的客户端的真实IP地址和端口进行校验;若校验失败,则切换解析模式后重新从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口。In some embodiments, the method further includes: verifying the parsed real IP address and port of the client; if the verification fails, re-parsing the client's real IP address from a specific field of the VXLAN packet after switching the parsing mode IP address and port.
第三方面,本公开的实施例提供了一种用于转发VXLAN报文的系统,包括负载均衡设备和至少一个真实服务器:负载均衡设备,被配置成:响应于接收到来自客户端的VXLAN报文,从VXLAN报文中解析出客户端的真实IP地址和端口;使用指定的IP地址和端口替换掉VXLAN报文中的客户端的真实IP地址和端口;从至少一个真实服务器中选择出目标真实服务器;使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段;将修改后的VXLAN报文转发给目标真实服务器;真实服务器,被配置成:响应于接收到负载均衡设备转发的VXLAN报文,根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口,其中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption;基于解析出的客户端的真实IP地址和端口进行业务处理。In a third aspect, embodiments of the present disclosure provide a system for forwarding VXLAN packets, including a load balancing device and at least one real server: the load balancing device is configured to: in response to receiving a VXLAN packet from a client , parse out the real IP address and port of the client from the VXLAN packet; use the specified IP address and port to replace the real IP address and port of the client in the VXLAN packet; select the target real server from at least one real server; Replace specific fields in the VXLAN packet with the real IP address and port of the parsed client; forward the modified VXLAN packet to the target real server; the real server is configured to: in response to receiving the In the VXLAN packet, the real IP address and port of the client are parsed from the specific fields of the VXLAN packet according to the parsing mode of the real server. The specific fields include at least one of the following: the source MAC address in the inner ether header, TCPoption, IPoption: Perform business processing based on the real IP address and port of the parsed client.
第四方面,本公开的实施例提供了一种用于转发VXLAN报文的装置,应用于负载均衡设备,包括:第一解析单元,被配置成响应于接收到来自客户端的VXLAN报文,从VXLAN报文中解析出客户端的真实IP地址和端口;第一替换单元,被配置成使用指定的IP地址和端口替换掉VXLAN报文中的客户端的真实IP地址和端口;调度单元,被配置成从至少一个真实服务器中选择出目标真实服务器;第二替换单元,被配置成使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段;发送单元,被配置成将修改后的VXLAN报文转发给目标真实服务器。In a fourth aspect, an embodiment of the present disclosure provides an apparatus for forwarding a VXLAN packet, applied to a load balancing device, comprising: a first parsing unit configured to, in response to receiving a VXLAN packet from a client, convert the The real IP address and port of the client are parsed from the VXLAN message; the first replacement unit is configured to replace the real IP address and port of the client in the VXLAN message with the specified IP address and port; the scheduling unit is configured to The target real server is selected from the at least one real server; the second replacement unit is configured to replace the specific field in the VXLAN message with the real IP address and port of the parsed client; the sending unit is configured to replace the modified The VXLAN packets are forwarded to the target real server.
在一些实施例中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption。In some embodiments, the specific field includes at least one of the following: source MAC address in the inner ether header, TCPoption, IPoption.
在一些实施例中,该装置还包括确定单元,被配置成:在使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段之前,获取目标真实服务器的解析模式;根据解析模式确定待替换的特定字段。In some embodiments, the apparatus further includes a determining unit configured to: obtain the parsing mode of the target real server before replacing the specific field in the VXLAN packet with the real IP address and port of the client that has been parsed; The pattern determines the specific fields to replace.
在一些实施例中,调度单元进一步被配置成:获取至少一个真实服务器的解析模式;从至少一个真实服务器选择解析模式与负载均衡设备的组包模式匹配的目标真实服务器。In some embodiments, the scheduling unit is further configured to: obtain a parsing mode of at least one real server; and select a target real server whose parsing mode matches the packetizing mode of the load balancing device from the at least one real server.
第五方面,本公开的实施例提供了一种用于转发VXLAN报文的装置,应用于真实服务器,包括:第二解析单元,被配置成响应于接收到负载均衡设备转发的VXLAN报文,根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口,其中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption;业务单元,被配置成基于解析出的客户端的真实IP地址和端口进行业务处理。In a fifth aspect, an embodiment of the present disclosure provides an apparatus for forwarding a VXLAN packet, which is applied to a real server and includes: a second parsing unit configured to respond to receiving the VXLAN packet forwarded by the load balancing device, According to the parsing mode of the real server, the real IP address and port of the client are parsed from the specific fields of the VXLAN packet, wherein the specific fields include at least one of the following: source MAC address, TCPoption, IPoption in the inner ether header; service unit , which is configured to perform service processing based on the parsed real IP address and port of the client.
在一些实施例中,该装置还包括切换单元,被配置成:响应于接收到解析模式的配置命令,根据配置命令切换解析模式。In some embodiments, the apparatus further includes a switching unit configured to: in response to receiving the configuration command of the parsing mode, switch the parsing mode according to the configuration command.
在一些实施例中,该装置还包括校验单元,被配置成:对解析出的客户端的真实IP地址和端口进行校验;若校验失败,则切换解析模式后重新从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口。In some embodiments, the apparatus further includes a verification unit, configured to: verify the real IP address and port of the parsed client; if the verification fails, switch the parsing mode and restart from the specific verification of the VXLAN packet. The real IP address and port of the client are resolved in the field.
第六方面,本公开的实施例提供了一种用于转发VXLAN报文的电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一的方法。In a sixth aspect, an embodiment of the present disclosure provides an electronic device for forwarding VXLAN messages, including: one or more processors; a storage device on which one or more programs are stored, and when one or more A program is executed by one or more processors such that the one or more processors implement a method as in any of the first aspects.
第七方面,本公开的实施例提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现如第一方面中任一的方法。In a seventh aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, wherein the program implements the method according to any one of the first aspects when executed by a processor.
本公开的实施例提供的用于转发VXLAN报文的方法和装置,在将真实IP+Port信息透传给真实服务器时,即可采用在报文中附加自定义数据的方式,又可采用复用报文中内层ether头中的源MAC地址的字段。可自适应识别报文中的字段,避免中间转发设备可能会由于无法识别而将其丢弃。复用内层ether头中的源MAC地址的字段,不会使报文变长,不会产生超过设备的MTU(MaximumTransmissionUnit,最大传输单元)而导致被分片或者被丢弃等情况的出现。The method and device for forwarding VXLAN messages provided by the embodiments of the present disclosure can be used to add custom data to the message when the real IP+Port information is transparently transmitted to the real server, or it can be repeated Use the source MAC address field in the inner ether header of the packet. It can adaptively identify fields in packets to avoid intermediate forwarding devices that may discard them because they cannot be identified. Multiplexing the source MAC address field in the inner ether header will not make the packet longer, and will not cause the packet to be fragmented or discarded because it exceeds the MTU (MaximumTransmissionUnit) of the device.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present disclosure will become more apparent upon reading the detailed description of non-limiting embodiments taken with reference to the following drawings:
图1是本公开的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure may be applied;
图2是根据本公开的用于转发VXLAN报文的方法的一个实施例的流程图;2 is a flowchart of an embodiment of a method for forwarding VXLAN packets according to the present disclosure;
图3是根据本公开的用于转发VXLAN报文的方法的又一个实施例的流程图;FIG. 3 is a flowchart of yet another embodiment of a method for forwarding VXLAN packets according to the present disclosure;
图4a-4c是根据本公开的用于转发VXLAN报文的方法的应用场景的示意图;4a-4c are schematic diagrams of application scenarios of the method for forwarding VXLAN packets according to the present disclosure;
图5是根据本公开的用于转发VXLAN报文的装置的一个实施例的结构示意图;5 is a schematic structural diagram of an embodiment of an apparatus for forwarding VXLAN packets according to the present disclosure;
图6是根据本公开的用于转发VXLAN报文的装置的又一个实施例的结构示意图;6 is a schematic structural diagram of yet another embodiment of an apparatus for forwarding VXLAN packets according to the present disclosure;
图7是适于用来实现本公开的实施例的电子设备的计算机系统的结构示意图。7 is a schematic structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure.
具体实施方式Detailed ways
下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。It should be noted that the embodiments of the present disclosure and the features of the embodiments may be combined with each other under the condition of no conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
图1示出了可以应用本公开的用于转发VXLAN报文的方法或用于转发VXLAN报文的装置的实施例的示例性系统架构100。FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the method for forwarding VXLAN messages or the apparatus for forwarding VXLAN messages of the present disclosure may be applied.
如图1所示,系统架构100可以包括客户端(client)101、负载均衡设备(loadbalancer)102、真实服务器(real server)103。网络用以在客户端101、负载均衡设备102、真实服务器103之间提供通信链路的介质。网络可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the system architecture 100 may include a client (client) 101 , a load balancer (loadbalancer) 102 , and a real server (real server) 103 . The network is a medium used to provide a communication link between the client 101 , the load balancing device 102 , and the real server 103 . A network may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
用户可以使用客户端101通过网络与负载均衡设备102交互,以接收或发送消息等。客户端101上可以安装有各种通讯客户端应用,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。The user can use the client 101 to interact with the load balancing device 102 through the network to receive or send messages and the like. Various communication client applications may be installed on the client 101 , such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and the like.
客户端101可以是硬件,也可以是软件。当客户端101为硬件时,可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(MovingPictureExpertsGroupAudioLayerIII,动态影像专家压缩标准音频层面3)、MP4(MovingPictureExpertsGroupAudioLayerIV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。当客户端101为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。The client 101 may be hardware or software. When the client 101 is hardware, it can be various electronic devices that have a display screen and support web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, moving picture experts compress standard audio Layer 3), MP4 (MovingPictureExpertsGroupAudioLayerIV, Moving Picture Experts Compression Standard Audio Layer 4) Players, Laptops and Desktops, etc. When the client 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (eg, to provide distributed services), or as a single software or software module. There is no specific limitation here.
负载均衡设备102,可用于在云中快速、简便地构建高性能的服务器集群,让新服务或企业已有服务上云。为了解决Overlay流量识别问题,通常使用单实例或多实例的方式为租户提供负载均衡服务。即对于用户创建的每个负载均衡实例,云服务提供商在后台为用户启动一个或多个反向代理实例(即负载均衡实例),前端统一使用不同的身份<IP,Port>接入,后端通过固定的配置回源;这些反向代理实例通常会根据每个用户的不同的业务需求,使用一份定制化的配置。从此以后,这些反向代理实例便专属于某个用户,只要位于前端的4层网络设备能够把特定流量转发到特定的一组反向代理实例,流经这些实例的流量也会根据既定配置转发到用户指定的真实服务器103。The load balancing device 102 can be used to quickly and easily build a high-performance server cluster in the cloud, so that new services or existing services of the enterprise can be migrated to the cloud. To solve the problem of overlay traffic identification, load balancing services are usually provided for tenants in a single-instance or multi-instance manner. That is, for each load balancing instance created by the user, the cloud service provider starts one or more reverse proxy instances (ie, load balancing instances) for the user in the background, and the front end uses different identities <IP, Port> to access, and then The client returns to the source through a fixed configuration; these reverse proxy instances usually use a customized configuration according to the different business needs of each user. From now on, these reverse proxy instances are dedicated to a certain user. As long as the front-end Layer 4 network device can forward specific traffic to a specific set of reverse proxy instances, the traffic flowing through these instances will also be forwarded according to the established configuration. to the real server 103 designated by the user.
需要说明的是,本公开的实施例所提供的用于转发VXLAN报文的方法一般由负载均衡设备102和真实服务器103执行,相应地,用于转发VXLAN报文的装置一般设置于负载均衡设备102和真实服务器103中。It should be noted that the method for forwarding VXLAN packets provided by the embodiments of the present disclosure is generally executed by the load balancing device 102 and the real server 103 , and accordingly, the device for forwarding VXLAN packets is generally set on the load balancing device 102 and the real server 103.
应该理解,图1中的客户端101、负载均衡设备102、真实服务器103的数目仅仅是示意性的。根据实现需要,可以具有任意数目的客户端101、负载均衡设备102、真实服务器103。It should be understood that the numbers of clients 101, load balancing devices 102, and real servers 103 in FIG. 1 are only illustrative. According to implementation requirements, there may be any number of clients 101 , load balancing devices 102 , and real servers 103 .
继续参考图2,示出了根据本公开的用于转发VXLAN报文的方法的一个实施例的流程200。该用于转发VXLAN报文的方法,包括以下步骤:Continuing to refer to FIG. 2 , a flow 200 of an embodiment of the method for forwarding VXLAN packets according to the present disclosure is shown. The method for forwarding VXLAN packets includes the following steps:
步骤201,响应于接收到来自客户端的VXLAN报文,从VXLAN报文中解析出客户端的真实IP地址和端口。Step 201, in response to receiving the VXLAN packet from the client, parse out the real IP address and port of the client from the VXLAN packet.
在本实施例中,用于转发VXLAN报文的方法的执行主体(例如图1所示的负载均衡设备)可以通过有线连接方式或者无线连接方式从用户利用其进行云计算的客户端接收VXLAN报文。然后从VXLAN报文中解析出客户端的真实IP地址和端口。报文结构可如图4a所示。In this embodiment, the execution body of the method for forwarding VXLAN packets (for example, the load balancing device shown in FIG. 1 ) may receive VXLAN packets from the client through which the user performs cloud computing through a wired connection or a wireless connection. arts. Then, the real IP address and port of the client are parsed from the VXLAN packet. The message structure can be shown in Figure 4a.
从这个报文中可以看到三个部分:Three parts can be seen from this message:
1、最外层的IP/UDP协议报文用来在底层网络上传输,也就是vtep之间互相通信的基础。1. The outermost IP/UDP protocol packets are used for transmission on the underlying network, which is the basis for mutual communication between vteps.
2、中间是VXLAN头部,vtep接收到报文之后,去除前面的IP/UDP协议部分,根据这部分来处理VXLAN的逻辑,主要是根据VNI发送到最终的虚拟机。2. In the middle is the VXLAN header. After vtep receives the message, it removes the previous part of the IP/UDP protocol. According to this part, the logic of VXLAN is processed, which is mainly sent to the final virtual machine according to VNI.
3、最里面是原始的报文,也就是虚拟机看到的报文内容。3. The innermost part is the original message, that is, the content of the message seen by the virtual machine.
报文各个部分的意义如下:The meaning of each part of the message is as follows:
VXLANheader:VXLAN协议相关的部分,一共8个字节VXLANheader: The part related to the VXLAN protocol, a total of 8 bytes
VXLANflags:标志位VXLANflags: flag bit
Reserved:保留位Reserved: reserved bit
VNID:24位的VNI字段,这也是VXLAN能支持千万租户的地方VNID: 24-bit VNI field, which is where VXLAN can support tens of millions of tenants
Reserved:保留字段Reserved: reserved field
UDP头部,8个字节UDP header, 8 bytes
UDP应用通信双方是vtep应用,其中目的端口就是接收方vtep使用的端口,IANA分配的端口是4789The two sides of the UDP application communication are vtep applications, where the destination port is the port used by the receiver vtep, and the port allocated by IANA is 4789
IP头部:20字节IP header: 20 bytes
主机之间通信的地址,可能是主机的网卡IP地址,也可能是多播IP地址The address of communication between hosts, which may be the IP address of the host's network card or the multicast IP address.
MAC头部:14字节MAC header: 14 bytes
主机之间通信的MAC地址,源MAC地址为主机MAC地址,目的MAC地址为下一跳设备的MAC地址。MAC address for communication between hosts. The source MAC address is the host MAC address, and the destination MAC address is the MAC address of the next-hop device.
通过报文可以看出VXLAN协议比原始报文多50字节的内容,这会降低网络链路传输有效数据的比例。VXLAN头部最重要的是VNID字段,其他的保留字段主要是为了未来的扩展,目前留给不同的厂商用这些字段添加自己的功能。It can be seen from the packets that the VXLAN protocol contains 50 bytes more than the original packet, which reduces the proportion of valid data transmitted by the network link. The most important part of the VXLAN header is the VNID field. Other reserved fields are mainly for future expansion, and are currently reserved for different manufacturers to use these fields to add their own functions.
步骤202,使用指定的IP地址和端口替换掉VXLAN报文中的客户端的真实IP地址和端口。Step 202 , replace the real IP address and port of the client in the VXLAN packet with the specified IP address and port.
在本实施例中,从client来的入向流量,经过负载均衡设备时,普遍会进行从VIP+VPort到RS IP+RS Port的DNAT,有时为了隔离内外网的流量也会进行SNAT,使用其它IP+Port来替换CIP+CPort。即,将Inner IP header中的源IP和源Port进行替换。In this embodiment, when the inbound traffic from the client passes through the load balancing device, DNAT from VIP+VPort to RS IP+RS Port is generally performed. IP+Port to replace CIP+CPort. That is, replace the source IP and source Port in the Inner IP header.
步骤203,从至少一个真实服务器中选择出目标真实服务器。Step 203, selecting a target real server from at least one real server.
在本实施例中,可通过预设的调度算法从至少一个真实服务器中选择出目标真实服务器。例如,轮询、源地址hash之类。也可根据真实服务器的负载情况选择资源占有率最低的真实服务器作为目标真实服务器。In this embodiment, the target real server may be selected from at least one real server through a preset scheduling algorithm. For example, polling, source address hashing, etc. The real server with the lowest resource occupancy rate can also be selected as the target real server according to the load of the real server.
在本实施例的一些可选的实现方式中,从至少一个真实服务器中选择出目标真实服务器,包括:获取至少一个真实服务器的解析模式;从至少一个真实服务器选择解析模式与负载均衡设备的组包模式匹配的目标真实服务器。例如,负载均衡设备被配置成替换内层ether头中的源MAC地址,则需要从至少一个真实服务器选择支持内层ether头中的源MAC地址解析为CIP+CPort的真实服务器。In some optional implementations of this embodiment, selecting a target real server from at least one real server includes: acquiring a parsing mode of the at least one real server; selecting a parsing mode from the at least one real server and a group of a load balancing device The target real server for packet pattern matching. For example, if the load balancing device is configured to replace the source MAC address in the inner ether header, a real server that supports resolving the source MAC address in the inner ether header to CIP+CPort needs to be selected from at least one real server.
步骤204,使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段。Step 204 , replace a specific field in the VXLAN packet with the parsed real IP address and port of the client.
在本实施例中,特定字段可包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption。In this embodiment, the specific field may include at least one of the following: source MAC address, TCPoption, and IPoption in the inner ether header.
如图4b所示为使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的TCPoption的过程。负载均衡设备将CIP+CPort填充到VXLAN报文中的TCPoption所在位置。Figure 4b shows the process of replacing the TCP option in the VXLAN packet with the real IP address and port of the parsed client. The load balancing device fills CIP+CPort into the location of the TCP option in the VXLAN packet.
如图4c所示为使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的内层ether头中的源MAC地址的过程。负载均衡设备将CIP+CPort填充到VXLAN报文中的内层ether头中的源MAC地址所在位置。一般情况下,这个源MAC地址是租户虚拟网络的上一条网关地址,在后续数据转发的过程中并没有太多作用,可以被重用来携带所需要的IP+Port信息。48bits的源MAC地址,刚好可以携带32bits的IP和16bits的端口信息。使用非标准的TCPoption、IP option或者自定义协议,不存在由于无法识别而被丢弃的风险,并且报文长度在转换前后未发生改变,也不存在由于超过MTU而被分片或者被丢弃的可能。Figure 4c shows the process of replacing the source MAC address in the inner ether header of the VXLAN packet with the parsed real IP address and port of the client. The load balancing device fills CIP+CPort into the location of the source MAC address in the inner ether header of the VXLAN packet. In general, this source MAC address is the last gateway address of the tenant virtual network. It does not play much role in the subsequent data forwarding process, and can be reused to carry the required IP+Port information. The source MAC address of 48bits can just carry 32bits of IP and 16bits of port information. Using non-standard TCP option, IP option or custom protocol, there is no risk of being discarded due to unrecognized, and the packet length does not change before and after conversion, and there is no possibility of being fragmented or discarded due to exceeding MTU .
在本实施例的一些可选的实现方式中,在使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段之前,该方法还包括:获取目标真实服务器的解析模式;根据解析模式确定待替换的特定字段。负载均衡设备可使用指定的特定字段进行替换,然后由真实服务器进行自适应的解析。负载均衡设备还可根据所选择的目标服务器的解析模式来自适应组包。解析模式包括以下至少一项:内层ether头中的源MAC地址解析模式、TCPoption解析模式、IPoption解析模式。In some optional implementations of this embodiment, before using the parsed real IP address and port of the client to replace the specific field in the VXLAN packet, the method further includes: acquiring the parsing mode of the target real server; The parsing mode determines the specific fields to replace. The load balancing device can use the specified specific field to replace, and then the real server will perform adaptive parsing. The load balancing device can also adaptively group packets according to the resolution mode of the selected target server. The parsing mode includes at least one of the following: source MAC address parsing mode in the inner ether header, TCPoption parsing mode, and IPoption parsing mode.
步骤205,将修改后的VXLAN报文转发给目标真实服务器。Step 205: Forward the modified VXLAN packet to the target real server.
在本实施例中,将修改后的VXLAN报文转发给步骤步骤203确定出的目标真实服务器。由目标真实服务器从中提取出CIP+CPort用于业务处理。In this embodiment, the modified VXLAN message is forwarded to the target real server determined in step 203 . The CIP+CPort is extracted from the target real server for business processing.
继续参考图3,示出了根据本公开的用于转发VXLAN报文的方法的又一个实施例的流程300。该用于转发VXLAN报文的方法,包括以下步骤:Continuing to refer to FIG. 3 , a flow 300 of another embodiment of the method for forwarding VXLAN packets according to the present disclosure is shown. The method for forwarding VXLAN packets includes the following steps:
步骤301,响应于接收到负载均衡设备转发的VXLAN报文,根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口。Step 301, in response to receiving the VXLAN packet forwarded by the load balancing device, parse out the real IP address and port of the client from a specific field of the VXLAN packet according to the parsing mode of the real server.
在本实施例中,用于转发VXLAN报文的方法的执行主体(例如图1所示的真实服务器)可以通过有线连接方式或者无线连接方式从用于真实服务器调度的负载均衡设备接收VXLAN报文。然后根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口。该VXLAN报文是负载均衡器根据步骤201-204生成的。其中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption。In this embodiment, the execution body of the method for forwarding VXLAN packets (for example, the real server shown in FIG. 1 ) may receive VXLAN packets from the load balancing device used for real server scheduling through wired connection or wireless connection . Then, according to the parsing mode of the real server, the real IP address and port of the client are parsed from the specific fields of the VXLAN packet. The VXLAN packet is generated by the load balancer according to steps 201-204. The specific field includes at least one of the following: source MAC address, TCPoption, and IPoption in the inner ether header.
解析模式可以通过命令设置。当真实服务器被设置了解析模式后后,即按要所设置的解析模式来解析VXLAN报文。The parsing mode can be set by command. After the real server is set to the parsing mode, it parses the VXLAN packets according to the set parsing mode.
在本实施例的一些可选的实现方式中,该方法还包括:对解析出的客户端的真实IP地址和端口进行校验;若校验失败,则切换解析模式后重新从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口。从而可以自适应的调整解析模式。例如,原本的解析模式是从报文中内层ether头中的源MAC地址所在位置解析出客户端的真实IP地址和端口。但如果解析出的值不符合IP地址和端口的规则,则认为负载均衡器不是对内层ether头中的源MAC地址进行替换。真实服务器可切换到到TCPoption模式继续解析。In some optional implementations of this embodiment, the method further includes: verifying the real IP address and port of the parsed client; if the verification fails, switching the parsing mode and re-selecting the specific VXLAN packet The real IP address and port of the client are resolved in the field. Thereby, the parsing mode can be adjusted adaptively. For example, the original parsing mode is to parse the real IP address and port of the client from the location of the source MAC address in the inner ether header of the packet. However, if the parsed value does not conform to the IP address and port rules, it is considered that the load balancer is not replacing the source MAC address in the inner ether header. The real server can switch to TCPoption mode to continue parsing.
步骤302,基于解析出的客户端的真实IP地址和端口进行业务处理。Step 302, perform service processing based on the real IP address and port of the client that is parsed out.
在本实施例中,通过特定的内核模块,将封装在内层ether源MAC或其它特定字段中的数据取出来,再借由自定义的系统调用最终传递给应用程序。真实IP地址和端口可用于标识个体身份。In this embodiment, the data encapsulated in the inner ether source MAC or other specific fields is taken out through a specific kernel module, and finally passed to the application program through a custom system call. Real IP addresses and ports can be used to identify individuals.
进一步参考图5,作为对上述各图所示方法的实现,本公开提供了一种用于转发VXLAN报文的装置(应用于负载均衡设备)的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to FIG. 5 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for forwarding VXLAN packets (applied to a load balancing device), which is the same as that shown in FIG. 2 . Corresponding to the method embodiments shown, the apparatus can be specifically applied to various electronic devices.
如图5所示,本实施例的用于转发VXLAN报文的装置(应用于负载均衡设备)500包括:第一解析单元501、第一替换单元502、调度单元503、第二替换单元504和发送单元505。其中,第一解析单元501,被配置成响应于接收到来自客户端的VXLAN报文,从所述VXLAN报文中解析出所述客户端的真实IP地址和端口;第一替换单元502,被配置成使用指定的IP地址和端口替换掉所述VXLAN报文中的所述客户端的真实IP地址和端口;调度单元503,被配置成从至少一个真实服务器中选择出目标真实服务器;第二替换单元504,被配置成使用解析出的所述客户端的真实IP地址和端口替换掉所述VXLAN报文中的特定字段;发送单元505,被配置成将修改后的VXLAN报文转发给所述目标真实服务器。As shown in FIG. 5 , the apparatus for forwarding VXLAN packets (applied to a load balancing device) 500 in this embodiment includes: a first parsing unit 501 , a first replacement unit 502 , a scheduling unit 503 , a second replacement unit 504 and Sending unit 505 . Wherein, the first parsing unit 501 is configured to, in response to receiving the VXLAN message from the client, parse out the real IP address and port of the client from the VXLAN message; the first replacement unit 502 is configured to Use the specified IP address and port to replace the real IP address and port of the client in the VXLAN message; the scheduling unit 503 is configured to select a target real server from at least one real server; the second replacement unit 504 , is configured to use the parsed real IP address and port of the client to replace the specific field in the VXLAN message; the sending unit 505 is configured to forward the modified VXLAN message to the target real server .
在本实施例中用于转发VXLAN报文的装置500的第一解析单元501、第一替换单元502、调度单元503、第二替换单元504和发送单元505的具体处理可以参考图2对应实施例中的步骤201、步骤202、步骤203、步骤204和步骤205。In this embodiment, the specific processing of the first parsing unit 501 , the first replacement unit 502 , the scheduling unit 503 , the second replacement unit 504 , and the sending unit 505 of the apparatus 500 for forwarding VXLAN packets may refer to the corresponding embodiment in FIG. 2 Step 201, Step 202, Step 203, Step 204 and Step 205 in .
在本实施例的一些可选的实现方式中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption。In some optional implementations of this embodiment, the specific field includes at least one of the following: source MAC address, TCPoption, and IPoption in the inner ether header.
在本实施例的一些可选的实现方式中,装置500还包括确定单元(附图中未示出),被配置成:在使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段之前,获取目标真实服务器的解析模式;根据解析模式确定待替换的特定字段。In some optional implementations of this embodiment, the apparatus 500 further includes a determination unit (not shown in the drawings), configured to: replace the VXLAN packet with the real IP address and port of the client that is parsed out Get the parsing mode of the target real server before the specific field of the target real server; determine the specific field to be replaced according to the parsing mode.
在本实施例的一些可选的实现方式中,调度单元503进一步被配置成:获取至少一个真实服务器的解析模式;从至少一个真实服务器选择解析模式与负载均衡设备的组包模式匹配的目标真实服务器。In some optional implementations of this embodiment, the scheduling unit 503 is further configured to: acquire a parsing mode of at least one real server; select a target real server whose parsing mode matches the packetizing mode of the load balancing device from the at least one real server server.
进一步参考图6,作为对上述各图所示方法的实现,本公开提供了一种用于转发VXLAN报文的装置(应用于真实服务器)的一个实施例,该装置实施例与图3所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 6 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for forwarding VXLAN packets (applied to a real server), the embodiment of the device is the same as that shown in FIG. 3 . Corresponding to the method embodiments described above, the apparatus can be specifically applied to various electronic devices.
如图6所示,本实施例的用于转发VXLAN报文的装置(应用于真实服务器)600包括:第二解析单元601和业务单元602。其中,第二解析单元601,被配置成响应于接收到负载均衡设备转发的VXLAN报文,根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口,其中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption;业务单元602,被配置成基于解析出的客户端的真实IP地址和端口进行业务处理。As shown in FIG. 6 , the apparatus for forwarding a VXLAN packet (applied to a real server) 600 in this embodiment includes: a second parsing unit 601 and a service unit 602 . The second parsing unit 601 is configured to, in response to receiving the VXLAN packet forwarded by the load balancing device, parse out the real IP address and port of the client from a specific field of the VXLAN packet according to the parsing mode of the real server, wherein, The specific field includes at least one of the following: the source MAC address, TCPoption, and IPoption in the inner ether header; the service unit 602 is configured to perform service processing based on the parsed real IP address and port of the client.
在本实施例的一些可选的实现方式中,装置600还包括切换单元(附图中未示出),被配置成:响应于接收到解析模式的配置命令,根据配置命令切换解析模式。In some optional implementations of this embodiment, the apparatus 600 further includes a switching unit (not shown in the drawings), configured to: in response to receiving a configuration command of the parsing mode, switch the parsing mode according to the configuration command.
在本实施例的一些可选的实现方式中,装置600还包括校验单元(附图中未示出),被配置成:对解析出的客户端的真实IP地址和端口进行校验;若校验失败,则切换解析模式后重新从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口。In some optional implementations of this embodiment, the apparatus 600 further includes a verification unit (not shown in the drawings), which is configured to: verify the real IP address and port of the parsed client; If the verification fails, switch the parsing mode and re-parse the client's real IP address and port from the specific fields of the VXLAN packet.
下面参考图7,其示出了适于用来实现本公开的实施例的电子设备(例如图1中的负载均衡设备或真实服务器)700的结构示意图。图7示出的负载均衡设备或真实服务器仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。Referring next to FIG. 7 , it shows a schematic structural diagram of an electronic device (eg, the load balancing device or real server in FIG. 1 ) 700 suitable for implementing embodiments of the present disclosure. The load balancing device or real server shown in FIG. 7 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储装置708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM703中,还存储有电子设备700操作所需的各种程序和数据。处理装置701、ROM702以及RAM703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7 , an electronic device 700 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 701 that may be loaded into random access according to a program stored in a read only memory (ROM) 702 or from a storage device 708 Various appropriate actions and processes are executed by the programs in the memory (RAM) 703 . In the RAM 703, various programs and data necessary for the operation of the electronic device 700 are also stored. The processing device 701 , the ROM 702 , and the RAM 703 are connected to each other through a bus 704 . An input/output (I/O) interface 705 is also connected to bus 704 .
通常,以下装置可以连接至I/O接口705:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置706;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许电子设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图7中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。Typically, the following devices can be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 707 of a computer, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. Communication means 709 may allow electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. Although FIG. 7 shows an electronic device 700 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in FIG. 7 can represent one device, and can also represent multiple devices as required.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM702被安装。在该计算机程序被处理装置701执行时,执行本公开的实施例的方法中限定的上述功能。需要说明的是,本公开的实施例所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication device 709 , or from the storage device 708 , or from the ROM 702 . When the computer program is executed by the processing device 701, the above-described functions defined in the methods of the embodiments of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Rather, in embodiments of the present disclosure, a computer-readable signal medium may include a data signal in baseband or propagated as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于接收到来自客户端的VXLAN报文,从VXLAN报文中解析出客户端的真实IP地址和端口;使用指定的IP地址和端口替换掉VXLAN报文中的客户端的真实IP地址和端口;从至少一个真实服务器中选择出目标真实服务器;使用解析出的客户端的真实IP地址和端口替换掉VXLAN报文中的特定字段;将修改后的VXLAN报文转发给目标真实服务器。或者,使得该电子设备:响应于接收到负载均衡设备转发的VXLAN报文,根据真实服务器的解析模式从VXLAN报文的特定字段中解析出客户端的真实IP地址和端口,其中,特定字段包括以下至少一项:内层ether头中的源MAC地址、TCPoption、IPoption;基于解析出的客户端的真实IP地址和端口进行业务处理。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: in response to receiving the VXLAN message from the client, parse out the VXLAN message from the VXLAN message. The real IP address and port of the client; use the specified IP address and port to replace the real IP address and port of the client in the VXLAN packet; select the target real server from at least one real server; use the real IP of the parsed client Address and port replace specific fields in the VXLAN message; forward the modified VXLAN message to the target real server. Or, make the electronic device: in response to receiving the VXLAN message forwarded by the load balancing device, parse out the real IP address and port of the client from specific fields of the VXLAN message according to the parsing mode of the real server, where the specific fields include the following At least one item: source MAC address, TCPoption, and IPoption in the inner ether header; business processing is performed based on the parsed real IP address and port of the client.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的实施例的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, or a combination thereof, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
描述于本公开的实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括第一解析单元、第一替换单元、调度单元、第二替换单元和发送单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一解析单元还可以被描述为“响应于接收到来自客户端的VXLAN报文,从所述VXLAN报文中解析出所述客户端的真实IP地址和端口的单元”。The units involved in the embodiments of the present disclosure may be implemented in software or hardware. The described unit may also be provided in the processor, for example, it may be described as: a processor includes a first parsing unit, a first replacement unit, a scheduling unit, a second replacement unit and a sending unit. The names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the first parsing unit may also be described as "in response to receiving the VXLAN packet from the client, The unit that resolves the client's real IP address and port".
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover the above-mentioned technical features without departing from the inventive concept. Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) with similar functions.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910839835.9ACN110545230B (en) | 2019-09-06 | 2019-09-06 | Method and device for forwarding VXLAN message |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910839835.9ACN110545230B (en) | 2019-09-06 | 2019-09-06 | Method and device for forwarding VXLAN message |
| Publication Number | Publication Date |
|---|---|
| CN110545230Atrue CN110545230A (en) | 2019-12-06 |
| CN110545230B CN110545230B (en) | 2023-09-26 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910839835.9AActiveCN110545230B (en) | 2019-09-06 | 2019-09-06 | Method and device for forwarding VXLAN message |
| Country | Link |
|---|---|
| CN (1) | CN110545230B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111800423A (en)* | 2020-07-06 | 2020-10-20 | 中国工商银行股份有限公司 | Method, system, computing device and medium for processing IP address |
| CN112636997A (en)* | 2020-11-17 | 2021-04-09 | 新华三技术有限公司 | Path detection method and device |
| CN114157632A (en)* | 2021-10-12 | 2022-03-08 | 北京华耀科技有限公司 | Network isolation method, device, equipment and storage medium |
| CN119544718A (en)* | 2024-11-28 | 2025-02-28 | 中国农业银行股份有限公司 | Load balancing method and system |
| WO2025124493A1 (en)* | 2023-12-12 | 2025-06-19 | 天翼云科技有限公司 | Vxlan forwarding table self-learning method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105554065A (en)* | 2015-12-03 | 2016-05-04 | 华为技术有限公司 | Method, conversion unit and application unit for message processing |
| CN106878194A (en)* | 2016-12-30 | 2017-06-20 | 新华三技术有限公司 | A kind of message processing method and device |
| CN107026890A (en)* | 2016-02-02 | 2017-08-08 | 华为技术有限公司 | A kind of message forming method and load equalizer based on server cluster |
| WO2018014874A1 (en)* | 2016-07-21 | 2018-01-25 | 深圳奇迹智慧网络有限公司 | Mobile terminal mac data acquisition method |
| CN111800423A (en)* | 2020-07-06 | 2020-10-20 | 中国工商银行股份有限公司 | Method, system, computing device and medium for processing IP address |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105554065A (en)* | 2015-12-03 | 2016-05-04 | 华为技术有限公司 | Method, conversion unit and application unit for message processing |
| CN107026890A (en)* | 2016-02-02 | 2017-08-08 | 华为技术有限公司 | A kind of message forming method and load equalizer based on server cluster |
| WO2018014874A1 (en)* | 2016-07-21 | 2018-01-25 | 深圳奇迹智慧网络有限公司 | Mobile terminal mac data acquisition method |
| CN106878194A (en)* | 2016-12-30 | 2017-06-20 | 新华三技术有限公司 | A kind of message processing method and device |
| CN111800423A (en)* | 2020-07-06 | 2020-10-20 | 中国工商银行股份有限公司 | Method, system, computing device and medium for processing IP address |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111800423A (en)* | 2020-07-06 | 2020-10-20 | 中国工商银行股份有限公司 | Method, system, computing device and medium for processing IP address |
| CN112636997A (en)* | 2020-11-17 | 2021-04-09 | 新华三技术有限公司 | Path detection method and device |
| CN112636997B (en)* | 2020-11-17 | 2022-08-30 | 新华三技术有限公司 | Path detection method and device |
| CN114157632A (en)* | 2021-10-12 | 2022-03-08 | 北京华耀科技有限公司 | Network isolation method, device, equipment and storage medium |
| CN114157632B (en)* | 2021-10-12 | 2023-11-21 | 北京华耀科技有限公司 | Network isolation method, device, equipment and storage medium |
| WO2025124493A1 (en)* | 2023-12-12 | 2025-06-19 | 天翼云科技有限公司 | Vxlan forwarding table self-learning method |
| CN119544718A (en)* | 2024-11-28 | 2025-02-28 | 中国农业银行股份有限公司 | Load balancing method and system |
| Publication number | Publication date |
|---|---|
| CN110545230B (en) | 2023-09-26 |
| Publication | Publication Date | Title |
|---|---|---|
| CN110708393B (en) | Method, device and system for transmitting data | |
| CN110545230B (en) | Method and device for forwarding VXLAN message | |
| US9602307B2 (en) | Tagging virtual overlay packets in a virtual networking system | |
| CN104038401B (en) | Method and system for interoperability for distributed overlay virtual environments | |
| CN107771320B (en) | System and method for improving the security of Secure Sockets Layer (SSL) communications | |
| US9077754B2 (en) | Systems and methods for nextproto negotiation extension handling using mixed mode | |
| US12010195B2 (en) | Efficient flow management utilizing control packets | |
| US9680764B2 (en) | Systems and methods for diameter load balancing | |
| US9614930B2 (en) | Virtual machine mobility using OpenFlow | |
| CN103392321B (en) | Systems and methods for policy-based integration of horizontally deployed WAN optimization appliances | |
| US9438701B2 (en) | Systems and methods for a SPDY to HTTP gateway | |
| CA2968964C (en) | Source ip address transparency systems and methods | |
| US20230370421A1 (en) | Scaling ip addresses in overlay networks | |
| US20150019702A1 (en) | Flexible flow offload | |
| US10230795B2 (en) | Data replication for a virtual networking system | |
| KR20140107173A (en) | Layer 2 packet switching without look-up table for ethernet switches | |
| CN108200018B (en) | Flow forwarding method and equipment, computer equipment and readable medium in cloud computing | |
| EP3128702B1 (en) | Transferring state in content centric network stacks | |
| US20230013110A1 (en) | Techniques for processing network flows | |
| EP3542518A1 (en) | Enabling connections in a content centric network | |
| JP7717988B2 (en) | Method, device, electronic device, computer-readable medium and computer program for acquiring video stream data | |
| CN108011989B (en) | Redirection method and device | |
| JP2025514772A (en) | Network device level optimization for latency sensitive RDMA traffic | |
| CN114979128A (en) | Cross-region communication method and device and electronic equipment | |
| CN118075206A (en) | Data transmission method and device |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |