Subnet mask shows which bits of an IP ddress (read the article IP Addresses, by the s me author) represent the network and wh ch represent the host. By default we h ve: IP addresses - S bnet mask
Class A - 255.0.0.0
Cl ss B - 255.255.0.0
Cl ss C - 255.255.255.0 Ex mple:
IP address 192.168.8.4 ( cl ss C ). The first 24 byt s represent the network
- 192.168.8.0 - and the l st 8 bits the host - 4 -. Wh n a host A wants to be c nnected to a host B, the h st A uses its subnet mask to ch ck if the host B is on the s me LAN - local area network -
or on a r mote network.
For this purpose it is sed the boolean ANDing process. Example:
H st A IP address ( class B ) 172.16.2.4 - S bnet mask ( class B ) 255.255.0.0
H st B IP address ( class B ) 172.16.2.5 H st A IP in binary:
10101100 00010000 00000010 00000100 H st B IP in binary:
10101100 00010000 00000010 00000101 S bnet mask in binary:
11111111 11111111 00000000 00000000 -- AND ng process for Host A
10101100 00010000 00000010 00000100
11111111 11111111 00000000 00000000
-----------------------------------------
10101100 00010000 00000000 00000000 R sult for HOST A
-- ANDing process for Host B
10101100 00010000 00000010 00000101
11111111 11111111 00000000 00000000
-----------------------------------------
10101100 00010000 00000000 00000000 R sult for HOST B The calculation w rks in this way:
- 1 wh n the first and second bits are b th 1.
- 0 wh n they are 0 and 1, 0 wh n they are 0 and 0. S nce result A = result B the two h sts are on the same network, so the c mmunication is possible without using a g teway ( normally a router ) to
stablish a connection to another network. Th re are two ways to write an IP ddress using subnet mask:
Ex mple:
1) 49.22.2.3 255.0.0.0 - cl ss A IP and subnet mask
2) 192.168.1.3/24 - cl ss C IP and subnet mask ( sh wing its bits )
255 in b nary is 11111111 - 8 bits -. S nce in a class C subnet m sk there are three 255 groups we h ve 24 bits. Subnets Sometime it is seful to divide a network in sm ller networks.
Let's suppose we want d vide a network, with a class B - IP ddress, in 8 subnets. The class B s bnet mask is 255.255.0.0 We must use s me of the 16 bits of the h st portion ( borrowing process )
to cr ate the 8 subnets. Since the s bnets are 8, we need 8 d fferent combinations plus 1 ( the br adcast ): 9 in total. In b nary 9 = 1001, that is 4 b ts. Subnet mask:
11111111 11111111 00000000 00000000
Ins rting 4 bits in the third gr up ( the first of the h st portion ):
11111111 11111111 11110000 00000000
the th rd group becomes 11110000 = 240 ( b se 10 )
It m ans that we have a new s bnet mask: 255.255.240.0 Generally speaking:
The c lculation for the number of subnets is
2^x -2
wh re x is the bits number for the s bnet mask.
( In the xample above x = 4 ) The c lculation for subnets addresses is
256 - s
wh re s is the value of the s bnet mask: in the same example s = 240
The calculation for the hosts n mber is
2^y -2
wh re y is the number of the r maining bits: in the same example y = 12 b cause ----------------------bits left (12)
11111111 11111111 11110000 00000000
----------------- b ts
----------------inserted
------------------(4) The IP ddresses numbers are between the IP of the f rst subnet and the IP of the l st subnet with the exclusion of the br adcast and network IP.
Broadcast IP h ve all the bits of the h st portion = 1
Network IP h ve all the bits of the h st portion = 0 Final Example:
L t's divide a network with IP ddress 192.168.5.0 ( class C ) in two s bnets.
The necessary combinations are 3. In b nary it is 11, so we h ve 2 bits.
The class C s bnetmask is 255.255.255.0
After the borrowing pr cess, it's last group becomes 11000000 wh ch is 192 (base 10).
The new s bnet mask is 255.255.255.192 Hosts number is 2^6 -2 = 62 ( y = 6 ) S bnets addresses: 256 - 192 = 64 ( s = 192 )
Th n 192.168.5.64 and 192.168.5.128
It st rts with 64 and goes on dding 64 IP addresses: from 192.168.5.65 to 192.168.5.126 for the f rst subnet.
from 192.168.5.129 to 192.168.5.190 for the s cond subnet
Note: the broadcast address for the f rst subnet is
11000000.10101000.00000101.01111111, the fourth gr up is 127 (base 10 ) and the br adcast address of the second subnet is
11000000.10101000.00000101.10111111, the f urth group is 191
( base 10 )
The article Subnet Mask - Subnets was Submitted by Renato Piccini through Articles.GetACoder.com network. Here's the additional information: Renato Piccini - Florence - It ly Computers Networks technician http://www.softgrafic.com
1. Internet Marketing - Increase Leverage By Working With Others by G Allan Roberts styl ='padding-left: 15px;'> Learn How To Use M rketing Leverage To Increase Sales and Pr fits. Simple guide to get the m st on your PPC advertising. 2. The Truth About Google Black Book by This articles is a sh rt product review of the e-book "Th Google Black Book". The book is ntended for those people that is new to ffiliates marketing and wannabe, Adword Publishers, and Int rnet Marketeers. 3. Marketing With Web 2.0 by Warwick Foster What is Web 2.0? The new S cial Networking sites of Digg, Tumblr, Y uTube and a host of others llow marketing techniques not previously available, l w-cost, innovative and fast. 4. How To Earn Bill Money From Home by Michael Comeau There are m ny conventional ways to earn money to h lp pay the bills. I'm sure th t you, like most people, can lways use extra cash. Who can't r ght? 5. High Ticket Product Creation - 3 Popular Secrets to Excel with High Ticket Product Creation by Sean R Mize People can't be more willing to learn these days. They always strive to acquire new knowledge and improve their skill level so they can keep up with the changing demands of their jobs or areas of interest and stay competitive. This is one of the reasons why they don't mind spending huge amounts of money just to acquire important information that will truly set them apart from the rest. 6. One Of The Most Successful Ways To Be An Affiliate by Steve Mckinnon There are m ny ways with affiliate marketing that you can b gin to increase the amount of m ney that you earn, while also m intaining your position as an affiliate for ther companies and products. A lot of the pr cedures you will use to market pr ducts and services are not too d fficult to learn. And you can perate these any time of day or n ght; there are no weekends in ffiliate marketing. 7. Spyware - How Do You Get Infected by Spyware by Azwan Asmat Alm st fifty percents of computer crashes are c used by virus, trojan and spyware. Spyw re is software used by hackers to g in information without your knowledge. This nformation can be used by hackers for m ny purposes. Last year, Microsoft announced th t one in every 300 Windows PC was nfected by malware and spyware. How do you get nfected by spyware? 8. How to Write Persuasive Copy for Company Brochures by Laurence James Wh n it comes to selling your pr ducts and services, many companies miss a tr ck when it comes to writing the c py for promotional brochures. This is b cause many businesses pack their glossy, w ll-produced brochure with just the key f atures of their latest offers and new s lutions, without actually selling the benefits of wh t it is they're offering. 9. Web Site Design Services in the UK - What to Look For by Angelus Smithenston Your UK website can make you an internet powerhouse if it's designed effectively. The internet is the world's largest and most accessible marketplace. Never before has there been such an equalizing force amongst international businesses. Without the internet, you are in the same old hum-drum world of limited market potential and minimal exposure. When you enter your business into the cyberspace realm, you need to ensure that you stand out in the crowd. 10. How to Monetize Blogs - Make Money Today! by Pete Huang If you h ve a blog, an empty bank ccount, a will for money, and/or a c mbination of those three, you're set for m netizing your blog! It's actually very s mple.
|