# US 2003/0204631 A1 · Method to synchronize and upload an offloaded network stack connection with a network stack

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2003/0204631 A1
- Document ID: US20030204631A1
- Status: Published application
- Kind: A1
- Application number: 10/135,630
- Filed: 2002-04-30
- Published: 2003-10-30
- Earliest claimed: 2002-04-30
- Assignees: Microsoft Corporation
- Inventors: James Pinkerton; Abolade Gbadegesin; Sanjay Kaniyar; NK Srinivas
- Web page: https://patentgrep.com/patent/US20030204631A1

## CPC

- H04L 69/16: Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L 69/10: Streamlined, light-weight or high-speed protocols, e.g. express transfer protocol [XTP] or byte stream
- H04L 69/161: {Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields}
- H04L 69/166: IP fragmentation; TCP segmentation
- H04L 69/32: Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A method to synchronize and upload an offloaded network stack connection between a host network stack and peripheral device is presented. A state object for each layer in the stack is sent to the device that includes state variables that are classified as a constant, a cached variable handled by the host, or a delegated variable handled by the device. State that must be updated by the network stack and the peripheral device is cleanly divided. For example, statistics are tracked by the host, the device, or the host and the device. A statistic tracked by both the host and peripheral device is divided into non-overlapping portions and combined to produce the statistic. Once an upload is initiated, the device achieves a consistent state and hands delegated states to the stack. Each layer in the stack takes control of its delegated state and resources at the device are freed.

## Claims

### Claim 1

A method to upload an offloaded network stack state object from a first path going from a peripheral device to a switch layer to a second path going from the peripheral device through a plurality of software layers and the switch layer, the plurality of software layers including an intermediate layer, the network stack state object having at least one cached state and at least one delegated state, the method comprising the steps of:
commanding the intermediate layer to take control of the at least one delegated state after the at least one delegated state has been received; and
sending data through the second path.

### Claim 2 (depends on 1)

The method of claim 1 further comprising the step of initiating an upload of the offloaded network stack state object.

### Claim 3 (depends on 1)

The method of claim 1 wherein the plurality of layers includes a network layer, the peripheral device having a network delegated state, the method further comprising the steps of:
decrementing a count of a number of offloaded transport connections for the network delegated state; and
if the count is decremented to zero:
sending a message to the peripheral device to send the network delegated state to the network layer.

### Claim 4 (depends on 1)

The method of claim 1 wherein the plurality of layers includes a framing layer, the peripheral device having a framing delegated state, the method further comprising the steps of:
decrementing a framing count of a number of offloaded network layer states for the framing delegated state; and
if the framing count is decremented to zero:
sending a message to the peripheral device to send the framing delegated state to the framing layer.

### Claim 5 (depends on 1)

The method of claim 1 further comprising the step of determining if the upload should be initiated.

### Claim 6 (depends on 5)

The method of claim 5 wherein the step of determining if the upload should be initiated includes at least one of:
determining if an amount of data being forwarded to the peripheral device is above a maximum threshold;
determining if the peripheral device can not process a function;
determining if an application is not pre-posting buffers; and
determining if the amount of data being forwarded to the peripheral device is below a minimum bandwidth.

### Claim 7 (depends on 1)

A computer-readable medium having computer executable instructions for performing the steps of claim 1.

### Claim 8 (depends on 7)

The computer-readable medium of claim 7 having further computer executable instructions for performing the step of determining if the upload should be initiated, the step of determining if the upload should be initiated includes at least one of:
determining if an amount of data being forwarded to the peripheral device is above a maximum threshold;
determining if the peripheral device can not process a function;
determining if an application is not pre-posting buffers; and
determining if the amount of data being forwarded to the peripheral device is below a minimum bandwidth.

### Claim 9 (depends on 7)

The computer-readable medium of claim 7 wherein the plurality of layers includes a network layer and a framing layer, the peripheral device having a network delegated state and a framing delegated state, the computer-readable medium having further computer executable instructions for performing the steps of:
decrementing a count of a number of offloaded transport connections for the network delegated state; and
if the count is decremented to zero:
sending a message to the peripheral device to send the network delegated state to the network layer;
decrementing a framing count of a number of offloaded network layer states for the framing delegated state; and
if the framing count is decremented to zero:
sending a message to the peripheral device to send the framing delegated state to the framing layer.

### Claim 10

