Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6926059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:52:09+00:00 2026-05-27T10:52:09+00:00

How to split a network block to sub blocks in Java. I want to

  • 0

How to split a network block to sub blocks in Java. I want to find out from a given 67.10/16 block, what blocks of /18 can I generate. For e.g. output should be this..

67.10.0/18
67.10.64/18
67.10.128/18
67.10.192/18

Or If I input 67.10/16 and the target cidr of /17 then the output should be

67.10.0/17
67.10.128/17

What is the best and efficient way of doing this.
Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:52:10+00:00Added an answer on May 27, 2026 at 10:52 am

    For example – subnet 67.10.1.1 /16 into four blocks.
    In general:

    Convert the base IP address to a number.

    01000011 00001010 00000001 00000001 (1,124,729,089)

    Convert the base mask to a number.

    11111111 11111111 00000000 00000000 (4,294,901,760)

    Mask the base IP with the mask giving the true base IP.

    01000011 00001010 00000000 00000000 (1,124,728,832)

    Convert the new mask (/18) to a number

    11111111 11111111 11000000 00000000 (4,294,950,912)

    XOR the original mask and the new mask to get the addition factor

    00000000 00000000 11000000 00000000 (49,152)

    Starting with the true base IP

    for x = 0 to (2^(new cidr-old cidr))-1
     use **true base IP**
     true base IP = true base IP + addition factor
    next x
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read a large XML document from the network and split it
Java has a convenient split method: String str = The quick brown fox; String[]
How can I split long commands over multiple lines in a batch file?
I want to split an arithmetic expression into tokens, to convert it into RPN.
I want to split a command line like string in single string parameters. How
One approach to high scalability is to use network load balancing to split processing
I posted Python find first network hop about trying to find the first hop
I want to send large files over Bonjure network. When I send a file
I have a windows service (C# .Net 3.5) that grabs data from a network
I have an Access database which is split, and have moved it from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.