Data communication coordination with sequence numbers

Information

  • Patent Grant
  • 8316129
  • Patent Number
    8,316,129
  • Date Filed
    Friday, July 15, 2005
    18 years ago
  • Date Issued
    Tuesday, November 20, 2012
    11 years ago
Abstract
Described are sequence numbers for client-server communication, to control a client's use of server resources. A server grants the client credits, and the client consumes a credit for sending each command to the server. Each credit corresponds to a sequence number, with the set of sequence numbers forming a valid command window. The server enforces that for each received command, the command includes a sequence number that is within the valid command window and that the sequence number has not been used with another command. The server may also maintain a maximum window size, such that clients with credits cannot send a command with a sequence number that beyond a maximum sequence number. When incorporated into a data communication protocol, quality of service, combating denial of service, detection of message loss, division of server resources, secure message signing, and other numerous benefits result.
Description
BACKGROUND

Many data communication protocols that are still in use today, such as the SMB (Server Message Block) protocol, were developed at a time when computing resources were very different, e.g., network bandwidth was typically limited and memory was very precious. As a result, when used in contemporary networks, such protocols may limit overall performance. For example, because of having been designed when memory was limited, small buffer sizes are used, requiring more round trips to communicate large amounts of data.


Moreover, the existing SMB protocol has other limitations that have become apparent over time. For example, the existing SMB protocol is susceptible to denial of service attacks; the design of the protocol makes it difficult to fight these attacks. Likewise, the method for ensuring packet security is cumbersome. Also, there is no current mechanism for performing quality of service-like operations, in that a trusted client, for example, obtains the same server resources as an untrusted client. In sum, while still a frequently-used and valuable protocol, existing SMB versions are less than ideal when used with contemporary network resources.


SUMMARY

Briefly, various aspects of the present invention are directed towards the use of sequence numbers for client-server communication, such as incorporated into a data communication protocol, to control a client's use of server resources. Various aspects apply the use of sequence numbers to a protocol where ordering is not important, but provide for quality of service, denial of service combating, division of server resources, secure message signing, and other numerous benefits.


A server grants the client credits, and the client uses a credit for sending each command to the server. Each credit corresponds to a sequence number, with the set of sequence numbers forming a valid command window. The server enforces that for each received command, the command includes a sequence number that is within the valid command window and that the sequence number has not been used with another command. The server may also maintain a maximum window size, such that even a client that has credits cannot send a command with a sequence number that beyond a maximum sequence number corresponding to the maximum window size.


In general, upon receiving a command from the client, the server verifies that the sequence number is within the window and has not been used before. The server then eliminates the corresponding sequence number from among those that the client can use, thereby consuming one credit. The server then determines whether to grant the client one or more other credits.


Thus, there is provided a mechanism for limiting use of server resources by controlling a number of credits granted to the client, via a valid operation window containing a unique number for each credit granted to the client. An enforcement mechanism ensures that to allow further server operations on a received command, the command includes a sequence number that is within the valid operation window and that the unique number has not been used with another command An allocation mechanism that controls credits granted to the client and the unique numbers within the valid operation window.


Other advantages will become apparent from the following detailed description when taken in conjunction with the drawings.





BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and not limited in the accompanying figures in which like reference numerals indicate similar elements and in which:



FIG. 1 shows an illustrative example of a general-purpose computing environment into which various aspects of the present invention may be incorporated.



FIG. 2 is a block diagram representing an example network environment in which a client communicates with a server in accordance with various aspects of the present invention.



FIGS. 3-13 are representations of client and server data maintained for using sequence numbers, in accordance with various aspects of the present invention.





DETAILED DESCRIPTION
Exemplary Operating Environment


FIG. 1 illustrates an example of a suitable computing system environment 100 on which the invention may be implemented. The computing system environment 100 is only one example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the invention. Neither should the computing environment 100 be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary operating environment 100.


The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to: personal computers, server computers, hand-held or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.


The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and so forth, which perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in local and/or remote computer storage media including memory storage devices.


With reference to FIG. 1, an exemplary system for implementing the invention includes a general purpose computing device in the form of a computer 110. Components of the computer 110 may include, but are not limited to, a processing unit 120, a system memory 130, and a system bus 121 that couples various system components including the system memory to the processing unit 120. The system bus 121 may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus also known as Mezzanine bus.


The computer 110 typically includes a variety of computer-readable media. Computer-readable media can be any available media that can be accessed by the computer 110 and includes both volatile and nonvolatile media, and removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by the computer 110. Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of the any of the above should also be included within the scope of computer-readable media.


The system memory 130 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 131 and random access memory (RAM) 132. A basic input/output system 133 (BIOS), containing the basic routines that help to transfer information between elements within computer 110, such as during start-up, is typically stored in ROM 131. RAM 132 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 120. By way of example, and not limitation, FIG. 1 illustrates operating system 134, application programs 135, other program modules 136 and program data 137.


