Communication method and device

By generating and traversing the user session clear table and deleting the corresponding session table entry, the billing problem caused by the newly launched user equipment due to the failure of the session table entry is solved, and the billing exceptions of abnormal traffic is prevented.

CN120547006APending Publication Date: 2025-08-26NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510617480.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

During the billing process of existing users, when the session table entry of the offline user equipment is not invalid, the newly launched user equipment is assigned to the same private network IP address, causing the newly launched user equipment to receive excessive traffic, resulting in billing abnormalities.

Method used

By receiving the notification message sent by the second network device, a user session clearance table is generated and traversed to delete the corresponding table entries in the local user session table, preventing the service traffic of the old user device from being forwarded.

Benefits of technology

Effectively intercept the service traffic of old user equipment, prevent operators from charging abnormally, and solve the problem that newly launched user equipment receives excessive traffic due to the failure of session table entry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120547006A_ABST
    Figure CN120547006A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and device, applied to a first network device, the method comprising: receiving at least one notification message sent by a second network device, each notification message comprising a first address; a user session clearing table is generated, the user session clearing table comprises at least one user session clearing table item, and each user session clearing table item comprises a first address; traversing the user session clear table; deleting a user session table item comprising each first address in a local user session table according to the user session clear table; wherein the first notification message is sent by the second network device after determining that the user equipment indicated by the first address is offline.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method and device. Background Art

[0002] A billing system manages billing for Internet users. Its core components include front-end user authentication, back-end billing and settlement, and database management. As application requirements evolve, additional features become necessary, such as logging and bandwidth limiting. Depending on the application requirements and the specific application scenario, the system complexity can vary, ranging from a simple, small-scale billing system to a large-scale broadband metropolitan area network billing system.

[0003] like Figure 1 As shown, Figure 1 This is the network diagram for billing existing users. Figure 1 In the example, user A accesses the network through user device A. The access device assigns a private IP address (10.1.1.1) to user device A. User device A sends a service packet, which includes a five-tuple (source IP address, source port, destination IP address, destination port, and protocol version). The firewall creates a session entry based on this five-tuple information, maps user device A's private IP address to a public address (117.1.1.1), and then sends the service packet to a remote server on the public network.

[0004] After user device A goes offline, the firewall's session entry ages after 2 minutes. Within 2 minutes, if the remote server continues to send service packets to user A, the session entry remains valid, and the firewall continues to forward service packets to the user. When user B accesses the network through user device B and is assigned the same private IP address (10.1.1.1), it immediately receives service packets, causing user device B to experience abnormally high traffic volume, leading to billing complaints and disputes. Summary of the Invention

[0005] In view of this, the present application provides a communication method and device to solve the problem that in the existing user billing process, when the session table entry of the offline user device has not expired, the newly online user device is assigned to the same private network IP address, and the newly online user device receives excessive traffic, causing billing abnormalities.

[0006] In a first aspect, the present application provides a communication method, applied to a first network device, the method comprising:

[0007] receiving at least one notification message sent by the second network device, each notification message including the first address;

[0008] generating a user session clearing table, wherein the user session clearing table includes at least one user session clearing table entry, and each user session clearing table entry includes a first address;

[0009] Traversing the user session clearing table;

[0010] Deleting the user session entry including each first address from the local user session table according to the user session clearing table;

[0011] The first notification message is sent by the second network device after determining that the user equipment indicated by the first address is offline.

[0012] In a second aspect, the present application provides a communication device, applied to a first network device, the device comprising:

[0013] a receiving unit, configured to receive at least one notification message sent by the second network device, each notification message including the first address;

[0014] a generating unit, configured to generate a user session clearing table, wherein the user session clearing table includes at least one user session clearing table entry, and each user session clearing table entry includes a first address;

[0015] A traversal unit, configured to traverse the user session clearing table;

[0016] a deleting unit, configured to delete, according to the user session clearing table, a user session entry including each first address in the local user session table;

[0017] The first notification message is sent by the second network device after determining that the user equipment indicated by the first address is offline.

[0018] In a third aspect, the present application provides a network device comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.

[0019] Therefore, using the communication method and apparatus provided in the present application, a first network device receives at least one notification message sent by a second network device, each notification message including a first address; the first network device generates a user session clearing table, the user session clearing table including at least one user session clearing table entry, each user session clearing table entry including a first address; the first network device traverses the user session clearing table; according to the user session clearing table, the first network device deletes the user session table entry including each first address in the local user session table; wherein the first notification message is sent by the second network device after determining that the user device indicated by the first address is offline.