A method to upload an offloaded network stack state object and at least one associated protocol from a first path going from a peripheral device to a switch layer to a second path going from the peripheral device through a plurality of software layers and the switch layer, the plurality of software layers including an intermediate layer, the network stack state object having a cached state and a delegated state, the method comprising the steps of:
completing outstanding requests with a transfer status;
handing the delegated state to the switch layer;
freeing resources in the peripheral device for the intermediate layer; and
sending data through the second path.

### Claim 11 (depends on 10)

The method of claim 10 further comprising the step of initiating an upload of the offloaded network stack state object and the at least one associated protocol.

### Claim 12 (depends on 10)

The method of claim 10 wherein the plurality of layers includes a network layer, the peripheral device having a network delegated state, the method further comprising the steps of:
sending the network delegated state to the network layer if all offloaded connections from the transport layer have been uploaded.

### Claim 13 (depends on 10)

The method of claim 10 wherein the plurality of layers includes a framing layer, the peripheral device having a framing delegated state, the method further comprising the steps of:
sending the framing delegated state to the framing layer if all offloaded connections from the network layer have been uploaded.

### Claim 14 (depends on 10)

The method of claim 10 further comprising the step of determining if the upload should be initiated.

### Claim 15 (depends on 14)

The method of claim 14 wherein the step of determining if the upload should be initiated includes at least one of:
determining if an amount of data being forwarded from the switch layer to the peripheral device is above a maximum threshold;
determining if there is a lack of activity in the offloaded network stack connection;
determining if the peripheral device can not process a function;
determining if connection behavior is unsuitable for offload;
determining if an upload will enable higher priority state objects to use peripheral device resources if peripheral device resource availability is below a threshold;
determining if an application is not pre-posting buffers; and
determining if the amount of data being forwarded to the peripheral device is above a maximum bandwidth.

### Claim 16 (depends on 10)

A computer-readable medium having computer executable instructions for performing the steps of claim 10.

### Claim 17 (depends on 16)

The computer-readable medium of claim 16 having further computer executable instructions for performing the step comprising determining if the upload should be initiated, the step of determining if the upload should be initiated including at least one of:
determining if an amount of data being forwarded from the switch layer to the peripheral device is above a maximum threshold;
determining if there is a lack of activity in the offloaded network stack connection;
determining if the peripheral device can not process a function;
determining if connection behavior is unsuitable for offload;
determining if an upload will enable higher priority state objects to use peripheral device resources if peripheral device resource availability is below a threshold;
determining if an application is not pre-posting buffers; and
determining if the amount of data being forwarded to the peripheral device is above a maximum bandwidth.

### Claim 18

A method of synchronizing an offloaded network stack state object between a host and a peripheral device in a host having a plurality of software layers, each software layer having at least one state variable, the method comprising the steps of:
for each software layer in the plurality of software layers:
classifying the at least one state variable to be one of a constant variable, a cached variable, and a delegated variable;
sending the at least one state variable to the peripheral device; and
if the at least one state variable has been classified as a cached variable:
processing the cached variable by the host; and
updating the cached variable in the peripheral device if the cached variable has changed.

### Claim 19 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is a transport layer and wherein the at least one state variable is classified as a constant variable, the at least one state variable including at least one of a destination port, a source port, a window scale factor, and an offload handle.

### Claim 20 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is a network layer and wherein the at least one state variable is classified as a constant variable, the at least one state variable including at least one of a destination IP address and a source IP address.

### Claim 21 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is a TCP layer and wherein the at least one state variable is classified as a cached variable, the at least one state variable including at least one of a TCP variable and an IP variable.

### Claim 22 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is a network layer and wherein the at least one state variable is classified as a cached variable, the at least one state variable including an offload handle.

### Claim 23 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is a framing layer and wherein the at least one state variable is classified as a cached variable, the at least one state variable including an ARP address.

### Claim 24 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is an IP security layer and wherein the constant variable includes at least one of a source port, a destination port, a protocol type, and security association variables.

### Claim 25 (depends on 18)

The method of claim 18 wherein one of the plurality of software layers is an IP security layer and wherein the cached variable includes at least one of a rekey on byte count, a stop on byte count, a rekey at a predefined tick, a stop at a predefined tick, and a maximum idle time for which a security association may be used.

### Claim 26 (depends on 18)

The method of claim 18 further comprising the steps of:
if the at least one state variable has been classified as a delegated variable:
processing the at least one state variable by the peripheral device; and
updating the at least one state variable if the delegated variable has changed.

### Claim 27 (depends on 26)

The method of claim 26 wherein one of the plurality of software layers is a TCP layer and wherein the at least one state variable is classified as a delegated variable, the at least one state variable including at least one of a current TCP state, a receive window size, a sequence number for next RECV, a maximum send window, a current congestion window, a maximum sequence number sent, and a sequence number for a next SEND.

