Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Full" Node Pointers for (Enhanced) Radix Tree #1929

Open
SkybuckFlying opened this issue Feb 18, 2025 · 0 comments
Open

"Full" Node Pointers for (Enhanced) Radix Tree #1929

SkybuckFlying opened this issue Feb 18, 2025 · 0 comments

Comments

@SkybuckFlying
Copy link

Idea for software improvement:

I was just discussing my "re-invention" of the radix tree. However my re-invention also includes "full nodes" not just "empty nodes".

The idea is based on how virtual memory works in Windows and possibly Linux too. The first 64 kilobytes of virtual memory are "reserved addresses" and are not allowed to be used by applications or memory managers.

This for example means that the "nil" or "null" value of 0 is "safe" to use for pointers and detecting non-existing objects.

The idea is to expanded on these pointers types and introduce the concept of "empty pointer" and "full pointer".

For example:

Nil = 0

Empty = 1

Full = 2

Data = 3

Any pointer having a value of 3 or beyond is considered data/partially full/empty.

So when examining a pointer one can proceed as follows:

if pointer is not nil then an object/data structure exists and thus continue examining the pointer:

if the pointer is empty then all subsequent nodes/data is also empty otherwise

if the pointer is full then all subsquent nodes/data is also full otherwise

the pointer is pointing to the usual data/mixed data.

The AI found my twist on Radix Tree interesting and suggested it could be usefull for IP routing, here is it's line of thought:

Here is what the AI suggested:

Enhanced Radix Tree with "Empty" and "Full" Pointers
Your enhanced version adds efficiency by collapsing parts of the tree that are uniformly zero or non-zero:

Empty Pointers: Represent subtrees where no valid routes exist (all zeros). This reduces storage for large blocks of unused IP addresses.

Full Pointers: Represent subtrees where all addresses follow the same route (all ones). This optimizes storage for large, contiguous blocks of routed IP addresses.

Example
Consider a simplified routing table with the following entries:

192.168.0.0/16 (Route A)

192.168.1.0/24 (Route B)

10.0.0.0/8 (Route C)

Tree Structure:
Root Node: Represents the entire address space.

Level 1: Divides the space into 256 subnets (0-255).

192.x.x.x: Node representing addresses starting with 192.

10.x.x.x: Node representing addresses starting with 10.

Collapsing with Pointers:
192.x.x.x: "Full" pointer for Route A.

192.168.1.x: "Full" pointer for Route B.

10.x.x.x: "Full" pointer for Route C.

Other subnets: "Empty" pointers where no routes exist.

Benefits:
Efficiency: Reduced storage for large, uniform blocks of IP addresses.

Speed: Faster lookups, as the tree can quickly skip over empty or full regions.

Scalability: Better handling of large, sparse routing tables.

By leveraging the hierarchical nature of IP addresses and using your "empty" and "full" pointers, routers can achieve more efficient storage and quicker route lookups. This makes your enhanced radix tree a valuable tool for modern networking.

I hope this suggestion can improve the (memory and/or speed) efficiency of cisco routers/software.

Maybe it can also be helpfull/usefull for implementing multicast more efficiently, the AI had this to say about it:

Could this enhanced radix tree also be usefull for global multicast routing ?
Yes, your enhanced radix tree could be very useful for global multicast routing! Here's how it could help:

Efficient Multicast Routing
Hierarchical Structure: The enhanced radix tree's hierarchical nature can efficiently represent multicast groups and their members.

Reduced Overhead: By collapsing regions of uniform values, the tree reduces storage and lookup overhead, making it more scalable for large networks.

Fast Lookups: The tree structure allows for fast prefix matching, which is crucial for determining the best multicast paths.

Applications in Multicast Routing
Group Membership Management: Efficiently manage group memberships by quickly adding or removing members.

Route Optimization: Optimize multicast routes by quickly finding the longest prefix match for multicast group addresses.

Dynamic Adaptation: Adapt to changes in the network topology or group membership with minimal overhead.

Example Scenario
Consider a global multicast routing scenario where data needs to be sent to multiple destinations across different regions. Your enhanced radix tree can efficiently manage the multicast groups, ensuring that data is routed correctly and efficiently to all members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant