A method, device and network device for calculating message bytes
Through the L2TP tunnel negotiation AVP, the problem of statistical differences in bytes between LAC and LNS devices is solved, and the adaptation and statistical consistency of billing parameters are achieved, and economic losses are avoided.
Patent Information
- Application Number
- CN202211198939.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-09-29
AI Technical Summary
In the L2TP network, LAC and LNS devices are responsible by different operators, resulting in statistical differences in packet bytes, resulting in inconsistent billing, and harming the interests of operators.
By extending the L2TP tunnel negotiation AVP method, the billing parameters are negotiated between the LAC and LNS devices, adapting to the other party's byte statistics method, and corresponding billing messages are generated to reduce statistical differences.
The billing adaptation between LAC and LNS devices is realized, reducing statistical differences between packets, avoiding economic losses, and ensuring billing consistency.
Smart Images

Figure CN115941821B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, device and network equipment for calculating message bytes. Background Art
[0002] In the Layer Two Tunneling Protocol (L2TP) networking, the L2TP Access Concentrator (LAC) performs data transmission between the L2TP Network Server (L2TP Network Server, LNS) and the user terminal. The data received from the user terminal is encapsulated by L2TP and sent to the LNS, and the data received from the LNS is decapsulated and sent to the user terminal. In the process of forwarding data, the LAC needs to make some settings for the user according to the user information, such as setting bandwidth, counting traffic and billing. Similarly, in the process of sending data, the LNS also needs to make some settings for the user according to the user information.
[0003] In the existing network, LAC and LNS often belong to different operators. Therefore, the operators of LAC and LNS will count the user's traffic information separately. There is a need for reconciliation between different operators. Therefore, when reconciling accounts, it is necessary to ensure that the billing of LAC and LNS is consistent, otherwise it will damage the interests of one party.
[0004] Usually, each manufacturer counts the number of messages and bytes based on the traffic characteristics of their own equipment, and then sends the relevant statistics to the RADIUS server for billing. Since the message encapsulation received and sent by LAC and LNS is different, different manufacturers have different byte statistics for messages, so the current billing method will cause large differences in byte billing, which will in turn cause losses to one operator. Summary of the invention
[0005] Based on the above, this patent application proposes a method of extending L2TP tunnel negotiation AVP so that the LAC and LNS ends of L2TP can adapt to each other's byte statistics, thereby reducing the difference in message billing statistics at both ends and eliminating or reducing the loss of one party. The following technical solutions are specifically disclosed:
[0006] In a first aspect, an embodiment of the present invention provides a method for calculating message bytes, which can be applied to a network device, and the method includes:
[0007] The first network device and the second network device determine a negotiation result through AVP negotiation, where the negotiation result indicates whether the first network device or the second network device participates in charging adaptation in a message statistics manner;
[0008] The first network device searches the attribute value list for target message header information matching the target message header according to the negotiation result and the target message header in the AVP negotiation process, wherein the target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes;
[0009] The first network device generates a first charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0010] The first network device is a LAC device, and the second network device is a LNS device; or conversely, the first network device is a LNS device, and the second network device is a LAC device.
[0011] In addition, the target accounting parameter is the accounting parameter configured by the device consistent with the negotiation result. For example, if the negotiation result is LAC, the target accounting parameter is accounting bytes 1 configured by LAC; if the negotiation result is LNS, the target accounting parameter is accounting bytes 2 configured by LNS.
[0012] In combination with the first aspect, in a possible implementation manner of the first aspect, the first network device and the second network device determine a negotiation result through AVP negotiation, including:
[0013] The first network device receives a first response message from the second network device, wherein the first response message includes a second control parameter configured by the second network device; the first network device determines the negotiation result in the control bit negotiation list according to the locally configured first control parameter and the second control parameter, and the negotiation result matches the value of the first control parameter and the value of the second control parameter.
[0014] The control bit negotiation list includes: in the value of the first control parameter and the value of the second control parameter, at least one corresponding relationship between different parameter combinations and whether two network devices participate in billing adaptation.
[0015] In combination with the first aspect, in another possible implementation of the first aspect, the first response message also includes a second billing parameter: the first network device determines the target billing parameter based on the negotiation result, and the first billing parameter and the second billing parameter configured by the first network device.
[0016] In combination with the first aspect, in another possible implementation of the first aspect, the first network device determines the target billing parameter based on the negotiation result, and the first billing parameter and the second billing parameter configured by the first network device, including: if the negotiation result indicates that the method of message statistics is based on the first network device, then the target billing parameter is determined to be the first billing parameter; if the negotiation result indicates that the method of message statistics is based on the second network device, then the target billing parameter is determined to be the second billing parameter.
[0017] In combination with the first aspect, in another possible implementation of the first aspect, the first network device and the second network device, through the AVP negotiation process, also include: the first network device sends a first request message to the second network device, and the first request message includes the first control parameter and the first billing parameter.
[0018] In combination with the first aspect, in another implementation of the first aspect, the attribute value list includes: charging parameters 0 to n, and message header information corresponding to the n+1 charging parameters, where n is a positive integer;
[0019] The first network device searches the attribute value list for target message header information matching the target billing parameter according to the negotiation result and the target billing parameter in the AVP negotiation process, including:
[0020] If the negotiation result indicates that the method of packet statistics is based on the first network device, searching the n+1 billing parameters in the attribute value list for a billing parameter that is the same as the first billing parameter, and determining that the target packet header information is the packet header information corresponding to the same billing parameter;
[0021] If the negotiation result indicates that the method of message statistics is based on the second network device, then the n+1 billing parameters in the attribute value list are searched for the same billing parameter as the second billing parameter, and the target message header information is determined to be the message header information corresponding to the same billing parameter.
[0022] Optionally, the multiple message headers described in the target message header information include one or more of the following: VLAN, PPPoE and L2TP message headers.
[0023] In combination with the first aspect, in another possible implementation manner of the first aspect, the method further includes: the first network device sends a SCCCN message to the second network device, and the SCCCN message includes the negotiation result and the target billing parameter.
[0024] In a second aspect, an embodiment of the present invention further provides a method for calculating message bytes, the method comprising:
[0025] The second network device receives the SCCCN message sent by the first network device, wherein the SCCCN message includes a target charging parameter and a negotiation result, and the negotiation result indicates whether the first network device or the second network device participates in the charging adaptation in the message statistics method;
[0026] The second network device searches the attribute value list for target message header information matching the target message header according to the negotiation result and the target message header, wherein the target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes;
[0027] The second network device generates a second charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0028] In conjunction with the second aspect, in a possible implementation manner of the second aspect, before the second network device receives the SCCCN message sent by the first network device, the method further includes:
[0029] The second network device receives a first request message from the first network device during the AVP negotiation with the first network device, where the first request message includes a first control parameter and a first charging parameter configured by the first network device;
[0030] In response to the first request message, the second network device sends a first response message to the first network device, where the first response message includes a second control parameter and a second charging parameter configured by the second network device.
[0031] In a third aspect, an embodiment of the present invention further provides a message byte calculation device, which is applied to a first network device, and the device includes:
[0032] A negotiation unit, configured to determine a negotiation result through AVP negotiation with the second network device, wherein the negotiation result indicates whether the first network device or the second network device participates in charging adaptation in a message statistics manner;
[0033] a search unit, configured to search, according to the negotiation result and the target charging parameter in the AVP negotiation process, in the attribute value list for target message header information matching the target charging parameter, wherein the target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes;
[0034] A calculation unit is used to generate a first billing message according to multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0035] In addition, the negotiation unit, the search unit and the calculation unit are also used to implement the method steps in various possible implementations of the first aspect.
[0036] In a fourth aspect, an embodiment of the present invention further provides another message byte calculation device, which is applied to a second network device, and the device includes:
[0037] A receiving unit, configured to receive an SCCCN message sent by a first network device, wherein the SCCCN message includes a target charging parameter and a negotiation result, and the negotiation result indicates whether the first network device or the second network device participates in the charging adaptation in a message statistics manner;
[0038] a search unit, configured to search, in an attribute value list, for target message header information matching the target message header according to the negotiation result and the target message header, wherein the target message header information describes whether each message header in a plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes;
[0039] A calculation unit is used to generate a second billing message according to multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0040] In addition, the receiving unit, the searching unit and the calculating unit are also used to implement the method steps in various possible implementations of the aforementioned second aspect.
[0041] In the fifth aspect, an embodiment of the present invention also discloses a network device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for calculating message bytes as described in the first aspect or any implementation of the first aspect, or the aforementioned second aspect or any implementation of the second aspect.
[0042] In addition, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the method for calculating the message bytes as described in the first aspect or any implementation of the first aspect, or the second aspect or any implementation of the second aspect.
[0043] In the sixth aspect, an embodiment of the present invention also provides a network system, comprising at least two network devices, such as a first network device and a second network device, wherein the first network device and the second network device are connected via an L2TP tunnel, wherein the first network device is used to implement the method described in the first aspect or any implementation of the first aspect; and the second network device is used to implement the method described in the second aspect or any implementation of the second aspect.
[0044] In addition, the network system also includes other network devices, such as remote network users, terminal devices, private network and Internet network devices, etc.
[0045] The method and apparatus provided in this embodiment negotiate AVP between LAC and LNS devices, so that both devices at both ends perform billing and settlement according to the target message header information corresponding to the negotiated target billing parameters, so that the LAC and LNS of L2TP can adapt to each other's byte statistics, thereby reducing the difference in message byte statistics at both ends, avoiding the economic loss caused by the lower cost of calculation and statistics of one party. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A topological diagram of an L2TP tunnel network provided in an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of a three-way handshake process for establishing an L2TP control connection provided by an embodiment of the present invention;
[0049] Figure 3 A flowchart of a message byte billing method provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of AVP filling on an L2TP message provided by an embodiment of the present invention;
[0051] Figure 5 A signaling flow chart of a billing method based on L2TP message bytes provided in an embodiment of the present invention;
[0052] Figure 6 A flowchart of another message byte billing method provided by an embodiment of the present invention;
[0053] Figure 7 A structural block diagram of a message byte billing device provided in an embodiment of the present invention;
[0054] Figure 8 A structural block diagram of another message byte billing device provided by an embodiment of the present invention;
[0055] Fig. 9 A structural block diagram of another message byte billing device provided in an embodiment of the present invention;
[0056] Fig.10 A schematic diagram of the structure of a network device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] First, the application scenarios and related terms of the technical solution of this application are introduced.
[0059] The technical solution of the present application can be applied to a virtual private dial-up network (VPDN) constructed based on the L2TP protocol, see Figure 1 , which is a topology diagram of an L2TP tunnel network provided in an embodiment of the present application.
[0060] The Layer 2 Tunneling Protocol (L2TP) is a virtual tunneling protocol that is used to transparently transmit PPP messages between users and corporate servers. The L2TP protocol itself does not provide encryption and reliability verification functions, but can be used in conjunction with security protocols to achieve encrypted data transmission.
[0061] like Figure 1 As shown, the network topology constructed using the L2TP protocol includes: LAC, LNS, Internet network, private network (Private network), PPPoE / ISDN (Integrated Services Digital Network), remote branch (remotebranch) network remote user (Remote user), client and so on.
[0062] 1. LAC
[0063] LAC stands for L2TP Access Concentrator, which is a device attached to a switching network that has PPP end system and L2TP protocol processing capabilities. LAC is generally a network access server NAS, which is mainly used to provide access services to users through PSTN / ISDN networks.
[0064] Among them, LAC is located between LNS and remote systems (remote users and remote branches), and is used to transmit information packets between LNS and remote systems. It encapsulates the information packets received from the remote system according to the L2TP protocol and sends them to LNS, and decapsulates the information packets received from LNS and sends them to the remote system. LAC and remote systems can use local connections or PPP links. PPP links are usually used in VPDN applications. For example, PPPoE (Point-to-Point Protocol Over Ethernet) is a network tunneling protocol that encapsulates the Point-to-Point Protocol (PPP) in the Ethernet framework.
[0065] 2. LNS
[0066] LNS stands for L2TP Network Server, which is a device on the PPP end system that processes the server part of the L2TP protocol. As the other end point of the L2TP tunnel, it is the peer device of the LAC and the logical termination end point of the PPP session tunneled by the LAC.
[0067] 3. AVP
[0068] AVP (Attribute-Value Pair, data identification name), indicates the corresponding relationship between attribute information Attribute and value. Among them, the AVP format configures the following information:
[0069] M: mandatory bit. When this bit is set to "1", an unrecognized AVP will cause the corresponding session or tunnel to terminate. H: hidden flag bit. When this bit is set to "1", it indicates that the AVP value is hidden. rsvd: reserved bit. Length: AVP message length. AttributeType: attribute type definition (). AttributeValue: attribute value. The attribute type and attribute value together determine the meaning and content of the AVP.
[0070] See also Figure 2, is a schematic diagram of a three-way handshake process for establishing an L2TP control connection provided in this embodiment, wherein the messages involved in the L2TP tunnel establishment process include:
[0071] SCCRQ (Start-Control-Connection-Request): used to request the other end to establish a control connection.
[0072] SCCRP (Start-Control-Connection-Reply): used to tell the other end that the local end has received the SCCRQ message from the other end and allows the control connection to be established.
[0073] StopCCN (Stop-Control-Connection-Notification): used to notify the peer end to remove the control connection. The local end has cleared all session connections and will close the tunnel interface. StopCCN carries the reason for the control connection removal on the sender end.
[0074] SCCCN (Start-Control-Connection-Connected): used to tell the other end that the local end has received the SCCRP message from the other end and has completed the tunnel establishment.
[0075] Hello: used to detect the connectivity of the tunnel.
[0076] ZLB (Zero-Length Body): If there is no message to be sent in the queue of the local end, ZLB is sent to the other end. During the process of dismantling the session connection and control connection, sending ZLB also indicates that StopCCN or CDN has been received. ZLB only has the L2TP header and no payload.
[0077] The control connection is established before the session connection. Only after the control connection is established can the session connection be established. The process of establishing the control connection of L2TP is as follows: Figure 2 shown.
[0078] After the routes between LAC and LNS are reachable to each other, LAC sets the corresponding AVP and sends a SCCRQ message to LNS to request the establishment of a control connection. LNS receives the SCCRQ from LAC. Based on the AVP, if it agrees to establish a tunnel, it sends a SCCRP message to LAC. LAC checks the received SCCRP message, extracts the tunnel information from it, and sends a SCCCN message to LNS, indicating that the control connection is successfully established. When there is no message in the message queue, LNS sends ZLB to the other end.
[0079] Since the message encapsulation received and sent by LAC and LNS is different, and different manufacturers have different byte statistics for messages, currently each manufacturer counts the number of messages and bytes based on the traffic characteristics of their own equipment, and then sends the relevant statistics to the Radius accounting server for billing. This billing method will cause a large difference in the byte billing of messages on both ends of the equipment. Furthermore, the reason for the difference is that when the devices at both ends calculate the message header, there is a difference in whether the size of the message header is involved in the fee calculation. Specifically, when LAC receives the message sent by the user, the message is encapsulated with VLAN and PPPoE headers, and then the message sent to LNS is stripped of VLAN and PPPoE and encapsulated with L2TP header and other related information. When the LNS receives the message sent by LAC, it is encapsulated with L2TP header and other related information, and then the L2TP header and other information are stripped when sending it to the server.
[0080] The method provided in this embodiment is described in detail below.
[0081] The present application embodiment provides a method for calculating message bytes, which can be applied to a network device, such as a LAC or a LNS. Figure 3 As shown, the method includes:
[0082] Step 101: A first network device and a second network device determine a negotiation result through AVP negotiation.
[0083] The negotiation result indicates whether the first network device or the second network device participates in charging adaptation in the message statistics method, or in other words, the negotiation result is used to indicate whether the message statistics method is based on the first network device or the second network device.
[0084] In this step, the first network device and the second network device send L2TP messages to each other, such as LAC sends SCCRQ message to LNS, and after receiving, LNS feeds back SCCRP message to LAC, and negotiates to determine which device is used as the basis for message statistics. AVP content is added to the L2TP messages sent and received, and the negotiation result is indicated and determined by adding configuration information to the AVP content.
[0085] Specifically, see Figure 4, control parameters and accounting parameters are set in the added AVP, which can be indicated by the Control value field and the accounting bytes field respectively. Among them, the Control value field is used to indicate whether the local device is used for accounting message statistics; the accounting bytes field is used to indicate which message headers need to be counted and which message headers do not need to be counted when billing under the billing method based on the local device. For example, if the Control value field is "0", it means that the local device is used and can be configured by the device; if the Control value field is "1", it means that the other party (opposite device) is used and can be configured by the device.
[0086] The message header includes but is not limited to: Virtual Local Area Network (VLAN), PPPoE and L2TP message headers.
[0087] Step 102: The first network device searches the attribute value list for target message header information matching the target billing parameter according to the negotiation result and the target billing parameter in the AVP negotiation process.
[0088] The target billing parameter is consistent with the network device indicated by the negotiation result. If the negotiation result indicates the first network device, the target billing parameter is the first billing parameter configured by the first network device. Conversely, if the negotiation result indicates the second network device, the target billing parameter is the second billing parameter configured by the second network device.
[0089] The target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes, and the size of the occupied bytes. For example, if the target accounting parameter is determined to be the first accounting parameter, and the value of the first accounting parameter accounting bytes is "2", then the message header information corresponding to the value "2" is the target message header information, and the target message header information describes the following content: PPPoE message header statistics bytes, VLAN and L2TP message headers do not count accounting bytes.
[0090] Optionally, the value range of the accounting parameter "accounting bytes" is 0 to 7, including the end value. And the numerical description corresponding to each value, that is, the message header information can be pre-configured and displayed through the accounting bytes attribute value list. As shown in Table 1,
[0091] Table 1, accounting bytes attribute value list
[0092]
[0093]
[0094] Table 1 contains the values of the Control value and the description of each value, as well as the different values of the accounting bytes and the numerical descriptions corresponding to each value, that is, the message header information.
[0095] It should be understood that more message headers and corresponding relationships with different accounting bytes field values may be configured, and this embodiment does not limit this.
[0096] Step 103: The first network device generates a first billing message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0097] The byte size of each message can be pre-configured. One configuration method is shown in Table 2.
[0098] Table 2, Byte size relationship table
[0099]
[0100] It should be noted that in the process of generating the first billing message, in addition to the byte size occupied by the above-mentioned message headers, the size of other fields such as the payload is also included. Table 2 only shows the byte size of each message header, and does not show the size of other fields such as the payload.
[0101] The first network device calculates the size of the message to be reported according to the encapsulation format of each message header and the byte bit size of each message header shown in Table 2. Similarly, the second network device at the other end can also determine which message headers are stripped when reporting and the size of the stripped message headers according to the byte size in Table 2, and then calculate and generate the second billing message.
[0102] For example, taking a user of L2TP accessed by double VLAN as an example, assume that the message statistics method is based on the first network device, such as the LAC end, and the value of the downstream accounting bytes configured by the LAC is 3. According to Table 1, according to the traffic statistics in the direction from the LAC to the second network device LNS, the target message header information corresponding to the target billing parameter "3" is: statistics on VLAN and PPPoE message headers, and no statistics on L2TP message headers.
[0103] According to the byte sizes in Table 1, when a 128-byte L2TP message from a remote user device enters the LAC, accounting is performed according to the rule of accounting bytes 3. The L2TP message header encapsulated on the LAC device side is not included in the accounting statistics. However, the VLAN and PPPoE message headers are encapsulated by the client, and the upstream statistics are 128 bytes.
[0104] When the LAC sends the encapsulated message to the LNS device, the VLAN header and PPPoE header are stripped from the original encapsulated message, and then the L2TP message header is encapsulated. At this time, the message size becomes: 128-4×2-8+38=150 bytes. The message received by the LNS device has 22 more bytes than the message entering the LAC device. At this time, the LNS device needs to subtract these 22 bytes when counting the upstream bytes to adapt to the 128 bytes received by the LAC.
[0105] Conversely, if the message statistics method is based on the second network device LNS, it is necessary to add 22 bytes when counting the uplink bytes of the LAC device to adapt the LNS to the 150 bytes on the LAC device side, so that the message byte size of the devices at both ends is the same, thereby reducing the difference in message statistics between the LAC and LNS sides.
[0106] The method provided in this embodiment negotiates AVP between LAC and LNS devices, so that both devices at both ends perform billing and settlement according to the target message header information corresponding to the negotiated target billing parameters, so that LAC and LNS of L2TP can adapt to each other's byte statistics, thereby reducing the difference in message byte statistics at both ends, avoiding the economic loss caused by the lower cost of calculation and statistics of one party.
[0107] Optionally, in a possible implementation of this embodiment, the above step 102: determining the negotiation result through AVP negotiation specifically includes:
[0108] The first network device sends a first request message to the second network device, wherein the first request message includes the first control parameter and the first charging parameter. Specifically, during the three-way handshake process of the L2TP control connection, Figure 5 As shown, AVP negotiation includes:
[0109] Step 201: LAC sends SCCRQ to LNS.
[0110] The SCCRQ is a first request message, and the SCCRQ message includes: accounting bytes 1 and Control value 1 fields, wherein Control value 1 is a first control parameter, accounting bytes 1 is a first accounting parameter, and both parameters can be configured through AVP attributes, such as a first AVP identifier.
[0111] A specific configuration method is to configure in the L2TP message: M: mandatory bit, this position is set to "0", indicating that the AVP content is recognized. H: hidden flag bit, this position is set to "1", indicating that the AVP value is not hidden and displayed. The AVP message length Length is 8, and the Vendor ID is configured as reserved. In addition, control parameter and billing parameter fields are added. For example, in the attribute type definition AttributeType (Attribute type is): the first billing parameter "accountingbytes" can occupy 2 bits (bytes), that is, the attribute value (AttributeValue) corresponding to the billing parameter field is 2.
[0112] In addition, the first control parameter "Control value" is configured to correspond to any bit in 0-7, which is used to set the control parameters. For example, it includes Up accounting bytes and Down accounting bytes. Up refers to the traffic statistics from LAC to LNS, and Down refers to the traffic statistics from LNS to LAC. It contains 8 bits in total, and Up and Down each occupy 4 bits. For example, Upaccounting bytes occupy bits 8-11; Down accounting bytes occupy bits 12-15.
[0113] Step 202: The LNS feeds back an SCCRP to the LAC. The SCCRP is a first response message.
[0114] Correspondingly, the first network device LAC receives a first response message SCCRP sent from the second network device LNS, where the SCCRP message includes a second control parameter (Control value 2) and a second accounting parameter (accounting bytes 2) configured by the second network device.
[0115] Specifically, the LNS can configure the value of Control value 2 and the value of accounting bytes2 by itself through the second AVP identifier.
[0116] After receiving the SCCRP message sent from the LNS, the LAC determines the negotiation result in the control bit negotiation list according to the first control parameter (Control value 1) configured locally and the second control parameter (Control value 2) carried in the SCCRP message, which is the same as the aforementioned step 101.
[0117] The control bit negotiation list includes: among the values of the first control parameter and the second control parameter, at least one corresponding relationship between different parameter combinations and whether the two network devices participate in the billing adaptation. In addition, the control bit negotiation list can be pre-configured, as shown in Table 3.
[0118] Table 3, accounting bytes control bit negotiation list
[0119]
[0120] For the LAC device, the sent message may be a SCCRQ message, and the received message may be a SCCRP message; conversely, for the LNS device, the sent message may be a SCCRP message, and the received message may be a SCCRQ message.
[0121] In this embodiment, taking the LAC device as an example, assume that the value of Control value 1 configured locally on the LAC device is 0, and the value of accounting bytes 1 is 2, that is, the first AVP identifier carried in the SCCRQ message, and the content is configured as "0+2". The value of Control value 2 configured on the LNS device is 1, and the value of accounting bytes 2 is 5, that is, the second AVP identifier carried in the SCCRP message, and the content is configured as "1+5".
[0122] Step 203: The LAC device searches and determines the target message header information, and calculates and generates a first billing message.
[0123] Specifically, the LAC device determines the negotiation result in the control bit negotiation list in Table 3 according to the value of Control value 1 and the value of Control value 2.
[0124] In this example, Control value 1=0 in the sent message configured by the LAC device, and Control value 2=1 in the received message, that is, the value combination of the control parameters is (0,1). The negotiation result corresponding to the value combination is found to be the LAC device through the relationship in Table 3 above, that is, the message statistics method based on the LAC device is adopted; if the value combination of the first control parameter Control value 1 and the second control parameter Control value 2 is configured to be (0,0) or (1,0), the corresponding negotiation result is determined to be the LNS device through table lookup, that is, the message statistics method based on the LNS device is adopted.
[0125] In addition, if the value combination relationship of two control parameters Control value is (1,1), then they are based on their respective local devices and no adaptation calculation is required.
[0126] Then, the LAC device determines a target charging parameter according to the negotiation result, the first charging parameter configured by the LAC device, and the second charging parameter configured by the LNS device.
[0127] A specific implementation method is that if the negotiation result indicates that the method of message statistics is based on the first network device, the target billing parameter is determined to be the first billing parameter; if the negotiation result indicates that the method of message statistics is based on the second network device, the target billing parameter is determined to be the second billing parameter.
[0128] For example, based on the correspondence in Table 3, if the negotiation result is based on the LAC device, the value of accounting bytes 1 configured on the LAC device is taken; if the negotiation result is based on the LNS device, the value of accounting bytes 2 configured on the LNS device is taken. In this example, assuming that the LAC device is taken, the value of accounting bytes 1 is 2, and the value "2" is the target billing parameter.
[0129] Based on the target billing parameter "2", matching target message header information is searched in the accounting bytes attribute value list shown in Table 1, wherein the attribute value list includes: billing parameters 0 to n, and message header information corresponding to the n billing parameters; n is a positive integer, optional, n=7, that is, the value range of the billing parameter is 0 to 7.
[0130] A search principle is: if the negotiation result indicates that the message statistics method is based on the first network device, then searching the n+1 billing parameters in the attribute value list for a billing parameter that is the same as the first billing parameter, and determining that the target message header information is the message header information corresponding to the same billing parameter;
[0131] If the negotiation result indicates that the method of message statistics is based on the second network device, then the n+1 billing parameters in the attribute value list are searched for the same billing parameter as the second billing parameter, and the target message header information is determined to be the message header information corresponding to the same billing parameter.
[0132] In this example, the LAC device is used as the basis, and the accounting parameter with the value of accounting bytes being 2 is searched in the attribute value list. The numerical description corresponding to the accounting parameter "2" is the target message header information, and the target message header is "PPPoE statistical bytes, VLAN, L2TP non-statistical bytes".
[0133] Finally, the number of bytes occupied by the current message is calculated using the byte size relationship table shown in Table 2 to obtain the first charging message. For the specific process, refer to the description of steps 101 to 103 of the above embodiment, which will not be described in detail in this embodiment.
[0134] See also Figure 5 , the method further comprises:
[0135] Step 204: The LAC device sends a SCCCN message to the LNS device.
[0136] The SCCCN message includes the negotiation result and the target billing parameter. For example, in this embodiment, the SCCCN message includes the negotiation result of "based on the LAC device" and the billing parameter information that the value of accounting bytes 1 is 2.
[0137] Step 205: The LNS device receives the SCCCN message sent by the LAC device, searches the attribute value list for target message header information matching the target billing parameters according to the negotiation result and target billing parameters carried in the SCCCN message, and generates a second billing message according to the byte size calculation shown in Table 2.
[0138] For the specific process, please refer to the above step 203 or the above Figure 3 The method flow shown in this embodiment will not be repeated here.
[0139] In addition, the method further includes: Step 206: When the LNS device detects that there is no message in the message queue, the LNS device sends a ZLB message to the LAC device. The LNS device sends the ZLB message to indicate that StopCCN or CDN (Call-Disconnect-Notify) has been received.
[0140] It should be noted that the LNS device can perform step 205 after receiving the SCCRP message in step 202. And both the LAC device and the LNS device can perform the method flow of searching, determining the target message header information, and calculating and generating the billing message after configuring the first AVP identifier locally and receiving the second AVP identifier sent by the opposite device.
[0141] In addition, based on the above Figure 3 In the embodiment shown, the method for calculating the message bytes is as follows: Figure 6 As shown, it also includes:
[0142] Step 104: The second network device receives the SCCCN message sent by the first network device, where the SCCCN message includes target charging parameters and negotiation results.
[0143] The second network device may be an LNS device, the first network device may be an LAC device, the negotiation result indicates whether the first network device or the second network device participates in the billing adaptation in the message statistics method, and the target billing parameter is consistent with the network device indicated by the negotiation result. For example, in the above embodiment, it is determined that the message negotiation result is based on the LAC device, then the SCCCN message includes the negotiation result of "based on the LAC device" and the target billing parameter of accountingbytes 1 configured by the LAC device.
[0144] Step 105: The second network device searches the attribute value list for target message header information that matches the target billing parameter according to the negotiation result and the target billing parameter.
[0145] The target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes, and the size of the occupied bytes. The attribute value list may be the list shown in 1 above.
[0146] Step 106: The second network device generates a second charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each message header.
[0147] Specifically, the process is the same as steps 102 and 103 of the aforementioned embodiment, and will not be repeated here in this embodiment.
[0148] In addition, before step 104, it also includes: the second network device receives a first request message from the first network device during the AVP negotiation with the first network device, wherein the first request message includes a first control parameter and a first billing parameter configured by the first network device; the same as the aforementioned step 201.
[0149] In response to the first request message, the second network device sends a first response message to the first network device, where the first response message includes a second control parameter and a second charging parameter configured by the second network device; this is the same as the aforementioned step 202.
[0150] The specific process can be found in the description of the aforementioned steps 201 and 202, which will not be repeated here in this embodiment.
[0151] In this embodiment, the second network device LNS uses the AVP content negotiated with the first network device LAC so that the devices at both ends of the LNS and LAC can adapt to each other's unified byte calculation method, thereby reducing the difference in message statistics of the devices at both ends when calculating and generating billing messages.
[0152] The embodiment of the present invention further provides a message byte calculation device, which can be applied to the first network device or the second network device of the above embodiment. In this embodiment, the device is the first network device, such as a LAC device. Figure 7 As shown, the message byte calculation device includes: a negotiation unit 701, a search unit 702 and a calculation unit 703. In addition, the device may also include other units and modules, such as a storage unit.
[0153] The negotiation unit 701 is configured to determine a negotiation result through AVP negotiation with the second network device, wherein the negotiation result indicates whether the first network device or the second network device participates in charging adaptation in a message statistics manner.
[0154] The search unit 702 is used to search for target message header information that matches the target billing parameter in the attribute value list according to the negotiation result and the target billing parameter in the AVP negotiation process, wherein the target message header information describes whether each message header in multiple message headers participates in the statistical calculation of message bytes and the size of the occupied bytes.
[0155] The calculation unit 703 is used to generate a first charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0156] Furthermore, if Figure 8 As shown, the negotiation unit 701 may include: a receiving unit 7011, a determining unit 7012 and a sending unit 7013. The receiving unit 7011 is used to receive a first response message from the second network device, wherein the first response message includes a second control parameter configured by the second network device.
[0157] The determination unit 7012 is used to determine the negotiation result in the control bit negotiation list according to the locally configured first control parameter and the second control parameter, and the negotiation result matches the value of the first control parameter and the value of the second control parameter.
[0158] The control bit negotiation list includes: among the values of the first control parameter and the second control parameter, at least one corresponding relationship between different parameter combinations and whether the two network devices participate in billing adaptation. For example, if the first control parameter is 0 or 1 and the second control parameter is 0 or 1, then the different parameter combinations include: (0,0), (0,1), (1,0) and (1,1).
[0159] Optionally, in a specific implementation of this embodiment, the first response message also includes a second billing parameter: a determination unit 7012 is specifically used to determine the target billing parameter based on the negotiation result, and the first billing parameter and the second billing parameter configured by the first network device.
[0160] Optionally, in another specific implementation of the present embodiment, the determination unit 7012 is further specifically used to determine that the target billing parameter is the first billing parameter if the negotiation result indicates that the method for counting message statistics is based on the first network device; if the negotiation result indicates that the method for counting message statistics is based on the second network device, then determine that the target billing parameter is the second billing parameter.
[0161] Optionally, in another specific implementation of this embodiment, in the above-mentioned negotiation unit 701, the sending unit 7013 is used to send a first request message to the second network device, and the first request message includes the first control parameter and the first billing parameter.
[0162] Optionally, the attribute value list includes: billing parameters 0 to n, and message header information corresponding to the n+1 billing parameters, where n is a positive integer;
[0163] The search unit 702 is specifically used to search for a billing parameter that is the same as the first billing parameter in the n+1 billing parameters in the attribute value list if the negotiation result indicates that the message statistics method is based on the first network device, and determine that the target message header information is the message header information corresponding to the same billing parameter.
[0164] If the negotiation result indicates that the method of message statistics is based on the second network device, then the n+1 billing parameters in the attribute value list are searched for the same billing parameter as the second billing parameter, and the target message header information is determined to be the message header information corresponding to the same billing parameter.
[0165] The multiple message headers described in the target message header information include one or more of the following: VLAN, PPPoE and L2TP message headers.
[0166] In addition, the sending unit 7013 is further used to send a SCCCN message to the second network device, and the SCCCN message includes the negotiation result and the target billing parameter.
[0167] In addition, this embodiment also provides another message byte calculation device, see Fig. 9 As shown, the device can be the first network device in the aforementioned embodiment, or it can also be the second network device, wherein, taking the second network device as an example, the message byte calculation device includes: a receiving unit 801, a search unit 802 and a calculation unit 803. In addition, the device can also include other more or fewer units / modules, such as a storage unit, a sending unit, etc.
[0168] Among them, the receiving unit 801 is used to receive the SCCCN message sent by the first network device, the SCCCN message includes target billing parameters and negotiation results, and the negotiation result indicates whether the first network device or the second network device participates in billing adaptation in the message statistics method.
[0169] The search unit 802 is used to search for target message header information that matches the target billing parameters in the attribute value list according to the negotiation result and the target billing parameters, and the target message header information describes whether each message header in multiple message headers participates in the statistical calculation of message bytes and the size of the occupied bytes.
[0170] The calculation unit 803 is used to generate a second charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
[0171] In addition, before the receiving unit 801 receives the SCCCN message sent by the first network device, the receiving unit 801 is also used to receive a first request message from the first network device during the AVP negotiation process with the first network device, and the first request message includes a first control parameter and a first billing parameter configured by the first network device.
[0172] a sending unit, configured to send a first response message to the first network device in response to the first request message, wherein the first response message includes a second control parameter and a second charging parameter configured by the second network device. Fig. 9 Not shown in FIG.
[0173] Optionally, the receiving unit 801, searching unit 802 and calculating unit 803 are also used to implement other method steps of the second network device, which are not described one by one in this embodiment.
[0174] At the hardware implementation level, the embodiment of the present invention also provides a network device, such as Fig.10 As shown, the network device may include a processor 110 and a memory 120, wherein the processor 110 and the memory 120 may be connected via a bus or other means. Fig.10 In the example, the bus connection is used. In addition, the network device further includes at least one interface 130, which may be a communication interface or other interface, such as an L2TP interface, which is not limited in this embodiment.
[0175] The processor 110 may be a central processing unit (CPU). The processor 110 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0176] The memory 120, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method for calculating message bytes in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 120, that is, implements the method for calculating message bytes in the above method embodiment.
[0177] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required by at least one function; the data storage area may store data, tables, rules, correspondences, etc. created by the processor 110. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the processor 110 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a private network, a VLAN network, and combinations thereof.
[0178] In addition, at least one interface 130 is used for communication between the network device and external devices, such as communication with a server, a terminal device, etc. Optionally, at least one interface 130 can also be used to connect external input and output devices, such as a keyboard, a display screen, etc.
[0179] The one or more modules are stored in the memory 120 and when executed by the processor 110, perform the following steps: Figure 3 , Figure 5 and Figure 6 The method for calculating the message bytes in the illustrated embodiment.
[0180] Optionally, the above network device may be a LAC device or a LNS device, or may be other network devices, such as a server, a remote user device, a switch, etc.
[0181] This embodiment also provides an L2TP network system, which can be as described above. Figure 1 The system includes at least two network devices, including a LAC device and a LNS device, as well as other end devices, such as a remote user of the network, a Radius accounting server, and the like.
[0182] Specifically, the structure of the network device can be Fig.10 The structures shown are the same and are used to implement the method for calculating the message bytes described in the above implementation.
[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0184] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for calculating message bytes, characterized in that: The method comprises: The first network device and the second network device determine a negotiation result through AVP negotiation, wherein the negotiation result indicates that the method of packet statistics is based on the first network device or the second network device; The first network device searches the attribute value list for target message header information matching the target message header according to the negotiation result and the target message header in the AVP negotiation process, wherein the target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes; The first network device generates a first charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
2. The method according to claim 1, characterized in that The first network device and the second network device determine a negotiation result through AVP negotiation, including: The first network device receives a first response message from the second network device, where the first response message includes a second control parameter configured by the second network device; The first network device determines the negotiation result in the control bit negotiation list according to the locally configured first control parameter and the second control parameter, and the negotiation result matches the value of the first control parameter and the value of the second control parameter; The control bit negotiation list includes: in the value of the first control parameter and the value of the second control parameter, at least one corresponding relationship between different parameter combinations and whether two network devices participate in billing adaptation.
3. The method according to claim 2, characterized in that The first response message also includes a second charging parameter: The first network device determines the target charging parameter according to the negotiation result, and the first charging parameter and the second charging parameter configured by the first network device.
4. The method according to claim 3, characterized in that The first network device determines the target charging parameter according to the negotiation result and the first charging parameter and the second charging parameter configured by the first network device, including: If the negotiation result indicates that the message statistics are performed in a manner based on the first network device, determining that the target billing parameter is the first billing parameter; If the negotiation result indicates that the message statistics are performed in a manner based on the second network device, the target charging parameter is determined to be the second charging parameter.
5. The method according to claim 4, characterized in that The first network device and the second network device negotiate through the AVP, further comprising: The first network device sends a first request message to the second network device, where the first request message includes the first control parameter and the first charging parameter.
6. The method according to claim 4, characterized in that The attribute value list includes: charging parameters 0 to n, and message header information corresponding to n+1 charging parameters, where n is a positive integer; The first network device searches the attribute value list for target message header information matching the target billing parameter according to the negotiation result and the target billing parameter in the AVP negotiation process, including: If the negotiation result indicates that the method of packet statistics is based on the first network device, searching the n+1 billing parameters in the attribute value list for a billing parameter that is the same as the first billing parameter, and determining that the target packet header information is the packet header information corresponding to the same billing parameter; If the negotiation result indicates that the method of message statistics is based on the second network device, then the n+1 billing parameters in the attribute value list are searched for the same billing parameter as the second billing parameter, and the target message header information is determined to be the message header information corresponding to the same billing parameter.
7. The method according to any one of claims 1 to 6, characterized in that: The multiple message headers described in the target message header information include one or more of the following: Virtual Local Area Network (VLAN), Ethernet Point-to-Point Communication Protocol (PPPoE), and Layer 2 Tunneling Protocol (L2TP) message headers.
8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The first network device sends a SCCCN message to the second network device, where the SCCCN message includes the negotiation result and the target billing parameter.
9. A method for calculating message bytes, characterized in that: The method comprises: The second network device receives the SCCCN message sent by the first network device, wherein the SCCCN message includes a target charging parameter and a negotiation result, and the negotiation result indicates whether the message statistics are based on the first network device or the second network device; The second network device searches the attribute value list for target message header information matching the target message header according to the negotiation result and the target message header, wherein the target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes; The second network device generates a second charging message according to the multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
10. The method according to claim 9, characterized in that Before the second network device receives the SCCCN message sent by the first network device, the method further includes: The second network device receives a first request message from the first network device during the AVP negotiation with the first network device, where the first request message includes a first control parameter and a first charging parameter configured by the first network device; In response to the first request message, the second network device sends a first response message to the first network device, where the first response message includes a second control parameter and a second charging parameter configured by the second network device.
11. A device for calculating message bytes, characterized in that: Applied to a first network device, the apparatus comprises: A negotiation unit, configured to determine a negotiation result through AVP negotiation with the second network device, wherein the negotiation result indicates that the method of packet statistics is based on the first network device or the second network device; a search unit, configured to search, according to the negotiation result and the target charging parameter in the AVP negotiation process, in the attribute value list for target message header information matching the target charging parameter, wherein the target message header information describes whether each message header in the plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes; A calculation unit is used to generate a first billing message according to multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
12. A message byte calculation device, characterized in that: Applied to a second network device, the apparatus comprises: A receiving unit, configured to receive an SCCCN message sent by a first network device, wherein the SCCCN message includes a target charging parameter and a negotiation result, and the negotiation result indicates whether a method of message statistics is based on the first network device or the second network device; a search unit, configured to search, in an attribute value list, for target message header information matching the target message header according to the negotiation result and the target message header, wherein the target message header information describes whether each message header in a plurality of message headers participates in the statistical calculation of message bytes and the size of the occupied bytes; A calculation unit is used to generate a second billing message according to multiple message headers indicated by the target message header information and the byte size occupied by each of the message headers.
13. A network device, characterized in that: comprising a processor and a memory, the memory being coupled to the processor; The memory stores computer-readable program instructions, and when the instructions are executed by the processor, the method for calculating the message bytes according to any one of claims 1 to 8 and 9 to 10 is implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for calculating the message bytes according to any one of claims 1 to 8 and 9 to 10 is implemented.