### Claim 28 (depends on 26)

The method of claim 26 wherein one of the plurality of software layers is a network layer and wherein the at least one state variable is classified as a delegated variable, the at least one state variable including an IP packet id start value.

### Claim 29 (depends on 26)

The method of claim 26 wherein one of the plurality of software layers is an IP security layer and wherein the delegated variable includes at least one of a count of the bytes encrypted or decrypted with a security association, a life time of the security association, and an idle time of the security association.

### Claim 30 (depends on 18)

A computer-readable medium having computer executable instructions for performing the steps of claim 18.

### Claim 31 (depends on 30)

The computer-readable medium of claim 30 having further computer executable instructions for performing the steps comprising:
processing each delegated variable by the peripheral device; and
for each cached variable: updating the cached variable if the cached variable has changed.

### Claim 32

A method to conserve resources in a peripheral device that is processing at least one offloaded state and an associated protocol for a plurality of intermediate software layers, the at least one offloaded state having a state object, the method comprising the steps of:
storing an initial state object for a first offloaded state;
receiving an initial offload handle for the initial state object from the peripheral device;
handing the initial offload handle to the peripheral device on a subsequent offload if the state object is the initial state object; and
receiving a new offload handle on the subsequent offload if the state object is a new state object.

### Claim 33 (depends on 32)

The method of claim 32 wherein the initial state object includes an initial transport state object, the initial offload handle includes an initial transport offload handle, and the new offload handle includes a new transport offload handle, and wherein the steps of handing the initial offload handle to the peripheral device on a subsequent offload if the state object is the initial state object and receiving a new offload handle on the subsequent offload if the state object is a new state object includes the steps of:
handing the initial transport offload handle to the peripheral device on a subsequent offload if the transport state object is the initial transport state object; and
receiving a new transport offload handle on the subsequent offload if the transport state object is a new transport state object.

### Claim 34 (depends on 32)

The method of claim 32 wherein the initial state object includes an initial network state object, the initial offload handle includes an initial network layer offload handle, and the new offload handle includes a new network layer offload handle, and wherein the steps of handing the initial offload handle to the peripheral device on a subsequent offload if the state object is the initial state object and receiving a new state offload on the subsequent offload if the state object is a new state object includes the steps of:
handing the initial network layer offload handle to the peripheral device on a subsequent offload if the network state object is the initial network state object; and
receiving a new network layer offload handle on the subsequent offload if the network state object is a new network state object.

### Claim 35 (depends on 32)

The method of claim 32 wherein the initial state object includes an initial framing state object, the initial offload handle includes an initial framing layer offload handle, and the new offload handle includes a new framing layer offload handle, and wherein the steps of handing the initial offload handle to the peripheral device on a subsequent offload if the state object is the initial state object and receiving a new offload handle on the subsequent offload if the state object is a new state object includes the steps of:
handing the initial framing layer offload handle to the peripheral device on a subsequent offload if the framing state object is the initial framing state object; and
receiving a new framing layer offload handle on the subsequent offload if the framing state object is a new framing state object.

### Claim 36 (depends on 32)

The method of claim 32 wherein the at least one offloaded state includes a transport state object, a network layer state object, and a framing layer state object, and wherein:
the step of storing the initial state object for the first offloaded state comprises storing an initial transport state object, an initial network layer state object, and an initial framing layer state object for a first offloaded connection;
the step of receiving the initial offload handle for the initial state entry from the peripheral device comprises receiving an initial transport state offload handle for the initial transport state object, an initial network layer offload handle for the initial network layer state object, and an initial framing layer offload handle for the initial framing layer state object for the first offloaded connection;
the step of handing the initial offload handle to the peripheral device on a subsequent offload if the state entry has not changed from the initial state comprises:
handing the initial transport state offload handle to the peripheral device on a subsequent offload if the transport state object is the initial transport state object;
handing the initial network layer offload handle to the peripheral device on the subsequent offload if the network layer state object is the initial network layer state object; and
handing the initial framing layer offload handle to the peripheral device on the subsequent offload if the framing layer state object has not changed from the initial framing layer state object; and
the step of receiving the new offload handle on the subsequent offload if the state entry has changed from the initial state after the peripheral device has allocated resources for the state entry comprises:
receiving a new transport state offload handle on the subsequent offload if the transport state object is a new transport state object;
receiving a new network layer offload handle on the subsequent offload if the network layer state object is a new network layer state object; and
receiving a new framing layer offload handle on the subsequent offload if the framing layer state object is a new framing layer state object.

