Movatterモバイル変換


[0]ホーム

URL:


CN108512714A - A kind of message transmitting method, relevant device and system - Google Patents

A kind of message transmitting method, relevant device and system
Download PDF

Info

Publication number
CN108512714A
CN108512714ACN201710112958.3ACN201710112958ACN108512714ACN 108512714 ACN108512714 ACN 108512714ACN 201710112958 ACN201710112958 ACN 201710112958ACN 108512714 ACN108512714 ACN 108512714A
Authority
CN
China
Prior art keywords
address
hop
request message
management network
traffic management
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710112958.3A
Other languages
Chinese (zh)
Other versions
CN108512714B (en
Inventor
周两进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN201710112958.3ApriorityCriticalpatent/CN108512714B/en
Publication of CN108512714ApublicationCriticalpatent/CN108512714A/en
Application grantedgrantedCritical
Publication of CN108512714BpublicationCriticalpatent/CN108512714B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明实施例公开了报文传输方法、相关设备和系统,用户网关接收请求报文;其中,请求报文携带五元组;用户网关在会话表中查询是否存在与请求报文的五元组关联的正向下一跳IP地址;若为否,用户网关获取请求报文的源MAC地址;用户网关查询会话保持表中是否存在与源IP地址关联的正向下一跳IP地址;若为是,用户网关将请求报文发送给正向下一跳IP地址指示的流量管理网元的用户端口。采用本发明实施例,能准确的对用户的流量进行监控。

The embodiment of the present invention discloses a message transmission method, related equipment and a system. The user gateway receives a request message; wherein, the request message carries a quintuple; the user gateway inquires in the session table whether there is a quintuple with the request message The associated forward next-hop IP address; if it is not, the user gateway obtains the source MAC address of the request message; the user gateway queries whether there is a forward next-hop IP address associated with the source IP address in the session maintenance table; if it is Yes, the user gateway sends the request packet to the user port of the traffic management network element indicated by the next-hop IP address. By adopting the embodiment of the present invention, the flow of users can be accurately monitored.

Description

Translated fromChinese
一种报文传输方法、相关设备和系统A message transmission method, related equipment and system

技术领域technical field

本发明涉及通信领域,尤其涉及一种报文传输方法、相关设备和系统。The present invention relates to the communication field, in particular to a message transmission method, related equipment and a system.

背景技术Background technique

随着互联网中业务量和用户数量的增长,网络中的流量的增长速度越来越快,在现有的方案中需要对每个用户的上网行为进行准确的统计,例如:需要对用户的上网时间和消耗的流量进行统计,目前的方案对用户的流量进行统计的方案是:用户网关根据报文的源IP地址来选择将报文转发到哪个流量管理网元上,选择的流量管理网元将报文转发给网际网关,网际网关根据报文的目的IP地址将报文转发给网络中的服务器;网际网关接收服务器发送的响应报文,根据响应报文的的目的IP地址将报文转发到对应的流量管理网元上,流量管理网元将响应报文发送给用户网关,用户网关根据目的IP地址将响应报文转发到相应的终端上。通过上述方式,确保相同用户的正向流量和反向流量都经过相同的流量管理网元,以实现对用户流量的精确统计。With the growth of the business volume and the number of users in the Internet, the traffic in the network is growing faster and faster. In the existing solutions, it is necessary to accurately count the online behavior of each user, for example: it is necessary to collect information about the user's online behavior. Time and consumed traffic are counted. The current solution for user traffic statistics is: the user gateway selects which traffic management network element to forward the message to according to the source IP address of the message, and the selected traffic management network element Forward the message to the Internet gateway, and the Internet gateway forwards the message to the server in the network according to the destination IP address of the message; the Internet gateway receives the response message sent by the server, and forwards the message according to the destination IP address of the response message to the corresponding traffic management network element, the traffic management network element sends the response message to the user gateway, and the user gateway forwards the response message to the corresponding terminal according to the destination IP address. Through the above method, it is ensured that the forward flow and reverse flow of the same user pass through the same flow management network element, so as to realize accurate statistics on user flow.

但是申请人发现用户在终端的IP地址发生变化的情况下,例如DHCP(DynamicHost Configuration Protocol,动态主机配置协议,简称DHCP)场景中,同一个IP地址可能会被多个终端使用,那么目前这种根据终端的IP地址统计终端流量的方案存在不准确的问题。However, the applicant found that when the IP address of the terminal changes, for example, in a DHCP (DynamicHost Configuration Protocol, DHCP for short) scenario, the same IP address may be used by multiple terminals. The scheme of counting terminal traffic according to the IP address of the terminal has the problem of inaccuracy.

发明内容Contents of the invention

本发明实施例所要解决的技术问题在于,提供一种报文传输方法,实现了能用户流量进行准确的统计。The technical problem to be solved by the embodiments of the present invention is to provide a message transmission method, which realizes accurate statistics of user traffic.

第一方面,本申请提供了一种报文传输方法,报文传输方法应用于流量管理系统,流量管理系统包括用户网关、多个流量管理网元和网际网关,每个流量管理网元用于监控用户的上网行为,例如监控用户的上网时长和消耗流量。每个流量管理网元包括用户端口和网际端口,用户端口表示流量管理网元与用户网关之间的端口,网际端口表示流量管理网元与网际网关之间的端口。其中,本申请中终端到互联网中服务器的称为正向,相应的终端发出的报文为正向报文;服务器到终端的方向称为反向,相应的服务器发出的报文为反向报文。本申请的报文传输方法包括:用户网关接收终端发送的请求报文,请求报文中携带五元组,五元组包括源IP地址、目的IP地址、源端口号、目的端口号和协议类型,用户网关中可预先设置有会话表,会话表的每个表项中存储有五元组和正向下一跳IP地址,会话表中的正向下一跳IP地址为多个流量管理网元的用户端口的IP地址。同时,用户网关中还存储有会话保持表,会话保持表中每个表项存储有MAC地址和正向下一跳IP地址,会话保持表中的正向下一跳IP地址表示多个流量管理网元中某个流量管理网元的用户端口的IP地址。用户网关接收终端发送的请求报文,请求报文携带五元组,用户网关在会话表中查询是否存与五元组关联的正向下一跳IP地址,若为否,用户网关确定请求报文的源MAC地址,此处请求报文的源MAC地址为发送请求报文的终端的MAC地址,用户网关在会话保持表中查询是否存在与源MAC地址关联的正向下一跳IP地址,若为是,用户网关将请求报文发送给在会话保持表中查询的正向下一跳IP地址指示的流量管理网元的用户端口。In the first aspect, the present application provides a message transmission method, the message transmission method is applied to a traffic management system, the traffic management system includes a user gateway, a plurality of traffic management network elements and an Internet gateway, and each traffic management network element is used for Monitor the user's online behavior, such as monitoring the user's online time and traffic consumption. Each traffic management network element includes a user port and an internet port, the user port means the port between the traffic management network element and the user gateway, and the internet port means the port between the traffic management network element and the internet gateway. Among them, in this application, the terminal to the server in the Internet is called forward, and the message sent by the corresponding terminal is a forward message; the direction from the server to the terminal is called reverse, and the message sent by the corresponding server is a reverse message. arts. The message transmission method of the present application includes: the user gateway receives the request message sent by the terminal, and the request message carries a quintuple, and the quintuple includes a source IP address, a destination IP address, a source port number, a destination port number and a protocol type , the user gateway can be pre-set with a session table, and each entry in the session table stores a quintuple and the next-hop IP address, and the next-hop IP address in the session table is a plurality of traffic management network elements The IP address of the user port. At the same time, the user gateway also stores a session hold table. Each entry in the session hold table stores a MAC address and a forward-hop IP address. The forward-hop IP address in the session hold table indicates that multiple traffic management network IP address of the user port of a traffic management network element in the network element. The user gateway receives the request message sent by the terminal. The request message carries a quintuple. The user gateway inquires in the session table whether there is a forward next-hop IP address associated with the quintuple. If not, the user gateway determines the request message The source MAC address of the message, where the source MAC address of the request message is the MAC address of the terminal sending the request message, and the user gateway queries in the session hold table whether there is a forward next-hop IP address associated with the source MAC address, If yes, the user gateway sends the request packet to the user port of the traffic management network element indicated by the next-hop IP address queried in the session holding table.

实施上述实施例,用户网关在接收终端发送的请求报文,根据请求报文的五元组在会话表中查询关联的正向下一跳IP地址,或者根据请求报文的源MAC地址在会话保持表中查询关联的正向下一跳IP地址,这样可以确保同一用户的流量经过相同的流量管理网元,实现对用户流量的精确监控。Implement the above-mentioned embodiment, the user gateway receives the request message sent by the terminal, and queries the associated forward next-hop IP address in the session table according to the quintuple of the request message, or according to the source MAC address of the request message in the session Keep the forward next-hop IP address associated with the query in the table, so as to ensure that the traffic of the same user passes through the same traffic management network element, and realize accurate monitoring of user traffic.

在第一方面的一种可能的实施方式中,用户网关在会话表中查询到与请求报文的五元组关联的正向下一跳IP地址的情况下,将请求报文发送给下一跳IP地址指示的流量管理网元的用户端口。In a possible implementation manner of the first aspect, the user gateway sends the request message to the next IP address associated with the next hop IP address associated with the quintuple of the request message in the session table. Jump to the user port of the traffic management NE indicated by the IP address.

在第一方面的一种可能的实施方式中,用户网关在会话表和会话保持表中查询后发现均不存在关联的正向下一跳IP地址的情况下,用户网关根据预设的分流算法从多个流量管理网元中确定选择一个目标流量管理网元,以及确定目标流量管理网元的用户端口的IP地址,将该IP地址作为正向下一跳IP地址。在会话表中新建一个表项,将请求报文的五元组和正向IP地址绑定后存储在新建的表项中;用户网关在会话保持表中新建一个表项,将请求报文的源MAC地址和正向下一跳IP存储在新建的表项中。In a possible implementation of the first aspect, when the user gateway finds that there is no associated forward next-hop IP address after querying the session table and the session hold table, the user gateway uses the preset distribution algorithm Determine and select a target traffic management network element from multiple traffic management network elements, and determine the IP address of the user port of the target traffic management network element, and use the IP address as the forward next hop IP address. Create a new entry in the session table, bind the quintuple of the request message with the forward IP address and store it in the newly created entry; the user gateway creates a new entry in the session hold table, and store the source The MAC address and forward-to-hop IP are stored in newly created entries.

在第一方面的一种可能的实施方式中,用户网关接收多个流量管理网元中某个流量管理网元发送的响应报文,根据响应报文的五元组在会话表中查询是否存在关联的反向下一跳IP地址,若为是,根据查询到的反向下一跳IP地址的指示将响应报文发送给终端;若为否,丢弃响应报文。In a possible implementation manner of the first aspect, the user gateway receives a response message sent by a certain flow management network element among the plurality of flow management network elements, and queries the session table according to the five-tuple of the response message The associated reverse next-hop IP address, if yes, send the response packet to the terminal according to the indication of the queried reverse next-hop IP address; if not, discard the response packet.

第二方面,本申请提供了一种报文传输方法,包括:In a second aspect, the present application provides a message transmission method, including:

网际网关接收多个流量管理网元中某个流量管理网元通过网际端口发送请求报文,请求报文携带五元组,网际网关在会话表中查询是否存在与请求报文的五元组关联的正向下一跳IP地址,正向下一跳IP地址表示互联网中服务器的IP地址,若为是,根据正向下一跳IP地址的指示将请求报文转发至互联网中相应的服务器。The Internet gateway receives a traffic management network element among multiple traffic management network elements and sends a request message through the Internet port. The request message carries a quintuple, and the Internet gateway queries in the session table whether there is a quintuple association with the request message. The forward next hop IP address, the forward next hop IP address indicates the IP address of the server in the Internet, if yes, the request message is forwarded to the corresponding server in the Internet according to the indication of the forward next hop IP address.

在第二方面的一种可能的实施方式中,网际网关在会话表中查询不存在与请求报文的五元组关联的正向下一跳IP地址的情况下,根据请求报文的目的IP地址在路由表中查询关联的正向下一跳IP地址,根据查询到的正向下一跳IP地址的指示将请求报文转发到互联网中相应的服务器。同时,网际网关获取请求报文的源MAC地址,此处的源MAC地址为流量管理网元的网际端口的MAC地址,网际网关可利用ARP协议反查流量管理网元的网际端口的IP地址,网际网关在会话表中创建表项,将请求报文的五元组、正向下一跳IP地址和反向下一跳IP地址进行绑定后存储在创建的表项中。In a possible implementation of the second aspect, the Internet gateway queries the session table in the case that there is no forward next-hop IP address associated with the quintuple of the request message, according to the destination IP address of the request message The address queries the associated next-hop IP address in the routing table, and forwards the request message to the corresponding server in the Internet according to the indication of the queried forward-hop IP address. At the same time, the Internet gateway obtains the source MAC address of the request message, where the source MAC address is the MAC address of the Internet port of the traffic management network element, and the Internet gateway can use the ARP protocol to check back the IP address of the Internet port of the traffic management network element, The Internet gateway creates an entry in the session table, binds the quintuple of the request message, the forward next-hop IP address, and the reverse next-hop IP address and stores them in the created entry.

结合第二方面的一种可能的实施方式中,网际网关接收网络侧返回的响应报文,网际网关根据响应报文的五元组在会话表中查询是否存在关联的反向下一跳IP地址,若为是,将响应报文发送给反向下一跳IP地址指示的流量管理网元的网际端口;若为否,网际网关丢弃该响应报文。In a possible implementation of the second aspect, the Internet gateway receives the response message returned by the network side, and the Internet gateway queries in the session table whether there is an associated reverse next-hop IP address according to the five-tuple of the response message , if yes, send the response packet to the Internet port of the traffic management network element indicated by the reverse next-hop IP address; if not, the Internet gateway discards the response packet.

第三方面,本申请提供了一种流量管理网元列表的维护方法,包括:用户网关关联有多个流量管理网元,用户网关为每个流量管理网元的用户端口分配IP地址,根据每个流量管理网元的用户端口的MAC地址和分配的IP地址生成用户端口列表。用户网关为每个流量管理网元的网际端口分配IP地址,根据每个流量管理网元的网际端口的MAC地址和分配的IP地址生成网际端口列表,此时用户网关和网际网关并不知道每个流量管理网元上用户端口和网际端口的映射关系,因此用户网关向待探测的流量管理网元发起探测,探测的过程包括:用户网关向流量管理网元发送探测请求报文,探测请求报文的源IP地址为用户网关的IP地址,目的IP地址为网际网关的IP地址,正向下一跳IP地址为待探测的流量管理网元的用户端口的IP地址,用户网关根据正向下一跳IP地址将探测请求报文通过用户端口发送给流量管理网元,流量管理网元将探测请求报文通过网际端口发送给网际网关,网际网关获取接收到的探测请求报文的源MAC地址,此时探测请求报文的源MAC地址为待探测的流量管理网元的网际端口的MAC地址,用户网关根据ARP协议反查源MAC地址对应网际端口的IP地址,该IP地址为待探测的流量管理网元的网际端口的IP地址,网际网关向用户网关返回流量管理网元的网际端口的IP地址和MAC地址,用户网关判断探测请求报文中携带的MAC地址和IP地址是否位于网际端口列表中,若为是,用户网关建立待探测的流量管理网元的用户端口和网际端口的绑定关系,并将绑定关系通知给网际端口。根据上述的探测方法,用户网关可以探测到每个流量管理网元上用户端口和网际端口的绑定关系。In a third aspect, the present application provides a method for maintaining a traffic management network element list, including: a user gateway is associated with a plurality of traffic management network elements, and the user gateway assigns an IP address to a user port of each traffic management network element. Generate a user port list based on the MAC addresses and assigned IP addresses of the user ports of each traffic management network element. The user gateway assigns an IP address to the Internet port of each flow management network element, and generates an Internet port list according to the MAC address of the Internet port of each flow management network element and the assigned IP address. At this time, the user gateway and the Internet gateway do not know each The mapping relationship between the user port and the Internet port on a traffic management network element, so the user gateway initiates a detection to the traffic management network element to be detected. The detection process includes: the user gateway sends a detection request message to the traffic management network element, and the detection request message The source IP address of the file is the IP address of the user gateway, the destination IP address is the IP address of the Internet gateway, and the IP address of the next hop forward is the IP address of the user port of the traffic management network element to be detected. The one-hop IP address sends the detection request message to the traffic management network element through the user port, and the traffic management network element sends the detection request message to the Internet gateway through the Internet port, and the Internet gateway obtains the source MAC address of the received detection request message At this time, the source MAC address of the detection request message is the MAC address of the Internet port of the traffic management network element to be detected, and the user gateway checks the IP address of the Internet port corresponding to the source MAC address according to the ARP protocol. The IP address of the Internet port of the traffic management network element, the Internet gateway returns the IP address and MAC address of the Internet port of the traffic management network element to the user gateway, and the user gateway judges whether the MAC address and IP address carried in the detection request message are located on the Internet port In the list, if yes, the user gateway establishes a binding relationship between the user port of the traffic management network element to be detected and the Internet port, and notifies the binding relationship to the Internet port. According to the above detection method, the user gateway can detect the binding relationship between the user port and the Internet port on each traffic management network element.

第四方面,本申请提供了一种用户网关,该用户网关具有实现上述方法中用户网关行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a fourth aspect, the present application provides a user gateway, which has the function of implementing the behavior of the user gateway in the above method. The functions described above may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.

一种可能的实现方式中,所述用户网关包括:In a possible implementation manner, the user gateway includes:

另一种可能的实现方式中,所述用户网关包括:接收器、发射器、存储器和处理器;其中,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,执行第一方面、第三方面、第一方面各个可能的实施方式中的报文传输方法。In another possible implementation manner, the user gateway includes: a receiver, a transmitter, a memory, and a processor; wherein, a set of program codes is stored in the memory, and the processor is used to call the program code stored in the memory. The program code executes the message transmission method in each possible implementation manner of the first aspect, the third aspect, and the first aspect.

基于同一发明构思,由于该装置解决问题的原理以及有益效果可以参见上述各可能的用户网关的方法实施方式以及所带来的有益效果,因此该装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, since the principle and beneficial effects of the device to solve the problem can refer to the above-mentioned possible user gateway method implementations and the beneficial effects brought, so the implementation of the device can refer to the implementation of the method, and there is no repetition Let me repeat.

本申请的第五方面提了供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行第一方面、第三方面、第一方面各个可能的实施方式中的报文传输方法。The fifth aspect of the present application provides a computer-readable storage medium, the computer-readable storage medium stores instructions, and when it is run on a computer, the computer executes the first aspect, the third aspect, and the first aspect. A message transmission method in various possible implementation manners of the aspect.

本申请的又一方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面、第三方面、第一方面各个可能的实施方式中的报文传输方法。Yet another aspect of the present application provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the message transmission method in each possible implementation manner of the first aspect, the third aspect, and the first aspect .

第六方面,本申请提供了一种网际网关,该网际网关具有实现上述方法中网际网关行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a sixth aspect, the present application provides an Internet gateway, which has the function of realizing the behavior of the Internet gateway in the above method. The functions described above may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.

一种可能的实现方式中,所述网际网关包括:In a possible implementation manner, the Internet gateway includes:

另一种可能的实现方式中,所述网际网关包括:接收器、发射器、存储器和处理器;其中,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,执行第二方面和第二方面各个可能的实施方式中的报文传输方法。In another possible implementation manner, the Internet gateway includes: a receiver, a transmitter, a memory, and a processor; wherein, a set of program codes is stored in the memory, and the processor is used to call the program code stored in the memory. The program code executes the second aspect and the message transmission method in each possible implementation manner of the second aspect.

基于同一发明构思,由于该装置解决问题的原理以及有益效果可以参见上述各可能的用户网关的方法实施方式以及所带来的有益效果,因此该装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, since the principle and beneficial effects of the device to solve the problem can refer to the above-mentioned possible user gateway method implementations and the beneficial effects brought, so the implementation of the device can refer to the implementation of the method, and there is no repetition Let me repeat.

本申请的第七方面提了供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第二方面和第二方面的各个可能的报文传输方法。The seventh aspect of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes each of the above-mentioned second aspect and the second aspect. Possible message transfer methods.

本申请的又一方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面和第二方面的各个可能的报文传输方法。Yet another aspect of the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the above-mentioned second aspect and each possible message transmission method of the second aspect.

本申请的又一方面提供了一种流量计费系统,包括用户网关、多个流量管理网元和网际网关;Another aspect of the present application provides a traffic billing system, including a user gateway, a plurality of traffic management network elements and an Internet gateway;

用户网关,用于接收请求报文;在用户网关的会话表中查询是否存在与请求报文的五元组关联的正向下一跳IP地址;若为否,获取请求报文的源MAC地址,查询用户网关的会话保持表中是否存在与源IP地址关联的正向下一跳IP地址;若为是,将请求报文发送给正向下一跳IP地址指示的流量管理网元的用户端口;正向下一跳IP地址指示的流量管理网元属于多个流量管理网元;The user gateway is used to receive the request message; in the session table of the user gateway, query whether there is a forward next-hop IP address associated with the quintuple of the request message; if not, obtain the source MAC address of the request message , query whether there is a forward next-hop IP address associated with the source IP address in the session retention table of the user gateway; if yes, send the request message to the user of the traffic management network element indicated by the forward-next-hop IP address port; the traffic management network element indicated by the next-hop IP address belongs to multiple traffic management network elements;

流量管理网元,用于通过用户端口接收请求报文,以及将请求报文通过网际端口发送至网际网关;The traffic management network element is used to receive the request message through the user port, and send the request message to the Internet gateway through the Internet port;

网际网关,用于接收流量管理网元转发的请求报文;在网际网关的会话表中查询是否存在与五元组关联的正向下一跳IP地址;若为否,在路由表中查询请求报文的正向下一跳IP地址;获取请求报文的源MAC地址,根据请求报文的源MAC地址查询得到流量管理网元的IP地址,将查询得到的IP地址存储在表项中,作为反向下一跳IP地址;在网际网际的会话表中创建表项,将五元组、正向下一跳IP地址和反向下一跳IP地址进行绑定后存储在创建的表项中。The Internet gateway is used to receive the request message forwarded by the traffic management network element; in the session table of the Internet gateway, check whether there is a forward next-hop IP address associated with the quintuple; if not, query the request in the routing table The forward and next hop IP address of the message; obtain the source MAC address of the request message, query the IP address of the traffic management network element according to the source MAC address of the request message, and store the obtained IP address in the table entry, As the reverse next-hop IP address; create an entry in the Internet session table, bind the quintuple, the forward next-hop IP address and the reverse next-hop IP address and store it in the created table entry middle.

附图说明Description of drawings

为了更清楚地说明本发明实施例或背景技术中的技术方案,下面将对本发明实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the following will describe the drawings that need to be used in the embodiments of the present invention or the background technology.

图1是本发明实施例提供的一种流量计费系统的架构示意图;FIG. 1 is a schematic diagram of the architecture of a traffic billing system provided by an embodiment of the present invention;

图2是本发明实施例提供的一种报文传输方法的流程示意图;FIG. 2 is a schematic flowchart of a message transmission method provided by an embodiment of the present invention;

图3是本发明实施例提供的一种报文传输方法的另一流程示意图;Fig. 3 is another schematic flowchart of a message transmission method provided by an embodiment of the present invention;

图4是本发明实施例提供的一种报文传输方法的另一流程示意图;Fig. 4 is another schematic flowchart of a message transmission method provided by an embodiment of the present invention;

图5是本发明实施例提供的一种流量管理网元的端口探测的流程示意图;FIG. 5 is a schematic flow diagram of port detection of a traffic management network element provided by an embodiment of the present invention;

图6是本发明实施例提供的一种流量管理网元的端口探测的具体举例;FIG. 6 is a specific example of port detection of a traffic management network element provided by an embodiment of the present invention;

图7是本发明实施例提供的一种用户网关的结构示意图;FIG. 7 is a schematic structural diagram of a user gateway provided by an embodiment of the present invention;

图8是本发明实施例提供的一种网际网关的结构示意图。Fig. 8 is a schematic structural diagram of an Internet gateway provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合本发明实施例中的附图对本发明实施例进行描述。Embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.

图1为本发明实施例涉及的一种流量计费系统的架构示意图,所述通信系统包括m个终端、接入网、用户网关、n个流量管理网元、网际网关和k个服务器,m、n和k为大于1的整数。n个流量管理网元中每个流量管理网元用于监控终端的流量,例如:监控终端的上网时长、消耗流量、数据网络类型等。每个流量管理网元设置有用户端口和网际端口,用户端口表示与终端相邻的接口,网际接口表示与服务器相连的端口,对于每个流量管理网元,用户端口和网际端口的IP地址和MAC地址可以不相同。终端通过接入网与用户网关,本申请中的接入网包括但不限于全球移动通信系统(Global System for Mobile Communication,GSM)接入网,码分多址(Code Division Multiple Access,CDMA)系统接入网、宽带码分多址(Wideband Code Division MultipleAccess,WCDMA)接入网,全球微波互联接入(Worldwide Interoperability for Microwave Access,WiMAX)接入网、长期演进(longterm evolution,LTE)接入网,或者后续演进接入网。Fig. 1 is a schematic diagram of the architecture of a traffic billing system according to an embodiment of the present invention. The communication system includes m terminals, an access network, a user gateway, n traffic management network elements, an Internet gateway, and k servers, m , n and k are integers greater than 1. Each of the n traffic management network elements is used to monitor the traffic of the terminal, for example, monitor the terminal's online time, consumed traffic, data network type, and the like. Each traffic management network element is provided with a user port and an Internet port, the user port represents the interface adjacent to the terminal, and the Internet interface represents the port connected to the server, for each traffic management network element, the IP address and the IP address of the user port and the Internet port The MAC addresses can be different. The terminal passes through the access network and the user gateway. The access network in this application includes but not limited to the Global System for Mobile Communication (Global System for Mobile Communication, GSM) access network, Code Division Multiple Access (CDMA) system Access network, Wideband Code Division Multiple Access (WCDMA) access network, Worldwide Interoperability for Microwave Access (WiMAX) access network, long term evolution (LTE) access network , or a subsequent evolution of the access network.

本申请中的终端是一种具有无限通信功能的设备,可以是具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备等。在不同的网络中终端可以叫做不同的名称,例如:用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置、蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal DigitalAssistant,PDA)、5G网络或未来演进网络中的终端等。The terminal in this application is a device with wireless communication function, which may be a handheld device with wireless communication function, vehicle-mounted device, wearable device, computing device or other processing device connected to a wireless modem, etc. Terminals can be called by different names in different networks, for example: user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device , user agent or user device, cellular phone, cordless phone, Session Initiation Protocol (Session Initiation Protocol, SIP) phone, wireless local loop (Wireless Local Loop, WLL) station, personal digital processing (Personal Digital Assistant, PDA), 5G network Or a terminal in a future evolution network, etc.

