# Patent

## Title
Core-trunking across cores on physically separated processors allocated to a virtual machine based on configuration information including context information for virtual machines

## Abstract

Techniques for providing core-based virtualization based upon cores provided by one or more processors of a system. A device such as a network device comprising multiple processor cores provides for core-based virtualization. According to one embodiment, a network device is provided comprising a first subsystem for processing packets received by the network device. The first subsystem may comprise a set of one or more processors, the one or more processors providing a plurality of cores. Each core in the plurality of cores may have associated memory resources.

## Background
BACKGROUND
The present application relates to virtualization and more particularly to core-based virtualization.
Virtualization implies that one or more virtual machines may be configured for a network device. The virtual machines enable the network device to act like multiple virtual network devices. However, the creation and management of virtual machines can get quite complicated, since resources of the network device must be manual partitioned between the virtual machines. For example, configuring virtual machines typically required complicated tweaking and partitioning of processor-related or memory-related resources.
BRIEF SUMMARY
Embodiments of the present invention provide virtualization based upon cores (core-based virtualization) provided by one or more processors of a system. A device such as a network device comprising multiple processor cores provides for core-based virtualization.
According to an embodiment of the present invention, a network device is provided comprising a first subsystem for processing packets received by the network device. The first subsystem may comprise a set of one or more processors, the one or more processors providing a plurality of cores. Each core in the plurality of cores may have associated memory resources. The cores provide the basis for core-based virtualization.
In one embodiment, the network device may store configuration information for a set of virtual machines configured for the network device. For each virtual machine in the set of virtual machines, the configuration information may comprise information identifying a set of one or more cores allocated to the virtual machine from the plurality of cores. Further, for each virtual machine in the set of virtual machines, the memory resources associated with the set of cores allocated to the virtual machine are automatically allocated for the virtual machine.
In one embodiment, when a packet is received by the network device, a second subsystem of the network device may cause the packet to be forwarded to a first core from a set of cores allocated to a first virtual machine from the set of virtual machines configured for the network device. In one embodiment, contents from the packet may be extracted and the first core determined based upon the extracted contents of the packet.
Various techniques may be used to determine the first core to which the packet is to be forwarded. In one embodiment, one or more lookups (e.g., CAM or table lookups) may be performed using the extracted packet contents to determine the first core.
In one embodiment, the network device may further comprise a switch fabric. After the first core has been determined based upon the extracted contents, the packet may be forwarded to the switch fabric. The switch fabric may then forward the packet to the first core from the set of cores allocated for the first virtual machine. In one embodiment, the packet is written to the memory resource associated with the first core.
In one embodiment, the network device may be configured to determine the first virtual machine from the set of virtual machines, determine the set of cores allocated to the first virtual machine, and determine the first core from the set of cores allocated to the first virtual machine. The packet may then be forwarded to the selected core for processing.
Techniques are provided for configuring virtual machines for a network device. In one embodiment, a network device may receive a request to configure a virtual machine based upon a set of cores provided by a set of processors of the network device. The network device may also receive information identifying one or more cores from the set of cores to be allocated for the virtual machine to be configured. The network device may then configure a virtual machine wherein the identified one or more cores and associated memory resources are allocated to the virtual machine. Information related to the virtual machine that is configured may be stored in a memory of the network device.
The foregoing, together with other features and embodiments will become more apparent when referring to the following specification, claims, and accompanying drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a simplified block diagram of a network device that may incorporate an embodiment of the present invention;
FIG. 2 is a simplified block diagram of a network device that may incorporate an embodiment of the present invention;
FIG. 3 depicts a high level simplified flowchart depicting a method performed by a network device for configuring a core-based virtual machine according to an embodiment of the present invention; and
FIG. 4 depicts a high level simplified flowchart depicting a method performed by a network device providing core-based virtualization upon receiving a packet according to an embodiment of the present invention.



