IP Address Subnetting Tutorial

Download (0)

Full text

(1)

IP Addres

IP Address Subnetting

s Subnetting Tut

Tutoria

oriall

By Ralph Becker  By Ralph Becker  Ralphb@whoever.com  Ralphb@whoever.com  Updated September 7, 1999 Updated September 7, 1999 This copy distributed by

This copy distributed by FirstVPNFirstVPNwith author's permission.with author's permission.

Disclaimer

Disclaimer

All the information contained in

All the information contained in this tutorial is provided for this tutorial is provided for the convenience of its readers. the convenience of its readers. All informationAll information is accurate as well

is accurate as well as can be as can be reasonably verified. reasonably verified. There are no There are no guarantees or warranties guarantees or warranties stated orstated or implied by the distribution

implied by the distribution of this information. of this information. Use the information in Use the information in this document at the this document at the reader's ownreader's own risk, and no liability shall be

risk, and no liability shall be given to the author. given to the author. Any damage or loss is the Any damage or loss is the sole responsibility of thesole responsibility of the reader.

reader.

Copyright Notice and Distribution Permission

Copyright Notice and Distribution Permission

Copyright 1996-2000 by Ralph Becker, All Rights Reserved. Copyright 1996-2000 by Ralph Becker, All Rights Reserved. Hypertext links to this site are encouraged.

Hypertext links to this site are encouraged. Hard copy reproduction created by printing Hard copy reproduction created by printing each page of theeach page of the tutorial is permitted.

tutorial is permitted. Online reproduction of the content of this tutorial beyond the control of the author Online reproduction of the content of this tutorial beyond the control of the author isis not permitted without

not permitted without express permission. express permission. Distribution for profit or Distribution for profit or financial gain is financial gain is not permitted.not permitted.

Distribution in commercial collections, compilations, or books without express permission from the author Distribution in commercial collections, compilations, or books without express permission from the author is not permitted. is not permitted.

Index

Index

Introduction Introduction IP Addressing IP Addressing Subnetting Subnetting

More Restrictive Subnet Masks

More Restrictive Subnet Masks

An Example

An Example

CIDR -- Classless InterDomain Routing

CIDR -- Classless InterDomain Routing

Allowed Class A Subnet and Host IP addresses

Allowed Class A Subnet and Host IP addresses

Allowed Class B Subnet and Host IP addresses

Allowed Class B Subnet and Host IP addresses

Allowed Class C Subnet and Host IP addresses

Allowed Class C Subnet and Host IP addresses

Logical Operations

Logical Operations

References and Sources on the Internet

(2)

Introduction

Introduction

This talk will cover the basics of

This talk will cover the basics of IP addressing and subnetting. IP addressing and subnetting. Topics covered will include:Topics covered will include:

• What is an IP Address?What is an IP Address?

• What are Classes?What are Classes?

• What is a Network Address?What is a Network Address?

• What are Subnet Masks and Subnet Addresses?What are Subnet Masks and Subnet Addresses?

• How are Subnet Masks defined and used?How are Subnet Masks defined and used?

• How can all this be applied?How can all this be applied?

• What is CIDR?What is CIDR?

IP Addressing

IP Addressing

An IP (Internet Protocol) address is a unique identifier for a node or host connection on an IP network. An An IP (Internet Protocol) address is a unique identifier for a node or host connection on an IP network. An IP address is a 32 bit binary number usually represented as 4 decimal values, each representing 8 bits, in IP address is a 32 bit binary number usually represented as 4 decimal values, each representing 8 bits, in the range 0 to 255 (known as octets) separated by decimal points. This is known as "dotted decimal" the range 0 to 255 (known as octets) separated by decimal points. This is known as "dotted decimal" notation.

notation.

Example: 140.179.220.200 Example: 140.179.220.200

It is sometimes useful to view the values in their binary form. It is sometimes useful to view the values in their binary form. 140 .179 .220 .200

140 .179 .220 .200

10001100.10110011.11011100.11001000 10001100.10110011.11011100.11001000

Every IP address consists of two parts, one identifying the network and one identifying the node. The Every IP address consists of two parts, one identifying the network and one identifying the node. The Class of the address and the subnet mask determine which part belongs to the network address and Class of the address and the subnet mask determine which part belongs to the network address and which part belongs to the node address.