本申请中的接入网包括用以提供无线通信功能的设备,根据接入网类型的不同,接入网中的设备包括但不限于:基站(例如:BTS(Base Transceiver Station,BTS),节点B(NodeB,NB),演进型基站B(Evolutional Node B,eNB或eNodeB),NR系统中的传输节点或收发点(transmission reception point,TRP或者TP)或者下一代节点B(generation nodeB,gNB),未来通信网络中的基站或网络设备)、中继站、接入点、车载设备、可穿戴设备,无线保真(Wireless-Fidelity,Wi-Fi)的站点、无线回传节点、小站、微站等等。The access network in this application includes equipment for providing wireless communication functions. According to the different types of access network, the equipment in the access network includes but not limited to: base station (for example: BTS (Base Transceiver Station, BTS), node B (NodeB, NB), evolved base station B (Evolutional Node B, eNB or eNodeB), transmission node or transceiver point (transmission reception point, TRP or TP) or next-generation node B (generation nodeB, gNB) in the NR system , base station or network equipment in the future communication network), relay station, access point, vehicle equipment, wearable equipment, wireless fidelity (Wireless-Fidelity, Wi-Fi) site, wireless backhaul node, small station, micro station and many more.

需要说明的是,本申请的用户网关和网际网关除了可采用图1中的集中式部署,还可以采用分布式部署的方式,即用户网关包括多个子网关,每个子网关管理不同范围的终端。网际网关包括多个子网关,每个字网关管理不同范围的服务器。It should be noted that, in addition to the centralized deployment shown in Figure 1, the user gateway and Internet gateway of this application can also be deployed in a distributed manner, that is, the user gateway includes multiple sub-gateways, and each sub-gateway manages different ranges of terminals. The Internet gateway includes multiple sub-gateways, and each sub-gateway manages a different range of servers.