DETAILED DESCRIPTION
In the following description, for the purposes of explanation, specific details are set forth in order to provide a thorough understanding of embodiments of the invention. However, it will be apparent that the embodiments of the invention may be practiced without these specific details.
Embodiments of the present invention provide virtualization based upon cores (core-based virtualization) provided by one or more processors in a system. In one embodiment, a device such as a network device comprising multiple processor cores provides for core-based virtualization.
FIG. 1 is a simplified block diagram of a network device 100 that may incorporate an embodiment of the present invention. Network device 100 may be any device that is configured to receive and forward data. The data processing performed by network device 100 for forwarding data may include for example Layer 2-3 and/or Layer 4-7 processing. Examples of network device 100 include a switch, a router, an application delivery controller (ADC), or any other device that is configured to receive and forward data. For example, network device 100 may be a device provided by Brocade Communications Systems, Inc. FIG. 1 is merely illustrative of an embodiment of the present invention and is not intended to limit the scope of the invention as recited in the claims. Various variations and modifications are possible in alternative embodiments.
In the embodiment depicted in FIG. 1, network device 100 comprises multiple subsystems including an input/output (I/O) subsystem 102, a switch fabric 104, a data processing subsystem 106 and a management subsystem 108. Network device 100 supports virtualization based upon processor cores provided by data processing subsystem 106. As depicted in FIG. 1, data processing subsystem 106 comprises multiple processors 110A, 110B, and 110C (referred to generally as processors 110). Each processor 110 may support one core or multiple processor cores (referred to as “cores”). For example, in the embodiment depicted in FIG. 1, each of the processors 110A, 110B, and 110C supports two cores, i.e., each processor is a dual-core processor. In alternative embodiments, processors 110 in data processing subsystem 106 may support different numbers of cores. For example, in an alternative embodiment, the number of cores provided by processor 110A may be different from the number of cores provided by processor 110B. Accordingly, the number of processors included in a network device and the number of cores provided by each of the processors may vary in alternative embodiments.
Each core has its own associated memory resources 112 that may be used by the core for performing processing. In one embodiment, memory resources associated with one core cannot be used by another core. In other embodiments, the memory resources associated with one core may be used by another core. The memory resources 112 associated with a core may include one or more memories such as a content addressable memory (CAM), a RAM, and other memories. By providing an architecture in which each core has its own associated memory resources, allocation of a core also automatically allocates the memory resources associated with that core. In this manner, a user of network device 100 does not have to worry about partitioning and managing memory resources among the cores.
The cores in data processing subsystem 106 provide the basis for virtualization provided by network device 100. Virtualization implies that one or more virtual machines may be configured for network device 100. The virtual machines configured for network device 100 enable network device 100 to act like multiple virtual network devices. In one embodiment, one or more virtual machines for network device 100 may be configured based upon the cores provided by data processing subsystem 106, with each virtual machine being allocated one or more cores from the cores provided by network device 100. This is referred to as core-based virtualization.
Using core-based virtualization, network device 100 may be partitioned in multiple virtual machines based upon the cores provided by network device 100, with each virtual machine being aware of and using one or more cores allocated to that virtual machine and using memory resources associated with the cores allocated to that virtual machine. Each virtual machine may be configured such that it operates as a discrete virtual instance of network device 100. Consequently, as a result of virtualization, network device 100 may operate as several different discrete virtual network devices.
In one embodiment, a virtual machine may be configured for network device 100 by assigning a unique identifier (unique within network device 100) to the virtual machine and allocating a discrete number of one or more cores provided by data processing subsystem 106 to the virtual machine. Since each core has its own set of associated memory resources 112, by allocating a set of cores to a virtual machine, the memory resources associated with cores are also automatically allocated to that virtual machine. Accordingly, by providing an architecture in which each core has its associated memory resources, the allocation of both processing resources and memory resources for a virtual machine is automatically taken care of by simply allocating one or more cores to that virtual machine. This in turn simplifies the creation and management of virtual machines since manual partitioning of memory resources between the virtual machines, which can get quite complicated, does not have to be done. Core-based virtualization thus provides a clean and simple way for partitioning both processing resources and memory resources among virtual machines configured for network device 100. Configuring a virtual machine is done by simply allocating a discrete number of cores to the virtual machine. It does not require complicated tweaking and partitioning of processor-related or memory-related resources.
Grouping of cores for allocation to a virtual machine is sometimes referred to as core trunking. A core trunk may comprise a specified number of cores (e.g., 1, 2, 3, 4, 5, etc. cores). A core trunk may be allocated to a virtual machine.
As described above, one or more cores may be allocated to a virtual machine. The cores allocated to a virtual machine may include cores provided by the same processor or cores provided by different processors. For example, for the embodiment depicted in FIG. 1 comprising three dual-core processors, the virtual machines may be configured as follows:
VM1=cores C1 and C2 of processor 110A
VM2=core C1 of processor 110B
VM3=core C2 of processor 110B and cores C1 and C2 of processor 110C
In the above example, virtual machine VM1 is allocated two cores from the same processor, virtual machine VM2 is allocated a single core from one processor, and virtual machine VM3 is allocated three cores from two different processors.
In one embodiment, a core allocated to one virtual machine cannot be allocated to another virtual machine. Further, a discrete number of cores need to be allocated for each virtual machine. As a result, the number of virtual machines that can be configured for a network device is dependent upon the total number of cores provided by the network device. For example, for the embodiment depicted in FIG. 1 providing six cores, a maximum of six virtual machines may be configured for network device 100, each virtual machine being allocated a single core.
Information related to virtual machines configured for network device 100 may be stored and managed by management subsystem 108 of network device 100. As depicted in FIG. 1, management subsystem 108 may comprise a CPU 114 and a memory 116. Memory 116 may store information 118 related to virtual machines configured for network device 100. For example, information 118 may comprise, for each virtual machine configured for network device 100, an identifier used for referencing the virtual machine and information identifying one or more cores allocated to the virtual machine.
In one embodiment, configuration information 118 may comprise multiple configuration files corresponding to the multiple virtual machines configured for network device 100. A configuration file created for a virtual machine and stored in memory 116 may identify a virtual machine and a set of one or more cores allocated to the virtual machine. The configuration information for a virtual machine may also include other information that defines a context for the virtual machine. The context information may identify the type of processing performed by the virtual machine, for example, the type of services provided by the virtual machine. The context information may also specify the type of data traffic to be forwarded to the virtual machine for processing, and other information.
In one embodiment, management subsystem 108 is configured to control and manage the various subsystems of network device 100. For example, management subsystem 108 may be configured to program I/O subsystem 102 based upon information 118 related to virtual machines that enables I/O subsystem 102 to determine particular virtual machines for processing packets received by network device 100 (as described below in further detail). Programs or code or instructions 120 that enable core-based virtualization related processing may be stored in memory 116 of management subsystem 108. These programs or code or instructions may be executed by CPU 114 of network device 100.
In the embodiment depicted in FIG. 1, configuration information 118 is stored within memory 116 of management subsystem 108. However, this is not intended to limit the scope of the invention embodiments recited in the claims. The configuration information may also be stored in other memories of network device 100 or in a memory location accessible to network device 100.
In one embodiment, network device 100 is configured to receive and forward data packets. In one embodiment, I/O subsystem 102 may comprise ports 109 via which data packets are received and forwarded by network device 100. A port may be classified as an input port or an output port depending upon whether a data packet is received or transmitted from network device 100 using the port. A port over which a data packet is received by network device 100 is referred to as an input port. A port used for communicating or forwarding a data packet from network device 100 is referred to as an output port. A particular port may function both as an input port and an output port. Ports 109 may be capable of receiving and/or transmitting different types of data traffic at different speeds including 1 Gigabit/sec, 10 Gigabits/sec, 40 Gigabits/sec, or more. In some embodiments, multiple ports of network device 100 may be logically grouped into one or more trunks.
Upon receiving a data packet via an input port, network device 100 is configured to perform processing to determine an output port for transmitting the data packet from the network device to facilitate transmission of the data packet to its intended destination. The data packet is then forwarded within network device 100 from the input port to the determined output port (or multiple output ports). The data packet is then forwarded from network device 100 using the output port.
In one embodiment, for a packet received by network device 100, I/O subsystem 102 is configured to analyze the packet to determine a processing entity within network device 100 for processing the packet. The processing entity may be a virtual machine from the set of virtual machines configured for network device 100 or CPU 114. In one embodiment, I/O subsystem 102 is configured to extract information (e.g., header information) from the data packet, analyze the extracted information, and determine a processing entity for the data packet. In one embodiment, I/O subsystem 102 may perform one or more memory lookups based upon the information extracted from the data packet to determine a processing entity for the packet, wherein the processing entity is a virtual machine from the set of virtual machines configured for the packet or CPU 114. For example, in one embodiment, CAM lookups may be performed using the extracted information to determine where the packet is to be forwarded for further processing.
In one embodiment, upon receipt of a packet, I/O subsystem 102 uses the configuration information stored for the various virtual machines configured for network device 100 to determine a virtual machine to which the packet is to be forwarded for processing. In one embodiment, this may be performed based upon the context information for the various virtual machines included in the virtual machines configuration information. For a determined virtual machine, the network device may also determine a set of one or more cores allocated to that virtual machine and select one or more cores from the set of cores to which the data packet is to be forwarded. In one embodiment, I/O subsystem 102 may perform one or more memory or table lookups to determine the one or more cores to which the packet is to be forwarded.
I/O subsystem 102 then causes the data packet to be communicated to the determined one or more cores. For instance, in the example provided above, I/O subsystem 102 may determine that a packet is to be processed by virtual machine VM3. I/O subsystem 102 may then determine that core C2 of processor 110B and cores C1 and C2 of processor 110C are allocated to VM3. I/O subsystem 102 may then select core C2 of processor 110B and cause the data packet to be communicated to core C2 of processor 110B.
In an alternative embodiment, the packet may be forwarded to multiple cores from the set of cores allocated to the virtual machine determined for packet processing. For example, for virtual machine VM3, the packet may be forwarded to core C2 of processor 110B and also to cores C1 and C2 of processor 110C for further processing.
In one embodiment, switch fabric 104 provides connectivity between data processing subsystem 106 and I/O subsystem 102. I/O subsystem 102 is configured to forward the data packet to switch fabric 104, which is then configured to communicate the packet to the cores determined for that packet by I/O subsystem 102. In one embodiment, switch fabric 104 communicates a packet to a selected core by writing the packet to the memory resource associated with the selected core. The selected core may then process the packet written to its memory resources.
After a packet has been communicated to a core, the core may perform further processing on the data packet. In one embodiment, a core may perform processing to determine an output port of network device 100 to be used for forwarding the packet from network device 100 to facilitate communication of the packet to its intended destination. A core may also perform other types of processing based upon the services to be provided by the core. Examples of services include security handling, web traffic management, VLAN processing, and the like.
After an output port has been determined for a packet, a core forwards the packet to switch fabric 104, which then communicates the packet to I/O subsystem 102. I/O subsystem 102 is then configured to transmit the packet from network device using the determined output port.
In exemplary network device 100 described above, by simply allocating one or more cores to a virtual machine, the memory resources associated with the allocated cores are automatically allocated to the virtual machine without needing any special processing or tweaking. The architecture of the network device including the manner in which memory resources are allocated to the cores enables core-based virtualization to be done in hardware.
FIG. 2 is a simplified block diagram of a network device 200 that may incorporate an embodiment of the present invention. In one embodiment, network device 200 may be configured as an application delivery controller (ADC). For example, network device 200 may be an ADC provided by Brocade Communications Systems, Inc. An ADC such as ADC 200 depicted in FIG. 2 may be configured to perform various functions such as load balancing across a server farm, across firewalls, across intrusion prevention systems, and the like. For example, an ADC may be configured to offload data traffic to appropriate servers to ensure higher availability and security at extreme data rates, while lowering Total Cost of Ownership (TCO). An ADC may be provided in a chassis-based model and/or a stackable model. In one embodiment, ADC 200 includes hardware and software to enable core-based virtualization. The ADC embodiment depicted in FIG. 2 is merely an example and is not intended to limit the scope of embodiments of the present invention recited in the claims.
Network device (ADC) 200 may comprise one or more management cards (not shown) configured to perform management-related processing, one or more application switch modules 210 (ASMs) configured to perform data processing, a switch fabric 208, and one or more I/O cards 204. In the embodiment depicted in FIG. 2, network device 200 comprises four I/O cards 204 (also referred to as line cards). Each I/O line card is coupled to ports 202 and comprises a packet processor 206. An I/O card 204 is configured to perform I/O related operations. This may include receiving a packet via one or more ports 202, analyzing the packet to determine one or more processing entities (e.g., a virtual machine or to a CPU for software processing) to which the packet is to be forwarded for processing. As part of this processing, I/O card 204 is configured to, based upon information extracted from a data packet, determine a virtual machine to which the data packet is to be forwarded for processing and determine the one or more cores allocated to the determined virtual machine. I/O subsystem card 204 may then forward the data packet to switch fabric 208 for communication to one or more of the determined cores. An I/O card 204 may also receive packets from the cores via switch fabric 208 and forward the packets from network device 200 using the output ports determined from the processing performed by the cores. In one embodiment, the processing performed by I/O card 204 such as processing to determine a processing entity to which a packet is to be forwarded may be performed by packet processor (PP) 206 on the I/O card. In the embodiment depicted in FIG. 2, each I/O card 204 is a 4×10 G linecard.
Switch fabric 208 provides connectivity between I/O cards 204 and ASMs 210. Switch fabric 208 receives packets from I/O cards 204 and forwards the packets to appropriate ASMs 210. Switch fabric 208 receives packets from ASMs 210 and forwards the packets to appropriate I/O cards 204.
ASMs 210 represent the data processing subsystem in network device 200. Each ASM 210 may comprise multiple processors, with each processor providing one or more cores. In the embodiment depicted in FIG. 2, network device 200 comprises four ASM cards 210A, 210B, 210C, and 210D (referred to generally as ASM 210), each ASM comprising four dual-core processors. Accordingly, each ASM 210 provides eight cores (labeled AC1, AC2, AC3, AC4, AC5, AC6, AC7, and AC8 in FIG. 2) for a total of thirty-two cores for ADC 200. Accordingly, ADC 200 can support a maximum of 32 different virtual machines (virtual ADCs), each virtual ADC being aware of and using resources that are allocated to that virtual machine. In alternative embodiments, the processors on an ASM module may support more or less cores than those depicted in FIG. 2.
Core-based virtualization may be provided based upon the cores provided by ASMs 210. Core trunking across multiple ASMs may be provided. For example, in the example shown in FIG. 2, six virtual machines have been configured as follows:
(1) Virtual machine “CT1” with allocated cores AC1, AC2, AC3, AC4 provided by ASM 210A;
(2) Virtual machine “CT2” with allocated cores AC5, AC6, AC7, and AC8 provided by ASM 210A and cores AC1, AC2, AC3, and AC4 provided by ASM 210B;
(3) Virtual machine “CT3” with allocated cores AC5, AC6, AC7, and AC8 provided by ASM 210B;
(4) Virtual machine “CT4” with allocated cores AC1 and AC2 provided by ASM 210C;
(5) Virtual machine “CT5” with allocated cores AC3, AC4, AC5, AC6, AC7, and AC8 provided by ASM 210C; and
(6) Virtual machine “CT6” with allocated cores AC1, AC2, AC3, and AC4 provided by ASM 210D.
Cores AC5, AC6, AC7, and AC8 of ASM 210D have not yet been allocated to any virtual machine and are available for allocation.
As described above, ASM 210 may receive a packet from an I/O linecard 204 via switch fabric 208. The packet may be received by an AXP 212 on an ASM. AXP 212 may then forward the packet to the appropriate set of cores using an internal switch fabric. In the outgoing direction, packets processed by an ASM may be forwarded to one or more linecards 204 via switch fabric 208. The packets may then be forwarded from network device 200 using one or more output ports of the network device.
An ADC such as ADC 200 depicted in FIG. 2 may be configured to perform various functions such as load balancing across a server farm, across firewalls, across intrusion prevention systems, and the like. In one embodiment, ADC 200 may interface to multiple servers and perform load balancing across the servers. In one such embodiment, in the forward flow direction the ADC may receive data packets from a network and forward the packets to one or more of the servers. In the reverse flow direction, the ADC may receive packets from the servers and forward them over the network. During forward flow processing, an I/O subsystem of the ADC may receive a packet, determine a virtual machine to which the packet is to be forwarded, and then cause the packet to be forwarded to one or more cores corresponding to the determined virtual machine for processing. In one embodiment, the I/O subsystem may perform one or more memory or table lookups to determine the virtual machine to which the packet is to be forwarded. The memory or table lookups may also yield the cores corresponding to the virtual machine. The memory or table lookups may also yield one or more cores from the cores allocated to the virtual machine to which the packet is to be forwarded. After processing by the cores, the packet may be forwarded by the ADC to one or more servers from the multiple servers.
During reverse flow processing, the ADC may receive a packet from a server from the multiple servers. The I/O subsystem of the ADC may then determine a virtual machine to which the packet is to be forwarded, and forward the packet to one or more of the cores corresponding to the virtual machine. The packet may then be forwarded over the network.
Using core-based virtualization, a physical ADC, such as ADC 200 depicted in FIG. 2, may be configured to provide several virtual machines, each virtual machine acting as a virtual ADC instance and performing ADC-related processing. Each virtual ADC may provide the following capabilities (or a subset thereof): efficient server load balancing (SLB), intelligent application content inspection and switching; disaster recovery and Global Server Load Balancing (GSLB); robust application security shielding server farms and applications from wire-speed multi-Gigabit-rate DoS, DDos, virus, and worm attacks; support enterprise environments running IP- and Web-based applications; protect server farms against multiple forms of DoS attacks; high-availability application switching; HTTP multiplexing; application rate limiting; high-performance access control; application redirection; advanced firewall and security device load balancing; transparent cache switching; and other functions. Accordingly, each virtual machine created using core-based virtualization may function as a separate ADC.
FIG. 3 depicts a high level simplified flowchart 300 depicting a method performed by a network device for configuring a core-based virtual machine according to an embodiment of the present invention. The processing depicted in flowchart 300 may be performed in software (e.g., instructions, code, program) executed by a processor, in hardware, or in combinations thereof. The software may be stored on a computer-readable storage medium. In one embodiment, the processing is performed by CPU 114 depicted in FIG. 1. The processing in FIG. 3 may be initiated by a user of the network device (e.g., a network administrator).
The processing in FIG. 3 may be initiated upon receiving a request to configure a virtual machine for a network device (step 302). The request may be received from various different sources. Information may be received identifying an identifier to be associated with the virtual machine to be created (step 304). The identifier may then be used to refer to the virtual machine (e.g., “VM1”, “CT1” etc.). The identifier is typically unique within the network device. Information is received identifying one or more cores to be allocated to the virtual machine (step 306). In one embodiment, the information received in 304 may specifically identify the cores to be included in the virtual machine. For example, the information may indicate cores C1 and C2 of processor 1 and C1 of processor 2, etc. In another embodiment, the information received in 306 may simply identify the number of cores to be allocated to the virtual machine and the specified number of cores may then be automatically identified from the available cores and allocated to the virtual machine.
Other configuration information may be received for the virtual machine to be created (step 308). The configuration information may, for example, comprise information identifying a context for the virtual machine. The context information may include identifying a set of source addresses, a set of services (e.g., web traffic forwarding, security handling, load balancing, etc.), IP addresses, L2 VLAN information, destination addresses, or other information. In one embodiment, the configuration information for a virtual machine may identify the type of data traffic to be forwarded to the virtual machine for processing. The configuration information stored for multiple virtual machines is used to map a packet to a specific virtual machine and to one or more cores allocated to that virtual machine. In one embodiment, the information received in 304, 306, and 308 may be included in the request received in 302.
A virtual machine is then created based upon the information received in 304, 306, and 308 (step 310). As part of 310, configuration information may be stored for the virtual machine identifying the identifier to be used for referencing the virtual machine, information identifying the one or more cores allocated to the virtual machine, and other configuration information including context information for the virtual machine. As part of 310, the cores identified in 306 are allocated to the virtual machine that is configured. Further, as part of 310, the memory resources associated with the cores identified in 306 are automatically allocated to the virtual machine.
As can be seen from the processing depicted in FIG. 3, the user does not have to worry about allocating memory resources for the virtual machine that is created. By simply identifying the cores to be allocated for the virtual machine, the memory resources associated with those cores are automatically allocated to the virtual machine. This makes it very easy to configure virtual machines.
FIG. 4 depicts a high level simplified flowchart 400 depicting a method performed by a network device providing core-based virtualization upon receiving a packet according to an embodiment of the present invention. The processing depicted in flowchart 400 may be performed in software (e.g., instructions, code, program) executed by a processor, in hardware, or in combinations thereof. The software may be stored on a computer-readable storage medium.
As depicted in FIG. 4, the processing may be initiated when a network device receives a packet (step 402). For example, the processing may be initiated when an I/O subsystem of the network device receives a data packet.
The packet is then analyzed to determine a virtual machine to which the packet is to be forwarded (step 404). In one embodiment, the I/O subsystem may extract contents of the received packet and use the extracted contents to determine the one or more virtual machines to which the packet is to be forwarded for processing. For example, the header of the packet or portions thereof may be extracted and used to determine a virtual machine for processing the packet. Configuration information stored for the virtual machines supported by the network device may be used to determine the one or more virtual machines. For example, based upon the analysis of the contents of the packet, the network device may determine a type of service to be performed for the packet and then identify a virtual machine configured to provide that service. As another example, the network device may determine a data stream to which the packet belongs and identify a virtual machine that is configured to process that data stream. In one embodiment, memory lookups (e.g., CAM lookups, table lookups) may be performed using the information extracted from the packet to determine the virtual machine in 404.
A set of one or more cores allocated to the virtual machine determined in 404 is then determined (step 406). This may be determined from information related to the virtual machine stored by the network device. In one embodiment, one or more memory lookups (e.g., CAM lookups, table lookups) may be performed using the information extracted from the packet to determine both the virtual machine and the set of cores corresponding to the determined virtual machine. The CAMs and/or tables may be configured using configuration information 118 to enable the lookups.
One or more cores may then be selected from the set one or more cores determined in 406 (step 408). In one embodiment, a single core is selected from the set of cores. Various different factors or techniques may be used for selecting the one or more cores in 408 from the set of cores determined in 406. In one embodiment, load balancing processing may be performed on the cores identified in 406 to select a core from the set of cores. In an alternative embodiment, one or more of the cores in the set of cores determined in 406 may be selected in 408.
In one embodiment, memory lookups (e.g., CAM lookups, table lookups) may be performed to select the one or more cores in 408. For example, one or more memory lookups may be performed using the information extracted from the packet to determine one or more cores to which the packet is to be forwarded. The CAMs and/or tables may be configured using configuration information 118 to enable the lookups.
The packet is then forwarded to the one or more cores identified in 408 (step 410). Different techniques may be used to forward the packet to the selected one or more cores. In one embodiment, the I/O subsystem of the network device forwards the packets to a switch fabric, which is then configured to write the packet to the memory resources associated with the one or more cores selected in 408. The packet may be stamped with the one or more cores to which the packet is to be sent. In some embodiments, the packet may be forwarded to all the cores determined in 406. In such an embodiment, the selecting step of 408 may not be required.
The one or more cores receiving the packet may then process the packet (step 412). In one embodiment, the memory resources associated with the one or more cores are used for processing the packet.
In one embodiment, the processing depicted in steps 402, 404, 406, 408 and 410 may be performed by an I/O subsystem of the network device.
Although steps 404, 406, and 408 are shown as separate steps in FIG. 4, the processing may be performed in a single step wherein the information extracted from the packet is used to perform lookups in one or more CAMs or tables and the lookups yield one or more cores to which the packet is to be forwarded. The CAMs and tables may be configured based upon configuration information related to the virtual machines such that lookups in the CAM yield the one or more cores to which the packet is to be forwarded. For example, for the embodiment depicted in FIG. 1, the CAMs or tables may be configured by management subsystem 108 based upon configuration information 118.
By providing core-based virtualization, as described above, a network device may be partitioned into multiple virtual machines, with each virtual machine acting as a separate network device. Each virtual machine may act as an instance of the network device (e.g., virtual ADC instances) providing all or a subset of features provided by the network device. The virtual machines within a network device may be configured to perform the same or different types of processing. A virtual machine may be treated just as another network device and be allocated network interfaces and VLANs, load balancing objects, policies and health checks. Users and user roles may be created for the virtual machines. Each virtual machine may have sufficient parameters to define maximum values for key variables by the global administrator.
Various tools (e.g., graphical user interfaces (GUIs), command-line interfaces (CLIs)) may be provided for obtaining information about virtual machines configured for a network device. The information that may be obtained for a virtual machine may include the identifier for the virtual machine, the cores allocated to the virtual machine, the type of data to be forwarded to the virtual machine for processing, types of services provided by the virtual machine, statistical information for the virtual machine, and the like. The information may be obtained for particular one or more virtual machines or for all the virtual machines globally defined.
In one embodiment, different functions or applications may be assigned to the different virtual machines configured for a network device. Further, a virtual machine is shielded from other virtual machines that may be configured for the network device. The virtual machines thus provide for application/function isolation within a network device while maintaining the performance and quality of service characteristics. The shielding also provides for security isolation. For example, for a virtual machine, any crash or failure of one or more cores allocated to that virtual machine does not affect the continued operation of other virtual machines. In this manner, one virtual machine is shielded from other virtual machines. For example, activities such as reconfiguration of a virtual machine, disabling/enabling a virtual machine, editing the virtual machine in any way, etc. do not affect the working of other virtual machines configured for the network device. Further, total system scaling does not change with virtualization configured for a network device. The same system maximums still apply, but will get divided amongst the virtual machines.
Core-based virtualization provides elasticity in provisioning resources for applications (e.g., business applications) within a single chassis of a network device while ensuring that the flexibility also provides the same performance, security, and quality of service characteristics of a single instance of the platform. By dynamically aggregating a group of processor cores and their associated compute resources, core-based virtualization enables a network device to act as multiple network devices. This gives users (e.g., business enterprises) of a network device a hardware solution that allows a single network device to act as if there are multiple network devices with minimal performance degradation, software systems overhead, and operational overhead of defining an entire class of resources that are rate-limited. For example, if the network device is an ADC, different virtual ADCs may be configured for performing different functions. Different SLAs may be provided for the different functions while providing the performance guarantee and providing security isolation among the functions/applications. These are building blocks of cloud computing that requires such an adaptive infrastructure. Core-based virtualization also offers the scalability desired by users such as service providers of voice, video, data that need the ability to ramp up quickly as new customers join. This helps them in scaling and changing to business needs quickly, while promoting performance and security isolation.
Although specific embodiments of the invention have been described, various modifications, alterations, alternative constructions, and equivalents are also encompassed within the scope of the invention. Embodiments of the present invention are not restricted to operation within certain specific data processing environments, but are free to operate within a plurality of data processing environments. Additionally, although embodiments of the present invention have been described using a particular series of transactions and steps, it should be apparent to those skilled in the art that the scope of the present invention is not limited to the described series of transactions and steps.
For example, while the various embodiments described above have been in the context of network devices, the teachings herein may be applied to other computing devices besides networking devices and may be used in different domains other than networking. For instance, teachings of the present invention may be applicable in a computing device application, such as a PC or a server or a super computer, having one or more processors with multiple cores, each core having associated memory resources.
Further, while embodiments of the present invention have been described using a particular combination of hardware and software, it should be recognized that other combinations of hardware and software are also within the scope of the present invention. Embodiments of the present invention may be implemented only in hardware, or only in software, or using combinations thereof.
The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. It will, however, be evident that additions, subtractions, deletions, and other modifications and changes may be made thereunto without departing from the broader spirit and scope as set forth in the claims.

