Subnet Mask

I have seen some subnet masks configured with all Zeros 0.0.0.0 or 255.255.255.255

Example:
Network 10.10.12.1 0.0.0.0
and
Network 10.10.12.1 255.255.255.255

what is the difference ?

Thanks
jskfanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

matrix8086Commented:
the net mask 0.0.0.0 it says that you have an extranet as big as all the Internet if 10.10.12.1 has such a net mask, theoretically he can ping every IP on the Internet (just theoretically)

the net mask 255.255.255.255.255 it says that you have a subnet from only one host. For example if 10.10.12.1 has such a net mask, he can ping only himself. He cannot ping any other host. Neither a host from the switch where is plugged in, with the IP, let's say, 10.10.12.2
0
jskfanAuthor Commented:
The way I know about 10.10.12.1 255.255.255.255
You are advertising just that IP address to other routers, which means other router do not know if you have other networks.


network 10.10.12.1 0.0.0.0
I saw that in wild card mask, but not in regular network mask
0
Fred MarshallPrincipalCommented:
Part of the answer will include "where?" you saw these.

For example, in a router rule, 255.255.255.255 in conjunction with an IP address means "this IP address and no others".   I don't know that it's properly called a "subnet" mask but perhaps.  I say that because there is no proper networking subnet defined with network and broadcast addresses included in the "subnet".
The same subnet mask would not be used in a NIC configuration.
So, the use and context matter.

Probably not very appropriate here to repeat them, there are any number of good treatises if you Google.  (I don't often suggest that as it may be off-putting but in this case I believe that will serve you best).
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

jskfanAuthor Commented:
I meant when you are advertising a network off the router, not when assigning IP address to an interface.
what is the impact of using all zeros vs all 255s
0
matrix8086Commented:
all zeros on a router means the default route
0
matrix8086Commented:
Sorry,

On a routing table of a router:

0.0.0.0 means that's the default route. If no other matches were found, the packet will follow the next hop specified on that line

255.255.255.255 in a routing table means the next hop for only that host (10.10.12.1) is the one specified at that line

The first line in a routing table is the default route and it has the lowest priority. Is used if no matches occurs.

The last line in a routing table has the maximum priority (first checked for a match)

The ruter order by himself the routes by net mask and distance

A routing table looks like in attach
Screen-Shot-2015-05-03-at-20.09.39.png
0
matrix8086Commented:
How the routes are calculated:

For each entry in a routing table, perform a bit-wise logical AND between the destination IP address and the network mask. Compare the result with the network ID of the entry for a match.
The list of matching routes is compiled. The route that has the longest match (the route that matched the most amount of bits with the destination IP address) is chosen. The longest matching route is the most specific route to the destination IP address. If multiple entries with the longest match are found (multiple routes to the same network ID, for example), the router uses the lowest metric to select the best route.
0
Don JohnstonInstructorCommented:
Here's how I explain it:

The advertised network consists of an address and mask. The portion of the address that corresponds to 1's in the mask are relevant.  The portion of the address that corresponds to 0's are not (relevant).  So 172.16.1.0/24 would mean that 172.16.1 are the relevant part of the network address.  The zeros in the mask simply mean that the portion of the address is not significant.

As for how the router uses these entries, assuming that you have a router with the following entries in the routing table:

172.16.1.8/32 (Entry A)
172.16.1.0/24 (Entry B)
172.16.0.0/16 (Entry C)
172.0.0.0/8 (Entry D)
0.0.0.0/0 (Entry E)

If the router receives a packet with the destination address of 172.16.1.8, it will use entry A since that is a perfect match.  Routers will always prefer the longest match.

If the router receives a packet with the destination address of 172.16.1.12, it will use entry B since that is longest matching entry  (A is not a match at all and B is a longer match than C). Or put another way, is this packet going to 172.16.1.I-don't-care?

A packet with the destination address of 172.17.88.7 will have the router using entry D. Or using the same analogy as above: Is this packet going to 172.I-don't-care.I-don't-care.I-don't-care? If yes, then entry D is the choice.  But remember, that's only if there isn't a longer match.

Finally, if the router receives a packet going to 10.1.2.3 it will be forced to use entry E. And once again, that basically means the destination network of I-don't-care.I-don't-care.I-don't-care.I-don't-care.

HTH
0
Fred MarshallPrincipalCommented:
It appears that folks have confused a 0.0.0.0 mask with a 0.0.0.0 address.
The question is about masks.
0
jskfanAuthor Commented:
This is my question:

let' say you have R1

Router OSPF 1
 Network 10.10.12.1 255.255.255.255

To my understanding you are advertising single IP address instead of a subnet
 


I am not sure about this when you advertise
Network 10.10.12.1 0.0.0.0
0
Don JohnstonInstructorCommented:
Not correct.

The network statement in OSPF does not (specifically) indicate a network to advertise. It indicates which interfaces OSPF is enabled on. Now when OSPF is enabled on an interface, the network connected to that interface is advertised.

In your example, OSPF is enabled on the interface with an IP address of (exactly) 10.10.12.1.

Consequently:

network 10.10.0.0 0.0.255.255 (area 2)

Would enable OSPF on any interface with an IP address of 10.10.anything.anything.

OSPF network statements use wildcard (or inverse) masks which basically mean that they are the opposite of traditional masks.  Which means that 0's indicate the relevant part of the address and 1's indicate the part of the address which is not relevant.

Context is important in these types of questions. ;-)
0
jskfanAuthor Commented:
I believe I saw the example in BGP to correct my self.

I am still not sure the difference between
Network 10.10.12.1 255.255.255.255
and
Network 10.10.12.1 0.0.0.0
0
Don JohnstonInstructorCommented:
Well in BGP, the network statement does indicate a network to advertise.
I am still not sure the difference between
That depends entirely on where this statement would be used.

In BGP, you would never use the all zeros mask since that would mean that the entire address you're advertising is not relevant.  An all ones could be used but that would be highly unlikely.

The thing is this.  The mask values are very dependent on where it's used.  i.e. a BGP network statement, an OSPF network statement, a static route, etc.

So before we can go any further, we must know where this mask will be used.
0
Fred MarshallPrincipalCommented:
Don Johnston is echoing what I said earlier with good reason.
It all depends on the use / where / what kind of machine and what settings specifically and the context if there's any context left after the first part.

I suppose I could get silly just to make sure there's understanding:

255.255.255.255 is 11111111 11111111 11111111 11111111
and
0.0.0.0                   is 00000000 00000000 00000000 00000000

So, that shows a clear difference.
But I don't think that's what you're asking.
I think the question is this:
"What is the difference in MEANING / INTERPRETATION of the two?"
And, that's why it depends a lot on where it's used because the meaning / interpretation / intent will vary.

Most places 255.255.255.255 will mean what I said earlier:  "this IP address and no other".  This might be used in a firewall rule where you list the scope of IP addresses that the rule applies to.  It might be used in a web filter to refer to a single public address.  etc.

I can't give you a good example of a mask that's 0.0.0.0 and I think others have said it won't work in many contexts.

So maybe trying to differentiate between the two is a hard way to go.  Maybe figuring out when to use one of them in some useful context is a good way.  Then figure out when to use the other one in some useful context would also be a good way.  But to somehow compare them is rather like apples and oranges.

I believe it's much more common for 255.255.255.255 to be a mask, as you've asked about.  And, 0.0.0.0 is more likely to be used as an address as in "default route".  But, again, the interpretations vary.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
Thank you.....I will read about it later
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.