需要说明的是,本申请的m个流量管理网元可划分为三个池:主用池、备用池和故障池,主用池中包括当前工作的流量管理网元,备用于池中包括起备份作用的流量管理网元,故障池中包括发生故障的流量管理网元。在主用池中的某个流量管理网元发生故障的情况下,将该流量管理网元移到故障池中,同时将备用池中的某个流量管理网元移入主用池中。当故障池中的某个流量管理网元的故障恢复时,将该流量管理网元移入到备用池中。其中,用户网关可以向流量管理网元发送探测请求报文的方式检测该流量管理网元的健康状态:如果在预设时长内接收到探测请求报文对应的探测响应报文,表明流量管理网元为正常状态;如果在预设时长内未接收到探测请求报文对应的探测响应报文,表明流量管理网元为故障状态。It should be noted that the m traffic management network elements in this application can be divided into three pools: a main pool, a backup pool and a failure pool. The main pool includes the currently working traffic management network elements, and the backup pool includes Traffic management network elements with a backup function, and the failure pool includes traffic management network elements that fail. When a traffic management network element in the active pool fails, the traffic management network element is moved to the faulty pool, and at the same time, a traffic management network element in the backup pool is moved to the active pool. When a traffic management network element in the faulty pool recovers from failure, the traffic management network element is moved into the backup pool. Among them, the user gateway can detect the health status of the traffic management network element by sending a probe request message to the traffic management network element: if the probe response message corresponding to the probe request message is received within the preset time period, it indicates that the traffic management network element The network element is in a normal state; if the probe response message corresponding to the probe request message is not received within a preset period of time, it indicates that the traffic management network element is in a fault state.

请参见图2,图2是本发明实施例提供的一种报文传输方法的流程示意图,该方法包括但不限于如下步骤:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of a message transmission method provided by an embodiment of the present invention. The method includes but is not limited to the following steps:

S201、接收终端发送的请求报文。S201. Receive a request message sent by a terminal.

具体地,终端通过接入网向对应的用户网关发送请求报文,请求报文可以是终端中的应用程序生成的。用户网关接收终端发送的请求报文,请求报文携带五元组,五元组包括源IP地址、目的IP地址、源端口号、目的端口号和协议类型,源IP地址表示终端的IP地址,目的IP地址表示互联网中服务器的IP地址,源端口号表示终端发送请求报文的端口的序号,目的端口号表示服务器上接收请求报文的端口序号,协议类型表示传输请求报文的协议的类型,协议类型包括但不限于TCP和UDP等IP协议。其中,请求报文中除包括五元组,还可以包括源MAC地址,源MAC地址表示用户网关的上一个相邻设备的MAC地址。Specifically, the terminal sends a request message to the corresponding user gateway through the access network, and the request message may be generated by an application program in the terminal. The user gateway receives the request message sent by the terminal. The request message carries a quintuple. The quintuple includes source IP address, destination IP address, source port number, destination port number and protocol type. The source IP address indicates the IP address of the terminal. The destination IP address indicates the IP address of the server in the Internet, the source port number indicates the serial number of the terminal sending the request message, the destination port number indicates the port serial number of the server receiving the request message, and the protocol type indicates the protocol type for transmitting the request message , the protocol type includes but not limited to IP protocols such as TCP and UDP. Wherein, in addition to including the quintuple, the request message may also include a source MAC address, and the source MAC address indicates the MAC address of the last neighboring device of the user gateway.

S202、在会话表中查询是否存在与请求报文的五元组关联的正向下一跳IP地址。S202. Query whether there is a forward next-hop IP address associated with the quintuple of the request message in the session table.

具体地,用户网关中可预先设置有会话表,会话表中包括多个表项,每个表项存储有五元组和正向下一跳IP地址,用户网关确定请求报文中携带的五元组,根据五元组在会话表中查询是否存在与五元组关联的表项,若存在,确定查询到的表项中存储的正向下一跳IP地址,执行S203。若会话表中不存在五元组关联的表项,执行S204。Specifically, a session table may be preset in the user gateway, and the session table includes a plurality of entries, and each entry stores a quintuple and the next-hop IP address, and the user gateway determines the quintuple carried in the request message. group, query whether there is an entry associated with the quintuple in the session table according to the quintuple, and if so, determine the IP address of the next forward hop stored in the queried entry, and execute S203. If there is no entry associated with the quintuple in the session table, execute S204.