## Claims

1. A network system comprising:
a data subsystem comprising a first processor comprising a first core and a second processor comprising a second core,
the first processor being physically separate from the second processor, each core having associated memory resources, the memory resources for each core being accessible by the other core, and
the memory resources for each respective core being associated with the core prior to receiving a request to configure a virtual machine, wherein the virtual machine is one of a plurality of virtual machines; and
a management subsystem coupled to the data subsystem and configured to:
receive the request to configure the virtual machine, the request comprising configuration information including context information for the virtual machine and identifying the first core and the second core to be allocated to the virtual machine; and
configure the virtual machine based upon the request, wherein the virtual machine is configured by allocating the first core and the second core to the virtual machine, and applying core-trunking across the cores on the first and the second processor, and the memory resources pre-associated with the first core and the second core prior to receiving the request.

2. The network system of claim 1 wherein an I/O subsystem is configured to:
extract contents from a packet; and
perform a lookup using the extracted contents to determine a core for processing the packet.

3. The network system of claim 1, further comprising an Input/Output (I/O) subsystem configured to:
receive a packet;
determine a first virtual machine from the plurality of virtual machines by analyzing the packet;
determine a set of one or more cores allocated to the first virtual machine, using configuration information for the first virtual machine; and
determine a core for processing the packet from the set of one or more cores, using the configuration information.