The computer 110 may also include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only, FIG. 1 illustrates a hard disk drive 141 that reads from or writes to non-removable, nonvolatile magnetic media, a magnetic disk drive 151 that reads from or writes to a removable, nonvolatile magnetic disk 152, and an optical disk drive 155 that reads from or writes to a removable, nonvolatile optical disk 156 such as a CD ROM or other optical media. Other removable/non-removable, volatile/nonvolatile computer storage media that can be used in the exemplary operating environment include, but are not limited to, magnetic tape cassettes, flash memory cards, digital versatile disks, digital video tape, solid state RAM, solid state ROM, and the like. The hard disk drive 141 is typically connected to the system bus 121 through a non-removable memory interface such as interface 140, and magnetic disk drive 151 and optical disk drive 155 are typically connected to the system bus 121 by a removable memory interface, such as interface 150.


The drives and their associated computer storage media, described above and illustrated in FIG. 1, provide storage of computer-readable instructions, data structures, program modules and other data for the computer 110. In FIG. 1, for example, hard disk drive 141 is illustrated as storing operating system 144, application programs 145, other program modules 146 and program data 147. Note that these components can either be the same as or different from operating system 134, application programs 135, other program modules 136, and program data 137. Operating system 144, application programs 145, other program modules 146, and program data 147 are given different numbers herein to illustrate that, at a minimum, they are different copies. A user may enter commands and information into the computer 110 through input devices such as a tablet, or electronic digitizer, 164, a microphone 163, a keyboard 162 and pointing device 161, commonly referred to as mouse, trackball or touch pad. Other input devices not shown in FIG. 1 may include a joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 120 through a user input interface 160 that is coupled to the system bus, but may be connected by other interface and bus structures, such as a parallel port, game port or a universal serial bus (USB). A monitor 191 or other type of display device is also connected to the system bus 121 via an interface, such as a video interface 190. The monitor 191 may also be integrated with a touch-screen panel or the like. Note that the monitor and/or touch screen panel can be physically coupled to a housing in which the computing device 110 is incorporated, such as in a tablet-type personal computer. In addition, computers such as the computing device 110 may also include other peripheral output devices such as speakers 195 and printer 196, which may be connected through an output peripheral interface 194 or the like.


The computer 110 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 180. The remote computer 180 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 110, although only a memory storage device 181 has been illustrated in FIG. 1. The logical connections depicted in FIG. 1 include a local area network (LAN) 171 and a wide area network (WAN) 173, but may also include other networks. Such networking environments are commonplace in offices, enterprise-wide computer networks, intranets and the Internet.


When used in a LAN networking environment, the computer 110 is connected to the LAN 171 through a network interface or adapter 170. When used in a WAN networking environment, the computer 110 typically includes a modem 172 or other means for establishing communications over the WAN 173, such as the Internet. The modem 172, which may be internal or external, may be connected to the system bus 121 via the user input interface 160 or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer 110, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation, FIG. 1 illustrates remote application programs 185 as residing on memory device 181. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used.


Data Communication Coordination With Sequence Numbers


Various aspects of the technology described herein are directed towards a mechanism that may be employed in a data communication protocol, such as a modified version (2.x or greater) of the SMB protocol. In one example implementation generally described herein, the mechanism controls data/command flow in this revised SMB protocol, which is used for Windows®-based file sharing. However, as can be readily appreciated, the present invention is not limited to Windows®-based systems or the SMB protocol, but rather, the example technique is applicable to other file sharing protocols and data communication protocols in general, including those that do not necessarily deal with file data. For example, numerous ways to implement the present invention are feasible, including for use in communication with printers, named data pipes, generic devices and so forth. As such, the present invention is not limited to any of the particular file-based or other examples used herein, but rather may be used numerous ways that provide benefits and advantages in computing in general.


Turning to FIG. 2 of the drawings, there is shown a block diagram representing an example networking environment in which a client 202 communicates with a server 204 through one or more communication channels. Although the functions and components of the client machine 202 and the server 204 are described as being located within two separate computers, such as the main computer system 110 and remote computer system 180 of FIG. 1, the components of these two computers or the functions performed thereby may be provided on one machine, or may be distributed over a number of computers. For example, a computer system may comprise one of variety of network appliance devices, such as print servers or printers themselves, as well as NAS storage devices, and the like.


Network file system commands from an application program 206 are handled by a client redirector component 208, which communicates with a counterpart common network module (SRVNET) 210 to carry out the commands on the file system 212. In general, the client 202 establishes a connection and then negotiates with the server 204 to ultimately set up a session. As part of this, before file system-directed commands are processed, the client and server agree upon a communication protocol. In this example, the agreed-upon protocol for this connection/session is SMB 2.0, whereby a client-side SMB engine 220 employs an SMB 2.0 driver for communications to and from the server 204. The common network module (SRVNET) 210 similarly employs an SMB 2.0 provider 226 for handling client communications over this connection. The provider 226 includes or is otherwise associated with the enforcement mechanism and data structures that ensure that a client uses a proper sequence number, as described below.


Turning to the concept of data communication coordination with sequence numbers, sequence numbers provide a mechanism by which a server may throttle the amount of work a given client can issue against the server. As will be understood, this is accomplished by having the server provide a window of available sequence numbers that the client is allowed to use when identifying a given command. To implement sequence numbers and the desired behavior, the concept of credits is employed, where a credit grants the client the right to consume a portion of server-side resources, including the memory required to back an operation and the CPU cycles it may consume. A client consumes a credit on each command sent, and depending on the server's response, may be granted zero, one or more additional credits. A client is not allowed to reuse a sequence number, and thus the number of commands a client can issue is controlled. Note that monotonically increasing sequence numbers are used for convenience, however any unique (per session/connection) number is equivalent.


