Tip & How-To about Computers & Internet

Why Subnet Mask is used with IP address

In networking the subnet mask is used with IP address to get the Network ID. The Network ID is used to identify that the particular IP address belongs to which network. To get the network ID the Subnet Mask is AND ed with the IP address in binary format.

Example:-

IPv4 address contains 4 fields and each field is 8bit

IP Address - 192.168.10.2

Subnet Mask (Default)- 255.255.255.0

Binary

192 -> 11000000

168 -> 10101000

10 -> 00001010

2 -> 00000010

255 -> 11111111

Logical AND (formula)

* 0 AND 0 = 0
* 0 AND 1 = 0
* 1 AND 0 = 0
* 1 AND 1 = 1

192.168.10.2 ------> 11000000.10101000.00001010.00000010

255.255.255.0 ------> 11111111.11111111.11111111.11111111
-----------------------------------------------------------------------------------------------------------
11000000.10101000.00001010.00000000 (AND ing)
-----------------------------------------------------------------------------------------------------------

Hence after AND ing we get the network ID that is 192.168.10.0, so the IP address 192.168.10.2 belongs to this network.

Enjoy networking.

Posted by on

Computers & Internet Logo

Related Topics:

Related Questions:

1 Answer

I just configured my MFC 490cw for wireless printing. It works but now I have IP address conflicts across all computers XP & Windows 7) and X-box in the house. If I turn the printer off, the network works fine. Any fast ideas/solution?


When configuring an address for the printer, the IP configuration might look like (just an example):

IP Address - 192.168.1.2

Subnet Mask - 255.255.255.0

Default Gateway - 192.168.1.1

It's important to note that even though you are not using any IP addresses in the default range for DHCP, the Subnet Mask and Default Gateway addresses will be THE SAME.

If you have another device on your network that will be assign a fixed address, you would use for example:

IP Address - 192.168.1.3

Subnet Mask - 255.255.255.0

Default Gateway - 192.168.1.1

For any other devices, just increment the IP address by one, 192.168.1.4, 192.168.1.5, etc and use the same Subnet Mask and Default Gateway.
(see the owners manual or site for steps on configuraing the printer TCP/IP information). This should take care of any conflicts.

Jan 29, 2011 | Brother MFC 490cw Color Inkjet...

1 Answer

hi. i cant connect to print server d-link dp301p+ IP to configure it?! who knows what IP by default it have? 192.168.0.10 doesnt work... Thanks, Mike


First find out the IP address , Subnet mask,and Gateway addresses of your ISP ( Internet Service Provider ). According to above addresses, you have to complete the network settings of your printer by mentioning the different IP address .

To find out the above mentioned addresses, first open the control panel -> network connections -> local area connction -> properties -> Internet Protocol Version 4(TCP/IPV4) OR Internet Protocol Version 6 (TCP/IPV6)according to your ISP -> Properties

By the systematic selection as mentioned above you will get the IP address, subnet mask and Gateway addresses.

Suppose your IP address is 192.168.0.10 , the gateway may be 192.168.0.1 Or any number. And the subnet mask may be XYY.XYY.XYY.0.

According to your ISP addresses you have to complete the network settings of your printer. First press the additional functions -> system settings -> network settings -> TCP/IP settings -> fill up the addresses as follows.

IP address : 192.168.0.16 OR any number .

subnet mask : XYY.XYY.XYY.0.

Gateway : 192.168.0.1

Hurray ! the problem about your network connection with the printer to your computer will be automatically solved.

Sep 28, 2010 | Computers & Internet

1 Answer

I can't get my computers to talk to one another through sonicwall and Im wondering what could be the issue


THere are many things you must be fully educated on like DNS, IP numbering and subnet masking for different networks (for the different sites), TCP Port and Protocol (UDP, TCP) knowledge for different TCP services (you have to know what you want each network to have access to) and Public Key Private Key methodology, IPSec, PPTP and Routing.

THere are many things that can go wrong. FOr instance in your particular case I would assume that your router is not configured to utilize groups of users and then assign those same groups to different traffic templates. YOu need to make sure that your four locations are assigned a particular traffic pattern. Most allow what the other gentleman spoke of "remote access" but you need more of a open network amongst authenticated users.