4. The network system of claim 1, further comprising a memory configurable to store the configuration information for the virtual machine, the memory separate from the memory resources associated with the first and the second cores.

5. The network system of claim 1, further comprising a second subsystem configurable to receive a packet and cause the packet to be forwarded to a core from the first and the second cores allocated to the virtual machine.

6. The network system of claim 1, further comprising a second subsystem configurable to receive a packet and cause contents of the packet to be written to the memory resources pre-associated with a core from the first or the second core allocated to the virtual machine.

7. A method performed by a network device comprising: storing, at the network device, configuration information for a set of virtual machines configured for the network device;
wherein, for at least one virtual machine from a plurality of virtual machines, the configuration information comprises:
context information for the at least one virtual machine, information identifying a first core from a first processor and a second core from a second processor by applying core-trunking across the cores on the first processor and the second processor, the first processor being physically separate from the second processor, the first and second cores allocated to the at least one virtual machine,
each core having associated memory resources,
the memory resources for each core being accessible by at least another core from the plurality of cores, and
the memory resources for each respective core being associated with the core prior to allocation of the core to the at least one virtual machine, and

wherein, for the at least one virtual machine from the plurality of virtual machines, the memory resources pre-associated with the first and the second cores allocated to the at least one virtual machine are allocated for the at least one virtual machine; and
causing, by the network device, a packet to be forwarded to a core from the first and the second cores allocated to the virtual machine from the plurality of virtual machines.

