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

  • SEARCH
  • Home
  • 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 8752169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:11:00+00:00 2026-06-13T13:11:00+00:00

I understand if two IP addresses are AND’d with a subnet mask if the

  • 0

I understand if two IP addresses are AND’d with a subnet mask if the result is the same then they are on the same network. If the result is different then they are on different networks. My question is, when given an IP address omitting some 0s where do the extra 0s get placed?

For example if the subnet mask is 255 . 128 . 0 . 0 , and you have IP 126 . 1 . 0 . 10 and IP 126 . 127 . 0 . 1 if you just blindly AND the IPs with the subnet mask you get different results even though they are on the same network.

Does 126.1.0.10 become 126.100.000.100 or 126.001.000.100?

EDIT after reading replies:

255128000000 AND 126001000010 = 1085496376*32* but 255128000000 AND 126127000001 = 1085276323*84*
Am I missing something?

  • 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-06-13T13:11:01+00:00Added an answer on June 13, 2026 at 1:11 pm

    IPv4 addreses are written as four ordinary decimal numbers (each fitting into a byte) separated by dots.

    The ordinary decimal number 1 is “one”, which can also be written 001. However 100 is a different number, namely “a hundred”.


    The AND operation is always a bitwise AND, so to understand it you must first see how the dotted-decimal address and netmask corresponds to a raw binary 32-bit address:

            126   .    127   .     0    .    1
         01111110   01111111   00000000   00000001
    
            255   .    128   .     0    .    0
    AND  11111111   10000000   00000000   00000000
     -----------------------------------------------
         01111110   00000000   00000000   00000000
            126   .      0   .     0    .    0
    

    So 126.127.0.1 with netmask 255.128.0.0 is in subnet 126.0.0.0/9

    In software one usually stores IPv4 addresses in a single 32-bit variable — so 126.127.0.1 is 01111110011111110000000000000001 binary (which also encodes 2122252289 decimal, except that nobody ever cares what the decimal value of a 32-bit IP address is), and it is converted to dotted-decimal only when it needs to be shown to human users. This representation is what glglgl decribes as multiplying by 256 several times.

    If you also have the netmask in a 32-bit variable (11111111100000000000000000000000 binary or 4286578688 decimal), you can AND them in a single machine instruction to get the network address 01111110000000000000000000000000.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really trying to understand the difference between OpenID and OAuth? Maybe they're two
This question relates to implementing redundancy when having two databases syncronising on 2 different
New to Node.js and Express, I am trying to understand the two seems overlapping
I want to understand the role interface plays in inheritance between two classes. My
Can you help me understand the practical differences between these two; IList<int> myList =
I'm looking for a better solution for two things: How can I understand if
What is the difference between these two class declarations? I don't understand why @class
I'm trying to better understand what the stack trace means. I have a two
![enter image description here][1]On my two demo and screenshot, you can understand that so
I've been working on this project for about two weeks now. I don't understand

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.