Port discovery method and apparatus, splitter, and computer-readable storage medium
By configuring packets and ACL entries on the splitter, the problem of the splitter being unable to discover the network topology is solved, and the network topology discovery function is realized when the splitter replaces the topology switch.
Patent Information
- Application Number
- CN202110205145.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-23
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2041-02-23
AI Technical Summary
When using a splitter to replace a topology switch, the network topology of the Ethernet switch connected to it cannot be detected.
By configuring packets and ACL entries on the splitter, specific packets can only be forwarded through specific outgoing ports, allowing the peer device to determine the port connection relationship with the splitter based on the obtained packets.
This enables the discovery of network topology when using a splitter instead of a topology switch.
Smart Images

Figure CN114978920B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communications, and specifically relates to a port discovery method, apparatus, splitter, and computer-readable storage medium. Background Technology
[0002] Because network switches used for extended connections (topology switches) lack the ability to distinguish between special packets such as partial protocol packets and small byte packets, network splitters are sometimes used to replace topology switches in certain application scenarios to achieve lossless transmission without packet discrimination. However, since splitters send all packets in the network to a designated analysis server as required, they cannot support address discovery methods such as LLDP (Link Layer Discovery Protocol) and FDB (Forwarding Database) address learning. Therefore, when using a splitter to replace a topology switch, there is a drawback: it cannot discover the network topology of the Ethernet switches connected to it. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a port discovery method, apparatus, splitter, and computer-readable storage medium that can realize network topology discovery function by using a splitter to replace the topology switch.
[0004] The embodiments of this application are implemented as follows:
[0005] In a first aspect, embodiments of this application provide a port discovery method applied to a splitter including an ingress port and multiple egress ports, each egress port being pre-configured with a corresponding ACL entry. The method includes: obtaining a test packet through the ingress port; redirecting the test packet to an egress port belonging to the same group as the ingress port according to a pre-configured grouping relationship; filtering the test packet for each egress port according to the corresponding ACL entry, and sending the filtered packet to a peer device connected to the peer device, so that the peer device determines the connection relationship with the port of the splitter based on the obtained packet; wherein the filtering rules of the ACL entries corresponding to each egress port are different.
[0006] In the above process, by configuring packets and ACL entries on the splitter, specific packets can only be forwarded through specific outgoing ports. This allows the peer device connected to the outgoing port to determine which port of the splitter it is connected to by using specific packets it can obtain, without knowing which port of the splitter it is connected to. Thus, network topology discovery can be achieved by using a splitter to replace the topology switch, overcoming the shortcomings of existing technologies.
[0007] In conjunction with the first aspect of the embodiment, in one possible implementation, a corresponding source MAC address is pre-configured for each of the outgoing ports; the filtering rule for the ACL entry corresponding to each outgoing port is: allow packets whose source MAC address is the same as its own source MAC address to pass through; the filtering of the test packets according to the corresponding ACL entry includes: obtaining the source MAC address of the test packet; determining whether the source MAC address of the test packet is consistent with the source MAC address corresponding to the corresponding ACL entry; if so, allow it to pass through; otherwise, discard it.
[0008] In conjunction with the first aspect of the embodiment, in one possible implementation, each of the grouping relationships includes the ingress port and an egress port.
[0009] In conjunction with the first aspect of the embodiment, in one possible implementation, the destination MAC address of the test message is all F; or the destination MAC address of the test message is any unicast address.
[0010] Secondly, embodiments of this application provide a port discovery device, the device comprising: a splitter including an ingress port and multiple egress ports, each egress port being pre-configured with a corresponding ACL entry; the device comprising: an acquisition module, a redirection module, and a filtering and sending module. The acquisition module is used to acquire test packets through the ingress port; the redirection module is used to redirect the test packets to an egress port belonging to the same group as the ingress port according to a pre-configured grouping relationship; the filtering and sending module is used to filter the test packets for each egress port according to the corresponding ACL entry, and send the filtered packets to a peer device connected to it, so that the peer device determines its connection relationship with the port of the splitter based on the acquired packets; wherein the filtering rules for the ACL entries corresponding to each egress port are different.
[0011] In conjunction with the second aspect of the embodiment, in one possible implementation, a corresponding source MAC address is pre-configured for each of the outgoing ports; the filtering rule for the ACL entry corresponding to each outgoing port is: allow packets whose source MAC address is the same as its own source MAC address to pass through; the filtering sending module is used to obtain the source MAC address of the test packet; determine whether the source MAC address of the test packet is consistent with the source MAC address corresponding to the corresponding ACL entry; if so, allow it to pass through; otherwise, discard it.
[0012] In conjunction with the second aspect of the embodiment, in one possible implementation, each of the grouping relationships includes the ingress port and an egress port.
[0013] In conjunction with the second aspect of the embodiment, in one possible implementation, the destination MAC address of the test message is all F; or the destination MAC address of the test message is any unicast address.
[0014] Thirdly, embodiments of this application also provide a traffic splitter, including: a memory, a processor, an ingress port, and a plurality of egress ports, wherein the memory and the processor are connected; the memory is used to store a program and an ACL entry corresponding to each egress port; the processor calls the program stored in the memory to execute the method provided by any possible implementation of the first aspect embodiment and / or in combination with the first aspect embodiment.
[0015] Fourthly, embodiments of this application also provide a non-volatile computer-readable storage medium (hereinafter referred to as a computer-readable storage medium) storing a computer program thereon, wherein the computer program is executed by a computer to perform the method provided by any possible implementation of the first aspect embodiment and / or in combination with the first aspect embodiment.
[0016] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The above and other objects, features, and advantages of this application will become clearer through the drawings. The same reference numerals indicate the same parts in all the drawings. The drawings are not intentionally drawn to scale to actual size; the focus is on illustrating the main points of this application.
[0018] Figure 1 This diagram illustrates the structure of a shunt provided in an embodiment of this application.
[0019] Figure 2 The flowchart illustrates a port discovery method provided in an embodiment of this application.
[0020] Figure 3 This diagram illustrates a port distribution according to an embodiment of this application.
[0021] Figure 4This diagram illustrates a structural block diagram of a port discovery device provided in an embodiment of this application.
[0022] Icons: 100-Splitter; 110-Processor; 120-Memory; 130-Input Port; 140-Output Port; 400-Port Discovery Device; 410-Acquisition Module; 420-Redirection Module; 430-Filtering Sending Module. Detailed Implementation
[0023] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0024] It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., used in the description of this application are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising," or any other variation thereof, is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0025] Furthermore, the applicant's conclusion regarding the shortcomings of existing port discovery schemes (the inability to achieve port discovery function when using a splitter to replace the topology switch) is the result of practical experience and careful research. Therefore, the process of discovering the aforementioned shortcomings and the solutions proposed by the applicant in the embodiments of this application below should be considered as contributions made by the applicant to this application.
[0026] To address the aforementioned issues, embodiments of this application provide a port discovery method, apparatus, splitter, and computer-readable storage medium, which enables network topology discovery by using a splitter instead of a topology switch.
[0027] This technology can be implemented using appropriate software, hardware, or a combination of both. The embodiments of this application are described in detail below.
[0028] First, the splitter mentioned in the embodiments of this application, which is used to implement the port discovery method and device of the embodiments of this application, will be introduced.
[0029] The core function of a traffic splitter is to be installed between the mirror port of the production network and the cluster of analytical devices, to aggregate the traffic mirrored from one or more production network devices, and then distribute it to one or more data analysis devices.
[0030] Of course, in some implementation scenarios, the splitter can be a standalone device; in other implementation scenarios, the splitter can be a stacked device.
[0031] Please refer to Figure 1 In this embodiment of the application, the splitter 100 may include a processor 110, a memory 120, and multiple ports.
[0032] The ports include at least one input port 130 and multiple output ports 140.
[0033] In the initial stage, the multiple ports of the splitter 100 have almost identical functions. After the splitter 100 is initialized and the corresponding instructions are configured, at least one of the multiple ports is configured as the input port 130, and some or all of the remaining ports are configured as the output port 140, so that the input port 130 and the output port 140 have different functions.
[0034] It is worth noting that, regardless of the type of network device the splitter is, in this embodiment of the application, the splitter supports at least two software functions: port redirection and port grouping.
[0035] It should be noted that Figure 1 The components and structure of the shunt 100 shown are merely exemplary and not limiting; the shunt 100 may also have other components and structures as needed.
[0036] The processor 110, memory 120, input port 130, multiple output ports 140, and other components that may be present in the splitter 100 are electrically connected directly or indirectly to enable data transmission or interaction. For example, the processor 110, memory 120, input port 130, multiple output ports 140, and other components may be electrically connected to each other via one or more communication buses or signal lines.
[0037] In this embodiment, a corresponding ACL (Access Control List) entry is pre-configured for each output port 140. The memory 120 is used to store the ACL entries corresponding to each output port 140.
[0038] In addition, the memory 120 is also used to store programs, such as programs corresponding to the port discovery method described later or port discovery devices described later. Optionally, when the memory 120 stores a port discovery device, the port discovery device includes at least one software functional module that can be stored in the memory 120 in the form of software or firmware.
[0039] Optionally, the software functional modules included in the port discovery device can also be embedded in the operating system (OS) of the splitter 100.
[0040] The processor 110 is used to execute executable modules stored in the memory 120, such as software function modules or computer programs included in the port discovery device. When the processor 110 receives an execution instruction, it can execute the computer program, for example, by: acquiring a test packet through the ingress port; redirecting the test packet to an egress port 140 belonging to the same group as the ingress port according to a pre-configured grouping relationship; filtering the test packet according to the corresponding ACL entry for each egress port 140, and sending the filtered packet to the peer device connected to it, so that the peer device can determine the connection relationship with the port of the splitter based on the acquired packet; wherein the filtering rules of the ACL entry corresponding to each egress port are different.
[0041] Of course, the methods disclosed in any embodiment of this application can be applied to or implemented by the processor 110. The port discovery method provided in this application will be described below.
[0042] Please see Figure 2 This application provides a port discovery method for the above-described splitter 100, which may include the following steps.
[0043] Step S110: Obtain the test message through the ingress port.
[0044] As mentioned earlier, in this embodiment of the application, the multiple ports included in the splitter 100 are pre-configured as different port roles, namely, input ports and output ports.
[0045] like Figure 3 As shown, assume that the splitter 100 includes 8 ports, namely: A1, A2, A3, A4, A5, A6, A7, and A8.
[0046] A1 is pre-configured as an ingress port for use with the device sending test messages (i.e., ...). Figure 3The TC1 port is connected; the other ports, A2-A8, are pre-configured as outgoing ports for use with network devices that support FDB address learning (i.e., Figure 3 Connect SW1-SW4 in the middle.
[0047] Optionally, the stream transmitting device can be any server or host that supports sending messages, and the network device that supports FDB address learning can be an Ethernet switch.
[0048] Of course, it is worth noting that in some implementations, the splitter 100 can be configured with multiple inlet ports to connect to different stream transmitting devices (devices that send test messages).
[0049] Furthermore, it is worth noting that in some implementations, the ports of each peer connected to the output port can be different ports belonging to the same Ethernet switch or different ports belonging to different Ethernet switches.
[0050] After completing the above configuration, test messages can be generated through the flow generation device, so that the flow divider 100 can obtain the test messages through the inlet port.
[0051] As for the test messages generated by the power generation device, they are pre-configured by the staff according to each output port of the splitter 100.
[0052] Optionally, the operator can predefine a corresponding source MAC address for each output port of the splitter 100, thereby forming a mapping table between ports and source MAC addresses. Assume that a mapping table between ports and source MAC addresses exists as shown in Table 1.
[0053] Table 1: Mapping Table of Ports and Source MAC Addresses
[0054] Egress port on a flow diverter Mapped source MAC address A2 0000.0000.0002 A3 0000.0000.0003 A4 0000.0000.0004 : : AX 0000.0000.000X
[0055] Note: The 'X' in the MAC address needs to be converted to hexadecimal.
[0056] Given the existence of the aforementioned X-1 output ports and X-1 types of source MAC addresses, when the flow generation device needs to generate test packets, the staff configures the flow generation device to generate at least X-1 types of test packets corresponding to the aforementioned mapping table. The source MAC address of the test packet is the source MAC address corresponding to the output port.
[0057] As for the destination MAC address of the test message, it can be configured to any unicast address, or it can be uniformly configured to all Fs.
[0058] Step S120: According to the pre-configured grouping relationship, redirect the test message to the outgoing port that belongs to the same group as the ingoing port.
[0059] As mentioned earlier, the splitter 100 supports grouping functionality.
[0060] In this embodiment of the application, groups are pre-established between the input port and each output port of the splitter 100, thereby forming a grouping relationship.
[0061] In some implementations, a group may include an ingress port and an egress port. Of course, in some implementations, a group may include an ingress port and multiple egress ports, depending on the specific circumstances.
[0062] Since the splitter 100 also supports redirection, it can be configured to allow ports belonging to the same group to forward packets to each other, while ports not belonging to the same group cannot forward packets to each other. This way, when the splitter 100 obtains a test packet, it can redirect the test packet to the output port belonging to the same group as the input port through the input port.
[0063] In other words, in this embodiment of the application, the purpose of establishing a group is to enable test packets to be forwarded between the ingress and egress ports of the splitter, so that each egress port can obtain all the test packets.
[0064] Corresponding to Figure 3 In the splitter 100 shown, groups can be pre-established between A1 and A2 to obtain group 1, between A1 and A3 to obtain group 2, between A1 and A4 to obtain group 3, between A1 and A5 to obtain group 4, between A1 and A6 to obtain group 5, between A1 and A7 to obtain group 6, and between A1 and A8 to obtain group 7.
[0065] After the traffic splitter 100 receives the test packets, for packet 1, the traffic splitter 100 redirects all test packets to A2 via A1; for packet 2, the traffic splitter 100 redirects all test packets to A3 via A1; for packet 3, the traffic splitter 100 redirects all test packets to A4 via A1; for packet 4, the traffic splitter 100 redirects all test packets to A5 via A1; for packet 5, the traffic splitter 100 redirects all test packets to A6 via A1; for packet 6, the traffic splitter 100 redirects all test packets to A7 via A1; and for packet 7, the traffic splitter 100 redirects all test packets to A8 via A1.
[0066] After the above forwarding, a full set of test packets was obtained for each outgoing port in A2-A8.
[0067] Step S130: For each output port, filter the test packet according to the corresponding ACL entry, and send the filtered packet to the peer device connected to it, so that the peer device can determine the connection relationship with the port of the splitter based on the obtained packet.
[0068] As mentioned earlier, each output port of the splitter 100 is pre-configured with a corresponding ACL entry, and each output port has a corresponding source MAC address, which is the corresponding source MAC address mentioned below.
[0069] The filtering rules for each ACL entry corresponding to each outgoing port are different.
[0070] For each ACL entry, the filtering rule can be: allow packets whose source MAC address is the same as the source MAC address of itself (i.e., the source MAC address corresponding to the outgoing port) to pass through.
[0071] Taking the mapping table in Table 1 as an example, for A2, its corresponding source MAC address is 0000.0000.0002. Therefore, the filtering rule for the ACL entry corresponding to A2 is: allow all test packets with a source MAC address of 0000.0000.0002 to pass. For A3, its corresponding source MAC address is 0000.0000.0003. Therefore, the filtering rule for the ACL entry corresponding to A3 is: allow all test packets with a source MAC address of 0000.0000.0003 to pass. In the packet analysis, the test packet with source MAC address 0000.0000.0003 passes; for A4, its corresponding source MAC address is 0000.0000.0004, so the filtering rule for the ACL entry corresponding to A4 is: allow all test packets with source MAC address 0000.0000.0004 to pass; for A5, its corresponding source MAC address is 0000.0000.0005, so the ACL entry corresponding to A5... The filtering rule for the entry is: allow all test packets with a source MAC address of 0000.0000.0005 to pass; for A6, the corresponding source MAC address is 0000.0000.0006, so the filtering rule for the ACL entry corresponding to A6 is: allow all test packets with a source MAC address of 0000.0000.0006 to pass; for A7, the corresponding source MAC address is 0000.0000.0006. If the source MAC address is 0000.0007, then the filtering rule for the ACL entry corresponding to A7 is: allow all test packets with a source MAC address of 0000.0000.0007 to pass. For A8, if the source MAC address is 0000.0000.0008, then the filtering rule for the ACL entry corresponding to A8 is: allow all test packets with a source MAC address of 0000.0000.0008 to pass.
[0072] Under the above premise, for the splitter 100, after each output port receives a test packet, it can filter the test packets at each output port according to the ACL entries corresponding to each output port, thereby obtaining the filtered packets corresponding to each output port. Since the filtering rules of the ACL entries corresponding to each output port are different, the filtered packets corresponding to each output port are also different.
[0073] Specifically, for each outgoing port, the splitter 100 can obtain the source MAC address of the test packet, and then determine whether the source MAC address is consistent with the source MAC address corresponding to the ACL entry. If so, it is allowed to pass; otherwise, it is discarded, thereby achieving packet filtering.
[0074] After obtaining the filtered packets corresponding to each output port, the splitter 100 sends the corresponding filtered packets to the peer device connected to the output port, i.e., the network device that supports FDB address learning, through each output port. Figure 3 (SW1-SW4).
[0075] Because the filtered messages corresponding to each output port are different, different peer devices will receive different messages.
[0076] Taking the mapping table shown in Table 1 as an example again, for Figure 3 The connection relationships between the ports are shown. Filtering rule A3 allows test packets with a source MAC address of 0000.0000.0003 to pass through. Therefore, the peer device SW1 connected to A3 can only obtain packets with a source MAC address of 0000.0000.0003. Similarly, filtering rule A5 allows test packets with a source MAC address of 0000.0000.0005 to pass through. Therefore, the peer device SW2 connected to A5 can only obtain packets with a source MAC address of 0000.0000.0003. The filtering rule for A7 allows test packets with a source MAC address of 0000.0000.0007 to pass through. Therefore, the peer device SW3 connected to A7 can only obtain packets with a source MAC address of 0000.0000.0007. The filtering rule for A8 allows test packets with a source MAC address of 0000.0000.0008 to pass through. Therefore, the peer device SW4 connected to A8 can only obtain packets with a source MAC address of 0000.0000.0008.
[0077] Furthermore, since the peer device supports FDB address learning, it can learn the source MAC address of the acquired packets. After address learning, the peer device can determine which port of the splitter 100 is currently connected to the peer device based on the learned source MAC address and a pre-formed port-to-source MAC address mapping table.
[0078] In Table 2, since there is a mapping relationship between the source MAC address 0000.0000.0003 and A3, it can be determined that SW1, which has a learned source MAC address of 0000.0000.0003, has a connection relationship with port A3 of the splitter 100.
[0079] In other words, the mapping table between the port and the source MAC address can be queried by the source MAC address learned by each peer device to determine the connection relationship between the peer device and the splitter 100, thereby realizing the network topology discovery function under the premise of using the splitter 100 to replace the topology switch.
[0080] Furthermore, in the above port discovery method, even if the connection relationship between the port of the splitter 100 and the peer device changes, it will not have a significant impact on the execution of the above method. Therefore, the above port discovery method also has good scalability and adaptability.
[0081] The port discovery method provided in this application provides that by configuring packets and ACL entries on a splitter, specific packets can only be forwarded through specific outgoing ports. This allows the peer device connected to the outgoing port to determine which port of the splitter it is connected to by using specific packets it can obtain, without knowing which port of the splitter it is connected to. Thus, the network topology discovery function can be realized when using a splitter to replace a topology switch.
[0082] like Figure 4 As shown, this application embodiment also provides a port discovery device 400, which is applied to a splitter 100 including an ingress port and multiple egress ports. Each egress port is pre-configured with a corresponding ACL entry. The port discovery device 400 may include: an acquisition module 410, a redirection module 420, and a filtering and sending module 430.
[0083] Acquisition module 410 is used to acquire test messages through the ingress port;
[0084] The redirection module 420 is used to redirect the test message to an outgoing port that belongs to the same group as the ingoing port, according to a pre-configured grouping relationship.
[0085] The filtering and sending module 430 is used to filter the test packets according to the corresponding ACL entries for each output port, and send the filtered packets to the peer device connected to it, so that the peer device can determine the connection relationship with the port of the splitter based on the obtained packets.
[0086] The filtering rules for each ACL entry corresponding to the outgoing port are different.
[0087] Optionally, in one possible implementation, a corresponding source MAC address is pre-configured for each of the outgoing ports; the filtering rule for the ACL entry corresponding to each outgoing port is: allow packets whose source MAC address is the same as its own source MAC address to pass through; the filtering sending module 430 is used to obtain the source MAC address of the test packet; determine whether the source MAC address of the test packet is consistent with the source MAC address corresponding to the ACL entry; if yes, allow it to pass through; if no, discard it.
[0088] In one possible implementation, each of the grouping relationships includes the ingress port and an egress port.
[0089] In one possible implementation, the destination MAC address of the test message is all F; or the destination MAC address of the test message is any unicast address.
[0090] The port discovery device 400 provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0091] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a computer, performs the steps included in the port discovery method described above.
[0092] In summary, the port discovery method, apparatus, splitter, and computer-readable storage medium proposed in this invention, by configuring packets and ACL entries on the splitter, ensure that specific packets can only be forwarded through specific outgoing ports. This allows the peer device connected to the outgoing port to determine its connection to the splitter based on the specific packets it can obtain, without knowing which port it is connected to on the splitter. Thus, network topology discovery can be achieved by using a splitter to replace a topology switch.
[0093] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0094] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0095] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0096] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, laptop, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0097] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A port discovery method, characterized in that, The method, applied to a splitter including an ingress port and multiple egress ports, wherein each egress port is pre-configured with a corresponding ACL entry, includes: The test message is obtained through the ingress port; According to the pre-configured grouping relationship, the test packet is redirected to the output port that belongs to the same group as the ingress port; wherein, based on the grouping relationship, the test packet is forwarded between the ingress port and the output port of the splitter, so that each output port can obtain all the test packets; For each output port, the test packets are filtered according to the corresponding ACL entries, and the filtered packets are sent to the peer device connected to it, so that the peer device can determine the connection relationship with the port of the splitter based on the obtained packets. The filtering rules for each ACL entry corresponding to the outgoing port are different.
2. The method according to claim 1, characterized in that, Each outgoing port is pre-configured with a corresponding source MAC address; the filtering rule for the ACL entry corresponding to each outgoing port is: allow packets with a source MAC address matching the port's own source MAC address to pass through; The filtering of the test packets according to the corresponding ACL entries includes: Obtain the source MAC address of the test packet; Determine whether the source MAC address of the test packet matches the source MAC address in the corresponding ACL entry. If so, allow it to pass; otherwise, discard it.
3. The method according to claim 1, characterized in that, Each of the grouping relationships includes the ingress port and an egress port.
4. The method according to claim 1, characterized in that, The destination MAC address of the test message is all F; or the destination MAC address of the test message is any unicast address.
5. A port discovery device, characterized in that, A splitter including an ingress port and multiple egress ports, wherein each egress port is pre-configured with a corresponding ACL entry, the device comprising: The acquisition module is used to acquire test packets through the ingress port; The redirection module is used to redirect the test packet to an output port belonging to the same group as the ingress port according to a pre-configured grouping relationship; wherein, based on the grouping relationship, the test packet is forwarded between the ingress port and the output port of the splitter, so that each output port can obtain all the test packets; The filtering and sending module is used to filter the test packets according to the corresponding ACL entries for each output port, and send the filtered packets to the peer device connected to it, so that the peer device can determine the connection relationship with the port of the splitter based on the obtained packets. The filtering rules for each ACL entry corresponding to the outgoing port are different.
6. The apparatus according to claim 5, characterized in that, Each outgoing port is pre-configured with a corresponding source MAC address; the filtering rule for the ACL entry corresponding to each outgoing port is: allow packets with a source MAC address matching the port's own source MAC address to pass through; The filtering and sending module is used to obtain the source MAC address of the test packet; and determine whether the source MAC address of the test packet is consistent with the source MAC address corresponding to the corresponding ACL entry. If so, allow it to pass; Otherwise, discard it.
7. The apparatus according to claim 5, characterized in that, Each of the grouping relationships includes the ingress port and an egress port.
8. A shunt, characterized in that, include: The system includes a memory, a processor, an input port, and multiple output ports, wherein the memory and the processor are connected. The memory is used to store the program and the ACL entry corresponding to each of the output ports; The processor invokes a program stored in the memory to execute the method as described in any one of claims 1-4.
9. The shunt according to claim 8, characterized in that, The splitter can be a standalone device or a stacked device.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is executed by a computer to perform the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Business shunting method and device
CN106789652A
Port link state detection method, device and system
CN111682989A