For example, if a server grants a client five credits, the server is giving the client the right to submit up to five operations simultaneously. When a server needs to throttle a client, the server does so by reducing the available credits to that client. When a server wants to give a client more resources to work with, the server does so by granting credits.


This gives the server several options. By granting zero credits to a client, the server runs down the resources allocated to that client. Alternatively, by returning one credit, the server maintains the previous window size. By returning more than one credit, the server allows the client more resources for executing commands. One restriction is that the server cannot allow the window size to hit zero (no valid sequence numbers), unless the server has a method of granting a credit out of band, assuming that the protocol is strictly a command-response protocol. Note that if there is a method of granting a client credits without requiring the client to ask for them in the protocol that is using this method, then the restriction does not apply.


Note that a negotiate request/response has a sequence number, (also referred to as a message identifier, or MID) of zero, and a window size of one. In SMB 2.0, the following header facilitates the passing of such information, as further described in the aforementioned related, copending United States patent application entitled “Data Communication Protocol”:














typedef struct _SMB2_HEADER {









 UCHAR
Protocol[4];
// Contains 0xFE, ‘S’, ‘M’, ‘B’


 USHORT
StructureSize;
// = sizeof(SMB2_HEADER).









// (versioning)









 USHORT
Epoch;
// incremented every time the









// server restarts









 NTSTATUS
Status;
// Status of the command


 USHORT
Command;
// The command for this









// packet union







 {











USHORT
CreditsRequested;
// On client send, request for









// more credits











USHORT
CreditsGranted;
// On server response, credits









// granted to client







 };








 ULONG
Flags;


 ULONG
Reserved;









 UINT64
MessageId;
// Identifies this message









// send/response







 union


 {









struct



{











 UINT64
ProcessId;
// Process identifier



 UINT64
SessionId;
// Session identifier



 ULONG
TreeId;
// Tree Connect identifier









};



struct



{











 UINT64
AsyncId;
// Used to identify long









// standing commands









};







 };









 UCHAR
Signature[8];
// Signature for the packet


 ULONG
NextCommand;
// Offset from to next







} _SMB2_HEADER, *PSMB2_HEADER;









As can be seen from the above header structure, the client requests as many credits as desired, however the server is in control of granting credits to the client. The server thus has the ability to shrink or grow the window based on the client's identity, behavior, or any other attributes or criteria. Sequence numbers also provide a way to uniquely identify a command sent from the client to the server for a given connection.


The client and server begin by establishing a command window. The command window starts by using either a default or a negotiated initial sequence number (ISN) (also referred to as an initial message identifier, or MID) and number of credits (NoC), which represents the range of allowable numbers the server will accept to identify a given command. Thus, the command window initially comprises [ISN, ISN+NoC−1]. For most protocols, the default may be ISN=1, NoC=1, so when first negotiated the command window is simply [1,1], representing that the only sequence number the server will accept to identify a command is one (1).


As communications progress, the client moves the down the numbers in the window by using up numbers within the range. Once a number is used, it cannot be reused, as this is enforced by the server. At the same time, the server may, as determined by the server, extend the end of the window by granting more credits to the client. For example, if the command window is [A, B], when the client sends command A, the valid command window becomes essentially [A+1, B]. When the server responds to command A, it can grant the client anywhere from zero to any practical number of credits. Thus, if the server returned N credits, the valid command window becomes [A+1, B+N].


The use of the sequence numbers in the allowable range is not required to be in order. The protocol is setup to facilitate asynchronous use of the sequence numbers, as long as the number being used is within the valid range. This allows the network protocol to send packets as they are available, instead of trying to force ordered sends. Thus, if sequence number A is claimed for a very large packet, but while the buffers are being prepared sends for A+1 and A+2 come in and are very small, it is legal to send A+1 and A+2 (as long as the end of the window is >=A+2) without waiting for the send of A to start.


Note that if there is a valid command window of [1, 5], and packets 2, 3, 4 are sent, the server may grant credits back allowing for a window of [1, 8] except {2, 3, 4} (meaning all numbers between 1 and 8 except 2 thru 4). Eventually, the server will likely stop granting credits until packet 1 is sent and the window is allowed to slide. If at this point, the client sends 1, and the server responds granting a credit, than the window becomes [5, 9].


The enforcement of the valid command window is done on the server side. This system permits a client-side structure to be as simple as having the current sequence number and the max sequence number, and using interlocked compares and increments as the only required synchronization method.


Thus, a valid command window, also referred to as a valid operation or Valid Op window) comprises the window of valid identifiers that the server will accept. The client sends each subsequent command with the next valid sequence number, (up to its valid credits), and need not maintain a view of the valid window. The client is required to understand the concept of a “Maximum Window Size” as described below). Examples of the use of the valid command/operation window are set forth below.


Any operation that could block for an indefinite amount of time, such as a change-notify or a named-pipe read, or create (as it may pend on an oplock break), is considered a blocking operation. To facilitate such operations, the client may supply an “operation context” value, i.e., a blocking flag, in the command send. The server will then respond when it successfully initiates the operation, allowing the sequence number to be incremented, even though the operation is still in process on the server side. However, the resources held by such long-running operations can often be a subset of the resources required for a normal command. Thus, a server is allowed to determine the maximum number of “Blocking Op Credits” (also referred to as long-operation credits, or LOC) that a client is allowed to consume. Sequence numbers also allow for long-running commands and commands with multiple responses from the server, balanced by controlling how many resources the client can consume.