S203、根据会话表中记录的正向下一跳IP地址将请求报文发送给流量管理网元的用户端口。S203. Send the request message to the user port of the traffic management network element according to the next-hop forward IP address recorded in the session table.

具体的,用户网关根据S202中查询到的正向下一跳IP地址确定对应的流量管理网元,将请求报文发送给该流量管理网元的用户端口。Specifically, the user gateway determines the corresponding traffic management network element according to the next-hop forward IP address queried in S202, and sends the request message to the user port of the traffic management network element.

S204、在会话保持表中查询是否存在与请求报文的源MAC地址关联的正向下一跳IP地址。S204. Query whether there is a forward next-hop IP address associated with the source MAC address of the request message in the session maintenance table.

具体的,用户网关预先设置有会话保持表,会话保持表中包括多个表项,每个表项存储有源MAC地址和正向下一跳IP地址,用户网关在会话保持表中查询是否存在与请求报文的源MAC地址关联的表项,若存在,确定查询到的表项中查询到的正向下一跳IP地址,执行S205。若会话保持表中不存在请求报文的源MAC地址关联的表项,执行S206。其中,请求报文的源MAC地址表示用户网关的上一个相邻的设备的MAC地址,例如请求报文的源MAC地址为终端的MAC地址。Specifically, the user gateway is preset with a session holding table, and the session holding table includes a plurality of entries, and each entry stores a source MAC address and a forward-hop IP address, and the user gateway queries in the session holding table whether there is an If there is an entry associated with the source MAC address of the request message, determine the next-hop IP address queried in the queried entry, and execute S205. If there is no entry associated with the source MAC address of the request message in the session hold table, execute S206. Wherein, the source MAC address of the request message represents the MAC address of a previous adjacent device of the user gateway, for example, the source MAC address of the request message is the MAC address of the terminal.

S205、根据会话保持表中记录的正向下一跳IP地址将请求报文发送给流量管理网元的用户端口。S205. Send the request message to the user port of the traffic management network element according to the next-hop forward IP address recorded in the session holding table.

具体的,用户网关根据S204查询到的正向下一跳IP地址确定对应的流量管理网元,用户网关将请求报文发送给确定的流量管理网元的用户端口上。Specifically, the user gateway determines the corresponding traffic management network element according to the next-hop forward IP address queried in S204, and the user gateway sends the request message to the user port of the determined traffic management network element.

S206、根据预设的分流算法从多个流量管理网元中选择一个目标流量管理网元,确定目标流量管理网元的用户端口的IP地址,将该IP地址作为请求报文的正向下一跳IP地址。S206. Select a target traffic management network element from a plurality of traffic management network elements according to a preset distribution algorithm, determine the IP address of the user port of the target traffic management network element, and use the IP address as the next forward of the request message Jump IP address.

具体的,用户网关预先给多个流量管理网元中每个流量管理网元的用户端口和网际端口分配了IP地址,分配IP地址的方法包括但不限于静态IP分配方法或动态IP分配方法。用户网关根据预设的分流算法从多个流量管理网元中选择一个目标流量管理网元,确定目标流量管理网元的用户端口的IP地址,将该IP地址作为请求报文的正向下一跳IP地址。Specifically, the user gateway pre-assigns an IP address to the user port and the Internet port of each traffic management network element among the plurality of traffic management network elements, and the method of assigning the IP address includes but is not limited to a static IP allocation method or a dynamic IP allocation method. The user gateway selects a target traffic management network element from multiple traffic management network elements according to the preset distribution algorithm, determines the IP address of the user port of the target traffic management network element, and uses the IP address as the forwarding direction of the request message. Jump IP address.

可选的,多个流量管理网元预先按照1、2、3……进行编号,用户网关获取请求报文的五元组,将五元组进行哈希运算后得到一个哈希值,将得到的哈希值与多个流量管理网元的数量进行求模,将得到的模值为目标流量管理网元的序号。Optionally, multiple traffic management network elements are pre-numbered according to 1, 2, 3..., the user gateway obtains the quintuple of the request message, performs a hash operation on the quintuple to obtain a hash value, and will get The hash value of the hash value is calculated modulo by the number of multiple traffic management network elements, and the obtained modulus value is the serial number of the target traffic management network element.

可选的,在请求报文同时携带IPv4地址和IPv6地址的情况下,用户网关根据请求报文的源MAC地址进行哈希运算得到一个哈希值,将得到的哈希值与多个流量管理网元的数量进行求模,将得到的模值作为目标流量管理网元的序号。Optionally, in the case that the request message carries both an IPv4 address and an IPv6 address, the user gateway performs a hash operation according to the source MAC address of the request message to obtain a hash value, and combines the obtained hash value with multiple traffic management Calculate the modulus of the number of network elements, and use the obtained modulus value as the serial number of the target traffic management network element.

可选的,在请求报文只携带IPv4地址或IPv6地址的情况下,用户网关根据请求报文的源IP地址进行哈希运算得到一个哈希值,将得到的哈希值与多个流量管理网元的数量进行求模,将得到的模值作为目标流量管理网元的序号。Optionally, in the case that the request message only carries an IPv4 address or an IPv6 address, the user gateway performs a hash operation according to the source IP address of the request message to obtain a hash value, and combines the obtained hash value with multiple traffic management Calculate the modulus of the number of network elements, and use the obtained modulus value as the serial number of the target traffic management network element.

S207、根据确定的正向下一跳IP地址发送请求报文。S207. Send the request message according to the determined forward next-hop IP address.

具体的,用户网关根据S206确定的正向下一跳IP地址将请求报文发送给对应的流量管理网元的用户端口上。Specifically, the user gateway sends the request message to the user port of the corresponding traffic management network element according to the forward next hop IP address determined in S206.

S208、在会话表中创建表项,将五元组和确定的正向下一跳IP地址绑定后存储在创建的表项中。S208. Create an entry in the session table, and store the quintuple in the created entry after binding the quintuple with the determined forward next-hop IP address.

具体的,用户网关在会话表中新建一个表项,将请求报文的五元组和S206确定的正向下一跳IP地址存储在创建的表项中,该表项中存储的五元组和正向下一跳IP地址具有绑定关系。Specifically, the user gateway creates a new entry in the session table, and stores the quintuple of the request message and the IP address of the forward next hop determined in S206 in the created entry, and the quintuple stored in the entry It has a binding relationship with the forward next hop IP address.

S209、在会话保持表中创建表项,将请求报文的源MAC地址和确定的正向下一跳IP地址绑定后存储在创建的表项中。S209. Create an entry in the session maintenance table, bind the source MAC address of the request message with the determined IP address of the forward next hop, and store in the created entry.

具体的,用户网关在会话保持表中新建一个表项,获取请求报文的源MAC地址,此处的请求报文的源MAC地址为终端的MAC地址,将请求报文的源MAC地址和S206确定的正向下一跳IP地址进行绑定后存储在创建的表项中。Specifically, the user gateway creates a new entry in the session maintenance table to obtain the source MAC address of the request message, where the source MAC address of the request message is the MAC address of the terminal, and the source MAC address of the request message and S206 The determined forward next-hop IP address is bound and stored in the created table entry.

在本发明实施例中,流量管理网元通过用户端口接收用户网关发送的请求报文,可统计发出请求报文的终端的上网业务进行计费,例如根据上网流量或上网时长进行计费,流量管理网元将请求报文转发到对应的网际端口,通过网际端口将请求报文发送给网际网关。在网际网关为分布式部署的情况下,流量管理网元可以根据预设规则将请求报文发送给对应的网际网关,例如:采用随机方式、业务类型优先级方式或流量优先级方式发送请求报文。In the embodiment of the present invention, the traffic management network element receives the request message sent by the user gateway through the user port, and can count the Internet service of the terminal sending the request message for charging, for example, charge according to the Internet traffic or the duration of the Internet. The management network element forwards the request message to the corresponding Internet port, and sends the request message to the Internet gateway through the Internet port. In the case of distributed deployment of the Internet gateway, the traffic management network element can send the request message to the corresponding Internet gateway according to the preset rules, for example: send the request message in a random way, service type priority method or traffic priority method arts.

在图2所描述的方法中,用户网关在接收终端发送的请求报文,根据请求报文的五元组在会话表中查询关联的正向下一跳IP地址,或者根据请求报文的源MAC地址在会话保持表中查询关联的正向下一跳IP地址,这样可以确保同一用户的流量经过相同的流量管理网元,实现对用户流量的精确监控。In the method described in Figure 2, the user gateway receives the request message sent by the terminal, and queries the associated forward next-hop IP address in the session table according to the quintuple of the request message, or according to the source of the request message The MAC address queries the associated forward next-hop IP address in the session hold table, which ensures that the traffic of the same user passes through the same traffic management network element, and realizes accurate monitoring of user traffic.

参见图3,为本发明实施例提供的一种报文传输方法的流程示意图,在本发明实施例中,所述方法包括:Referring to FIG. 3, it is a schematic flowchart of a message transmission method provided by an embodiment of the present invention. In an embodiment of the present invention, the method includes:

S301、接收流量管理网元发送的请求报文。S301. Receive a request message sent by a traffic management network element.

具体的,网际网关接收流量管理网元发送的请求报文,请求报文中携带五元组。Specifically, the Internet gateway receives the request message sent by the traffic management network element, and the request message carries a quintuple.

S302、在会话表中查询是否存在与请求报文的五元组关联的正向下一跳IP地址。S302. Check in the session table whether there is a forward next-hop IP address associated with the quintuple of the request message.

具体的,网际网关预先设置有会话表,会话表包括多个表项,每个表项存储有五元组和下一跳IP地址,网际网关在会话表中查询是否存在请求报文的五元组关联的表项,若存在,确定表项中存储的下一跳IP地址,执行S303。若会话表中不存在请求报文的五元组关联的表项,执行S304。Specifically, the Internet gateway is preset with a session table, and the session table includes a plurality of entries, and each entry stores a quintuple and a next-hop IP address, and the Internet gateway inquires in the session table whether there is a quintuple of the request message. If the entry associated with the group exists, determine the next-hop IP address stored in the entry, and execute S303. If there is no entry associated with the quintuple of the request message in the session table, execute S304.

S303、根据会话表中记录的下一跳IP地址转发请求报文。S303. Forward the request message according to the next-hop IP address recorded in the session table.

具体的,网际网关根据下一跳IP地址将请求报文转发给互联网中的设备。Specifically, the Internet gateway forwards the request packet to the device on the Internet according to the next-hop IP address.

S304、获取请求报文的源MAC地址。S304. Obtain the source MAC address of the request packet.

具体的,网际网关获取请求报文的源MAC地址,请求报文中可携带该源MAC地址,此处的源MAC地址为流量管理网元的网际端口的MAC地址。Specifically, the Internet gateway obtains the source MAC address of the request message, which may be carried in the request message, where the source MAC address is the MAC address of the Internet port of the traffic management network element.

