A method for determining a location of a requested resource, comprising: receiving a request for a resource from a client, wherein the resource is identified by a hierarchically structured name; decomposing the hierarchically structured name into a plurality of segments; comparing each of the plurality of segments to parent nodes of a plurality of two-level treelets, wherein comparing at least two of the plurality of segments to parent nodes of the plurality of two-level treelets is performed in a parallel manner, wherein at least a number of combinations of two-level treelets comprise a hierarchical name of a network resource, wherein each two-level treelet comprises a parent node and one or more child nodes; and determining a longest prefix match of the hierarchically structured name based on the comparing of each of the plurality of segments to the parent nodes of the plurality of two-level treelets, wherein determining the longest prefix match of the hierarchically structure name comprises: determining a first mismatch of the plurality of segments with the plurality of treelets starting from a root of the plurality of segments in terms of determining a first hierarchical segment that does not have a match in the treelets; identifying the first mismatch as an end of matched longest prefix of the hierarchically structured name; and constructing a longest prefix match name from matched ones of the plurality of treelets by joining each of the matching hierarchical segments in order from the root to the hierarchical segment immediately preceding the hierarchical segment lacking a match to construct a longest prefix match; wherein the method further comprising: determining an egress port corresponding to the longest prefix match; and forwarding the request through the identified egress port, wherein the request comprises a request for content and further comprising: receiving the content from a storage node; and forwarding the content to the client. receiving a request for a resource from a client, wherein the resource is identified by a hierarchically structured name; decomposing the hierarchically structured name into a plurality of segments; comparing each of the plurality of segments to parent nodes of a plurality of two-level treelets, wherein comparing at least two of the plurality of segments to parent nodes of the plurality of two-level treelets is performed in a parallel manner, wherein at least a number of combinations of two-level treelets comprise a hierarchical name of a network resource, wherein each two-level treelet comprises a parent node and one or more child nodes; and determining a longest prefix match of the hierarchically structured name based on the comparing of each of the plurality of segments to the parent nodes of the plurality of two-level treelets, wherein determining the longest prefix match of the hierarchically structure name comprises: determining a first mismatch of the plurality of segments with the plurality of treelets starting from a root of the plurality of segments in terms of determining a first hierarchical segment that does not have a match in the treelets; identifying the first mismatch as an end of matched longest prefix of the hierarchically structured name; and constructing a longest prefix match name from matched ones of the plurality of treelets by joining each of the matching hierarchical segments in order from the root to the hierarchical segment immediately preceding the hierarchical segment lacking a match to construct a longest prefix match; wherein the method further comprising: determining an egress port corresponding to the longest prefix match; and forwarding the request through the identified egress port, determining a first mismatch of the plurality of segments with the plurality of treelets starting from a root of the plurality of segments in terms of determining a first hierarchical segment that does not have a match in the treelets; identifying the first mismatch as an end of matched longest prefix of the hierarchically structured name; and constructing a longest prefix match name from matched ones of the plurality of treelets by joining each of the matching hierarchical segments in order from the root to the hierarchical segment immediately preceding the hierarchical segment lacking a match to construct a longest prefix match; wherein the method further comprising: determining an egress port corresponding to the longest prefix match; and forwarding the request through the identified egress port, determining an egress port corresponding to the longest prefix match; and forwarding the request through the identified egress port, receiving the content from a storage node; and forwarding the content to the client.