Thus, an extension to the valid command window is to allow the window to continue to slide as normal, and not be held up by operations that may take an indefinite amount of time. To this end, the client is granted a given number of Blocking Op credits by the server and any operation issued with the Blocking Op flag will consume a Blocking Op credit. When the server receives a command, the server may send an interim response back to the client with such a flag set that acknowledges the receipt of a long-standing command, and returns a long-standing command ID, also referred to as an asynchronous identifier (AsyncID). This response allows the valid command window to slide as it normally would. When the long-standing command is completed, a new response is sent back to the client using the long standing command ID to indicate to which packet it is responding. This send-response-response architecture allows the window to continue to move, and the credit mechanism allows the server to retain control over how many resources the client can consume. The server can even shrink the valid command window if there are a large number of long standing operations in progress from the client.


Alternative implementations include a protocol that allows the client to hint to the server that a long-standing command may be coming. Another implementation of the asynchronous concept also may have the client issue an interim “accept” or the like, such that an async/blocking operation takes the form, “send-rec-send-rec” as opposed to simply send-rec-rec. Note that some underlying transports (e.g., TCP) are often tuned for request-response traffic, and may introduce delays in a request-response-response situation.


Due to the asynchronous nature of the protocol and the transports, the current valid window will not be directly equal to the current minimum sequence ID plus the credits, since some intermediate commands may be received first, or, for example, the command with sequence ID=1 may take a long time to process. However, the server may place a limit on how large this valid window can grow before it is stopped from growing. Continuing with the above example, the server may specify that the maximum window size is ten (10). This means that the valid operation (command) window may grow to [1, 10] if the server receives and processes packets 2, 3, 4, 5, and 6 before its receives or completes processing of packet 1. Thus, the sequence numbers that would be valid are 1, 7, 8, 9, 10. However, if the server then receives packet 7 and processes it, the valid operation (command) window will not slide to [1, 11], but remains at [1, 10] with acceptable sequence numbers of 1, 8, 9, 10. The response on command 8 would indicate a (−1) credit to tell the client that the client is reaching the end of its acceptable limits, that is, its Credits value is now 4. This is one way in which the server prevents the client from ever skipping a given number in the sequence that would prevent the window from sliding nicely. This also demonstrates the value of issuing “Blocking Ops” against a server for commands that will take a long time.


Tracking the valid command window on the server side may be computationally expensive as the server needs to keep track of intersecting sets. To simplify this, one example implementation will establish the maximum window size described above, as the largest the server will ever let the command window become. Once this is established, the server allocates a buffer representing this size, and as commands come in, the value at that location in the buffer is changed. As long as the window size remains less than or equal to the maximum window size, then as the start of the window moves forward, the server moves its buffer pointer forward. Likewise, when the end grows as credits are granted, the server moves its end pointer along the buffer. Arithmetic handles situations where the buffer “wraps” the maximum window size. It is possible to grow the maximum window size dynamically, by allocating a larger buffer and copying the current values into it. Interlocked operations are used to track the status of the valid commands within the window, starting as AVAILABLE. Upon receiving the command from the client, they transition to IN_PROGRESS, and when the response (or interim response for a long-running command case) is sent, it transitions to USED. If the value transitioning to USED is the first value in the window, the window is slid forward until a non-USED value is encountered.


Another alternative allows for the server to revoke credits via an alternate channel or through unsequenced communication. For example, consider that the server has granted the client ten credits, but wants to trim the client down to five credits, which ordinarily will not happen until the client uses five commands. If the client is idle, the server may indicate to the client that it must use five credits in the next N seconds, or it will be in violation and terminated (or lose the credits). This allows the server to throttle down clients without relying on the client to move their own window.


Turning to an explanation of the operation of the invention via the use of various examples, the current state will be set forth in the format below:



















Min:
Current Credits:
Credits:
Valid:
Max:









1
(5, 1)
(5, 1)
[1, 5]
[1, 11]






except {}










The Min column shows the lowest unused client sequence number that the client is allowed to use; current credits are how many credits are granted to the client, in the form (normal credits, blocking op credits). A client consumes a credit on a send, and possibly re-increments on the receive (depending on the response). The next column, simply “Credits” shows the current maximum number of credits the client is allowed.


Valid and Max represent server-side structures for sequence identifier validation; (note that the client need not have any idea about these). Valid shows the Valid Op Window along with the exceptions of sequence identifiers that were already used (e.g., tracked by bitmap), and Max shows the MaxCommandWindow that the client can ever fill before completing the first operation, that is, the operation that would cause the window to shift.