[0020] In this way, the first network device generates a user session purge table based on the received notification message, and uses it to intercept the service traffic of the old user device and purge the old session, preventing abnormal billing by the operator. This also solves the existing problem in user billing where, while the session table entry of a disconnected user device is still valid, a newly connected user device assigned to the same private IP address receives excessive traffic, resulting in abnormal billing. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 Billing network diagram for existing users;

[0022] Figure 2 A flow chart of a communication method provided in an embodiment of the present application;

[0023] Figure 3 A structural diagram of a communication device provided in an embodiment of the present application;

[0024] Figure 4 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION

[0025] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0026] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the corresponding listed items.

[0027] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0028] The communication method provided in the embodiment of the present application is described in detail below. Figure 2 , Figure 2 This is a flowchart of a communication method provided in an embodiment of the present application. The method is applied to a first network device, which is located within a billing system. The first network device may be a firewall. The communication method provided in an embodiment of the present application may include the following steps.

[0029] Step 210: Receive at least one notification message sent by the second network device, each notification message including the first address;

[0030] Specifically, please refer to Figure 1 ,exist Figure 1 In the example, any user (for example, user A accesses the network first, followed by user B) accesses the network through a user device. A second network device (for example, a GGSN device, or other network device capable of enabling user devices to go online) assigns a first address to the user device (for example, user device A first). This first address can also be called a private IP address (for example, 10.1.1.1).

[0031] After the user equipment obtains the first address, it subsequently accesses the network through the first address.

[0032] After receiving a service message from a user device, the first network device not only forwards the service message to a server in the network, but also assigns a second address to the user device based on the first address. This second address can also be called a public IP address (for example, 117.1.1.1). Simultaneously, the first network device also locally generates a corresponding user session entry for the user device. This user session entry includes the first address, the second address, the time the entry was generated, and the remaining lifetime of the entry.

[0033] It can be understood that the first network device stores the user session entries generated for each user equipment in a unified manner in the user session table.

[0034] If, at this time, the user device no longer accesses the network (for example, the user device determines that the user device is offline through a PPPoE protocol message or a DHCP protocol message, or the server determines that the user device is offline after not receiving a user service message within a preset time), or the user device is abnormal (for example, power outage or failure), that is, the user device is offline, the second network device generates a notification message after determining that the user device is offline. The notification message includes the first address.

[0035] It is understandable that after determining that each user device is offline, the second network device generates a notification message, which includes the first address of the offline user device. In other words, the notification message includes the private IP address of the offline user device.

[0036] Optionally, in an embodiment of the present application, the notification message includes a Type-Length-Value (TLV) structure, which includes a Type field, a Length field, and a Value field. The Type field indicates the attribute type, which is currently configured to be 8 and occupies 1 byte; the Length field indicates the length of the TLV structure (including type, length, and value), which occupies 1 byte; and the Value field indicates the information carried by the TLV, which is used to carry the first address and occupies 2 bytes.

[0037] Furthermore, the above value field also includes a user IP address (Framed-IP-Address) field, and the Framed-IP-Address field is used to carry the first address.

[0038] It should be noted that in the embodiment of the present application, the DAE service has been configured in the second network device, and the above-mentioned notification message can specifically be a disconnect message (English: Disconnect Message, abbreviated as: DM) or an authorization change (English: Change of Authorization, abbreviated as: COA) message.

[0039] A DAE port (port number 3799) has been configured in the first network device, and the first network device periodically detects whether the DAE port has received a notification message.

[0040] Step 220: Generate a user session clearing table, wherein the user session clearing table includes at least one user session clearing table entry, and each user session clearing table entry includes a first address;

[0041] Specifically, according to the description of step 210, after obtaining the first address from each notification message, the first network device generates a corresponding user session clearing entry according to each first address, and each user session clearing entry includes a first address.

[0042] It can be understood that the first network device stores each user session clearing entry generated for each first address in the user session clearing table.

[0043] Optionally, in an embodiment of the present application, the notification message further includes an address of the second network device, and the address of the second network device is the source address of the notification message.

[0044] After receiving the notification message, the first network device also obtains the source address from the notification message, that is, obtains the address of the second network device; the first network device identifies whether the address of the second network device has been recorded locally; if the address of the second network device has been recorded locally, the first network device generates a corresponding user session clearing table; if the address of the second network device has not been recorded locally, the first network device does not generate a corresponding user session clearing table.