### Claim 37 (depends on 32)

A computer-readable medium for performing the steps of claim 32.

### Claim 38 (depends on 37)

The computer readable medium of claim 37 wherein the at least one offloaded state includes at least one of a transport state object, a network layer state object, and a framing layer state object, and wherein:
the step of storing the initial state object for the first offloaded state comprises storing at least one of an initial transport state object, an initial network layer state object, and an initial framing layer state object for a first offloaded connection;
the step of receiving the initial offload handle for the initial state entry from the peripheral device comprises receiving at least one of an initial transport state offload handle for the initial transport state object, an initial network layer offload handle for the initial network layer state object, and an initial framing layer offload handle for the initial framing layer state object for the first offloaded connection;
the step of handing the initial offload handle to the peripheral device on a subsequent offload if the state entry has not changed from the initial state comprises handing at least one of the initial transport state offload handle to the peripheral device on a subsequent offload if the transport state object is the initial transport state object, the initial network layer offload handle to the peripheral device on the subsequent offload if the network layer state object is the initial network layer state object, and the initial framing layer offload handle to the peripheral device on the subsequent offload if the framing layer state object has not changed from the initial framing layer state object; and
the step of receiving the new offload handle on the subsequent offload if the state entry has changed from the initial state after the peripheral device has allocated resources for the state entry comprises receiving at least one of a new transport state offload handle on the subsequent offload if the transport state object is a new transport state object, a new network layer offload handle on the subsequent offload if the network layer state object is a new network layer state object, a new framing layer offload handle on the subsequent offload if the framing layer state object is a new framing layer state object.

### Claim 39

A method to obtain statistics for a network stack having at least one intermediate software layer and at least one network state object offloaded to a peripheral device, the network state object having at least one of a constant state variable, a cached state variable, and a delegated state variable, the network stack controlled by a host and the offloaded network state object processed by the peripheral device the method comprising the steps of:
for each intermediate software layer:
obtaining statistics from the host for host maintained statistics;
obtaining statistics from the peripheral device for peripheral device maintained statistics;
obtaining statistics from the host and peripheral device for host and peripheral device maintained statistics; and
combining the peripheral device maintained statistics and the host and peripheral device maintained statistics to the host maintained statistics.

### Claim 40 (depends on 39)

The method of claim 39 wherein the statistics are transport control protocol management information base statistics and wherein the host maintained statistics include at least one of a ts_RtoAlgorithm statistic, a ts_rtomin statistic, a ts_RtoMax statistic, a ts_RtoMaxConn statistic, a ts_ActiveOpens statistic, a ts_PassiveOpens statistic, a ts_AttemptFails statistic, a ts_EstabResets statistic, and a ts_numcons statistic.

### Claim 41 (depends on 39)

The method of claim 39 wherein the statistics are transport control protocol management information base statistics and wherein the host and peripheral maintained statistics include at least one of a ts_CurrEstab statistic, a ts_InSegs statistic, a ts_OutSegs statistic, a ts_RetransSegs statistic, a ts_InErrs statistic, and a ts_OutRsts statistic.

### Claim 42 (depends on 39)

The method of claim 39 wherein the statistics are internet protocol version four management information statistics and wherein the host maintained statistics include at least one of an ipsi_forwarding statistic, an ipsi_DefaultTTL statistic, an ipsi_InAddrErrors statistic, an ipsi_ForwDatagrams statistic, an ipsi_UnknownProtos statistic, an ipsi_RoutingDiscards statistic, an ipsi_ReasmTimeout statistic, a ipsi_FagOKs statistic, an ipsi_FragFails statistic, an ipsi_FragCreates statistic, an ipsi_NumIf statistic, an ipsi_NumAddr statistic, and an ipsi_NumRoutes statistic.

### Claim 43 (depends on 39)

The method of claim 39 wherein the statistics are internet protocol version four management information statistics and wherein the host and peripheral device maintained statistics include at least one of an ipsi_InReceives statistic, an ipsi_InHdrErrors statistic, ipsi_InDiscards statistic, an ipsi_InDelivers statistic, an ipsi_OutRequests statistic, an ipsi_OutDiscards statistic, an ipsi_OutNoRoutes statistic, an ipsi_ReamsReqds statistic, an ipsi_ReasmOKs statistic, and an ipsi_ReasmFails statistic.

### Claim 44 (depends on 39)

A computer-readable medium for performing the steps of claim 39.