FIGS. 3-9 represent an example on how the valid operation (Valid Op) window 330S grows as maintained at the server 204; (note that in FIGS. 3-9, as the valid operation window changes, the first digit of its label changes, e.g., FIG. 3 has a valid operation window labeled 330S, FIG. 4 has a valid operation window labeled 430S, and so forth.


In FIG. 3, a client is granted 5 credits and a starting sequence number (or MID) of 1. Some criteria 320 as generally described above, e.g., the type of client, is used by an allocator component 322 to determine the amount to grant the client. In this example, the current valid operation window is thus [1, 5], as represented vertically in FIG. 5 by individual digits in the window 330S. The server 204 thus will accept a packet with sequence number 1, 2, 3, 4 or 5 from this client 202. This is alternatively represented in the above-described format as follows:



















Min:
Current Credits:
Credits:
Valid:
Max:









1
(5, 1)
(5, 1)
[1, 5]
[1, 11]






except {}










The valid op window 320S is used to trivially reject packets; if they lie within the valid op window 320S, the server 204 than checks an internal exception map to guarantee a sequence number has not been already used.


In the typical event of a monotonically increasing receive, the client sends a packet with MID=1, and the client and server transition to the state represented in FIG. 4 and in the table below; (note that [1, 5] are considered valid, but 1 is only truly valid for a response from the server, not for another receipt from the client, which would fail against the Min=2 check first).



















Min:
Current Credits:
Credits:
Valid:
Max:









2
(4, 1)
(5, 1)
[1, 5]
[1, 11]






except {1}










In FIG. 4, the server receives and processes the command with sequence number=1. This means that 1 is no longer a valid sequence number for subsequent commands, as represented by the bracketed {1} in the valid/exception column in the table above and in the valid operation window labeled 430S in FIG. 4.


When the server responds, it grants the client an additional (+1) credit on the response, and slides the window, as represented in FIG. 5 and in the table below:



















Min:
Current Credits:
Credits:
Valid:
Max:









2
(5, 1)
(5, 1)
[2, 6]
[2, 12]






except {}










The client now has a valid window of [2, 6]. Consider when an out-of-order receive occurs, e.g., the asynchronous send on the transport is such that the server received command 3 before command 2 (and responds to it). The valid op window 630S would then conceptually exist as represented in FIG. 6 and as follows:



















Min:
Current Credits:
Credits:
Valid:
Max:









2
(5, 1)
(5, 1)
[2, 7]
[2, 12]






except {3}










Note that in the table, the valid window extends, but the maximum window does not slide. However, when the server receives command 2 and responds, the window 730S will slide over both, as in FIG. 7 and as below:



















Min:
Current Credits:
Credits:
Valid:
Max:









4
(5, 1)
(5, 1)
[4, 8]
[4, 14]






except {}










Consider next a malicious client attempting to use up resources on the server by sending commands and refusing the responses. Here the client has sent the server commands 4 and 5, and is refusing the responses. The state becomes as represented in FIG. 8 and as below:
















Min:
Current Credits:
Credits:
Valid:
Max:







6
(3, 1)
(5, 1)
[4, 8]
[4, 14]





except {4, 5}









After commands with sequence identifiers 6, 7, 8 are sent, because of credit enforcement, the client is out of credits and all packets are refused, as represented in FIG. 9 and in the table below:
















Min:
Current Credits:
Credits:
Valid:
Max:







9
(0, 1)
(5, 1)
[4, 8]
[4, 14]





except {4, 5, 6, 7, 8}









Turning to examples of maximum window enforcement, FIGS. 10-13 and similar tables are used. Consider a malicious client trying to send a packet N+1 and beyond, without sending us packet N. The examples of FIGS. 10-13 will start at the state before the last attacker, that is, FIG. 10 is essentially FIG. 7:



















Min:
Current Credits:
Credits:
Valid:
Max:









4
(5, 1)
(5, 1)
[4, 8]
[4, 14]






except {}










The client sends commands 5, 6, 7, 8, 9, 10, and the server responds, but without sending command 4. This state is shown in FIG. 11 and in the table below:
















Min:
Current Credits:
Credits:
Valid:
Max:







4
(5, 1)
(5, 1)
[4, 14]
[4, 14]





except {5, 6, 7, 8, 9, 10}









Note that the client still has five credits because there are still five viable slots in the command window. However, when the client sends, and the server responds, to command 11, the state in FIG. 12 and in the table below exists:
















Min:
Current Credits:
Credits:
Valid:
Max:







4
(4, 1)
(5, 1)
[4, 14] except
[4, 14]





{5, 6, 7, 8, 9, 10, 11}









Note that the client then continues with 12, 13, 14. The client's available number of credits has been reduced by one for each command because there is not an available slot in the MaxWindow. This will continue for commands 12, 13, 14:

















Current





Min:
Credits:
Credits:
Valid:
Max:







4
(1, 1)
(5, 1)
[4, 14] except
[4, 14]





{5, 6, 7, 8, 9, 10, 11, 12, 13, 14}









Now the only command the server will accept from the client is command 4, as represented in FIG. 13.


As can be readily appreciated, the attributes of a window of sequence numbers are very advantageous in a number of desirable scenarios. Some of these scenarios include preventing denial-of-service, allowing quality-of-service, providing a common language for the client and server to reference commands that were executed over a given connection, allow for long-running commands and commands with multiple responses from the server, but balance it with controlling how many resources the client can consume, and allowing for continuous use of security signatures.


With respect to preventing denial-of-service, the server may limit the amount of resources a given client connection may consume, until the server has authenticated the client and the client is behaving correctly. For example, by allowing the server to control the resources allocated to a client, when an apparent attack is detected, the server can enter a “panic mode” where it reduces resources available to its clients to a minimum, and grants them back on a trust-basis. The server gives each client a small enough window to allow work to happen, but prevents any single client from overwhelming essentially all of the resources. When the attack is over or reduced, the server can begin re-granting resources to clients that prove trustworthy.


With respect to allowing quality-of-service, the variable window scheme allows the server to scale the amounts of resources allocated to clients based on their identity and/or their behavior. For example, the server may allot more resources to a web server connecting to the file server than to a single user accessing individual documents. As another example, if another server is a database server that is accessing a file server, the file server may weight the number of credits granted higher than that granted to an average user.


Moreover, when controlling quality of service, the allocation of resources to clients may be dynamically altered based on the clients' various needs. This allows the server to grant credits in a completely fair manner, or to take other information into account. An administrator may configure machines on resource priority basis, and this may be utilized and change dynamically as users connect and disconnect.


Sequence numbers also provide a common language for the client and server to reference commands that were executed over a given connection. This assists in the building of various features, including persistent handles. For example, because both the client and the server have agreed on a common language for identifying commands as they are sent and received, that is, the sequence number mechanism, when a disconnect occurs there is a straightforward way upon connection reestablishment for the server and client to determine which commands were received and which were not. Without such a set scheme, it is more difficult to track, particularly when the command identifier is chosen by the client and potentially re-used.


Sequence numbers further allow for continuous use of security signatures, without the extreme performance problems of current models; the sends need not be sequenced, (although the checksum of the whole packet will still need to be calculated, and entire packet received before issuing). With respect to packet signing, replayability is not possible. More particularly, a network protocol that does signing needs to embed an index number into the packet to prevent replayability of the signed packet, otherwise an attacker simply reissues the packet without having to resign it, and the packet remains valid. Other methods include timestamps and the like, however these require some form of synchronization between client and server. If index numbers are used, often the network traffic between the client and the server becomes serialized, because the client must ensure the server receives packet 1 before it sends packet 2.


With a sequence number embedded as the command identifier, and a valid window supported on the server, parallel command sends with sequence numbers in them occur naturally. The server enforces the valid window, so each command can only be issued once, whereby replayability is not a problem, as long as the protocol ensures that the key used for signing is unique for each authenticated connection. Note that if the command identifier rolls over, then replayability could become a problem, and thus sequence numbers on the order of 32 bits or 64 bits are desirable to prevent this, with 64 bits likely more desirable if the re-establishment of broken connections is allowed.


While the invention is susceptible to various modifications and alternative constructions, certain illustrated embodiments thereof are shown in the drawings and have been described above in detail. It should be understood, however, that there is no intention to limit the invention to the specific forms disclosed, but on the contrary, the intention is to cover all modifications, alternative constructions, and equivalents falling within the spirit and scope of the invention.

Claims
  • 1. In a network computing environment having a client and server, a method comprising: establishing, by a server computing device, a session for receiving file system commands from a client;establishing, by the server computing device, a valid command window comprising at least one sequence number, wherein the valid command window is adjusted to include an additional unused sequence number in response to the client being granted an additional credit, wherein the additional credit enables the client to consume server resources using the file system commands;receiving, at the server computing device, a file system command that consumes at least one server resource, the file system command including an associated sequence number;determining whether the associated sequence number is within the valid command window;determining whether the associated sequence number has not been previously included in another file system command;allowing the file system command upon determining the associated sequence number is within the valid command window and has not been previously included in another file system command sent during the session; andgranting to the client a first additional credit and adjusting the valid command window to include a first additional unused sequence number.
  • 2. The method of claim 1 further comprising, allowing the command upon determining that the associated sequence number is not beyond a maximum sequence number.
  • 3. The method of claim 1 further comprising, in response to the received command, granting to the client a second additional credit and adjusting the valid command window to include a second additional unused sequence number.
  • 4. The method of claim 1 wherein, allowing the file system command consumes one credit granted to the client.
  • 5. The method of claim 1 further comprising: granting the client one or more blocking operation credits; andallowing a blocking operation to be performed by the server in response to receiving a blocking command sent from the client wherein the blocking command has not exceeded a maximum number of blocking operation credits.
  • 6. The method of claim 5 further comprising: returning data indicating the blocking operation's progress; andreturning an identifier for the blocking operation.
  • 7. The method of claim 6 further comprising, granting to the client an additional credit and adjusting the valid command window in response to receiving the blocking operation command.
  • 8. The method of claim 1 further comprising, processing a received request for an additional credit from the client.
  • 9. The method of claim 1 further comprising, revoking at least one credit previously granted to the client.
  • 10. At least one computer-storage medium not consisting of a propagated data signal having computer executable instructions, which when executed perform steps, comprising: establishing a session for receiving file system commands from a client; establishing a valid command window comprising at least one sequence number, wherein the valid command window is adjusted to include an additional unused sequence number in response to the client being granted an additional credit, wherein the additional credit enables the client to consume server resources using the file system commands;receiving a file system command to consume at least one server resource, the file system command including an associated sequence number;determining whether the associated sequence number is within the valid command window;determining whether the associated sequence number has not been included in another file system command;allowing the file system command upon determining the associated sequence number is within the valid command window and has not been included in another file system command during the session, otherwise denying the file system command; andgranting to the client a first additional credit and adjusting the valid command window to include a first additional unused sequence number.
  • 11. The computer-storage medium of claim 10 wherein the step of granting to the client a first additional credit is performed upon determining not to revoke the credits previously granted to the client.
  • 12. The computer-storage medium of claim 10 wherein the step of granting the client a first additional credit is performed when the sequence number in the valid command window does not exceed a maximum window size.
  • 13. The computer-storage medium of claim 10 comprising instructions which when executed perform the step of revoking at least one credit previously granted to the client.
  • 14. The computer-storage medium of claim 10 having further computer executable instructions, comprising: granting to the client one or more blocking operation credits; andallowing a blocking operation to be performed by the server in response to receiving a blocking command sent from the client, wherein the blocking command has not exceeded a maximum number of blocking operation credits.
  • 15. In a network computing environment having a client and server, a server-side system comprising: at least one processor; andat least one memory with computer executable instructions that when executed by the at least one processor provide:a server mechanism that establishes a session for receiving file system commands from a client and limits use of server resources by controlling a number of credits granted to the client, the credit enabling the client to consume one or more server resources using a file system command, the mechanism including: a valid command window, containing unique numbers, one for each credit granted to the client;an enforcement mechanism that allows the client to consume the one or more server resources for the file system command, provided the unique number associated with the file system command is within the valid command window and has not been included in another file system command during the session; andan allocation mechanism that controls credits granted to the client and the unique numbers within the valid command window, wherein the valid command window is adjusted to include an additional unique number in response to the client being granted an additional credit.
  • 16. The system of claim 15 wherein the enforcement mechanism includes a server message block protocol driver.
  • 17. The system of claim 15 wherein the server mechanism is configured to revoke at least one credit previously granted to the client.
CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority to U.S. provisional patent application Ser. No. 60/685,008, filed May 25, 2005, and herein incorporated by reference. The present application is related to United States patent application entitled “Data Communication Protocol”, U.S. patent application Ser. No. 11/182,251, filed concurrently herewith, assigned to the assignee of the present invention, and hereby incorporated by reference.

US Referenced Citations (141)
Number Name Date Kind
4399504 Obermarck Aug 1983 A
4780821 Crossley Oct 1988 A
4791566 Sudama Dec 1988 A
4825354 Agrawal Apr 1989 A
4887204 Johnson Dec 1989 A
4891785 Donohoo Jan 1990 A
4914570 Peacock Apr 1990 A
5008853 Bly Apr 1991 A
5109519 Zimmet Apr 1992 A
5113519 Johnson May 1992 A
5202971 Henson Apr 1993 A
5218696 Baird et al. Jun 1993 A
5261051 Masden et al. Nov 1993 A
5265261 Rubin et al. Nov 1993 A
5313646 Hendricks et al. May 1994 A
5349642 Kingdon Sep 1994 A
5410697 Baird Apr 1995 A
5437013 Rubin et al. Jul 1995 A
5452447 Nelson Sep 1995 A
5493728 Solton Feb 1996 A
5513314 Kandasamy Apr 1996 A
5522042 Fee et al. May 1996 A
5535375 Eshel et al. Jul 1996 A
5560008 Johnson et al. Sep 1996 A
5588117 Karp et al. Dec 1996 A
5628005 Hurvig May 1997 A
5764887 Kells et al. Jun 1998 A
5826027 Pedersen et al. Oct 1998 A
5931913 Meriwether et al. Aug 1999 A
5933602 Grover Aug 1999 A
5978802 Hurvig Nov 1999 A
6085247 Parsons et al. Jul 2000 A
6092199 Dutcher Jul 2000 A
6125122 Favichia et al. Sep 2000 A
6131125 Rostoker et al. Oct 2000 A
6208952 Goertzel et al. Mar 2001 B1
6219799 Kandasamy Apr 2001 B1
6247139 Walker et al. Jun 2001 B1
6324581 Xu et al. Nov 2001 B1
6401123 Shields et al. Jun 2002 B1
6453354 Jiang et al. Sep 2002 B1
6640226 Shringeri et al. Oct 2003 B1
6658476 Van Dec 2003 B1
6829473 Raman et al. Dec 2004 B2
6910082 Marcotte Jun 2005 B1
6928577 Moser et al. Aug 2005 B2
7020651 Ripley Mar 2006 B2
7103007 Natarajan et al. Sep 2006 B2
7111035 McClellan et al. Sep 2006 B2
7111060 Araujo et al. Sep 2006 B2
7197535 Salesky et al. Mar 2007 B2
7243132 Choi Jul 2007 B2
7318102 Krause et al. Jan 2008 B1
7330910 Young et al. Feb 2008 B2
7339885 Ahrens et al. Mar 2008 B2
7380080 Hughes May 2008 B2
7380155 Fung et al. May 2008 B2
7386889 Shay Jun 2008 B2
7421502 Czap et al. Sep 2008 B2
7434087 Singh Oct 2008 B1
7444536 Jairath Oct 2008 B1
7453879 Lo Nov 2008 B1
7457722 Shain et al. Nov 2008 B1
7509407 Miller et al. Mar 2009 B2
7539722 Mohamed et al. May 2009 B2
7664991 Gunda et al. Feb 2010 B1
7702745 Lin et al. Apr 2010 B2
20020019874 Borr Feb 2002 A1
20020083130 Shimada et al. Jun 2002 A1
20020152315 Kagan et al. Oct 2002 A1
20020161980 Nishikawa Oct 2002 A1
20030056069 Cabrera et al. Mar 2003 A1
20030058277 Bowman-Amuah Mar 2003 A1
20030093678 Bowe et al. May 2003 A1
20030112754 Ramani et al. Jun 2003 A1
20030115341 Sinha et al. Jun 2003 A1
20030126195 Reynolds et al. Jul 2003 A1
20030140129 Livnat et al. Jul 2003 A1
20030169859 Strathmeyer et al. Sep 2003 A1
20030182282 Ripley Sep 2003 A1
20040003210 Duale et al. Jan 2004 A1
20040003241 Sengodan et al. Jan 2004 A1
20040018829 Raman et al. Jan 2004 A1
20040032876 Garg et al. Feb 2004 A1
20040103342 Moser et al. May 2004 A1
20040136325 Dobric et al. Jul 2004 A1
20040160909 Sheynblat Aug 2004 A1
20040215794 Lauer Oct 2004 A1
20040260748 Springer, Sr. et al. Dec 2004 A1
20040267932 Voellm et al. Dec 2004 A1
20040268118 Bazan Bejarano Dec 2004 A1
20050010670 Greschler et al. Jan 2005 A1
20050015511 Izmailov et al. Jan 2005 A1
20050015747 Zatloukal et al. Jan 2005 A1
20050021832 Bennett et al. Jan 2005 A1
20050041686 Roy et al. Feb 2005 A1
20050055345 Ripley Mar 2005 A1
20050060442 Beverly et al. Mar 2005 A1
20050091212 Mohamed et al. Apr 2005 A1
20050102537 Zheng May 2005 A1
20050111030 Berkema et al. May 2005 A1
20050114670 Bowe et al. May 2005 A1
20050125378 Kawada Jun 2005 A1
20050129045 Machulsky et al. Jun 2005 A1
20050131832 Fransdonk Jun 2005 A1
20050132077 Biran et al. Jun 2005 A1
20050138528 Ameigeiras et al. Jun 2005 A1
20050149817 Biran et al. Jul 2005 A1
20050177635 Schmidt et al. Aug 2005 A1
20050182850 Kohno Aug 2005 A1
20050198113 Mohamed et al. Sep 2005 A1
20050198247 Perry et al. Sep 2005 A1
20050223014 Sharma et al. Oct 2005 A1
20050246803 Spencer Nov 2005 A1
20050248803 Ohara Nov 2005 A1
20050251448 Gropper Nov 2005 A1
20050257022 Hughes Nov 2005 A1
20050258022 Horton et al. Nov 2005 A1
20050262084 Tomita Nov 2005 A1
20050262103 Stakutis et al. Nov 2005 A1
20060031519 Helliwell et al. Feb 2006 A1
20060041698 Han et al. Feb 2006 A1
20060047818 Kruglick et al. Mar 2006 A1
20060080443 Kruglick et al. Apr 2006 A1
20060085328 Cohen et al. Apr 2006 A1
20060095382 Mahlbacher May 2006 A1
20060130107 Gonder et al. Jun 2006 A1
20060168262 Frazer Jul 2006 A1
20060206705 Khosravi Sep 2006 A1
20060271697 Kruse et al. Nov 2006 A1
20060281525 Borissov Dec 2006 A1
20070171793 Mesut et al. Jul 2007 A1
20080151885 Horn et al. Jun 2008 A1
20080172397 Maeda et al. Jul 2008 A1
20090077097 Lacapra et al. Mar 2009 A1
20090138615 Cristallo et al. May 2009 A1
20090172085 Arthursson Jul 2009 A1
20090319661 Shiozawa et al. Dec 2009 A1
20090327798 D'Amato et al. Dec 2009 A1
20100185704 George et al. Jul 2010 A1
20120151249 Swan et al. Jun 2012 A1
Foreign Referenced Citations (35)
Number Date Country
1 259 045 Nov 2002 EP
1259045 Nov 2002 EP
1 727 056 Nov 2006 EP
60-019341 Jan 1985 JP
62-297927 Dec 1987 JP
63-061148 Mar 1988 JP
63-205747 Aug 1988 JP
63-256165 Oct 1988 JP
64-061148 Aug 1989 JP
02-101847 Apr 1990 JP
03-048558 Mar 1991 JP
03-074745 Mar 1991 JP
03-245939 Sep 1991 JP
04-172039 Jun 1992 JP
04-229746 Aug 1992 JP
05-089048 Apr 1993 JP
05-143488 Jun 1993 JP
06-075890 Mar 1994 JP
10-313342 Nov 1998 JP
11-055314 Feb 1999 JP
2001-094613 Apr 2001 JP
2003-016766 Jan 2003 JP
2003-032727 Feb 2003 JP
2003-069610 Mar 2003 JP
2003-281091 Mar 2003 JP
2003-125022 Apr 2003 JP
2004-005427 Jan 2004 JP
2004-139385 May 2004 JP
2004-229143 Aug 2004 JP
2005-322016 Nov 2005 JP
2007-49755 Feb 2007 JP
3967758 Jun 2007 JP
10-1994-0001700 Mar 1994 KR
10-0860152 Sep 2008 KR
WO 03096646 Nov 2003 WO
Related Publications (1)
Number Date Country
20060271692 A1 Nov 2006 US
Provisional Applications (1)
Number Date Country
60685008 May 2005 US