Method and apparatus for acquiring device access position
By receiving and analyzing the receiving port identifier and sending end identifier in the mirror message, and combining the port type and neighbor information, the accurate location of the user equipment access point is achieved, solving the problem of real-time and accuracy of access point acquisition in large communication systems and reducing communication overhead.
Patent Information
- Application Number
- PCT/CN2024/083830
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-30
- Filing Date
- 2024-03-26
- Publication Date
- 2024-10-03
AI Technical Summary
In large-scale communication systems, existing technologies struggle to accurately and in real-time obtain the access location of user equipment, resulting in low efficiency in fault location, especially in scenarios involving the migration of terminal equipment where it is difficult to update the access location in a timely manner.
By receiving mirrored packets sent by network devices, the access location of user equipment is determined using the receiving port identifier and the sending end identifier in the mirrored packets. Combined with port type filtering and neighbor information, accurate location of user equipment can be achieved.
It improves the real-time performance and accuracy of user equipment access location acquisition, reduces system communication overhead, and is suitable for various networking scenarios, especially in the scenario of terminal equipment migration, where it can update access location in a timely manner.
Smart Images

Figure CN2024083830_03102024_PF_FP_ABST
Abstract
Description
Method and device for obtaining device access location
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 30, 2023, with application number 202310371599.9 and application name “Method and Apparatus for Obtaining Device Access Location”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communications, and in particular to a method and apparatus for acquiring a device access location. Background Art
[0003] In large-scale communications systems, if application data transmission anomalies occur, they may be due to network issues. Therefore, administrators need to locate and troubleshoot the fault. During troubleshooting, administrators must determine the network access location of each user device and, based on the network topology and access location, determine the application data flow's transmission path. Administrators can monitor traffic flow at key locations along the application data flow's transmission path to obtain specific parameters, which they then use to locate the fault. Therefore, accurately determining the user device's network access location is crucial.
[0004] Summary of the Invention
[0005] The present application provides a method and apparatus for obtaining a device access location, which can accurately locate a user device in a network to obtain the access location of the user device.
[0006] In a first aspect, the present application provides a method for obtaining the access location of a device. The method includes: a device receives a mirror message sent by a network device. The mirror message sent by the network device is generated by the network device based on the received data message. In addition, the mirror message sent by the network device includes the data message or part of the content of the data message, as well as the identifier and receiving port identifier of the network device. The receiving port identifier carried in the mirror message is used to indicate the receiving port of the network device for receiving the data message, and the data message in the mirror message or part of the content of the data message in the mirror message includes the identifier of the sender of the data message. Then, based on the received mirror message, the device determines whether the sender of the data message is a user device. If it is determined that the sender is a user device, the device obtains the access location information of the user device in the network. The access location information includes the identifier of the sender, the identifier of the network device, and the receiving port identifier.
[0007] In this way, the present application uses a mirror message to obtain the access location of the user device, which enables the system to obtain the access location of the user device in real time when the user device interacts with the device in the system, thereby improving the real-time performance of the access location acquisition of the user device. In addition, the present application provides a highly versatile access location acquisition method that can be applied to various networking scenarios to meet the real-time and accuracy requirements of access location acquisition in different networking scenarios. For example, in terminal device migration scenarios, the present application can update the access location of the device in a timely manner to ensure the real-time performance of the access location of the acquired user device. In addition, the present application only relies on the network device to transmit the mirror message to obtain the access location of the user device, without the need to transmit a large amount of interface data, etc., which can effectively reduce the communication overhead within the system and reduce bandwidth occupancy.
[0008] Exemplarily, data exchange is performed between the network device and the sender of the data message based on a wired connection.
[0009] Exemplarily, the receiving port of the data message can also be understood as a connection port with the sending end of the data message.
[0010] In one possible implementation, based on a mirror message, determining whether the sender of a data message is a user device includes: a device determining whether the sender of a data message is a user device based on a receiving port identifier in the mirror message. In this way, the present application extends the mirror message so that the mirror message carries a receiving port identifier. Accordingly, the device can determine whether the sender connected to the corresponding receiving port is a user device through the receiving port identifier carried by the mirror message, thereby providing an access location acquisition solution suitable for scenarios of layer 2 and layer 3 data message forwarding, which can achieve accurate positioning of the access device of the user device and thus obtain the access location of the user device.
[0011] In one possible implementation, determining whether the sender of a data message is a user device based on a mirrored message includes: a device determining whether the sender of the data message is a user device based on an identifier of the sender in the mirrored message. Thus, the present application utilizes the characteristics of the mirrored message to determine the device type of the sender (i.e., user device or non-user device) based on the identifier of the sender carried in the mirrored message, so as to further obtain the access point of the user device if the sender is determined to be a user device.
[0012] In one possible implementation, the port type of the receiving port is a user-side port type. Thus, in the present application, a network device having a port of the user-side port type will trigger the mirror message sending process only when a data message is received at a receiving port based on the user-side port type. Other network devices that do not have a port of the user-side port type, and network devices that have a port of the user-side port type but receive a data message at a receiving port based on a non-user-side port type, will not trigger the sending of a mirror message. This effectively reduces the number of mirror message interactions, reduces the pressure on network devices, and further reduces communication overhead.
[0013] In one possible implementation, based on the mirror message, determining whether the sender of the data message is a user device includes: the device determines that the sender of the data message is a user device in response to the received mirror message. In this way, in the scenario where the network device with a port of the user-side port type in the present application triggers the mirror message sending process only when the receiving port based on the user-side port type receives a data message, when the device receives the mirror message, it can determine that the sender of the mirror message is the access point of the user device, thereby effectively improving the positioning efficiency of the access point.
[0014] In one possible implementation, before receiving a mirrored message sent by a network device, the method further includes: the device determines at least one network device in the network based on first information. The first information includes the port identifier and corresponding port type of each network device in the network, the port type including the user-side port type and the network device-side port type, and each of the at least one network device includes a port of the user-side port type. Next, the device sends instruction information to the at least one network device, wherein the instruction information is used to instruct each of the at least one network device to generate a mirrored message based on the data message received by the port of the user-side interface type of each network device. In this way, the present application can predetermine some ports of the user-side port type in the network and instruct the network devices to which these ports belong as the senders of the mirrored message, so that these network devices trigger the mirrored message sending process only when they receive a data message based on the port of the user-side port type. This effectively reduces the number of mirrored message interactions, reduces the pressure on the network devices, and further reduces communication overhead.
[0015] In one possible implementation, based on the receiving port identifier in the mirrored message, determining whether the sender of the data message is a user device includes: a device determines the port type of the receiving port based on first information and the receiving port identifier, the first information including the port identifier and corresponding port type of the port of each network device in the network, the port type including the user-side port type and the network device-side port type. If the port type of the receiving port is the user-side port type, the device determines that the sender is a user device. If the port type of the receiving port is the network device-side port type, the device determines that the sender is a non-user device. In this way, the present application pre-classifies the ports so that when the network device receives the data message, the port type corresponding to the port receiving the data message can be determined. The pre-classification can be understood as preliminary screening. In the preliminary screening stage, the port of the network device-side port type can be determined, and the device connected to the port of the user-side port type may be a user device or a non-user device (e.g., a network device not within the observation range), or the port of the user-side port type may also be an empty port. Accordingly, the device can further determine which specific neighboring device connected to the user-side port is the user device based on the received mirror message, thereby accurately locating the user device and further obtaining the corresponding access location.
[0016] In one possible implementation, before receiving the mirror message sent by the network device, the method further includes: the device obtains second information, the second information includes the identification of multiple network devices in the network. Then, the device obtains neighbor information of each network device in the multiple network devices, each neighbor information includes the identification of the source network device, the source network device port identification and the identification of the neighbor device, the source network device is the device that sends the neighbor information, the neighbor device is the device that is physically connected to the source network device, and the source network device port identification is used to indicate the port of the source network device connected to the neighbor device. Subsequently, the device determines the port type of each network device port based on the second information and the neighbor information. The identification of the neighbor device connected to the port with the port type of the network device side port type is included in the second information, and the identification of the neighbor device connected to the port with the port type of the user side port type is not included in the second information. In this way, the present application can determine whether the device type of the neighbor device to which the network device is connected is a network device type or a non-network device type based on the preset network device identification. Among them, the non-network device may include user devices or other devices (for example, network devices not within the observation range). Based on the received mirror message, the device can further determine which specific port on the user side port is connected to the neighboring device that is the user device, thereby accurately locating the user device and further obtaining the corresponding access location.
[0017] In one possible implementation, receiving a mirror message sent by a network device includes: a device receiving multiple mirror messages; the multiple mirror messages come from one or more network devices. The identifier of the sender includes the IP address of the sender and the MAC address of the sender. Based on the identifier of the sender in the mirror message, determining whether the sender of the data message is a user device includes: if the IP address of the sender carried by N mirror messages in the multiple mirror messages is the same, and the MAC address of the sender carried by the N mirror messages is not included in the second information, and the identifier of the network device carried by the N mirror messages indicates the same network device, determining that the sender is a user device, and the second information includes the identifiers of multiple network devices in the network. In this way, in the three-layer forwarding scenario, if the sender of multiple messages is a non-network device and the corresponding mirror messages come from the same network device, it can be determined that the corresponding sender is a user device. By combining the identifier of the sender and the distribution of the mirror messages, the present application can accurately locate the access point of the user device in the network, and then obtain the access location information corresponding to the user device.
[0018] For example, multiple mirrored messages may be sent by the same network device, generated based on multiple data messages sent by a user device connected to the network device, or generated based on multiple messages sent by multiple user devices connected to the network device.
[0019] In one possible implementation, based on the identifier of the sender in the mirror message, determining whether the sender of the data message is a user device, further includes: if the IP addresses of the senders carried by M mirror messages in multiple mirror messages are the same, and the MAC addresses of the senders carried by the M mirror messages are not included in the second information, and the identifiers of the network devices carried by the M mirror messages indicate two or more network devices, based on the receiving port identifier in the mirror message, determining whether the sender of the data message is a user device. In this way, the present application can effectively improve the accuracy of user device positioning by combining two different judgment methods, thereby avoiding the problem of inaccurate fault positioning caused by misjudgment.
[0020] In one possible implementation, the method further includes: the device queries the user equipment access information based on the identifier of the sending end, and the user equipment access information includes the access location information of at least one user equipment. If the user equipment access information already contains the access location information of the user equipment corresponding to the identifier of the sending end, and the saved access location information is inconsistent with the currently acquired access location information, the device updates the access location information of the user equipment corresponding to the identifier of the sending end in the user equipment access information. In this way, the present application can record the update status of the access location of the user equipment, so that when locating the fault, the operation and maintenance personnel can obtain more fault information to improve the accuracy of fault location.
[0021] For example, when the device saves the access location information of the user equipment, it may also save the access location acquisition time, where the acquisition time may be the time when the access location is acquired or the time when the access location is saved.
[0022] In one possible implementation, based on a mirrored message, determining whether the sender of a data message is a user device includes: a device determining whether the sender of the data message is a user device based on a receiving port identifier and a sender identifier in the mirrored message. If the determination result based on the receiving port identifier indicates that the sender is a user device, and the determination result based on the sender identifier indicates that the sender is not a user device, the sender is determined to be a non-user device. In this way, by combining two different determination methods, the present application can effectively improve the accuracy of user device positioning, thereby avoiding the problem of inaccurate fault positioning caused by misjudgment.
[0023] In one possible implementation, the data message carries transport layer control information or application layer control information. In this way, the network device in the present application triggers the mirror message sending process based on a special (or specified) data message, thereby effectively reducing the number of mirror message sending times to reduce network overhead. In addition, in the case of user device migration or new access, the corresponding control information will be sent, and the network device will trigger the mirror message sending process accordingly. The device can obtain the access location of the user device, thereby reducing network overhead while ensuring the real-time acquisition of the user device access location.
[0024] In one possible implementation, the data message is a tunnel message, and the sender's identifier is carried in the inner message of the tunnel message. In this way, the present application can be applied to the transmission scenario of tunnel data messages, that is, corresponding to user devices such as virtual machines that access the system through the tunnel protocol, and can also accurately locate them.
[0025] In a possible implementation, the user device is a server, a terminal device, or a virtual machine.
[0026] In a possible implementation, the mirrored message is an encapsulated remote port mirroring ERPAN message.
[0027] In a second aspect, the present application provides a device for obtaining the access location of a device. The device includes: a receiving unit and an access location acquisition unit. The receiving unit is used to receive a mirror message sent by a network device. The mirror message is generated by the network device based on the received data message, and the mirror message includes the data message or part of the data message, as well as the identifier of the network device and the receiving port identifier. The data message in the mirror message or the part of the data message in the mirror message includes the identifier of the sender of the data message, and the receiving port identifier is used to indicate the receiving port of the network device for receiving the data message. The access location acquisition unit is used to determine whether the sender of the data message is a user device based on the mirror message. The access location acquisition unit is used to obtain the access location information of the user device if it is determined that the sender is a user device. The access location information includes the identifier of the sender, the identifier of the network device and the receiving port identifier.
[0028] In a possible implementation, the access location acquisition unit is specifically configured to determine whether the sender of the data message is a user equipment based on a receiving port identifier in the mirror message.
[0029] In a possible implementation, the access location acquiring unit is specifically configured to determine whether the sender of the data message is a user equipment based on an identifier of the sender in the mirror message.
[0030] In a possible implementation, the port type of the receiving port is a user-side port type.
[0031] In a possible implementation, the access location acquiring unit is specifically configured to determine, in response to a received mirrored message, that a sender of the data message is a user equipment.
[0032] In one possible implementation, the device also includes an analysis unit, which is used to: determine at least one network device in the network based on first information, the first information including the port identifier and corresponding port type of the port of each network device in the network, the port type including the user-side port type and the network device-side port type, and each network device in at least one network device includes a port of the user-side port type; send indication information to at least one network device, the indication information is used to instruct each network device in at least one network device to generate a mirror message based on the data message received by the port of the user-side interface type of each network device.
[0033] In one possible implementation, the access location acquisition unit is specifically used to: determine the port type of the receiving port based on the first information and the receiving port identifier, the first information including the port identifier and the corresponding port type of the port of each network device in the network, the port type including the user-side port type and the network device-side port type; if the port type of the receiving port is the user-side port type, determine that the sending end is a user device; if the port type of the receiving port is the network device-side port type, determine that the sending end is a non-user device.
[0034] In one possible implementation, the device also includes an analysis unit, which is specifically used to: obtain second information, the second information includes identifiers of multiple network devices in the network; obtain neighbor information of each network device in the multiple network devices, each neighbor information includes the identifier of the source network device, the source network device port identifier and the identifier of the neighbor device, the source network device is a device that sends neighbor information, the neighbor device is a device physically connected to the source network device, and the source network device port identifier is used to indicate the port of the source network device connected to the neighbor device; based on the second information and the neighbor information, determine the port type of the port of each network device, the identifier of the neighbor device connected to the port whose port type is the network device side port type is included in the second information, and the identifier of the neighbor device connected to the port whose port type is the user side port type is not included in the second information.
[0035] In one possible implementation, the receiving unit is specifically configured to: receive multiple mirror messages; the multiple mirror messages come from one or more network devices; the identifier of the sender includes the IP address and the MAC address of the sender; the analyzing unit is specifically configured to: determine that the sender is a user device if the IP address of the sender carried by N mirror messages in the multiple mirror messages is the same, and the MAC address of the sender carried by the N mirror messages is not included in the second information, and the identifiers of the network devices carried by the N mirror messages indicate the same network device, and the second information includes the identifiers of multiple network devices in the network.
[0036] In one possible implementation, the access location acquisition unit is specifically used to: if the IP addresses of the senders carried by M mirror messages in multiple mirror messages are the same, and the MAC addresses of the senders carried by the M mirror messages are not included in the second information, and the identifiers of the network devices carried by the M mirror messages indicate two or more network devices, based on the receiving port identifier in the mirror message, determine whether the sender of the data message is a user device.
[0037] In one possible implementation, the access location acquisition unit is specifically used to: determine whether the sender of the data message is a user device based on the receiving port identifier and the sender identifier in the mirror message; if the judgment result based on the receiving port identifier indicates that the sender is a user device, and the judgment result based on the sender identifier indicates that the sender is a non-user device, determine that the sender is a non-user device.
[0038] In one possible implementation, the device also includes: an access location storage unit, which is used to query user equipment access information based on the identifier of the sending end, where the user equipment access information includes access location information of at least one user equipment; the access location storage unit is also used to update the access location information of the user equipment corresponding to the identifier of the sending end in the user equipment access information if the user equipment access information already includes the access location information of the user equipment corresponding to the identifier of the sending end, and the saved access location information is inconsistent with the currently acquired access location information.
[0039] In a possible implementation, the data message carries transport layer control information or application layer control information.
[0040] In a possible implementation, the data message is a tunnel message, and the identifier of the sender is carried in an inner message of the tunnel message.
[0041] In a possible implementation, the user device is a server, a terminal device, or a virtual machine.
[0042] In a possible implementation, the mirrored message is an encapsulated remote port mirroring ERPAN message.
[0043] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.
[0044] In a third aspect, the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0045] In a fourth aspect, the present application provides a computer program comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0046] In a fifth aspect, the present application provides a chip comprising a processing circuit and a transceiver pin. The transceiver pin and the processing circuit communicate with each other via an internal connection path, and the processing circuit executes the method of the first aspect or any possible implementation of the first aspect to control the receive pin to receive a signal and to control the transmit pin to send a signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] FIG1 is a schematic structural diagram of an exemplary communication system;
[0048] FIG2 is a schematic diagram illustrating an exemplary virtual environment message transmission;
[0049] FIG3 is a flow chart showing an exemplary method for obtaining a device access location;
[0050] FIG4 is a schematic structural diagram of an exemplary communication system;
[0051] FIG5a is a schematic diagram showing the structure of a data message;
[0052] FIG5 b is a schematic diagram showing the structure of a mirrored message;
[0053] FIG6a is a schematic diagram showing the structure of a data message;
[0054] FIG6 b is a schematic diagram illustrating the structure of a mirrored message;
[0055] FIG7 is a schematic diagram illustrating an exemplary application scenario;
[0056] FIG8 is a schematic diagram illustrating an exemplary method for obtaining a device access location;
[0057] FIG9a is a schematic diagram illustrating exemplary message processing;
[0058] FIG9b is a schematic diagram illustrating exemplary message processing;
[0059] FIG9c is a schematic diagram illustrating exemplary message processing;
[0060] FIG10 is a schematic diagram illustrating exemplary message processing;
[0061] FIG11 is a schematic diagram illustrating an exemplary method for obtaining a device access location;
[0062] FIG12 is a schematic diagram illustrating an exemplary mirror message transmission process;
[0063] FIG13 is a schematic diagram illustrating exemplary message processing;
[0064] FIG14 is a schematic diagram showing the structure of a mirror message;
[0065] FIG15 is a schematic diagram illustrating an exemplary application scenario;
[0066] FIG16 is a schematic diagram illustrating an exemplary application scenario;
[0067] FIG17 is a schematic structural diagram of an exemplary device;
[0068] FIG18 is a schematic structural diagram of an exemplary device. DETAILED DESCRIPTION
[0069] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0070] First, before describing the technical solutions of the embodiments of the present application, the communication system of the embodiments of the present application is exemplarily described in conjunction with the structural diagram of the communication system (which may also be referred to as a communication network, etc., which is not limited in this application) shown in Figure 1. Referring to Figure 1, the communication system includes but is not limited to: Spine1, Spine2, Leaf1, Leaf2, Leaf3, and multiple user devices.
[0071] The spine nodes (including Spine1 and Spine2) can be network devices such as switches and routers. The leaves (including Leaf1, Leaf2, and Leaf3) can be network devices such as switches and routers.
[0072] In the embodiments of the present application, each network device (including Spine and Leaf) may provide one or more interfaces (also referred to as ports or transceiver interfaces, etc., which are not limited in this application). The interfaces of the network devices can be used to connect (referring to physical connections, i.e., connections through physical links. Unless otherwise specified, the connection relationships described in the embodiments of the present application refer to direct physical connections, which will not be repeated below) other devices.
[0073] Exemplarily, devices that are interconnected (referring to directly connected) in a system can be referred to as neighbor devices. For example, in the communication system shown in Figure 1, the connection relationships between the devices include but are not limited to: Spine1 connects to Leaf1, Leaf2, and Leaf3. Spine2 connects to Leaf1, Leaf2, and Leaf3. Leaf1 connects to server 11 to server 1n, Leaf2 connects to server 21 to server 2n, and Leaf3 connects to server 31 to server 3n. Accordingly, Leaf1's neighbor devices include but are not limited to: server 11 to server 1n and Spine1. In this scenario, Spine1's neighbor devices include but are not limited to: Leaf1, Leaf2, and Leaf3. Leaf1's neighbor devices include but are not limited to: Spine1, Spin2, and server 11 to server 1n. The neighbor devices of other devices can refer to the above description and will not be illustrated one by one here.
[0074] In Figure 1 , although a communication link exists between Server 11 and Spine 1 (i.e., a communication link exists between Server 11 and Spine 1 for data exchange), and data exchange can occur through this communication link, Server 11 and Spine 1 are not physically directly connected, so the two devices are not neighbors.
[0075] In the embodiment of the present application, the communication system shown in Figure 1 can be located in a data center. In other embodiments, the communication system shown in Figure 1 can also be located in application scenarios such as parks, supermarkets, large enterprises, and operators, which are not limited in this application.
[0076] It should be noted that the embodiments of the present application are described using the leaf-spine network architecture (also represented as Spine-Leaf) in Figure 1 as an example. In other embodiments, the solutions in the embodiments of the present application can also be applied to any network architecture such as the traditional network architecture, and this application does not limit this.
[0077] It should be further explained that the number of devices in the system shown in FIG1 is only an illustrative example, and in actual applications, fewer or more devices may be included, and this application does not limit this.
[0078] It should be further explained that the connection relationship between the devices shown in Figure 1 is also a schematic example. In actual applications, the connection relationship can be set according to the scenario requirements, and this application does not limit it.
[0079] In the embodiment of the present application, the device types in the communication system may include, but are not limited to: network devices (also referred to as network device types) and user devices (also referred to as user device types). Optionally, network devices can be understood as a general term for all devices on the network side, and network devices can be used to provide network functions such as data forwarding. For example, devices such as Spine1, Spine2, Leaf1, Leaf2, and Leaf3 in Figure 1 are network devices. User devices can be understood as a general term for all devices on the user side, and user devices can provide functions such as application services for users, such as servers 11 to 1n, servers 21 to 2n, etc. in Figure 1.
[0080] In the embodiments of the present application, the user device is taken as an example of a server. In other embodiments, the user device can also be a terminal device (such as a computer, tablet, mobile phone, wearable device, smart home device, car-mounted device, etc.), a virtual terminal (such as a virtual machine), etc., which can be connected to the system through a wired connection. This application does not limit this.
[0081] In an embodiment of the present application, the network device used to connect the user device may also be referred to as a boundary device, or an access point of the user device. Exemplarily, the user device accesses the network through the access point to interact with other devices in the network. In an embodiment of the present application, the access point of the user device can be understood as the network device that is closest to the user device (which can be understood as the distance of the physical connection path, or the communication distance or the transmission path distance, etc.) among the known network devices in the system. For example, still referring to Figure 1, Leaf1 is the access point of server 11. Accordingly, server 11 accesses the communication system by accessing Leaf1, thereby interacting with other devices in the communication system.
[0082] The "known network devices" mentioned above can also be referred to as network devices within the observation range, i.e., network devices pre-configured in the network. They can also be understood as network devices known to the administrator, and can also be understood as manageable network devices. This description will not be repeated below. Correspondingly, in the embodiments of this application, some "unknown network devices" exist. These network devices can be understood as network devices that are not configured by the system, or can also be understood as unmanageable network devices. Specific scenarios will be described in detail below.
[0083] Exemplarily, an operating system can be deployed in the user device, and one or more applications or modules can be deployed on the operating system. The application in the user device can generate a data message (also referred to as a data packet) in response to a user operation (or a locally stored instruction). The application data is carried in the data message. The user device (also referred to as the initial sending end in the embodiment of the present application) sends the data message to the network device serving as its access point (hereinafter referred to as the access point). The access point can forward the data message to transmit the data message to the target device (also referred to as the end receiving end in the embodiment of the present application). The transmission path of the data message may also include one or more other network devices.
[0084] In existing technologies, taking campus scenarios as an example, communication systems typically employ terminal access network authentication mechanisms. Access points identify user device identity information and send it to an authentication server for authentication. Only after successful authentication can a user device access the network. In this example, the user device's access information is available from each access point. However, in relatively closed networks, such as data center networks, authentication systems are typically not deployed. Therefore, in scenarios where authentication systems are not deployed, the user device's access location cannot be obtained using the aforementioned methods. To accurately obtain the user device's access location, existing technologies also propose a method for obtaining the access location. In Internet Protocol version 4 (IPv4), when any user device needs to communicate with another user device, it must first obtain the link-layer address of the destination device through the Address Resolution Protocol (ARP). In Internet Protocol version 6 (IPv6), the link-layer address must be obtained through the Neighbor Discovery Protocol (NDP). Accordingly, in this example, the system can regularly (or periodically) collect ARP entries or ND (Neighbor Discovery) entries on the edge switch to obtain the access location of the user device. Taking ARP entries as an example, the ARP entries include, but are not limited to: the Internet Protocol (IP) address of the device interface, the IP address of the connected user device, the Media Access Control (MAC) address of the device interface, and the MAC address of the connected user device.
[0085] However, the application scenarios of the above method are limited. For example, as shown in Figure 2, in this scenario, a virtual machine (VM) is deployed in a user device (such as a server), and the VM generates a data message and sends the data message to an open virtual switch (OVS). OVS encapsulates the data message sent by the VM to generate a tunnel message. Among them, the tunnel message can follow the Virtual eXtensible Local Area Network (VXLAN) protocol (it can also be other tunnel protocols, which are not limited in this application). OVS sends the tunnel message to Leaf. For Leaf, it can only obtain the IP address and MAC address of the tunnel between the server, and because it does not directly interact with the VM through the protocol, it cannot obtain the ARP table entries or ND table entries related to the VM, and thus cannot accurately obtain the access location of the VM.
[0086] In addition, when obtaining the access location of a user device based on an ARP table entry or an ND table entry, the number of ARP table entries or ND table entries obtained is equal to the number of user devices included in the system. If a method of periodically obtaining ARP table entries or ND table entries to determine the access location is adopted, if the acquisition cycle is set to a small length, the communication burden and processing burden (such as the processor burden) of each device will increase. If the cycle length is set to a large length, it may not respond in time to changing scenarios such as user device migration in the system, resulting in obtaining the wrong access location.
[0087] For application scenarios with VMs, existing technologies also provide a method for obtaining access locations. The cloud platform can obtain the attachment relationship between the VM and the physical machine (such as the server in Figure 2). When the access location of the server is obtained on the Leaf, the access location of the VM in the communication system can be further obtained based on the obtained attachment relationship. However, this method relies on the cloud platform to call the interface for obtaining the attachment relationship to obtain the attachment relationship. However, there are many ways to implement VMs. For example, some VMs are based on the OpenStack architecture, and some VMs are based on the CloudStack architecture. This requires the cloud platform to carry out customized development for each VM implementation to support different interfaces for obtaining attachment relationships, which has a high implementation cost.
[0088] In view of this, an embodiment of the present application provides a method for obtaining a device access location. In this method, a system locates a user device through a mirrored message to obtain the user device's access location. This provides a simple and highly real-time access location acquisition method.
[0089] In an embodiment of the present application, an analysis unit, an access location acquisition unit, and an access location storage unit are deployed in a communication system. The analysis unit, the access location acquisition unit, and the access location storage unit can be deployed on the same device (such as a server) or on different devices, which is not limited in this application. If the analysis unit, the access location acquisition unit, and the access location storage unit are deployed on different devices, the servers on which the above units are deployed can communicate with each other (which can be directly connected or indirectly connected, which is not limited in this application) to achieve the interaction of access location related information between the units. Optionally, the device (such as a server) to which the analysis unit, the access location acquisition unit, and the access location storage unit belong can also be deployed outside the communication system (such as the communication system shown in Figure 1). In this scenario, one or more devices on which the analysis unit, the access location acquisition unit, and the access location storage unit are deployed communicate with each other, and can communicate with each device in the communication system.
[0090] In the embodiment of the present application, an example is given in which the analyzing unit, the access location acquiring unit, and the access location storing unit are deployed on the same server (eg, server 22).
[0091] In one possible implementation, one or more servers that deploy the analysis unit, the access location acquisition unit, and the access location storage unit are connected to a Leaf to access the communication system, thereby interacting with other devices. Optionally, the Leaf to which one or more servers that deploy the analysis unit, the access location acquisition unit, and the access location storage unit are connected can be any Leaf in the system. Optionally, the Leaf to which one or more servers that deploy the analysis unit, the access location acquisition unit, and the access location storage unit are connected can also be a dedicated Leaf for such a server. It can be understood that the dedicated Leaf is used to forward messages from the analysis unit, the access location acquisition unit, and the access location storage unit without transmitting other application messages, thereby improving the interaction rate of various information (or parameters) in the access location acquisition process, so as to further improve the efficiency of access location acquisition and storage.
[0092] Exemplarily, the analysis unit may be used to obtain device information in the communication system, and may also be understood as being used to obtain relevant parameters required for analyzing the access location of a user device. Examples include, but are not limited to, network device identifiers and network device interface identifiers. Optionally, the network device identifier includes, but is not limited to, one of the following: a network device ID, a network device MAC address, or a network device IP address.
[0093] In one example, the analysis unit performs analysis based on the acquired device information to determine the device type of the device in the system, where the device type includes a network device type and a non-network device type (also referred to as a user device type). The analysis unit transmits the analysis results to the access location acquisition unit. Accordingly, the access location acquisition unit can further parse the received mirrored message based on the analysis results of the analysis unit to locate the user device among the non-network devices indicated in the analysis results, further obtain the access location of the user device, and save the access location of the user device to the access location storage unit. It can be understood that in this example, the analysis unit can perform preliminary screening based on the device information to exclude network devices, that is, to filter out non-network devices (specifically, network devices that are not within the observation range). In this example, non-network devices may include user devices or some unknown devices, that is, the initial screening does not yet determine the exact type of the device. The access location acquisition unit can then perform further refined screening based on the analysis results of the analysis unit to obtain a precise positioning result for the user device.
[0094] In another example, the analyzing unit outputs the acquired device information to the access location acquiring unit. The access location acquiring unit may acquire the access location of the user device based on the received mirrored message and the acquired device information, and store the access location of the user device in the access location storage unit.
[0095] Illustratively, the access location storage unit is configured to store the access location of each user device input by the access location acquisition unit. Optionally, the access location storage unit stores the access location of each user device in a list format. For example, the access location information received by the access location storage unit includes, but is not limited to, a user device identifier and the access location of the user device. The user device identifier may optionally be the IP address of the user device, and the access location of the user device may include, but is not limited to, at least one of the following: an identifier of a network device to which the user device is connected, and a port identifier of a port of the network device to which the user device is connected.
[0096] In an embodiment of the present application, the user device and the access point may be physically directly connected. In some examples, there may be other devices between the user device and the access point. For example, the VM and the network device it accesses (such as Leaf) are not directly connected, and the server to which the VM belongs and the access point are directly connected. For another example, the user device may also connect to known network devices in the system through some private routers (which may be referred to as unknown network devices or network devices not within the observation range in the embodiment of the present application). In other words, although the device type of the unknown network device is also a network device, it is a network device not within the observation range in the system of the embodiment of the present application, and the access points in the embodiment of the present application are all network devices within the observation range, that is, the access point can be further understood as a network device within the observation range that is closest to the user device.
[0097] The following is a detailed description of the method for obtaining the device access location in the embodiment of the present application with reference to the accompanying drawings. Figure 3 is a flow chart of a method for obtaining the device access location provided in the embodiment of the present application. Referring to Figure 3, the specific steps include but are not limited to steps S301 to S303.
[0098] S301: Receive a mirror message sent by a network device, wherein the mirror message is generated by the network device based on a received data message.
[0099] In an embodiment of the present application, at least one network device in the system can be configured for mirrored messages, so that after receiving a data message, the at least one network device generates a mirrored message based on the data message and sends the generated mirrored message to the device to which the analysis unit belongs. In this embodiment of the present application, the at least one network device configured to send the mirrored message can be referred to as a mirrored message sender.
[0100] In one possible implementation, at least one network device serving as a mirror message sender may be all network devices with a message mirroring function known in the system. In an embodiment of the present application, the known network devices may also be referred to as network devices within the observation range. Furthermore, a network device with a message mirroring function refers to a network device that can encapsulate data messages based on a mirror message protocol. For example, taking Figure 1 as an example, Spine1, Spine2, Leaf1, Leaf2, and Leaf3 in Figure 1 are all pre-configured network devices. In this scenario, the administrator can connect to the management interface provided by each network device through a management device (such as a computer, tablet, or other terminal device) to implement the message mirroring function configuration for each network device, so that the above-mentioned network device serves as a mirror message sender. To give another example, as described above, at least one network device is all network devices known in the system, and the system may also include some private ones, which can also be understood as network devices that are not within the observation range. Taking the structural diagram of the system shown in Figure 4 as an example, in Figure 4, Leaf4 is connected to Spine1, Spine2 and the firewall (other network devices can be connected to the other side of the firewall), Router X is connected to Leaf3, and Router X is connected to multiple servers (for example, server 41 to server 4n) (for descriptions of other devices, please refer to Figure 1 and will not be repeated here). In this example, the firewall and Router X are both network devices that are not within the observation range. It can be understood that the operation and maintenance personnel cannot manage and configure Router X and the firewall. Optionally, Router X can also be called a network device on the user side. Since Router X is an unknown network device (that is, a network device that is not within the observation range), the management personnel have not configured the message mirroring function for it. Accordingly, Router X will not generate a mirror message after receiving the data message.
[0101] It should be noted that the mirrored messages described in the embodiments of the present application refer to mirrored messages having the specified characteristics described in the embodiments of the present application. In other embodiments, router X may also implement mirrored message configuration, but the mirrored messages it sends are mirrored messages that meet the requirements of other scenarios and are not the mirrored messages described in the embodiments of the present application (which can also be understood as mirrored messages that can be used to locate user devices).
[0102] It should be further noted that, as mentioned above, since some unknown network devices may exist in the network, the "non-network devices" described in the embodiments of the present application can be understood as network devices that are not within the observation range. For example, the device may be a user device or an unknown network device.
[0103] In another possible implementation, at least one network device serving as a mirror message sender may be a designated network device in the system. Optionally, the designated network device may be a network device having a port of a user-side port type. In an embodiment of the present application, the ports of the network device may be divided into a user-side port type and a network-side port type. Among them, the neighboring device connected to the port of the network-side port type is the network device within the observation range described above. The neighboring device connected to the port of the user-side port type is a device not within the observation range. Among them, the device not within the observation range may be a user device, or may be a network device not within the observation range, such as the firewall and router X in Figure 4, which are network devices not within the observation range, and may also be referred to as unknown network devices. That is, in this example, the network device having a port of the user-side port type is configured as a mirror message sender.
[0104] Specifically, in an embodiment of the present application, the analysis unit can obtain the identification of each network device within the observation range of the system. The identification of the network device includes but is not limited to at least one of the following: the ID of the network device, the MAC address of the network device, the IP address of the network device, the management address of the network device, etc., which is not limited in this application. The identification of each network device obtained by the analysis unit can be pre-configured by the management personnel. For example, taking Figure 1 as an example, the analysis unit pre-saves a list of network device identifications (in the embodiment of the present application, a list is used as an example, and in other embodiments, other forms may also be used, which is not limited in this application). The list includes the identifications of all known network devices in the system. For example, the network device identification list includes but is not limited to: the identification of Spine1, the identification of Spine2, the identification of Leaf1, the identification of Leaf2, and the identification of Leaf3. That is, Spine1, Spine2, Leaf1, Leaf2, and Leaf3 have all confirmed that their device types are network devices, that is, they are network devices within the observation range.
[0105] Exemplarily, the analysis unit may collect neighbor information from each network device within the observation range. Specifically, each network device obtains its own LLDP information based on the Link Layer Discovery Protocol (LLDP). LLDP information includes, but is not limited to: a local port identifier (i.e., the port identifier of the port used by this network device to connect to the neighboring device), a peer device identifier (i.e., the identifier of the neighboring device to which this network device is connected), and a peer device port identifier (i.e., the interface identifier of the neighboring device connected to this network device).
[0106] Optionally, each network device can periodically send LLDP messages to neighboring devices. LLDP messages include, but are not limited to, the device's identifier, port identifier (i.e., the identifier of the port sending the LLDP message), and message type. Each network device can update its stored LLDP information based on the received LLDP messages.
[0107] Optionally, when the local configuration of a network device changes (for example, a device connected to a port is disconnected, or a new device is connected to a port), the sending of LLDP messages will also be triggered to notify neighboring devices of the change in the local configuration.
[0108] For example, using Leaf 1 in Figure 4 as an example, Leaf 1 can receive LLDP packets from neighboring devices (including but not limited to Servers 11 through 1n, Spine 1, and Spine 2 in Figure 4). The LLDP packets sent by each neighboring device include but are not limited to information such as the source address, destination address, and packet type. The source address includes but is not limited to the MAC address of the source device (i.e., the sender of the LLDP packet) and the MAC address of the source port (i.e., the port sending the LLDP packet).
[0109] Assume that Leaf1 receives an LLDP message sent by Spine1 from port 13. The LLDP message includes but is not limited to: source MAC address (i.e., the MAC address of Spine1 and the MAC address of the port where Spine1 and Leaf1 are connected (for example, port 31)), destination address (i.e., multicast address), etc. Leaf1 parses the LLDP message and obtains information such as the neighbor device identifier (i.e., the MAC address of Spine1) and the neighbor device interface identifier (for example, the MAC address of port 31 of Spine1). It should be noted that for Leaf1, it only obtains the relevant identifiers of the neighbor device (including device identifiers and interface identifiers, etc.) through the LLDP message, and it cannot confirm the specific objects to which these identifiers correspond in the communication system.
[0110] Exemplarily, Leaf1 stores the LLDP information corresponding to port 13, which includes but is not limited to: the MAC address of Spine1 (i.e., the identifier of the neighboring device), the MAC address of port 13 of Leaf1 (i.e., the port identifier of the network device), and the MAC address of port 31 of Spine1 (i.e., the port identifier of the neighboring device), etc. The LLDP information is used to indicate that the neighboring device connected to port 13 of Leaf1 is port 31 of Spine1. In the embodiment of the present application, the identifier of the port is taken as an example for explanation. In other embodiments, the identifier of the port can also be a port identifier (Identifier, ID), etc. This application does not limit this and will not be repeated below. For example, in some examples, the port of a network device may not have a MAC address, but may have a corresponding port ID. Accordingly, the port identifier carried in the LLDP message sent by the network device is the port ID.
[0111] Exemplarily, the analysis unit sends a neighbor information request to each network device within the observation range during the initialization phase (for example, after the device is powered on) to request neighbor information. Optionally, the analysis unit communicates with other devices in the system based on the Simple Network Management Protocol (SNMP) or the Telecommunication Network Protocol (Telnet) to obtain neighbor information. In response to the received neighbor information request, each network device within the observation range sends a response message to the analysis unit to feedback the neighbor information. The response message includes but is not limited to: the identifier of the network device (i.e., the sender of the neighbor information response) and the LLDP information most recently obtained by the network device. Among them, the LLDP information includes but is not limited to: the port identifier of the network device, the identifier of the neighbor device, the port identifier of the neighbor device, etc.
[0112] The analyzing unit updates the locally stored neighbor information of each network device in response to the neighbor information response message received from each network device. The neighbor information includes but is not limited to: the identifier of the network device, the port identifier of the network device, the identifier of the neighbor device, and the port identifier of the neighbor device.
[0113] Optionally, the LLDP information stored by each network device may include the LLDP information corresponding to all ports (including empty ports, i.e., ports not connected to neighboring devices). Optionally, the LLDP information stored by each network device may also only include the LLDP information corresponding to ports connected to neighboring devices, i.e., LLDP information such as the MAC address of empty ports is not included. Accordingly, the neighbor information obtained by the analysis unit may include the neighbor information of all ports of the network device, or may only include the neighbor information corresponding to ports connected to neighboring devices, which is not limited in this application.
[0114] Optionally, the analysis unit may periodically (the periodic duration may be set according to actual needs and is not limited in this application) send neighbor requests to each network device to obtain neighbor information of each network device. Optionally, as described above, each network device may trigger the sending of LLDP messages when the local configuration changes. Accordingly, when the network device detects a change in local LLDP information, it may send a neighbor information update indication to the analysis unit. The indication may include the identifier of the network device, the port identifier of the network device, the identifier of the neighbor device, the port identifier of the neighbor device, etc. The analysis unit may update the neighbor information of the corresponding network device based on the received neighbor information update indication.
[0115] Optionally, when a device (including a network device and a user device) detects a change in LLDP information, the neighbor information update indication sent may only include the neighbor information corresponding to the changed port and / or neighbor device. For example, if Leaf1 detects that the neighbor device of port 13 is disconnected, Leaf1 updates the local LLDP information, wherein port 13 in the LLDP information is an empty port, that is, no neighbor device is connected. Leaf1 sends a neighbor information update indication to the analysis unit, and the update indication includes the identifier of Leaf1 (that is, the MAC address of Leaf1) and the identifier of port 13 (for example, the MAC address of port 13), which is used to indicate that port 13 of Leaf1 is an empty port, that is, no neighbor device is connected. The analysis unit can find the neighbor information corresponding to Leaf1 based on the MAC address of Leaf1, and match it in the neighbor information corresponding to Leaf1 based on the MAC address of port 13. Analysis unit 1 updates the neighbor information corresponding to the MAC address of port 13 that has been successfully matched. For example, the identifier of the neighbor device corresponding to the original MAC address of port 13 (for example, the MAC address of Spine1) is deleted to indicate that port 13 is currently an empty port and is not connected to any neighbor device.
[0116] Optionally, the neighbor information update indication may also include current neighbor information of all ports or ports connected to neighbor devices.
[0117] In a possible implementation, the user equipment in the system may have the function of sending LLDP messages and maintaining LLDP information, or may not have the function of sending LLDP messages and maintaining LLDP information, which is not limited in this application.
[0118] In an embodiment of the present application, as described above, the analysis unit maintains a list of network device identifiers. The network device identifier list (in the embodiment of the present application, a list is used as an example, and in other embodiments, other forms may also be used, which is not limited by the present application) stores the identifiers of all network devices within the observation range. The identifiers of network devices include but are not limited to: the IP address of the network device, the MAC address of the network device, the management address of the network device, etc. The analysis unit determines the port type of the port of each network device based on the obtained neighbor information of each network device and the network device identifier list. Among them, the port type includes the user-side port type and the network device-side port type.
[0119] In one example, if the identifier of the neighbor device connected to the port of the network device is in the network device identifier list, that is, the type of the neighbor device connected to the port is a network device (also called a network device type), it can also be understood that the neighbor device connected to the port is a network device within the observation range. Accordingly, the port type of the port is a network device side port type.
[0120] In another example, if the identifier of the neighbor device to which the port of the network device is connected is not included in the network device identifier list, that is, the type of the neighbor device to which the port is connected is a non-network device, for example, it can be a user device or an unknown network device (that is, a network device not within the observation range). Accordingly, the port type of the port is a user-side port type. Optionally, the type of a port that is not connected to any device (which can be simply referred to as an empty port) can also be classified as a user-side port type. That is to say, if the neighbor information also includes the identifier of a port that is not connected to a neighbor device, the analysis unit determines it as a user-side port. Optionally, as described above, some user devices do not have the function of sending LLDP messages. Accordingly, the network device will not receive the LLDP messages sent by this type of user device. Accordingly, the LLDP information maintained by the network device does not include relevant information corresponding to the port. Similar to the empty port mentioned above, this type of port is also classified as a user-side port type. That is to say, in an embodiment of the present application, the identifier of the neighbor device to which the port is connected is included in the network device identifier list, and the corresponding port type is a network device. The port types in other situations (including empty ports, neighbor devices are not within the observation range, or LLDP messages cannot be obtained) are all user-side ports.
[0121] Exemplarily, the analysis unit may further determine the network devices that include ports of the user-side port type based on the port type of each network device. The analysis unit may designate this type of network device as a mirror message sender. Accordingly, this type of network device may generate a mirror message upon receiving a data message, and transmit the mirror message to the device to which the access location acquisition unit belongs, thereby reducing the number of mirror message interactions in the system and reducing the communication overhead within the system. In another example, this type of network device may also generate a mirror message upon receiving a data message through a port of the user-side port type, and transmit the mirror message to the device to which the access location acquisition unit belongs, thereby further reducing the number of mirror message interactions in the system and reducing the communication overhead within the system.
[0122] In an embodiment of the present application, after receiving a data packet, at least one network device serving as a mirror message sender copies the data packet, encapsulates the copied data packet into a mirror message, and sends the mirror message to the access location acquisition unit. The network device forwards the data packet to send the data packet to the next device on the transmission path. In one example, in a layer 2 forwarding scenario, the network device on the transmission path only performs transparent transmission of the data packet (i.e., does not change the data packet). In another example, in a layer 3 forwarding scenario, some network devices on the transmission path decapsulate and recapsulate the data packet before forwarding it (for example, changing the MAC address in the data packet).
[0123] In one possible implementation, the data message carried by the mirrored message may include only a portion of the original data message, such as the first 64 bytes or the first 128 bytes of the original data message. This may be configured based on actual needs and is not limited by this application. In other words, after receiving a data message, the network device may copy a portion of the data message and encapsulate the copied portion of the data message into a mirrored message.
[0124] In one possible implementation, the message mirroring function configuration of at least one network device serving as a mirror message sender may include a data message type configuration, which is used to instruct the network device to generate a mirror message when receiving a data message of a specified type, thereby effectively reducing the transmission frequency of the mirror message and reducing communication overhead. Optionally, the data message of the specified type may be a data message carrying transport layer control information or application layer control information. For example, the transport layer control information may include but is not limited to: urgent (URG), acknowledgment (ACK), push (PSH), synchronous (SYN), finish (FIN), reset (RST) and other identification bits in the Transmission Control Protocol (TCP). Application layer control information includes but is not limited to: Packet messages in Quick UDP Internet Connections (QUIC), etc., which are not limited in this application. The specified types of data messages described above are only illustrative examples and can be set according to actual needs, which are not limited in this application.
[0125] Figure 5a is a schematic diagram of the structure of an exemplary data message. Referring to Figure 5a, the data message includes but is not limited to: an Ethernet header field, an IP header field, a data field, and other fields.
[0126] The Ethernet Header fields include, but are not limited to, the destination address field and the source address field. The destination address field carries the MAC address of the destination device (i.e., the receiver of the data packet) (referred to as the destination MAC address), while the source address field carries the MAC address of the source device (i.e., the sender of the data packet) (referred to as the source MAC address).
[0127] The IP Header fields include but are not limited to: a destination address field and a source address field. The destination address field is used to carry the IP address of the destination device (referred to as the destination IP address), and the source address field is used to carry the IP address of the source device (referred to as the source IP address).
[0128] The data field is used to carry data, such as application data or other control information.
[0129] In the embodiments of the present application, for each network device, the sender of the data message may optionally be the previous device on the transmission path of the data message. For example, device A (for example, a user device) generates a data message and sends the data message to device B, and device B forwards the data message to device C. For device B, device A is the sender of the data message. For device C, device B is the sender of the data message. Unless otherwise specified, the sender of the data message described in the embodiments below refers to each sender on the transmission path (including the initial sender, that is, the device indicated by the source IP address in the data message). Correspondingly, the receiver of the data message may optionally be the next device on the transmission path of the data message. For example, device A (for example, a user device) generates a data message and sends the data message to device B, and device B forwards the data message to device C. For device A, device B is the receiver of the data message. For device B, device C is the receiver of the data message. As specifically noted in the figure, the receiving ends of the data messages described in the following embodiments all refer to the receiving ends on the transmission path (including the end receiving end, i.e., the device indicated by the destination IP address in the data message).
[0130] In one possible implementation, in a Layer 2 forwarding scenario, the destination MAC address in the Ethernet Header field is always the MAC address of the last receiving end of the data message, and the source MAC address is always the MAC address of the initial sending end that generates the data message. Similarly, the destination IP in the IP Header field is always the IP address of the last receiving end, and the source IP address is always the IP address of the initial sending end. For example, device A (for example, a user device) generates a data message and sends it to device C through device B. During the data message forwarding process, the addresses (including IP addresses and MAC addresses) in the Ethernet Header field and the IP Header field of the data messages sent or received by each device remain unchanged, the destination address is the MAC address and IP address of device C, and the source address is the MAC address and IP address of device A.
[0131] In another possible implementation, in a Layer 3 forwarding scenario, the network devices on the transmission path decapsulate and recapsulate the data message, for example, re-encapsulate the Layer 2 frame, and accordingly, the source MAC address and destination MAC address in the Layer 2 frame header (i.e., the Ethernet Header field) are updated accordingly. In other words, the source MAC address in the Ethernet Header field of the re-encapsulated data message indicates the network device currently forwarding the data message, and the destination MAC address indicates the next Layer 3 device on the transmission path that receives the data message. The destination IP address in the IP Header field in the data message is always the IP address of the last receiving end, and the source IP address is always the IP address of the initial sending end.
[0132] That is to say, in the embodiment of the present application, the sending end and the receiving end of the data message are divided into two levels, one level is the actual transmission path level, that is, on the actual transmission path, the sending end of the data message described in the embodiment of the present application is the previous device on the data message transmission path, and the receiving end of the data message is the next device on the data message transmission path. The other level is the level based on the MAC address indication in the data message. Optionally, in the second-layer forwarding scenario, the device indicated by the MAC address (including the source MAC address and the destination MAC address) in the data message is the same as the device indicated by the IP address, that is, the sending end indicated by it is the initial sending end, and the receiving end is the last receiving end. In the third-layer forwarding scenario, the device indicated by the MAC address in the data message is different from the device indicated by the IP address, and the device indicated by the MAC address is the same as the sending end and the receiving end on the actual transmission path.
[0133] In the embodiment of the present application, the mirror message is an Encapsulated Remote Switched Port Analyzer (ERSPAN) message of a Layer 3 remote mirror. In other embodiments, the mirror message can also be a message of other protocols that can realize the mirror message function in the embodiment of the present application, and this application does not limit it. Exemplarily, the encapsulation of the ERSPAN message can optionally be General Routing Encapsulation (GRE), the principle of which is to copy the source port message and send it to the destination device through GRE encapsulation. Figure 5b is a schematic diagram of the structure of the mirror message shown as an example. Please refer to Figure 5b. The mirror message includes but is not limited to: IP Header field, GRE Header field, ERSPAN Header field and data field.
[0134] The IP Header field is used to carry the identifiers of the sender and receiver of the mirrored message. The identifier of the sender can optionally be the IP address of the network device that sends the mirrored message. The identifier of the receiver can optionally be the IP address of the device to which the access location acquisition unit belongs.
[0135] The GRE Header field is used to carry information such as version number and flag bit.
[0136] The ERSPAN Header field includes, but is not limited to, a Header field and a SubHeader field. The Header field is 12 bytes long and includes, but is not limited to, a Session ID field, a VLAN field, etc. The SubHeader field can optionally be 8 bytes long and includes, but is not limited to, a Platform ID field and a Platform Specific Info field, etc. In an embodiment of the present application, when the value in the Platform ID field is a preset value, the Platform Specific Info field is used to carry a receiving port identifier. The receiving port identifier is the identifier of the port at which the network device that sends the mirrored message receives the data message. For example, if Leaf 1 receives a data message sent by server 11 through port 11, the receiving port identifier in the mirrored message sent by Leaf 1 is the port identifier of port 11, such as the MAC address of port 11. In other embodiments, the receiving port identifier may also be a port number, etc., which is not limited in this application. In an embodiment of the present application, the receiving port identifier carried in the Platform Specific Info field is taken as the MAC address of the port. In other embodiments, due to the limited length of the Platform Specific Info field, the receiving port identifier may be the INDEX (index) information corresponding to the port. In this example, both the access location acquisition unit and the analysis unit can maintain the correspondence between the INDEX information and the MAC address of the port, so that the MAC address of the corresponding port can be queried through the INDEX information.
[0137] The data field is used to carry data messages. In other words, the original data message is encapsulated in this field.
[0138] In the embodiments of the present application, the encapsulated mirrored message includes an outer message and an inner message. The outer message is the packet header encapsulated using the tunneling protocol of the mirrored message, including but not limited to the IP Header field, the GRE Header field, and the ERSPAN Header field. The inner message includes the data field; in other words, the inner message is the original data message.
[0139] Figure 6a is a schematic diagram of the structure of another data message. Referring to Figure 6a, the data message may be referred to as a tunnel message. In an embodiment of the present application, the tunnel message may comply with the VXLAN protocol. In other embodiments, the tunnel message may comply with other tunnel protocols, which are not limited in this application. For example, the tunnel message may include a tunnel outer message (also referred to as a tunnel message header) and a tunnel inner message (also referred to as an original data message).
[0140] Exemplarily, the tunnel inner layer message is an original data message sent by a user device (eg, VM) and carrying application data (or other control information), including but not limited to: Ethernet Header field, IP Header field, data field and other fields.
[0141] The Ethernet Header fields of the tunnel inner packet include, but are not limited to, the destination address field and the source address field. The destination address field carries the MAC address of the destination device (i.e., the receiver of the data packet) (referred to as the destination MAC address), and the source address field carries the MAC address of the source device (i.e., the sender of the data packet) (referred to as the source MAC address).
[0142] The IP Header fields of the tunnel inner packet include but are not limited to: the destination address field and the source address field. The destination address field is used to carry the IP address of the destination device (referred to as the destination IP address), and the source address field is used to carry the IP address of the source device (referred to as the source IP address).
[0143] The data field is used to carry data, such as application data or other control information.
[0144] Still referring to FIG6a , illustratively, the outer layer message of the tunnel is encapsulated in accordance with the VXLAN tunnel protocol, which includes but is not limited to: an Ethernet Header field, an IP Header field, and a tunnel header field.
[0145] The Ethernet Header field of the tunnel outer message includes: the source MAC address of the tunnel and the destination MAC address of the tunnel. Specifically, during the tunnel message forwarding process, the network device re-encapsulates the tunnel message and updates the Ethernet Header field of the tunnel outer message.
[0146] The IP Header fields of the tunnel outer packet include but are not limited to: the source IP address of the tunnel and the destination IP address of the tunnel.
[0147] The tunnel header field includes but is not limited to some tunnel information, such as a tunnel identifier.
[0148] Figure 6b is a schematic diagram illustrating the structure of a mirrored message. Referring to Figure 6b, the mirrored message includes, but is not limited to, the IP Header field, the GRE Header field, the ERSPAN Header field, and the data field. The data message is carried in the data field of the mirrored message. For a description of the other fields in the mirrored message, refer to Figure 5b and are not further described here.
[0149] In the embodiments of this application, the mirrored message is an ERSPAN Type III message. In other embodiments, the mirrored message can also be a message of another protocol that can implement the mirrored message function of the embodiments of this application, that is, a message type that can encapsulate the original data message and carry interface information. This application does not limit this.
[0150] Exemplarily, an access location acquisition unit receives a mirrored message sent by at least one network device. The device to which the access location acquisition unit belongs determines that the receiving end of the mirrored message is the device itself based on the destination address field in the IP header field of the mirrored message. The device obtains the mirrored message and transmits the mirrored message to the access location acquisition unit for further processing. Based on the mirrored message, the access location acquisition unit obtains information carried in the IP header field, the GRE header field, and the ERSPAN header field of the message.
[0151] In one example, if the information carried in the Platform ID field in the SubHeader field of the ERSPAN Header is a preset value (e.g., 0x7 or 0x0, which can be set based on actual needs and is not limited in this application), the access location acquisition unit can determine that the Platform Specific Info field carries interface information, namely, the port identifier corresponding to the port on which the mirrored message sender received the data message. The access location acquisition unit obtains the interface information and executes S302.
[0152] In another example, if the information carried by the Platf ID field in the SubHeader field in the ERSPAN Header is a non-preset value (for example, 0x7 or 0x0, which can be set according to actual needs and is not limited in this application), then the mirrored message may be a mirrored message required for other scenarios and can be processed in other ways, which is not limited in this application.
[0153] S302: Based on the mirrored message, determine whether the sender of the data message is a user equipment.
[0154] In one example, after the access location acquisition unit receives a mirror message sent by a network device and obtains interface information from the mirror message, the access location unit can determine whether the sender of the data message is a user device based on the receiving port identifier (i.e., interface information) in the mirror message.
[0155] In another example, after the access location acquisition unit receives a mirror message sent by at least one network device and obtains interface information from the mirror message, the access location unit can determine whether the sender of the data message is a user device based on the identifier of the sender in the mirror message (i.e., the source MAC address in the data message).
[0156] The above two judgment methods are described in detail below.
[0157] 1. Based on the receiving port identifier, determine whether the sending end is a user device.
[0158] Method 1:
[0159] The access location acquisition unit determines the port type of the receiving port indicated by the receiving port identifier carried in the mirrored message based on the pre-acquired correspondence between the port identifier and the port type. For example, if the access location acquisition unit determines that the port type of the receiving port is a user-side port type, then the sending end corresponding to the data message received at the receiving port can be determined to be a user device (also understood as a user device type).
[0160] Specifically, in this example, the analysis unit can obtain the neighbor information of each network device. The analysis unit can determine the port type of the port in each network device based on the neighbor information. Exemplarily, the port type includes: user-side port type and network device-side port type. Among them, the type of the neighbor device to which the port is connected is a network device (also referred to as a network device type), which can also be understood as the neighbor device connected to the port is a network device within the observation range. Accordingly, the port type of the port is a network device-side port type. If the neighbor device connected to the port is a network device not within the observation range, the port type of the port is a user-side port type. Optionally, the type of a port that is not connected to any device (which can be simply referred to as an empty port) can also be classified as a user-side port type. The way in which the analysis unit determines the port type can refer to the relevant description in S301 and will not be repeated here.
[0161] The analysis unit may send the analysis results to the access location acquisition unit. In one example, the analysis results include but are not limited to: the identifier of the port of the user-side port type and the identifier of the corresponding network device. Among them, the identifier of the network device may optionally be the IP address of the network device, and the port identifier may optionally be the MAC address of the port (it may also be the port ID, which is not limited in this application). Accordingly, the access location acquisition unit maintains a table of correspondences between network device ports and port types (in the embodiment of this application, a list is used as an example, and in other embodiments, it may also be other forms, which are not limited in this application). The access location acquisition unit may write the identifier of the acquired network device and the port identifier of the corresponding port into the list. That is to say, in this example, each network device identified in the list is a network device with a port of the user-side port type, and the type of each port in the list is a port of the user-side port type. For example, Table 1 is one form of a table of correspondences between network device ports and port types:
[0162] Table 1
[0163] Refer to Table 1. In this table, the network device identifier is the IP address of each network device, and the port identifier is the MAC address corresponding to the port. In this example, network device 1, network device 2, and network device 3 are all network devices with ports of the user-side port type. Among them, the ports of the user-side port type of network device 1 include port 1 and port 2, the ports of the user-side port type of network device 2 include port 3 and port 4, and the ports of the user-side port type of network device 3 include ports 9 to port 11. The above correspondence is only an illustrative example and is not limited in this application.
[0164] In another example, the analysis results include but are not limited to: the identifiers of all network devices within the observation range of the system, the port identifiers of the ports of each network device, and the port type corresponding to each port. The access location acquisition unit can write the received network device identifiers and the corresponding port identifiers and port types into the network device port and port type correspondence table. For example, Table 2 is one form of the network device port and port type correspondence table:
[0165] Table 2
[0166] Refer to Table 2. In this table, the network device identifier is the IP address of each network device, and the port identifier is the MAC address corresponding to the port. In this example, Port 1 and Port 2 of Network Device 1 are both user-side port-type ports. Port 3 and Port 4 of Network Device 1 are both network-device-side port-type ports. Port 1 and Port 2 of Network Device 2 are both user-side port-type ports. Port 3 of Network Device 2 is a network-device-side port-type port. The above correspondence is for illustrative purposes only and is not intended to be limiting in this application.
[0167] In one possible implementation, the operation and maintenance personnel can connect to the interface provided by the analysis unit through a terminal (such as a computer, tablet or mobile phone and other terminal devices), and configure the network device port and port type correspondence table for the analysis unit through the terminal. The analysis unit can obtain the network device port and port type correspondence table configured by the operation and maintenance personnel.
[0168] Exemplarily, the access location acquisition unit receives a mirrored message and decapsulates the mirrored message to obtain information (or parameters) carried by the outer layer of the mirrored message. Specifically, the access location acquisition unit reads the identifier of the mirrored message sender in the IP Header field, as well as the interface information (i.e., the receiving port identifier) carried in the ERSPAN Header. The receiving port identifier is used to indicate the port on which the network device serving as the mirrored message sender receives the data message. The use of the information in the GRE Header field can be referred to in existing technical embodiments and will not be elaborated upon in this application.
[0169] The access location acquisition unit queries the network device port and port type correspondence table based on the mirror message sender identifier and the receiving port identifier in the mirror message to determine the port type corresponding to the receiving port.
[0170] In a possible implementation, if the table of correspondences between network device ports and port types is in the form shown in Table 1, that is, it only includes relevant information of ports of user-side port types (including port identifiers and identifiers of corresponding network devices). In one example, the access location acquisition unit detects, based on the identifier of the mirror message sender and the receiving port identifier, that the receiving port identifier carried by the mirror message is not included in the table of correspondences between network device ports and port types, and can determine that the port indicated by the receiving port identifier is a port of the network device side port type, that is, a port of a non-user-side port type. In another example, the access location acquisition unit detects, based on the identifier of the mirror message sender and the receiving port identifier, that the receiving port identifier carried by the mirror message is included in the table of correspondences between network device ports and port types, and can determine that the port indicated by the receiving port identifier is a port of the user-side port type, that is, a port of the network device side port type.
[0171] In another possible implementation, the table of correspondences between network device ports and port types is in the form shown in Table 2, i.e., includes relevant information about ports of user-side port types and relevant information about ports of network device-side port types. Exemplarily, the access location acquisition unit matches each entry in the table of correspondences between network device ports and port types (including the identifier of the network device and the identifier of the port) based on the identifier of the mirrored message sender and the identifier of the receiving port, and obtains the port type corresponding to the successfully matched receiving port identifier to determine the port type corresponding to the port indicated by the receiving port identifier.
[0172] Exemplarily, the access location unit may further determine, based on the port type of the receiving port, whether the sending end corresponding to the data message received based on the receiving port is a user equipment.
[0173] In one example, the access location acquisition unit determines that the port indicated by the receiving port identifier is a port of the user side port type, then it can be further determined that the sending end corresponding to the data message received by the port indicated by the receiving port identifier is a user device, which can also be understood as the type of the device is a user device type, or a non-network device type.
[0174] In another example, the access location acquisition unit determines that the port indicated by the receiving port identifier is a port of the network device side port type, then it can be further determined that the sending end corresponding to the data packet received by the port indicated by the receiving port identifier is a network device, which can also be understood as the type of the device is a network device type, or a non-user device type.
[0175] Method 2:
[0176] In the embodiment of the present application, as described above, at least one network device serving as the mirrored message sender is a designated network device within the system. Specifically, the analysis unit may designate at least one network device having a port of the user-side port type as the mirrored message sender. In other words, in this example, only network devices with ports of the user-side port type will send mirrored messages to the access location acquisition unit after receiving data packets through these ports. Accordingly, upon receiving the mirrored message, the access location acquisition unit can determine that the sender corresponding to the data packet in the mirrored message is a user device, i.e., that the device type is a user device type.
[0177] Alternatively, at least one network device serving as a mirrored message sender may be configured to receive data messages through any port. In this example, the process may be performed in accordance with Method 1. That is, it is still necessary to first determine the type of the receiving port receiving the data message and then further identify whether it is a user device.
[0178] In one possible implementation, the access location acquisition unit periodically executes the process shown in FIG3 , for example, with a period of 1 second, which can be set based on actual needs and is not limited in this application. That is, if the access location acquisition unit receives one or more mirrored messages within 1 second, it can execute S302 and S303 on the received mirrored messages.
[0179] In this way, in the embodiments of the present application, by extending the mirrored message, the mirrored message can carry a receiving port identifier. Based on the receiving port, the device can determine whether the transmitting end connected to the receiving port is a user device. This provides an identification solution suitable for Layer 2 and Layer 3 data message forwarding scenarios, enabling accurate positioning of the user device's access device, thereby obtaining the user device's access location.
[0180] 2. Based on the identifier of the sender of the data message, determine whether the sender is a user equipment.
[0181] Exemplarily, the access location acquisition unit receives multiple mirror messages. The mirror messages may come from one or more network devices. For example, multiple mirror messages may be sent by network device A, wherein the sending end corresponding to the data message in each mirror message may be the same or different, that is, network device A may be a plurality of mirror messages generated based on data messages sent by one or more devices. Network device A may also be a plurality of mirror messages generated based on multiple data messages sent by a device. For another example, multiple mirror messages come from network device A and network device B respectively. Similarly, the mirror message sent by network device A may be generated based on data messages sent by one or more devices. Network device B is similar and will not be repeated here.
[0182] For example, the access location acquisition unit may periodically process the received multiple mirrored messages. For example, the period may be 1 second, which may be set according to actual needs and is not limited in this application.
[0183] The access location acquisition unit groups multiple mirror messages based on the sender identifier carried in each mirror message. Mirror messages with the same sender identifier are grouped into the same group. Specifically, the access location acquisition unit reads the source IP address of the IP Header field in the inner message (i.e., data message) in each mirror message, and groups mirror messages with the same source IP address into the same group. This can be understood as the inner messages (i.e., data messages) of the mirror messages in each group all come from the same initial sender (i.e., the device identified by the source IP address).
[0184] Next, the access location acquisition unit filters the mirror messages of each group based on the sender identifier of the inner message of the mirror message. Specifically, the access location acquisition unit reads the source MAC address in the Ethernet Header field in the data message of each mirror message in the group, and the access location acquisition unit matches the source MAC address in each mirror message with the network device identification list (the list includes the identifiers of all network devices within the observation range). The access location acquisition unit filters out the mirror messages that have successfully matched. That is to say, if the source MAC address in the mirror message is in the network device identification list, that is, the sender of the inner message (that is, the data message) in these mirror messages is a network device within the observation range, then the access location acquisition unit filters out this type of mirror message. The access location acquisition unit performs the next step of processing on the mirror message whose source MAC address in the group does not belong to the network device identification list, that is, the mirror message whose sender of the inner message is a network device that is not within the observation range.
[0185] Exemplarily, the access location acquisition unit reads the network device identifier of each filtered mirrored message to determine whether each mirrored message originates from the same network device. Specifically, the access location acquisition unit reads the source IP address in the IP Header field of the outer layer of each filtered mirrored message. As described above, the source IP address indicates the sender of the mirrored message (the sender is a network device within the observation range). The access location acquisition unit detects whether the source IP address in the outer layer of each mirrored message is the same.
[0186] For example, if the source IP addresses in the outer packets are the same, the access location acquisition unit can determine that these mirrored packets (i.e., one or more filtered mirrored packets) come from the same sender (i.e., the same network device). Accordingly, the access location acquisition unit determines that the sender corresponding to the data packets of the filtered mirrored packets is the user device, and the sender of these mirrored packets is the access point of the user device. Thus, in this embodiment of the present application, the characteristics of the mirrored packets are utilized to obtain the actual sender of the data packets, and further determine the type of the sender based on the identifier of the sender.
[0187] In an embodiment of the present application, two judgment methods, namely "judging whether the sender is a user device based on the receiving port identifier" and "judging whether the sender is a user device based on the identifier of the sender of the data message", can be selected and executed independently to determine the role type of the sender of the data message (i.e., user device or network device).
[0188] In a possible implementation, the two judgment methods described above, namely, "judging whether the sender is a user device based on the receiving port identifier" and "judging whether the sender is a user device based on the identifier of the sender of the data message", can be executed asynchronously, that is, they can be understood as being executed in parallel, thereby improving the accuracy of access location positioning. For example, the access location acquisition unit can execute the above two judgment methods in parallel for multiple mirror messages acquired within the current cycle at the triggering moment of each cycle (for example, 1s). In one example, if the method of "judging whether the sender is a user device based on the receiving port identifier" determines that the sender of the data message is a user device, and the method of "judging whether the sender is a user device based on the identifier of the sender of the data message" determines that the sender of the data message is a network device (that is, not a user device), then the access location acquisition unit can determine that the sender of the data message is a network device. Specific examples will be described in the embodiments below. In another example, if the method of "determining whether the sender is a user device based on the identifier of the sender of the data message" determines that there are multiple access locations, the access location acquisition unit can further combine the judgment result of the method of "determining whether the sender is a user device based on the identifier of the sender of the data message" to determine the access location of the user device.
[0189] S303: If the sending end is a user equipment, obtain the access location of the user equipment.
[0190] Exemplarily, after the access location acquisition unit determines that the sender of the data message is the user equipment, it can determine that the sender of the mirror message to which the data message belongs is the access point of the user equipment, and the connection interface between the access point and the user equipment is the access port of the user equipment.
[0191] Illustratively, after determining the access point, the access location acquisition unit reads a mirrored message from the access point (specifically, the mirrored message involved in the determination step S302) to obtain the access location information of the user device. The access location information includes, but is not limited to, a user device identifier, an access point identifier, and an access point identifier (i.e., a connection interface between the access point and the user device).
[0192] Specifically, the access location acquisition unit reads the source IP address from the IP Header field of the outer layer of the mirrored message (the mirrored message from the access point). This IP address identifies the network device accessed by the user device and can also be understood as the identifier of the user device's access point. The access location acquisition unit also reads the source IP address from the IP Header field of the inner layer of the mirrored message. This IP address identifies the user device. Furthermore, the access location acquisition unit reads the interface information (i.e., the receiving port identifier) from the ERSPAN Header field of the outer layer of the mirrored message, which is the access point identifier.
[0193] Exemplarily, the access location acquisition unit stores the access location information of the user device in the access location storage unit. Specifically, the access location storage unit may maintain an access location information list (other storage formats are also possible, and this application does not limit this). The list includes one or more entries, each of which is used to store the access location information of the user device. The entry includes, but is not limited to, a user device identifier, an access point identifier, and an access portal identifier.
[0194] The access location acquisition unit queries the access location information list based on the identifier of the user device. In one possible implementation, the access location acquisition unit detects that the identifier of the user device exists in the access location information list, and the access location acquisition unit further detects whether the saved access location information of the user device (including the access point identifier and the access portal identifier, etc.) is consistent with the access location information of the user device currently acquired. In one example, if the two are consistent, there is no need to write the currently acquired access location information of the user device into the list. In another example, if the two are inconsistent, the access location acquisition unit writes the currently acquired access location information of the user device into the access location information list to update the access location information of the user device. In another possible implementation, the access location acquisition unit detects that the identifier of the user device does not exist in the access location information list, and the access location acquisition unit writes the currently acquired access location information of the user device into the access location information list.
[0195] Optionally, the access location acquisition unit can also write the acquisition time of the currently acquired access location of the user device in the table entry, wherein the acquisition time can be the time when the access location is acquired, or the time when the access location information is saved, which is not limited in this application. In this way, in the subsequent fault location process, the operation and maintenance personnel (or management personnel) can perform fault location and troubleshooting operations based on the changes in the access location of the same user device (including changes in location and time points). It should be noted that the change in the access location of the user device may be the migration of the access location of the user device, for example, the user device previously accessed network device A and then migrated to network device B (that is, after disconnecting from network device A, it accessed network device B).
[0196] The following, in conjunction with the accompanying drawings, describes in detail the application of the access location acquisition method in different application scenarios in the embodiments of the present application. It should be noted that the scenarios shown in the embodiments below (including device connection relationships, device numbers, data message transmission paths, etc.) are only illustrative examples and are not limited in this application.
[0197] Figure 7 is a schematic diagram of an exemplary application scenario. Referring to Figure 7, the system includes but is not limited to: Spine1, Leaf1, Leaf2, and multiple user devices. Among them, the user devices include but are not limited to: server 11, server 12, server 21, and server 22. In this example, port 11 of Leaf1 is connected to port A of server 11, port 12 of Leaf1 is connected to port B of server 12, and port 13 of Leaf1 is connected to port 31 of Spine1. Port 21 of Leaf2 is connected to port C of server 21, port 22 of Leaf2 is connected to port D of server 22, and port 23 of Leaf2 is connected to port 32 of Spine1. Exemplarily, virtual machines such as VM1 and VM2 are deployed on server 12. In this example, an analysis unit, an access location acquisition unit, and an access location storage unit are deployed on server 22.
[0198] Scene 1
[0199] In this scenario, the analysis unit maintains a list of network device identifications, which stores the identifications of all network devices within the observation range (for example, the MAC addresses of the network devices) in the list (in the embodiment of this application, the list is used as an example, and in other embodiments, it may also be in other forms, which is not limited by this application).
[0200] In conjunction with FIG7 , the network device identification list maintained by the analysis unit is shown in Table 3:
[0201] Table 3
[0202] Among them, device identification A is the MAC address and IP address of Spine1, device identification B is the MAC address and IP address of Leaf1, and device identification C is the MAC address and IP address of Leaf2. In the embodiment of this application, only the device identification includes MAC address and IP address as an example for description. In other embodiments, other identifications such as management address and device name may also be included, and this application does not limit them.
[0203] FIG8 is a flow chart showing an exemplary method for obtaining a device access location. Referring to FIG8 , the method specifically includes but is not limited to the following steps:
[0204] S801: The analyzing unit obtains neighbor information of a network device.
[0205] For example, refer to Figure 7. Leaf1, Leaf2, and Spine1 periodically obtain LLDP information. For example, Leaf1's LLDP information includes but is not limited to:
[0206] Port 11 ID - Device ID 11 - Port A ID
[0207] Port 12 ID - Device ID 12 - Port B ID
[0208] Port 13 ID - Device ID A - Port 31 ID
[0209] For example, the identifier of port 11 is the MAC address of port 11 of Leaf 1, the device identifier 11 is the MAC address of server 11, and the identifier of port A is the MAC address of port A of server 11. The corresponding LLDP information indicates that the neighboring device connected to port 11 of Leaf 1 is the device indicated by device identifier 11, and the connected port is port A of the neighboring device.
[0210] For example, the identifier of port 12 is the MAC address of port 12 of Leaf 1, the device identifier 12 is the MAC address of server 12, and the identifier of port B is the MAC address of port B of server 12. The corresponding LLDP information indicates that the neighboring device connected to port 12 of Leaf 1 is the device indicated by device identifier 12, and the connected port is port B of the neighboring device.
[0211] For example, the identifier of port 13 is the MAC address of port 13 of Leaf 1, the device identifier A is the MAC address of Spine 1, and the identifier of port 31 is the MAC address of port 31 of Spine 1. The corresponding LLDP information indicates that the neighboring device connected to port 13 of Leaf 1 is the device indicated by device identifier A, and the connected port is port 31 of the neighboring device.
[0212] Leaf2's LLDP information includes but is not limited to the following:
[0213] Port 21 ID - Device ID 21 - Port A ID
[0214] Port 22 ID - Device ID 22 - Port B ID
[0215] Port 23 ID - Device ID A - Port 32 ID
[0216] The description of Leaf2's LLDP information is similar to that of Leaf1, and is not repeated here.
[0217] Spine1's LLDP information includes but is not limited to:
[0218] Port 31 ID - Device ID B - Port 13 ID
[0219] Port 32 ID - Device ID C - Port 23 ID
[0220] For example, the identifier of port 31 is the MAC address of port 31 of Spine 1, the device identifier B is the MAC address of Leaf 1, and the identifier of port 13 is the MAC address of port 13 of Leaf 1. The corresponding LLDP information indicates that the neighboring device connected to port 31 of Spine 1 is the device indicated by device identifier B, and the connected port is port 13 of the neighboring device.
[0221] For example, the identifier of port 32 is the MAC address of port 32 of Spine1, the device identifier C is the MAC address of Leaf2, and the identifier of port 23 is the MAC address of port 23 of Leaf2. The corresponding LLDP information indicates that the neighboring device connected to port 32 of Spine1 is the device indicated by device identifier C, and the connected port is port 23 of the neighboring device.
[0222] Exemplarily, the analysis unit sends a neighbor information request message to each network device in the system, instructing to feedback neighbor information. The analysis unit may receive neighbor information 1 fed back by Leaf1, neighbor information 2 fed back by Leaf2, and neighbor information 3 fed back by Spine1.
[0223] Neighbor information 1 includes, but is not limited to, Leaf 1's identifier (i.e., Leaf 1's MAC address) and Leaf 1's LLDP information. Neighbor information 2 includes, but is not limited to, Leaf 2's identifier (i.e., Leaf 2's MAC address) and Leaf 2's LLDP information. Neighbor information 3 includes, but is not limited to, Spin 1's identifier (i.e., Spin 1's MAC address) and Spine 1's LLDP information.
[0224] S802: The analyzing unit determines the interface role based on the neighbor information.
[0225] Exemplarily, the analyzing unit identifies the port type (ie, interface role) of each port of the network device based on the network device identification list and the received neighbor information.
[0226] For example, taking Leaf1 as an example, the analysis unit queries the network device identification list (for example, as shown in Table 3) based on the neighbor information corresponding to Leaf1. The analysis unit detects that the identification of the neighbor device connected to port 11 of Leaf1 (i.e., device identification 11) and the identification of the neighbor device connected to port 12 of Leaf1 (i.e., device identification 12) are not included in the network device identification list. The analysis unit determines that the devices connected to port 11 and port 12 of Leaf1 are network devices that are not within the observation range. Accordingly, the analysis unit determines that the port types of port 11 and port 12 of Leaf1 are user-side type ports. The analysis unit detects that the identification of the neighbor device connected to port 13 of Leaf1 (i.e., device identification A) is included in the network device identification list. The analysis unit determines that the device connected to port 13 of Leaf1 is a network device within the observation range, and further determines that port 13 of Leaf1 is a network device side type port.
[0227] Similar to Leaf1, the analysis unit obtains the interface roles of the ports on Leaf2 and Spine1. For example, this includes but is not limited to: Ports 21 and 22 of Leaf2 are user-side ports, and Port 23 of Leaf2 is a network device-side port. Ports 31 and 32 of Spine1 are network device-side ports. The specific identification method can be found in the same way as for Leaf1 and will not be detailed here.
[0228] The analyzing unit sends the identifier of the port of the user-side port type and the identifier of the corresponding network device to the access location acquisition unit. The access location acquisition unit maintains a correspondence table between network device ports and port types, and updates the received network device identifier and port identifier to the correspondence table between network device ports and port types.
[0229] Specifically, as described above, the identifier of the network device maintained by the analysis unit may include but is not limited to the IP address of the network device, the MAC address of the network device, and the management address of the network device. In an embodiment of the present application, the analysis unit may send the identifier required by the access location acquisition unit to the access location acquisition unit. For example, in this instance, the device identifier sent by the analysis unit to the access location acquisition unit is the IP address of the network device. After the analysis unit determines that the network device has a port of the user-side port type, it can search for the IP address corresponding to the network device in the network device identifier list, and send the IP address of the network device found and the identifier of the port of the corresponding user-side port type (for example, the MAC address of the port) to the access location acquisition unit. Optionally, as described above, the interface information carried by the mirrored message may be the INDEX information of the receiving port. In this example, the analysis unit may also obtain the INDEX information corresponding to each port, and send the INDEX information and MAC address of the port to the access location acquisition unit. Optionally, the INDEX information may be requested by the analysis unit from the network device, or configured by the management personnel, and this application does not limit it. Optionally, the INDEX information can also be obtained by the access location acquisition unit sending a request message to the network device indicated by the source IP address of the outer message of the mirror message after receiving the mirror message and reading the INDEX information in the interface information, and based on the response message fed back by the network device (the response message carries the MAC address of the port corresponding to the INDEX information). This application does not limit this.
[0230] Correspondingly, the access location acquisition unit writes the acquired network device identifier and port identifier into the network device port and port type correspondence table, such as shown in Table 4:
[0231] Table 4
[0232] Among them, the device identifier B in Table 4 is the IP address of Leaf1, and the device identifier C is the IP address of Leaf2. Table item 1 (i.e., serial number 1) in the relationship table is used to indicate that port 11 of the network device indicated by device identifier B is a user-side port type. Table item 2 is used to indicate that port 12 of the network device indicated by device identifier B is a user-side port type. Table item 3 is used to indicate that port 21 of the network device indicated by device identifier C is a user-side port type. Table item 4 is used to indicate that port 22 of the network device indicated by device identifier C is a user-side port type. Optionally, the network device port and port type correspondence table can also be in the form of Table 2, which is not limited in this application.
[0233] S803: The access location acquisition unit acquires the mirrored message.
[0234] The following describes the transmission method of mirrored messages using a specific transmission scenario as an example. Figure 9a is a schematic diagram of an exemplary mirrored message transmission process. Please refer to Figure 9a. In this scenario, the three-layer forwarding scenario of data messages is used as an example for explanation. Specifically, server 11 sends a data message to Leaf1 through port A. Leaf1 receives the data message through port 11 and forwards the data message to Spine1 through port 13. Spine1 receives the data message through port 31 and forwards the data message to Leaf2 through port 32. Leaf2 receives the data message through port 23 and sends the data message to server 21 through port 21. Server 21 receives the data message through port C.
[0235] Figure 9b is an exemplary diagram of mirror message transmission. Referring to Figure 9b, in this example, all network devices within the observation range (including Leaf1, Spine1 and Leaf2) have completed the message mirroring function configuration. Accordingly, during the transmission of the data message, after Leaf1, Spine1 and Leaf2 receive the data message, they generate a mirror message based on the data message and send the mirror message to the access location acquisition unit. In this example, the mirror message is an ERSPAN message. Taking Leaf1 as an example, the transmission path of Leaf1's mirror message can optionally be: Port 13 of Leaf1-Port 31 of Spine1-Port 32 of Spine1-Port 23 of Leaf2-Port 22 of Leaf2-Port D of Server 22. The paths of other devices will not be repeated one by one.
[0236] In conjunction with Figures 9a and 9b, Figure 9c is an exemplary diagram illustrating message processing. Referring to Figure 9c, the Ethernet Header field in the data message sent by server 11 carries the destination MAC address (i.e., the MAC address of server 12) and the source MAC address (i.e., the MAC address of server 11). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). The data field carries the data. For example, server 11 is the initial sender of the data message.
[0237] Leaf1 receives the data packet through port 11. Leaf1 re-encapsulates the data packet and forwards the re-encapsulated data packet to Spine1 through port 13, and Leaf1 generates a mirror message based on the data packet. Exemplarily, the Ethernet Header field of the re-encapsulated data packet carries the destination MAC address (i.e., the MAC address of Spine1) and the source MAC address (i.e., the MAC address of Leaf1). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). Exemplarily, for Leaf1, server 11 is the sender of the data packet.
[0238] Exemplarily, the mirror message of Leaf1 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf1). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 11 (i.e., the MAC address of port 11 of Leaf1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf1 based on the data message received by port 11. The inner message is the data field, which carries the data message received by Leaf1.
[0239] Spine1 receives the data packet through port 31. Spine1 re-encapsulates the data packet and forwards the re-encapsulated data packet to Leaf2 through port 32, and Spine1 generates a mirror message based on the data packet. Exemplarily, the Ethernet Header field of the re-encapsulated data packet carries the destination MAC address (i.e., the MAC address of Leaf2) and the source MAC address (i.e., the MAC address of Spine1). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). Exemplarily, for Spine1, Leaf1 is the sender of the data packet.
[0240] Exemplarily, the mirror message of Spine1 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Spine1). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 31 (i.e., the MAC address of port 31 of Spine1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Spine1 based on the data message received by port 31. The inner message is the data field, which carries the data message received by Spine1.
[0241] Leaf2 receives the data packet through port 23. Leaf2 re-encapsulates the data packet and forwards the re-encapsulated data packet to server 21 through port 21, and Leaf2 generates a mirror message based on the data packet. Exemplarily, the Ethernet Header field of the re-encapsulated data packet carries the destination MAC address (i.e., the MAC address of server 21) and the source MAC address (i.e., the MAC address of Leaf2). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). Exemplarily, for Leaf2, Spine1 is the sender of the data packet.
[0242] Exemplarily, the mirror message of Leaf2 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf2). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 23 (i.e., the MAC address of port 23 of Leaf2, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf2 based on the data message received by port 23. The inner message is the data field, which carries the data message received by Leaf2.
[0243] Exemplarily, the access location acquisition unit receives mirrored messages sent by multiple network devices, including the mirrored message of Leaf1, the mirrored message of Spine1, and the mirrored message of Leaf2.
[0244] S804: The access location acquiring unit acquires the access location of the user equipment based on the mirrored message and the interface role.
[0245] Exemplarily, as described above, the access location acquisition unit maintains a table of correspondences between network device ports and port types, wherein the table records port identifiers of ports of user-side port types and identifiers of corresponding network devices. Based on the network device identifier and interface information in the mirrored message, the access location acquisition unit queries the table of correspondences between network device ports and port types to detect whether the receiving port identifier in the interface information is included in the table of correspondences between network device ports and port types, thereby determining whether the sender corresponding to the data message of the single mirrored message is a user device.
[0246] Still referring to Figure 9c, illustratively, the access location acquisition unit obtains the source IP address (i.e., the IP address of Leaf1) in the IP Header field of the mirrored message of Leaf1, and the interface information (i.e., the MAC address of port 11) in the Platform Specific Info field. The access location acquisition unit matches each entry in the network device port and port type correspondence table based on the IP address of Leaf1 and the MAC address of port 11. In this example, the IP address of Leaf1 and the MAC address of port 11 are successfully matched, and the access location acquisition unit determines that port 11 of Leaf1 is a port of the user-side port type. Further, the access location acquisition unit can determine that the neighboring device connected to port 11 of Leaf1 (i.e., the device to which port 11 is connected) is a user device, that is, the sending end corresponding to the data message received by Leaf1 from port 11 is the user device. The access location acquisition unit determines that Leaf1 is the access point of the user device. The access location acquisition unit acquires the source IP address (i.e., the IP address of server 11) in the IP Header field of the inner packet of Leaf 1's mirrored packet, that is, the identifier of the sender corresponding to the data packet received by Leaf 1. The access location acquisition unit acquires the access location information corresponding to server 11, including but not limited to: the IP address of server 11, the identifier of the access point (i.e., the IP address of Leaf 1), and the identifier of the receiving port (i.e., the MAC address of port 11). This access location information is used to indicate that server 11, as a user device, is connected to port 11 of Leaf 1.
[0247] Please continue to refer to Figure 9c. Exemplarily, the access location acquisition unit obtains the source IP address in the IP Header field of the mirror message of Spine1 (i.e., the IP address of Spine1), and the interface information in the Platform Specific Info field (i.e., the MAC address of port 31). The access location acquisition unit matches each entry in the network device port and port type correspondence table based on the IP address of Spine1 and the MAC address of port 31. In this example, the IP address of Spine1 fails to match the MAC address of port 31, and the access location acquisition unit determines that port 31 of Spine1 is a port of the network device side port type. Further, the access location acquisition unit can determine that the sending end (i.e., the device connected to port 31) corresponding to the data packet received by Spine1 from port 31 is a network device.
[0248] Please continue to refer to Figure 9c. Exemplarily, the access location acquisition unit obtains the source IP address in the IP Header field of the mirrored message of Leaf2 (i.e., the IP address of Leaf2), and the interface information in the Platform Specific Info field (i.e., the MAC address of port 23). The access location acquisition unit matches each entry in the network device port and port type correspondence table based on the IP address of Leaf2 and the MAC address of port 23. In this example, the IP address of Leaf2 fails to match the MAC address of port 23, and the access location acquisition unit determines that port 23 of Leaf2 is a port of the network device side port type. Further, the access location acquisition unit can determine that the sending end (i.e., the device connected to port 23) corresponding to the data packet received by Leaf2 from port 23 is a network device.
[0249] In one possible implementation, the access location acquisition unit may first identify an access point based on the received mirrored message. After determining the access point, the access location acquisition unit then reads relevant fields of the mirrored message (i.e., a mirrored message carrying interface information indicating that the port is a user-side port type) from the access point to acquire the access location.
[0250] S805: The access location storage unit stores the access location information of the user equipment.
[0251] Exemplarily, the access location acquisition unit saves the access location information of the server 11 to the access location storage unit. The access location storage unit maintains an access location information list (other storage formats are also possible, and this application does not limit this). The list includes one or more entries, each of which is used to store the access location information of the user device. The entry includes, but is not limited to: a user device identifier, an access point identifier, and a receiving port identifier (i.e., an access point identifier).
[0252] The access location acquisition unit (the execution entity may also be the access location storage unit, which is not limited in this application) queries the access location information list based on the identifier of server 11 (i.e., the IP address of server 11). In one example, if the access location information list does not include the identifier of server 11, that is, the access location information corresponding to server 11 is not saved. Then, the access location acquisition unit saves the access location information of server 11 (including but not limited to: the IP address of server 11, the identifier of the access point (i.e., the IP address of Leaf1) and the receiving port identifier (i.e., the MAC address of port 11)) to the access location information list. In another example, if the access location information list includes the identifier of server 11, that is, the access location information corresponding to server 11 has been saved. The access location acquisition unit detects whether the saved access location information is consistent with the currently acquired access location information. If they are consistent, no update is performed. If they are inconsistent, the access location acquisition unit saves the access location information of server 11 (including but not limited to: the IP address of server 11, the identifier of the access point (i.e., the IP address of Leaf 1), and the receiving port identifier (i.e., the MAC address of port 11)) to the access location information list. Optionally, the access location acquisition unit writes the acquisition time of the access location information (e.g., the time of saving to the access location information list) into the access location information.
[0253] Scene 2
[0254] Still taking the application scenario shown in FIG7 as an example, in this scenario, a Layer 2 forwarding scenario is used as an example for description. The analysis unit and the access location acquisition unit execute S801 to S802. The specific details can be found above and will not be repeated here.
[0255] In S803 , the transmission path of the data message and the transmission method of the mirror message can be referred to FIG9 a and FIG9 b , which will not be described in detail here.
[0256] Figure 10 is a schematic diagram illustrating exemplary message processing. Referring to Figure 10 , the Ethernet Header field in a data message sent by server 11 carries the destination MAC address (i.e., the MAC address of server 12) and the source MAC address (i.e., the MAC address of server 11). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). The data field carries the data. For example, server 11 is the initial sender of the data message.
[0257] Leaf 1 receives the data packet through port 11. Leaf 1 forwards the data packet to Spine 1 through port 13 (also called transparent transmission), and Leaf 1 generates a mirrored message based on the data packet. For example, the data packet forwarded by Leaf 1 is the same as the data packet received (i.e., the data packet sent by server 11). For a detailed description, please refer to the relevant description above and will not be repeated here.
[0258] Exemplarily, the mirror message of Leaf 1 includes an outer message and an inner message. The outer message includes, but is not limited to, an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf 1). The ERSPAN Header includes, but is not limited to, a Header field and a Subheader field. The Platform ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 11 (i.e., the MAC address of port 11 of Leaf 1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf 1 based on the data message received by port 11. The inner message is the data field, which carries the data message received by Leaf 1. Exemplarily, for Leaf 1, server 11 is the sender of the data message.
[0259] Spine1 receives data packets through port 31. Spine1 forwards the data packets to Leaf2 through port 32 (also called transparent transmission). Spine1 also generates a mirrored packet based on the data packets. For example, the data packets forwarded by Spine1 are identical to the data packets received (i.e., the data packets sent by Leaf1). For a detailed description, please refer to the relevant description above and will not be repeated here.
[0260] Exemplarily, the mirror message of Spine1 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Spine1). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 31 (i.e., the MAC address of port 31 of Spine1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Spine1 based on the data message received by port 31. The inner message is the data field, which carries the data message received by Spine1. Exemplarily, for Spine1, Leaf1 is the sender of the data message.
[0261] Leaf2 receives the data packet through port 23. Leaf1 forwards the data packet to server 21 through port 21 (also called transparent transmission), and Leaf2 generates a mirrored message based on the data packet. For example, the data packet forwarded by Leaf2 is the same as the data packet received (i.e., the data packet sent by Spine1). For detailed description, please refer to the relevant description above and will not be repeated here.
[0262] Exemplarily, the mirror message of Leaf2 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf2). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 23 (i.e., the MAC address of port 23 of Leaf2, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf2 based on the data message received by port 23. The inner message is the data field, which carries the data message received by Leaf2. Exemplarily, for Leaf2, Spine1 is the sender of the data message.
[0263] Exemplarily, the access location acquisition unit receives mirrored messages sent by multiple network devices, including the mirrored message of Leaf1, the mirrored message of Spine1, and the mirrored message of Leaf2.
[0264] In this scenario, the mirrored messages of Leaf1, Spine1, and Leaf2 received by the access location acquisition unit are processed in steps S803 to S804. The specific details are the same as those in scenario 1 and are not repeated here.
[0265] Scenario 3
[0266] Still taking the application scenario shown in FIG7 as an example, in this scenario, the analysis unit executes S801 and S802. The specific details of S801 can be referred to the relevant content in scenario 1, which will not be repeated here.
[0267] Exemplarily, during the execution of S802, after determining the interface role based on the neighbor information, the analysis unit may send indication information to the network devices having ports of the user-side port type (e.g., Leaf1 and Leaf2), to instruct Leaf1 to generate a mirror message after receiving a data message through the port of the user-side port type (i.e., port 11 and port), and send the mirror message to the access location acquisition unit, and to instruct Leaf2 to generate a mirror message after receiving a data message through the port of the user-side port type (i.e., port 21 and port 22), and send the mirror message to the access location acquisition unit.
[0268] In S803, if Leaf1 and Leaf2 receive data packets through ports of the user-side port type, corresponding mirrored packets are generated. For example, taking Figure 9c as an example, in this example, unlike the scenario shown in Figure 9c, Leaf1 sends a mirrored packet to the access location acquisition unit, while Spine1 and Leaf2 both receive data packets through ports of the network device-side port type, so there is no need to generate a mirrored packet.
[0269] In S804, the access location acquisition unit receives the mirrored message sent by Leaf 1 and determines that the sender (i.e., server 11) of the inner message (i.e., data message) of the mirrored message sent by Leaf 1 is a user device. Accordingly, Leaf 1 is the access point for the user device. Furthermore, the access location acquisition unit reads Leaf 1's mirrored message to obtain the access location information of server 11 and stores it in the access location storage unit. Any details not described herein are referred to above and will not be repeated here.
[0270] Scene 4
[0271] FIG11 is a flow chart showing an exemplary method for obtaining a device access location. Referring to FIG11 , the method specifically includes but is not limited to the following steps:
[0272] S1101: The analysis unit obtains the MAC address of the network device.
[0273] Exemplarily, the analyzing unit may obtain the identification of each network device in the system, such as the MAC address and IP address of each network device, etc. The following description will only take the MAC address as an example.
[0274] Optionally, the analysis unit may periodically and automatically collect the MAC address of each network device in the system, and / or the management personnel (or operation and maintenance personnel) may configure the MAC address of each network device in the system for the analysis unit through the user interface provided by the analysis unit.
[0275] It should be noted that in this example, the MAC addresses of network devices acquired by the analysis unit include both those within the observation range and those outside the observation range. For example, taking the firewall in Figure 4 as an example, the firewall is a network device outside the observation range. However, the analysis unit can communicate with the network device and thus acquire the MAC address corresponding to the firewall. Of course, the MAC address of the firewall can also be configured by the administrator, and this application does not limit this.
[0276] Still combining with the application scenario shown in FIG7 , in an embodiment of the present application, the analysis unit may maintain a list of network device identifiers. The list may refer to Table 3, and the related description may refer to the related content above, which will not be repeated here.
[0277] Exemplarily, the analysis unit sends the acquired MAC address of the network device to the access location acquisition unit. As described above, the network device identifiers in the network device identifier list may include, but are not limited to, the MAC address of the network device, the IP address of the network device, and the management address of the network device (the list may not include the management addresses of network devices outside the observation range, such as firewalls). In this example, the analysis unit may only send the MAC address to the access location acquisition unit, but of course, other types of identifiers may also be sent, and this application does not limit this.
[0278] S1102: The access location acquisition unit acquires a mirrored message.
[0279] The following describes the transmission method of mirrored messages using a specific transmission scenario as an example. Figure 12 is a schematic diagram of an exemplary mirrored message transmission process. Please refer to Figure 12. In this scenario, the three-layer forwarding scenario of data messages is used as an example for description. Specifically, server 11 sends data message 1 to Leaf 1 through port A. Leaf 1 receives data message 1 through port 11 and forwards data message 1 to Spine 1 through port 13. Spine 1 receives data message 1 through port 31 and forwards data message 1 to Leaf 2 through port 32. Leaf 2 receives data message 1 through port 23 and sends data message 1 to server 21 through port 21. Server 21 receives data message 1 through port C.
[0280] Still referring to Figure 12, server 12 sends data packet 2 to Leaf 1 via port A. Leaf 1 receives data packet 2 via port 12 and forwards it to Spine 1 via port 13. Spine 1 receives data packet 2 via port 31 and forwards it to Leaf 2 via port 32. Leaf 2 receives data packet 2 via port 23 and sends it to server 21 via port 21. Server 21 receives data packet 2 via port C.
[0281] In conjunction with Figure 12, Figure 13 is an exemplary diagram of message processing. Referring to Figure 13, the Ethernet Hear field in the data message 1 sent by the server 11 carries the destination MAC address (i.e., the MAC address of Leaf1) and the source MAC address (i.e., the MAC address of the server 11), the IP Header field carries the destination IP address (i.e., the IP address of the server 21) and the source IP address (i.e., the IP address of the server 11), and the data field carries the data. For example, the server 11 is the initial sender of the data message 1. It should be noted that Figure 12 illustrates the information carried by some fields, and the other fields can be referred to the relevant description in Figure 9c, which will not be repeated here and will not be repeated below.
[0282] Leaf 1 receives data packet 1 through port 11. Leaf 1 re-encapsulates data packet 1 and forwards the re-encapsulated data packet 1 to Spine 1 through port 13. Leaf 1 also generates mirrored data packet 1 based on data packet 1. Exemplarily, the Ethernet Header field of the re-encapsulated data packet 1 carries the destination MAC address (i.e., Spine 1's MAC address) and the source MAC address (i.e., Leaf 1's MAC address). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11).
[0283] Exemplarily, the mirror message 1 of Leaf 1 includes an outer message and an inner message. The outer message includes, but is not limited to, an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf 1). The ERSPAN Header includes, but is not limited to, a Header field and a Subheader field. The Platform ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 11 (i.e., the MAC address of port 11 of Leaf 1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf 1 based on the data message received by port 11. The inner message is the data field, which carries the data message 1 received by Leaf 1. Exemplarily, for Leaf 1, server 11 is the sender of data message 1.
[0284] Spine1 receives data packet 1 through port 31. Spine1 re-encapsulates data packet 1 and forwards the re-encapsulated data packet 1 to Leaf2 through port 32. Spine1 also generates mirrored data packet 3 based on data packet 1. Exemplarily, the Ethernet Header field of the re-encapsulated data packet 1 carries the destination MAC address (i.e., Leaf2's MAC address) and the source MAC address (i.e., Spine1's MAC address). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11).
[0285] Exemplarily, the mirror message 3 of Spine1 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Spine1). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 31 (i.e., the MAC address of port 31 of Spine1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Spine1 based on the data message received by port 31. The inner message is the data field, which carries the data message 1 received by Spine1. Exemplarily, for Spine1, Leaf1 is the sender of data message 1.
[0286] Leaf 2 receives data packet 1 through port 23. Leaf 2 re-encapsulates data packet 1 and forwards the re-encapsulated data packet 1 to server 21 through port 21. Leaf 2 also generates a mirrored message 5 based on data packet 1. Exemplarily, the Ethernet Header field of the re-encapsulated data packet 1 carries the destination MAC address (i.e., the MAC address of server 21) and the source MAC address (i.e., the MAC address of Leaf 2). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). Exemplarily, for Leaf 2, Spine 1 is the sender of data packet 1.
[0287] Exemplarily, the mirror message 5 of Leaf2 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf2). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 23 (i.e., the MAC address of port 23 of Leaf2, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf2 based on the data message 1 received by port 23. The inner message is the data field, which carries the data message 1 received by Leaf2.
[0288] Still referring to Figure 13, the Ethernet Hear field in data packet 2 sent by server 12 carries the destination MAC address (i.e., the MAC address of server Leaf1) and the source MAC address (i.e., the MAC address of server 12), the IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 12), and the data field carries data. For example, server 12 is the initial sender of data packet 2. It should be noted that Figure 12 illustrates the information carried by some fields. For other fields, please refer to the relevant description in Figure 9c, which will not be repeated here and will not be repeated below.
[0289] Leaf1 receives data packet 2 through port 12. Leaf1 re-encapsulates data packet 2 and forwards the re-encapsulated data packet 2 to Spine1 through port 13, and Leaf1 generates mirrored message 2 based on data packet 2. Exemplarily, the Ethernet Header field of the re-encapsulated data packet 2 carries the destination MAC address (i.e., the MAC address of Spine1) and the source MAC address (i.e., the MAC address of Leaf1). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 11). Exemplarily, for Leaf1, server 12 is the sender of data packet 2.
[0290] Exemplarily, the mirror message 2 of Leaf 1 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf 1). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 11 (i.e., the MAC address of port 12 of Leaf 1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf 1 based on the data message 2 received by port 12. The inner message is the data field, which carries the data message 2 received by Leaf 1.
[0291] Spine1 receives data packet 2 through port 31. Spine1 re-encapsulates data packet 2 and forwards the re-encapsulated data packet 2 to Leaf2 through port 32. Spine1 also generates a mirrored message 4 based on data packet 2. Exemplarily, the Ethernet Header field of the re-encapsulated data packet 2 carries the destination MAC address (i.e., Leaf2's MAC address) and the source MAC address (i.e., Spine1's MAC address). The IP Header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 12).
[0292] Exemplarily, the mirror message 4 of Spine1 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Spine1). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 31 (i.e., the MAC address of port 31 of Spine1, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Spine1 based on the data message 2 received by port 31. The inner message is the data field, which carries the data message 2 received by Spine1. Exemplarily, for Spine1, Leaf1 is the sender of data message 2.
[0293] Leaf 2 receives data packet 2 through port 23. Leaf 2 re-encapsulates data packet 2 and forwards it to server 21 through port 21. Leaf 2 also generates mirrored packet 6 based on data packet 2. For example, the Ethernet header field of the re-encapsulated data packet 2 carries the destination MAC address (i.e., the MAC address of server 21) and the source MAC address (i.e., the MAC address of Leaf 2). The IP header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 12).
[0294] Exemplarily, the mirror message 6 of Leaf2 includes an outer message and an inner message. The outer message includes but is not limited to: an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf2). The ERSPAN Header includes but is not limited to: a Header field and a Subheader field. The Platf ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 23 (i.e., the MAC address of port 23 of Leaf2, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf2 based on the data message 2 received by port 23. The inner message is the data field, which carries the data message 2 received by Leaf2. Exemplarily, for Leaf2, Spine1 is the sender of data message 2.
[0295] Exemplarily, the access location acquisition unit receives mirrored messages sent by multiple network devices, including mirrored messages 1 and 2 from Leaf 1, mirrored messages 3 and 4 from Spine 1, and mirrored messages 5 and 5 from Leaf 2. In this example, assuming that these multiple mirrored messages are all received within the same cycle, the access location acquisition unit can determine, at the cycle triggering moment, whether the sender of each data message is a user device based on these multiple mirrored messages.
[0296] S1103: The access location acquisition unit groups the mirrored messages based on the IP addresses of the inner messages.
[0297] For example, please refer to the schematic diagram of the mirror message shown in Figure 14. At the cycle trigger moment, the access location acquisition unit reads the source IP address in the IP address field of the inner message of each mirror message obtained in this cycle, that is, the identifier of the initial sender of the data message.
[0298] The access location acquisition unit groups the mirrored messages based on the source IP addresses of the inner messages of each mirrored message, wherein the mirrored messages with the same source IP address are grouped together.
[0299] For example, still referring to FIG. 13 , in this example, mirrored packets 1, 3, and 5 are all generated based on the same data packet (i.e., data packet 1). Accordingly, the source IP address of the inner packets of mirrored packets 1, 3, and 5 is the same, i.e., the IP address of server 11. The access location acquisition unit groups mirrored packets 1, 3, and 5 into the same group (e.g., mirrored packet group 1).
[0300] Furthermore, mirrored message 2, mirrored message 4, and mirrored message 5 are all generated based on the same data message (i.e., data message 2). Accordingly, the source IP addresses of the inner messages of mirrored message 2, mirrored message 4, and mirrored message 6 are the same, i.e., the IP address of server 12. The access location acquisition unit divides mirrored message 2, mirrored message 4, and mirrored message 6 into the same group (e.g., mirrored message group 2).
[0301] S1104: The access location acquiring unit determines the access location of the user device based on the mirrored message in the group and the MAC address of the network device.
[0302] Exemplarily, still referring to Figure 14, the access location acquisition unit reads the source MAC address (i.e., the identifier of the sender of the data message) in the Ethernet Header field of the mirror message in the same group, and matches the read source MAC address with the MAC address of the network device in the system that the access location acquisition unit has pre-acquired. The access location acquisition unit filters out the mirror messages corresponding to the source MAC addresses that have successfully matched. In other words, the senders corresponding to the data messages of the filtered mirror messages are all network devices. Still taking the scenario in Figure 13 as an example, exemplarily, the access location acquisition unit processes the mirror message group 1 (including mirror message 1, mirror message 3, and mirror message 5), and the access location acquisition unit reads the source MAC address in the Ethernet Header field of mirror message 1 (i.e., the MAC address of server 11), the source MAC address in the Ethernet Header field of mirror message 3 (i.e., the MAC address of Leaf1), and the source MAC address in the Ethernet Header field of mirror message 5 (i.e., the MAC address of Spine1). The access location acquisition unit matches the read source MAC address with the pre-acquired MAC addresses of network devices within the system (as shown in Table 3) to filter out mirrored messages whose source MAC addresses are the MAC addresses of network devices (including network devices within the observation range and network devices outside the observation range). If the source MAC address in the Ethernet Header field of mirrored message 3 and the source MAC address in the Ethernet Header field of mirrored message 5 successfully match, the access location acquisition unit filters out mirrored message 3 and mirrored message 5. If the source MAC address in the Ethernet Header field of mirrored message 1 fails to match, the remaining mirrored messages in mirrored message group 1 after filtering are mirrored message 1.
[0303] Next, referring to Figure 14 , the access location acquisition unit reads the sender identifier of each filtered mirrored message within the group (i.e., the remaining mirrored messages within the group), namely, the source IP address in the IP Header field of the outer message of the mirrored message. The access location acquisition unit detects whether the source IP addresses of each filtered mirrored message within the group are the same, that is, whether the filtered mirrored messages are all sent by the same network device (i.e., the sender).
[0304] Exemplarily, if the source IP addresses of the mirrored messages after filtering within the group are the same, that is, the mirrored messages come from the same network device, the access location acquisition unit reads the relevant fields of the mirrored message to obtain the access location information of the user device. Specifically, the access location acquisition unit reads the source IP address of the inner message of any mirrored message after filtering (that is, the IP address of the sender of the data message (that is, the user device)), the interface information in the ERSPAN Header field of the outer message of the mirrored message (that is, the receiving port identifier of the access point), and the source IP address of the IP Header field of the outer message of the mirrored message (that is, the identifier of the access point). The above information is the access location information of the user device. For example, still referring to Figure 13, in this scenario, the mirrored message after filtering of mirrored message group 1 is mirrored message 1. The access location acquisition unit reads the source IP address of the outer message of mirrored message 1 and determines that it comes from the same network device (that is, Leaf1). Correspondingly, the access location acquisition unit reads the source IP address of the inner message of the mirrored message 1 (i.e., the IP address of the server 11) to obtain the identifier of the user device, and reads the interface information in the ERSPAN Header field of the outer message of the mirrored message 1 (i.e., the MAC address of the port 11 of Leaf 11) to obtain the receiving port identifier (also referred to as the access point identifier) of the access point, and reads the source IP address in the IP Header field of the outer message of the mirrored message 1 (i.e., the IP address of Leaf 1) to obtain the access point identifier.
[0305] The following scenario illustrates an example in which the source IP addresses of mirrored packets after filtering within a group are different.
[0306] In one possible implementation, if the number of mirrored messages after filtering is 1, it can be directly determined that the sender of the data message of the mirrored message is the user device, and the sender of the mirrored message is the access point of the user device. For example, still referring to Figure 13, in this scenario, after filtering the mirrored messages of mirrored message group 1, the remaining mirrored message 1 is mirrored message 1, then the access location acquisition unit can determine that the sender of mirrored message 1 is the access point, and the sender of the data message of mirrored message 1 is the user device. Accordingly, the access location acquisition unit reads the relevant fields of mirrored message 1 to obtain the access location information of the user device (i.e., server 11). The specific details can be referred to above and will not be repeated here.
[0307] Exemplarily, in this scenario, the access location acquisition unit performs the same processing on the mirror message group 2. The specific processing flow can refer to the processing of the mirror message group 1. The access location acquisition unit can obtain that the sender of the data message received by Leaf1 (i.e., server 12) is a user device. The access location acquisition unit obtains the access location information of server 12 by reading the mirror message 2 of Leaf1, including but not limited to: the MAC address of server 12 (i.e., user device identifier), the IP address of Leaf1 (i.e., access point identifier), and the MAC address of port 12 of Leaf1 (i.e., access port identifier).
[0308] In another possible implementation, if the number of mirrored messages received within the period is 1, the process in FIG. 8 and / or FIG. 11 still needs to be executed to determine whether the sender of the data message of the mirrored message is a user device.
[0309] S1105: The access location storing unit stores the access location of the user equipment.
[0310] In the scenario shown in Figure 13, the access location storage unit can store the access location information of server 11 and the access location information of server 12. For specific details, please refer to the relevant steps of the above embodiment and will not be repeated here.
[0311] Scene 5
[0312] In conjunction with Figure 10 (i.e., the Layer 2 forwarding scenario), in this scenario, the access location acquisition method shown in Figure 11 is used. When executing S1104, the access location acquisition unit divides the mirrored messages with the same source IP address of the inner message into one group. For example, the mirrored messages carrying the IP address of server 11 are all divided into the same group. Next, the access location acquisition unit detects the identifier of the sender of the data message of each mirrored message in the group, that is, the source MAC address in the Ethernet Header field of the inner message does not belong to any network device in the system, and it can be determined that the sender of the data message is a non-network device. Further, the access location acquisition unit reads the source IP address of the outer message of each mirrored message in the group, and detects that the source IP address of each mirrored message is different, that is, it points to multiple network devices (including Leaf1, Spine1, and Leaf2). The access location acquisition unit cannot determine which network device is the access point, nor can it determine which specific data message sender is the user device.
[0313] In this example, the analysis unit and the access location acquisition unit may asynchronously execute the access location acquisition process in FIG8 (eg, the process described in scenario 2). Accordingly, the access location may identify the user equipment and the corresponding access location in the layer 2 forwarding scenario shown in FIG10.
[0314] It should be noted that when the process shown in Figure 8 and the process shown in Figure 11 are executed asynchronously, their periodic triggering moments may be the same or different, and this application does not limit this.
[0315] Scene 6
[0316] In embodiments of the present application, a single user device may be connected to two or more network devices. For example, refer to the application scenario shown in FIG15 , where server 12 is connected to port 12 of Leaf 1 and port 24 of Leaf 2. Other connection relationships can be found in FIG12 and will not be further described here.
[0317] In this example, server 11 sends data packet 1. The transmission method for this packet can be found in the description of FIG14 and will not be further described here. Server 12 sends data packet 2. The transmission method for this packet can be found in the description of FIG14 and will not be further described here. Furthermore, server 12 sends data packet 3. Specifically, server 12 sends data packet 3 to Leaf 2 via port E. Leaf 2 receives data packet 3 via port 24 and sends data packet 3 to server 21 via port 21. Server 21 receives data packet 3 via port C.
[0318] Illustratively, the Ethernet Hear field in data packet 3 sent by server 12 carries the destination MAC address (i.e., Leaf 2's MAC address) and the source MAC address (i.e., server 12's MAC address). The IP Header field carries the destination IP address (i.e., server 21's IP address) and the source IP address (i.e., server 12's IP address). The Data field carries the data. Illustratively, server 12 is the initial sender of data packet 3.
[0319] Leaf 2 receives data packet 3 through port 24. Leaf 2 re-encapsulates data packet 3 and forwards it to server 21 through port 21. Leaf 2 also generates mirrored packet 7 based on data packet 3. For example, the Ethernet header field of the re-encapsulated data packet 3 carries the destination MAC address (i.e., the MAC address of server 21) and the source MAC address (i.e., the MAC address of Leaf 2). The IP header field carries the destination IP address (i.e., the IP address of server 21) and the source IP address (i.e., the IP address of server 12).
[0320] Exemplarily, Leaf2's mirror message 7 (not shown in the figure) includes an outer message and an inner message. The outer message includes, but is not limited to, an IP Header field, a GRE Header field, and an ERSPAN Header field. The IP Header field of the outer message includes the destination IP address (i.e., the IP address of server 22) and the source IP address (i.e., the IP address of Leaf2). The ERSPAN Header includes, but is not limited to, a Header field and a Subheader field. The Platform ID field in the Subheader field carries specified information (i.e., 0x7 or 0x0), and the Platform Specific Info field carries the identifier of port 24 (i.e., the MAC address of port 24 of Leaf2, or a port ID, etc., which is not limited in this application), which is used to indicate that the mirror message is generated by Leaf2 based on the data message 3 received by port 24. The inner message is the data field, which carries the data message 3 received by Leaf2. Exemplarily, for Leaf2, server 12 is the sender of data message 3.
[0321] In this scenario, the access location acquisition unit can independently execute the access location acquisition process shown in Figure 8 or Figure 11, or asynchronously execute the access location acquisition process shown in Figure 8 or Figure 11. This example takes the asynchronous execution of the two processes as an example for description.
[0322] Exemplarily, the access location acquisition unit executes the process shown in Figure 8 and can identify that server 11 is a user device, and its access location is port 11 of Leaf1. The specific details can be found above and will not be repeated here. Based on the interface information carried by the mirror message of Leaf1, the access location acquisition unit can determine that Leaf1 receives a data message from a user-side type port (i.e., port 12). Accordingly, it can be determined that the sender of data message 2 (i.e., server 12) is a user device, and the corresponding access location is port 12 of Leaf1. Exemplarily, based on the interface information carried by the mirror message of Leaf2, the access location acquisition unit can determine that Leaf2 receives a data message from a user-side type port (i.e., port 24). Accordingly, it can be determined that the sender of data message 3 (i.e., server 12) is a user device, and the corresponding access location is port 24 of Leaf2. In other words, the access location acquisition unit can identify the two access locations of server 12 in the system.
[0323] Exemplarily, the access location acquisition unit executes the process shown in Figure 11. The access location acquisition unit can obtain the access location information of the server 11. The acquisition method can refer to the above and will not be repeated here. Exemplarily, the access location acquisition unit recognizes that the source IP addresses of the inner messages of mirror message 2, mirror message 4, mirror message 6 and mirror message 7 are the same, that is, they are all the IP addresses of server 12. The access location acquisition unit divides mirror message 2, mirror message 4, mirror message 6 and mirror message 7 into the same group. The access location acquisition unit filters the mirror messages based on the MAC addresses of the inner messages. Among them, the source MAC addresses of the inner messages of mirror message 2 (for a specific description, please refer to the relevant content of Figure 13) and mirror message 7 are both the MAC address of server 12, that is, the source MAC addresses of the inner messages of mirror message 2 (for a specific description, please refer to the relevant content of Figure 13) and mirror message 7 are both indicated as non-network devices. Next, the access location acquisition unit identifies the source IP address of the outer layer of each filtered mirrored message (i.e., mirrored message 2 and mirrored message 7). The access location acquisition unit detects that the source IP address of mirrored message 2 points to Leaf 1 (i.e., Leaf 1's IP address), and the source IP address of mirrored message 7 points to Leaf 2 (i.e., Leaf 2's IP address). That is, the source IP addresses of mirrored message 2 and mirrored message 7 point to different network devices. In other words, mirrored message 2 and mirrored message 7 originate from different senders. The access location acquisition unit determines that there are multiple access points corresponding to server 12. Optionally, the access location acquisition unit may further determine the specific access location of server 12 based on the results obtained in the process of FIG. 8 .
[0324] In one possible implementation, when the processes of FIG. 11 and FIG. 8 are executed asynchronously, the access location acquisition unit may compare the result obtained in FIG. 8 with the result obtained in FIG. 11 . For example, in the scenario shown in FIG. 15 , the access location acquisition unit can obtain the access location of server 11 through the processes shown in FIG. 11 and FIG. 8 , and the obtained results are the same. Then, the access location acquisition unit can determine that the access location of server 11 is interface 11 of Leaf 1 . However, for the access location of server 12 , the result obtained in FIG. 8 is inconsistent with the result obtained in FIG. 11 . In the embodiment of the present application, the case where the results obtained by the processes of FIG. 8 and FIG. 11 are inconsistent may include the case in FIG. 15 , that is, when the process shown in FIG. 11 obtains multiple access locations of the user device, the access location of the user device may be further obtained in combination with the process shown in FIG. 8 . In other embodiments, the case where the results obtained by the processes of FIG. 8 and FIG. 11 are inconsistent may also include the case where FIG. 8 determines that the sender of the data message is a user device, while FIG. 11 determines that the sender of the data message is a non-user device (i.e., a network device). For details, please refer to Scenario 7.
[0325] Scene 7
[0326] FIG16 is a schematic diagram of an exemplary application scenario. Referring to FIG16 , in conjunction with the scenario shown in FIG13 , in the scenario shown in FIG16 , a firewall is provided between Spine 1 and Leaf 2. The data message sent by server 11 is sent to the firewall via Spine 1. The firewall performs security verification and other processing on the data message before sending the data message to Leaf 2. In the embodiment of the present application, the firewall forwards the data message in a transparent manner, i.e., does not change the MAC address in the data message, as an example for explanation. In other embodiments, the firewall may also re-encapsulate the data message, which is not limited in the present application.
[0327] In this scenario, the analyzing unit and the access location acquiring unit may execute the access location acquiring method in FIG. 8 and / or FIG. 11 .
[0328] In one possible implementation, during the process of the analysis unit and the access location acquisition unit executing the access location acquisition method shown in FIG8 , in S801, because the firewall does not send LLDP information in this example, Spine1 cannot obtain the LLDP information corresponding to interface 32. In this example, the neighbor information of Spine1 obtained by the analysis unit includes but is not limited to:
[0329] Port 31 ID - Device ID B - Port 13 ID
[0330] Accordingly, in S802, the analysis unit determines that port 32 is an empty port based on the neighbor information of Spine1, or determines that the neighbor device connected to port 32 is a network device that is not within the observation range. As described above, the identifier of the neighbor device connected to the port does not belong to the port of the network device within the observation range, and its port type is the user-side port type. Accordingly, the analysis unit determines that port 32 of Spine1 is a port of the user-side port type. Similarly, port 23 of Leaf2 is also determined to be a port of the user-side port type. Other undescribed details of S801 to S802 can be referred to above and will not be repeated here.
[0331] 16 , in S803 , the access location acquisition unit may receive mirrored messages sent by Leaf 1 , Spine 1 , and Leaf 2 . Detailed descriptions can be found in Scenario 1 and will not be repeated here.
[0332] It should be noted that, in FIG16 , for Leaf2, the firewall is the sender of the data packets it receives.
[0333] In S804, the access location acquisition unit can determine that Leaf 1 is the access point of server 11 and obtain the access location information of server 11. The specific details can be found above and are not repeated here. Exemplarily, the access location acquisition unit determines that port 23 is a user-side port type port based on the interface information carried by the mirrored message of Leaf 2. Accordingly, the access location acquisition unit can determine that the neighboring device connected to port 23 is a user device, that is, the sender corresponding to the data message received by Leaf 2 through port 23 is a user device.
[0334] Exemplarily, the access location acquisition unit reads the mirror message of Leaf2 and obtains the user device identifier (the source IP address carried by the inner message of the mirror message, i.e., the IP address of server 11), the access point identifier (i.e., the source IP address carried by the outer message of the mirror message, i.e., the IP address of Leaf2), and the receiving port identifier (i.e., the interface information carried by the outer message of the mirror message, i.e., the MAC address of port 23). That is, the access location of server 11 is port 23 of Leaf2. That is, in the scenario shown in FIG16 , the access location acquisition unit detects, by executing the process shown in FIG8 , that the sending end corresponding to the data message received by Leaf1 from port 11 is a user device, and that the sending end corresponding to the data message received by Leaf2 from port 23 is also a user device.
[0335] In another possible implementation, the analysis unit and the access location acquisition unit execute the process shown in Figure 11. After the access location acquisition unit performs the grouping operation (the specific details can be found above and will not be repeated here), based on the source MAC address carried by the inner message in the mirror message of Leaf2 (i.e., the MAC address of Spine1), it determines that the sender of the data message received by Leaf2 is a network device within the observation range, that is, the source MAC address carried by the inner message in the mirror message of Leaf2 is included in the MAC address of the network device in the system pre-acquired by the access location acquisition unit. Accordingly, based on the execution result of the process shown in Figure 11, the access location acquisition unit can determine that the sender corresponding to the data message received by Leaf2 from port 23 is a non-user device. This result is inconsistent with the result after execution of Figure 8. Then, the access location acquisition unit shall be based on the result of execution of Figure 11, that is, it shall determine that the sender corresponding to the data message received by Leaf2 from port 23 (i.e., the firewall) is a non-user device.
[0336] Scene 8
[0337] The access location acquisition method in the embodiments of the present application can also be used in user device migration scenarios. Still taking the scenario shown in FIG. 7 as an example, assuming that server 11 migrates from port 11 of Leaf 1 to port 25 of Leaf 2, server 11 accesses the system through port 25 of Leaf 2 to communicate with other devices in the system.
[0338] In this example, after Server 11 is disconnected from Leaf 1, Leaf 1 sends LLDP information to all network devices in the system, indicating that Leaf 1's port 11 is an empty port. After Server 11 connects to Leaf 2's port 25, Leaf 2 can send LLDP information to all network devices in the system, indicating that Leaf 2's port 25 is connected to Server 11.
[0339] In one possible implementation, the analysis unit executes the process in Figure 8. In one example, Leaf1 and Leaf2 detect an LLDP information update and may send neighbor information update information to the analysis unit. The neighbor information update information of Leaf1 is used to indicate that port 11 is an empty port. The neighbor information update information of Leaf2 includes but is not limited to: the identifier of port 25 (i.e., the MAC address of port 25), the neighbor device identifier (i.e., the MAC address of server 11), and the port identifier of the neighbor device (i.e., port A of server 11). The neighbor information update information of Leaf2 is used to indicate port A of server 11 to which port 25 of Leaf2 is connected. The analysis unit may update the locally stored neighbor information. In another example, the analysis unit may also request neighbor information from each network device in the system at a periodic triggering moment. The analysis unit may update the locally stored neighbor information based on the neighbor information fed back by Leaf1 and Leaf2.
[0340] Exemplarily, the analysis unit may execute S802 to S805 based on the new neighbor information. In this example, the data message from server 11 will be sent to Leaf 2. Leaf 2 receives the data message sent by server 11 through port 25, forwards the data message, and generates and sends a corresponding mirror message based on the data message. Accordingly, when the access location acquisition unit executes S804, it can obtain that the access location of server 11 is port 25 of Leaf 2. Based on the identifier of server 11, the access location acquisition unit can detect that the identifier of server 11 already exists in the access location information list, and that the access location information corresponding to the saved server 11 is different from the currently obtained access location information. Accordingly, the access location acquisition unit can write the newly obtained access location information of server 11 into the access location information list and write the current time (i.e., the time when the access location information was written). In this way, in the troubleshooting scenario, the administrator can obtain the migration status of server 11 (including the migrated access point and the corresponding time).
[0341] In another possible implementation, the analysis unit and the access location unit execute the process in Figure 11. During this process, the MAC addresses of network devices within the observation range maintained by the analysis unit remain unchanged. When executing S1104, the access location acquisition unit may determine the access location of server 11 based on the multiple mirrored messages corresponding to the data message sent by server 11. Specific implementation details can be found in the description of Figure 11 and are not further elaborated here.
[0342] Scene Nine
[0343] The access location acquisition method in the embodiment of the present application can also be applied to scenarios where the user device is a virtual machine. Still taking the scenario in Figure 7 as an example, in this example, VM1 in the server 12 sends the original data message, and the format of the original data message can be referred to the tunnel inner layer message in Figure 6a. The OVS in the server 12 re-encapsulates the original data message of VM1, and the format of the re-encapsulated data message (also referred to as a tunnel message) can be referred to Figure 6a. During the transmission of the data message (i.e., the tunnel message) of the server 12, the network device within the observation range on the transmission path sends a mirror message to the access location acquisition unit, and the format of the mirror message can be referred to Figure 6b.
[0344] In one possible implementation, the access location acquisition unit executes S804 in Figure 8 in response to the received mirror message (S801 to S803 can be referred to above and will not be repeated here). The access location acquisition unit determines whether the sender of the data message is a user device based on the interface information of the mirror message. The specific details are the same as S804 and will not be repeated here. Exemplarily, the access location acquisition unit determines that the sender corresponding to the data message received by Leaf1 is a user device, and can obtain the access location information corresponding to the user device. Specifically, the access location acquisition unit reads the source IP address (i.e., the user device identifier) carried by the tunnel inner message in the inner message (i.e., the tunnel message) of the mirror message of Leaf1, and the source IP address (i.e., the identifier of Leaf1) and the interface information (i.e., the receiving port identifier) carried by the outer message of the mirror message to obtain the access location information corresponding to the corresponding server 11.
[0345] In another possible implementation, the access location acquisition unit executes S1104 in Figure 11 in response to the received mirror message (S1101 to S1103 are the same as in Figure 11 and will not be repeated here). In this step, the access location acquisition unit groups the mirror messages based on the source IP address carried by the inner message of the tunnel message of the inner message (i.e., tunnel message or data message) of each mirror message, that is, the mirror messages with the source IP address of VM1 are divided into the same group. During the transmission of the tunnel message, each network device updates the Ethernet Header in the outer message of the tunnel. Accordingly, the access location acquisition unit can filter the mirror message based on the source MAC address (i.e., the sender identifier of the data message) carried by the outer message of the tunnel in the inner message of the mirror message. The specific filtering method can be referred to above and will not be repeated here. Next, the access location acquisition unit determines the access location of the user device based on the source IP address of the outer layer of the filtered mirrored message (ie, the IP address of the sender of the mirrored message).
[0346] In this way, the access location acquisition method in the embodiment of the present application can be applied to the transmission scenario of tunnel data packets, that is, user devices such as virtual machines that access the system through tunnel protocols can also be accurately located.
[0347] Scene 10
[0348] In the embodiment of the present application, there are some network devices outside the observation range in the system, such as network devices deployed on the user side. Taking the scenario shown in Figure 4 as an example, router X is a network device outside the observation range, that is, a router deployed on the user side.
[0349] In one possible implementation, during the execution of the process shown in Figure 8, the analysis unit obtains the neighbor information of Leaf3 and detects that the identifier of router X does not belong to the network device within the observation range, then it can be determined that the port of Leaf3 connected to router X is a user-side port type. In this example, it is assumed that server 41 sends a data packet to router X, and router X forwards the data packet to Leaf3. Leaf3 forwards the received data packet and generates and sends a mirror message at the same time. The access location acquisition unit can determine that the sender of the data packet received by Leaf3 (here refers to router X) is a user device based on the mirror message of Leaf3. That is, the receiving port corresponding to the data packet of the mirror message of Leaf3 is a user-side port type, and accordingly, the neighbor device connected to the receiving port, that is, the sender of the data packet, is the user device.
[0350] The access location reads the source IP address carried in the inner message of Leaf3's mirror message, where the source IP address is the IP address of server 41. Accordingly, the access location of the user device obtained by reading the relevant fields of the mirror message (see above for specific details) is the access location of server 41. The access location information of server 41 includes but is not limited to: the identifier of server 41, the identifier of Leaf3 (i.e., the access point identifier), and the receiving port identifier (i.e., the identifier of the connection port between Leaf3 and router X). That is to say, in this scenario, the access locations of servers 41 to 4n are the same, and the access points are all Leaf3, and the corresponding access ports are all connection ports between Leaf3 and router X. In this example, it can be understood that router X belongs to the user-side device for the network side. Accordingly, the access locations of servers 41 to 4n can also be understood as the access locations of router X in the system.
[0351] In another possible implementation, in the process of executing the process shown in Figure 11, the data message sent by the server 41 is still taken as an example. The access location acquisition unit divides the mirror messages carrying the IP address of the server 41 in the mirror message into the same group. Then, the access location acquisition unit filters the mirror message based on the source MAC address carried by the inner message of the mirror message in the group. Among them, the source MAC address carried by the inner message of the mirror message of Leaf3 is the MAC address of router X, and the MAC address does not belong to the network device on the network side. The access location acquisition unit can perform subsequent steps on the mirror message corresponding to the MAC address of router X. Similarly, the access location acquisition unit can determine that Leaf3 is the access point of the user device, and obtain the access location information of the user device by reading the relevant fields of the mirror message of Leaf3. Similarly, the access location information of the user device obtained by the access location refers to the access location information corresponding to the server 41 (for specific details, please refer to the above and will not be repeated here).
[0352] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the interaction between various network elements. It can be understood that in order to realize the above functions, the device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0353] The embodiment of the present application can divide the functional modules of the device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.
[0354] FIG17 illustrates a possible structural diagram of an apparatus 1700 involved in the above-described embodiment, where each functional module is divided according to its function. As shown in FIG17 , apparatus 1700 includes, but is not limited to, a receiving unit 1701 and an access location acquisition unit 1702. Receiving unit 1701 is configured to receive a mirrored message sent by a network device. A mirrored message is generated by the network device based on a received data message. The mirrored message includes a network device identifier, a receiving port identifier, and a data message. The data message includes an identifier of the sender of the data message. The receiving port identifier indicates the receiving port of the network device receiving the data message. Access location acquisition unit 1702 is configured to determine, based on the mirrored message, whether the sender of the data message is a user device. Access location acquisition unit 1702 is further configured to, if the sender is determined to be a user device, obtain access location information of the user device. The access location information includes the sender identifier, the network device identifier, and the receiving port identifier.
[0355] In a possible implementation, the access location acquiring unit 1702 is specifically configured to determine whether the sender of the data message is a user equipment based on the receiving port identifier in the mirrored message.
[0356] In a possible implementation, the access location acquiring unit 1702 is specifically configured to determine whether the sender of the data message is a user equipment based on the identifier of the sender in the mirror message.
[0357] In a possible implementation, the port type of the receiving port is a user-side port type.
[0358] In a possible implementation, the access location acquiring unit 1702 is specifically configured to determine, in response to a received mirrored message, that the sender of the data message is a user equipment.
[0359] In one possible implementation, the device also includes an analysis unit 1703, which is used to: determine at least one network device in the network based on first information, the first information including the port identifier and corresponding port type of each network device in the network, the port type including the user-side port type and the network device-side port type, and each network device in at least one network device includes a port of the user-side port type; send indication information to at least one network device, the indication information is used to instruct each network device in at least one network device to generate a mirror message based on the data message received by the port of the user-side interface type of each network device.
[0360] In one possible implementation, the access location acquisition unit 1702 is specifically used to: determine the port type of the receiving port based on the first information and the receiving port identifier, the first information including the port identifier and the corresponding port type of the port of each network device in the network, the port type including the user-side port type and the network device-side port type; if the port type of the receiving port is the user-side port type, determine that the sending end is a user device; if the port type of the receiving port is the network device-side port type, determine that the sending end is a non-user device.
[0361] In one possible implementation, the device also includes an analysis unit 1703, which is specifically used to: obtain second information, the second information includes identifiers of multiple network devices in the network; obtain neighbor information of each network device in the multiple network devices, each neighbor information includes the identifier of the source network device, the source network device port identifier and the identifier of the neighbor device, the source network device is a device that sends neighbor information, the neighbor device is a device physically connected to the source network device, and the source network device port identifier is used to indicate the port of the source network device connected to the neighbor device; based on the second information and the neighbor information, determine the port type of the port of each network device, the identifier of the neighbor device connected to the port whose port type is the network device side port type is included in the second information, and the identifier of the neighbor device connected to the port whose port type is the user side port type is not included in the second information.
[0362] In one possible implementation, the receiving unit 1701 is specifically configured to: receive multiple mirror messages; the multiple mirror messages come from one or more network devices; the identifier of the sender includes the IP address and the MAC address of the sender; the access location acquisition unit 1702 is specifically configured to: if the IP address of the sender carried by N mirror messages in the multiple mirror messages is the same, and the MAC address of the sender carried by the N mirror messages is not included in the second information, and the identifiers of the network devices carried by the N mirror messages indicate the same network device, determine that the sender is a user device, and the second information includes the identifiers of multiple network devices in the network.
[0363] In one possible implementation, the access location acquisition unit 1702 is specifically used to: if the IP addresses of the senders carried by M mirror messages in multiple mirror messages are the same, and the MAC addresses of the senders carried by the M mirror messages are not included in the second information, and the identifiers of the network devices carried by the M mirror messages indicate two or more network devices, determine whether the sender of the data message is a user device based on the receiving port identifier in the mirror message.
[0364] In one possible implementation, the access location acquisition unit 1702 is specifically used to: determine whether the sender of the data message is a user device based on the receiving port identifier and the sender identifier in the mirror message; if the judgment result based on the receiving port identifier indicates that the sender is a user device, and the judgment result based on the sender identifier indicates that the sender is a non-user device, determine that the sender is a non-user device.
[0365] In one possible implementation, the device also includes: an access location storage unit 1704, which is used to query user equipment access information based on the identifier of the sending end, where the user equipment access information includes access location information of at least one user equipment; the access location storage unit 1704 is also used to update the access location information of the user equipment corresponding to the identifier of the sending end in the user equipment access information if the user equipment access information already includes the access location information of the user equipment corresponding to the identifier of the sending end, and the saved access location information is inconsistent with the currently obtained access location information.
[0366] In another example, Figure 18 shows a schematic block diagram of an apparatus 1800 according to an embodiment of the present application. Apparatus 1800 may include a processor 1801 and a transceiver / transceiver pin 1802, and optionally, a memory 1803. Processor 1801 may be configured to execute the steps performed by the analysis unit, access location acquisition unit, and access location storage unit in the methods of the aforementioned embodiments, and to control the receive pin to receive signals and the transmit pin to send signals.
[0367] The various components of device 1800 are coupled together via bus 1804. Bus system 1804 includes not only a data bus but also a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1804 in the figure.
[0368] Optionally, the memory 1803 may be used to store instructions in the aforementioned method embodiment.
[0369] It should be understood that the device 1800 according to the embodiment of the present application may correspond to the analysis unit, access location acquisition unit, access location storage unit and the corresponding server in each method of the aforementioned embodiments, and the above-mentioned and other management operations and / or functions of each element in the device 1800 are respectively for implementing the corresponding steps of each of the aforementioned methods. For the sake of brevity, they will not be repeated here.
[0370] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0371] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes at least one section of code, and the at least one section of code can be executed by a computer to control the computer to implement the above method embodiment.
[0372] Based on the same technical concept, an embodiment of the present application also provides a computer program, which, when executed by a computer, is used to implement the above method embodiment.
[0373] The program may be stored in whole or in part on a storage medium packaged with the processor, or may be stored in whole or in part on a memory not packaged with the processor.
[0374] Based on the same technical concept, the embodiment of the present application further provides a processor, which is used to implement the above method embodiment. The above processor can be a chip.
[0375] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in a hardware manner, or can be implemented by a processor executing a software instruction. The software instruction can be composed of corresponding software modules, and the software module can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disc (CD-ROM) or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0376] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0377] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0378] In the description and claims of the embodiments of this application, the terms "first" and "second" are used to distinguish different objects, rather than to describe a specific order of objects. For example, the terms "first target object" and "second target object" are used to distinguish different objects, rather than to describe a specific order of objects.
[0379] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0380] In the description of the embodiments of this application, unless otherwise specified, "multiple" means two or more. For example, "multiple processing units" means two or more processing units; "multiple systems" means two or more systems.
[0381] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A method for obtaining a device access location, characterized in that: include: Receive a mirrored message sent by a network device; wherein the mirrored message is generated by the network device based on a received data message, the mirrored message includes the data message or part of the data message, and an identifier and a receiving port identifier of the network device, the data message in the mirrored message or part of the data message in the mirrored message includes an identifier of a sender of the data message, and the receiving port identifier is used to indicate a receiving port of the network device for receiving the data message; Based on the mirror message, determining whether the sender of the data message is a user device; If it is determined that the sending end is the user equipment, access location information of the user equipment is acquired, where the access location information includes an identifier of the sending end, an identifier of the network device, and an identifier of the receiving port.
2. The method according to claim 1, characterized in that The determining, based on the mirror message, whether the sender of the data message is a user device includes: Based on the receiving port identifier in the mirrored message, it is determined whether the sender of the data message is a user equipment.
3. The method according to claim 1, characterized in that The determining, based on the mirror message, whether the sender of the data message is a user device includes: Based on the identifier of the sender in the mirror message, it is determined whether the sender of the data message is a user equipment.
4. The method according to claim 1, characterized in that: The port type of the receiving port is a user-side port type.
5. The method according to claim 4, characterized in that The determining, based on the mirror message, whether the sender of the data message is a user device includes: In response to the received mirrored message, it is determined that the sender of the data message is a user equipment.
6. The method according to claim 4, characterized in that Before receiving the mirror message sent by the network device, the method further includes: Determine at least one network device in the network based on first information, wherein the first information includes a port identifier and a corresponding port type of a port of each network device in the network, wherein the port type includes a user-side port type and a network device-side port type, and each network device in the at least one network device includes a port of the user-side port type; Instruction information is sent to the at least one network device, where the instruction information is used to instruct each network device in the at least one network device to generate a mirror message based on a data message received by a port of the user-side interface type of each network device.
7. The method according to claim 2, characterized in that: The determining, based on the receiving port identifier in the mirrored message, whether the sending end of the data message is a user device includes: Determine the port type of the receiving port based on the first information and the receiving port identifier, wherein the first information includes the port identifier and the corresponding port type of the port of each network device in the network, and the port type includes the user side port type and the network device side port type; If the port type of the receiving port is the user-side port type, determining that the sending end is a user equipment; If the port type of the receiving port is a network device side port type, it is determined that the sending end is a non-user device.
8. The method according to claim 6 or 7, characterized in that: Before receiving the mirror message sent by the network device, the method further includes: Acquire second information, where the second information includes identifiers of multiple network devices in the network; Obtaining neighbor information of each network device among the multiple network devices, each piece of neighbor information includes an identifier of a source network device, a source network device port identifier, and an identifier of a neighbor device, the source network device is a device that sends the neighbor information, the neighbor device is a device that is physically connected to the source network device, and the source network device port identifier is used to indicate a port on which the source network device is connected to the neighbor device; Based on the second information and the neighbor information, determine the port type of the port of each network device, the port type being the port type of the network device. The identifier of the neighbor device connected to the port of the backup side port type is included in the second information, and the identifier of the neighbor device connected to the port of the user side port type is not included in the second information.
9. The method according to claim 3, characterized in that: The receiving of the mirror message sent by the network device includes: Receiving a plurality of mirrored messages; the plurality of mirrored messages come from one or more network devices; The identifier of the sender includes an IP address of the sender and a MAC address of the sender, and judging whether the sender of the data message is a user device based on the identifier of the sender in the mirror message includes: If the IP addresses of the senders carried by N of the multiple mirror messages are the same, and the MAC addresses of the senders carried by the N mirror messages are not included in the second information, and the identifiers of the network devices carried by the N mirror messages indicate the same network device, it is determined that the sender is a user device, and the second information includes identifiers of multiple network devices in the network.
10. The method according to claim 9, characterized in that The determining, based on the identifier of the sender in the mirror message, whether the sender of the data message is a user equipment, further includes: If the IP addresses of the senders carried by M of the multiple mirror messages are the same, and the MAC addresses of the senders carried by the M mirror messages are not included in the second information, and the identifiers of the network devices carried by the M mirror messages indicate two or more network devices, based on the receiving port identifier in the mirror message, determine whether the sender of the data message is a user device.
11. The method according to claim 1, characterized in that: The method further comprises: Based on the identifier of the sending end, query the user equipment access information, where the user equipment access information includes access location information of at least one user equipment; If the user equipment access information already includes the access location information of the user equipment corresponding to the identifier of the sender, and the saved access location information is inconsistent with the currently acquired access location information, update the access location information of the user equipment corresponding to the identifier of the sender in the user equipment access information.
12. The method according to any one of claims 1 to 11, characterized in that: The data message carries transport layer control information or application layer control information.
13. The method according to any one of claims 1 to 12, characterized in that: The data message is a tunnel message, and the identifier of the sending end is carried in an inner message of the tunnel message.
14. The method according to any one of claims 1 to 13, characterized in that: The user device is a server, a terminal device or a virtual machine.
15. A device for acquiring a device access location, characterized in that: include: A receiving unit, configured to receive a mirrored message sent by a network device; wherein the mirrored message is generated by the network device based on a received data message, the mirrored message includes the data message or part of the data message, and an identifier and a receiving port identifier of the network device, the data message in the mirrored message or part of the data message in the mirrored message includes an identifier of a sending end of the data message, and the receiving port identifier is used to indicate a receiving port of the network device for receiving the data message; An access location acquisition unit, configured to determine whether a sender of the data message is a user device based on the mirror message; The access location acquisition unit is further used to acquire access location information of the user equipment if it is determined that the sender is the user equipment, the access location information including the identifier of the sender, the identifier of the network device and the receiving port identifier.
16. The device according to claim 15, characterized in that The access location acquisition unit is specifically configured to determine whether the sender of the data message is a user equipment based on the receiving port identifier in the mirror message.
17. The device according to claim 15, characterized in that The access location acquisition unit is specifically configured to determine whether the sender of the data message is a user equipment based on the identifier of the sender in the mirror message.
18. The device according to claim 15, characterized in that The port type of the receiving port is a user-side port type.
19. The device according to claim 18, characterized in that The access location acquisition unit is specifically configured to determine that the sender of the data message is a user equipment in response to the received mirror message.
20. The device according to claim 18, characterized in that The device also includes an analysis unit for: Determine at least one network device in the network based on first information, wherein the first information includes a port identifier and a corresponding port type of a port of each network device in the network, wherein the port type includes a user-side port type and a network device-side port type, and each network device in the at least one network device includes a port of the user-side port type; Instruction information is sent to the at least one network device, where the instruction information is used to instruct each network device in the at least one network device to generate a mirror message based on a data message received by a port of the user-side interface type of each network device.
21. The device according to claim 16, characterized in that The access location acquisition unit is specifically used to: Determine the port type of the receiving port based on the first information and the receiving port identifier, wherein the first information includes the port identifier and the corresponding port type of the port of each network device in the network, and the port type includes the user side port type and the network device side port type; If the port type of the receiving port is the user-side port type, determining that the sending end is a user equipment; If the port type of the receiving port is a network device side port type, it is determined that the sending end is a non-user device.
22. The device according to claim 20 or 21, characterized in that The device also includes an analysis unit, which is specifically used for: Acquire second information, where the second information includes identifiers of multiple network devices in the network; Obtaining neighbor information of each network device among the multiple network devices, each piece of neighbor information includes an identifier of a source network device, a source network device port identifier, and an identifier of a neighbor device, the source network device is a device that sends the neighbor information, the neighbor device is a device that is physically connected to the source network device, and the source network device port identifier is used to indicate a port on which the source network device is connected to the neighbor device; Based on the second information and the neighbor information, the port type of each network device's port is determined, the identifier of the neighbor device connected to the port with a port type of the network device side port type is included in the second information, and the identifier of the neighbor device connected to the port with a port type of the user side port type is not included in the second information.
23. The device according to claim 17, characterized in that The receiving unit is specifically used for: Receiving a plurality of mirrored messages; the plurality of mirrored messages come from one or more network devices; The identifier of the sending end includes the IP address of the sending end and the MAC address of the sending end. The access location acquisition unit is specifically used to: If the IP addresses of the senders carried by N of the multiple mirror messages are the same, and the MAC addresses of the senders carried by the N mirror messages are not included in the second information, and the identifiers of the network devices carried by the N mirror messages indicate the same network device, it is determined that the sender is a user device, and the second information includes identifiers of multiple network devices in the network.
24. The device according to claim 23, characterized in that The access location acquisition unit is specifically used to: If the IP addresses of the senders carried by M of the multiple mirror messages are the same, and the MAC addresses of the senders carried by the M mirror messages are not included in the second information, and the identifiers of the network devices carried by the M mirror messages indicate two or more network devices, based on the receiving port identifier in the mirror message, determine whether the sender of the data message is a user device.
25. The device according to claim 15, characterized in that The device also includes: an access location storage unit, configured to query user equipment access information based on the identifier of the transmitting end, wherein the user equipment access information includes access location information of at least one user equipment; The access location storage unit is further used to store the user equipment corresponding to the identifier of the sending end if the user equipment access information already contains the user equipment The access location information of the user equipment is obtained, and the saved access location information is inconsistent with the currently acquired access location information, and the access location information of the user equipment corresponding to the identifier of the sending end in the user equipment access information is updated.
26. The device according to any one of claims 15 to 25, characterized in that The data message carries transport layer control information or application layer control information.
27. The device according to any one of claims 15 to 26, characterized in that The data message is a tunnel message, and the identifier of the sending end is carried in an inner message of the tunnel message.
28. The device according to any one of claims 15 to 27, characterized in that The user device is a server, a terminal device or a virtual machine.
29. A computer storage medium, characterized in that The method comprises computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 14.
30. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Method and device for acquiring access position of equipment
CN118740603A
Method, equipment and system for sending and receiving position information of access user
CN102883265A
Authentication method and apparatus of user device
CN107181759A
Information processing device, information processing system, information processing method, and computer-readable medium
WO2023281661A1
Cited By
Message mirroring method based on network-on-chip, network-on-chip module and network equipment
CN121334091A