which part belongs to the node address.

Address Classes

Address Classes

There are 5 different address classes. You can determine which class any IP address is in by examining There are 5 different address classes. You can determine which class any IP address is in by examining the first 4 bits of the IP address.

the first 4 bits of the IP address.

• Class AClass A addresses begin withaddresses begin with 0xxx0xxx, or, or 1 to 1261 to 126 decimal.decimal.

• Class BClass B addresses begin withaddresses begin with 10xx10xx, or, or 128 to 191128 to 191 decimal.decimal.

• Class CClass C addresses begin withaddresses begin with 110x110x, or, or 192 to 223192 to 223 decimal.decimal.

• Class DClass D addresses begin withaddresses begin with 11101110, or, or 224 to 239224 to 239 decimal.decimal.

• Class EClass E addresses begin withaddresses begin with 11111111, or, or 240 to 254240 to 254 decimal.decimal.

Addresses beginning with

Addresses beginning with 0111111101111111, or, or 127127 decimal, are reserved for loopback and for internal testing ondecimal, are reserved for loopback and for internal testing on a local machine. [You can test this: you should always be able to ping

a local machine. [You can test this: you should always be able to ping 127.0.0.1127.0.0.1, which points to yourself], which points to yourself] Class D addresses are reserved for multicasting. Class E addresses are reserved for future use. They Class D addresses are reserved for multicasting. Class E addresses are reserved for future use. They

(3)

should not be used for host addresses. should not be used for host addresses.

Now we can see how the Class determines, by default, which part of the IP address belongs to the Now we can see how the Class determines, by default, which part of the IP address belongs to the network (N) and which part belongs to the node (n).

network (N) and which part belongs to the node (n).

• • Class A -- NNNNNNNN.nnnnnnnn.nnnnnnn.nnnnnnnClass A -- NNNNNNNN.nnnnnnnn.nnnnnnn.nnnnnnn • • Class B -- NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnnClass B -- NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn • • Class C -- NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnnClass C -- NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn

In the example, 140.179.220.200 is a Class B address so by default the Network part of the address (also In the example, 140.179.220.200 is a Class B address so by default the Network part of the address (also known as the

known as the Network Address Network Address ) is defined by the first two octets (140.179.x.x) and the node part is) is defined by the first two octets (140.179.x.x) and the node part is defined by the last 2 octets (x.x.220.200).

defined by the last 2 octets (x.x.220.200).

In order to specify the network address for a given IP address, the node section is set to all "0"s. In our In order to specify the network address for a given IP address, the node section is set to all "0"s. In our example, 140.179.0.0 specifies the network address for 140.179.220.200. When the node section is set example, 140.179.0.0 specifies the network address for 140.179.220.200. When the node section is set to all "1"s, it specifies a broadcast that is sent to all hosts on the network. 140.179.255.255 specifies the to all "1"s, it specifies a broadcast that is sent to all hosts on the network. 140.179.255.255 specifies the example broadcast address. Note that this is true regardless of the length of the node section.

example broadcast address. Note that this is true regardless of the length of the node section.

Subnetting

Subnetting

Subnetting an IP Network can be done for a variety of reasons, including organization, use of different Subnetting an IP Network can be done for a variety of reasons, including organization, use of different physical media (such as Ethernet, FDDI, WAN, etc.), preservation of address space, and security. The physical media (such as Ethernet, FDDI, WAN, etc.), preservation of address space, and security. The most common reason is to control network traffic. In an Ethernet network, all nodes on a segment see all most common reason is to control network traffic. In an Ethernet network, all nodes on a segment see all the packets transmitted by all the other nodes on that segment. Performance can be adversely affected the packets transmitted by all the other nodes on that segment. Performance can be adversely affected under heavy traffic loads, due to collisions and the resulting retransmissions. A router is used to connect under heavy traffic loads, due to collisions and the resulting retransmissions. A router is used to connect IP networks to minimize the amount of traffic each segment must receive.

IP networks to minimize the amount of traffic each segment must receive.

Subnet Masking

Subnet Masking

Applying a subnet mask to an IP address allows you to identify the network and node parts of the Applying a subnet mask to an IP address allows you to identify the network and node parts of the address. Performing a bitwise