8. The method of claim 7 wherein the causing the packet to be forwarded comprises:
extracting contents from the packet; and
determining the core based upon the extracted contents.

9. The network device of claim 8 wherein the determining comprises:
performing one or more lookups in one or more memories in the network device using the extracted contents to determine the core.

10. The method of claim 8 further comprises:
forwarding the packet to a switch fabric of the network device after determining the core based upon the extracted contents; and
forwarding the packet from the switch fabric to the core.

11. The method of claim 7 wherein the causing the packet to be forwarded comprises writing the packet to the memory resource pre-associated with the core.

12. The method of claim 7 wherein the causing the packet to be forwarded comprises:
determining the at least one virtual machine from the plurality of virtual machines by analyzing the packet;
determining the first and the second cores allocated to the at least one virtual machine; and
determining the first core from the first and the second cores to forward the packet to.

13. A computer-readable memory storing a plurality of instructions for controlling a network device comprising a first processor and a second processor, the plurality of instructions comprising:
instructions that cause the network device to store configuration information by applying core-trunking across cores of the first processor and the second processor for a set of virtual machines configured for the network device;
wherein, for at least one virtual machine in the set of virtual machines, the configuration information comprises:
context information for the at least one virtual machine,
information identifying a set of one or more cores comprising a first core from the first processor and a second core from the second processor, the first processor being physically separate from the second processor, allocated to the at least one virtual machine, the set of one or more cores provided by one or more processors of the network device,
each core in the set of one or more cores having associated memory resources, the memory resources for each core being accessible by at least another core from the set of one or more cores, and
the memory resources for each respective core being associated with the core prior to allocation of the core to the at least one virtual machine, and
wherein, for at least one virtual machine in the set of virtual machines, the memory resources pre-associated with the set of one or more cores allocated to the at least one virtual machine are allocated for the at least one virtual machine;
instructions that cause the network device to cause a packet to be forwarded to a core from a set of one or more cores allocated to the at least one virtual machine from the set of virtual machines.