S305、根据请求报文的目的IP地址查询路由表得到正向下一跳IP地址。S305. Query the routing table according to the destination IP address of the request message to obtain the IP address of the forward next hop.

S306、根据请求报文的源MAC地址查询关联的IP地址,将查询到的IP地址作为反向下一跳IP地址。S306. Query the associated IP address according to the source MAC address of the request message, and use the queried IP address as the reverse next-hop IP address.

S307、在会话表中创建表项,将请求报文的五元组、正向下一跳IP地址和反向下一跳IP地址绑定后存储在创建的表项中。S307. Create an entry in the session table, and store the quintuple of the request message, the forward next-hop IP address, and the reverse next-hop IP address in the created entry after binding.

S308、根据正向下一跳IP地址转发请求报文。S308. Forward the request message according to the IP address of the forward next hop.

从图3的实施例可以看出,网际网关在接收到用户的请求报文后,直接根据请求报文的源MAC地址反查出反向下一跳IP地址,这样网际网关在接收到请求报文对应的响应报文时,直接可通过查会话表得到反向下一跳IP地址,避免查路由表消耗大量时长,减少报文传输时延。As can be seen from the embodiment of Fig. 3, after receiving the request message of the user, the Internet gateway directly checks out the reverse next-hop IP address according to the source MAC address of the request message, so that the Internet gateway receives the request message When receiving the response message corresponding to the text, the reverse next-hop IP address can be obtained directly by looking up the session table, avoiding the time-consuming lookup of the routing table and reducing the message transmission delay.

参见图4,为本发明实施例提供的一种报文传输方法的流程示意图,在本发明实施例中,所述方法包括:Referring to FIG. 4, it is a schematic flowchart of a message transmission method provided by an embodiment of the present invention. In an embodiment of the present invention, the method includes:

S401、接收服务器发送的响应报文。S401. Receive a response message sent by the server.

具体的,网际网关接收服务器发送的响应报文。Specifically, the Internet gateway receives the response message sent by the server.

S402、在会话表中查询是否存在与响应报文的五元组关联的反向下一跳IP地址。S402. Query whether there is a reverse next-hop IP address associated with the quintuple of the response message in the session table.

S403、根据会话中记录的反向下一跳IP地址将请求报文发送给流量管理网元的网际端口。S403. Send the request packet to the Internet port of the traffic management network element according to the reverse next-hop IP address recorded in the session.

S404、丢弃响应报文。S404. Discard the response packet.

参见图5,为本发明实施例提供的一种报文传输方法的流程示意图,在本发明实施例中,所述方法包括:Referring to FIG. 5, it is a schematic flowchart of a message transmission method provided by an embodiment of the present invention. In an embodiment of the present invention, the method includes:

S501、用户网关生成探测请求报文。S501. The user gateway generates a detection request message.

具体的,用户网关关联多个流量管理网元,每个流量管理网元具有用户端口和网际端口,用户网关为每个用户端口和每个网际端口分配IP地址,用户网关根据多个流量管理网元的用户端口生成用户端口列表,用户端口列表中每个表项存储有用户端口的IP地址和MAC地址。同时,用户网关根据多个流量管理网元的网际端口生成网际端口列表,网际端口列表中每个表项存储有网际端口的IP地址和MAC地址。用户网关生成探测请求报文,探测请求报文的源IP地址为用户网关的IP地址,正向下一跳IP地址为待探测的流量管理网元的用户端口的IP地址,目的IP地址为网际网关的IP地址。Specifically, the user gateway is associated with multiple traffic management network elements, and each traffic management network element has a user port and an Internet port. The user gateway assigns an IP address to each user port and each Internet port. The user port of the unit generates a user port list, and each entry in the user port list stores the IP address and MAC address of the user port. At the same time, the user gateway generates an Internet port list according to the Internet ports of multiple traffic management network elements, and each entry in the Internet port list stores the IP address and MAC address of the Internet port. The user gateway generates a detection request message, the source IP address of the detection request message is the IP address of the user gateway, the IP address of the next hop forward is the IP address of the user port of the traffic management network element to be detected, and the destination IP address is the Internet The IP address of the gateway.

S502、用户网关向流量管理网元发送探测请求报文。S502. The user gateway sends a detection request message to the traffic management network element.

具体的,用户网关根据探测请求报文的正向下一跳IP地址,将探测请求报文发送给待探测的流量管理网元。Specifically, the user gateway sends the detection request message to the traffic management network element to be detected according to the next-hop forward IP address of the detection request message.

S503、流量管理网元将探测请求报文从用户端口转发至网际端口。S503. The traffic management network element forwards the detection request message from the user port to the Internet port.

具体的,流量管理网元从用户端口接收用户网关发送的探测请求报文,将探测请求报文转发到对应的网际端口,同时将探测请求报文的源MAC地址修改为流量管理网元的网际端口的MAC地址。Specifically, the traffic management network element receives the detection request message sent by the user gateway from the user port, forwards the detection request message to the corresponding Internet port, and at the same time modifies the source MAC address of the detection request message to the network address of the traffic management network element. MAC address of the port.

S504、流量管理网元将探测请求报文发送给网际网关。S504. The traffic management network element sends the detection request packet to the Internet gateway.

具体的,流量管理网元根据探测请求报文中携带的目的IP地址,将探测请求报文发送给网际网关。Specifically, the traffic management network element sends the detection request message to the Internet gateway according to the destination IP address carried in the detection request message.

S505、网际网关获取探测请求报文的源MAC地址,查询源MAC地址关联的IP地址。S505. The internet gateway obtains the source MAC address of the detection request message, and queries the IP address associated with the source MAC address.

具体的,网际网关接收探测请求报文,获取探测请求报文携带的源MAC地址,此时的源MAC地址为流量管理网元的MAC地址。Specifically, the Internet gateway receives the probe request message, and obtains the source MAC address carried in the probe request message, where the source MAC address is the MAC address of the traffic management network element.

S506、根据源MAC地址和查询到的IP地址生成探测响应报文。S506. Generate a probe response message according to the source MAC address and the queried IP address.

具体的,网际网关可根据ARP协议反查流量管理网元的网际端口的IP地址,将待探测的流量管理网元的网际端口的IP地址和MAC地址填入探测响应报文中。Specifically, the Internet gateway can check back the IP address of the Internet port of the traffic management network element according to the ARP protocol, and fill the IP address and MAC address of the Internet port of the traffic management network element to be detected into the detection response message.

S507、网际网关向用户网关发送探测响应报文。S507. The internet gateway sends a probe response message to the user gateway.

S508、查询源MAC地址和IP地址是否位于网际端口列表中。S508. Query whether the source MAC address and IP address are in the Internet port list.

具体的,用户网关接收探测响应报文,获取探测响应报文中携带的MAC地址和IP地址,该MAC地址和IP地址为待探测的流量管理网元的网际端口的IP地址和MAC地址,用户网关查询上述的MAC地址和IP地址是否位于网际端口列表中,若为是,执行S509。Specifically, the user gateway receives the detection response message, and obtains the MAC address and the IP address carried in the detection response message. The MAC address and the IP address are the IP address and the MAC address of the Internet port of the traffic management network element to be detected. The gateway queries whether the aforementioned MAC address and IP address are in the Internet port list, and if yes, executes S509.

S509、用户端口和网际端口进行绑定。S509, the user port and the Internet port are bound.

具体的,用户网关将用户端口的IP地址及MAC地址和网际端口的IP地址及MAC地址进行绑定,Specifically, the user gateway binds the IP address and the MAC address of the user port with the IP address and the MAC address of the Internet port,

S510、用户网关向网际网关通知绑定关系。S510. The user gateway notifies the Internet gateway of the binding relationship.

具体的,用户网关向网际网关通知S509中确定的用户端口和网际端口的绑定关系,网际网关根据绑定关系得知待探测的流量管理网元的用户接口和网际接口的MAC地址和IP地址。Specifically, the user gateway notifies the Internet gateway of the binding relationship between the user port and the Internet port determined in S509, and the Internet gateway learns the MAC address and IP address of the user interface and the Internet interface of the traffic management network element to be detected according to the binding relationship .

实施上述实施例,用户网关在接收终端发送的请求报文,根据请求报文的五元组在会话表中查询关联的正向下一跳IP地址,或者根据请求报文的源MAC地址在会话保持表中查询关联的正向下一跳IP地址,这样可以确保同一用户的流量经过相同的流量管理网元,实现对用户流量的精确监控。Implement the above-mentioned embodiment, the user gateway receives the request message sent by the terminal, and queries the associated forward next-hop IP address in the session table according to the quintuple of the request message, or according to the source MAC address of the request message in the session Keep the forward next-hop IP address associated with the query in the table, so as to ensure that the traffic of the same user passes through the same traffic management network element, and realize accurate monitoring of user traffic.

参见图6,下面根据图6的例子对本方实施例的用户端口和网际端口的绑定关系进行说明:用户网关与流量管理网元1和流量管理网元2连接,网际网关与流量管理网元1和流量管理网元2连接,用户网关还与网际网关连接。用户网关的IP地址为1.1.1.254,网际网关的IP地址为2.2.2.254,用户网关接收流量管理网元1发起的DHCP请求,DHCP请求中携带流量管理网元1的用户端口的MAC地址1-1-1,将为流量管理网元1的用户端口分配的IP地址和MAC地址进行绑定。流量管理网元1通过网际网关向用户网关发送DHCP请求,请求用户网关为流量管理网元1的网际端口分配IP地址,DHCP请求中携带流量管理网元1的网际端口的MAC地址,用户网关接收到该DHCP请求,为流量管理网元1的网际端口分配IP地址为2.2.2.1。同理,用户网关为流量管理网元2的用户端口分配的IP地址为1.1.1.2,为流量管理网元2的网际端口分配的IP地址为2.2.2.2。用户网关生成用户端口列表(MAC:1-1-1,IP:1.1.1.1)、(MAC:3-3-3,IP:1.1.1.2),用户网关生成网际端口列表:(MAC:2-2-2,IP:2.2.2.1)、(MAC:4-4-4,2.2.2.2)。Referring to Fig. 6, the binding relationship between the user port and the Internet port of this embodiment is described below according to the example in Fig. 6: the user gateway is connected to the traffic management network element 1 and the traffic management network element 2, and the Internet gateway is connected to the traffic management network element 1 is connected to the traffic management network element 2, and the user gateway is also connected to the Internet gateway. The IP address of the user gateway is 1.1.1.254, and the IP address of the Internet gateway is 2.2.2.254. The user gateway receives the DHCP request initiated by the traffic management network element 1, and the DHCP request carries the MAC address 1- 1-1, the IP address assigned to the user port of traffic management network element 1 is bound to the MAC address. The traffic management network element 1 sends a DHCP request to the user gateway through the Internet gateway, requesting the user gateway to allocate an IP address for the Internet port of the traffic management network element 1, and the DHCP request carries the MAC address of the Internet port of the traffic management network element 1, and the user gateway receives Upon receiving the DHCP request, an IP address 2.2.2.1 is assigned to the Internet port of the traffic management network element 1 . Similarly, the IP address assigned by the user gateway to the user port of the traffic management network element 2 is 1.1.1.2, and the IP address assigned to the Internet port of the traffic management network element 2 is 2.2.2.2. The user gateway generates the user port list (MAC: 1-1-1, IP: 1.1.1.1), (MAC: 3-3-3, IP: 1.1.1.2), and the user gateway generates the Internet port list: (MAC: 2- 2-2, IP: 2.2.2.1), (MAC: 4-4-4, 2.2.2.2).