Routers of this class generally work by allowing you to assign traffic to a very specific Port and direction assignment. For instance simply - http traffic is always on port 80. If you wanted your users to have internet HTTP connectivity you must assign port 80 incoming and outgoing to those users and assign that traffic to internal and external IP addresses by using Network Address Translation on the IP address of the external network. YOu also want to make certain that your Gateway for the remote users are using their own internet service provider account because sometimes uneducated people setup the internet access to be routed to the external ip adddress on the home router. In this situation you would have a remote user dialing the home office and then requesting an internet page from that External network, only to have that traffic then come back to the home router and then out again over the vpn to the remote location. All internet traffic should be routed to the local gateway of that locations provider. THose remote routers will allow this and then only file sharing and printing and other critical network services should be routed over the VPN itself.

As I said it is very complicated and I would definitely pay someone to do this for you and then walk you through basic configuration issues while they are there. You would probably pay in the neighborhood of about 100-150 an hour but for this level you would be getting a certified and knowledgable person. You could also call SonicWall and have them walk you through it for a fee. Watchguards fee is 500.00 to 1000.00 depending on sophistication.

I am sure this only confused you more but IP Routing and VPN traffic routing is difficult and even people who have been in this industry for a very long time find it difficult. You have to be in it and doing it all the time for it to come second nature. I believe your IP addresses are on completely different subnets or ranges. That is another place to start. You really need to setup your internal networks at all locations on the SAME NETWORK in order for them to speak to one another.

127.0.0.1 is one network that is publicly unroutable or 192.168.0.1 or 192.168.111.1. These are common netoworks.

I'll try to give you a short lesson this. subnet masks (the 255.255.255.0) number under the ip address in the networks section allows you to segment your traffic to only communicate to a certain NUMBER of computers.

An IP Address of 192.168.0.0 with a subnet mask of 255.255.255.254 gives you zero computers. If you move the subnet mask to 255.255.255.252 you get 4 ip address but only 2 computers that can talk to one another. THe ip address in this configuration would be 192.168.0.0, 192.168.0.1, 192.168.0.2 and 192.168.0.3. The first ip address of any given network is ALWAYS the network address and should not be used (192.168.0.0) the next two ip address can be assigned to computers and the last ip address is always a "Broadcast" address for the network to speak on.

YOu could have started with another number to begin with for instance 192.168.1.54 subnet mask 255.255.252 and the same methodology would apply. 192.168.1.54 is the network, 192.168.1.55 and 56 are the computer addresses and 192.168.1.57 is the broadcast address.

If you want to have multiple computers at different locations you must all be on the same network with the same IP addressing scheme.

AN example 192.168.111.0 subnet mask of 255.255.255.0 would give you available address of 254 computers but 256 addresses (including zero).

The subnet masks are as follows for this network above (maybe you can use this)

192.168.111.0
255.255.255.254

Zero Computers only a network address and a broadcast address. Remember you only have 256 addresses in a range and the first is network and the last is broadcast so in this configuration you have 192.168.111.0 and 192.168.111.1 (only two addresses)

192.168.111.0
255.255.255.252

Two Computers 192.168.111.1 and 192.168.111.2 with network of 192.168.111.0 (first IP number) and broadcast of 192.168.111.3 (last IP Number) only two usable addresses but FOUR ip addresses.

192.168.111.0
255.255.255.248

Six computers with IPS of 192.168.111.1 to 192.168.111.6. Network of dot zero and broadcast of dot seven (192.168.111.7)

192.168.111.0
255.255.255.240

fourteen address 192.168.111.1 to 192.168.111.14
network .0, broadcast .15

subnet of 255.255.224
thirty computers 192.168.111.1 to 192.168.111.30
network of .0 and broadcast of .31

subnet of 255.255.192
sixty two computers 111.1 to 111.62
network of .0 and broadcast of .63

subnet of 255.255.128
One hundred twenty six computers 111.1 to 111.126
network of .0 and broadcast of .127

subnet of 255.255.0
Two hundred fifty four computers 111.1 to 111.254
network of .0 and broadcast of .255.

THis is one reason the actual computers wont talk to one another probably. ALL computers on the VPN must talk on the same Route or be ROUTED with the routers routing of networks options. to make the traffic move from one network to another.

May 03, 2009 | Computers & Internet

Not finding what you are looking for?

588 people viewed this tip

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Loading...