address. Performing a bitwise logical ANDlogical AND ooperation between the IP address and the subnet mask resultsperation between the IP address and the subnet mask results in the

in the Network Address Network Address or Number.or Number.

For example, using our test IP address and the default Class B subnet mask, we get: For example, using our test IP address and the default Class B subnet mask, we get: 10001100.10110011.11110000.11001000

10001100.10110011.11110000.11001000 140.179.240.200 140.179.240.200 Class Class B B IP IP AddressAddress 11111111.11111111.00000000.00000000

11111111.11111111.00000000.00000000 255.255.000.000 255.255.000.000 Default Default Class Class B B Subnet Subnet MaskMask

--- ---10001100.10110011.00000000.00000000

10001100.10110011.00000000.00000000 140.179.000.000 140.179.000.000 Network Network AddressAddress Default subnet masks:

Default subnet masks:

• • Class AClass A - 255.0.0.0 - 11111111.00000000.00000000.00000000- 255.0.0.0 - 11111111.00000000.00000000.00000000 • • Class BClass B - 255.255.0.0 - 11111111.11111111.00000000.00000000- 255.255.0.0 - 11111111.11111111.00000000.00000000 • • Class CClass C - 255.255.255.0 - 11111111.11111111.11111111.00000000- 255.255.255.0 - 11111111.11111111.11111111.00000000

More Restrictive Subnet Masks

More Restrictive Subnet Masks

Additional bits can be added to th

Additional bits can be added to th e default subne default subnet mask for a given Class to further subnet, or breaket mask for a given Class to further subnet, or break down, a network. When a bitwise

down, a network. When a bitwise logical ANDlogical AND ooperation is performed between the subnet mask and IPperation is performed between the subnet mask and IP address, the result defines the

