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

IP Assignment #190

Open
evaachim opened this issue Jun 21, 2023 · 13 comments
Open

IP Assignment #190

evaachim opened this issue Jun 21, 2023 · 13 comments
Assignees
Labels
advancement Additions

Comments

@evaachim
Copy link
Contributor

No description provided.

@evaachim evaachim changed the title Backend tuning Backend Jun 21, 2023
@evaachim evaachim changed the title Backend IP Assignment Jun 23, 2023
@evaachim
Copy link
Contributor Author

Assign IP addresses for resources which are added to the Zebra server tool by users.

@evaachim
Copy link
Contributor Author

evaachim commented Jun 23, 2023

Ideas to keep in mind:

  1. Are the IP addresses internal only to Zebra?
  2. Make sure the IPs are unique.
  3. Consider "releasing" an IP address once the resource it belonged to was deleted.

@evaachim evaachim added the advancement Additions label Jun 23, 2023
@evaachim evaachim added this to zebra Jun 23, 2023
@evaachim evaachim moved this to In Progress in zebra Jun 23, 2023
@evaachim evaachim self-assigned this Jun 23, 2023
@evaachim
Copy link
Contributor Author

Some ideas:

We need an address pool to allocate addresses from to every resource that is being added/requested by a user
We need an interface to store all IP addresses for active resources
We need to check against the above interface to make sure IP addresses do not repeat
We need to "free up" addresses once the resource is no longer active so it can be potentially re-used

@evaachim
Copy link
Contributor Author

Further Ideas:

  1. generate IPs as per the protocol
  2. Check or convert to IPv4 format
  3. Create a list of "in-use" IPs
  4. Add any newly used IP to the above list
  5. Store all associated IPs in an IP address pool.

@evaachim
Copy link
Contributor Author

Some things to consider:

  1. How will we manage IP address pools AND how will we group them - by resource or by user?
  2. If local, what is the plan to determine the domain or port for them?

@evaachim
Copy link
Contributor Author

evaachim commented Jul 3, 2023

To add more as per Dan's requirements

@evaachim
Copy link
Contributor Author

evaachim commented Jul 5, 2023

Requirements from Dan:

  1. Replicate the IP address as it is in Racktables
  2. Enhance the experience from above to generate and assign IP addresses to newly created resources, as needed.

@evaachim
Copy link
Contributor Author

evaachim commented Jul 6, 2023

The IPs in Racktables are of the type long or integer, represented as a string, of either one of the following types: 2887224186, 180612481, 173099303. Thus, these need to be converted to a valid IP address via a series of conversions.

@evaachim
Copy link
Contributor Author

evaachim commented Jul 6, 2023

Ideas for achieving this:

  1. generate numeric strings
  2. convert the string to IP-type
  3. validate IP to ensure it is of correct / valid format
  4. pass this IP to newly created resources

@evaachim
Copy link
Contributor Author

evaachim commented Jul 7, 2023

This can be accomplished like this:

  1. function to generate random numeric values
  2. function to convert to hex and then IP
  3. function to validate IP
  4. function to assign this new IP to any new resource that requires an IP address,

@evaachim
Copy link
Contributor Author

Conversion to IP is as follows:

decimal -> hex -> bit grouping -> bit shifting -> IP

@evaachim
Copy link
Contributor Author

Assignment of IP:

a function that operates on the new base resource struct to add IPs to those resources which need them.

@evaachim
Copy link
Contributor Author

evaachim commented Jul 19, 2023

Our desired format is subnet + slashes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advancement Additions
Projects
Status: In Progress
Development

No branches or pull requests

1 participant