14. The computer-readable memory of claim 13 wherein the instructions that cause the processor to cause the packet to be forwarded to the core comprise:
instructions that cause the network device to extract contents from the packet; and
instructions that cause the network device to determine the core based upon the extracted contents.

15. The computer-readable memory of claim 14 wherein the instructions that cause the network device to determine the core comprise instructions that cause the network device to perform one or more lookups in one or more memories using the extracted contents to determine the core.

16. The computer-readable memory of claim 14 wherein the instructions that cause the network device to cause the packet to be forwarded to the core comprise:
instructions that cause the network device to forward the packet to a switch fabric of the network device after determining the core based upon the extracted contents; and
instructions that cause the packet to be forwarded from the switch fabric to the core.

17. The computer-readable memory of claim 13 wherein the instructions that cause the network device to cause the packet to be forwarded to the core comprise instructions that cause the packet to be written to the memory resource pre-associated with the core.

18. The computer-readable memory of claim 13 wherein instructions that cause the network device to cause the packet to be forwarded to the core comprise:
instructions that cause the network device to determine the at least one virtual machine from the set of virtual machines by analyzing the packet;
instructions that cause the network device to determine the set of one or more cores allocated to the at least one virtual machine; and
instructions that cause the processor to determine the first core from the set of one or more cores allocated to the at least one virtual machine.