address, the result defines the Subnet Address Subnet Address . There are some restrictions on the subnet address. Node. There are some restrictions on the subnet address. Node addresses of all "0"s and all "1"s are reserved for specifying the local network (when a host does not addresses of all "0"s and all "1"s are reserved for specifying the local network (when a host does not

(4)

know it's network address) and all hosts on the network (broadcast address), respectively. This also know it's network address) and all hosts on the network (broadcast address), respectively. This also applies to subnets. A subnet address cannot be all "0"s or all "1"s. This also implies that a 1 bit subnet applies to subnets. A subnet address cannot be all "0"s or all "1"s. This also implies that a 1 bit subnet mask is not allowed. This restriction is required because older standards enforced this restriction. Recent mask is not allowed. This restriction is required because older standards enforced this restriction. Recent standards that allow use of these subnets have superceded these standards, but many "legacy" devices standards that allow use of these subnets have superceded these standards, but many "legacy" devices do not support the newer standards. If you are operating in a controlled environment, such as a lab, you do not support the newer standards. If you are operating in a controlled environment, such as a lab, you can safely use these restricted subnets.

can safely use these restricted subnets.

To calculate the number of subnets or nodes, use the formula (2^n - 2) where n = number of bits in either To calculate the number of subnets or nodes, use the formula (2^n - 2) where n = number of bits in either field. Multiplying the number of subnets by the number of nodes available per subnet gives you the total field. Multiplying the number of subnets by the number of nodes available per subnet gives you the total number of nodes available for your class and subnet mask. Also, note that although subnet masks with number of nodes available for your class and subnet mask. Also, note that although subnet masks with non-contiguous mask bits are allowed they are not recommended.

non-contiguous mask bits are allowed they are not recommended. Example:

Example:

10001100.10110011.11011100.11001000

10001100.10110011.11011100.11001000 140.179.220.200 140.179.220.200 IP IP AddressAddress 11111111.11111111.11100000.00000000

11111111.11111111.11100000.00000000 255.255.224.000 255.255.224.000 Subnet Subnet MaskMask

--- ---10001100.10110011.11000000.00000000

10001100.10110011.11000000.00000000 140.179.192.000 140.179.192.000 Subnet Subnet AddressAddress 10001100.10110011.11011111.11111111

10001100.10110011.11011111.11111111 140.179.223.255 140.179.223.255 Broadcast Broadcast AddressAddress

In this example a 3 bit subnet mask was used. There are 6 subnets available with this size mask In this example a 3 bit subnet mask was used. There are 6 subnets available with this size mask (remember that subnets with all 0's and all 1's are not allowed). Each subnet has 8190 nodes. Each (remember that subnets with all 0's and all 1's are not allowed). Each subnet has 8190 nodes. Each subnet can have nodes assigned to any address between the Subnet address and the Broadcast subnet can have nodes assigned to any address between the Subnet address and the Broadcast

address. This gives a total of 49,140 nodes for the entire class B address subnetted this way. Notice that address. This gives a total of 49,140 nodes for the entire class B address subnetted this way. Notice that this is less than the 65,534 nodes an unsubnetted class B address would have.

this is less than the 65,534 nodes an unsubnetted class B address would have.

Subnetting always reduces the number of possible nodes for a given network. There are complete subnet Subnetting always reduces the number of possible nodes for a given network. There are complete subnet tables available here for

tables available here for Class AClass A,, Class BClass B andand Class CClass C.. These tables list all the possible subnet masks forThese tables list all the possible subnet masks for each class, along with calculations of the number of networks, nodes and total hosts for each subnet. each class, along with calculations of the number of networks, nodes and total hosts for each subnet.

An Example

An Example

Here is another, more detailed, example. Say you are assigned a Class C network number of Here is another, more detailed, example. Say you are assigned a Class C network number of

200.133.175.0 (apologies to anyone who may actually own this domain address :). You want to utilize this 200.133.175.0 (apologies to anyone who may actually own this domain address :). You want to utilize this network across multiple small groups within an organization. You can do this by subnetting that network network across multiple small groups within an organization. You can do this by subnetting that network with a subnet address.

with a subnet address.

We will break this network into 14 subnets of 14 nodes each. This will limit us to 196 nodes on the We will break this network into 14 subnets of 14 nodes each. This will limit us to 196 nodes on the network instead of the 254 we would have without subnetting, but gives us the advantages of traffic network instead of the 254 we would have without subnetting, but gives us the advantages of traffic isolation and security. To accomplish this, we need to use a subnet mask 4 bits long.

isolation and security. To accomplish this, we need to use a subnet mask 4 bits long. Recall that the default Class C subnet mask is

Recall that the default Class C subnet mask is

255.255.255.0 (11111111.11111111.11111111.00000000 binary) 255.255.255.0 (11111111.11111111.11111111.00000000 binary) Extending this by 4 bits yields a mask of

Extending this by 4 bits yields a mask of

255.255.255.240 (11111111.11111111.11111111.11110000 binary) 255.255.255.240 (11111111.11111111.11111111.11110000 binary) This gives us 16 possible network numbers, 2 of which cannot be used: This gives us 16 possible network numbers, 2 of which cannot be used:

S

Suubbnneet t bbiittss NNeettwwoorrk k NNuummbbeerr NNoodde e AAddddrreesssseess BBrrooaaddccaasst t AAddddrreessss 0 0000000 220000..113333..117755..00 RReesseerrvveedd NNoonnee 0 0000011 220000..113333..117755..1166 ..117 7 tthhrroouuggh h ..3300 220000..113333..117755..3311 0 0001100 220000..113333..117755..3322 ..333 3 tthhrroouuggh h ..4466 220000..113333..117755..4477

(5)

0 0001111 220000..113333..117755..4488 ..449 9 tthhrroouuggh h ..6622 220000..113333..117755..6633 0 0110000 220000..113333..117755..6644 ..665 5 tthhrroouuggh h ..7788 220000..113333..117755..7799 0 0110011 220000..113333..117755..8800 ..881 1 tthhrroouuggh h ..9944 220000..113333..117755..9955 0 0111100 220000..113333..117755..9966 ..997 7 tthhrroouuggh h ..111100 220000..113333..117755..111111 0 0111111 220000..113333..117755..111122 ..11113 3 tthhrroouuggh h ..112266 220000..113333..117755..112277 1 1000000 220000..113333..117755..112288 ..11229 9 tthhrroouuggh h ..114422 220000..113333..117755..114433 1 1000011 220000..113333..117755..114444 ..11445 5 tthhrroouuggh h ..115588 220000..113333..117755..115599 1 1001100 220000..113333..117755..116600 ..11661 1 tthhrroouuggh h ..117744 220000..113333..117755..117755 1 1001111 220000..113333..117755..117766 ..11777 7 tthhrroouuggh h ..119900 220000..113333..117755..119911 1 1110000 220000..113333..117755..119922 ..11993 3 tthhrroouuggh h ..220066 220000..113333..117755..220077 1 1110011 220000..113333..117755..220088 ..22009 9 tthhrroouuggh h ..222222 220000..113333..117755..222233 1 1111100 220000..113333..117755..222244 ..22225 5 tthhrroouuggh h ..223388 220000..113333..117755..223399 1 1111111 220000..113333..117755..224400 RReesseerrvveedd NNoonnee

CIDR --

CIDR -- Classless InterDomain Routin

Classless InterDomain Routing

g

Now that you understand "classful" IP Subnetting principals, you can forget them ;). The reason is