[0045] Through the above identification process, a user session clearing table can be generated for legitimate and trusted access devices to prevent malicious attacks.

[0046] Further, as shown in Table 1 below.

[0047] Table 1 User session clearing table

[0048] Framed-IP-Address SourceIP Address Update time TTL 10.1.1.2 20.1.1.2 2025 / 04 / 23 14:29 30s 10.1.1.3 20.1.1.2 2025 / 04 / 23 14:30 30s 10.1.1.4 20.1.1.2 2025 / 04 / 23 15:00 30s 10.1.1.5 20.1.1.2 2025 / 04 / 23 15:29 40s 10.1.1.6 20.1.1.2 2025 / 04 / 23 16:00 50s 10.1.1.7 20.1.1.2 2025 / 04 / 23 16:29 50s

[0049] In Table 1, a user session clearing entry includes a user IP address field, a source IP address field, an update time field, and a time to live (TTL) field. The user IP address field carries the first address, the source IP address field carries the address of the second network device, the update time field carries the time the user session clearing entry was generated, and the TTL field carries the remaining time to live of the user session entry.

[0050] Step 230: traverse the user session clearing table;

[0051] Specifically, according to the description of step 220, after generating the user session clearing table, the first network device traverses each user session clearing entry in the user session clearing table and obtains the first address from each user session clearing entry.

[0052] Step 240: Delete the user session entry including each first address in the local user session table according to the user session clearing table.

[0053] Specifically, according to the description of step 230, after obtaining the first address from each user session clearing entry, the first network device deletes the user session entry including each first address in the local user session table using the first address.

[0054] Optionally, the specific process of the first network device deleting the user session entry including each first address in the local user session table according to the user session clearing table is as follows:

[0055] Based on the generation time of each entry, the first network device obtains at least one first user session entry generated before the entry generation time from the local user session table; based on each first address included in the user session clearing table, the first network device selects at least one second user session entry from the at least one first user session entry, each second user session entry including the first address; and the first network device deletes the at least one second user session entry.

[0056] In one example, the user session table is shown in Table 2.

[0057] Table 2 User session table

[0058]

[0059]

[0060] The first network device first obtains the first address, 10.1.1.2, from the user session clearing table. Based on the generation time corresponding to this address, it retrieves entries 1, 2, and 3 from the user session table. The generation times of entries 1, 2, and 3 are all before 2025 / 04 / 23 14:29, the generation time corresponding to the first address. From entries 1, 2, and 3, the first network device again selects entry 1, which includes the first address, and deletes it.

[0061] In the above example, entry 7 in the user session table is not deleted by the first network device because the user device corresponding to entry 7 (i.e., user device B) may have been assigned the same IP address by the second network device after the previous user device (i.e., user device A) went offline. However, because entry 7 was generated later than the generation time corresponding to the first address in the user session clearing table (2025 / 04 / 23 14:29), the first network device retains entry 7 to avoid affecting the service usage of the user device corresponding to entry 7 (i.e., user device B).

[0062] Optionally, in an embodiment of the present application, a process is also included in which the first network device forwards the service message sent by the server.

[0063] Furthermore, a server on the external network intends to send a service message to a user device on the private network. The service message includes a second address. After receiving the service message, the first network device obtains the second address from the message. Based on the second address, the first network device searches the local user session table for a user session entry that matches the second address. If no user session entry matching the second address exists in the user session table, the first network device discards the service message.

[0064] It is understandable that since the first network device has deleted the corresponding entry in the user session table according to the user session clearing table, when the first network device searches the user session table again according to the second address, there is no user session entry matching the second address in the user session table.

[0065] Optionally, in an embodiment of the present application, the first network device may also perform aging processing on the user session clearing entry to avoid excessive memory usage.

[0066] Furthermore, when the remaining lifetime of the entry reaches a first value (for example, the first value is 0), the first network device deletes the corresponding user session clearing entry.

[0067] Therefore, using the communication method provided in the present application, the first network device receives at least one notification message sent by the second network device, each notification message includes a first address; the first network device generates a user session clearing table, the user session clearing table includes at least one user session clearing table entry, each user session clearing table entry includes a first address; the first network device traverses the user session clearing table; according to the user session clearing table, the first network device deletes the user session table entry including each first address in the local user session table; wherein, the first notification message is sent by the second network device after determining that the user device indicated by the first address is offline.

