Method For Partitioning
A Block of Data
Into Subblocks And For
Storing And Communicating
Such Subblocks
INTRODUCTION
The present invention provides a method and apparatus for identifving identical subblocks of data within one or more blocks of data and of communicating and storing such subblocks in an efficient manner.
BACKGROUND
Much the massive amount of information stored, communicated, and manipulated by modern computer systems is duplicated within the same or a related computer system. It is commonplace, for example, for computers to store many slightly dif¬ fering versions of the same document. It is also commonplace for data transmitted during a backup operation to be almost identical to the data t ransmitted during the previous backup operation. Computer networks also must repeatedly carry the same or similar data in accordance the requirements of their users.
Despite the obvious benefits that would flow from a reduction in the redundancy of communicated and stored data, few computer systems perform an \ such optimiza¬ tion. ome instances can be found at t he application level, one example being the class of incremental backup utilities that save only t hose files that have changed since t he most recent backup. However, even these ut ilit ies do not at t empt to ex¬ ploit t in- significant similarities bet ween old and new versions of files, and bet ween
1
SUBSTΓTUTE SHEET (Rule 26)
files sharing other close semantic ties. This kind of redundancy can be approached only by analysing the contents of the files.
The present invention addresses the potential for reducing redundancy by providing an efficient method for identifying identical portions of data within a group of blocks of data, and for using this identification to increase the efficiency of systems that store and communicate data.
SUMMARY OF THE INVENTION
To identify identical portions of data within a group of blocks of data, the blocks must be analysed. In a simple aspect of the invention, the blocks are divided into fixed-length (e.g. 512-byte) subblocks and these subblocks are compared with each other so as to identify all identical subblocks. This knowledge can then be used to manage the blocks in more efficient ways.
Unfortunately, the partitioning of blocks into fixed-length subblocks does not always provide a suitable framework for the recognition of duplicated port ions of data, as identical portions of data can occur in different sizes and places within a group of blocks of data. Figure 1 shows how division into fixed-size subblocks fails to generate identical subblocks in two blocks whose only difference is the insertion of a single byte ( ' X ' ). A comparison of the two groups of subblocks would reveal no identical pairs of subblocks.
In a more sophisticated aspect of t he invention, the blocks are partitioned at bound¬ aries determined by the content of t he data itself. For example, the block could be divided at each point at which the preceding three bytes hash t o a particular con¬ stant value. Figure 2 shows how such a partitioning could t urn out . and contrasts it with a fixed-lengt h partitioning.
The fact that a partitioning is data dependent does not imply that it must incorpo¬ rate any knowledge of the syntax or semantics of the dat a. So long as the boundaries are positioned in a manner dependent on the local data content, identical subblocks are likely to be formed from identical portions of data, even if the two portions are not identically aligned relative to the start of their enclosing blocks (Figure 3).
Once the group of blocks has been partitioned into subblocks, the resulting group of subblocks can be manipulated in a manner that exploits the occurrence of duplicate subblocks. This leads to a variety of applications, some of which are listed below. However, the application of a further aspect of the invention leads to even greater benefits.
In a further aspect of the invention, the hash of one or more subblocks is calcu¬ lated. The hash function can be an ordinary hash function or one providing cryp¬ tographic strength. The hash function maps each subblock into a small tractable value (e.g. 128 bits) that provides an identity of the subblock. These hashes can usually be manipulated more efficiently than their corresponding subblocks.
Some applications of aspects of this invention are:
Fine-grained incremental backups: Conventional incremental backup technology uses the file as the unit of backup. However, in practice many large files change only slightly, resulting in a wasteful re-t ransmission of changed files. By storing the hashes of subblocks of t he previous versions of files, t he transmission of unchanged subblocks can be eliminated.
Communications: By providing a framework for communicating the hashes of subblocks. the invention can eliminate the transmission of sub- blocks already possessed by the receiver.
Differences: The invention could be used as the basis of a program that determines the areas of similarity and difference between two blocks.
Low-redundancy file system: Data stored in a file system can be par¬ titioned into subblocks whose hashes can be compared so as to eliminate the redundant storage of identical subblocks.
Virtual memory: Virtual memory could be organized by subblock us¬ ing a table of hashes to determine if a subblock is somewhere in memory.
Clarification Of Terms
The term block and subblock both refer, without limitation, to finite blocks or infinite blocks (sometimes called streams) of zero or more bits or bytes of digital data. Although the two different terms ( "block" and '"subblock" ) essentially describe the same substance (digital data), the two different terms have been employed so as to indicate the role that a particular piece of data is playing. The term "block" is usually used to refer to raw data to be manipulated by aspects of the invention. The term '"subblock" is usually used to refer to a part of a block.
The term partition has its usual meaning of exhaustively dividing an entity into mutuallv exclusive parts. However, within this patent specification, the term also includes:
• Analyses in which only one or more parts are analysed.
• Analyses in which multiple overlapping subblocks are formed.
A natural number is a non-negative integer (0. 1. 2. 3. 4. δ. . . . ).
Where the phrase zero or more is used, this phrase is intended to encompass the degenerate case where the objects being enumerated are not considered at all, as well as the case where zero or more objects are used.
BRIEF DESCRIPTION
The following aspects of this invention are numbered for reference purposes. The terms ''block" and "subblock" refer to blocks and subblocks of digital data.
1. In an aspect of the invention, the invention provides a method for partitioning a block b into one or more subblocks, the method using the component :
(i ) a deterministic or non-deterministic function F that returns one of at least two values, and whose arguments include at least a block of A bits and a block of B bits, where A and B are natural numbers;
and comprising the step of:
a. Basing the positions of subblock boundaries on the positions k in the block for which F(bk-A ■ ■ ■ bk, bk+ι ■ ■ ■ bk+β) alls within a predetermined subclass of the set of possible function result values.
Note : The specification of tins aspect (and each other specification of an aspect involving a function F) encompasses the elegenerate case in which either A or B is zero and the function takes (without limitation) just one of the two arguments described. Such specifi¬ cations also include the case of functions F that do not use some bits of their arguments. A function F that bases its calculation solely on (say) ^-3 end b^+2 would fall unde r the classes of F constrained by the condition A > 4 and B > 2.
2. In a further aspect of the invent ion, the invent ion provides a method for locat ing the nearest subblock boundary on a particular side of a particular posit ion p wit hin
a block, the method using the same components as aspect 1 , but replacing step (a) with:
a. Evaluating F(bp_A . . . bp, bp+ l . . . bp+β ) for increasing (or decreasing) /) until the result of F falls within a predetermined subclass of the set of possible function result values, the position of the resultant boundary being based on this position.
3. In a further aspect of the invention, the invention provides a method for parti¬ tioning a block into one or more subblocks. the method being identical to one of those above, wherein boundaries may be added and removed in accordance with a further method.
4. In a further aspect of the invention, the invention provides a method for parti¬ tioning a block into one or more subblocks. the method being ident ical to one of those above, wherein an upperbound U on the subblock size is imposed.
5. In a further aspect of the invention, the invention provides a method for parti¬ tioning a block into one or more subblocks. the method being identical to one of those above, wherein a lowerbound L on the subblock size is imposed .
C. In a further aspect of the invention , the invention provides a method for partition¬ ing a block into one or more subblocks. the method being ident ical to one of those above, wherein an upperbound V on the subblock size is imposed and a lowerbound __ on the subblock size is also imposed.
7. In a further aspect of the invention, the invention uses one or more of the methods above, but applies more than one part it ioning function ( e.g. F\ . F2. ■ ■ ■ ) and method independently to the block b so as to form more than one group of subblocks.
Xote : The subblocks of the various groups are very likely to overlap. The groups produced by this aspect can be u^ d independently or combined in various ways to form large r groups of subblocks.
S. In a further aspect of the invention, the invention provides a method for parti¬ tioning a block into one or more subblocks by dividing the block into subblocks of equal size.
Note: This aspect is not novel and has been included solely so that later aspects can refer to it.
9. In a further aspect of the invention, the invention provides a method for parti¬ tioning a block into one or more subblocks by dividing the block into subblocks of a small number of different sizes.
Note: This aspect is not novel and has been included solely so that later aspects can refer to it.
10. In a further aspect of t he invention, the invention uses one of the methods above, and additionally forms subblocks from one or more groups of subblocks.
11 . In a further aspect of t he invention, the invention employs one of the met hods above, and additionally forms a hierarchy of subblocks from one or more contiguous groups of subblocks.
Note : The aspects above will be referred to as the partitioning aspects.
12. In a further aspect of the invention, the invention provides a method for par¬ titioning a block into subblocks and forming a corresponding collection of hashes. comprising the steps of:
a. Part itioning the block into one or more subblocks in accordance with any part i¬ tioning aspect :
b. Calculat ing the hash of one or more subblocks using a hash function // .
Note : The collection of hashes is particularly useful if H is a strong one-way hash function.
13. In a further aspect of the invention, the invention provides a method for con¬ structing a projection of a block, comprising the steps of:
a. Partitioning the block into one or more subblocks in accordance with any parti¬ tioning aspect:
b. Forming a projection which is an ordered or unordered list containing identities (e.g. subblocks or hashes of subblocks) of, or references to, one or more of the subblocks.
Note: The specification of this aspect is intended to admit lists that contain a mixture of various kinds of identities and references.
Note: In most applications the output of this aspect will be an ordered list of hashes of the subblocks of the block.
14. In a further aspect of the invention, the invention provides a method for finding identical portions within a group of one or more blocks comprising the steps of:
a. Partitioning one or more of said blocks into one or more subblocks in accordance with an aspect above;
b. Comparing the subblocks or the identities (e.g. hashes) of the subblocks.
15. In a further aspect of the invention, the invention provides a method for repre¬ senting one or more blocks, involving the following c omponents:
(i ) A method for storing and retrieving subblocks:
(ii ) A mapping from block representatives (e.g. filenames) to lists of entries that identify subblocks:
whereby the modification of data in a stored block involves the following steps:
a. Partitioning the new data into subblocks in accordance with any partitioning aspect:
b. Adding subblocks in the new data that are not already in the collection of stored subblocks to the collection of stored subblocks. and updating the subblock list associated with the block being modified;
16. In a further aspect of the invention, the invention provides a method for an entity E\ to communicate a group Λ' of one or more subblocks Λ"ι . . . Λ' n to E2 where El possesses the knowledge that £.2 possesses a group _ of zero or more subblocks _ i . . . _ " m comprising the following step:
a. Transmitting from El to E2 the contents of a subset of zero or more subblocks in Λ\ and the remaining subblocks as references which may take ( but are not limited to) the following forms:
(i ) a hash of a subblock;
( ii ) a reference to a subblock in _ ;
( iii ) a reference to a range of subblocks in _ ;
( iv) a reference to a subblock already transmitted:
(v ) a reference to a range of subblocks already transmitted.
Note: In mo^t implementations of this aspect, the subblocks whose contents are transmitted will be the>se in X that are not in V . and for which no ide ntical subblock ha*, pre viously been transmitted.
Note: To possess knowledge that E'2 possesses V
, . . . )
'„, . El need not actually
_
'ι . . . V
m itse lf. E\ need only possess the identities of _
'ι . . . V
m (e.g. the hashes of each
subblock } . . . Y
m). This specification is intended to admit any other representation in which El may have the knowledge that Eϊ possesses (or has access to) Y
x . . . Y
m . In particular, the knowledge may take the form of a projection of }' .
Note: It is implicit in this aspect that El will be able to use comparison (or other methods) to use its knowledge of E2 's possession of Y to determine the set of subblocks that are common to both X and Y. For example, if El possessed the hashes of the subblocks of Y , it could compare them to the hashes of the subblocks of X to determine the subblocks common to both X and Y . Subblocks that are not common can be transmitted explicitly. Subblocks that are common to both X and )' can be transmitted by transmitting a reference to the subblock.
17. In a further aspect of the invention, the invention provides a method for an entity El to communicate a block Λ' to E2 where El possesses the knowledge that E2 possesses a group Y of subblocks _ 'ι . . . _ ' m comprising step (a) of aspect 16 preceded by the step:
s. Partitioning X into subblocks Λ'ι . . . X„ in accordance with any partitioning aspect.
IS. In a further aspect of the invention, the invention provides a method for an entity El to communicate one or more subblocks of a group X of subblocks Λ'ι . . . Λ' n to E2 where El possesses the knowledge that E2 possesses the block _ . comprising step ( a) of aspect 16 preceded by the step:
s. Partitioning _
' into subblocks ) . . . _ „, in accordance with
partitioning as¬ pect.
19. In a further aspect of t he invention, the invention provides a method for an entit y El to communicate a block X to E2 where El possesses the knowledge that E2 possesses block _ '. comprising step (a) of aspect 16 preceded by the steps:
10
TΓTUTΕ SHEET Rule 26
si . Partitioning Λ' into subblocks λ'j . . . Λ'n in accordance with any partitioning aspect .
s2. Partitioning Y into subblocks Vj . . . Ym in accordance with any partitioning aspect.
Note: Steps (si) and (s2) could be performed in any order, or concurrently, as could many other subsets of steps in this patent specification.
20. In a further aspect of the invention, the invention provides a method for con¬ structing a block D from a group Λ' of one or more subblocks λ'ι . . . X„ and a group Y of zero or more subblocks Y . . . _ m such that X can be constructed from . and D. comprising the step:
a. Constructing D from at least one of the following components:
( 1 ) the contents of one or more subblocks in Λ':
(2) references to subblocks in Y or to subblocks included in D. or to a range of subblocks from either D or _ .
Note: Component 2 above is intended to encompass the case where mixture ef the ele ¬ ments it describes is used.
21. In a further aspect of the invention, the invention provides a method for con¬ struct ing a block D from a block Λ' and a group V of subblocks _ ] . . . _ „, such that -V can be constructed from and D. comprising step (a ) of aspect 20 preceded by the step:
s. Partit ioning .V into subblocks X< . . . Λ'„ in accordance with any partitioning aspect .
22. In a further aspect of the invention, the invention provides a method for con¬ structing a block D from a group A' of subblocks Λ'j . . . A' n and a block _ ' such that X can be constructed from Y and D. comprising step (a ) of aspect 20 preceded by the step:
s. Partitioning _ into subblocks 5 \ . . . _ ' m in accordance with any partitioning as¬ pect.
23. In a further aspect of the invention, the invention provides a method for con¬ structing a block D from a block .V and a block such that A' can be constructed from Y and D. comprising step (a) of aspect 20 preceded by the steps:
si. Partitioning A' into subblocks Λ'ι . . . Λ'„ in accordance with any partitioning aspect.
s2. Partitioning Y into subblocks _ '[ . . . _ ',„ in accordance with any partitioning aspect.
Note: Steps (si) and (s2) could be performed m any order, or concurrently, as could many other subsets of stej>s in this patent specification.
24. In a further aspect of the invention, the invention provides a met hod for con¬ structing a block D from a group A' of subblocks A'ι . . . A',, and a projection of a block (or a projection of a group _ of subblocks _ j . . . _ „, ). such that A' can be constructed from _ ' and D. comprising the step:
a. Constructing D from at least one of the following components:
( 1 ) the contents of one or more subblocks in A' :
(2) references to subblocks in _ or to subblocks included in D. or to a range of subblocks from either D or _ '.
Note: The projection of Y will usually have been calculated in accordance with aspect 13. The projection of a group of subblocks will usually have been calculated in accordance with step (b) of aspect 13.
Note: An implementation will usually be able to use the projection of Y to determine if a subblock in X is also in Y .
Note: Component 2 above is intended to encompass the case where a mixture of the ele¬ ments it describes is used.
25. In a further aspect of the invention, the invention provides a method for con¬ structing a block D from a block A' and a projection of Y such that A' can be constructed from _ and D. comprising the step of aspect 24 with the following step inserted before step (a):
s. Partitioning A' into subblocks A'ι . . . Λ'„ in accordance with any partitioning aspect;
26. In a further aspect of the invention, the invention provides a method for con¬ structing a block A' (or group ' of subblocks A'! . . . A'„ ) from a group V of subblocks } ] . . . _ „, and a block D. where D was constructed in accordance with one of aspects 20 to 2 above, comprising the step of:
a. Constructing A' from D and _ by constructing the subblocks of A' based on one or more of:
(i ) references in D to subblocks in _ :
(ii ) references in D to subblocks in D:
(iii ) references in D that specify a range of subblocks in _ :
(iv ) references in D that specify a range of subblocks in D:
( v ) subblocks contained within D:
( vi ) other data elements in D.
27. In a further aspect of the invention, the invention provides a method for con¬ structing a block A' (or group A' of subblocks 'ι . . . A' n ) from a block and a block D. where D was constructed in accordance with one of aspects 20 to 25 above, comprising the step of aspect 26 with the following step inserted before step (a):
s. Partitioning Y into subblocks Yj . . . _ m in accordance with any partitioning as¬ pect.
2S. In a further aspect of the inv ention, the invention provides a method for trans¬ mitt ing a group A' of subblocks A'ι . . . A'„ from one entity El to another entity E2. comprising the steps of:
a. Transmit ting from El to E2 an identity of one or more subblocks:
b. Transmitting from E2 to El information communicat ing the presence or absence of subblocks at E2:
c. El t ransmitting to E2 at least the subblocks identified in step (b) as not being present at E2:
Note : The information communicated in step (b) could take the form of bitmap (or a compressed bitmap) corresponding to the subblocks referred to in step (a). It could also take many othe r forms.
Note : If group of subblocks are to be transmitted, the above steps could be performed complete ly for each subblock before moving onto the next subblock. The step , could be applie d to any subgroup of subblocks.
29. In a further aspect of the invention, the invention provides a method for com¬ municating a data block A' from one entity El to another entity E2. comprising the steps of aspect 28 but with the following step inserted before step (a):
s. Partitioning A' into subblocks Λ'ι . . . A' n in accordance with any partitioning aspect.
30. In a further aspect of the invention, the invention provides a method for com¬ paring the contents of two or more blocks comprising the steps:
a. Constructing a projection of each block as described in aspect 13;
b. Comparing the projections of the blocks.
Note: The phrase "comparing the projections'" is intended to include not just the case where the two projections are tested lo see if they arc the same, but also the case where the subblocks (or projections of subblocks) within the projections are compared so as to determine the subblocks theit are common to the two origineil blocks.
31. In a furt her aspect of the invention, the invention provides a method for trans¬ mitting a group A' of subblocks A'ι . . . X„ from one entity El to another entity E2. comprising the steps of:
a. Transmitting from E'2 to El information communicating the presence or absence at E2 of members of a group V of subblocks } ] . . . _ m :
b. Transmitting from El to E2 the contents of zero or more subblocks in A . and the remaining subblocks as reference^ which may take ( but are not limited to) the following forms:
( i ) a hash of a subblock:
(ii ) a reference to a subblock in _ :
(iii ) a reference to a range of subblocks in _ ;
(iv) a reference to a subblock already transmitted:
(v) a reference to a range of subblocks already transmitted.
Note: The information communicated in step (a) could take the form of subblock identities such as hashes. It could also take many other forms.
32. In a further aspect of the invention, the invention provides a method for trans¬ mitting a block A' from one entity El to another entity E2, comprising the steps of aspect 31 with the following step inserted before step (a):
s. El partitioning .V into subblocks λ'ι . . . A'„ in accordance with any partitioning aspect:
33. In a further aspect of the invention, the invention provides a method for an entity E2 to communicate to an entity El the fact that E2 possesses a group Y of subblocks _ ] . . . Ym. comprising the step of:
a. E2 transmitting to El identities or references of the subblocks _ 'j . . . _ ' m .
34. In a further aspect of the invention, the invention provides a method for an entity E2 to communicate to an entity El the fact that E2 possesses a block _ . comprising the step of aspect 33 with the following step inserted before step (a ):
ε. E2 partitioning _ into subblocks ) ] . . . . '„, in accordance with any partitioning aspect;
35. In a further aspect of the invention, the invention provides a met hod for an ent ity El to communicate a subblock A', to an ent ity E2. comprising t he steps:
a. E2 sending El an identity of A', .
b. El sending A', to E2.
Note: This aspect applies (among other applications) to the case of a network server El that serves subblocks to clients such as E2, given the identities (e.g. hashes) of the requested subblocks.
36. In a further aspect of the invention, the invention provides a method for an entity El to communicate a subblock Λ',- to an entity E2. comprising the steps of aspect 35 with the following step inserted before step (a):
s. El partitioning a block A' into subblocks λ'ι . . . Λ'„ in accordance with any partitioning aspect;
37. In a further aspect of the invention, the invention provides a method similar to any of those above, but where one or more of the comparisons of subblocks are performed by comparing the hashes of the subblocks. using hashes already available (e.g. as a byproduct of other steps), or calculated for the purpose of performing one or more said comparisons.
38. In a further aspect of the invention the invention provides a method similar to any of those above, but where subsets of identical subblocks within a group of one or more subblocks are identified by inserting each subblock. an identity of each subblock. a reference of each subblock. or a hash of each subblock. into a data structure.
39. In a further aspect of the invention the invention provides a method identical to any of those above, but with various subsets of steps executed concurrently.
40. In an aspect of the invention, the invention provides an apparat us for partit ion¬ ing a block b into one or more subblocks. the apparat us comprising:
( i ) means for evaluating a deterministic or non-deterministic function E that ret urns
one of at least two values, and whose arguments include at least a block of A bits and a block of B bits, where A and B are natural numbers:
and comprising the step of
a. Generating a set of partitions of 6. basing these upon the positions of subblock boundaries on the positions k in the block for which F(bk-A ■ ■ ■ k- bk+ι ■ ■ ■ b +B ) falls within a predetermined subclass of the set of possible function result values.
Note: The specification of this aspect (and each other specification of an aspect involving a function F) encompasses the degenerate case in which either A or B is zero and the function takes (without limitation) just one of the two arguments described. Such specifi¬ cations also include the case of functions F that do not use some bits of their arguments. A function F that beises its calculation solely on (say) b -3 and b +2 would fall unde r the classes of F constrained by the condition A > 3 and B > 2.
41. In a further aspect of the invention, the invention provides an apparatus for locating the nearest subblock boundary on a particular side of a particular position p within a block 6. the apparatus comprising the same elements as aspect 40. but replacing step ( a ) with
a. Generating a position within b by evaluating E(6,,_ 4 . . . br. bp+ \ . . . 6p+β ) for in¬ creasing (or decreasing) p unt il the result of E falls within a predetermined subclass of the set of possible function result values, the position being based on this position .
42. In a further aspect of the invention, t he invention provides an apparat us for partitioning a block into one or more subblocks comprising
( i ) means for dividing a block into subblocks of equal size.
Note : This aspect is not novel and has bee n included solely so that late r aspect ', can refe i to it.
43. In a further aspect of the invention, the invention provides an apparatus for partitioning a block into one or more subblocks comprising
(i) means for dividing a block into subblocks of a small number of different sizes.
Note: This aspect is not novel and has been included solely so that later aspects can refer to it.
44. In a further aspect of the invention, the invention provides an apparatus El that can communicate a group A' of one or more subblocks A'] . . . Xn to an entity E2 where El possesses the knowledge that E2 possesses a group Y of zero or more subblocks _ 'ι . . . _ m , the apparatus comprising
(i ) means for manipulating subblocks, subblock identities, and subblock references:
and comprising the step
a. Transmitting from El to E2 the contents of a subset of zero or more subblocks in A', and the remaining subblocks as references which may take (but are not limited to) the following forms:
(i ) a hash of a subblock;
( ii ) a reference to a subblock in _ :
(iii ) a reference to a range of subblocks in _ ';
(iv) a reference to a subblock already transmitted:
( v) a reference to a range of subblocks already transmitted.
Note In most implementations of this asι>ect. the subblocks whose contents are transmitted will be those in X that are not in Y . and for which no identical subblock has pre viously been transmitted.
Note: To possess knowledge that E2 possesses } . . . Vm . El need not actually possess Vj ■ . . Ym itself. El need only possess the identities of Y< . . . Ym (e.g. the hashes of each subblock } . . . Ym). This specification is intended to admit any other representation in which El may have the knowledge that E2 possesses (or has access to) } . . . V„, . In particular, the knowleelge may take the form of a projection of Y .
Note: It is implicit in this aspect that El will be able to use comparison (or other methods) to use its knowledge of E2 's possession of Y to determine the set of subblocks that are common to both N and Y . For example, if El possessed the hashes of the subblocks of Y , it could compare them to the hashes of the subblocks of X to determine the subblocks common to both X and Y . Subblocks that are not common can be transmitted explicitly. Subblocks that are common to both X and }' can be transmitted by transmitting a reference to the subblock.
45. In a further aspect of the invention, the invention provides an apparatus for constructing a block D from a group A" of one or more subblocks A'ι . . . A'„ and a group >' of zero or more subblocks _ 'ι . . . _ „, such that A' can be const ructed from and Z), the apparatus comprising:
( i ) means for manipulat ing subblocks, subblock identit ies and subblock references:
and comprising the step
a. Constructing D from at least one of the following components:
( 1 ) the contents of one or more subblocks in A' :
(2 ) references to subblocks in _ or to subblock^ included in D. or to a range of subblocks from eit her D or Y.
Note : Component 2 above is inte nded to encompass the case where a mixture of the ele ¬ ments it describes is used.
46. In a further aspect of the invention, the invention provides an apparatus for constructing a block D from a group .V of subblocks '] . . . A'„ and a projection of a block _ (or a projection of a group _ ' of subblocks Y\ . . . Ym ). such that A' can be constructed from Y and D, the apparatus comprising
(i ) means for manipulating subblocks. subblock identities and subblock references;
and comprising the step:
a. Constructing D from at least one of the following components:
( 1 ) the contents of one or more subblocks in A':
(2) references to subblocks in _ or to subblocks included in D. or to a range of subblocks from either D or _ .
Not : The projection of Y will usually have been calculated in accordance with aspect 13. The projection of a group of subblocks will usually have been ceύculated in accordance with step (b) of aspect 13.
Note: A n implementation will usually be able to use the projection of }' to determine if a subblock m X is also in Y .
Note: Comjwnent 2 above is intended to encompass the case where a mixture of the ele¬ ments it describes is used.
47. In a further aspect of the invention, the invent ion provides an apparatus for constructing a block A' (or group A' of subblocks A'ι . . . A'„ ) from a group _ of subblocks V] . . . _ TO and a block D. where D was constructed in accordance with one of aspects 20 to 25 above, the apparatus comprising
(i ) means for manipulating subblocks. subblock identities and subblock references:
and comprising the step of
a. Constructing A' from D and _ by constructing the subblocks of A' based on one or more of:
(i references in D to subblocks in Y;
(ϋ references in D to subblocks in D;
(iϋ references in D that specify a range of subblocks in ) ':
, ιv references in D that specify a range of subblocks in D:
subblocks contained within D:
VI other data elements in D.
48. In a further aspect of the invention, the invention provides a system for transmit¬ ting a group A' of subblocks A'j . . . Ar„ from one apparatus El to another apparatus E2. each apparatus consisting of
(i ) means for manipulating subblocks, subblock identities and subblock references:
and t he systems execution comprising the steps of:
a. Transmitting from El to E2 an identity of one or more subblocks:
b. Transmitting from E2 to El information communicating t he presence or absence o f subblocks at E2:
c. El t ransmit ting to E2 at least the subblocks ident ified in st ep ( b ) as not being present at E2:
o
UTE SHEET (Rule 2b)
Note: The information communicated in step (b) could take the form of a bitmap (or a cemipressed bitmap) corresponding to the subblocks referred to in step (a). It could also take many other forms.
Note: If a group of subblocks are to be transmitted, the above steps could be performed completely for each subblock before moving onto the next subblock. The steps could be apj>lied to any subgroup of subblocks.
49. In a further aspect of the invention, the invention provides a system for transmit¬ ting a group A' of subblocks 'ι . . . Xn from one apparatus El to another apparatus E2, each apparatus consisting of
(i ) means for manipulating subblocks. subblock identities and subblock references:
and comprising the steps of:
a. Transmitting from E2 to El information communicating the presence or absence at E2 of members of a group _ ' of subblocks } . . . _ m :
b. Transmitting from El to E2 the contents of zero or more subblocks in A', and the remaining subblocks as references which may take (but are not limited to) the following forms:
( i ) a hash of a subblock:
( ii ) a reference to a subblock in :
(iii ) a reference to a range of subblocks in _ :
( iv ) a reference to a subblock already transmitted:
( v ) a reference to a range of subblocks alreadv transmitted.
Note: The information communicated in step (a) could take the form of subblock identities such as hashes. It could also take many other forms.
50. In a further aspect of the invention, the invention provides a system for an apparatus E2 to communicate to an apparatus El the fact that E2 possesses a group Y of subblocks . i . . . _ m. each apparatus consisting of
(i ) means for manipulating subblocks, subblock identities and subblock references:
and comprising the step of:
a. E2 transmitting to El identities or references of the subblocks _ i . . . Ym .
51. In a further aspect of the invention, the invention provides a system for an apparatus El to communicate a subblock A', to an apparatus E2. each apparatus consisting of
(i ) means for manipulating subblocks. subblock identities and subblock references:
and comprising the steps:
a. E2 sending El an identity of A', .
b. El sending A', to E2.
Note : This aspect applies (among other applications) to the case of a network server El that serves subblocks to clients such as E2. given the identities (e.g. hashes) of the requested subblocks.
BRIEF DESCRIPTION OF FIGURES
Figure 1 shows how data can become "misaligned" relative to its containing blocks when data in inserted.
Figure 2 shows how data can be divided into fixed-width subblocks or variable-width subblocks.
Figure 3 shows how data-dependent partitions move with the data when the data is shifted (e.g. by an insertion) (Compare with Figure 1 ).
Figure 4 depicts the data-dependent partitioning of a block of data b into subblocks using a function E.
Figure 5 depicts the search within a block 6 for a subblock boundary (as defined by E) using F.
Figure 6 shows how a block may be subdivided in different ways using different boundary functions.
Figure 7 shows how "higher order" subblocks can be constructed from one or more initial subblocks.
Figure S shows how different partitioning functions can produce subblocks of differ¬ ing average sizes.
Figure 9 shows how subblocks can be constructed (or organized ) into a hierarchy. Such a hierarchy can be constructed by restricting in stages. E"s "partition" result subset.
Figure 10 depicts a method (and apparat us) for the partitioning of a block b into subblocks using E and the calculation of the hashes of the subblocks using hash function H.
Figure 11 depicts the partitioning of a block b into subblocks using E and the project ion of those subblocks into a structure consisting of subblock hashes, subblock data, and subblock references.
SUBSTITUTE SHEET (Rule 2b)
Figure 12 depicts a method (and apparatus) for partitioning two blocks b\ and 62 into subblocks using E and the comparison of those subblocks.
Figure 13 depicts a method (and apparatus) for the partitioning using E of two blocks 61 and 62 into subblocks, the calculation using H of the hashes of the sub¬ blocks. and the comparison of those hashes with each other to determine (among other things) subblocks common to both 61 and 62.
Figure 14 depicts a method (and apparatus) for a file system that employs an aspect of the invention to eliminate the multiple storage of data common to more than file (or to different parts of the same file).
Figure 15 depicts a method (and apparatus) for the communication of a block A' from El to E2 where both El and E2 possess Y.
Figure 16 depicts a method (and apparatus) for the construction of a block D from which A' may be later reconstructed, given Y .
Figure 17 depicts a method (and apparatus) for the construction of a block D from which A' may be later reconstructed, given . In this case, the entity constructing D does not have access to _ . only to a projection of _ (in this case being the hashes of the subblocks of V).
Figure 18 depicts a method (and apparatus) for the reconstruction of A' from the blocks _ and D.
Figure 19 depicts a method (and apparatus ( El and E2 at each time) ) for the communication of a block A' from entity El to entity E2 where E2 already possesses Y.
Figure 20 depicts a method (and apparatus ( El and E2 at each time) ) for the communication of a block A' from entity El to entity E2 where E2 already possesses _ and where E2 first discloses to El information about V.
Figure 21 depicts a method (and apparatus) for the communication from entity E2 to entity El information about a block (or group of subblocks) _ ' at E2.
Figure 22 depicts a method (and apparatus (El and E2 at each time)) for the communication from entity El to entity E2 of subblock A', following a request by entity E2 for the subblock A', .
Figure 23 depicts an apparatus for partitioning a block 6 (the input) using a parti¬ tioning function F. The output is a set of subblock boundary positions.
Figure 24 depicts a method (and apparatus) for the partitioning of a block 6 into subblocks using E and the projection of those subblocks into a table of subblock hashes.
Figure 25 depicts a method (and apparatus) for the transmission from entity El to E2 of a block .V where E2 possesses Y and El possesses a table of the hashes of the subblocks of V (a projection of Y ).
Figure 26 depicts a method (and apparatus) for a file system that employs an aspect of the invention to eliminate the multiple storage of data common to more than file (or to different parts of the same file).
DETAILED DESCRIPTION OF PREFERRED
EMBODIMENTS
This section contains a detailed discussion of mechanisms that could be used to implement aspects of the invention. It also contains a selection of examples of implementations of various aspects of the invention. However, nothing in this section should be interpreted as a limitation on the scope of this patent .
Units Of Information
Aspects of this invention can be applied at various levels of granularity of data. For example, if the data was treated as a stream of bits, boundaries could be placed between any two bits. However, if the data was treated as a stream of bytes, boundaries would usually be positioned only between bytes. The inv ention could be applied with any unit of data, and in this document references to bits and bytes should usually be interpreted as admitting any granularity.
The Concept Of Entity
At various places, this patent specification uses the term "entity" to describe an agent. This term is purposefully vague and is intended to cover all forms of agent including, but not limited to:
• Computer systems.
• Networks of computer systems.
• Processes in computer systems.
• File systems.
• Components of software.
• Dedicated computer systems.
• Communications systems.
The Concepts Of Identity And Reference
This patent specificat ion frequently refers l o "identities" of subblocks and "refer¬ ences" to subblocks. These terms are not intended to be defined precisely .
The identity of a subblock means any piece of information that could be used in place of the subblock for the purpose of comparison for identicality. Identities include, but are not limited to:
• The subblock itself.
• A hash of the subblock.
The subblock acts as its own identity because subblocks themselves can be com¬ pared with each other. Hashes of subblocks also act as identities of subblocks be¬ cause hashes of subblocks can be compared with each other to determine if their corresponding subblocks are identical.
A reference to a subblock means any piece of information that could be used in practice by one entity to identify to anot her entity (or itself) a particularly val¬ ued subblock. where the two entities may already share some kind of knowledge. For example, the two entities might each possess the knowledge that the other en¬ tity already possesses ten subblocks of known values having part icular index values numbered one to ten.
Once two entities have a basis of shared knowledge, it is possible for them to identify a subblock in ways more concise than t he transmission of an ident ity. A reference to a particularly valued subblock can take ( without limitat ion ) the following forms:
• An identity.
• An ident ifving number of a subblock possessed by t he receiver.
• An identifving number of a subblock previously transmitted between the t wo communicants.
• The location of the block in some shared data space.
• A relative subblock number.
• Ranges of the above.
The concept of knowledge of a subblock is related to the concepts of identity and reference. An entity may have knowledge of a subblock (or knowledge that another entity possesses a subblock ) without actually possessing the subblock itself. For example, it might possess an identitv of the subblock or a reference to the subblock.
The Use Of Ranges
In an \ sit uation where a group of values that have contiguous values (e.g. 6, 7. 8. 9) is to be communicated or stored, such a group can be represented using a range (e.g. 6-9) which may take up less communication time or storage space. Ranges can be applied to all kinds of things, such as index values and subblock numbers. In particular, if an entity notices that the references (to subblocks) t hat it is about to transmit are contiguous, it can replace the references with a range.
Ranges can be represented in any way that identifies the first and last element of the range. Three common representations are:
1 . The first and last element of the range.
2. The first element and the length of the range.
3. The last element and the length of the range.
The concept of range can be generalized to include t he compression of any group of values that exhibit compressible structure.
The Use Of Backward References
References can be used not only to refer to data shared by two communicants at the start of a transmission, but can also be used to refer to data communicated at some previous time during the transmission.
For example, if an entity A notices that the subblock it is about to transmit to another entity B was not possessed by B at the start of the transmission, but has since been transmitted by .4 to B, then A could code the second instance of the subblock as a reference to the previous instance of the subblock. The range mechanism can be used here too.
No Requirement For Subblock Framing Information
It should be noted that it is possible that an entity El could transmit a group A' of subblocks A'ι . . . Xn as a group to an entity E2 simply by sending the concatenat ion of the subblocks. There may be no need for any framing information (e.g. informa¬ tion at the start of each subblock giving the length of t he subblock or '"escape" codes to indicate subblock boundaries) as E2 is capable of partitioning A' into A'ι . . . A' r, itself.
No Requirement For Ordering Subblocks
It should be noted that if two entities El and E2 both possess the same unorde red group Y of subblocks (or knowledge of such a group of subblocks) then even t hough El and E2 may not possess the subblocks in the same order, the subblocks can st ill be referred to using a subblock index or serial numbei . This is achieved
having El and E2 each sort their subblocks in accordance with some mutually agreed (or universally defined ) ordering method and then number the subblocks in the resultant ordered group of subblocks. These numbers (or ranges of such numbers ) can t hen be used to refer to subblocks.
An Overview Of Hash Functions
Although the use of a hash function is not essential in all aspects of this invention, hash functions provide such advantages in the implementation of this invention that an overview of them is warranted.
A hash function accepts a variable-length input block of bits and generates an output block of bits that is based on the input block. Most hash functions guarantee that the output block will be of a particular length (e.g. 16 bits) and aspire to provide a random, but deterministic, mapping between the infinite set of input blocks and the finite set of output blocks. The property of randomness enables these outputs, called "hashes" , to act as easily manipulated representatives of the original block.
Hash functions come in at least four classes of strength.
Narrow hash functions: Narrow hash functions are the weakest class of hash functions and generate output values that are so narrow (e.g. 16 bits) that the entire space of output values could be searched in a rea¬ sonable time. For example, an 8-bit hash funct ion would map any data block to a hash in the range 0 to 255. A 16-bit hash function would map to a hash in the range 0 to 65535. Given a particular hash value, it would be possible to find a corresponding block simply by generat¬ ing random blocks and feeding them into t he narrow hash funct ion until the searched-for value appeared. Narrow hash funct ions arc usually used to arbitrarily (but deterministically ) classify a set of data values into a small number of groups. As such, they are useful for constructing hash table data structures, and for detecting errors in data transmitted over noisy communication channels. Examples of this class: CRC- 16. CRC- 32. Fletcher checksum, the IP checksum.
Wide hash functions: Wide hash funct ions are similar to narrow hash
functions except that their output values are significantly wider. At a certain point this quantitative difference implies a qualitative difference. In a wide hash function, the output value is so wide (e.g. 128 bits) that the probability of any two randomly chosen blocks having the same hashed value is negligible (e.g. about one in 1038). This property enables these wide hashes to be used as "identities" of the blocks of data from which they are calculated. For example, if entity El has a block of data and sends the wide hash of the block to an entity E2. then if entity E2 has a block that has the same hash, then the a-priori probability of the blocks actually being different is negligible. The only catch is that wide hash functions are not designed to be non-invertible. Thus, while the space of (say ) 212s values is too large to search in the manner described for narrow hash functions, it may be easy to analyse the hash function and calculate a block corresponding to a particular hash. Accordingly. El could fool E2 into thinking El had one block when it really had a different block. Examples of this class: any 128-bit CRC algorithm.
Weak one-way hash functions: Weak one-way hash functions are not onh wide enough to provide "identity
" , but
also provide crypto¬ graphic assurance that it will be extremely difficult , given a particular hash value, to find a block corresponding to that hash value. Examples of this class: a 64-bit DES hash.
Strong one-way hash functions: Strong one-way hash functions are the same as weak one-way hash functions except that they have the ad¬ ditional property of providing cryptographic assurance that it is difficult to find any two different blocks that have the same hash value, where the hash value is unspecified. Examples of this class: MD4. MD5. SHA-1. and Snefru.
These four classes of hash provide a range of hashing strengths from which to choose. As might be expected, the speed of a hash function decreases with strength, pro¬ viding a tradeoff, and different strengths are appropriate in different applications. However, the difference is small enough to admit the use of strong one-way hash functions in all but the most time-critical applications.
The term cryptographic hash is often used to refer to hashes that provide cryp¬ tographic strength, encompassing both the class of weak one-way hash functions and the class of strong one-way hash functions. However, as strong one-way hash functions are almost always preferable to weak one-way hash functions, the term ""cryptographic hash" is used mainly to refer to the class of strong one-way hash functions.
The present invention can employ hash functions in at least two roles:
1. To determine subblock boundaries.
2. To generate subblock identities.
Depending on the application, hash functions from any of the four classes above could be employed in either role. However, as the determination of subblock bound¬ aries does not require ident ity or cryptographic strength, it would be inefficient tυ use hash functions from any but the weakest class. Similarly, t he need for iden¬ tity, the ever-present threat of subversion, and the minor performance penalty foi st rong one-way hash functions suggests that nothing less than strong one-way hash functions should be used to calculate subblock identit ies.
The security dangers inherent in employing anything less than a strong one-way hash funct ion to generate identit ies can be illustrated by considering a communicat ions system or file system that incorporates the invention using any such weaker hash
function. In such a system, an intruder could modify a subblock (to be manipulated by a target system) in such a way that the modified subblock has the same hash as another subblock known by the intruder to be already present in the target system. This could result in the target system retaining its existing subblock rather than replacing it by a new one. Such a weakness could be used (for example) to prevent a target system from properly applying a security patch retrieved over a network.
Thus, while wide hash functions could be safely used to calculate subblocks in sys¬ tems not exposed to hostile humans, even weak one-way hash functions are likely to be insecure in those systems that are.
We now to turn to the ways in which hashes of blocks or subblocks can actually be used.
The Use Of Cryptographic Hashes
The theoretical properties of cryptographic hashes (and here is meant strong one¬ way hash functions) yield particularly interesting practical properties. Because such hashes are significantly wide, the probability of t wo randomly-chosen subblocks hav ¬ ing the same hash is practically zero (for a 128-bit hash, it is about one in 103! ). and because it is computationally infeasible to find two subblocks having the same hash, it is practically guaranteed that no intelligent agent will be able to do so. The implication of these properties is that from a pract ical perspective, the finite set of hash values for a particular cryptographic hash algorithm is one-to-one wit h the infinite set of finite variable length subblocks. This theoretically impossible prop¬ ert y manifests itself in practice because of the pract ical infeasibility of finding two subblocks that hash to t he same value.
This property means that , for the purposes of comparison (for identicality). crypto¬ graphic hashes may safely be used in place of t he subblocks from which they were
calculated. As most cryptographic hashes are only about 128 bits long, hashes pro¬ vide an extremely efficient way to compare subblocks without requiring the direct comparison of the content of the subblocks themselves. This can be used to elimi¬ nate many transmissions of information. For example, a subblock A'ι on a computer Cl in Sydney could be compared with a subblock i 'ι on a computer C'l in Boston by a computer C'3 in Paris, with the total theoretical network traffic being just 256 bits (Cl and C2 each send the 128-bit hash of their respective subblocks to C3 for comparison, and C3 compares the two hashes).
Some of the ways in which cryptographic hashes could be used in aspects of this invention are:
• Cryptographic hashes can be used to compare two subblocks without having to compare, or requiring access to. the content of the subblocks.
• If it is necessary to be able to determine whether a subblock 7 is identical to one of a group of subblocks, the subblocks themselves need not be stored, just a list of their hashes. The hash of any candidate subblock can then be compared with the hashes in the list to establish whether t he subblock is in the group of subblocks from which the list of hashes was generated.
• Cryptographic hashes can be used to ensure that the part it ioning of a block into subblocks and the subsequent reassembly of the subblocks into a recon¬ structed block is error-free. This can be done by comparing t he hash of the original block with the hash of the reconstructed block.
• If an entity El calculates the hash of a subblock A' ! and t ransmits it to E2. then if E2 possesses A'j . or even just the hash of A'ι . then E2 can determine without any practical doubt that El possesses A' l .
• If an ent ity El passes a key (consist ing of a block of bit s) chosen at random to an entity E2. E2 may t hen pro\ e to El that it possesses a subblock by
sending El the hash of the concatenation of the key and the subblock. This mechanism could be used as an additional check in security applications.
• If a group of subblocks must be compared so as to find all subsets of identical subblocks. the corresponding set of hashes of the subblocks may be calculated and compared instead.
• Many of the uses of cryptographic hashes for subblocks can also be applied to blocks. For example, cryptographic hashes can be used to determine whether a block has changed at all since it was last backed up. Such a check could eliminate the need for further analvsis.
Use Of Hashes As A Safety Net
A potential disadvantage of deploying aspects of this invent ion is that it will add extra complexity to the systems into which it is incorporated. This increased com¬ plexity carries the potential to increase t he chance of undetected failures.
The main mechanism of complexity int roduced by many aspects of the invention is the partitioning of blocks (e.g. files) into subblocks. and the subsequent re-assembly of such subblocks. By partitioning a block into subblocks. a system creates the potential for subblocks to be erroneously added, deleted, rearranged, substituted, duplicated, or in some other way exposed to a greater risk of accidental error.
This risk can be reduced or eliminated by calculating the hash ( preferably a cryp¬ tographic hash ) of the block before it is part itioned into subblocks. storing the hash with an entity associated with the block as a whole and then lat er comparing the stored hash with a computed hash of the reconstructed subblock. Such a check would provide a very strong safet \ net t hat would virtually eliminate the risk of undetected errors arising from the use of this inv ention.
Choosing A Partitioning Function
Although the requirements for the block partitioning function F are not stringent, care should be taken to select a function that suits the application to which it is to be applied.
In situations where the data is highly structured and knowledge of the data is available, a choice of an E that tends to place subblock boundaries at positions in the data that correspond to obvious boundaries in the data could be advantageous. However, in general. F should be chosen from the class of narrow hash functions. Use of a narrow hash function for E provides both efficiency and a (deterministic) randomness that will enable the implementation to operate effect ively over a wide- ran *goe of data.
One of the most important propert ies of F is the probability that F will place a boundary at any particular point when applied to completely random data. For example, a function with a probability of one would produce a boundan between each bit (or byte), whereas a function with a probability of zero would never produce any boundaries at all. In a real application, a more moderate probability would be chosen (e.g. 1 /1024 ) so as to yield useful subblock sizes. The probability can be tuned to suit the application.
We end t his section with an example of a narrow hash funct ion that has been implemented and tested and seems to perform well on a variet \ of data types. The hash function calculates a hash value from three bvtes.
H( b, . b2. b3) - ( (40543 x ( (b, « 8) 7 (fc2 « 4 ) ; b3) ) » 4 ) | p
The following notat ion has been used, " x " is multiplication. '"<< is left bit shift . "X' is right bit shift. " 7 " i exclusive or. "|" is modulo. T he constant p is
38
SUBSTITUTE SHEET (Rule 2t>
the inverse of the probability of placing a boundary at an arbitrary position in a randomly generated block of data, and can be set to any integer value in [0. 65535]. However, in practice it seems to be advantageous to choose values that are prime (Mersenne primes seem to work well). The value 40543 was chosen carefully in accordance with the guidelines provided in pages 508-513 of the book:
Knuth D.E.. "The Art of Computer Programming: Volume 3: Sorting and Searching" . Addison W esley, 1973.
The function evaluates to a value in the range [Q. p — 1] and can be used in pract ice by placing a boundary at each point where the preceding three bytes hash to a predetermined constant value \ '. This would imply that its arguments bx . . . b3 correspond to the argument .4 in aspect one above. To avoid pathological behaviour in the commonly occurring case of runs of zeros, it is wise to choose a non-zero value for 1 '.
In a real implementation, p was set to 511 and \ was set to one.
Although early aspects of the detailed description of the invention refer to a funct ion F that places a boundary when it s output value falls within a predetermined subclass of the set of possible output values, it should be noted that the combinat ion of F and its use in the invention can always be viewed as equivalent to a boolean funct ion B(x, y. z) (where j' and y are blocks of data) where
B( x. y. z ) = G( F(.r. y. z ) )
and where G is a function accepting a value of whatever type F returns and ret urning a boolean, being . /■</. iff the value from F falls within a predetermined subclass defined for F. The r argument s have been included to indicate that t he funct ions could depend on ot her information too.
Placing An Upper And Lower Bound On The Subblock Size
The use of data-dependent subblock boundaries provides a way to deterministically partition similar portions of data in a context-independent way. However, if artifi¬ cial bounds are not placed on the subblock size, particular kinds of data will yield subblocks that are either too large or too small to be effective. For example, if a file contains a block of a million identical bytes, any deterministic function F (that operates at the byte level) must either partition the block into one subblock or a million subblocks. Both alternatives are undesirable.
A solution to this problem is to artificially impose an upper bound I ' and a lower bound L on the subblock size. There seem to be a limitless number of ways of doing this. Here are some examples:
Upper bound: Subdivide subblocks defined by E that are longer than bytes at the points. F. 21'. 3. . and so on. where is the chosen upperbound on subblock size.
Upper bound: Subdivide subblocks that are longer than I ' bytes at points determined by a secondary hash function.
Lower bound: Of the set of boundaries that bound subblocks less than L bytes long, remov e those boundaries that are closer to their neighbour¬ ing boundaries than their neighbouring boundaries are to their neigh¬ bouring boundaries.
Lower bound: If the block is being scanned sequentially, do not place a boundary unless at least /. bytes have been scanned since t he previous boundary.
Lower bound: Of the set of boundaries that bound subblocks less than L bytes long, remove those boundaries that satisfy some secondary hash function.
Lower bound: Of the set of boundaries that bound subblocks less than L bytes long, remove randomly chosen boundaries until all the resulting subblocks are at least L bytes long.
Many other such schemes could be devised.
Partitioning Blocks Using Non Data-Dependent Means
Although this invention will usually be applied using data-dependent, variable- length subblocks. it can also be applied using non data-dependent subblocks. For example, the input blocks could simply be partitioned into ;?-byte blocks. Non data- dependent partitionings could be very effectively applied to blocks whose content varies but does not move about (i.e. the bits or bytes of the data are modified, but bits or bv tes are not inserted, deleted, or re-arranged).
Another way of using fixed-length blocks would be to use many different overlapping partitionings of fixed-length blocks.
There are an infinite number of other ways of partitioning a block into subblocks without referring to its content.
The Use Of Multiple Partitionings
In most applicat ions the use of just one partitioning into subblocks will be sufficient . However, in some applications there may be a need for more than one subblock par¬ titioning. For example, in applications where channel space is expensive, it may be appropriat e to part ition each block of data in U different ways using II dif ei - ent funct ions F\ . . . F\\- where each function provides a different average subblock size. For example, four different partitions could be performed using functions that provide subblocks of average length 256 bytes. I K. 10K. and 100K. By providing a range of different sizes of subblocks to choose from, such an organizat ion could
simultaneously indicate large blocks extremely efficiently, while still retaining fine¬ grained subblocks so that minor changes to the data do not result in voluminous updates (Figure S).
The efficiency of such a scheme could be improved by performing the partitioning all in one operation using increasing constraints on a single E. For example, the example hash function that was described earlier could be used, but with different values of the constant p being used to determine the different levels of subdivision. By choosing appropriately related values of p, the set of boundaries that could be produced by the different E could be arranged to be subsets of each other, resulting in a tree structure of subblocks. For example, values of p of 32, 64, and 128. and 256 could be used. Figure 9 shows how the subblocks of four levels of the tree could relate to each other:
A further method could define the hash of a larger block to be the hash of the hashes of its component blocks.
Multiple partitionings may also be useful simply to provide a wider pool of subblocks to recognize. For example, it may be appropriate to partition each block of data in I I ' different ways using IT different functions Ei . . . En- where each function yields roughly the same subblock sizes, but at different positions in the block.
Another technique would be to create an additional set of boundaries based on the boundaries provided by a hash function. For example, a fractal algorithm could be used to partition a block based upon some other part itioning provided by a funct ion E.
Comparing Subblocks
In most applicat ions of this invention, there will be a need at some stage to ident ify identical subblocks. This can be done in a number of ways:
• Compare the subblocks themselves.
• Compare the hashes of the subblocks.
• Compare identities of the subblocks.
• Compare references to the subblocks.
In most cases, the problem reduces to that of taking a group of subblocks of data and finding all subsets of identical subblocks. This is a well-solved problem and discussion of various solutions can be found in the following books:
Knuth D.E., "The Art of Computer Programming: Volume 1 : Funda¬ mental Algorithms" . Addison Wesley. 1973.
Knuth D.E., "The Art of Computer Programming: Volume 3: Sorting and Searching" , Addison Wesley, 1973.
In most cases, the problem is best solved by creating a data structure that maintains the subblocks. or references to the subblocks. in sorted order, and then inserting each subblock one at a time into the data struct ure. Not only does this identifv all currently identical subblocks. but it also establishes a st ructure that can be used to determine quickly whether incoming subblocks are identical to any of those already held. The following data structures are described in the books referenced above and provide just a sample of the structures that could be used:
• Hash tables.
• Sorted trees (binary. N-ary, AVL).
• Sorted linked lists.
• Sorted arrays.
Of the multitude of solutions to the problem of matching blocks of data, one solution is worthy of special attention: the hash table. Hash tables consist of a (usually) finite array of slots into which values may be inserted. To add a value to a hash table, the value is hashed (using a hash function that is usually selected from the class of narrow hash functions) into a slot number and the value is inserted into that slot. Later, the value can be retrieved in the same manner. Provisions must be made for the case where two data values to be stored in the same table hash to the same slot number.
Hash tables are likely to be of particular value in the implementation of this invention because:
• They provide very fast (essentially constant time) access.
• Many applications will need to calculate a strong one-way hash of each sub¬ block anyway, and a portion of this value can be used to index the hash t able.
Particularly effective would be a hash table indexed by a portion of a strong one¬ way hash of the subblocks it stores, with each table entry containing (a ) the strong one-way hash of the subblock. and (b) a pointer to the subblock stored elsewhere in memory.
The Use Of Compression, Encryption, and Integrity Tech¬ niques
Various aspects of the invention could be enhanced by the use of data compression, data encryption, and data integrity techniques. The applications of these techniques include, but are not limited to the following applicat ions:
• Any subblock that is transmitted or represented in its raw form could altei- natively be transmitted or represented in a compressed or encrypted form.
• Subblocks could be compressed and encrypted before further processing by aspects of this invention.
• Blocks could be compressed and encrypted before further processing by aspects of this invention.
• Communications or representations could be compressed or encrypted.
• Any component could carry additional checking information such as checksums or digests of the data in the component.
• Ad-hoc data compression techniques could be used to further compress refer¬ ences and identities or consecutive runs of references and identities.
Storage Of Variable-Length Subblocks On Disk
The division of data into subblocks of varying length presents some storage orga¬ nization problems if the subblocks are to be stored independently of each other, as most hardware disk systems are organized to store an array of fixed-length blocks (e.g. one million 51'2-byte blocks) rather than variable-length ones. Here are some techniques that could be used to tackle this problem:
• Each subblock could be stored in an integral number of disk blocks, with some part of the last disk block being wasted. For randomly sized subblocks. this scheme will waste on average half a disk block per subblock.
• Create a small subset of different bucket sizes (e.g. powers of two) and create arrays on the disk that pack collections of these buckets efficiently into the disk blocks. For example, if disk blocks were 512 bytes long, one could fairly efficient ly pack five 200-byte buckets into an array of two disk blocks. Each subblock would be stored in the smallest bucket size that would hold t he subblock. wit h the unused part of the bucket being wasted.
45
SUBST ΓUTE SHEET (Rule 26)
• Treat the disk blocks as a vast array of bytes and use well-established heap management techniques to manage the array. A sample of such techniques appears in pages 435-451 of the book:
Knuth D.E., "The Art of Computer Programming: Volume 1: Fun¬ damental Algorithms" , Addison Wesley. 1973.
The Use Of Concurrency
Two processes are said to be concurrent if their execution takes place in some sense at the same time:
• In interleaving concurrency, some or all of the operations performed by the two processes are interleaved in time, but the two processes are never both executing at exactly the same instant.
• In genuine concurrency, some or all of the operations performed by the two processes are genuinely executed at the same instant.
Implementations of the present invention could incorporate either form of concur¬ rency to various degrees. In most of the aspects described earlier, some subset of t he steps of each aspect could be performed concurrently. In particular ( without limitat ion):
• A block could be split into parts and each part part itioned concurrently.
• The processing of subblocks defined during a sequential part itioning of a block need not be deferred until the entire block has been partitioned. In particular, t he hashes of already-defined subblocks could be calculated and compared while further subblocks are being defined.
• Communicating entities implementing aspects that decompose and compose blocks could execute concurrently.
• Where more than one block must be partitioned for processing, such parti¬ tioning can occur concurrently.
Many more forms of concurrency within aspects of this invention could be identified.
Example: Partitioning A Block
We now present a simple example of how a block might be partitioned in practice. Consider the following block of bytes:
In this example, the example hash function H will be used to partition the block and boundaries will be represented by pairs such as (3/67. We will assume that H returns a boolean value based on its argument and that a boundary is to be placed at each b b, + 1 for which F( b, — 2, b, — 1 , b, ) evaluates to true.
As the hash function accepts 3 byte arguments, we start at 63/64 and evalu¬ ate H{b\ . 62. 63). This t urns out to be false , so we move to 64/65 and evaluate .7( . 63. 64 ). This turns out to be true so a boundary is placed at 64 /65. Next , we move to 65/66 and evaluate (63.64, 65). This turns out to be false so we move on. H(b4. b^. bc ) is true so we place a boundary at 66/6τ. This process continues until the end of the block is reached.
6] 62 63 64 I 65 6,> I 67 bg 6 . . .
Some variations on this approach are:
• Imposition of a lower bound L on subblock size by skipping ahead L bytes following the placement of each boundary.
• Imposition of an upper bound U on block size by artificially placing a boundary if U bytes have been processed since the last boundary was placed.
• Improving the efficiency of the hash calculations by using some part of the calculation of the hash of the bytes at one position to calculate the hash at the next position. For example, it may be more efficient to calculate H(x. y. z) if H( *. x, y) has already been calculated. For example, the Internet IP checksum is organized so that a single running checksum value can be maintained, with bytes entering the window being added to the checksum and bytes exiting the window being subtracted from the checksum.
• Applying this algorithm in reverse starting from the end of the block and workin Όg backwards.
• Establishing the subblock enclosing a particular point (chosen from anywhere within the block) by exploring in both directions from the point looking for the nearest boundary in each direct ion.
• Finding all subblock boundaries in one step by evaluating F for all positions in parallel.
Example: Forming A Table of Hashes
Once a block has been partitioned, the hash of each subblock can be calculated to form a table of hashes ( Figure 24 ).
This t able of hashes can be used to determine if a new subblock is identical to any of t he subblocks whose hashes are in t he table. To do this the new subblock's hash is calculated and a check made to see if the hash is in the table.
In Figure 24. the table of hashes looks like an array of hashes. However, the table of hashes could be stored in a wide variety of data structures (e.g. hash tables, binary trees).
Example Application: A File Comparison Utility
As the invention provides a new way of finding similarities between large volumes of data, it follows that it should find some application in the comparison of data.
In one aspect , the invention could be used to determine the broad similarities be¬ tween two files being compared by a file comparison utility. The utility would partition each of the two files into subblocks. organize the hashes of the subblocks somehow (e.g. using a hash table) to identify all identical subblocks. and then use this information as a framework for reporting similarities and differences between the two files.
In a similar aspect , the invention could be used to find similarities between the con¬ tents of large numbers of files in a file system. A utility incorporating t he invention could read each file in an entire file system, partition each into subblocks and then insert the subblocks (or hashes of the subblocks) into one huge table (e.g. imple¬ mented by a hash table or a binary tree). If each entry in the table carried the name of the file containing it as well as the position of the subblock within the file, the table could later be used to identify those files containing ident ical portions of data.
If. in addit ion, a facility was added for recording and comparing the hashes of the entire contents of files and directory trees, a utility could be const ructed that could ident ifv all largely similar st ructures within a file system. Such a ut ility would be immensely useful when (say) attempting to merge the data on several similar backup tapes.
Example Application: A Fine-Grained Incremental Backup System
In a fine-grained incremental backup system, two entities El and E2 (e.g. two computers on a network) wish to repeatedly backup a file A' at El such that the old version of the file V at E2 will be updated to become a copy of the new version of the file Λ' at El (without modifying X). The system could work as follows:
Each time El performs a backup operation, it partitions A' into subblocks and writes the hashes of the subblocks to a shadow file 5. It might also write a hash of the entire contents of A' to the shadow file. After the backup has been completed. A' will be the same as _ and so the shadow file S will correspond to both A' and ) . Once A' is again modified (during the normal operation of the computer system). S will coirespond only to V. S is used during the next backup operation.
To perform the backup. El compares the hash of (stored in S) against the hash of A' to see if A' has changed (it could also use the modification date file attribute of the file). If A' hasn't changed, there is no need to perform any further backup action. If A' has changed. El partitions A' into subblocks and compares the hashes of these subblocks with the hashes in the shadow file 5, so as to find all identical hashes. Identical hashes identifv identical subblocks in that can be transmitted by reference. El then transmits the file as a mixture of raw subblocks and references to subblocks whose hashes appear in ,S' and which are therefore known to appear as subblocks in V. El can also transmit references to subblocks already transmitted. References can take many forms including ( without limitation ):
• A hash of the subblock.
• The number of the subblock in the list of subblocks in V.
• The number of a subblock previously transmitted.
• A range of any of the above.
Throughout this process El can be constructing the new shadow file corresponding to A'. Figure 25 illustrates the backup process.
To reconstruct .V from Y and the incremental backup information being sent from El, E2 partitions into subblocks and calculates the hashes of the subblocks (It could do this in advance during the previous backup). It then processes the incremental backup information, copying subblocks that were transmitted raw and looking up the references either in V or in the part of A' already reconstructed.
Because information need only flow from El to E2 during the backup operation, there is no need for El and E2 to perform the backup operation concurrently. El can perform its side of the backup operation in isolation, producing an incremental backup file that can be later processed by E2.
There is a tradeoff between 1 ) the approximate ratio between the size of each file and that of its shadow, and 2) the mean subblock size. The higher the mean sub¬ block size (as determined by the partitioning met hod used (including E) ). the fewer subblocks per unit file length, and hence the shorter the shadow size per unit file length. However, increasing mean subblock sizes implies increasing the granular¬ ity of backups which can cause an increase in the size of the incremental backup file. There is also a tradeoff between the shadow file size and the hash width. A shadow file that uses 128-bit hashes will be about twice as long as one that uses 64-bit hashes. All these tradeoffs must be considered closely when constructing an implementation.
In a real existing implementation of this backup scheme, the exact format of the shadow file 5' is:
51
SUBSTITUTE SHEET (Rule 26.
Bytes Description
16 MD5 digest of the f ile Y corresponding to this shadow f ile .
16 MD5 digest of the first subblock in Y .
16 MD5 digest of the second subblock in Y .
16 MD5 digest of the last subblock in Y .
16 MD5 digest of the rest of this shadow f ile .
The first field contains the MD5 digest (a form of cryptographic hash ) of the entire contents of Y. This is included so that it can be copied to the incremental backup file so as to provide a check later that the incremental backup file is not being applied to the wrong version of V. It could also be used to determine if any change has been made to A' since the previous backup was taken. The first field is followed by a list of the MD5 digests of the subblocks in V in the order in which they appear in Y. Finally, a digest of the contents of the shadow file (less this field ) is included at the end so as to enable the detection of any corruption of the shadow file.
The format of the incremental backup file is as follows:
Bytes Description
16 MD5 digest of Y .
16 MD5 digest of X .
Zero or more ITEMS . 16 MD5 digest of the rest of the incremental backup f ile .
The first two fields of the incremental backup file contain the MD5 digest of the old and new versions of the file. The hash of the new version A' is calculated directlv
from A'. The hash of the old version is obtained from the first field of the shadow- file. These two values enable the remote backup entity E2 to check that:
• The backup file Y (to be updated) is identical to the one from which the shadow file was generated.
• The reconstructed A' is identical to the original A'.
The two checking fields are followed by a list of items followed by a checking digest of the rest of the incremental backup file.
Each item in the list of items describes one or more subblocks in the list of subblocks that can be considered to constitute A'. There are three kinds of item, and so each item commences with a byte having a value one. two, or three to indicate the kind of item. Here is a description of the content of each of the three kinds of item:
1. The 32-bit index of a subblock in V . Because E2 possesses V. it can partition itself to construct the same partitioning that was used to create the shadow- file. Thus El doesn't need to send the hash of any subblock that is in both Λr and Y. Instead, it need only send the index of the subblock in the list of subblocks constituting _ *. This list is represented by the list of hashes in S. As 32-bits is wide enough for an index in practice, the saving gained by communicating a 32-bit index instead of a hash is 98 bits for each such item.
2. A pair of 32-bit numbers being the index of the first and last subblock of a range of subblocks in _ '. Old and new versions of files often share large contiguous ranges of subblocks. The use of this kind of item allows such ranges to be represented using just 64 bits instead of a long run of instances of the first kind of item.
3. A 32-bit value containing the number of bytes in the subblock. followed by the raw content of the subblock. This kind of item is used if the subblock to be transmitted is not present in Y.
In the implementation, all the values are coded in little-endian form. Big-endian could be used equally as well.
The existing implementation could be further optimized by (without limitation):
• Adding an additional kind of item that refers to subblocks in A' already trans¬ mitted:
• Adding an additional kind of item that refers to ranges of subblocks in A' already transmitted;
• Employing data compression techniques to compress the raw blocks in the third kind of item.
• Using the first hash in the shadow file to check to see if the entire file has changed at all before performing the backup process described above.
• Replacing hashes in S of subblocks in _ by references to other hashes in $ ( where the hashes (and hence subblocks) are identical ). Repeated runs of hashes could also be replaced by pointers to ranges of hashes.
The scheme described above has been described in terms of a single file. However, the technique could be applied repeatedly to each of the files in a file system, thus providing a way to back up an entire file system. The shadow information for each file in the file system could be stored inside a separate shadow file for each file, or in a master shadow file containing the shadows for one or more (or all ) files in the file system.
Although most redundancy in a file system is likely to be found within different versions of each file, there may be great similarities between versions of different files. For example, if a file is renamed, the "new" file will be identical to the "old" file. Such redundancy can be catered for by comparing the hashes of all the files in the old and new versions of a file system. In addition, similarities between different parts of different files can be exploited by comparing the hashes of subblocks of each file to be backed up against the hashes of the subblocks of the entire old version of the file system.
If E2 has lots of space, a further improvement could be for El to retain t he shadows of all the previous versions of the file system, and for E2 to retain copies of all the previous versions of the file system. El could then refer to every block it has ever seen. This technique could also be applied on a file-by-file basis.
In a further variant, the dependence on the ordering of subblocks could be abandoned and El could simply keep a shadow file containing a list of the hashes of all the subblocks in the previous version (or versions) of the file or file system. E2 would then need to record only a single copy of each unique subblock it has ever received from El .
Aspects of the backup application described in this section can be integrat ed cleanly into existing backup architectures by deploying the new mechanisms wit hin the framework of the existing ones. For example, the traditional methods for determin¬ ing if a file has changed since the last backup (modification date, backup date and so on) can be used to see if a file needs to be backed up at all. before applying the new mechanisms.
Example Application: A Low-Redundancy File System
We now present an example of a low-redundancy file system that attempts to avoid
oo
SUBSTITUTE SHEET (Rule 26;
storing different instances of the same data more than once. In this example, the file system is organized as shown in Figure 26.
The bottom layer consists of a collection of unique subblocks of varying length that are stored somewhere on the disk. The middle layer consists of a hash table containing one entry for each subblock. Each entry consists of a cryptographic hash of the subblock. a reference count for the subblock, and a pointer to the subblock on disk. The hash table is indexed by some part of the cryptographic hash (e.g. the bottom 16 bits). Although a hash table is used in this example, many other data structures (e.g. a binary tree) could also be used to map cryptographic hashes to subblock entries . It would also be possible to index the subblocks directly without the use of cryptographic hashes.
The top layer consists of a table of files that binds filenames to lists of subblocks. each list being a list of indexes into the hash table. Each hash table entry corresponds to a single unique subblock (except possibly in the case of overflow) and contains the cryptographic hash of the subblock along with a reference count and a pointer to the subblock on the disk. The reference count records the number of references to the subblock that appear in the entire set of files in the file table. The issue of hash table "overflow" can be addressed using a variety of well-known overflow techniques such as that of attaching a linked list to each hash slot.
When a file is read, the list of hash table indexes is converted to pointers to sub¬ blocks of data using the hash table. If random access to the file is required, extra information about the length of the subblocks could be added to the file table and/or hash table so as to speed access.
Writing a file is more complicated. During a sequential write, the data being written is buffered until a subblock-boundary is reached (as determined by whatever bound¬ ary function is being used ). The cryptographic hash of the new subblock is then calculated and used to look up the hash table. If the subblock is unique ( i.e. there
is no entry for the cryptographic hash ), it is added to the data blocks on the disk and an entry is added to the hash table. A new subblock number is added to the list of blocks in the file table. If. on the other hand, the subblock already exists, the subblock need not be written to disk. Instead, the reference count of the already- existing subblock is incremented, and the subblock's hash table index is added to the list of blocks in the file's entry in the file table.
Random access writes are more involved, but essentially the same principles apply.
If a record were kept of subblocks created since the last backup, backing up this file system could be very efficient indeed.
One enhancement that could be made is to exploit unused disk space. Instead of automatically ignoring or overwriting subblocks whose reference count has dropped to zero, the low-redundancy file system could move them to a pool of unused sub¬ blocks. These subblocks, while not present in any file, could still form part of the subblock pool referred to when checking to see if incoming subblocks are already present in the file system. The space consumed by subblocks in the unused sub¬ block pool would be recycled only when the disk was full. In t he steady state, the '"unused" portion of the disk would be filled by subblocks in the unused subblock pool.
Although this section has specifically described a low-redundancy file system, this aspect of the invention is really a general purpose storage system that could be applied at many levels and in many roles in information pi ocessing systems. For example:
• The technique could be used to implement a low-redundancy virtual mem- orv system. The contents of memory could be organized as a collection of subblocks.
θ ι
The technique could be used to increase the efficiency of an on-chip cache.
Example Application: A Communication System
We now present a method for reducing duplicate transmissions in communications systems. Consider two entities El and E2, where El must transfer a block of data A' to E2. El and E2 need never have communicated previously with each other.
The conventional way to perform the transmission is simply for El to transmit A' to E2. However, here. El first partitions A' into subblocks and calculates the hash of each subblock using a hash function. It then transmits the hashes to E2. E2 then looks up the hashes in a table of hashes of all the subblocks it already possesses. E2 then transmits to El information (e.g. a list of subblock numbers) identifying the subblocks in A' that E2 does not already possess. El then transmits just those subblocks.
Another way to perform the transaction would be for E*2 to first transmit to El the hashes of all the subblocks it possesses (or perhaps a well chosen subset of them). El could then transmit references to subblocks in A' already known to E2 and the actual contents of subblocks in A' not known to E2. This scheme could be more efficient than the earlier scheme in cases where E2 possesses less subblocks than there are in A'.
Another way to perform the t ransaction is for El and E2 to conduct a more com¬ plicated conversation to establish which subblocks E2 possesses. For example. E2 could send El the hashes of just some of the subblocks it possesses (perhaps the most popular ones). El could then send to E2 the hashes of other subblocks in A'. E2 could then reply indicating which of those subblocks it truly does not possess. El could then send to E2 t he subblocks in A' not possessed by E2.
In a more sophisticated system, El and E2 could keep track of the hashes of the subblocks possessed by the other. If either entity ever sent (for whatever reason ) a reference to a subblock not possessed by the other entity, the latter entity could simply send back a request for the subblock to be transmitted explicitly and the former entity could send the requested subblock.
The communication application described above considers the case of just two com¬ municants. However, there is no reason why the scheme could not be generalized to cover more than two communicants communicating with each other in private and in public (using broadcasts). For example, to broadcast a block, a computer C could broadcast a list of the hashes of the block's subblocks. Computers C_ . . . _V could then each reply indicating which subblocks they do not already possess. C could t hen broadcast subblocks that many of the other computers do not possess, and send the subblocks missing from only a few computers to those computers privately.
All these techniques have the potential to great ly reduce the amount of information transmitted between computers.
These techniques would be very efficient if they were implemented on top of the file system described earlier, as the file system would already have performed the work of organizing all the data it possesses into indexed subblocks. The potential savings in communication that could be made if many different computer systems shared the same subblock partitioning algorithm suggests that some form of universal stan¬ dardization on a particular partit ioning method would be a worthy goal.
Example Application: A Subblock Server
Aspec ts of the invention could be used to establish a subblock server on a net work so as to reduce network traffic. A subblock server could be located in a busy part of a network. It would consist of a computer that breaks each block of data it
sees into subblocks, hashes the subblocks, and then stores them for future reference. Other computers on the network could send requests to the server for subblocks. the requests consisting of the hashes of subblocks the server might possess. The server would respond to each hash, returning either the subblock corresponding to the hash, or a message stating that the server does not possess a subblock corresponding to the hash.
Such a subblock server could be useful for localizing network traffic on the Internet. For example, if a subnetwork (even a large one for (say) an entire country) placed a subblock server on each of its major Internet connections, then (with the appropriate modification of various protocols) much of the traffic into the network could be eliminated. For example, if a user requested a file from a remote host on another network. the user's computer might issue the request and receive, in reply, not the file, but the hashes of the file's subblocks. The user's computer could then send the hashes to the local subblock server to see if the subblocks are present t here. It would receive the subblocks that are present and then forward a request for the remaining subblocks to the remote host. The subblock server might notice the new subblocks flowing through it and archive them for future reference. The entire effect would be to eliminate most repeated data transfers between the subnetwork and the rest of the Internet . However, the security implications of schemes such as t hese would need to be closely investigated before there were deployed.
A further step could be to create '"virtual" subblock servers t hai store the hashes of subblocks and their location on the Internet rather than the subblocks and their hashes.