A method, device and medium for charging based on MAC address
By using a MAC address-based billing system, the problem of the inability to separate authentication and billing in existing technologies is solved. It provides diversified billing schemes, supports dumb terminal billing, reduces server load, and improves network quality and processing efficiency.
Patent Information
- Application Number
- CN202310308761.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-03-23
AI Technical Summary
Existing MAC authentication and billing methods require the same protocol as the authentication function, which cannot meet the need for separation of authentication and billing, and cannot support authentication and billing for dumb terminals, increasing maintenance costs and server burden.
A MAC address-based billing system is provided, including an address detection module, an authentication module, and a billing module. Through filtering, encapsulation, and diversified billing scheme processing, it supports remote and local billing methods, enhancing the flexibility and reliability of billing.
It separates authentication and billing, supports billing for dumb terminals, reduces server maintenance costs, improves network quality and processing efficiency, and adapts to complex application scenarios.
Smart Images

Figure CN116366384B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a MAC address-based charging method, device and medium. BACKGROUND
[0002] AAA is an abbreviation of Authentication, Authorization and Accounting, and is a security management mechanism for access control in network security. When providing corresponding services for clients, authentication, authorization and accounting need to be performed in sequence. The three mechanisms can be performed in different ways, flexibly adapting to various application scenarios while increasing system security. MAC authentication refers to terminal network access control equipment that automatically obtains the MAC address of a terminal as a credential for accessing a network and sends it to a RADIUS server for verification. MAC authentication is an authentication method for controlling the network access rights of users based on interfaces and MAC addresses. It does not require users to install any client software. MAC address charging is usually performed after authentication, and the same protocol and server as authentication are used to send charging information to the server at regular intervals to facilitate the statistics of user online duration. MAC bypass authentication (MAB) is similar to MAC address authentication. MAB first sends an 802.1x authentication request to the detected MAC address in unicast. When the MAC address does not reply the authentication identity message after a certain time and a certain number of authentication requests, MAB will use the MAC address for authentication.
[0003] Traditional MAC authentication can identify dumb terminals in the environment. However, the charging function after authentication needs to use the same protocol as the authentication function for charging, and the charging process needs to be performed on the authentication server, which requires long-term maintenance of user table entries on the server, increasing maintenance costs. The charging support in the AAA management mechanism separates authentication and charging, and different methods and servers can be used for authentication and charging. However, AAA charging needs to go through authentication and authorization first, and the authentication process requires entering a username and password. For dumb terminals that do not support actively initiating authentication requests and sending authentication account and password information, the AAA management mechanism cannot support authentication and charging using the MAC address of the dumb terminal. MAB and MAC authentication are the same, and the 1x authentication flow needs to be performed first. The MAC address authentication process and the corresponding charging process need to use the same remote server as 802.1x, and also need to use the same protocol, which cannot meet the needs of separating authentication and charging in some application scenarios. SUMMARY
[0004] To solve the above problems, the application provides a MAC address-based charging method applied to a MAC address-based charging system, the charging system comprising an address detection module, an authentication module and a charging module; the method comprising: the address detection module receiving information of the MAC terminal and screening the information according to a preset format to obtain authentication information and sending the authentication information to the authentication module; the authentication module encapsulating the authentication information to obtain an authentication message and sending the authentication message to the charging module; and the charging module determining a charging scheme for the MAC terminal according to a preset charging list and charging the authentication message according to the charging scheme to obtain a charging result.
[0005] In one example, before the information is screened according to the preset format, the method further comprises: the address detection module obtaining an authentication state of the MAC terminal and judging the authentication state; if the authentication state of the MAC terminal is authenticated, the address detection module receives the information; if the authentication state of the MAC terminal is not authenticated, the address detection module does not receive the information.
[0006] In one example, the format comprises but is not limited to broadcast, groupcast, unicast and multicast; the address detection module screens the information according to the preset format, specifically comprising: deleting broadcast format information and groupcast format information in the information to obtain the authentication information.
[0007] In one example, the authentication module encapsulates the authentication information, specifically comprising: the authentication module encapsulating the authentication information into a TLV field of a Radius message to obtain the authentication message.
[0008] In one example, the charging scheme comprises but is not limited to RADIUS remote charging, TACACS remote charging, local charging and no charging; a plurality of charging schemes are arranged in a chain in the charging list; the charging module determines a charging scheme for the MAC terminal according to the preset charging list, specifically comprising: charging the MAC terminal according to an arrangement order of the charging schemes in the charging list.
[0009] In one example, the method further comprises: determining a charging scheme for the MAC terminal; if the charging scheme is remote charging, the charging module sends the authentication message to a remote charging server; if the charging scheme is local charging, the charging module charges the MAC terminal according to a local database.
[0010] In one example, after the charging module sends the authentication message to the remote charging server, the method further comprises: determining whether the remote charging server generates a charging result; if the remote charging server generates a charging result, the remote charging server sends the charging result to the charging module; if the remote charging server does not generate a charging result, the remote charging server sends a charging failure message to the charging module, and the charging module selects a next charging scheme according to the chain arrangement.
[0011] In one example, the charging system further comprises a command line module; the method further comprises: the command line module receives a parameter package set by a user, and sends the parameter package to other modules of the charging system, wherein the parameter package includes but is not limited to an authentication scheme of the authentication module and interactive configuration information of the charging module.
[0012] In another aspect, the application further provides a MAC address-based charging device applied in a MAC address-based charging system, wherein the charging system comprises an address detection module, an authentication module and a charging module; the device comprises: at least one processor; and a memory in communication connection with 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 MAC address-based charging device to perform: the address detection module receives information of the MAC terminal, and filters the information according to a pre-set format to obtain authentication information, and sends the authentication information to the authentication module; the authentication module encapsulates the authentication information to obtain an authentication message, and sends the authentication message to the charging module; and the charging module determines a charging scheme for the MAC terminal according to a pre-set charging list, and charges the authentication message according to the charging scheme to obtain a charging result.
[0013] In another aspect, the application further provides a non-volatile computer storage medium storing computer executable instructions applied in a MAC address-based charging system, wherein the charging system comprises an address detection module, an authentication module and a charging module; the computer executable instructions are set to: the address detection module receives information of the MAC terminal, and filters the information according to a pre-set format to obtain authentication information, and sends the authentication information to the authentication module; the authentication module encapsulates the authentication information to obtain an authentication message, and sends the authentication message to the charging module; and the charging module determines a charging scheme for the MAC terminal according to a pre-set charging list, and charges the authentication message according to the charging scheme to obtain a charging result.
[0014] The application provides a list of alternative charging schemes for dumb terminals, and charges according to the order of the list, thereby supporting multiple charging methods including remote and local charging. The application preserves the existing MAC address authentication technology, and adds diversity to the charging methods, thereby expanding the existing charging technology. BRIEF DESCRIPTION OF DRAWINGS
[0015] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application, and do not limit the application. In the drawings:
[0016] Figure 1 A flowchart of a MAC address-based charging method in an embodiment of the application;
[0017] Figure 2 A structure diagram of a MAC address-based charging system in an embodiment of the application;
[0018] Figure 3 A diagram of a MAC address-based charging device in an embodiment of the application. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions and advantages of the application clearer, the technical solutions of the application will be described below in detail with reference to the embodiments of the application and the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.
[0020] The technical solutions provided by the embodiments of the application will be described in detail below with reference to the accompanying drawings.
[0021] Currently, some charging functions and authentication functions use the same server, which not only affects the network quality of the physical link between the switch and the server, but also reduces the processing efficiency of the server, increases the running overhead of the server, and increases the burden of the server. The switch lacks a convenient means for charging, and when the remote charging server fails, the charging will be interrupted, affecting the business. Some charging functions need to be authenticated, and authentication requires a username and password. The dumb terminal lacks a means to input the username and password, and lacks a scheme that can provide charging for the dumb terminal. The charging function has a single charging method, which is usually a fixed method, and lacks a backup method to cope with more complex and flexible application scenarios.
[0022] As Figure 1As shown, in order to solve the above problems, the application provides a MAC address-based charging method, which is applied to a MAC address-based charging system, as shown in the figure Figure 2 As shown, the charging system includes an address detection module, an authentication module, a charging module, and a command line module. The method includes the following steps:
[0023] S101, the address detection module receives the information of the MAC terminal, and filters the information according to a pre-set format to obtain authentication information, and sends the authentication information to the authentication module.
[0024] The address detection module controls the entering flow according to the MAC terminal port flow authentication state. When no authentication is performed under the port, the flow accessed through the terminal port is controlled, and after authentication, the flow of the MAC terminal is released, so as to realize the control of the port direction flow. When a dumb terminal or a terminal that needs to be authenticated accesses the equipment, the module will obtain the authentication information of all terminals under the interface in the form of active detection plus passive reception, and report the terminal MAC address except broadcast and multicast to the authentication module.
[0025] In one embodiment, before filtering the information according to the pre-set format, the address detection module obtains the authentication state of the MAC terminal and judges the authentication state. If the authentication state of the MAC terminal is authenticated, the address detection module receives the information; if the authentication state of the MAC terminal is not authenticated, the address detection module does not receive the information.
[0026] In one embodiment, the format of the authentication information includes broadcast, multicast, unicast, multicast, etc. The broadcast format information and the multicast format information in the information are deleted to obtain the authentication information.
[0027] S102, the authentication module encapsulates the authentication information to obtain an authentication message, and sends the authentication message to the charging module.
[0028] In one embodiment, the authentication module encapsulates the authentication information of the MAC terminal into the TLV field of the Radius message, and encapsulates other information such as interface MAC address, IP address, etc. into the TLV field, and finally forms a completed authentication message. Analyze the MAC address information received from the upstream module, store the authentication results of each MAC address through the software table item, and the module can also use multiple authentication methods to realize through the interaction with the remote RADIUS server.
[0029] S103, the charging module determines a charging scheme for the MAC terminal according to a pre-set charging list, and charges the authentication message according to the charging scheme to obtain a charging result.
[0030] In one embodiment, a charging list is arranged in the charging module. The charging list is configured in a chain form by a plurality of different charging methods, and the MAC terminal is charged according to the arrangement order of the charging schemes in the charging list, so that when the charging scheme of the previous node is invalid, the scheme of the next node can be used for charging in time. The alternative charging schemes include RADIUS remote charging, TACACS remote charging, local charging, and no charging.
[0031] The RADIUS remote charging is implemented by using the RADIUS message for interaction between the charging module and the remote server. Based on the high scalability of RADIUS, the required field RADIUS authentication message TLV field can be added or deleted in the message according to the actual application requirement. The TACACS remote charging is implemented by using the more secure TCP link for charging, and supports sending the real-time charging information of TACACS through the operation record after the authentication and authorization are successful. The operation record is generated after logging into the system, and each input instruction can be sent to the remote server. The local charging is implemented by using the local database in the subsequent module to charge the MAC address authentication user, and provides the same charging content options as the remote charging. The information to be recorded or ignored can be selected according to the requirement. In addition to generating the corresponding record log at the key charging event, such as starting and ending charging, the stored log can also be exported to the local or remote environment. The no charging is implemented by not performing the charging operation. If this scheme is required to be configured, it must be configured at the end. When the charging method list configured with this method is executed to the no charging method, the charging process is also considered to be successful.
[0032] In one embodiment, after the specific charging scheme is determined from the charging list, the charging module executes the charging scheme. If the selected scheme is remote charging, the charging module needs to communicate with the remote charging server to obtain and analyze the final charging result. If the selected scheme is local charging, the charging module charges the MAC terminal according to the local database.
[0033] In one embodiment, after the charging module sends the authentication message to the remote charging server, it is determined whether the remote charging server generates a charging result. If the remote charging server generates a charging result, the remote charging server sends the charging result to the charging module. If the charging return information is illegal or the charging reply message is timed out and no result is received, the remote charging server feeds back the charging failure message to the charging module, and requests the next charging method according to the chain arrangement in the charging list. When the remote charging is successful, the success information is also fed back to the method list, indicating that the charging program of the scheme is normal. The local charging returns the charging error only when the local data table is full or other abnormal conditions occur.
[0034] In one embodiment, the command line module provides a command line interface for interaction, controls the operation parameters of other modules of the billing system. For the authentication module, the command line module controls the switch of the MAC address authentication of the whole port, configures the MAC address authentication method, including the server address, secret key and other information when remotely authenticating; for the billing module, a list of multiple billing schemes can be configured, and one of them can be selectively enabled; the interaction information with the remote server can also be configured, and the configuration of the local billing database can also be modified.
[0035] As shown in Figure 3 The embodiment of the present application also provides a MAC address-based billing device, which is applied to a MAC address-based billing system, and the billing system comprises an address detection module, an authentication module and a billing module.
[0036] at least one processor; and
[0037] a memory in communication with the at least one processor; wherein
[0038] 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 MAC address-based billing device to perform the following steps:
[0039] The address detection module receives information of the MAC terminal, and filters the information according to a pre-set format to obtain authentication information, and sends the authentication information to the authentication module.
[0040] The authentication module encapsulates the authentication information to obtain an authentication message, and sends the authentication message to the billing module.
[0041] The billing module determines a billing scheme for the MAC terminal according to a pre-set billing list, and charges the authentication message according to the billing scheme to obtain a billing result.
[0042] The embodiment of the present application also provides a non-volatile computer storage medium, which stores computer executable instructions, and is applied to a MAC address-based billing system, and the billing system comprises an address detection module, an authentication module and a billing module.
[0043] The address detection module receives information of the MAC terminal, and filters the information according to a pre-set format to obtain authentication information, and sends the authentication information to the authentication module.
[0044] The authentication module encapsulates the authentication information to obtain an authentication message, and sends the authentication message to the billing module.
[0045] The charging module determines a charging scheme for the MAC terminal according to a pre-set charging list, and charges the authentication message according to the charging scheme to obtain a charging result.
[0046] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments. Especially, the device and medium embodiments are described simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments.
[0047] The device and medium provided by the embodiments of the present application are one-to-one corresponding to the method, and therefore, the device and medium also have the similar beneficial technical effects as the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here.
[0048] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program code.
[0049] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device implemented in the flowcharts and / or block diagrams. Figure 1 The function of one flow or multiple flows and / or blocks Figure 1 The function of one block or multiple blocks.
[0050] These computer program instructions can also be stored in a computer-readable memory capable of guiding the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices, which implement the flowcharts and / or block diagrams. Figure 1 The function of one flow or multiple flows and / or blocks Figure 1the function(s) specified in the block or blocks.
[0051] These computer program instructions can also be loaded into computer or other programmable data processing devices to cause a series of operational steps to be performed on the computer or other programmable devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable devices provide steps for implementing the flowchart block(s) or flowchart flow(s) and / or portions thereof. Figure 1 the flowchart block(s) or flowchart flow(s) and / or portions thereof. Figure 1 the function(s) specified in the block or blocks.
[0052] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0053] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the computer stores information about an operating system, application software, and / or the like. Memory is an example of computer readable media.
[0054] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0055] It should also be noted that the terms "comprising", "including", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article or apparatus that includes the recited element.
[0056] The above merely provides an example of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the scope of claims of the present application.
Claims
1. A MAC address based charging method, characterized in that, The method is applied to a MAC address-based charging system, and the charging system comprises an address detection module, an authentication module and a charging module. The address detection module receives information of a MAC terminal, filters the information according to a preset format to obtain authentication information, and sends the authentication information to the authentication module. The authentication module encapsulates the authentication information to obtain an authentication message, and sends the authentication message to the charging module. The charging module determines a charging scheme for the MAC terminal according to a preset charging list, and charges the authentication message according to the charging scheme to obtain a charging result. The format comprises broadcast, groupcast, unicast, multicast. The address detection module filters the information according to the preset format, specifically comprising: The broadcast format information and the groupcast format information in the information are deleted to obtain the authentication information.
2. The method of claim 1, wherein, Before filtering the information according to the preset format, the method further comprises: The address detection module obtains an authentication state of the MAC terminal, and judges the authentication state. If the authentication state of the MAC terminal is authenticated, the address detection module receives the information. If the authentication state of the MAC terminal is not authenticated, the address detection module does not receive the information.
3. The method of claim 1, wherein, The authentication module encapsulates the authentication information, specifically comprising: The authentication module encapsulates the authentication information into a TLV field of a Radius message to obtain the authentication message.
4. The method of claim 1, wherein, The charging scheme comprises RADIUS remote charging, TACACS remote charging, local charging and no charging; and a plurality of charging schemes are arranged in a chain in the charging list. The charging module determines a charging scheme for the MAC terminal according to a preset charging list, specifically comprising: The MAC terminal is charged according to the arrangement order of the charging schemes in the charging list.
5. The method of claim 4, wherein, The method further comprises: Determining a charging scheme for the MAC terminal; If the charging scheme is remote charging, the charging module sends the authentication message to a remote charging server; If the charging scheme is local charging, the charging module charges the MAC terminal according to a local database.
6. The method of claim 5, wherein, After the charging module sends the authentication message to the remote charging server, the method further comprises: Determining whether the remote charging server generates a charging result; If the remote charging server generates a charging result, the remote charging server sends the charging result to the charging module; If the remote charging server does not generate a charging result, the remote charging server sends a charging failure message to the charging module, and the charging module selects a next charging scheme according to the chain arrangement.
7. The method of claim 1, wherein, The charging system further comprises a command line module; and the method further comprises: The command line module receives a parameter package set by a user, and sends the parameter package to other modules of the charging system, wherein the parameter package comprises an authentication scheme of the authentication module and interactive configuration information of the charging module.
8. A MAC address based charging device, characterized by The application is applied to a MAC address-based charging system, which comprises an address detection module, an authentication module and a charging module. at least one processor; and a memory connected with the at least one processor in communication; 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 MAC address-based charging device to perform the following steps: the address detection module receives information of a MAC terminal, filters the information according to a preset format to obtain authentication information, and sends the authentication information to the authentication module; the authentication module encapsulates the authentication information to obtain an authentication packet, and sends the authentication packet to the charging module; the charging module determines a charging scheme for the MAC terminal according to a preset charging list, and charges the authentication packet according to the charging scheme to obtain a charging result; the format comprises broadcast, groupcast, unicast and multicast; the address detection module filters the information according to the preset format, specifically including: deleting broadcast format information and groupcast format information in the information to obtain the authentication information.
9. A non-transitory computer storage medium storing computer-executable instructions, the computer-executable instructions comprising instructions for: receiving a request to access a file; determining whether the file is stored in a cache; and in response to determining that the file is stored in the cache, providing access to the file from the cache. The application is applied to a MAC address-based charging system, which comprises an address detection module, an authentication module and a charging module. The computer executable instructions are set as follows: the address detection module receives information of a MAC terminal, filters the information according to a preset format to obtain authentication information, and sends the authentication information to the authentication module; the authentication module encapsulates the authentication information to obtain an authentication packet, and sends the authentication packet to the charging module; the charging module determines a charging scheme for the MAC terminal according to a preset charging list, and charges the authentication packet according to the charging scheme to obtain a charging result; the format comprises broadcast, groupcast, unicast and multicast; the address detection module filters the information according to the preset format, specifically including: deleting broadcast format information and groupcast format information in the information to obtain the authentication information.
Citation Information
Patent Citations
Method and system for charging of communication network
CN1921398A
Method and system for radio data networks access authentication
EP1307017A1