[0068] In this way, the first network device generates a user session purge table based on the received notification message, and uses it to intercept the service traffic of the old user device and purge the old session, preventing abnormal billing by the operator. This also solves the existing problem in user billing where, while the session table entry of a disconnected user device is still valid, a newly connected user device assigned to the same private IP address receives excessive traffic, resulting in abnormal billing.

[0069] Based on the same inventive concept, the present application also provides a communication device corresponding to the communication method. Figure 3 , Figure 3 The communication device provided in an embodiment of the present application is applied to a first network device, and the device includes:

[0070] The receiving unit 310 is configured to receive at least one notification message sent by the second network device, each notification message including the first address;

[0071] A first generating unit 320 is configured to generate a user session clearing table, wherein the user session clearing table includes at least one user session clearing table entry, and each user session clearing table entry includes a first address;

[0072] A traversal unit 330, configured to traverse the user session clearing table;

[0073] a first deleting unit 340, configured to delete the user session entry including each first address in the local user session table according to the user session clearing table;

[0074] The first notification message is sent by the second network device after determining that the user equipment indicated by the first address is offline.

[0075] Optionally, the user session entry further includes a second address;

[0076] The receiving unit 310 is further configured to receive a service message sent by a server, where the service message includes the second address;

[0077] The device further includes: a search unit (not shown in the figure), configured to search, based on the second address, a local user session table to determine whether there is a user session entry matching the second address;

[0078] a discarding unit (not shown in the figure), configured to discard the service message if the service message does not exist;

[0079] The first address is the intranet address of the user equipment, and the second address is the extranet address of the user equipment.

[0080] Optionally, the notification message further includes an address of the second network device;

[0081] The apparatus further includes: an identification unit (not shown in the figure), configured to identify whether the address of the second network device has been recorded locally;

[0082] A second generating unit (not shown in the figure) is used to generate the user session clearing table if the user session has been recorded;

[0083] Wherein, each user session clearing entry further includes the address of the second network device.

[0084] Optionally, the notification message includes a TLV structure, the TLV structure includes a value field, the value field includes a Framed-IP-Address field, and the Framed-IP-Address field is used to carry the first address.

[0085] Optionally, the clearing table entry for each user session further includes a time when the table entry was generated;

[0086] The first deleting unit 340 is specifically configured to obtain, from the local user session table, according to the entry generation time, at least one first user session entry that has been generated before the entry generation time;

[0087] selecting, according to each first address, at least one second user session entry from the at least one first user session entry, each second user session entry including the first address;

[0088] Delete the at least one second user session entry.

[0089] Optionally, each user session clearing entry further includes a remaining lifetime of the entry;

[0090] The device further includes: a second deleting unit (not shown in the figure), configured to delete the corresponding user session clearing entry when the remaining survival time of the entry reaches a first value.

[0091] Therefore, using the communication device provided in the present application, the first network device receives at least one notification message sent by the second network device, each notification message includes a first address; the first network device generates a user session clearing table, the user session clearing table includes at least one user session clearing table item, each user session clearing table item includes a first address; the first network device traverses the user session clearing table; according to the user session clearing table, the first network device deletes the user session table item including each first address in the local user session table; wherein, the first notification message is sent by the second network device after determining that the user device indicated by the first address is offline.

[0092] In this way, the first network device generates a user session purge table based on the received notification message, and uses it to intercept the service traffic of the old user device and purge the old session, preventing abnormal billing by the operator. This also solves the existing problem in user billing where, while the session table entry of a disconnected user device is still valid, a newly connected user device assigned to the same private IP address receives excessive traffic, resulting in abnormal billing.

[0093] Based on the same inventive concept, the embodiment of the present application further provides a network device, such as Figure 4 As shown, it includes a processor 410, a transceiver 420 and a machine-readable storage medium 430, the machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410, and the processor 410 is prompted by the machine-executable instructions to execute the communication method provided in the embodiment of the present application. Figure 3 The communication device shown can be used as Figure 4 The network device hardware structure shown is implemented.

[0094] The computer-readable storage medium 430 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the computer-readable storage medium 430 may be at least one storage device located remotely from the processor 410.

[0095] The processor 410 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0096] In the embodiment of the present application, the processor 410 reads the machine-executable instructions stored in the machine-readable storage medium 430, and the machine-executable instructions enable the processor 410 itself and call the transceiver 420 to execute the communication method described in the aforementioned embodiment of the present application.