19. A method comprising:
responsive to a request to configure a virtual machine based upon a set of cores provided by a set of processors of a network device, accessing, at the network device, information, derived by applying core-trunking on the set of cores provided by the set of processors, including context information for the virtual machine and identifying a first processor comprising a first core and a second processor comprising a second core from the set of cores to be allocated for the virtual machine to be configured, wherein the first processor and the second processors are physically separate processors;
configuring the virtual machine, the configuring comprising allocating the one or more cores and memory resources associated with each core to the virtual machine,
wherein the memory resources associated with each respective core is accessible by at least another core from the set of cores and are not identified in the request or in the information, the memory resources for a core being associated with the core prior to allocation of the core to a virtual machine.

20. A system comprising:
a memory; and
a processor configured to:
access, responsive to a request to configure a virtual machine based upon a set of cores provided by a set of processors of a network device, configuration information, derived by applying core-trunking on the set of cores provided by the set of processors, including context information for the virtual machine and identifying a first processor comprising a first core and a second processor comprising a second core from the set of cores to be allocated for the virtual machine to be configured, wherein the first processor and the second processors are physically separate processors;
cause the virtual machine to be configured that is allocated the first and the second cores and memory resources associated with the first and the second cores; and
store the configuration information in the memory related to the virtual machine, wherein the memory resources associated with the first and the second cores are not identified in the request or in the configuration information, the memory resources for each core being accessible by at least another core from the plurality of cores, and the memory resources for each respective core being associated with the core prior to allocation of the core to a virtual machine.