以流量管理网元1为例,用户网关需要探测流量网元1上用户端口和网际端口的IP地址,用户网关向流量管理网元1发送探测请求报文,探测请求报文携带的源IP地址为用户网关的IP地址1.1.1.254,正向下一跳IP地址为流量管理网元1的用户端口的IP地址:1.1.1.1,目的IP地址为网际网关的IP地址2.2.2.254,用户网关根据正向下一跳IP地址:1.1.1.1将探测请求报文发送流量管理网元1的用户端口,流量管理网元1将探测请求报文转发到相应的网际端口,以及将探测请求报文的源MAC地址更新为网际端口的MAC地址:2.2.2.1,网际网关接收探测请求报文,获取探测请求报文中携带的源MAC地址,根据ARP协议反查到源MAC地址关联的IP地址为2.2.2.1,网际网关将源MAC地址和查询到的IP地址填入到探测响应报文中,网际网关向用户网关返回探测响应报文,用户网关接收探测请求报文,获取探测响应报文中携带的MAC地址和IP地址,查询网际端口列表中时长存在探测响应报文中携带的MAC地址和IP地址,若为是,表明MAC地址:2-2-2和IP地址2.2.2.1为流量管理网元1的网际端口的地址信息,用户网关将(MAC:1-1-1,IP:1.1.1.1)与(MAC:2-2-2,IP:2.2.2.1)进行绑定,以及将绑定关系通知给网际网关。Taking traffic management network element 1 as an example, the user gateway needs to detect the IP addresses of the user port and the Internet port on traffic network element 1, and the user gateway sends a detection request message to traffic management network element 1, and the source IP address carried in the detection request message The IP address of the user gateway is 1.1.1.254, the IP address of the next hop forward is the IP address of the user port of traffic management network element 1: 1.1.1.1, the destination IP address is the IP address of the Internet gateway 2.2.2.254, and the user gateway is based on Forward next-hop IP address: 1.1.1.1 sends the detection request message to the user port of traffic management network element 1, and traffic management network element 1 forwards the detection request message to the corresponding Internet port, and sends the detection request message to The source MAC address is updated to the MAC address of the Internet port: 2.2.2.1. The Internet gateway receives the detection request message and obtains the source MAC address carried in the detection request message. According to the ARP protocol, the IP address associated with the source MAC address is found to be 2.2. .2.1, the Internet gateway fills the source MAC address and the queried IP address into the detection response message, the Internet gateway returns the detection response message to the user gateway, the user gateway receives the detection request message, and obtains the MAC address and IP address in the Internet port list, query the MAC address and IP address carried in the detection response message for a long time in the Internet port list, if yes, indicate that the MAC address: 2-2-2 and IP address 2.2.2.1 are traffic management network The address information of the Internet port of element 1, the user gateway binds (MAC: 1-1-1, IP: 1.1.1.1) with (MAC: 2-2-2, IP: 2.2.2.1), and binds Notify the Internet gateway of the established relationship.

用户网关对流量管理网元2的用户端口和网际端口的探测可参照对流量管理网元1的探测,此处不再赘述。The detection of the user port and the Internet port of the traffic management network element 2 by the user gateway can refer to the detection of the traffic management network element 1, which will not be repeated here.

请参见图7,图7是本发明实施例提供的一种用户网关70,该用户网关70包括处理器701、存储器702和通信接口703,所述处理器701、存储器702和通信接口703通过总线相互连接。Please refer to FIG. 7. FIG. 7 is a user gateway 70 provided by an embodiment of the present invention. The user gateway 70 includes a processor 701, a memory 702, and a communication interface 703. interconnected.

存储器402包括但不限于是随机存储记忆体(英文:RandomAccess Memory,简称:RAM)、只读存储器(英文:Read-Only Memory,简称:ROM)、可擦除可编程只读存储器(英文:Erasable Programmable Read Only Memory,简称:EPROM)、或便携式只读存储器(英文:Compact Disc Read-Only Memory,简称:CD-ROM),该存储器402用于相关指令及数据。收发器703用于接收和发送数据。The memory 402 includes but is not limited to random access memory (English: Random Access Memory, referred to as: RAM), read-only memory (English: Read-Only Memory, referred to as: ROM), erasable programmable read-only memory (English: Erasable Programmable Read Only Memory, EPROM for short), or portable read-only memory (English: Compact Disc Read-Only Memory, CD-ROM for short), the memory 402 is used for related instructions and data. The transceiver 703 is used to receive and transmit data.

处理器701可以是一个或多个中央处理器(英文:Central Processing Unit,简称:CPU),在处理器701是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 701 may be one or more central processing units (English: Central Processing Unit, CPU for short). When the processor 701 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.

该用户网关70中的处理器701用于读取所述存储器702中存储的程序代码,执行以下操作:The processor 701 in the user gateway 70 is used to read the program code stored in the memory 702, and perform the following operations:

接收请求报文;其中,所述请求报文携带五元组;receiving a request message; wherein, the request message carries a quintuple;

在会话表中查询是否存在与所述请求报文的五元组关联的正向下一跳IP地址;Query whether there is a forward next-hop IP address associated with the quintuple of the request message in the session table;

若为否,获取所述请求报文的源MAC地址;If not, obtain the source MAC address of the request message;

查询会话保持表中是否存在与所述源IP地址关联的正向下一跳IP地址;Querying whether there is a positive next-hop IP address associated with the source IP address in the session holding table;

若为是,所述用户网关将所述请求报文发送给正向下一跳IP地址指示的流量管理网元的用户端口。If yes, the user gateway sends the request packet to the user port of the traffic management network element indicated by the next-hop IP address.

可选的,处理器701还用于执行:Optionally, the processor 701 is also configured to execute:

在所述会话表中查询存在所述五元组关联的正向下一跳IP地址;Querying the forward next-hop IP address associated with the five-tuple in the session table;

将所述请求报文发送给流量管理网元。Send the request packet to the traffic management network element.

可选的,处理器701还用于执行:Optionally, the processor 701 is also configured to execute:

在所述会话表中不存在与所述报文的五元组关联的正向下一跳IP地址,且所述会话保持表中不存在与所述源MAC地址关联的正向下一跳IP地址的情况下,The forward next-hop IP address associated with the quintuple of the message does not exist in the session table, and the forward next-hop IP address associated with the source MAC address does not exist in the session hold table In the case of an address,

根据所述五元组中的一个或多个参数从多个流量管理网元中确定目标流量管理网元,将所述目标流量管理网元的用户端口的IP地址作为目标正向下一跳IP地址;Determine the target traffic management network element from multiple traffic management network elements according to one or more parameters in the quintuple, and use the IP address of the user port of the target traffic management network element as the target forward next hop IP address;

在所述会话表中创建表项,将所述五元组和所述目标正向下一跳IP地址进行绑定后存放在建立的表项中;Create an entry in the session table, bind the five-tuple and the target forward-to-next-hop IP address and store it in the established entry;

在会话保持表中建立表项,将源MAC地址和所述目标正向下一跳IP地址进行绑定后存储在建立的表项中。An entry is established in the session maintenance table, and the source MAC address is bound with the IP address of the target's next hop and stored in the established entry.

可选的,处理器701执行所述根据所述五元组中的一个或多个参数从多个流量管理网元中确定目标管理网元包括:Optionally, the performing by the processor 701 of determining a target management network element from multiple traffic management network elements according to one or more parameters in the quintuple includes:

对五元组中的一个或多个参数进行哈希运算得到一个哈希值;Perform a hash operation on one or more parameters in the five-tuple to obtain a hash value;

确定多个流量管理网元的数量,将所述哈希值和所述数量取模运算后得到所述目标管理网元的序号。The number of multiple traffic management network elements is determined, and the serial number of the target management network element is obtained after a modulo operation of the hash value and the number.

需要说明的是,各个操作的实现还可以对应参照图2至4所示的方法实施例的相应描述。It should be noted that the implementation of each operation may also refer to corresponding descriptions of the method embodiments shown in FIGS. 2 to 4 .

综上所述,通过实施本发明实施例,用户网关在接收终端发送的请求报文,根据请求报文的五元组在会话表中查询关联的正向下一跳IP地址,或者根据请求报文的源MAC地址在会话保持表中查询关联的正向下一跳IP地址,这样可以确保同一用户的流量经过相同的流量管理网元,实现对用户流量的精确监控。To sum up, by implementing the embodiment of the present invention, the user gateway receives the request message sent by the terminal, and queries the associated forward next-hop IP address in the session table according to the quintuple of the request message, or according to the request message The source MAC address of the text is queried in the session hold table for the associated forward next-hop IP address, which ensures that the traffic of the same user passes through the same traffic management network element, and realizes accurate monitoring of user traffic.

请参见图8,图8是本发明实施例提供的一种网际网关80,该网际网关80包括处理器801、存储器802和通信接口803,所述处理器801、存储器802和通信接口803通过总线相互连接。Please refer to FIG. 8. FIG. 8 is an Internet gateway 80 provided by an embodiment of the present invention. The Internet gateway 80 includes a processor 801, a memory 802, and a communication interface 803. interconnected.

存储器402包括但不限于是随机存储记忆体(英文:RandomAccess Memory,简称:RAM)、只读存储器(英文:Read-Only Memory,简称:ROM)、可擦除可编程只读存储器(英文:Erasable Programmable Read Only Memory,简称:EPROM)、或便携式只读存储器(英文:Compact Disc Read-Only Memory,简称:CD-ROM),该存储器402用于相关指令及数据。收发器803用于接收和发送数据。The memory 402 includes but is not limited to random access memory (English: Random Access Memory, referred to as: RAM), read-only memory (English: Read-Only Memory, referred to as: ROM), erasable programmable read-only memory (English: Erasable Programmable Read Only Memory, EPROM for short), or portable read-only memory (English: Compact Disc Read-Only Memory, CD-ROM for short), the memory 402 is used for related instructions and data. The transceiver 803 is used to receive and transmit data.

处理器801可以是一个或多个中央处理器(英文:Central Processing Unit,简称:CPU),在处理器801是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 801 may be one or more central processing units (English: Central Processing Unit, CPU for short). When the processor 801 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.

该网际网关80中的处理器801用于读取所述存储器802中存储的程序代码,执行以下操作:The processor 801 in the Internet gateway 80 is used to read the program code stored in the memory 802, and perform the following operations:

通过网际端口接收流量管理网元发送的请求报文;其中,所述请求报文携带五元组;receiving a request message sent by a traffic management network element through an internet port; wherein, the request message carries a quintuple;