[0097] In addition, an embodiment of the present application provides a machine-readable storage medium 430, which stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions prompt the processor 410 itself and the calling transceiver 420 to execute the communication method described in the aforementioned embodiment of the present application.

[0098] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0099] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0100] As for the embodiments of the communication device and the machine-readable storage medium, since the method contents involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0101] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A communication method, characterized in that: Applied to a first network device, the method includes: receiving at least one notification message sent by the second network device, each notification message including the first address; generating a user session clearing table, wherein the user session clearing table includes at least one user session clearing table entry, and each user session clearing table entry includes a first address; Traversing the user session clearing table; Deleting the user session entry including each first address from the local user session table according to the user session clearing table; The first notification message is sent by the second network device after determining that the user equipment indicated by the first address is offline.

2. The method according to claim 1, characterized in that The user session entry further includes a second address; and the method further includes: receiving a service message sent by a server, where the service message includes the second address; searching, according to the second address, in a local user session table to determine whether a user session entry matching the second address exists; If not, discard the service message; The first address is the intranet address of the user equipment, and the second address is the extranet address of the user equipment.

3. The method according to claim 1, characterized in that The notification message also includes the address of the second network device; After receiving the notification message, the method further includes: Identifying whether the address of the second network device has been recorded locally; If it has been recorded, generating the user session clearing table; Wherein, each user session clearing entry further includes the address of the second network device.

4. The method according to claim 1, wherein The notification message includes a TLV structure, the TLV structure includes a value field, the value field includes a Framed-IP-Address field, and the Framed-IP-Address field is used to carry the first address.

5. The method according to claim 1, wherein Each user session clearing entry also includes the time when the entry was generated; The deleting, according to the user session clearing table, the user session entry including each first address in the local user session table specifically includes: acquiring, from the local user session table, according to the entry generation time, at least one first user session entry generated before the entry generation time; selecting, according to each first address, at least one second user session entry from the at least one first user session entry, each second user session entry including the first address; Delete the at least one second user session entry.

6. The method according to claim 1, characterized in that The clearing table entry for each user session also includes the remaining lifetime of the entry; and the method further includes: When the remaining survival time of the entry reaches a first value, the corresponding user session clearing entry is deleted.

7. A communication device, characterized in that: Applied to a first network device, the apparatus includes: a receiving unit, configured to receive at least one notification message sent by the second network device, each notification message including the first address; a first generating unit, configured to generate a user session clearing table, wherein the user session clearing table includes at least one user session clearing table entry, and each user session clearing table entry includes a first address; A traversal unit, configured to traverse the user session clearing table; a first deleting unit, configured to delete, according to the user session clearing table, a user session entry including each first address in the local user session table; The first notification message is sent by the second network device after determining that the user equipment indicated by the first address is offline.

8. The device according to claim 7, characterized in that The user session table entry also includes a second address; The receiving unit is further configured to receive a service message sent by a server, where the service message includes the second address; The apparatus further includes: a search unit configured to search, based on the second address, a local user session table for a user session entry that matches the second address; a discarding unit, configured to discard the service message if the service message does not exist; The first address is the intranet address of the user equipment, and the second address is the extranet address of the user equipment.

9. The device according to claim 7, characterized in that The notification message also includes the address of the second network device; The apparatus further includes: an identification unit, configured to identify whether the address of the second network device has been recorded locally; a second generating unit, configured to generate the user session clearing table if the user session has been recorded; Wherein, each user session clearing entry further includes the address of the second network device.

10. The device according to claim 7, characterized in that The notification message includes a TLV structure, the TLV structure includes a value field, the value field includes a Framed-IP-Address field, and the Framed-IP-Address field is used to carry the first address.

11. The device according to claim 7, characterized in that Each user session clearing entry also includes the time when the entry was generated; The first deleting unit is specifically configured to obtain, from the local user session table, according to the entry generation time, at least one first user session entry generated before the entry generation time; selecting, according to each first address, at least one second user session entry from the at least one first user session entry, each second user session entry including the first address; Delete the at least one second user session entry.

12. The device according to claim 7, characterized in that Each user session clearing entry also includes the remaining lifetime of the entry; The device further includes: a second deleting unit, configured to delete the corresponding user session clearing entry when the remaining lifetime of the entry reaches a first value.