Now that you understand "classful" IP Subnetting principals, you can forget them ;). The reason is CIDRCIDR -- --C

Classlesslassless IInternterDDomainomain RRouting. CIDR was invented several years ago to keep the Internet from runningouting. CIDR was invented several years ago to keep the Internet from running out of IP addresses. The "classful" system of allocating IP addresses can be very wasteful; anyone who out of IP addresses. The "classful" system of allocating IP addresses can be very wasteful; anyone who could reasonably show a need for more that 254 host addresses was given a Class B address block of could reasonably show a need for more that 254 host addresses was given a Class B address block of 65533 host addresses. Even more wasteful were companies and organizations that were allocated Class 65533 host addresses. Even more wasteful were companies and organizations that were allocated Class A address blocks, which contain over 16 Million host addresses! Only a tiny percentage of the allocated A address blocks, which contain over 16 Million host addresses! Only a tiny percentage of the allocated Class A and Class B address space has ever been actually assigned to a host computer on the Internet. Class A and Class B address space has ever been actually assigned to a host computer on the Internet. People realized that addresses could be conserved if the class system was eliminated. By accurately People realized that addresses could be conserved if the class system was eliminated. By accurately allocating only the amount of address space that was actually needed, the address space crisis could be allocating only the amount of address space that was actually needed, the address space crisis could be avoided for many years. This was first proposed in 1992 as a scheme called

avoided for many years. This was first proposed in 1992 as a scheme called SupernettingSupernetting. Under. Under supernetting, the classful subnet masks are extended so that a network address and subnet mask could, supernetting, the classful subnet masks are extended so that a network address and subnet mask could, for example, specify multiple Class C subnets with one address. For example, If I needed about 1000 for example, specify multiple Class C subnets with one address. For example, If I needed about 1000 addresses, I could supernet 4 Class C networks together:

addresses, I could supernet 4 Class C networks together: 192.60.128.0

192.60.128.0 Class Class C C subnet subnet addressaddress 192.60.129.0

192.60.129.0 Class Class C C subnet subnet addressaddress 192.60.130.0

192.60.130.0 Class Class C C subnet subnet addressaddress 192.60.131.0

192.60.131.0 Class Class C C subnet subnet addressaddress

--- ---192.60.128.0

192.60.128.0 Supernetted Supernetted Subnet Subnet addressaddress 255.255.252.0

255.255.252.0 Subnet Subnet MaskMask 192.60.131.255

192.60.131.255 Broadcast Broadcast addressaddress

In this example, the subnet 192.60.128.0 includes all the addresses from 192.60.128.0 to In this example, the subnet 192.60.128.0 includes all the addresses from 192.60.128.0 to

192.60.131.255. The Network portion of the address is 22 bits long, and the host portion is 10 bits long. 192.60.131.255. The Network portion of the address is 22 bits long, and the host portion is 10 bits long.

(6)

Under CIDR, the subnet mask notation is reduced to a simplified shorthand. Instead of spelling out the Under CIDR, the subnet mask notation is reduced to a simplified shorthand. Instead of spelling out the bits of the subnet mask, it is simply listed as the number of 1s bits that start the mask. In the above bits of the subnet mask, it is simply listed as the number of 1s bits that start the mask. In the above example, the network address would be written simply as:

example, the network address would be written simply as: 192.60.128.0/22

192.60.128.0/22

which indicates starting address of the network, and number of 1s bits in the network portion of the which indicates starting address of the network, and number of 1s bits in the network portion of the address.