在会话表中查询是否存在与所述五元组关联的正向下一跳IP地址;Query whether there is a positive next-hop IP address associated with the five-tuple in the session table;

若为否,在路由表中查询所述请求报文的正向下一跳IP地址;If not, query the forward next-hop IP address of the request message in the routing table;

获取所述请求报文的源MAC地址,根据所述请求报文的源MAC地址查询得到流量管理网元的IP地址,将查询得到的IP地址存储在所述表项中,作为反向下一跳IP地址;Obtaining the source MAC address of the request message, querying the IP address of the traffic management network element according to the source MAC address of the request message, and storing the IP address obtained by querying in the entry as a reverse next skip IP address;

在所述会话表中创建表项,将五元组、正向下一跳IP地址和反向下一跳IP地址进行绑定后存储在创建的表项中。An entry is created in the session table, and the five-tuple, the forward next-hop IP address and the reverse next-hop IP address are bound and stored in the created entry.

可选的,处理器801还用于执行:Optionally, the processor 801 is also used to execute:

接收所述请求报文对应的响应报文;receiving a response message corresponding to the request message;

在所述会话表中查询是否存在与所述响应报文关联的表项;Query whether there is an entry associated with the response message in the session table;

若为是,根据关联的表项确定反向下一跳IP地址,根据所述反向下一跳IP地址将所述响应报文发送给流量管理网元的网际端口;If so, determine the reverse next-hop IP address according to the associated table entry, and send the response message to the Internet port of the traffic management network element according to the reverse next-hop IP address;

若为否,丢弃所述响应报文。If not, discard the response packet.

上述实施例可看出,网际网关在接收到用户的请求报文后,直接根据请求报文的源MAC地址反查出反向下一跳IP地址,这样网际网关在接收到请求报文对应的响应报文时,直接可通过查会话表得到反向下一跳IP地址,避免查路由表消耗大量时长,减少报文传输时延。It can be seen from the foregoing embodiments that after receiving the request message from the user, the Internet gateway directly finds out the reverse next-hop IP address according to the source MAC address of the request message, so that the Internet gateway receives the corresponding IP address of the request message. When responding to a message, the reverse next-hop IP address can be obtained directly by looking up the session table, avoiding the time-consuming lookup of the routing table and reducing the message transmission delay.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present invention will be generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted via a computer-readable storage medium. The computer instructions may be transmitted from one website site, computer, server, or data center to another website site by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) , computer, server or data center for transmission. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments are realized. The processes can be completed by computer programs to instruct related hardware. The programs can be stored in computer-readable storage media. When the programs are executed , may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store program codes.

Claims (13)

Translated fromChinese
1.一种报文传输方法,其特征在于,包括:1. A message transmission method, characterized in that, comprising:用户网关接收请求报文;其中,所述请求报文携带五元组;The user gateway receives the request message; wherein, the request message carries a quintuple;所述用户网关在会话表中查询是否存在与所述请求报文的五元组关联的正向下一跳IP地址;The user gateway inquires in the session table whether there is a forward next-hop IP address associated with the quintuple of the request message;若为否,所述用户网关获取所述请求报文的源介质访问控制MAC地址;If not, the user gateway obtains the source media access control MAC address of the request message;所述用户网关查询会话保持表中是否存在与所述源IP地址关联的正向下一跳IP地址;The user gateway queries whether there is a forward next-hop IP address associated with the source IP address in the session holding table;若为是,所述用户网关将所述请求报文发送给正向下一跳IP地址指示的流量管理网元的用户端口。If yes, the user gateway sends the request packet to the user port of the traffic management network element indicated by the next-hop IP address.2.如权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising:所述用户网关在所述会话表中查询存在所述五元组关联的正向下一跳IP地址;The user gateway queries the forward next-hop IP address associated with the quintuple in the session table;所述用户网关将所述请求报文发送给流量管理网元。The user gateway sends the request message to the traffic management network element.3.如权利要求1所述的方法,其特征在于,还包括:3. The method of claim 1, further comprising:在所述会话表中不存在与所述报文的五元组关联的正向下一跳IP地址,且所述会话保持表中不存在与所述源MAC地址关联的正向下一跳IP地址的情况下The forward next-hop IP address associated with the quintuple of the message does not exist in the session table, and the forward next-hop IP address associated with the source MAC address does not exist in the session hold table in case of address根据所述五元组中的一个或多个参数从多个流量管理网元中确定目标流量管理网元,将所述目标流量管理网元的用户端口的IP地址作为目标正向下一跳IP地址;Determine the target traffic management network element from multiple traffic management network elements according to one or more parameters in the quintuple, and use the IP address of the user port of the target traffic management network element as the target forward next hop IP address;在所述会话表中创建表项,将所述五元组和所述目标正向下一跳IP地址进行绑定后存放在建立的表项中;Create an entry in the session table, bind the five-tuple and the target forward-to-next-hop IP address and store it in the established entry;在会话保持表中建立表项,将源MAC地址和所述目标正向下一跳IP地址进行绑定后存储在建立的表项中。An entry is established in the session maintenance table, and the source MAC address is bound with the IP address of the target's next hop and stored in the established entry.4.如权利要求3所述的方法,其特征在于,所述根据所述五元组中的一个或多个参数从多个流量管理网元中确定目标管理网元包括:4. The method according to claim 3, wherein the determining the target management network element from multiple traffic management network elements according to one or more parameters in the five-tuple comprises:对五元组中的一个或多个参数进行哈希运算得到一个哈希值;Perform a hash operation on one or more parameters in the five-tuple to obtain a hash value;确定多个流量管理网元的数量,将所述哈希值和所述数量取模运算后得到所述目标管理网元的序号。The number of multiple traffic management network elements is determined, and the serial number of the target management network element is obtained after a modulo operation of the hash value and the number.5.一种报文传输方法,其特征在于,包括:5. A message transmission method, characterized in that, comprising:网际网关通过网际端口接收流量管理网元发送的请求报文;其中,所述请求报文携带五元组;The Internet gateway receives the request message sent by the traffic management network element through the Internet port; wherein, the request message carries a quintuple;所述网际网关在会话表中查询是否存在与所述五元组关联的正向下一跳IP地址;The Internet gateway queries in the session table whether there is a forward next-hop IP address associated with the five-tuple;若为否,在路由表中查询所述请求报文的正向下一跳IP地址;If not, query the forward next-hop IP address of the request message in the routing table;获取所述请求报文的源MAC地址,根据所述请求报文的源MAC地址查询得到流量管理网元的IP地址,将查询得到的IP地址存储在所述表项中,作为反向下一跳IP地址;Obtaining the source MAC address of the request message, querying the IP address of the traffic management network element according to the source MAC address of the request message, and storing the IP address obtained by querying in the entry as a reverse next skip IP address;在所述会话表中创建表项,将五元组、正向下一跳IP地址和反向下一跳IP地址进行绑定后存储在创建的表项中。An entry is created in the session table, and the five-tuple, the forward next-hop IP address and the reverse next-hop IP address are bound and stored in the created entry.6.如权利要求5所述的方法,其特征在于,还包括:6. The method of claim 5, further comprising:所述网际网关接收所述请求报文对应的响应报文;The internet gateway receives a response message corresponding to the request message;所述网际网关在所述会话表中查询是否存在与所述响应报文关联的表项;The Internet gateway queries in the session table whether there is an entry associated with the response message;若为是,所述网际网关根据关联的表项确定反向下一跳IP地址,根据所述反向下一跳IP地址将所述响应报文发送给流量管理网元的网际端口;If yes, the Internet gateway determines the reverse next-hop IP address according to the associated table entry, and sends the response message to the Internet port of the traffic management network element according to the reverse next-hop IP address;若为否,所述网际网关丢弃所述响应报文。If not, the Internet gateway discards the response message.7.一种用户网关,其特征在于,包括:存储器和处理器,所述存储器存储有程序代码,所述处理器调用所述程序代码用于执行以下操作:7. A user gateway, comprising: a memory and a processor, the memory stores program codes, and the processor invokes the program codes to perform the following operations:接收请求报文;其中,所述请求报文携带五元组;receiving a request message; wherein, the request message carries a quintuple;在会话表中查询是否存在与所述请求报文的五元组关联的正向下一跳IP地址;Query whether there is a forward next-hop IP address associated with the quintuple of the request message in the session table;若为否,获取所述请求报文的源MAC地址;If not, obtain the source MAC address of the request message;查询会话保持表中是否存在与所述源IP地址关联的正向下一跳IP地址;Querying whether there is a positive next-hop IP address associated with the source IP address in the session holding table;若为是,所述用户网关将所述请求报文发送给正向下一跳IP地址指示的流量管理网元的用户端口。If yes, the user gateway sends the request packet to the user port of the traffic management network element indicated by the next-hop IP address.8.如权利要求7所述的用户网关,其特征在于,所述处理器还用于执行:8. The user gateway according to claim 7, wherein the processor is further configured to perform:在所述会话表中查询存在所述五元组关联的正向下一跳IP地址;Querying the forward next-hop IP address associated with the five-tuple in the session table;将所述请求报文发送给流量管理网元。Send the request packet to the traffic management network element.9.如权利要求7所述的用户网关,其特征在于,所述处理器还用于执行:9. The user gateway according to claim 7, wherein the processor is further configured to:在所述会话表中不存在与所述报文的五元组关联的正向下一跳IP地址,且所述会话保持表中不存在与所述源MAC地址关联的正向下一跳IP地址的情况下,The forward next-hop IP address associated with the quintuple of the message does not exist in the session table, and the forward next-hop IP address associated with the source MAC address does not exist in the session hold table In the case of an address,根据所述五元组中的一个或多个参数从多个流量管理网元中确定目标流量管理网元,将所述目标流量管理网元的用户端口的IP地址作为目标正向下一跳IP地址;Determine the target traffic management network element from multiple traffic management network elements according to one or more parameters in the quintuple, and use the IP address of the user port of the target traffic management network element as the target forward next hop IP address;在所述会话表中创建表项,将所述五元组和所述目标正向下一跳IP地址进行绑定后存放在建立的表项中;Create an entry in the session table, bind the five-tuple and the target forward-to-next-hop IP address and store it in the established entry;在会话保持表中建立表项,将源MAC地址和所述目标正向下一跳IP地址进行绑定后存储在建立的表项中。An entry is established in the session maintenance table, and the source MAC address is bound with the IP address of the target's next hop and stored in the established entry.10.如权利要求9所述的用户网关,其特征在于,所述处理器执行所述根据所述五元组中的一个或多个参数从多个流量管理网元中确定目标管理网元包括:10. The user gateway according to claim 9, wherein the processor performing the determining the target management network element from multiple traffic management network elements according to one or more parameters in the five-tuple comprises :对五元组中的一个或多个参数进行哈希运算得到一个哈希值;Perform a hash operation on one or more parameters in the five-tuple to obtain a hash value;确定多个流量管理网元的数量,将所述哈希值和所述数量取模运算后得到所述目标管理网元的序号。The number of multiple traffic management network elements is determined, and the serial number of the target management network element is obtained after a modulo operation of the hash value and the number.11.一种网际网关,其特征在于,包括存储器和处理器,所述存储器存储有程序代码,所述处理器调用所述程序代码用于执行以下操作:11. A kind of Internet gateway, is characterized in that, comprises memory and processor, and described memory is stored with program code, and described processor calls described program code and is used for performing the following operations:通过网际端口接收流量管理网元发送的请求报文;其中,所述请求报文携带五元组;receiving a request message sent by a traffic management network element through an internet port; wherein, the request message carries a quintuple;在会话表中查询是否存在与所述五元组关联的正向下一跳IP地址;Query whether there is a positive next-hop IP address associated with the five-tuple in the session table;若为否,在路由表中查询所述请求报文的正向下一跳IP地址;If not, query the forward next-hop IP address of the request message in the routing table;获取所述请求报文的源MAC地址,根据所述请求报文的源MAC地址查询得到流量管理网元的IP地址,将查询得到的IP地址存储在所述表项中,作为反向下一跳IP地址;Obtaining the source MAC address of the request message, querying the IP address of the traffic management network element according to the source MAC address of the request message, and storing the IP address obtained by querying in the entry as a reverse next skip IP address;在所述会话表中创建表项,将五元组、正向下一跳IP地址和反向下一跳IP地址进行绑定后存储在创建的表项中。An entry is created in the session table, and the five-tuple, the forward next-hop IP address and the reverse next-hop IP address are bound and stored in the created entry.12.如权利要求11所述的用户网关,其特征在于,所述处理器还用于执行:12. The user gateway according to claim 11, wherein the processor is further configured to:接收所述请求报文对应的响应报文;receiving a response message corresponding to the request message;在所述会话表中查询是否存在与所述响应报文关联的表项;Query whether there is an entry associated with the response message in the session table;若为是,根据关联的表项确定反向下一跳IP地址,根据所述反向下一跳IP地址将所述响应报文发送给流量管理网元的网际端口;If so, determine the reverse next-hop IP address according to the associated table entry, and send the response message to the Internet port of the traffic management network element according to the reverse next-hop IP address;若为否,丢弃所述响应报文。If not, discard the response packet.13.一种流量计费系统,其特征在于,包括用户网关、多个流量管理网元和网际网关;13. A traffic billing system, characterized in that it includes a user gateway, a plurality of traffic management network elements and an Internet gateway;所述用户网关,用于接收请求报文;在所述用户网关的会话表中查询是否存在与所述请求报文的五元组关联的正向下一跳IP地址;若为否,获取所述请求报文的源MAC地址,查询所述用户网关的会话保持表中是否存在与所述源IP地址关联的正向下一跳IP地址;若为是,将所述请求报文发送给正向下一跳IP地址指示的流量管理网元的用户端口;所述正向下一跳IP地址指示的流量管理网元属于所述多个流量管理网元;The user gateway is used to receive the request message; in the session table of the user gateway, inquire whether there is a forward next-hop IP address associated with the quintuple of the request message; if not, obtain the The source MAC address of the request message, query whether there is a forward next-hop IP address associated with the source IP address in the session maintenance table of the user gateway; if yes, send the request message to the regular A user port of the traffic management network element indicated by the next-hop IP address; the traffic management network element being indicated by the next-hop IP address belongs to the plurality of traffic management network elements;所述流量管理网元,用于通过用户端口接收所述请求报文,以及将所述请求报文通过所述网际端口发送至所述网际网关;The traffic management network element is configured to receive the request message through the user port, and send the request message to the Internet gateway through the Internet port;所述网际网关,用于接收所述流量管理网元转发的请求报文;在所述网际网关的会话表中查询是否存在与所述五元组关联的正向下一跳IP地址;若为否,在路由表中查询所述请求报文的正向下一跳IP地址;获取所述请求报文的源MAC地址,根据所述请求报文的源MAC地址查询得到流量管理网元的IP地址,将查询得到的IP地址存储在所述表项中,作为反向下一跳IP地址;在所述网际网际的会话表中创建表项,将五元组、正向下一跳IP地址和反向下一跳IP地址进行绑定后存储在创建的表项中。The Internet gateway is used to receive the request message forwarded by the traffic management network element; query whether there is a forward next-hop IP address associated with the five-tuple in the session table of the Internet gateway; if it is No, query the forward next hop IP address of the request message in the routing table; obtain the source MAC address of the request message, and obtain the IP address of the traffic management network element according to the source MAC address of the request message address, the IP address obtained by querying is stored in the entry as the reverse next-hop IP address; an entry is created in the session table of the Internet, and the quintuple and forward next-hop IP address are After binding with the reverse next-hop IP address, it is stored in the created table entry.
CN201710112958.3A2017-02-282017-02-28 A message transmission method, related equipment and systemExpired - Fee RelatedCN108512714B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710112958.3ACN108512714B (en)2017-02-282017-02-28 A message transmission method, related equipment and system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710112958.3ACN108512714B (en)2017-02-282017-02-28 A message transmission method, related equipment and system

