Specific embodiments of the invention will now be described in detail with reference to the accompanying figures. Like elements in the various figures are denoted by like reference numerals for consistency.
In the following detailed description of embodiments of the invention, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to one of ordinary skill in the art that the invention may be practiced without these specific details. In other instances, well-known features have not been described in detail to avoid unnecessarily complicating the description.
In general, embodiments of the invention relate to a method and system for changing network configuration parameters. Further, embodiments of the invention provide a method and system for limiting the network configuration parameters a virtual machine may change. In addition, embodiments of the invention provide a method and system for monitoring outbound packets from a virtual machine to ensure that the virtual machine has not changed a network configuration parameter that is not authorized to change.
In one embodiment of the invention, a network configuration parameter corresponds to any parameter that is associated with networking. Examples, of network configuration parameters may include, but are not limited to, Media Access Control (MAC) address, Internet Protocol (IP) address, IP routing algorithm (e.g., Routing Information Protocol (RIP), Open Shortest Path First (OSPF), etc.), transport layer protocol (e.g., Transmission Control Protocol (TCP), User Datagram Protocol (UDP), default route (i.e., the route, set in the IP routing table, used when no other entry in the IP routing table matches the destination IP address of the packet), TCP parameters (i.e., parameters in the TCP that may be changed, for example, bandwidth-delay product, buffer size, etc.), IP parameters (i.e., parameters in the IP that may be changed), and TCP port number.
Continuing with the discussion of
The host (102) includes a device driver (not shown), a number of virtual network interface cards (VNICs) (116, 118, 120, 122), one or more virtual network stacks (VNSs) (124), one or more interfaces (126, 128, 130), one or more packet destinations (132), one or more virtual machines (VMs) (146, 148, 150), and a VNIC configuration database (104). Each of the aforementioned components is described below.
Though not shown in
Each VNIC (116, 118, 120, 122) in the host (102) includes the same functionality as the NIC (100). However, unlike the NIC (100), the VNICs (116, 118, 120, 122) are implemented in the host (100), typically, in a MAC layer of the host (102). To all components above the VNIC (116, 118, 120, 122) (e.g., the VNS (124), the interfaces (126, 128, 130), the packet destination (132), and the VMs (146, 148, 150), the VNICs (116, 118, 120, 122) appear as physical NICs.
Each VNIC (116, 118, 120, 122) is associated with a MAC address and an IP address. Further, each VNIC (116, 118, 120, 122) may be optionally associated with a TCP port. Further, each VNIC (116, 118, 120, 122) is associated with a RR (108, 110, 112, 114) such that the VNICs (116, 118, 120, 122) obtain packets from the RR (108, 110, 112, 114) with which they are associated. For example, VNIC 1 (116) obtains packets from RR 1 (108).
As discussed above, each VNIC (116, 118, 120, 122) may be associated with a VNS (116) or an interface (126, 128, 130). The VNS is described in
In one embodiment of the invention, the packet destination (132) corresponds to a process executing in the host (102), where the process is configured to send and receive packets but does not include its own internal networking stack. Rather, the packet destination (132) uses the VNS (124) executing in the host (102). Examples of packet destinations include services (i.e., applications executing in the host (102)) and containers. In one embodiment of the invention, a container corresponds to an isolated execution environment within the host (102), where the container and the host (102) share a common kernel but the processes executing in the container are restricted to execute in the container and have limited access to resources not assigned to the container. An example of a container is a Solaris™ Container. (Solaris is a trademark of Sun Microsystems, Inc. of California, USA).
In one embodiment of the invention, a VM (146, 148, 150) corresponds to an isolated execution environment executing on the host (102). However, unlike packet destinations (132), the VMs (146, 148, 150) do not share the same kernel as the host (102). Rather, each VM (146, 148, 150) executes its own operating system (OS), which may be different from the OS executing on the host. Accordingly, each VM (146, 148, 150) is executing on its own a separate kernel.
In addition, each VM (146, 148, 150) includes a pseudo-driver (PDriver) (134, 136, 138) and its own VM network stack (140, 142, 144). The PDriver (134, 136, 138) corresponds to a component in the VM (146, 148, 150) that is configured to interact with the interface (126, 128, 130) associated with the VM (146, 148, 150). The PDriver (134, 136, 138) emulates a device driver (discussed above) (not shown) for the particular VM (146, 148, 150). Accordingly, to the VM network stack (140, 142, 144) in the VM (146, 148, 150), the PDriver (134, 136, 138) corresponds to a real device driver, which is connected to a physical NIC.
The PDriver (134, 136, 138) also maintains the MAC address and the IP address associated with the VM (140, 142, 144). In one embodiment of the invention, the MAC address and IP address maintained by the PDriver (134, 136, 138) is the same as the MAC address and IP address associated with the corresponding VNIC (116, 118, 120, 122). For example, VNIC 4 (122) is associated with the same MAC address and IP address as PDriver 3 (138).
In one embodiment of the invention, each VM network stack (140, 142, 144) includes functionality to process inbound (i.e., packets received by the VM) and outbound packets (i.e., packet issued by the VM (or a process executing therein). The aforementioned functionality to process packets may include but is not limited to IP layer processing and transport layer processing. IP layer processing corresponds to processing the packets in accordance with IP and transport layer processing corresponds to processing packets in accordance with a transport layer protocol such as Transmission Control Protocol (TCP), User Datagram Protocol (UDP), etc.
In one embodiment of the invention, the VNIC configuration database (104) is configured to maintain all network configuration parameters associated with the networking components in the host (102). Accordingly, the VNIC configuration database (104) may include network configuration parameters for each packet destination (132), each VM (146, 148, 150), and each VNIC (116, 118, 120, 122). Further, the VNIC configuration database (104) also includes a listing of which network configuration parameters each VM (146, 148, 150) and/or each packet destination (132) is allowed to change. In addition to listing the network configuration parameters, the VM (146, 148, 150) may change, the VNIC configuration database (104) may also indicate the allowable values the VM (146, 148, 150) or packet destination (132) may change a given network configuration parameter to. For example, the VNIC configuration database (104) may allow VM 1 (146) to change its IP address, but the VNIC configuration database (104) may include a list of IP addresses that the VM 1 (146) may change its IP address to. Accordingly, VM 1 (146) is only allowed to change its IP address to one of the IP addresses in the aforementioned list. Finally, as shown in
In one embodiment, the IP layer (202) is configured to receive packets from the VNIC associated with the VNS (204) (e.g., VNS (124) receives packets from VNIC 1 (116) in
Continuing with the discussion of
In one embodiment of the invention, the transport layer (206) is configured to process inbound and outbound packets in accordance with Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or both UDP and TCP. Other protocols may be supported by the transport layer (206).
In one embodiment of the invention, the outbound VSQ (208) is a queue data structure configured to receive packets from the packet destination (e.g., 132) with which the VNS (204) is associated. Further, the outbound VSQ (208) is configured to store packets prior to sending the received packets to the transport layer (206). In one embodiment of the invention, the outbound VSQ (208) is also configured to control the flow of packets from the packet destination (e.g., 132) associated with the VNS (200) to the VNS (200). In one embodiment of the invention, the outbound VSQ (208) (or a related process) is configured to block an application from sending packets to the outbound VSQ (208), if the packet destination (e.g., 132) is attempting to issue packets at a higher rate than the outbound bandwidth allocated to the packet destination (e.g., 132). Further, the outbound VSQ (208) (or a related process) is configured to notify the packet destination (e.g., 132) when it is no longer blocked from issuing packets to the VNS (200).
In one embodiment of the invention, the inbound VSQ (204) and outbound VSQ (208) are each configured to enforce the manner in which packets are processed. Specifically, the inbound VSQ (204) and outbound VSQ (208) may be configured to enforce the packet processing requirements imposed by the transport layer (206). For example, TCP requires serial processing of packets. Thus, the inbound VSQ (204) and outbound VSQ (208) may require all threads accessing the inbound VSQ (204) and outbound VSQ (208) to conform to a mutual exclusion policy. In one embodiment of the invention, the mutual exclusion policy requires that only one thread may access the VSQ (inbound or outbound) at a time. Thus, if two threads are attempting to access a given VSQ (inbound or outbound), one thread must wait until the other thread has finished accessing the VSQ (inbound or outbound).
Alternatively, if the transport layer (206) only supports UDP, then the inbound VSQ (204) and outbound VSQ (208) may be configured to allow concurrent access. Said another way, two or more threads may concurrently access the VSQ (inbound or outbound). In one embodiment of the invention, if the transport layer (206) is configured to process both TCP and UDP packets, then the inbound VSQ (204) and outbound VSQ (208) are configured to conform to the more stringent standard (e.g., TCP if the transport layer supports both TCP and UDP).
In one embodiment of the invention, the inbound VSQ (204) and the outbound VSQ (208) are implemented as a single bi-directional VSQ. In such cases, the bi-directional VSQ includes a single set of configuration parameters (discussed above) to enforce the manner in which packets are processed. Further, the enforcement of the configuration parameters is performed on a VSQ-basis (as opposed to a per-direction basis). For example, if the bi-directional VSQ enforces a mutual exclusion policy, then only one thread may access the bi-directional VSQ at a time.
The VNIC configuration database (104) then determines whether the VM is allowed to change the network configuration parameter as requested (ST306). For example, example if VM 1 (146) requested to change its MAC address, then the VNIC configuration database determines whether VM 1 (146) is allowed to change its MAC address based on the information included in the VNIC configuration database. If the change is not allowed, then the network configuration parameter change is not committed to the VNIC configuration database (ST308) and the process ends.
Alternatively, if the network configuration parameter change is allowed (i.e., the VM is allowed to change the network configuration parameter and, optionally, the VM is allowed to change the network configuration parameter to the value specified in the request), then the VNIC configuration database is updated to reflect the change in the network configuration parameter (ST310). Optionally, the VNIC associated with the VM is subsequently updated (ST312). ST312 is optional as the network configuration parameter that is changed may not affect the VNIC. For example, if the IP address is changed, then the VNIC is updated to include the new IP address. However, if the IP routing algorithm was changed, then the VNIC is not affected and, thus, is not changed.
The VM is subsequently informed, via a request sent by the VNIC configuration database to the associated VNIC, that the network configuration parameter has been changed (ST314). Though not shown in
Optionally, the VNIC associated with the VM is subsequently updated (ST404). ST404 is optional as the network configuration parameter that is changed may not affect the VNIC. For example, if the IP address is changed, then the VNIC is updated to include the new IP address. However, if the IP routing algorithm was changed, then the VNIC is not affected and, thus, is not changed.
The VM is subsequently informed, via a request sent by the VNIC configuration database to the associated VNIC, that the network configuration parameter has been changed (ST406). Though not shown in
The VM subsequently sends the packet to the associated VNIC (ST504). Typically, the packet is received by the associated VNIC via an interface associated with the VM. The VNIC then determines whether the source MAC address (i.e., the MAC address associated with the VM) in the header of the packet is the same as the MAC address in the VNIC (i.e., the VNIC MAC address) (ST506). If the source MAC address is not the same as the MAC address in the VNIC, then the packet is dropped and, optionally, a warning is issued to the host that the VM is attempting to send spoofed packets (ST508). Alternatively, if the source MAC address is the same as the MAC address in the VNIC, then the packet is sent towards the destination MAC address listed in the header of the packet (ST510).
An embodiment of the invention may be implemented on virtually any type of computer regardless of the platform being used. For example, as shown in
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this disclosure, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as disclosed herein. Accordingly, the scope of the invention should be limited only by the attached claims.
The present application contains subject matter that may be related to the subject matter in the following U.S. applications filed on Apr. 22, 2005, and assigned to the assignee of the present application: “Method and Apparatus for Managing and Accounting for Bandwidth Utilization Within A Computing System” with U.S. application Ser. No. 11/112,367 (Attorney Docket No. 03226/643001; SUN050681); “Method and Apparatus for Consolidating Available Computing Resources on Different Computing Devices” with U.S. application Ser. No. 11/112,368 (Attorney Docket No. 03226/644001; SUN050682); “Assigning Higher Priority to Transactions Based on Subscription Level” with U.S. application Ser. No. 11/112,947 (Attorney Docket No. 03226/645001; SUN050589); “Method and Apparatus for Dynamically Isolating Affected Services Under Denial of Service Attack” with U.S. application Ser. No. 11/112,158 (Attorney Docket No. 03226/646001; SUN050587); “Method and Apparatus for Improving User Experience for Legitimate Traffic of a Service Impacted by Denial of Service Attack” with U.S. application Ser. No. 11/112,629 (Attorney Docket No. 03226/647001; SUN050590); “Method and Apparatus for Limiting Denial of Service Attack by Limiting Traffic for Hosts” with U.S. application Ser. No. 11/112,328 (Attorney Docket No. 03226/648001; SUN050591); “Hardware-Based Network Interface Per-Ring Resource Accounting” with U.S. application Ser. No. 11/112,222 (Attorney Docket No. 03226/649001; SUN050593); “Dynamic Hardware Classification Engine Updating for a Network Interface” with U.S. application Ser. No. 11/112,934 (Attorney Docket No. 03226/650001; SUN050592); “Network Interface Card Resource Mapping to Virtual Network Interface Cards” with U.S. application Ser. No. 11/112,063 (Attorney Docket No. 03226/651001; SUN050588); “Network Interface Decryption and Classification Technique” with U.S. application Ser. No. 11/112,436 (Attorney Docket No. 03226/652001; SUN050596); “Method and Apparatus for Enforcing Resource Utilization of a Container” with U.S. application Ser. No. 11/112,910 (Attorney Docket No. 03226/653001; SUN050595); “Method and Apparatus for Enforcing Packet Destination Specific Priority Using Threads” with U.S. application Ser. No. 11/112,584 (Attorney Docket No. 03226/654001; SUN050597); “Method and Apparatus for Processing Network Traffic Associated with Specific Protocols” with U.S. application Ser. No. 11/112,228 (Attorney Docket No. 03226/655001; SUN050598). The present application contains subject matter that may be related to the subject matter in the following U.S. applications filed on Oct. 21, 2005, and assigned to the assignee of the present application: “Method and Apparatus for Defending Against Denial of Service Attacks” with U.S. application Ser. No. 11/255,366 (Attorney Docket No. 03226/688001; SUN050966); “Router Based Defense Against Denial of Service Attacks Using Dynamic Feedback from Attacked Host” with U.S. application Ser. No. 11/256,254 (Attorney Docket No. 03226/689001; SUN050969); and “Method and Apparatus for Monitoring Packets at High Data Rates” with U.S. application Ser. No. 11/226,790 (Attorney Docket No. 03226/690001; SUN050972). The present application contains subject matter that may be related to the subject matter in the following U.S. applications filed on Jun. 30, 2006, and assigned to the assignee of the present application: “Network Interface Card Virtualization Based On Hardware Resources and Software Rings” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/870001; SUN061020); “Method and System for Controlling Virtual Machine Bandwidth” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/871001; SUN061021); “Virtual Switch” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/873001; SUN061023); “System and Method for Virtual Network Interface Cards Based on Internet Protocol Addresses” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/874001; SUN061024); “Virtual Network Interface Card Loopback Fastpath” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/876001; SUN061027); “Bridging Network Components” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/877001; SUN061028); “Reflecting the Bandwidth Assigned to a Virtual Network Interface Card Through Its Link Speed” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/878001; SUN061029); “Method and Apparatus for Containing a Denial of Service Attack Using Hardware Resources on a Virtual Network Interface Card” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/879001; SUN061033); “Virtual Network Interface Cards with VLAN Functionality” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/882001; SUN061037); “Method and Apparatus for Dynamic Assignment of Network Interface Card Resources” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/883001; SUN061038); “Generalized Serialization Queue Framework for Protocol Processing” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/884001; SUN061039); “Serialization Queue Framework for Transmitting Packets” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/885001; SUN061040). The present application contains subject matter that may be related to the subject matter in the following U.S. applications filed on Jul. 20, 2006, and assigned to the assignee of the present application: “Low Impact Network Debugging” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/829001; SUN060545); “Reflecting Bandwidth and Priority in Network Attached Storage I/O” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/830001; SUN060587); “Priority and Bandwidth Specification at Mount Time of NAS Device Volume” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/831001; SUN060588); “Notifying Network Applications of Receive Overflow Conditions” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/869001; SUN060913); “Host Operating System Bypass for Packets Destined for a Virtual Machine” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/872001; SUN061022); “Multi-Level Packet Classification” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/875001; SUN061026); “Method and System for Automatically Reflecting Hardware Resource Allocation Modifications” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/881001; SUN061036); “Multiple Virtual Network Stack Instances Using Virtual Network Interface Cards” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/888001; SUN061041); “Method and System for Network Configuration for Containers” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/889001; SUN061044); “Network Memory Pools for Packet Destinations and Virtual Machines” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/890001; SUN061062); “Multiple Virtual Network Stack Instances” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/896001; SUN061198); and “Shared and Separate Network Stack Instances” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/898001; SUN061200).