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 provide a method and apparatus to debug network connections. A network connection involves the transport of packets between a source and a destination. When packets between the source and destination are dropped, missing, misdirected, or arrive out of order, the connection between the source and destination is examined at various levels (e.g., transport layer, network layer, etc.) in order to determine where errors are occurring.
Embodiments of the invention provide a method and apparatus to debug network connections at high bandwidth sites while incurring minimal computational cost. In one embodiment of the invention, packets from a problematic connection are isolated by a network interface card (NIC) and redirected to a virtual NIC, where the packets may be further redirected to a test machine, offline storage, or a processor for real-time processing. Each packet may also be copied and the copy sent to the original packet destination so that the original connection may be observed for anomalies. In addition, embodiments of the invention allow the connection state to be captured and stored once a packet is transmitted or received by the NIC to further aid in determining the condition of the network connection.
The NIC (105) provides an interface between the host (100) and the network (110) (e.g., a local area network, a wide area network, a wireless network, etc.). More specifically, the NIC (105) includes a network interface (NI) (i.e., the hardware on the NIC used to interface with the network (110)). For example, the NI may correspond to an RJ-45 connector, a wireless antenna, etc. The packets received by the NI are then forwarded to other components on the NIC (105) for processing. In one embodiment of the invention, the NIC (105) includes one or more receive rings (e.g., receive ring 1 (115), receive ring 2 (125)). In one embodiment of the invention, the receive rings (e.g., receive ring 1 (115), receive ring 2 (125)) correspond to portions of memory within the NIC (105) used to temporarily store packets received from the network (110). In one or more embodiments of the invention, the receive rings (e.g., receive ring 1 (115), receive ring 2 (125)) are implemented as ring buffers in the NIC (105). In one embodiment of the invention, the classifier (108) is configured to analyze the incoming network traffic, typically in the form of packets, received from the network (110).
In one embodiment of the invention, analyzing individual packets includes determining to which of the receive rings (e.g., receive ring 1 (115), receive ring 2 (125)) each packet is sent. In one embodiment of the invention, analyzing the packets by the classifier (108) includes analyzing one or more fields in each of the packets to determine to which of the receive rings (e.g., receive ring 1 (115), receive ring 2 (125)) the packets are sent. As an alternative, the classifier (108) may use the contents of one or more fields in each packet as an index into a data structure that includes information necessary to determine to which receive ring (e.g., receive ring 1 (115), receive ring 2 (125)) that packet is sent. The classifier (108) may be implemented entirely in hardware (i.e., the classifier (108) may be a separate microprocessor embedded on the NIC (105)), or the classifier (108) may be implemented in software stored in memory (e.g., firmware, etc.) on the NIC and executed by a microprocessor on the NIC (105).
In one or more embodiments of the invention, the host (100) may include a device driver (not shown) and one or more virtual NICs (e.g., virtual NIC (130), debug virtual NIC (140)). In one embodiment of the invention, the device driver provides an interface between the receive rings (e.g., receive ring 1 (115), receive ring 2 (125)) and the host (100). More specifically, the device driver (not shown) exposes the receive rings (e.g., receive ring 1 (115), receive ring 2 (125)) to the host (100). In one embodiment of the invention, each of the virtual NICs (e.g., virtual NIC (130), debug virtual NIC (140)) is associated with one or more receive rings (e.g., receive ring 1 (115), receive ring 2 (125)). In other words, a virtual NIC (e.g., virtual NIC (130), debug virtual NIC (140)) receives incoming packets from the corresponding receive ring (e.g., receive ring 1 (115), receive ring 2 (125)).
In one or more embodiments of the invention, the virtual NICs (e.g., virtual NIC (130), debug virtual NIC (140)) are operatively connected to services (e.g., service (175), debug service (185)) via virtual network stacks (e.g., virtual network stack (145), debug virtual network stack (155)). The virtual NICs (e.g., virtual NIC (130), debug virtual NIC (140)) provide an abstraction layer between the NIC (105) and the services (e.g., service (175), debug service (185)) on the host (100). More specifically, each virtual NIC (e.g., virtual NIC (130), debug virtual NIC (140)) operates like a NIC (105). For example, in one embodiment of the invention, each virtual NIC (e.g., virtual NIC (130), debug virtual NIC (140)) is associated with one or more Internet Protocol (IP) addresses, one or more ports, and is configured to handle one or more protocol types. Thus, while the host (100) may be operatively connected to a single NIC (105), services (e.g., service (175), debug service (185)) executing on the host (100) operate as if the host (100) is bound to multiple NICs. To each service (e.g., service (175), debug service (185)), the corresponding virtual NIC (e.g., virtual NIC (130), debug virtual NIC (140)) is indistinguishable from a physical NIC (105). Further, each virtual NIC (e.g., virtual NIC (130), debug virtual NIC (140)) includes properties of a physical NIC, such as link speed, Media Access Control (MAC) address, etc. Those skilled in the art will appreciate that an arbitrary number of virtual NICs (e.g., virtual NIC (130), debug virtual NIC (140)) may be created for a given physical NIC (105), subject to resource limitations.
In one embodiment of the invention, each virtual network stack (e.g., virtual network stack (145), debug virtual network stack (155)) includes functionality to process packets in accordance with various protocols used to send and receive packets (e.g., Transmission Communication Protocol (TCP), Internet Protocol (IP), User Datagram Protocol (UDP), etc.). Further, each virtual network stack (e.g., virtual network stack (145), debug virtual network stack (155)) may also include functionality, as needed, to perform additional processing on the incoming and outgoing packets. This additional processing may include, but is not limited to, cryptographic processing, firewall routing, debugging, rerouting, etc.
In one or more embodiments of the invention, the virtual network stacks (e.g., virtual network stack (145), debug virtual network stack (155)) correspond to network stacks with network layer and transport layer functionality. In one embodiment of the invention, network layer functionality corresponds to functionality to manage packet addressing and delivery on a network (e.g., functionality to support Internet Protocol, Address Resolution Protocol (ARP), Internet Control Message Protocol (ICMP), etc.). In one embodiment of the invention, transport layer functionality corresponds to functionality to manage the transfer of packets on the network (e.g., functionality to support TCP, UDP, Stream Control Transmission Protocol (SCTP), etc.).
In one or more embodiments of the invention, the system of
In one or more embodiments of the invention, a debug virtual NIC (140), debug virtual network stack (155), and debug service (185) are set up to isolate packets originating from the test client (160) from packets originating from other sources. For example, the debug virtual NIC (140), debug virtual network stack (155), and debug service (185) are used to examine a network connection that sends packets to the service (175) by receiving and redirecting packets originating from the test client (160) without interfering with or accessing packets sent from other sources, such as real client machines communicating with the host (100). While debugging takes place, the service (175) is allowed to receive and process packets from other sources, as well as transmit packets to other clients (not shown). Those skilled in the art will appreciate that the system of
In one or more embodiments of the invention, the debug virtual network stack (155) and debug service (185) are duplicates of the virtual network stack (145) and service (175), respectively. Packets sent from the test client (160) are received by the NIC (105) and classified by the classifier (108), which places the packets in the receive ring (e.g., receive ring 2 (125)) corresponding to the debug virtual NIC (140). The debug virtual NIC (140) may then send the packets to the debug virtual network stack (155). Errors in the virtual network stack (145) may be observed when the packets proceed through the debug virtual network stack (155). In addition, errors in the service (175) may be observed once the packets arrive at the debug service (185) after going through the debug virtual network stack (155).
Alternatively, packets that arrive at the debug virtual NIC (140) from the test client (160) may be sent to offline storage (165) or a test machine (170) for further processing. The host (100) may be directly connected to the offline storage (165) or test machine (170), or the debug virtual NIC (140) may send the packets to the offline storage (165) or test machine (170) through a network (110). In addition, packets that arrive at the debug virtual NIC (140) from the test client (160) may be processed in real-time by a processor (not shown) operatively connected to the debug virtual NIC (140).
In one or more embodiments of the invention, packets from the test client (160) arrive at the NIC (105), or are sent from the NIC (105) to the test client (160). Once the packets arrive or leave, the connection state between the test client (160) and the host (100) is stored. In one or more embodiments of the invention, the connection state corresponds to a TCP connection state. For example, the connection state between the test client (160) and the host (100) may be LISTEN, SYN-SENT, SYN-RECEIVED, ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT, or CLOSED. Storing the connection state at the transmission or receipt of a packet allows more information about the connection to be known, and as a result, easier identification of problems occurring within the connection.
In addition, a packet sent from the test client (160) may be copied once the packet arrives at the NIC (105). The original packet is placed in receive ring 2 (125) and sent to the debug virtual NIC (140) as described above, and the copy of the packet is placed in receive ring 1 (115) and sent to the virtual NIC (130). Those skilled in the art will appreciate that the original packet and the copy of the packet are identical; either the original packet or the copy may be sent to either receive ring (e.g., receive ring 1 (115), receive ring 2 (125)) with the same result in both scenarios. As the packet, or the copy of the packet, travels between the virtual NIC (130) and the service (175), problems occurring at the virtual network stack (145) and service (175) may be identified; the debug virtual network stack (155) and debug service (185) may not be implemented to save overhead. In such cases, the debug virtual NIC (140) may be used to send the packet, or a copy of the packet, as well as a snapshot of the connection state upon receipt of the packet, to a test machine (170), offline storage (165), or a processor (not shown) for storage and/or further processing.
Once the classifier has been programmed to direct packets from the suspect connection to the virtual NIC, a packet from the suspect connection is sent by the test client and received by the classifier (Step 205). The classifier then forwards the packet to the debug virtual NIC; the classifier may also optionally create a copy of the packet (Step 207) and forward the copy to the virtual NIC corresponding to the original packet destination. In addition, a snapshot of the connection state associated with the suspect connection (Step 209) is optionally taken once the packet is received by the classifier.
Once the packet arrives at the debug virtual NIC, the packet is further processed based on the debug mode of the debug virtual NIC (Step 211). If the debug mode is offline, the packet is written to offline storage (Step 213) and processed offline (Step 215) so that processing does not interfere with the flow of traffic through the NIC. Alternatively, if the debug mode is test machine, the packet is transmitted to a test machine (Step 217), where the packet is processed (Step 219) so as to not interfere with activity on the host. As stated above, the packet may be sent to offline storage or the test machine through a direct connection with the storage or test machine, or through the network. If the debug mode is real-time, a processor is used to process the packet in real-time (Step 221). The processor may be a Central Processing Unit (CPU) operatively connected to the debug virtual NIC, or the processor may be located elsewhere, such as on the NIC. In one or more embodiments of the invention, multiple debug modes take place once the packet is received by the debug virtual NIC. For example, the packet may be sent to a test machine as well as processed in real-time, or the packet may be processed using all three debug modes.
The following is an example covering one or more embodiments of the invention. The example is not intended to limit the scope of the invention. Assume that an network error is detected by the service (175 in
Prior to sending the packets from the test machine, the classifier (108 in
Packets from the test machine are subsequently sent to the NIC (105 in
At this stage, the progress of the packet through the suspect connection may be monitored. In addition, the progress of the copy of the packet may also be monitored as it progresses through the debug virtual NIC (140 in
In one embodiment of the invention, the debug service (185 in
The invention may be implemented on virtually any type of computer regardless of the platform being used. For example, as shown in
Further, those skilled in the art will appreciate that one or more elements of the aforementioned computer system (300) may be located at a remote location and connected to the other elements over a network. Further, the invention may be implemented on a distributed system having a plurality of nodes, where each portion of the invention (e.g., test machine, test client, network interface card, etc.) may be located on a different node within the distributed system. In one embodiment of the invention, the node corresponds to a computer system. Alternatively, the node may correspond to a processor with associated physical memory. The node may alternatively correspond to a processor with shared memory and/or resources. Further, software instructions to perform embodiments of the invention may be stored on a computer readable medium such as a compact disc (CD), a diskette, a tape, a file, or any other computer readable storage device.
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: “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); “Method and System for Network Configuration for Virtual Machines” with U.S. application Ser. No. TBD (Attorney Docket No. 03226/893001; SUN061171); “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).