Transfer device and transfer method
Patent Information
- Application Number
- PCT/JP2023/031441
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-03-06
Smart Images

Figure JP2023031441_06032025_PF_FP_ABST
Abstract
Description
Transfer device and transfer method
[0001] The present invention relates to a transfer device and a transfer method.
[0002] As the number of applications using networks increases, the amount of traffic flowing through networks is increasing year by year. To accommodate this traffic, there is a demand for faster packet transfer. Networks are equipped with forwarding devices that forward packets from source to destination. The forwarding devices perform a process to search for the interface that will be the next output destination for the packet based on the destination address contained in the packet. Speeding up the search process is a major challenge in accelerating packet transfer.
[0003] In addition, there are usually multiple possible routes for a traffic flow from a packet source to a destination. To distribute traffic across these multiple routes, technologies such as Equal Cost Multi Path (ECMP) and Load Balancing (LB) have been proposed. By supporting these technologies, forwarding devices can improve traffic accommodation efficiency. Even in environments that support such functions, there is a demand for faster search processing in forwarding devices.
[0004] Traffic distribution is performed for flows that belong to a specific address range, such as a destination prefix. For each forwarding device, a next hop group (hereinafter also referred to as an "NH group") is set for each of these address ranges, including one or more interfaces that serve as output destinations. The interface registered in the NH group is selected so that packets of flows that belong to the address range can be forwarded to the destination without looping. When multiple interfaces are registered in an NH group, there is an operation in which the traffic distribution ratio is changed taking into account factors such as the interface bandwidth. In other words, each NH group is set with a distribution rule that specifies the traffic distribution ratio to the registered interfaces.
[0005] When a forwarding device distributes traffic according to distribution rules, it utilizes a hash function, a hash table, or the like (see, for example, Non-Patent Documents 1 and 2). The packet header of a traffic flow contains numerical data such as source / destination IP addresses, source / destination L4 port numbers, and a protocol ID. The forwarding device calculates a hash value from the numerical data using a hash function, a hash table, or the like. The forwarding device has created a hash value correspondence table that defines the interface to which each hash value is distributed. The forwarding device refers to the hash value correspondence table and determines the interface corresponding to the calculated hash value as the output destination interface for the packet.
[0006] "Junos OS - Traffic Sampling, Forwarding, and Monitoring User Guide," Juniper Networks, Inc., p. 113, 2023. "Supported load balancers," [online] [Retrieved August 22, 2023], Envoy, 2023, Internet <URL: https: / / www.envoyproxy.io / docs / envoy / latest / intro / arch_overview / upstream / load_balancing / load_balancers>. "Equal Cost Multipath Load Sharing - Hardware ECMP," [online] [Retrieved August 22, 2023], Nvidia, Internet <URL: https: / / docs.nvidia.com / networking-ethernet-software / cumulus-linux-55 / Layer-3 / Routing / Equal-Cost-Multipath-Load-Sharing-Hardware-ECMP / > ("Nvidia" and "linux" are registered trademarks.)
[0007] The methods described in Non-Patent Documents 1 and 2 are managed using multiple tables that use NH groups as key information. The forwarding device has the following multiple tables: a forwarding table that lists NH groups set for each specific address range; a hash value correspondence table that defines the traffic allocation ratio to interfaces registered in each NH group; and an interface list that lists access information for interfaces registered in each NH group. The forwarding device searches the forwarding table to obtain identification information for the NH group corresponding to the packet destination, and then searches the hash value correspondence table and interface list to determine the output destination from the interfaces registered in the NH group. Since the hash value correspondence table and interface list are provided for each NH group, the greater the number of NH groups, the greater the number of tables to search. High-speed devices such as Ternary Content Addressable Memory (TCAM) can be used as forwarding devices, but high-speed devices are expensive and consume a lot of power. Without such devices, the forwarding device's search process requires multiple memory accesses, which may hinder processing speed.
[0008] For example, Non-Patent Document 3 proposes a technology that reduces the number of searches by directly recording access information for interfaces registered in an NH group in the hash value correspondence table for each NH group. In the technology of Non-Patent Document 3, there is a one-to-one correspondence between hash values and output destination interfaces. Therefore, by calculating a hash value, a forwarding device can quickly search the hash value correspondence table for access information for the corresponding output destination interface. However, in this case, since the hash value and the output destination interface information are uniquely determined, the hash value correspondence table cannot be shared between NH groups that share the same number of registered interfaces and distribution ratio rules. As a result, a hash value correspondence table must be created for each NH hop group, which may reduce memory efficiency. There is a demand for forwarding devices to improve memory efficiency while speeding up the process of determining the output destination of packets.
[0009] a transfer device according to the present invention, which transfers packets within a network, comprising: a transfer control unit which determines an interface to be the output destination of a packet based on a predetermined sorting rule so as to sort a traffic flow of the packet heading to the same destination to an interface registered in a predetermined output destination group; an output unit which outputs the packet to the interface determined as the output destination; and a storage unit which stores transfer control information used in processing by the transfer control unit, wherein the storage unit stores, as the transfer control information: interface information which describes, for each output destination group, access information of interfaces registered in each output destination group, and the position where the access information of each interface is written can be specified by an offset address which specifies an offset amount from the position where the access information of the first interface is written; sorting information which describes, for each hash value calculated from numerical data included in the packet, the offset address in the interface information of the interface sorted by the sorting rule; For each specific address range that is the destination of the packet, the forwarding information stores identification information of the preset output destination group, a base address specifying the description position of the first interface of the output destination group in the interface information, and a memory address for accessing the distribution information applied to the output destination group, and the transfer control unit includes: a search unit that acquires from the forwarding information the base address in the interface information of the output destination group that corresponds to the destination of the packet and the memory address of the distribution information; a distribution unit that calculates the hash value from numerical data included in the packet, and accesses the distribution information by referring to the memory address acquired by the search unit, and acquires the offset address of the interface that is assigned to the calculated hash value;and an output destination management unit that accesses the interface information and acquires access information of the interface assigned to the hash value by referring to the base address acquired by the search unit and the offset address acquired by the allocation unit, wherein the output unit outputs the packet to the interface based on the access information of the interface acquired by the output destination management unit.
[0010] According to the present invention, it is possible to increase the speed of the process for determining the output destination of a packet and improve memory efficiency.
[0011] FIG. 1 is a diagram illustrating an example of a packet forwarding path in a network. FIG. 2 is a diagram illustrating distribution of traffic flows in a forwarding device according to an embodiment of the present invention. FIG. 3 is a block diagram illustrating the configuration of a forwarding device according to an embodiment of the present invention. FIG. 4 is a diagram illustrating an example of a forwarding table. FIG. 5 is a diagram illustrating an example of a hash value correspondence table. FIG. 6 is a diagram illustrating an example of an interface list. FIG. 7 is a flowchart illustrating the flow of processing in a forwarding device according to an embodiment of the present invention. FIG. 8 is a schematic diagram illustrating an example of processing in a forwarding device according to an embodiment of the present invention. FIG. 9 is a diagram illustrating comparative example 1. FIG. 10 is a diagram illustrating comparative example 2. FIG. 11 is a hardware configuration diagram illustrating an example of a computer that realizes the functions of a forwarding device according to an embodiment of the present invention. FIG. 12 is a block diagram illustrating the configuration of a forwarding device according to modified example 1. FIG. 13 is a flowchart illustrating the flow of processing in a forwarding device according to modified example 1. FIG. 14 is a schematic diagram illustrating an example of processing in a forwarding device according to modified example 1.
[0012] Next, an embodiment of the present invention (hereinafter referred to as "the present embodiment") will be described with reference to the drawings. FIG. 1 is a diagram showing an example of a forwarding path of a packet P in a network NW. As shown in FIG. 1, in the network NW, a packet P is transmitted from a source ST to a destination DT via multiple forwarding devices 1. As illustrated by the arrows in the figure, even if the source ST and destination DT of the packet P are the same in the network NW, there are multiple possible paths that the traffic flow of the packet P can take.
[0013] 2 is a diagram illustrating the distribution of traffic flows in the forwarding device 1 according to this embodiment. Fig. 2 shows an example in which the forwarding device 1 has two interfaces IF1 and IF2 as output destinations for packets P with the same destination DT. The forwarding device 1 controls the output of packets P so that the traffic flows are distributed and distributed to the two interfaces IF1 and IF2.
[0014] 3 is a block diagram showing the configuration of a transfer device 1 according to this embodiment. As shown in FIG. 3, the transfer device 1 has a receiving unit 2, a transfer control unit 3, a transmitting unit 4 (output unit), and a storage unit 5. The receiving unit 2 receives a packet P from a terminal of a source ST or another transfer device 1 in the network NW (see FIG. 1). The packet P includes a payload, which is the data body, and additional information such as header information and a trailer. The header information of the packet P includes the IP addresses of the source ST / destination DT of the packet P, the L4 port numbers of the source ST / destination DT, and numerical data such as a protocol ID.
[0015] The transfer control unit 3 determines the output destination interface of the input packet P based on a preset distribution rule so as to distribute traffic flows heading to the same destination DT to different interfaces registered in a preset output destination group. The transfer control unit 3 has a search unit 31, a distribution unit 32, and an output destination management unit 33. Details of the processing of each unit will be described later. The transmission unit 4 transmits the packet P to the output destination interface determined by the transfer control unit 3.
[0016] The memory unit 5 stores various data necessary for the processing of the forwarding device 1. The memory unit 5 stores, for example, transfer control information used in the processing of the transfer control unit 3. The memory unit 5 stores, as the transfer control information, a forwarding table 51 (forwarding information), a hash value correspondence table 52 (distribution information), and an interface list 53 (interface information). FIG. 4 is a diagram showing an example of the forwarding table 51. FIG. 5 is a diagram showing an example of the hash value correspondence table 52. FIG. 6 is a diagram showing an example of the interface list 53. As shown in FIG. 4, the forwarding table 51 lists, for each destination prefix, identification information of a preset NH group and the base address of the NH group in the interface list 53. The base address is an address that specifies the position of the first interface of each NH group in the interface list 53 stored in the memory unit 5. The forwarding table 51 also lists a memory address for accessing the hash value correspondence table 52 applied to each NH group.
[0017] A destination prefix describes a specific address range in the network NW. An NH group (next hop group, output destination group) is pre-configured for each destination prefix. The forwarding table 51 can record, for example, the name or ID number of each group as identification information for the NH group. One or more interfaces that serve as the output destination of packets P from the forwarding device 1 are registered in each NH group. The interfaces belonging to the NH group are selected so that packets P of the flow belonging to the destination prefix can be forwarded to the destination DT without looping. For example, in the example of FIG. 4, an NH group "NH1" is configured for the destination prefix 172.16.0.0 / 8, and an NH group "NH2" is configured for the destination prefix 172.16.10.0 / 8. As shown in FIG. 2, two interfaces, IF1 and IF2, are registered in the NH group "NH1."
[0018] The transfer device 1 is operated so that traffic with the same destination DT is distributed among the interfaces registered in the NH group. Therefore, traffic distribution rules are preset for each NH group. The hash value correspondence table 52 shown in FIG. 5 reflects these distribution rules. As shown in FIG. 5, the hash value correspondence table 52 lists, for each hash value calculated from the numerical data contained in packet P, the offset address in the interface list 53 of the interface that is distributed to each hash value according to the distribution rule. The hash value is calculated, for example, by applying a predetermined hash function to the numerical data contained in the header of packet P. Even if packets P have the same IP address in the destination DT, the numerical data contained in the header may differ. Therefore, the hash values calculated using the same hash function for the numerical data of packet P tend to be distributed. For example, as shown in FIG. 5, a hash function can be appropriately set so that hash values 1 to 4 are calculated from the numerical data of packet P.
[0019] One or more interfaces registered in each NH group are assigned to their respective hash values based on a pre-set assignment rule. For example, two interfaces IF1 and IF2 are registered in the NH group "NH1." An assignment rule is pre-set for the NH group "NH1" so that packet P is distributed to the interfaces IF1 and IF2. Based on this assignment rule, if hash values 1 and 2 are calculated, packet P is assigned to IF1, and if hash values 3 and 4 are calculated, packet P is assigned to IF2.
[0020] The hash value correspondence table 52 is provided according to the allocation rule applied to the NH group and the number of interfaces registered in each NH group. In other words, the hash value correspondence table 52 can be shared between NH groups that have the same allocation rule and the same number of registered interfaces. Specifically, as shown in FIG. 5 , the hash value correspondence table 52 lists the offset address of the interface in the interface list 53 instead of directly listing the driver address of the interface allocated to each hash value. In this embodiment, the driver address of the allocated interface can be obtained by referring to the interface list 53, which will be described later, based on the offset address obtained by referring to the hash value correspondence table 52.
[0021] As shown in Fig. 6, the interface list 53 lists, for each NH group, the driver addresses (access information) of the interfaces registered in that NH group. For example, the interface list 53 lists the driver addresses of the interfaces IF1 and IF2 registered in the NH group "NH1." The base address of each NH group listed in the forwarding table 51 of Fig. 4 specifies the location in the interface list 53 of Fig. 6 where the driver address of the first interface in the NH group is listed. If the memory size for storing information about each interface in the interface list 53 is set to a specified value, the base address is set to an integer multiple of the specified value.
[0022] For example, the base address 0x1000 of the NH group “NH1” specifies the interface IF1 located at the top of the NH group “NH1” in the interface list 53. The base address 0x2000 of the NH group “NH2” specifies the interface IF3 located at the top of the NH group “NH2” in the interface list 53.
[0023] The offset addresses listed in the hash value correspondence table 52 of FIG. 5 are addresses for identifying the position of the driver address of each interface in the interface list 53. Specifically, the offset addresses specify the offset amount from the position of the first interface in each NH group in the interface list 53. When the memory size of the portion of the interface list 53 that stores information about each interface is set to a specified value, the offset addresses are set to an integer multiple of the specified value. For example, in the hash value correspondence table 52 of FIG. 5, the offset address +0x0000 assigned to hash values 1 and 2 specifies interface IF1, which is offset 0 from the beginning (0x1000) of the NH group "NH1" in FIG. 6. The offset address +0x0010 assigned to hash values 3 and 4 specifies interface IF2, which is offset by one from the beginning. Although not shown, the portion that stores information about each interface may include not only the driver address but also other related information within the range of the specified value.
[0024] In this embodiment, the transfer control unit 3 executes a transfer control step using the transfer control information described above. In the transfer control step, the transfer control unit 3 searches for an NH group corresponding to the destination DT of the input packet P. The transfer control unit 3 further distributes the output destination of the input packet P to an interface registered in the NH group according to a distribution rule. The transfer control step includes a search step, a distribution step, and an output destination determination step.
[0025] The search unit 31 of the forwarding control unit 3 executes a search step. The search unit 31 searches the forwarding table 51 to obtain the base address in the interface list 53 and the memory address in the hash value correspondence table 52 of the NH group corresponding to the destination DT of the input packet P.
[0026] The allocating unit 32 executes the allocating step. The allocating unit 32 calculates a hash value from the numerical data included in the packet P, and accesses the hash value correspondence table 52 by referring to the memory address acquired by the search unit 31. The allocating unit 32 acquires from the hash value correspondence table 52 the offset address of the interface allocated to the calculated hash value.
[0027] The output destination management unit 33 executes an output destination determination step. The output destination management unit 33 accesses the interface list 53 and references the base address acquired by the search unit 31 and the offset address acquired by the allocation unit 32 to acquire the driver address of the interface assigned to the calculated hash value. The interface from which the output destination management unit 33 acquired the driver address becomes the interface to which the packet P is to be output. The transmitter 4 described above transmits the packet P to this interface to which the packet P is to be output.
[0028] FIG. 7 is a flowchart illustrating the processing of the transfer device 1 according to this embodiment. FIG. 8 is a schematic diagram illustrating an example of the processing of the transfer device 1 according to this embodiment. As shown in FIG. 7, the receiver 2 of the transfer device 1 determines whether or not it has received a packet P (step S01). If it has not received the packet (step S01: No), it waits until it receives the packet P. On the other hand, when the receiver 2 receives the packet P (step S01: Yes), the search unit 31 of the transfer control unit 3 acquires the IP address of the destination DT included in the header of the packet P and searches the forwarding table 51 stored in the storage unit 5 (step S02). The search unit 31 acquires information written in the forwarding table 51 for the destination prefix that includes the IP address of the destination DT. The search unit 31 acquires the base address in the interface list 53 of the NH group set for the corresponding destination prefix and the memory address of the hash value correspondence table 52 applied to the NH group (step S03). The search unit 31 outputs the memory address to the distribution unit 32 and the base address to the output destination management unit 33.
[0029] As shown in Figure 8, for example, if the IP address of the destination DT of packet P is 172.16.0.1, the search unit 31 searches the forwarding table 51 and obtains the base address 0x1000 in the interface list 53 of the NH group "NH1" set to the destination prefix 172.16.0.0 / 8 and the memory address 0xa00 in the hash value correspondence table 52.
[0030] 7 , the distribution unit 32 acquires the numerical data included in the header of the packet P and calculates a hash value using a hash function or the like (step S04). The distribution unit 32 accesses the hash value correspondence table 52 stored in the storage unit 5 based on the memory address input from the search unit 31 (step S05). The distribution unit 32 acquires the offset address of the interface corresponding to the calculated hash value (step S06). The distribution unit 32 outputs the offset address to the output destination management unit 33.
[0031] As shown in Figure 8, when the distribution unit 32 calculates, for example, a hash value of 3 from the numerical data of packet P, the distribution unit 32 obtains the offset address +0x0010 corresponding to the hash value 3 from the hash value correspondence table 52.
[0032] 7 , the output destination management unit 33 accesses the interface list 53 stored in the storage unit 5 (step S07). The output destination management unit 33 references the base address input from the output destination management unit 33 and the offset address input from the distribution unit 32 to obtain the driver address of the interface assigned to the calculated hash value (step S08). This determines the interface to which the packet P will be output. The distribution unit 32 outputs the driver address of the output destination interface to the transmission unit 4. The transmission unit 4 transmits the packet P to the output destination interface based on the driver address input from the distribution unit 32 (step S09).
[0033] 8 , the base address 0x1000 input from the search unit 31 specifies the first interface IF1 of the NH group "NH1" in the interface list 53. Furthermore, the offset address +0x0010 input from the distribution unit 32 specifies the interface IF2, which is offset by one from the first interface IF1. The output destination management unit 33 determines the interface IF2 as the output destination interface, obtains the driver address 0xYYYY, and outputs it to the transmission unit 4.
[0034] As described above, in this embodiment, the forwarding table 51 used in the processing of the search unit 31 contains information (memory address, base address) for accessing data used by the distribution unit 32 and the output destination management unit 33 when performing processing. This allows the distribution unit 32 and the output destination management unit 33 to directly access data, thereby reducing the number of searches and memory accesses in the processing of the transfer control unit 3. Furthermore, in this embodiment, instead of listing the driver addresses of the interfaces in the hash value correspondence table 52, an offset address that can be used to access the driver addresses of the interfaces in combination with the base address is listed. This makes it possible to share the hash value correspondence table 52 between NH groups with the same distribution policy. The operation of this embodiment will be described in comparison with a comparative example.
[0035] 9 is a diagram illustrating Comparative Example 1. As shown in FIG. 9, in Comparative Example 1, a forwarding table 51A lists only the identification information of a preset NH group for each destination prefix. A hash value correspondence table 52A is provided for each NH group, and lists the identification information of the interface assigned to each hash value. An interface list 53A is provided for each NH group, and lists the driver addresses of each interface registered in the NH group.
[0036] In Comparative Example 1, the search unit 31 searches the forwarding table 51A to identify an NH group (e.g., NH group "NH1") corresponding to the destination address of the packet P. Next, the allocation unit 32 searches the hash value correspondence table 52A corresponding to the identified NH group, and identifies the interface (e.g., interface IF1) assigned to the calculated hash value (e.g., hash value 1) from the hit hash value correspondence table 52A. Furthermore, the output destination management unit 33 searches the interface list 53A of the NH group identified by the search unit 31. The output destination management unit 33 further searches the hit interface list 53A to obtain the driver address (e.g., 0xYYYY) of the assigned interface.
[0037] In this way, in Comparative Example 1, the distribution unit 32 and the output destination management unit 33 must search the memory unit 5 until they find the hash value correspondence table 52A and the interface list 53A corresponding to the NH group identified by the search unit 31. Furthermore, after accessing the interface list 53A that has been found, the output destination management unit 33 must continue searching until it finds the interface identified by the distribution unit 32. In this way, in Comparative Example 1, the number of memory accesses and searches required to obtain the target data increases. The number of memory accesses and searches increases as the number of set NH groups increases, which affects the speed of processing in the transfer device 1.
[0038] 4, in the forwarding table 51, for each destination prefix, the memory address of the hash value correspondence table 52 corresponding to the NH group and the base address of the interface list 53 are recorded. The search unit 31 acquires these addresses and outputs them to the distribution unit 32 and the output destination management unit 33, so that the distribution unit 32 and the output destination management unit 33 can directly access the target hash value correspondence table 52 and interface list 53 without searching them. Furthermore, in the present embodiment, because the hash value correspondence table 52 records the offset address in the interface list 53, the output destination management unit 33 does not need to search the interface list 53 for the interface identified by the distribution unit 32, and can directly access the driver address of the target interface.
[0039] 10 is a diagram illustrating Comparative Example 2. As shown in FIG. 10, in Comparative Example 2, the driver address of the interface assigned to each hash value is directly entered in hash value correspondence table 52B. In Comparative Example 2, the assigning unit 32 searches hash value correspondence table 52 corresponding to the NH group identified by the search unit 31, and by accessing the hash value correspondence table 52B that is found, it is possible to obtain the driver address of the interface assigned to the calculated hash value (e.g., hash value 1). In other words, since processing in the output destination management unit 33 is not required, the number of memory accesses and searches can be reduced.
[0040] However, in the case of Comparative Example 2, since the correspondence between hash values and output destination interfaces is one-to-one, it is necessary to provide a hash value correspondence table 52B for each NH group. The greater the number of NH groups, the greater the number of hash value correspondence tables 52B, consuming more space in the storage unit 5. Furthermore, for example, when the driver address of interface IF1 is updated, it is necessary to search for the hash value assigned to interface IF1 in hash value correspondence table 52B and update all of them.
[0041] On the other hand, in this embodiment, as described above, only the offset addresses of each interface in the interface list 53 are entered in the hash value correspondence table 52. Therefore, the hash value correspondence table 52 can be shared between NH groups that have the same sorting rule and the same number of registered interfaces. Furthermore, for example, when the driver address of interface IF1 is updated, it is not necessary to update the hash value correspondence table 52; it is sufficient to update only the driver address of interface IF1 in the interface list 53. In this way, this embodiment makes it possible to secure memory space by sharing the hash value correspondence table 52 and reduce the update work, while reducing the number of memory accesses and searches in the transfer device 1.
[0042] <Hardware Configuration> The transfer device 1 according to this embodiment is realized by, for example, a computer 900 as shown in Fig. 11. Fig. 11 is a hardware configuration diagram showing an example of the computer 900 that realizes the functions of the transfer device 1 according to this embodiment. The computer 900 has a CPU (Central Processing Unit) 901, a ROM (Read Only Memory) 902, a RAM 903, an HDD (Hard Disk Drive) 904, an input / output I / F (Interface) 905, a communication I / F 906, and a media I / F 907.
[0043] The CPU 901 operates based on a program stored in the ROM 902 or the HDD 904, and controls the transfer control unit 3 shown in Fig. 3. The ROM 902 stores a boot program executed by the CPU 901 when the computer 900 is started up, programs related to the hardware of the computer 900, and the like.
[0044] The CPU 901 controls an input device 910 such as a mouse or keyboard, and an output device 911 such as a display, via an input / output I / F 905. The CPU 901 acquires data from the input device 910 via the input / output I / F 905, and outputs generated data to the output device 911. Note that a GPU (Graphics Processing Unit) or the like may be used as a processor together with the CPU 901.
[0045] The HDD 904 stores programs executed by the CPU 901 and data used by the programs. The communication I / F 906 receives data from other devices via a communication network (e.g., NW (Network) 920) and outputs the data to the CPU 901, and also transmits data generated by the CPU 901 to other devices via the communication network.
[0046] The media I / F 907 reads a program or data stored in the recording medium 912 and outputs it to the CPU 901 via the RAM 903. The CPU 901 loads a program related to a target process from the recording medium 912 onto the RAM 903 via the media I / F 907, and executes the loaded program. The recording medium 912 is an optical recording medium such as a DVD (Digital Versatile Disc) or a PD (Phase Change Rewritable Disc), a magneto-optical recording medium such as an MO (Magneto Optical Disc), a magnetic recording medium, a conductive memory tape medium, a semiconductor memory, or the like.
[0047] For example, when a computer 900 functions as the transfer device 1 according to this embodiment, a CPU 901 of the computer 900 executes a program loaded onto a RAM 903 to implement the functions of the transfer device 1. Furthermore, data stored in the RAM 903 is stored in the HDD 904. The CPU 901 reads and executes a program related to a target process from a recording medium 912. Alternatively, the CPU 901 may read a program related to a target process from another device via a communication network (NW 920). Note that the computer that implements the transfer device 1 is not limited to one composed only of physical devices, and may be implemented at least in part by a virtual machine or a virtual container. In this case, the computer's hardware may include virtual hardware.
[0048] <Configuration of the above embodiment and its effects> (1, 4) The forwarding device 1 executes a forwarding method for forwarding packets P within a network NW. The forwarding device 1 has a forwarding control unit 3 and a transmitting unit 4 (output unit). In a forwarding control step (steps S02 to S08), the forwarding control unit 3 determines an interface to be the output destination of the packets P based on a preset distribution rule so as to distribute the traffic flow of packets P heading to the same destination DT to an interface registered in a preset NH group (output destination group). In an output step (step S09), the transmitting unit 4 outputs the packets P to the interface determined as the output destination.
[0049] The storage unit 5 stores transfer control information used in the processing of the transfer control unit 3. The storage unit 5 stores, as the transfer control information, an interface list 53 (interface information), a hash value correspondence table 52 (distribution information), and a forwarding table 51 (forwarding information).
[0050] The interface list 53 lists, for each NH group, the driver addresses (access information) of the interfaces registered in each NH group. In the interface list 53, the location of the access information for each interface can be identified by an offset address that specifies the offset amount from the location of the first interface. The hash value correspondence table 52 lists, for each hash value calculated from the numerical data included in the packet P, the offset address in the interface list 53 of the interface allocated according to the allocation rule. For each destination prefix, which is a specific address range that serves as the destination DT of the packet P, the forwarding table 51 lists identification information of a predetermined NH group, a base address that specifies the location of the first interface of the NH group in the interface list 53, and a memory address for accessing the hash value correspondence table 52 applied to the NH group.
[0051] The transfer control unit 3 includes a search unit 31, a distribution unit 32, and an output destination determination unit. In a search step (steps S02 to S03), the search unit 31 obtains from the forwarding table 51 a base address in the interface list 53 and a memory address in the hash value correspondence table 52 of the NH group corresponding to the destination DT of the packet P. In a distribution step (steps S04 to S06), the distribution unit 32 calculates a hash value from the numerical data included in the packet P, and accesses the hash value correspondence table 52 by referring to the memory address obtained by the search unit 31 to obtain the offset address of the interface assigned to the calculated hash value. In a destination determination step (steps S07 to S08), the output destination management unit 33 accesses the interface list 53 and obtains the driver address of the interface assigned to the hash value by referring to the base address obtained by the search unit 31 and the offset address obtained by the distribution unit 32.
[0052] In an output step (step S09), the transmitter 4 outputs the packet P to the interface based on the access information of the interface acquired by the output destination manager 33.
[0053] According to the forwarding device 1 of this embodiment, it is possible to improve memory efficiency while speeding up the process of determining the output destination of a packet P. Specifically, in this embodiment, the forwarding table 51 used in the processing of the search unit 31 contains information (memory address, base address) for accessing data used by the distribution unit 32 and the output destination management unit 33 when performing their respective processing. This allows the distribution unit 32 and the output destination management unit 33 to directly access data, thereby reducing the number of searches and memory accesses required in the processing of the transfer control unit 3 and speeding up the processing. Furthermore, in this embodiment, the hash value correspondence table 52 does not contain the driver address of the interface assigned to the hash value, but rather the offset address in the interface list 53. The output destination management unit 33 can obtain the driver address of the assigned interface by combining the base address and offset address obtained by the search unit 31. This allows the hash value correspondence table 52 to be shared between NH groups with the same distribution policy, eliminating the need to provide a hash value correspondence table 52 for every NH group and improving memory efficiency.
[0054] 12 is a block diagram showing the configuration of the transfer device 1 according to Modification 1. In the embodiment described above, the transfer control unit 3 of the transfer device 1 determines the interface to which the packet P is to be output, using the transfer control information stored in the storage unit 5. Modification 1 describes an example in which the transfer control unit 3 has an update function that updates the transfer control information stored in the storage unit 5.
[0055] 12, the transfer control unit 3 executes the update function when update data UD (data) is input to the transfer device 1. The update data UD may be, for example, transmitted from a management device that comprehensively manages the multiple transfer devices 1 that make up the network NW. Alternatively, the administrator of the network NW may directly input the update data UD to the transfer device 1 in the form of a command line interface or the like. The update data UD uses at least one of the header information of the packet P and the NH group as key information, and uses the driver address (access information) of the interface registered in the NH group and the allocation rule applied to the NH group as value information.
[0056] 12, the address information of the multiple tables stored in the storage unit 5 is managed by the OS 6 (operating system) of the transfer device 1, and is normally kept private to protect against attacks by malware, etc. Therefore, the transfer control unit 3 obtains the necessary information from the storage unit 5 via the OS 6 and updates the tables. Note that the transfer device 1 of the above-described embodiment also has an OS 6, but for ease of explanation, it is not shown in FIG. 3.
[0057] When update data UD is input to transfer device 1, search unit 31 of transfer control unit 3 searches forwarding table 51 stored in memory unit 5 to check whether there is an entry in forwarding table 51 that corresponds to the key information of the update data UD. If there is no entry, search unit 31 creates an NH group that corresponds to the key information and registers the information included in the update data UD in that NH group.
[0058] The search unit 31 outputs to the distribution unit 32 a request to return the memory address in the hash value correspondence table 52 that corresponds to the distribution rule specified in the value information of the update data UD, regardless of whether there is an entry in the forwarding table 51. The search unit 31 also outputs to the output destination management unit 33 a request to return the base address in the interface list 53 of the NH group that corresponds to the key information of the update data UD.
[0059] The sorting unit 32 refers to the hash value correspondence table 52 stored in the storage unit 5 to check whether there is a hash value correspondence table 52 that corresponds to the sorting rule specified by the search unit 31. If there is no corresponding hash value correspondence table 52, the sorting unit 32 creates a hash value correspondence table 52 and stores it in the storage unit 5. The sorting unit 32 returns the memory address of the hash value correspondence table 52 to the search unit 31.
[0060] The output destination management unit 33 refers to the interface list 53 stored in the storage unit 5 and checks whether the NH group corresponding to the key information of the update data UD and the address information of the interface specified by the value information are registered. If there is any information that has not been registered, the output destination management unit 33 registers it in the interface list 53. The output destination management unit 33 returns the base address in the interface list 53 of the NH group to the search unit 31.
[0061] The search unit 31 registers the memory address of the hash value correspondence table 52 and the base address of the interface list 53 returned from the distribution unit 32 and the output destination management unit 33 in an entry of the forwarding table 51 .
[0062] FIG. 13 is a flowchart illustrating the processing of the transfer device 1 according to Modification 1. FIG. 14 is a schematic diagram illustrating an example of the processing of the transfer device 1 according to Modification 1. As shown in FIG. 13 , the transfer device 1 determines whether update data UD has been input (step S11). If update data UD has not been input (step S11: No), the transfer device 1 waits until update data UD is input. On the other hand, if update data UD is input (step S11: Yes), the search unit 31 of the transfer control unit 3 searches the forwarding table 51 stored in the storage unit 5 to check whether there is an entry in the forwarding table 51 corresponding to the key information of the update data UD (step S12). If there is no entry in the forwarding table 51 (step S12: No), the search unit 31 creates a new entry including an NH group corresponding to the key information and registers the information included in the update data UD in the NH group (step S13). The search unit 31 creates the entry and registers the information via the OS 6. If the search unit 31 determines that an entry already exists in the forwarding table 51 (step S12: Yes), the search unit 31 does not create an NH group and proceeds to step S14.
[0063] In the example of FIG. 14 , the update data UD includes, as key information, the destination DT prefix 172.16.0.0 / 8 and identification information of the NH group "NH1" set for this destination DT prefix. The update data UD includes, as value information, the sorting rule applied to the NH group "NH1" and the driver addresses of the interfaces IF1 and IF2 registered in the NH group "NH1." If there is no entry corresponding to the update data UD in the forwarding table 51, the search unit 31 creates a new entry. In the example of FIG. 14 , the search unit 31 creates an entry for the destination DT prefix 172.16.0.0 / 8 and the NH group "NH1" in the forwarding table 51. The search unit 31 registers the identification information of the NH group "NH1" in the entry.
[0064] The search unit 31 may also change existing information registered in the forwarding table 51 based on the update data UD. For example, if an NH group other than the NH group "NH1" is entered for the destination DT prefix 172.16.0.0 / 8, the search unit 31 deletes the existing entry and creates an entry for the NH group "NH1." There may also be cases where the NH group setting for the destination prefix remains unchanged, but the distribution rules applied to the NH group are changed, or an interface registered in the NH group is added or deleted. In such cases, the search unit 31 does not create an entry in the forwarding table 51, but instead changes the information written in the existing entry.
[0065] 14, forwarding table 51 does not directly record the distribution rules and the driver addresses of the interfaces. Therefore, search unit 31 queries distribution unit 32 and output destination management unit 33 to obtain information to be recorded in the entries of forwarding table 51 (memory addresses of hash value correspondence table 52 and base addresses of interface list 53).
[0066] 13 , the search unit 31 outputs a return request to the distribution unit 32 and the output destination management unit 33 (step S14). The distribution unit 32 searches the hash value correspondence table 52 stored in the storage unit 5 to confirm whether there is a hash value correspondence table 52 corresponding to the distribution rule specified by the search unit 31 (step S15). If there is no corresponding hash value correspondence table 52 (step S15: No), the distribution unit 32 creates a new hash value correspondence table 52 and stores it in the storage unit 5 via the OS 6 (step S16). If there is a hash value correspondence table 52 corresponding to the specified distribution rule (step S15: Yes), the search unit 31 does not create the hash value correspondence table 52 and proceeds to step S17. The distribution unit 32 queries the OS 6 to obtain the memory address of the specified hash value correspondence table 52 and returns it to the search unit 31 (step S17).
[0067] In the example of FIG. 14 , the distribution unit 32 returns to the search unit 31 the memory address 0xa00 of the hash value correspondence table 52 corresponding to the distribution rule applied to the NH group "NH1." As described above, the hash value correspondence table 52 can be shared between NH groups that have the same distribution rule and the same number of registered interfaces. Therefore, even when a new NH group is set, an existing hash value correspondence table 52 may be usable. In such a case, the distribution unit 32 does not create a new hash value correspondence table 52, but returns the memory address of the existing hash value correspondence table 52 corresponding to the specified distribution rule. Furthermore, for an existing NH group, it may be necessary to change the hash value correspondence table 52 due to a change in the distribution rule or an increase or decrease in the number of registered interfaces. In such a case, the distribution unit 32 may change the existing hash value correspondence table 52 to another existing hash value correspondence table 52 or to a newly created hash value correspondence table 52.
[0068] 13, the output destination management unit 33 searches the interface list 53 stored in the storage unit 5 to check whether the NH group corresponding to the key information of the update data UD and the address information of the interface specified by the value information are registered (step S18). If there is information that has not been registered (step S18: No), the output destination management unit 33 registers it in the interface list 53 via the OS 6 (step S19). If all the information has been registered in the interface list 53 (step S18: Yes), the output destination management unit 33 does not register the information and proceeds to step S20.
[0069] The output destination management unit 33 queries the OS 6 to obtain the base address in the interface list 53 of the NH group, and returns it to the search unit 31 (step S20). The search unit 31 registers the memory address returned from the distribution unit 32 and the base address returned from the output destination management unit 33 in the forwarding table 51 (step S21).
[0070] 14, the output destination management unit 33 returns the base address 0x1000, which is the head of the NH group "NH1" in the interface list 53, to the search unit 31. When a new NH group is set, the NH group corresponding to the key information of the update data UD and all of the address information of the interface specified by the value information are registered in the interface list 53. When an interface is added to or deleted from an existing NH group, the output destination management unit 33 only adds or deletes the driver address of the interface in the interface list 53.
[0071] In this way, the search unit 31 registers the memory address of the hash value correspondence table 52 and the base address of the interface list 53 returned from the distribution unit 32 and the output destination management unit 33 in the entry of the forwarding table 51 via the OS 6. In the example of Fig. 14, the search unit 31 registers the base address 0x1000 of the NH group "NH1" in the interface list 53 and the memory address 0xa00 of the hash value correspondence table 52 for the entry of the destination DT prefix 172.16.0.0 / 8 and the NH group "NH1".
[0072] <Configuration and Effects of Modification 1> (2) The forwarding control unit 3 has an update function that updates multiple tables stored in the storage unit 5 when update data UD (data) is input, where key information is at least one of the header information of the packet P and the NH group, and value information is access information of an interface registered in the NH group and an allocation rule applied to the NH group. The search unit 31 searches the forwarding table 51, and if there is no entry in the forwarding table 51 corresponding to the key information, creates an entry including the NH group corresponding to the key information and registers the information included in the update data UD in the entry. Regardless of whether there is an entry, the search unit 31 outputs to the allocation unit 32 a request to return a memory address in the hash value correspondence table 52 corresponding to the allocation rule specified in the value information, and outputs to the output destination management unit 33 a request to return a base address in the interface list 53 of the NH group corresponding to the key information.
[0073] If there is no hash value correspondence table 52 corresponding to the allocation rule specified by the value information, the allocation unit 32 creates the hash value correspondence table 52 and returns the memory address of the hash value correspondence table 52 to the search unit 31. If there is an NH group corresponding to the key information and address information of the interface specified by the value information that is not registered in the interface list 53, the output destination management unit 33 registers it in the interface list 53 and returns the base address of the NH group to the search unit 31. The search unit 31 registers the memory address of the hash value correspondence table 52 and the base address of the interface list 53 returned from the allocation unit 32 and the output destination management unit 33 in an entry of the forwarding table 51.
[0074] When registering the settings of a new NH group in the transfer device 1 or registering a new interface in an existing NH group due to a specification change in the network NW, it is necessary to update the multiple tables (forwarding table 51, hash value correspondence table 52, interface list 53) stored in the storage unit 5. In the transfer device 1 of Modification 1, when update data UD is input, the transfer control unit 3 executes an update function that updates the multiple tables. This eliminates the need for an operator to manually update the multiple tables, thereby speeding up the update process and reducing personnel costs.
[0075] (3) Transfer device 1 has OS 6 (operating system). OS 6 manages address information of multiple tables stored in storage unit 5. When executing the update function, distribution unit 32 and output destination management unit 33 acquire the memory address of hash value correspondence table 52 and the base address of interface list 53 via OS 6. Search unit 31 registers the memory address of hash value correspondence table 52 and the base address of interface list 53 returned from distribution unit 32 and output destination management unit 33 in forwarding table 51 via OS 6.
[0076] In the transfer device 1 of the first modification, the OS 6 manages the memory addresses of the hash value correspondence table 52 and the base addresses of the interface list 53, and the search unit 31, the distribution unit 32, and the output destination management unit 33 execute the update function via the OS 6. This allows the address information of the data stored in the storage unit 5 to be kept private in normal circumstances to protect it from attacks by malware and the like, and the update function can be executed in a secure state.
[0077] The present invention is not limited to the above-described embodiments, and many modifications can be made by a person having ordinary skill in the art within the technical concept of the present invention.
[0078] (Note) (5) The forwarding method includes an updating step of updating the plurality of tables stored in the storage unit when data is input, the data having at least one of header information of the packet and the destination group as key information, and access information of the interface registered in the destination group and the distribution rule applied to the destination group as value information, wherein in the updating step, the search unit of the forwarding device searches the forwarding information, and if there is no entry of the forwarding information corresponding to the key information, creates an entry including the destination group corresponding to the key information and registers the information included in the data in the entry, the search unit outputs a request to the distribution unit of the forwarding control unit to return a memory address of distribution information corresponding to the distribution rule specified in the value information, regardless of whether there is an entry, and outputs a request to the destination management unit of the forwarding control unit to return a base address in interface information of the destination group corresponding to the key information, and the distribution unit of the forwarding device creates the distribution information and returns the memory address of the distribution information to the search unit, The transfer method of (4) is characterized in that, if there is any of the output destination group corresponding to the key information and the address information of the interface specified by the value information that is not registered in the interface information, the output destination management unit of the transfer device registers it in the interface information and returns the base address of the output destination group to the search unit, and the search unit registers the memory address of the distribution information returned from the distribution unit and the output destination management unit and the base address of the interface information in the entry of the forwarding information.
[0079] REFERENCE SIGNS LIST 1 Transfer device 3 Transfer control unit 4 Transmitter (output unit) 5 Storage unit 6 OS (operating system) 31 Search unit 32 Distributor 33 Output destination manager 51 Forwarding table (forwarding information) 52 Hash value correspondence table (distribution information) 53 Interface list (interface information) NW Network DT Destination P Packet UD Update data
Claims
1. A forwarding device that forwards packets within a network, comprising: a forwarding control unit that determines an interface to which a packet is to be outputted based on a preset sorting rule so as to sort a traffic flow of the packet heading for the same destination to an interface registered in a preset output destination group; an output unit that outputs the packet to the interface determined as the output destination; and a memory unit that stores forwarding control information used in processing by the forwarding control unit, wherein the memory unit stores, as the forwarding control information: interface information that describes, for each output destination group, access information of an interface registered in each output destination group, and the position where the access information of each interface is described can be specified by an offset address that specifies an offset amount from the position where the first interface is described; sorting information that describes, for each hash value calculated from numerical data included in the packet, the offset address in the interface information of the interface sorted by the sorting rule; For each specific address range that is the destination of the packet, the forwarding information stores identification information of the preset output destination group, a base address specifying the description position of the first interface of the output destination group in the interface information, and a memory address for accessing the distribution information applied to the output destination group, and the transfer control unit stores: a search unit that acquires from the forwarding information the base address in the interface information of the output destination group corresponding to the destination of the packet and the memory address of the distribution information; a distribution unit that calculates the hash value from numerical data included in the packet, and accesses the distribution information by referring to the memory address acquired by the search unit, and acquires the offset address of the interface assigned to the calculated hash value;a destination management unit that accesses the interface information and acquires access information of the interface assigned to the hash value by referring to the base address acquired by the search unit and the offset address acquired by the allocation unit, wherein the output unit outputs the packet to the interface based on the access information of the interface acquired by the destination management unit.
2. The forwarding control unit has an update function for updating the forwarding control information stored in the storage unit when data is input, the key information being at least one of the header information of the packet and the output destination group, and the value information being the access information of the interface registered in the output destination group and the distribution rule applied to the output destination group; the search unit searches for the forwarding information, and if there is no entry of the forwarding information corresponding to the key information, creates an entry including the output destination group corresponding to the key information and registers the information included in the data in the entry; the search unit outputs, regardless of the presence or absence of the entry, to the distribution unit a request for return of a memory address of distribution information corresponding to the distribution rule specified in the value information, and outputs a request for return of a base address in interface information of the output destination group corresponding to the key information to the output destination management unit; if there is no distribution information corresponding to the distribution rule specified in the value information, the distribution unit creates the distribution information and returns the memory address of the distribution information to the search unit; 2. The forwarding device according to claim 1, wherein if there is any of the output destination group corresponding to the key information and the address information of the interface specified by the value information that is not registered in the interface information, the output destination management unit registers it in the interface information and returns a base address of the output destination group to the search unit, and the search unit registers the memory address of the distribution information and the base address of the interface information returned from the distribution unit and the output destination management unit in the entry of the forwarding information.
3. A forwarding device as described in claim 2, further comprising an operating system which manages address information of the forwarding control information stored in the memory unit, and when the update function is executed, the distribution unit and the output destination management unit obtain the memory address of the distribution information and the base address of the interface information via the operating system, and the search unit registers the memory address of the distribution information and the base address of the interface information returned from the distribution unit and the output destination management unit in the forwarding information via the operating system.
4. A forwarding method of a forwarding device that forwards packets within a network, comprising: a forwarding control step of determining an interface to be an output destination of the packets based on a predetermined sorting rule so as to sort a traffic flow of the packets heading for the same destination to an interface registered in a predetermined output destination group; and an output step of outputting the packets to the interface determined as the output destination, wherein the forwarding device has a memory unit that stores forwarding control information used in the forwarding control step, and the memory unit includes, as the forwarding control information: interface information that describes, for each output destination group, access information of interfaces registered in each output destination group, and the position where the access information of each interface is described can be specified by an offset address that specifies an offset amount from the position where the first interface is described; sorting information that describes, for each hash value calculated from numerical data included in the packet, the offset address in the interface information of the interface sorted by the sorting rule; For each specific address range that is the destination of the packet, forwarding information is stored that describes predetermined identification information of the output destination group, a base address specifying the description position of the first interface of the output destination group in the interface information, and a memory address for accessing the distribution information applied to the output destination group, and the transfer control step includes a search step of acquiring from the forwarding information the base address in the interface information of the output destination group corresponding to the destination of the packet and the memory address of the distribution information, a distribution step of calculating the hash value from numerical data included in the packet, accessing the distribution information by referring to the memory address acquired in the search step, and acquiring the offset address of the interface assigned to the calculated hash value,a destination determination step of accessing the interface information and acquiring access information of the interface assigned to the hash value by referring to the base address acquired in the search step and the offset address acquired in the allocation step, wherein the output step outputs the packet to the interface based on the access information of the interface acquired in the output destination determination step.
Citation Information
Patent Citations
Packet forwarding apparatus and method using flow subgroup based path selection for dynamic load balancing
US20150163146A1
Distributed router forwarding architecture employing global translation indices
US7292569B1