Publications (2)

Publication NumberPublication Date
CN108512714Atrue CN108512714A (en)2018-09-07
CN108512714B CN108512714B (en)2021-10-01

Family

ID=63374239

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710112958.3AExpired - Fee RelatedCN108512714B (en)2017-02-282017-02-28 A message transmission method, related equipment and system

Country Status (1)

CountryLink
CN (1)CN108512714B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109361608A (en)*2018-11-232019-02-19北京六方领安网络科技有限公司Message processing method, system and storage medium
CN111064668A (en)*2018-10-172020-04-24华为技术有限公司 Routing table entry generation method, device and related equipment
WO2021139311A1 (en)*2020-08-072021-07-15平安科技(深圳)有限公司Routing forwarding method and apparatus, routing device and readable storage medium
CN114285659A (en)*2021-12-282022-04-05深圳市酷开网络科技股份有限公司Reverse proxy method, device, equipment and storage medium
CN114938348A (en)*2021-02-042022-08-23北京金山云网络技术有限公司Data stream forwarding method and device, electronic equipment and storage medium
CN116016339A (en)*2022-12-272023-04-25北京天融信网络安全技术有限公司Message path selection method, device, electronic equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1380773A (en)*2002-04-252002-11-20复旦大学Enhanced NAT-PT protocol scheme
CN101170515A (en)*2007-12-042008-04-30华为技术有限公司 A method, system and gateway device for processing messages
CN101938415A (en)*2010-08-302011-01-05北京傲天动联技术有限公司Rapid forwarding method for network forwarding device
CN102025643A (en)*2010-12-302011-04-20华为技术有限公司Flow table search method and device
CN102664804A (en)*2012-04-242012-09-12汉柏科技有限公司Method and system for achieving network bridge function of network equipment
CN103595711A (en)*2013-11-062014-02-19神州数码网络(北京)有限公司Adjusting safety access method and exchanger
US20150071080A1 (en)*2013-09-102015-03-12Cisco Technology, Inc.Redundancy for inter-as l2vpn service with optimal forwarding

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1380773A (en)*2002-04-252002-11-20复旦大学Enhanced NAT-PT protocol scheme
CN101170515A (en)*2007-12-042008-04-30华为技术有限公司 A method, system and gateway device for processing messages
CN101938415A (en)*2010-08-302011-01-05北京傲天动联技术有限公司Rapid forwarding method for network forwarding device
CN102025643A (en)*2010-12-302011-04-20华为技术有限公司Flow table search method and device
CN102664804A (en)*2012-04-242012-09-12汉柏科技有限公司Method and system for achieving network bridge function of network equipment
US20150071080A1 (en)*2013-09-102015-03-12Cisco Technology, Inc.Redundancy for inter-as l2vpn service with optimal forwarding
CN103595711A (en)*2013-11-062014-02-19神州数码网络(北京)有限公司Adjusting safety access method and exchanger

Cited By (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111064668A (en)*2018-10-172020-04-24华为技术有限公司 Routing table entry generation method, device and related equipment
CN111064668B (en)*2018-10-172022-06-14华为技术有限公司Method and device for generating routing table entry and related equipment
CN109361608A (en)*2018-11-232019-02-19北京六方领安网络科技有限公司Message processing method, system and storage medium
CN109361608B (en)*2018-11-232021-04-27北京六方云信息技术有限公司Message processing method, system and storage medium
WO2021139311A1 (en)*2020-08-072021-07-15平安科技(深圳)有限公司Routing forwarding method and apparatus, routing device and readable storage medium
CN114938348A (en)*2021-02-042022-08-23北京金山云网络技术有限公司Data stream forwarding method and device, electronic equipment and storage medium
CN114285659A (en)*2021-12-282022-04-05深圳市酷开网络科技股份有限公司Reverse proxy method, device, equipment and storage medium
CN114285659B (en)*2021-12-282024-05-24深圳市酷开网络科技股份有限公司Reverse proxy method, device, equipment and storage medium
CN116016339A (en)*2022-12-272023-04-25北京天融信网络安全技术有限公司Message path selection method, device, electronic equipment and medium

Also Published As

Publication numberPublication date
CN108512714B (en)2021-10-01

Similar Documents

PublicationPublication DateTitle
US9438496B2 (en)Monitoring link quality between network devices
CN108512714B (en) A message transmission method, related equipment and system
US9438499B2 (en)Approximation of the physical location of devices and transitive device discovery through the sharing of neighborhood information using wireless or wired discovery mechanisms
CN107948076B (en)Method and device for forwarding message
WO2015103926A1 (en)Method, apparatus and system for disseminating routing information
US20170063699A1 (en)Method and apparatus for configuring multi-paths using segment list
EP2858313B1 (en)Method, device, and system for routing function activation and data transmission
US10812292B2 (en)Packet processing method and device
US10243783B2 (en)Method and device for processing communication path
EP3487122B1 (en)Resource allocation method, device and system
WO2021051992A1 (en)Method for nat traversal, device, and system
CN106254265A (en)Process the methods, devices and systems of message
WO2017008701A1 (en)Data transmission method, apparatus, and user device
CN104349509B (en)Mobile device and communication control method
US11870683B2 (en)3GPP network function set adaptation for pre-5G network elements
CN106797626B (en)A kind of paging message sending method and equipment
US10021589B2 (en)Wireless data system that associates internet protocol ports with quality-of-service for user applications
WO2015096734A1 (en)Downlink transmission method for service data, and packet data gateway
JPWO2008120276A1 (en) COMMUNICATION SYSTEM, COMMUNICATION METHOD IN COMMUNICATION SYSTEM, AND RELAY DEVICE
CN103701626A (en)Method and equipment for acquiring bandwidth information
KR101378313B1 (en)Method, appratus, system and computer-readable recording medium for assisting communication between terminal and local host by using openflow
JP2020010315A (en) Network topology acquisition method and apparatus
CN104363176A (en)Message control method and equipment
JP2018164298A (en)Information delivery apparatus, push notification transmission method, and computer program
CN116266904A (en)Method and device for determining application server

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20211001

CF01Termination of patent right due to non-payment of annual fee

[8]ページ先頭

©2009-2025 Movatter.jp