Different types of devices that communicate with one another include computing devices, memory, networking devices like network switches and network adapters, node controllers, as well as other types of devices. A computing device may include one or more processors, which can also be considered devices that can communicate with one another. Processors that communicate with one another may be part of the same computing device, or different devices. Furthermore, a processor may include multiple processor cores, which also can communicate with one another.
As noted in the background, one type of type of device is a computing device that can include multiple processors, including multiple processing cores. Processors execute program code, such as processing threads. The threads may be related to one another, and as such, may have to exchange data with each other. For example, a processor executing one thread may request data from a processor executing another thread. The former processor sends a packet of a request packet type to the latter processor, which responds with a packet of a data packet type that includes the requested data.
To increase processing speeds, the rate and bandwidth at which communication can occur may be increased, and the latency with which packets are communicated may be decreased. Such rate and bandwidth increases and latency decreases can be achieved by increasing the number of interface lanes that interconnect the processors. However, adding interface lanes can increase logic die size, the number of semiconductor package pins, and the number of cable connectors, all of which can increase manufacturing cost. Rate and bandwidth increase and latency decrease may also be achieved by increasing communication baud rate, but semiconductor fabrication process and circuit design technology can limit how much baud rate can be increased.
By comparison, techniques described herein provide for increased rate and bandwidth and decreased latency of communication without adding interface lanes or increasing baud rate. Rather, the packets sent between devices are compressed in a variety of different ways. A transmitting device can thus compress a packet before transmitting the packet to a receiving device, which upon receipt of the packet decompresses the packet prior to processing it. The techniques describe herein can be applied to other types of devices that communicate with one another, besides processors and processor cores.
The header 104 of each packet 102 includes a memory block address 108, a length 110, and other information 112. The memory block address 108 specifies the memory address to which the packet 102 pertains. The length 110 specifies the length, such as in bytes, of the packet 102 as a whole, including the header 104 and, if present, the payload 106. The length 110 of a packet 102 may be explicitly encoded, or in another implementation, may be implied or implicit because each packet 108 has a same fixed length. The other information 112 can include the type of the packet (e.g., a data packet type, a request packet type, and so on), error-detection codes, and so on. The packets 102 are of the same type, and can each have the same length 110. The payload 106 of each packet 102, when present, includes the data 114 that the packet 102 of the data packet type is conveying.
The memory block addresses 108 of the packets 102 are consecutive to one another in the example of
The packets 102 are combined into a single combined packet 116 in the example compression technique of
The header 118 includes other information, such as the type of the packet 116, which is same as the type of each packet 102, as well as other information. If the packets 102 and thus the packet 116 are of the data packet type, then the payload 120 is present. The payload 120 includes the data 1114 of each data packet 102, concatenated in order from the packet 102A through the packet 102N.
The single combined packet 116 has a smaller size than the total size of the packets 102. Specifically, the reduction in size of the packet 116 can be equal to the size of the header 104 of a packet 102, multiplied by a value of the total number of packets 102 minus one. That is, whereas the packets 102 as a whole include N headers 104, the combined packet 116 includes one header 118, for a reduction of size that may be equal to (N−1) headers.
If the single combined packet 116 does not include a payload 120 (that is, the packets 102 do not include payloads 106), then the length 124 of the combined packet 116 can be equal to the length 110 of a packet 102. If the combined packet 116 does include a payload 120, then the length 124 can be equal to the size of a header 104, plus the sum of the payloads 106 of the packets 102. The combined packet 116, in other words, can still include the payload 106 of each packet 102.
When the receiving device receives the single combined packet 116, the receiving device may decompose the combined packet 116 back into the packets 102, or into a number of packets other than the N packets 102, before processing. The receiving device may just be able to process packets of a maximum length. Therefore, if the length 124 of the packet 116 is too large, the receiving device can divide the packet 116 into a number of smaller packets, by performing the reverse of the process that has been described to combine the packets 102 into the combined packet 116.
In the example of
Rather than including a block address 208, a length 210, and other information 212 like the header 204 does, the header 218 includes a flag 222 and a sequence number 224. The flag 222 is a unique series of bits that denotes that the header 218 is not a regular or standard header, such as the header 204 of the packet 202, but rather is a reduced-sized header that, besides the flag 222, may include just the sequence number 224. The sequence number 224 may be equal to the number of packets with reduced-size headers that have been consecutively sent from the transmitting device to the receiving device with consecutive memory block addresses, where the first such packet has a memory block address consecutive to a preceding packet with a regular, standard, or full-sized header.
For example, if the packet sent prior to the packet 202 was of the same type as the packet 202 and had a full-sized header, then the sequence number 224 may be one, indicating that the packet 216 is the first packet transmitted in the sequence with a header of reduced size. If the packet sent within a prescribed number of other packets after the packet 216 (i.e., the compressed version of the packet 202) is of the same type as the packet 216, then the sequence number of that packet may be two, and so on. Therefore, if N packets of the same type and that refer to consecutive block addresses are sent from the transmitting device to the receiving device, the first packet includes a full-sized header, and the remaining N−1 packets include reduced-size headers that have sequence numbers 1, 2, . . . , N−1.
The header 218 has a smaller size than the header 204 because the size of the address 208, the length 210, and the other information 212 in total is less than the size of the flag 222 and the sequence number 224. Packets sent from the transmitting device to the receiving device that have such reduced-size headers can have the same length as the most recent packet that the transmitting device sent to the receiving device that had a full-sized header. Similarly, such packets with reduced-size headers are of the same type as the most recent packet sent by the transmitting device to the receiving device that had a full-sized header. As such, the receiving device can expand the header 218 of the received packet 216 back into the header 204 to regenerate the packet 202 prior to processing.
In the example compression technique of
The packet 316 is a compressed version of the packet 302 insofar as the data 314 of the payload 306 has been replaced by an identifier 328 within the payload 320. For example, the transmitting device may refer to a compression dictionary that maps data patterns to unique identifiers. The transmitting device looks up the pattern of the data 314—i.e., the unique sequence of bits of the data 314—within the dictionary to determine the unique identifier that corresponds to this pattern. The unique identifier can be much smaller in size than the data 314 itself. The transmitting device compresses the packet 302 into the packet 316, therefore, by substituting this unique identifier 328 within the payload 320 for the data 314 of the payload 306.
The receiving device has a version of the same compression dictionary. Rather than mapping data patterns to unique identifiers, however, the receiving device's dictionary maps unique identifiers to data patterns. Therefore, when the receiving device receives the compressed packet 316 from the transmitting device, the receiving device looks up the unique identifier 328 of the payload 320 within its dictionary, and replaces the identifier 328 with the data 314 to generate the decompressed packet 302. The receiving device can also calculate the length 310 of the packet 302 and replace the compressed packet 316's length 324 with this length 310.
If the transmitting device determines that a transmission queue includes packets of the same type and that refer to consecutive memory block addresses (402), then the device combines the packets within a single combined packet (404), as has been described in relation to the compression technique of
If the transmitting device determines that the transmission queue does not include packets of the same type and that refer to consecutive memory block addresses (402), then the method 400 can proceed to part 406 with respect to a current packet to be transmitted, such as the first packet in the queue, where the method 400 is subsequently repeated with respect to the other queued packets. The method 400 also proceeds to part 406 from part 404, but where the single combined packet is considered as the current packet in relation to which part 406 is performed. In either case, if the transmitting device determines that the current packet is of the same type as and refers to a memory block address that is consecutive to the memory block address of the packet most recently sent from the transmitting device to the receiving device (406), then the method 400 can proceed to part 408. Specifically, the transmitting device replaces the header of the current packet with a sequence number and a flag indicating that the header has been replaced (408), as has been described in relation to the compression technique of
After the transmitting device replaces the header of the current packet in part 408, or if the transmitting device determines that the current packet is not of the same type as and/or does not refer to a memory block address that is consecutive to the memory block address of the packet most recently sent to the receiving device (406), then the method 400 can proceed to part 410. Specifically, if the transmitting device determines that the current packet is of the data packet type (410) and thus includes a payload, and if the transmitting device determines that the payload matches a pattern within a compression dictionary (412), then the transmitting device replaces the payload with an identifier to which the pattern is mapped within the dictionary (414). That is, the transmitting device performs the compression technique of
After the transmitting device compresses the payload of the current packet in part 414, if the current packet is not of the data packet type (410), or if the current packet is of the data packet type but its payload does not match a pattern within the compression dictionary (414), then the method 400 can proceed to part 416. Specifically, the transmitting device transmits the current packet to the receiving device (416). If more than one packet is within the transmission queue, and the packets are not combined within a single combined packet, then the transmitting device may repeat the method 400 with respect to each packet within the queue, so that each packet is transmitted.
In performing the method 400, the transmitting device may have generated the current packet by performing the compression techniques of
If the receiving device determines that the received packet is of the data packet type (504), and if the receiving device determines that the packet's payload has been compressed (506), then the receiving device expands, or decompresses, the payload (508). The receiving device may determine whether the payload of the packet is compressed in part 506 by inspecting the packet's header for a flag that the transmitting device has added to indicate that the payload has been compressed. The receiving device may decompress the payload in part 508 by looking up a unique identifier of the payload within a compression dictionary that maps identifiers to patterns, and replacing the identifier within the packet's payload with the pattern to which the identifier is mapped, as in
After expanding the packet's payload in part 508, if the packet is not of the data packet type (504), or if the packet is of the data packet type but does not have its payload compressed (506), the method 500 can proceed to part 510. Specifically, if the receiving device determines whether the packet has a sequence number in its header (510), such that the header is of reduced size, then the receiving device expands the header (512). The receiving device can make the determination of part 510 by inspecting the header for a flag that indicates the header is of reduced size. The receiving device can expand the header in part 512 by replacing the flag and the sequence number with a memory block address, length, and any other information, as in
After expanding the packet's header in part 512, or if the packet does not have a reduced-size header (510), the method can proceed to part 514. Specifically, if the receiving device determines that the packet is a combined packet (514), then the receiving device may decompose or divide the packet into multiple packets (516), as in
Processing a packet in part 518 can include, for instance, performing an instruction on the data within the packet's payload in accordance with program code that the receiving device is executing, in the case where the packet is of the data packet type. By comparison, if the packet is of the data request type, then processing the packet in part 518 can include returning data back to the transmitting device in a reply packet of the data packet type. In this case, the receiving device becomes a transmitting device when sending the reply packet, and the transmitting device becomes a receiving device that receives this reply packet.
In the example method 500 of
Each of the devices 602 can thus act as a transmitting device. For example, the device 602A may be a transmitting device when sending packets to the device 602B, in which case the device 602B acts as the corresponding receiving device. Similarly, the device 602B may be a transmitting device when sending packets to the device 602A, in which case the device 602A acts as the corresponding receiving device.
In some implementations, the same device 602A or 602B may act as both the transmitting device and the receiving device with respect to a packet. For instance, a first thread being executed on the device 602A may send a packet to a second thread being executed on the same device 602A. In this example, the device 602A is thus both the transmitting device and the receiving device.
Different techniques have been described for packet compression and decompression. Such compression and decompression techniques can be employed to increase communication rate and bandwidth. Similarly, such techniques can decrease the latency at which communication occurs.