address.

It is currently almost impossible to be allocated IP address blocks. You will simply be told to get them from It is currently almost impossible to be allocated IP address blocks. You will simply be told to get them from your ISP. The reason for this is the ever-growing size of the Internet routing table. Just 5 years ago, there your ISP. The reason for this is the ever-growing size of the Internet routing table. Just 5 years ago, there were less than 5000 network routes in the entire Internet. Today, there are over 80,000. Using CIDR, were less than 5000 network routes in the entire Internet. Today, there are over 80,000. Using CIDR, ISPs are allocated large chunks of address space (usually with a subnet mask of /19 or even smaller); the ISPs are allocated large chunks of address space (usually with a subnet mask of /19 or even smaller); the ISP's customers are then allocated networks from the ISP's pool. That way, all the ISP's customers are ISP's customers are then allocated networks from the ISP's pool. That way, all the ISP's customers are accessible via 1 network route on the Internet. But I digress.

accessible via 1 network route on the Internet. But I digress.

It is expected that CIDR will keep the Internet happily in IP addresses for the next few years at least. After It is expected that CIDR will keep the Internet happily in IP addresses for the next few years at least. After that, IPv6, with 128 bit addresses, will be needed. Under IPv6, even sloppy address allocation would that, IPv6, with 128 bit addresses, will be needed. Under IPv6, even sloppy address allocation would comfortably allow a billion u

comfortably allow a billion u nique IP adnique IP addresses for every person on earth! The complete and gory detailsdresses for every person on earth! The complete and gory details of CIDR are documented in

of CIDR are documented in RFC1519RFC1519,, which was released in September of 1993.which was released in September of 1993.

Allowed Class A Subnet and Host IP addresses

Allowed Class A Subnet and Host IP addresses

#

# bbiittss SSuubbnneet t MMaasskk # # SSuubbnneettss # # HHoossttss NNeetts s * * HHoossttss 2 2 225555..119922..00..00 22 44119944330022 88338888660044 3 3 225555..222244..00..00 66 22009977115500 1122558822990000 4 4 225555..224400..00..00 1144 11004488557744 1144668800003366 5 5 225555..224488..00..00 3300 525244228866 1155772288558800 6 6 225555..225522..00..00 6622 262622114422 1166225522880044 7 7 225555..225544..00..00 112266 131311007700 1166551144882200 8 8 225555..225555..00..00 225544 6655553344 1166664455663366 9 9 225555..225555..112288..00 551100 3322776666 1166771100666600 1 100 225555..225555..119922..00 11002222 1166338822 1166774422440044 1 111 225555..225555..222244..00 22004466 88119900 1166775566774400 1 122 225555..225555..224400..00 44009944 44009944 1166776600883366 1 133 225555..225555..224488..00 88119900 22004466 1166775566774400 1 144 225555..225555..225522..00 1166338822 11002222 1166774422440044 1 155 225555..225555..225544..00 3322776666 551100 1166771100666600 1 166 225555..225555..225555..00 6655553344 225544 1166664455663366

(7)

1 177 225555..225555..225555..112288 113311007700 112266 1166551144882200 1 188 225555..225555..225555..119922 226622114422 6622 1166225522880044 1 199 225555..225555..225555..222244 552244228866 3300 1155772288558800 2 200 225555..225555..225555..224400 11004488557744 1144 1144668800003366 2 211 225555..225555..225555..224488 22009977115500 66 1122558822990000 2 222 225555..225555..225555..225522 41419944330022 22 88338888660044

Allowed Class B Subnet and Host IP addresses

Allowed Class B Subnet and Host IP addresses

#

# bbiittss SSuubbnneet t MMaasskk # # SSuubbnneettss # # HHoossttss NNeetts s * * HHoossttss 2 2 225555..225555..119922..00 22 1166338822 3322776644 3 3 225555..225555..222244..00 66 88119900 4499114400 4 4 225555..225555..224400..00 1414 44009944 5577331166 5 5 225555..225555..224488..00 3030 22004466 6611338800 6 6 225555..225555..225522..00 6262 11002222 6633336644 7 7 225555..225555..225544..00 121266 551100 6644226600 8 8 225555..225555..225555..00 252544 225544 6644551166 9 9 225555..225555..225555..112288 551100 112266 6644226600 1 100 225555..225555..225555..119922 11002222 6622 6633336644 1 111 225555..225555..225555..222244 22004466 3300 6611338800 1 122 225555..225555..225555..224400 44009944 1144 5577331166 1 133 225555..225555..225555..224488 88119900 66 4499114400 1 144 225555..225555..225555..225522 1166338822 22 3322776644

Allowed Class C Subnet and Host IP addresses

Allowed Class C Subnet and Host IP addresses

#

# bbiittss SSuubbnneet t MMaasskk # # SSuubbnneettss # # HHoossttss NNeetts s * * HHoossttss 2 2 225555..225555..225555..119922 22 6622 112244 3 3 225555..225555..225555..222244 66 3300 118800 4 4 225555..225555..225555..224400 1144 1144 119966

(8)

5 5 225555..225555..225555..224488 3300 66 118800 6 6 225555..225555..225555..225522 6622 22 112244

Logical Operations

Logical Operations

This page will provide a brief review and explanation of the common logical bitwise operations AND, OR, This page will provide a brief review and explanation of the common logical bitwise operations AND, OR, XOR and NOT. Logical operations are performed between two data bits (except for NOT). Bits can be XOR and NOT. Logical operations are performed between two data bits (except for NOT). Bits can be either "1" or "0", and these operations are essential to performing digital math operations.

either "1" or "0", and these operations are essential to performing digital math operations. In the "truth tables" below, the input bits are in

In the "truth tables" below, the input bits are in boldbold, and the results are plain., and the results are plain.

AND

AND

The logical AND operation compares 2 bits and if they are both "1", then the result is "1", otherwise, the The logical AND operation compares 2 bits and if they are both "1", then the result is "1", otherwise, the result is "0". result is "0". 0 0 11 0 0 00 00 1 1 00 11

OR

OR

The logical OR operation compares 2 bits and if either or both bits are "1", then the result is "1", The logical OR operation compares 2 bits and if either or both bits are "1", then the result is "1", otherwise, the result is "0".

otherwise, the result is "0". 0 0 11 0 0 00 11 1 1 11 11

XOR

XOR

The logical XOR (Exclusive OR) operation compares 2 bits and if exactly one of them is "1" (i.e., if they The logical XOR (Exclusive OR) operation compares 2 bits and if exactly one of them is "1" (i.e., if they are different values), then the result is "1"; otherwise (if the bits are the same), the result is "0".

are different values), then the result is "1"; otherwise (if the bits are the same), the result is "0". 0 0 11 0 0 00 11 1 1 11 00

(9)

NOT

NOT

The logical NOT operation simply changes the value of a single bit. If it is a "1", the result is "0"; if it is a The logical NOT operation simply changes the value of a single bit. If it is a "1", the result is "0"; if it is a "0", the result is "1". Note that this operation is different in that instead of comparing two bits, it is acting "0", the result is "1". Note that this operation is different in that instead of comparing two bits, it is acting on a single bit. on a single bit. 0 0 11 1 1 00

References and Sources on the Internet

References and Sources on the Internet

Requests for Comments (RFCs): Requests for Comments (RFCs):

• Overall RFC IndexOverall RFC Index •

• RFC 1918RFC 1918-- Address Allocation for Private InternetsAddress Allocation for Private Internets •

• RFC 1219RFC 1219-- On the Assignment of Subnet NumbersOn the Assignment of Subnet Numbers •

• RFC 950RFC 950- I- Internet standard subnetting procedurenternet standard subnetting procedure •

• RFC 940RFC 940- T- Toward an Internet standard scheme for subnettingoward an Internet standard scheme for subnetting •

• RFC 932RFC 932-- Subnetwork addressing schemeSubnetwork addressing scheme •

• RFC 917RFC 917-- Internet subnetsInternet subnets

Newsgroups of interest: Newsgroups of interest: • • comp.protocols.tcpipcomp.protocols.tcpip • • comp.protocols.tcpip.domainscomp.protocols.tcpip.domains Other Stuff: Other Stuff: • • InterNICInterNIC •

• Zen and the Art of the InternetZen and the Art of the Internet •

• Glossary of Internet TermsGlossary of Internet Terms

Tutorial Search:

Figure

Updating...

References