Sunteți pe pagina 1din 134

http://www.trainsignaltraining.

com/simplify-routing-how-to-organize-your-network-into-
smaller-subnets/2007-11-08/

Subnetting a Class C Address Using the Binary Method

We will use a Class C address which takes 5 bits from the Host field for subnetting and leaves 3 bits for
defining hosts as shown in figure 1 below. Having 5 bits available for defining subnets means that we can have
up to 32 (2^5) different subnets.

It should be noted that in the past using subnet zero (00000²) and all-ones subnet (11111²) was not allowed.
This is not true nowadays. Since Cisco IOS Software Release 12.0 the entire address space including all
possible subnets is explicitly allowed.

Let¶s use IP address 192.168.10.44 with subnet mask 255.255.255.248 or /29.

STEP 1: Convert to Binary

STEP 2: Calculate the Subnet Address

To calculate the Subnets IP Address you need to perform a bit-wise AND operation (1+1=1, 1+0 or 0+1 =0,
0+0=0) on the host IP address and subnet mask.

The result is the subnet address in which the host is situated.

Página ? de ? 
STEP 3: Find Host Range

We know already that for subnetting this Class C address we have borrowed 5 bits from the Host field. These 5
bits are used to identify the subnets. The remaining 3 bits are used for defining hosts within a particular subnet.

The Subnet address is identified by all 0 bits in the Host part of the address. The first host within the subnet is
identified by all 0s and a 1. The last host is identified by all 1s and a 0. The broadcast address is the all 1s. Now,
we move to the next subnet and the process is repeated the same way. The following diagram clearly illustrates
this process:

STEP 4: Calculate the Total Number of Subnets and Hosts Per Subnet

Página  de ? 
*nowing the number of Subnet and Host bits we can now calculate the total number of possible subnets and the
total number of hosts per subnet. We assume in our calculations that all-zeros and all-ones subnets can be used.
The following diagram illustrated the calculation steps.

Subnetting a Class C Address Using the Fast Way

Now let¶s see how we can subnet the same Class C address using a faster method. Let¶s again use the IP
address 192.168.10.44 with subnet mask 255.255.255.248 (/29). The steps to perform this task are the
following:

1.Y Total number of subnets: Using the subnet mask 255.255.255.248, number value 248 (11111000)
indicates that 5 bits are used to identify the subnet. To find the total number of subnets available simply
raise 2 to the power of 5 (2^5) and you will find that the result is 32 subnets.

Note that if subnet all-zeros is not used then we are left with 31 subnets and if also all-ones subnet is not
used then we finally have 30 subnets.
2.Y Hosts per subnet: 3 bits are left to identify the host therefore the total number of hosts per subnet is 2
to the power of 3 minus 2 (1 address for subnet address and another one for the broadcast
address)(2^3-2) which equals to 6 hosts per subnet.
3.Y Subnets, hosts and broadcast addresses per subnet: To find the valid subnets for this specific subnet
mask you have to subtract 248 from the value 256 (256-248=8) which is the first available subnet
address.

Actually the first available one is the subnet-zero which we explicitly note. Next subnet address is
8+8=16, next one is 16+8=24 and this goes on until we reach value 248. The following table provides
all the calculated information.

Note that our IP address (192.168.10.44) lies in subnet 192.168.10.40.


Página de ? 
Test Your Subnetting Knowledge and Practice, Practice, Practice!

Don¶t get discouraged if you didn¶t understand every little detail I went over in this article. Subnetting is not
really that difficult, but it does require a bit of practice.

Start with testing your knowledge of subnets and make sure you feel confident about this before you move on
to designing your own subnets. But remember, if you¶re on the Cisco Networking track you will have to deal
with subnetting sooner or later, so grab this opportunity and start testing yourself.

Go ahead and subnet the network address 192.168.10.0 address using the subnet mask 255.255.255.192 (/26).
Find the valid subnets, host ranges and broadcast addresses per subnet. If you want to double-check your
answer, feel free to leave me a comment and I will provide you with the correct solution.

Página  de ? 
x  
   


A few months back, I showed you how to organize your network into smaller subnets. My post covered the
details of the concept of subnetting.

So if you missed that article, I would suggest taking a look at it to make sure you understand VLSM and this
article in its entirety.

For now, I will assume that you are already familiar with subnetting and know how to divide a network into
smaller subnets.

In today¶s article, we¶ll subnet an already subnetted network into multiple subnets with variable subnet masks
and then allocate them within our sample network.

6ariable Length Subnet Mask (VLSM) is a key technology on large scalable networks. Mastering the concept
of VLSM is not an easy task, but it¶s well worth it. The importance of VLSM and its beneficial contribution to
networking design is unquestionable.

At the end of this article you will be able to understand the benefits of VLSM and describe the process of
calculating VLSMs. I will use a real world example to help you understand the whole process and its beneficial
effects.

The Benefits of 6LSM

VLSM provides the ability to subnet an already subnetted network address. The benefits that arise from this
behavior include:

{Y ‰  
     IP addresses are allocated according to the host space requirement of each
subnet.

IP addresses are not wasted; for example, a Class C network of 192.168.10.0 and a mask of 255.255.255.224
(/27) allows you to have eight subnets, each with 32 IP addresses (30 of which could be assigned to devices).
What if we had a few WAN links in our network (WAN links need only one IP address on each side, hence a total
of two IP addresses per WAN link are needed).

Without VLSM that would be impossible. With VLSM we can subnet one of the subnets, 192.168.10.32, into
smaller subnets with a mask of 255.255.255.252 (/30). This way we end up with eight subnets with only two
available hosts each that we could use on the WAN links.

The /30 subnets created are: 192.168.10.32/30, 192.168.10.36/30, 192.168.10.40/30, 192.168.10.44/30,


192.168.10.48/30, 192.168.10.52/30, 192.168.10.56/30 192.168.10.60/30.
{Y a


   
 VLSM supports hierarchical addressing design therefore, it can
effectively support route aggregation, also called route summarization.

The latter can successfully reduce the number of routes in a routing table by representing a range of network
subnets in a single summary address. For example subnets 192.168.10.0/24, 192.168.11.0/24 and
192.168.12.0/24 could all be summarized into 192.168.8.0/21.

Página  de ? 
Address Waste Without 6LSM

The following diagram shows a sample internetwork which uses a network C address 192.168.10.0 (/24)
subnetted into 8 equal size subnets (32 available IP addresses each) to be allocated to the various portions of the
network.

This specific network consists of 3 WAN links that are allocated a subnet address range each from the pool of
available subnets. Obviously 30 IP address are wasted (28 host addresses) since they are never going to be used
on the WAN links.

Implementing 6LSM

In order to be able to implement VLSMs in a quick and efficient way, you need to understand and memorize
the IP address blocks and available hosts for various subnet masks.

Create a small table with all of this information and use it to create your VLSM network. The following table
shows the block sizes used for subnetting a Class C subnet.

Página r de ? 
Having this table in front of you is very helpful. For example, if you have a subnet with 28 hosts then you can
easily see from the table that you will need a block size of 32. For a subnet of 40 hosts you will need a block
size of 64.

Example: Create a 6LSM Network

Let us use the sample network provided above to implement VLSM. According to the number of hosts in each
subnet, identify the addressing blocks required. You should end up with the following VLSM table for this
Class C network 192.168.10.0/24.

Take a deep breath « we¶re almost done. We have identified the necessary block sizes for our sample network.

The final step is to allocate the actual subnets to our design and construct our VLSM network. We will take into
account that subnet-zero can be used in our network design, therefore the following solution will really allow us
to save unnecessary addressing waste:

Página 3 de ? 
With VLSM we have occupied 140 addresses. Nearly half of the address space of the Class C network is saved.
The address space that remains unused is available for any future expansion.

Isn¶t that amazing? We have reserved a great amount of addresses for future use. Our sample network diagram
is finalized as shown on the following diagram:

Página J de ? 
Final Thoughts

Variable Length Subnet Mask is an extremely important chapter in Network Design. Honestly, if you want to
design and implement scalable and efficient networks, you should definitely learn how to design and implement
VLSM.

It¶s not that difficult once you understand the process of block sizes and the way to allocate them within your
design. Don¶t forget that VLSM relates directly to the subnetting process, therefore mastering the subnetting
process is a prerequisite for effectively implementing VLSM.

And feel free to go through my subnetting articles a couple of times to get a hang of the whole process.

Página [ de ? 
£   
  
  £  £  

I wrote this article with the invasion of IP services in our daily life in mind. Think about it ² the electronics
you use every day: your computer, your TV, your home phone, your mobile phone ² all possess an IP address.
Our world would not be the same without the Internet Protocol.

But do you know what it is? Why it is needed? How it is structured? If you answered no to at least one of these
questions, keep reading ² all of this and more will be explained in this article.

And in my next article, Part 2 of this mini-series, I will go even further and explain the process of IP routing
by showing you step-by-step what happens when two hosts need to communicate between each other. But first
let¶s take a look at what¶s required before communication can occur ² the IP address and the different IP
network classes.

The IP Necessity

To get a clear understanding of why we need this P  called IP address, I¶ll use an example from daily life.
Imagine that you need to send some mail to Train Signal Inc. What you need is Train Signal¶s country, street
name, and number.

The IP address structure is similar to the mail system architecture. There is a specific part in the IP header that
identifies the country part of the address. A separate field identifies the postal code and street name within
the country and another one identifies the actual mail box and name of a particular host.

All these fields of course, have special names of their own in the ³IP world.´ The table below shows the
analogy between IP addressing structure and mail system architecture:

Imagine if every router in the Internet had to know the IP addresses of every host around the world ² this
would be extremely inefficient. That is why the 2 or 3 level hierarchical addressing scheme is efficient, because
each router along the path reads and matches only the hierarchical part of the IP address that it needs to know
about.

Only the router closest to the destination host will need to match the whole network-subnet-host address and
physically identify the host in a subnet (identify the street number). That is where the MAC address takes
action. The latter has only local meaning, in the sense that it identifies hosts within a given subnet (street).

The combination of the virtual addressing scheme (IP address) and physical addressing scheme (MAC address)
ensures reliable delivery of messages to their destination.

The IP Structure

An IP address consists of 4-bytes of data. A byte consists of 8 bits (a bit is a single digit and it could only be
either a 1 or 0), therefore we have a total of 32 bits for each IP address. The IP address is presented in a dotted
Página ? de ? 
decimal formation, where each byte is seen as a separate section with a full-stop dividing each section. The
same IP address can be represented using one of these three methods:

{Y ½  11000000. 10101000. 00001010.00000010


{Y 0   C0.A8.0A.02
{Y ·  192.168.10.2

To simplify things, the decimal representation is usually used.

Network Addressing

Now that we¶ve gone over the hierarchical addressing scheme, let¶s take a look at the network and host parts
and how a network class determines their location in the IP address field.

Class A Network

In a class A network the first byte of the address identifies the network part and the remaining three bytes
identify the host part. The format is:

Class A network addresses are one byte long with the first bit of the byte being set permanently to zero.
Therefore, the first Class A network that can be created is the 00000000 network. Actually this network cannot
be used because it is reserved to designate the default route.

The last Class A network that can be defined is 01111111 (127 decimal). And guess what, this network cannot
be used either because it¶s reserved for testing purposes. Therefore, we are left with 126 (128-2) available
networks.

The remaining three bytes can be used to identify hosts. The actual maximum number of usable hosts is
16777214. When you see an IP address that starts from 1 and goes up to 126, then you will know that it¶s a
Class A address.

Class B Network

In Class B networks, the first bit of the first byte must always be 1 and the second bit must always be 0.
Therefore the range for a Class B network in binary notation is:

{Y 10000000 up to 10111111

Class B networks use two bytes for the network part and two for the host part which leads to a total of 16384
Class B networks with a maximum of 65535 hosts per network. The format of a Class B network is:

Página ?? de ? 
When you see an IP address that starts from 128 and goes up to 191, then you will know that is a Class B
address.

Class C Network

In Class C networks we have the first two bits of the first byte permanently set to 11 and the third bit set to 0.
Therefore, the range for a Class B network in binary notation is:

{Y 11000000 up to 11011111

Class C networks use three bytes for the network part and one for the host part which leads to a total of
2097152 Class C networks with a maximum of 254 hosts per network. The format of a Class C network is:

When you see an IP address that starts from 192 and goes up to 223, then you will know that is a Class C
address.

Classes D and E

Class D addresses start from 224 until 239. These addresses are defined as multicast addresses whereas Class E
addresses are used only for scientific purposes. The latter cover the starting range from 240 until 255.

Special Purpose Addresses

Some IP addresses are reserved to serve certain purposes and they cannot be assigned to hosts. These special
purpose addresses include:

{Y IP address 127.0.0.1 Ͷ reserved for loopback tests.


{Y Node address of all 0s Ͷ used to identify the network address.
{Y Node address of all 1s Ͷ used to identify the broadcast address within a network (intended for all the hosts in
the network).
{Y IP address 0.0.0.0 Ͷ used to designate the default route.
{Y IP address 255.255.255.255 Ͷ used for broadcast to all hosts

Página ? de ? 
Private IP Addresses

A range of IP addresses has been reserved for use within a LAN for conservation purposes. The ranges of
private IP addresses that can be used in the Local network and cannot be routed to the internet are the
following:

{Y 10.0.0.0 10.255.255.255
{Y 172.16.0.0 172.31.255.255
{Y 192.168.0.0 192.168.255.255

If you¶re interested in this topic, you can find the details about the usage of these private addresses in
conjunction with Network Address Translation (NAT) functionality in one of my previous posts: Learn About
Scaling IP addresses with NAT and PAT

Summary

I hope this article has been helpful! Now you can identify the different network classes and classify IP
addresses within each class. The following table is sort of a cheat sheet, and it will help you remember how to
do it all:

Página ? de ? 
http://www.texbuddy.com/network_design1_free.html


·   
In the Cisco CCNA exam, IP addressing and subnetting questions can be difficult and
confusing. However, don¶t let that dicurrege you from studying this part of the CCNA exam,
as it an important piece of knowledge you will need at work. In this article we will illustrate in
details how to derive the subnet addres, broadcast address and IP host range for a tipical
network design question from the CCNA exam.

Want more examples? For compelet detailed illustration of all CCNA exam topics, visit our
CCNA Study Guide home page and check out our complete CCNA Quick Reference Chart.

´uestion:
For a given IP address 172.16.10.22 and mask 255.255.255.240, answer the following:

1.Y What is the subnet IP address?


2.Y What is the broadcast IP address?
3.Y What is a valid range for a hosts IP addresses?

Answer:
Don¶t let the given IP addres confuse you, it is simply one of the hosts IP Addresses of this
subnet. Later on, we will find the whole range of host IP addresses for this subnet.

Step1: Line up and convert the given IP address and mask to binary, see section A and B,
Note: The first Octet if the given IP address indicate it is a class B
address; we know that in class B mask, the first two octets are set to 1.
Therefore we conclude that the bits of the third octet and bit number 7, 6,
5 and 4 of the fourth octet are borrowed from the host portion of this class
C address to be used for subnetting, see section A.
Step 2: Turn OFF all the host bits (set them to 0) to get the subnet IP address, see section C.

Step 3: Turn ON all the host bits (set them to 1) to get the broadcast IP address, see section D.

Step 4: The valid host IP address range is the list of IP addresses between the subnet address
and the broadcast address. See section E.
Note: The given IP address (172.16.10.22) falls within the host range we
found in Step 4.

Página ? de ? 
Página ? de ? 
http://www.softsession.com/resource/ref2.htm

£  
  
x£  


1.Y Who is this for?

People who will be building networks. If you're a manager you can go to sleep now; if you know this stuff already,
take a pizza break; if you want to actually build networks some day and are not already comfortable working out
appropriate sizes of subnets, please come to the front of the lecture hall - I have a few copies of this lesson but not
enough for everyone in the room.

2.Y Purpose of this lesson

Some day you may be responsible for designing a network that connects several locations together with routers.
You'll have been given a certain number of IP addresses you can use, andyou have to allocate them in chunks to
each site without running out!

The reason we are going to learn subnetting is simple: there are not enough IP addresses free for you to give a
whole Class C network to every site you manage. Some upstream providers charge you for each Class C you
allocate. Others force you to justify your use of space in detail, showing that each network you allocated was fully
populated.

Before we go into details, there are two things you might be able to use which will avoid the need to learn any of
this stuff:

1.Y NAT - network address translation


If it is available to you, NAT often lets you create any size of network you want, without worrying about
how much IP space you have been officially allocated. I'm not going to explain what NAT is in detail,
because it will be covered in someone else's lesson. In short, it's a way to map large numbers of IPs on
to a single IP (or to take a large sparse range such as a Class B and map each address that is actually
used on to a small number of Class C's). NAT is worth taking the time to learn, because it can save you a
whole lot of effort!
2.Y Online tools to calculate subnets
There are many web pages available that will calculate netmasks for given sizes of subnets. These are
useful as long as you understand the basics of what you're trying to do. If you don't have 'the big
picture', these tools won't help. You can listen to this lecture to get 'the big picture' without getting
distracted by the details, then use one of the online tools when you need actual numbers.

3.Y IP address space in general - inference of Class A/B/C

Before we start - a quick and very basic recap on IP addressing in general.


Every machine on the net has an address. Addresses are 32 bits. These 32 bits are split into two parts - a network
number followed by a host address. The 'host address' part is for a number of machines on one physical network-
say a bunch of machines connected with a hub or on a single thin ether wire. The network number represents this
group of hosts as a single unit, and routers need to know these network numbers to send data from one net to
another.
Just where the network/host split is made is arbitrary. There's no real reason why 10.1.2.3 should be part of a class
A network and 220.1.2.3 is part of a class C network - it just is. The address space was split up as shown below, and
any addresses in these ranges are deemed to be in the appropriate Class. Why does this matter? Well, some
software will ask for an IP address but NOT a netmask - and it will infer a netmask from the address. This is OK as
long as you are staying within the class system, but if you are subnetting or supernetting, it can cause you a lot of
trouble.

There's actually very little difference between a Class C network, and a Class B network with a 255.255.255.0
Página ?r de ? 
netmask applied. (The only time they're different is if the network address is of the form X.X.0.X or X.X.255.X)

Before you start designing your subnets, you should know what it is that you've been given. Here are three ways of
finding out what class your allocation is in. Use whichever you find easiest.

6Y x  addresses begin with , or ?


?r decimal. (127 is loopback)
6Y x ½ addresses begin with ?, or ?J
?[? decimal.
6Y x x addresses begin with ??, or ?[
 decimal.
6Y x · addresses begin with ???, or 
 [ decimal. (a.k.a multicast - you'll probably never see
these)
6Y x ‰ addresses begin with ????, or 
 decimal. (or these)

6Y If the first bit is 0 it is a Class A address


6Y If the first two bits are 10 it is a Class B address
6Y If the first three bits are 110 it is a Class C address
6Y If the first four bits are 1110 it is a Class D multicast address
6Y If the first four bits are 1111 it is a Class E experimental address

First Byte Class Network Mask (explained later)


1-126 "A" 255.0.0.0
128-191 "B" 255.255.0.0
192-223 "C" 255.255.255.0

In all the examples below we will assume we have been allocated a Class C network to work with:
192.168.1.0

192.168.1.0 is actually a special type of Class C address - it's one that is reserved never to be allocated
on the real Internet. So we'll use it in our examples because if you do configure a network using these
numbers, you won't mess anybody else up. It's amazing the number of people who create internal
networks using real IP addresses chosen at random. If you ever connect one of these networks to the
internet, you will not be to route because the space belongs to someone else. If you disguise your
addresses using NAT, you'll still not be able to access those parts of the net that legitimately use those
addresses.

Doing subnet calculations for Class A and Class B networks works just the same way as the Class C
examples we are going to cover. If you can do a Class C from first principles, you'll be able to do Class
B's in your sleep. Very few people here will get much opportunity to design Class A or Class B subnets,
but you are quite likely to be asked to work on existing Class A or B networks, so it's still worth
knowing.

Y What is Broadcast?

I assume you know what a broadcast address is - the necessity to handle broadcasts is actually what makes subnetting
anything less than trivial: if you have a Class C network such as 192.168.1.* (with station addresses 192.168.1.1,
192.168.1.2 etc), then a packet addressed to 192.168.1.255 will be sent to *every* station on that network. Later we'll
discover that sending to 192.168.1.0 is sort of something similar. Or was once, anyway.

In a Class C, the host part set to 255 means broadcast. In a subnet, the subnet host part set to all ones means broadcast.
Eg in a /28, any addresses of the form N.N.N.XXXX1111 are broadcast addresses for their subnets only.
Página ?3 de ? 
Y Don't I need to know how to do binary arithmetic?

Forgetaboutit. If you can't do binary math in your head, just use the data in these tables below. (On the other hand, if
you can't do binary in your head by now, you probably shouldn't be looking at a career in networking.)

Y Subnetting Class C - most typical example: /28 "all zeroes, all ones" excluded. Mask is 11110000

This table may be all you ever need to know, for many installations. This is a typical example and possibly the most
common one. Because it is such a useful table, this is the only large one we will list in full.

Broadcast
Network part Subnet.host Host addresses
Address
192.168.1.15 -
192.168.1.1 to UNUSABLE -
192.168.1.0 0000xxxx
192.168.1.14 NETMASK ALL
0000's
192.168.1.17
192.168.1.16 0001xxxx to 192.168.1.31
192.168.1.30
192.168.1.33
192.168.1.32 0010xxxx to 192.168.1.47
192.168.1.46
192.168.1.49
192.168.1.48 0011xxxx to 192.168.1.63
192.168.1.62
192.168.1.65
192.168.1.64 0100xxxx to 192.168.1.79
192.168.1.78
192.168.1.81
192.168.1.80 0101xxxx to 192.168.1.95
192.168.1.94
192.168.1.97
192.168.1.96 0110xxxx to 192.168.1.111
192.168.1.110
192.168.1.113
192.168.1.112 0111xxxx to 192.168.1.127
192.168.1.126
192.168.1.129
192.168.1.128 1000xxxx to 192.168.1.143
192.168.1.142
192.168.1.145
192.168.1.144 1001xxxx to 192.168.1.159
192.168.1.158
192.168.1.161
192.168.1.160 1010xxxx to 192.168.1.175
192.168.1.174
192.168.1.177
192.168.1.176 1011xxxx to 192.168.1.191
192.168.1.190

Página ?J de ? 
192.168.1.193
192.168.1.192 1100xxxx to 192.168.1.207
192.168.1.206
192.168.1.209
192.168.1.208 1101xxxx to 192.168.1.223
192.168.1.222
192.168.1.225
192.168.1.224 1110xxxx to 192.168.1.239
192.168.1.238
192.168.1.255 -
192.168.1.241
UNUSABLE -
192.168.1.240 1111xxxx to
NETMASK ALL
192.168.1.254
1111's

Y 0's/1's restriction on host part: let's take one subnet from the table above:

Network Broadcast
Subnet.host Host addresses
part Address
192.168.1.33 to
192.168.1.32 0010xxxx 192.168.1.47
192.168.1.46

Now, let's look at the individual hosts within that subnet:

Network part Subnet . Host part Host Address


192.168.1.32 0010.0000 UNUSABLE - HOST PART IS ALL 0's
192.168.1.33 0010.0001
192.168.1.34 0010.0010
192.168.1.35 0010.0011
192.168.1.36 0010.0100
192.168.1.37 0010.0101
192.168.1.38 0010.0110
192.168.1.39 0010.0111
192.168.1.40 0010.1000
192.168.1.41 0010.1001
192.168.1.42 0010.1010
192.168.1.43 0010.1011
192.168.1.44 0010.1100
192.168.1.45 0010.1101
192.168.1.46 0010.1110
192.168.1.47 0010.1111 UNUSABLE - HOST PART IS ALL 1's

Although you may be familiar with the all ones broadcast addresses (typically x.x.x.255 for a Class C network) you
may not realise that at some time in the past x.x.x.0 was also used as a broadcast address. Although this seldom is
Página ?[ de ? 
done nowadays, for historical reasons we still obey this convention. (The last machine I owned that actually used
the .0 address for broadcast was a Sun from the late 1980's)

Note what happens as the room for hosts gets smaller:

This is the host table for a /30:

Network part Subnet . Host part Host Address


192.168.1.32 001000.00 UNUSABLE - HOST PART IS ALL 0's
192.168.1.33 001001.01
192.168.1.34 001010.10
192.168.1.35 001011.11 UNUSABLE - HOST PART IS ALL 1's

A /30 is particularly wasteful - 50% of the hosts are unusable. Similarly, a /26 is pretty bad, because 50% of the
nets are unusable. a /28 is best because it lets you have (16 - 2) * (16 - 2) = 192 hosts.

This would be the host table if a /31, if it existed:

Network part Subnet . Host part Host Address


192.168.1.32 0010000.0 UNUSABLE - HOST PART IS ALL 0's
192.168.1.33 0010000.1 UNUSABLE - HOST PART IS ALL 1's

What's wrong with this picture??? Well, you can't have a /31. Here's why...

Y We can have subnets of /26,/27,/28,/29,/30 - BUT NOT /25 or /31!

This is a /30 (with sections removed for brevity):


Mask is 11111100

Network part Subnet.host Host addresses Broadcast Address


192.168.1.3 -
192.168.1.1 to
192.168.1.0 000000xx UNUSABLE - NETMASK
192.168.1.2
ALL 000000's
192.168.1.5 to
192.168.1.4 000001xx 192.168.1.7
192.168.1.6
192.168.1.9 to
192.168.1.8 000010xx 192.168.1.11
192.168.1.10
192.168.1.13 to
192.168.1.12 000011xx 192.168.1.15
192.168.1.14
192.168.1.17 to
192.168.1.16 000100xx 192.168.1.19
192.168.1.18
192.168.1.21 to
192.168.1.20 000101xx 192.168.1.23
192.168.1.22
192.168.1.24 -
... .............................. .............
244
192.168.1.249 to
192.168.1.248 111110xx 192.168.1.251
192.168.1.250

Página  de ? 
192.168.1.255 -
192.168.1.253 to
192.168.1.252 111111xx UNUSABLE - NETMASK
192.168.1.254
ALL 111111's

Y So why not a /25????

Network part Subnet.host Host addresses Broadcast Address


192.168.1.127 -
192.168.1.1 to
192.168.1.0 0xxxxxxx UNUSABLE - NETMASK
192.168.1.126
ALL 0's
192.168.1.255 -
192.168.1.129 to
192.168.1.128 1xxxxxxx UNUSABLE - NETMASK
192.168.1.254
ALL 1's

When the netmask is only one bit, it can't help but being all zeroes or all ones.

Y And why not a /31?

Broadcast
Network part Subnet.host Host addresses Addresses (0's and
1's)
192.168.1.0 -
UNUSABLE -
192.168.1.0? to NETMASK 000000's
192.168.1.0 0000000x
192.168.1.1? 192.168.1.1 -
UNUSABLE -
NETMASK 000000's
192.168.1.2 -
UNUSABLE -
192.168.1.2? to Broadcast 0's
192.168.1.2 0000001x
192.168.1.3? 192.168.1.3 -
UNUSABLE -
Broadcast 1's
192.168.1.4 - .............
... ..............................
250 .............
192.168.1.252 -
UNUSABLE -
192.168.1.252 to Broadcast 0's
192.168.1.252 1111110x
192.168.1.253 192.168.1.253 -
UNUSABLE -
Broadcast 1's
192.168.1.254
UNUSABLE -
192.168.1.254 to NETMASK 111111's
192.168.1.254 1111111x
192.168.1.255 192.168.1.255
UNUSABLE -
NETMASK 111111's

Página ? de ? 
Y Variable subnetting example 1 (insert /30 into /28 from above)

Well, in the /28 example above, we've shown that the first and last subnets are unusable, because the subnet mask is
either all 0's or all 1's. This is unfortunate because each of those subnets is losing 16 (-2) IP addresses each.

Is there any way we can get back some of those addresses? Well, yes - there is. If you look at the example of a /30
subnet, you'll see these entries:

Broadcast
Network part Subnet.host Host addresses
Address
192.168.1.3 -
192.168.1.1 to UNUSABLE -
192.168.1.0 000000xx
192.168.1.2 NETMASK ALL
000000's
192.168.1.5 to
192.168.1.4 000001xx 192.168.1.7
192.168.1.6
192.168.1.9 to
192.168.1.8 000010xx 192.168.1.11
192.168.1.10
192.168.1.13 to
192.168.1.12 000011xx 192.168.1.15
192.168.1.14
192.168.1.16
... .............................. .............
- 252

Apart from the first one, these are all perfectly valid subnets, and if we were to configure machines using them,
they will look just like normal addresses in a /30 subnet. We can do exactly the same thing for the 192.168.1.240-
255 addresses.

These small subnets - they only have 2 IP addresses that are usable - are actually just what you need when you are
setting up a point to point link between different subnets (in different locations). So by using the 'slop' at the end
of the range, you can get your point to point links for free.

Y Variable subnetting example 2 (insert /28 from above into /26)

Here we have a different and possibly more useful example of variable subnetting. Let's say we have a central office
with 50 workstations, one remote office with 10, and another remote office with 9 workstations.

The following table tells you how many workstations and how many offices you can have for each size of subnet mask:

Max Useable
# C IPs/Subnet
Bit Subnet Block Subnets
(number of
Split Mask Size (number of
workstations)
office

2/6 192 (/26) 64 2 62

3/5 224 (/27) 32 6 30

4/4 240 (/28) 16 14 14

5/3 248 (/29) 8 30 6

6/2 252 (/30) 4 62 2

Página  de ? 
You see, with one office of size 50, we're forced with a simple subnet scheme to use a /26 (2 bits subnet, 6 bits
host). However, we have three offices, so this won't work.
With offices of size 9 or 10 (which we round up to 16 - 2), we could use a /28 (16 - 2 subnets of 16 - 2 stations) -
but then we couldn't fit in our 50 station office.

Well, the solution is simple: Treat it as a /26, allocate the large office, then extract from a table of /28's enough
smaller subnets to fit in the one remaining /26 slot. Like this:

Network part Subnet.host Host addresses Broadcast Address


192.168.1.1 to 192.168.1.63 UNUSABLE -
192.168.1.0 00xxxxxx
192.168.1.62 NETMASK ALL 00's
192.168.1.127 ALLOCATE
192.168.1.65 to
192.168.1.64 01xxxxxx THIS TO BE FURTHER
192.168.1.126
SUBNETTED
192.168.1.191 ALLOCATE
192.168.1.129 to
192.168.1.128 10xxxxxx THIS ONE TO THE 50-
192.168.1.190
STATION OFFICE
192.168.1.193 to 192.168.1.255 UNUSABLE
192.168.1.192 11xxxxxx
192.168.1.254 - NETMASK ALL 11's

(note: with a simple /26, you lose HALF of your potential IP addresses to the broadcast network addresses)

And guess what ... if we look at the earlier table for a /28, you'll find exactly the section we need to extract and fit
in here:
192.168.1.63

Broadcast
Network part Subnet.host Host addresses
Address
192.168.1.65 to
192.168.1.64 0100xxxx 192.168.1.79
192.168.1.78
192.168.1.81 to
192.168.1.80 0101xxxx 192.168.1.95
192.168.1.94
192.168.1.97 to
192.168.1.96 0110xxxx 192.168.1.111
192.168.1.110
192.168.1.113 to
192.168.1.112 0111xxxx 192.168.1.127
192.168.1.126

Now we simply put the two tables together, and we have a variable subnet solution for our three offices. Plus
some spares!

Network part Subnet.host Host addresses Broadcast Address


192.168.1.1 to 192.168.1.63 UNUSABLE -
192.168.1.0 00xxxxxx
192.168.1.62 NETMASK ALL 00's
192.168.1.64 0100xxxx 192.168.1.65 to 192.168.1.79 ALLOCATE

Página  de ? 
192.168.1.78 THIS TO THE 10-PC OFFICE
192.168.1.81 to 192.168.1.95 ALLOCATE
192.168.1.80 0101xxxx
192.168.1.94 THIS TO THE 9-PC OFFICE
192.168.1.97 to
192.168.1.96 0110xxxx 192.168.1.111 SPARE
192.168.1.110
192.168.1.113 to
192.168.1.112 0111xxxx 192.168.1.127 SPARE
192.168.1.126
192.168.1.191 ALLOCATE
192.168.1.129 to
192.168.1.128 10xxxxxx THIS ONE TO THE 50-
192.168.1.190
STATION OFFICE
192.168.1.193 to 192.168.1.255 UNUSABLE
192.168.1.192 11xxxxxx
192.168.1.254 - NETMASK ALL 11's

and don't forget the trick of grabbing the end IP's for the point to point networks to link these offices together.

Y Preference to finer resolution routes - don't need to fully enumerate

Let's say you have variably subnetted a network, and of the 30 subnets available, 29 of them are in one office, but the
30th is in the other. To route this properly you would issue 29 routing commands to one address and 1 to the other. This
is wasteful of router table space. The thing to do is to issue ONE router command that covers all 30 subnets and send
them to the one office, but issue a second router command which is MORE SPECIFIC to extract that one subnet from the
block, and route it elsewhere. More specific routes take precedence in most routers. Occasionally you will find some
brand of router which does require non-overlapping routes, and if this happens to you, just issue all 30 explicit
commands.

Y "Supernetting", aka CIDR (Classless InterDomain Routing)

The world has a big problem with too many route table entries in the big backbone routers. To solve that problem,
people realised they could aggregate network routing commands, eg a network 192.168.2.0/24 and a neighboring
network 192.168.3.0/24 could be represented by merging them like this: 192.168.2.0/23

This would be fine, except we know the problems of subnetting and all-zeroes and all-ones masks. The same problems
would start showing up here. The solution is simple: someone just issued an edict saying "forget everything you learned,
we won't bother with those rules any more". There's even a command to tell the routers themselves that they should
ignore the rules - "Ê  "
When you break the rules like this, and allow netmasks that end in all 0's or all 1's, it's called "CIDR" - Classless
InterDomain Routing.

That's really all you need to know about CIDR. It's trivial, it's easy, and the details work just the same as subnetting but
you merge up instead of splitting down.

Y Calculators

Once you understand subnetting as described above, you'll probably be able to do it in your head. However sometimes
you want to check your work, or are in a hurry, and if so, there are many web pages on the net which offer "subnet
calculator"s.
Just be warned - often they do not check for the special conditions such as all-one's subnets, and will let you do
something stupid like ask for a /25 subnet. The one referred to below does appear to make an effort at checking for this
sort of thing, so it may be a good one to bookmark.

Y Final test :-)

Página  de ? 
You are a sys admin at a small ISP. You asked your upstream vendor for a /19 allocation (equivalent to 32 Class C
networks). You were given the following: 167.114.209.0 through 167.114.240.0.

Will these do what you want?

Página  de ? 
http://www.svrops.com/svrops/documents/subnetshortcut.htm
Subnetting Shortcuts

Class C

200.4.5.0 Borrow 3 bits Subnet Mask = 255.255.255.224

Number of networks created 23 = 8


Number of useable networks created 23 = 8 ± 2 = 6

Number of host per network 2 5 = 32


Number of useable host per network 2 5 = 32 ± 2 = 30

The increment for each network is 32

If you need to determine the network number of subnet 6,


multiply 6 X 32 = 192.
The subnet 6 network address would be 200.4.5.192

In simple terms, multiply the increment by the number of the subnet


you wish to find.

x ss B ± borrowing in the 3 rd octet

150.4.0.0 Borrow 3 bits Subnet Mask = 255.255.224.0

Number of networks created 23 = 8


Number of useable networks created 23 = 8 ± 2 = 6

Number of host per network 2 5 X 256 = 8192

The increment for each network is 32 in the 3rd octet


(the number of unmasked bits in the 3 rd octet is 5, this is
the octet we borrowed from)

If you need to determine the network number of subnet 6,


multiply 6 X 32 = 192.
The subnet 6 network address would be 150.4.192.0

If you are borrowing in the 3 rd octet, just ignore the 4 th


octet to determine your network numbers.

Página r de ? 
x ss B ± borrowing  the 3 rd octet

150.4.0.0 Borrow 8 bits Subnet Mask = 255.255.255.0

Number of networks created 28 = 256


Number of useable networks created 28 = 256 ± 2 = 254

Number of host per network 2 0 X 256 = 256

The increment for each network is 256 in the 3 rd octet.


(The number of unmasked bits in the 3 rd octet is 0, this is
the octet we borrowed from.
This means that the value of the 3rd octet increases by one each time.)

If you need to determine the network number of subnet 26, simply


insert that number into the 3rd octet slot.
The subnet 26 network address would be 150.4.26.0

If you need to determine the network number of subnet 100, simply


insert that number into the 3 rd octet slot.
The subnet 100 network address would be 150.4.100.0


x ss B ± borrowing in the 4 th octet

150.4.0.0 Borrow 11 bits Subnet Mask = 255.255.255.224

Number of networks created 211 = 2048 (or 23 X 256 = 2048)

Number of useable networks created 211 = 2048 ± 2 = 2046

Number of host per network 2 5 = 32

The increment for each network is 32 in the 4 th octet.


(The number of masked bits in the 4 th octet is 3, the number of
unmasked bits in the 4th octet is 5, this is the last octet we borrowed from.
This means that the value of the 4th octet increases by the increment value.)

If you need to determine the network number of subnet 325, do the fo owing:

Divide the desired subnet by 2 raised to the masked bits in the 4 th octet

Página 3 de ? 
325 / 23 or 325 / 8 = 40 remainder 5

The 40 is the value of the 3 rd octet -- 150.4.40.?

To find the value of the 4 th octet multiply the remainder (5) times the increment (32)

32 X 5 = 160 This is the value of the 4th octet

The subnet 325 network address would be 150.4.40.160

--------------------------------------------------------------------------------

If you need to determine the network number of subnet 40, do the following:

Divide the desired subnet by 2 raised to the masked bits in the 4 th octet

40 / 23 or 40 / 8 = 5 remainder 0

The 5 is the value of the 3rd octet -- 150.4.5.?

To find the value of the 4 th octet multiply the remainder (0) times the increment (32)

32 X 0 = 0 This is the value of the 4th octet

The subnet 40 network address would be 150.4.5.0

Another Method

x ss B ± borrowing in the 4 th octet

150.4.0.0 Borrow 11 bits Subnet Mask = 255.255.255.224

Number of networks created 211 = 2048 (or 23 X 256 = 2048)

Number of useable networks created 211 = 2048 ± 2 = 2046

Number of host per network 25 = 32

The increment for each network is 32 in the 4 th octet. (The number of


masked bits in the 4th octet is 3, the number of unmasked bits in the
4th octet is 5, this is the last octet we borrowed from.
This means that the value of the 4th octet increases by the increment value.)

Página J de ? 
Another wy to determine the Network Number of  Subnet:

Página [ de ? 
http://www.itdojo.com/blog/2009/02/let-me-take-a-stab-at-this-ip-subnet-zero-thing/

Let me take a stab at this ͚ip subnet-zero͛ thing

Subnetting. A simple thing that fills many with dread. The swirl of numbers flying about when discussing
subnetted networks can make your head respond in kind. If subnetting wasn¶t challenging enough we have
long dealt with this thing, this ¶subnet-zero¶ thing. Discussion on the topic (this post included) lingers for some
unknown reason. It vexes me. I even read a recent post (written about a month ago) that suggested NOT using
it was still a viable concept. At the risk of taunting the author I shall refrain from links to that post. I can¶t tell
you how much I disagree with such a statement. Well, scratch that. I actually can tell you how much I
disagree. Please enjoy:

First, a review: What is µip subnet-zero¶?

It¶s a command you enter into a Cisco router (or L3 switch), actually. From global configuration mode you
have two choices: ip subnet-zero or no ip subnet-zero. If you want to use this thing we call subnet zero you
enter the former. If you don¶t want to use it, enter the latter. And I don¶t understand you if you don¶t want to
use it. Cisco doesn¶t either. They have been telling you for a long time that you should be using it. The
command has been enabled by default since IOS 12.0 which has been out for the better part of a decade. To
stop using it you would have to intentionally go into the router and disable it (e.g. no ip subnet-zero). And who
are you to disable a Cisco default? Hmmph. I thought so.

So it¶s a command. Cool. But what does it actually do? In simple terms the command controls whether or not
the all zeroes and all ones subnets are valid. Easy enough to say but it¶s a little more involved to understand.
Let me explain by way of example. Here is an example of a simple subnetting problem that uses subnet zero
(and yes, I¶m assuming you already have a little bit of subnetting skill):

In this example we take the 192.168.44.0/24 network and subnet it by 4 bits, dividing it into 16 networks. If
we look at the newly created networks a little more closely we will see something interesting. Using the image
below, notice that the first network has all of the subnet bits set to zero. Also notice that the last network has all
of the subnets bits set to one. We call the network with the subnet bits set to zero the ³all zeroes subnet´. We

Página  de ? 
call the network with the subnet bits set to one the ³all one¶s subnet´. Pretty clever names, I know.
Collectively we refer to both of them as subnet-zero. Yeah, that makes sense? Deal with the weirdness.

Subnetting with IP Subnet -Zero

Two things you need to notice:

First: To the user, the all zeroes subnet looks alamringly like the original network. The original network was
192.168.44.0/24. The all zeroes subnet is 192.168.44.0/28. Does that creep you out?

Second: The all one¶s subnet has a decimal value equal to the subnet mask value in the last octet AND the
broadcast address of the all zero¶s subnet is 192.168.44.255 which is identical to the broadcast address of the
original network (192.168.44.0/24). How about that? Feeling spiders crawling up your legs?

What¶s my point?

Página ? de ? 
First: People got confused by the striking similarity between 192.168.44.0/24 and 192.168.44.0/28. Let me
restate that in case you didn¶t catch it. c  got confused by« (never mind the rest, it doesn¶t matter). The
important word, in case you missed the italics, is PEOPLE. Computers, routers and other network devices
were NEVER confused by the apparent similarity. To the computer, a device which thinks only in binary,
192.168.44.0/24 is just as similar to 192.168.44.0/28 as 11.12.0.0/14 is. The difference is plain to see for the
computer. The same can¶t be said for the fragile mental stability of the network administrator. Because people
were confused the decision was made long ago to simply throw out the all zeroes subnet. Just don¶t use it.
Problem solved! Outta¶ sight, outta¶ mind! The word lame comes to mind. How, in this world of IP address
space exhaustion, can you even begin to condone throwing away a perfectly good network for the sole purpose
of preventing confusion with the network administrators? Uh, you can¶t. Your network people need to get over
it. Suck it up, use the addresses. ³Waste is a thief!´ (my token Fight Club reference)

But wait! There¶s more!

Second: We didn¶t just throw out the all zeroes subnet. We threw out the all one¶s subnet along with it. The
confusion surrounding the decimal value of the last network value being equal to the subnet mask and the hosts
having a decimal value greater than the subnet mask combined with the whole, ³Hey the broadcast address of
the last network is the same as the broadcast address of the original network´, thing caused ³they´ (whoever
they are) to toss out the all one¶s subnet, too. What was that word again? Oh yeah! Lame.

The all zeroes subnet and the all ones¶ subnet are both perfectly valid networks. They should be used and are
used in environments that are movitvated to squeeze all of the usefulness possible out of the IPv4 address
space. So, if you haven¶t been using it you need to get busy doing so. Have I mentioned that NOT using
subnet-zero in IPv6 isn¶t going to be an option? When your ISP gives you a prefix of 2001:ABCD:1234::/48
guess what your first usable network is going to be «2001:ABCD:1234::/64. How do you like them apples?
Ha!

Página  de ? 
http://dkerr.home.mindspring.com/IP%20Addresses,%20Subnet%20Masks,%20&%20Subnetting.htm

IP Addresses, Subnet Masks, & Subnetting


An IP address is used for Network Layer identification of hosts and routers on a TCP/IP network. The address
consists of a 32-bit binary number of 4 octets and is usually displayed in the decimal format 100.100.100.100,
which is called dotted decimal notation.

The class of the Network is determined by the high order bits

?YY
x 
Y  Y 
 Y
 ? ?   
 ? ?? ?  
x ?  ??   

{Y The network I.D. 127.x.y.z is a reserved address used for the local loopback and self-diagnostic
{Y A network and host I.D. cannot be all binary 1's (Decimal 255) . If all bits are set to 1's this is interpreted as a
broadcast
{Y A network and host I.D. cannot be all binary 0's, If all bits are set to 0's this is interpreted as a the network I.D.
{Y The high order bits of ??? (224.0.0.0 to 239.255.255.255) Class D is used for multicasting technologies and the
high order bits of ???? (240.0.0.0 to 247. 255.255.255) Class E are reserved for future use

Bitwise ANDing

Hosts and routers use Boolean math to determine the netid and the hostid by the use of ANDing.

 Y?  Y  Y


? ? ?
?  
 ? 
  

ANDing IP Addresses and Subnet Masks

? ? ???? ???? ???? ????


 ???????? ???????? ???????? 
Página de ? 
ÿ  ???? ???? ???? 

Note: In all calculations and comments the current classful standard is used. Under this standard, the first and
last subnets are dropped.

The higher order bits of 198.53.147.45 are 110 thus this is a class C address

The Netid of this Class C address 198.53.147.0 and the Hostid is 45

From the example above it is visible that with this subnet mask the netid and hostid remained unchanged by
bitwise ANDing.

Defining a Subnet Mask

Subnetting is a technique that allows the network administrator to divide a network into smaller networks by
using the same network number assignment. The advantages of subnetting are below:

{Y Simplified administration- With the help of routers networks can be broken up into smaller subnets that can
managed more independently and efficiently.
{Y Restructuring of the internal network without affecting external networks- A organization can continue to use
it's allocated IP addresses without having to obtain additional IP blocks.
{Y Improved security - Subnetting will allow an organization to separate internal networks on the internetwork but
will not be visible to external networks.
{Y Isolation of network traffic - With the help of routers and subnetting, network traffic can be kept to a minimum.

In the diagram above illustrates how a subnetted IP appears on an internal Intra-Net and the Internet. The
Internet only reads the NetId and the routers on the Internet are only concerned with routing the IP packet to
the Intra-Net external router. When the IP packet reaches the external router, which has been configured for
subnet routing reads the HostId. The router then forwards the packet to appropriate subnet where it is delivered
to the host.

Determining the Subnet Mask to Use

The diagram below shows that when subnetting an IP address the Netid remains unchanged but the Hostid is
further sectioned or divided up.

The Current Classfull Standard

There a number of different ways to define the available range of IP addresses. The MCSE exams use the
existing Classful standard. Some network equipment may follow a more current addressing scheme called
CIDR. To date, CIDR has not been adopted as the standard."

Página  de ? 
Just for reference, MS stacks do not adhere to the Classful standard. They will allow you to use all subnets,
including the first and last. For example, look at the *B article, Q139983 "Class C Subnetting Options for RAS
Routing"

The Current Classfull Standard rules are as follows.

1.Y The original Network ID (defined by the default class mask)


2.Y The Subnet ID (defined by any bits beyond the default class mask)
3.Y The Host ID

Before defining a subnet mask, you need to determine the number of segments and hosts per segment

 Y ÔY   Y Y


     Ô
??   ?
???   
????  ? 
?????   
??????   
???????  ? 
????????   

The above chart represents how a subnet mask is represented in binary format, to determine the values is quite
simple

I.Y Determine the number of Physical segments required in your network and covert to binary format. In the
example below 6 segments are required
II.Y Count the number of bits required to represent the number of physical segments in binary. With 6 required
subnets (Binary value is 110). Representing 6 in binary requires 3 bits
III.Y Convert the required number of bits to decimal format in high order (left to right).
IV.Y Configure the 3 required bits as the first bits of the host id. The decimal value for binary 11100000 is 224.
Representing a subnet mask of 255.255.255.224

Página  de ? 
´uestion: What happened to 198.53.147.32 and 198.53.147.63 why can't these be IP addresses ?

198.53.147.32 - Is the subnet's Network Id which is revserved for the physical segment (00100000).
198.53.147.63 - Is the subnet's Broadcast Address (00111111)

As stated above every network or subnet has a IP address for the Physical segment and a Broadcast Address.

Calculating Hosts


  x Y x Y
 Y Ô  x Y
Y Y xY
 Y Y




   Ô 
  

?? ?
  ? ? 
 ?
??? ?
   ? 
 
???? ?
 ?   ?
 
????
     
?
????
   ? ? 
??
????
 ?  ?? ? 
???
????
     
????

´uestion: I want to set up a TCP/IP LAN in my organization what IP addresses should I use?

For hosts that need to be connected to the Internet you can get a block of valid IP addresses from a ISP. Larger
Organizations or ISP's can get IP blocks from the American Registry for Internet Numbers

Página r de ? 
The following IP address ranges have been set aside for Internal use. These IP's are will not be routable on the
Internet.

Class A: 10.xx.xx.xx
      P


Class B: 172.16.xx.xx - 172.32.xx.xx


   
  P


Class C: 192.168.xx.xx
   
  P


Página 3 de ? 
http://hubpages.com/hub/ip-tutorial-subnetting

!"! "#   £   


 

xx$ #   !££ 


Topic: Subnetting a network An step-by-step tutorial with examples for IP addressing and sub-netting.

Subnetting:

To divide a large network into smaller sub-networks, we have to simply turn some of the host bits on in the
subnet mask, thus increasing the number of sub-networks and decreasing the number of hosts per sub-networks.
Here we are dividing a class C network into 2 smaller sub-networks by turning two host bits on in the subnet
mask. It means now we are having 26 bits reserved for the network addressing and only 6 bits remaining for the
host addressing. The formula to get the number of subnets is:

No. of subnets is equal to 2^n-2, where "n" is the number of bits taken from host. So here in our case we have
taken 2 bits from the host, thus we get total of two subnets. In fact we get total of four subnets, but according to
RFC which stands for Request For Comment and is the documentation of TCP/IP, we cannot use the first
subnet because all the subnet bits are turned "off" in the first subnet and we cannot use the last subnet, because
all the subnet bits are turned "on" at the same time, however Cisco routers does allow 1st subnet to be used by
issuing an IOS command "ip subnet zero". Here just remember that the subnet bits refer to the number of bits

Página J de ? 
taken from the host. So we have to subtract all subnet bits on and all subnet bits off. Practically we can use all
the subnets, but from CCNA exam point of view we cannot use 1st and last subnet.

Now the No. of hosts per subnet is equal to 2^r -2, where "r" is the number of bits remaining for the host. So
2^r-2 is equal to 2^6-2 is equal to 62. So we get total of two subnets with 62 hosts per subnet.
==================================================

After getting the number of subnets and hosts per subnet, we have to find the valid host range in each subnet
and network and broadcast address for each subnet. To get all these information, we have to get a block size.
We get block size by subtracting decimal value of the subnet bits from the maximum value of the octet, that is
2^8 is equal to 256. So here Block size is equal to 256 - 192 = 64. In this case, 192 is the decimal value of the
two subnet bits turned on. Once we get a block size, that block size becomes the network address of the first
valid subnet. Add block size to the first valid subnet and it gives you the network address of the second subnet.
*eep on adding the block size to next subnet until the value reaches to equal to all subnet bits turned "on",
which is 192 in our case. So we cannot use this last subnet. So we got two valid subnets, i.e., subnet 64 and
subnet 128. The valid IP range for the subnet 64 is from 192.168.0.65 to 192.168.0.126. The network address
for this subnet is 192.168.0.64 and broadcast address is 192.168.0.127. We cannot assign these network and
broadcast addresses to the system. The valid IP range for the subnet 128 is from 192.168.0.129 to
192.168.0.190. The network address for this subnet is 192.168.0.128 and the broadcast address is
192.168.0.191. =====================================================

Página [ de ? 
First of all let us write the subnet mask. Since it is class C address, the default subnet mask length is 24 bits.
And we have taken 3 bits extra from the host portion. Now we have total of 27 bits for network addressing. If
you remember earlier lessons, you will be able to calculate that up-to 24 bits continuous "on" in subnet mask
will be represented as 255.255.255.0, but we have taken 3 bits extra from the fourth octet. So the decimal value
of the three bits from the left will be 224. Hence new subnet mask for the network 202.10.4.0/27 will be
255.255.255.224. It's important to remember that all the subnets will have the same subnet mask. Now let us
calculate the number of subnets. Here the number of subnets =2^n-2 = 2^3-2 = 6. So we got six smaller
networks or subnets out of dividing a single class C network. Now let us calculate the number of hosts per
subnet. ==================================================

Página  de ? 
The number of hosts per subnet = 2^r-2 = 2^5-2 = 30. So we divided one big network into six smaller sub
networks with 30 hosts each. Next let us calculate the block size. Block size = 256 - 224 =32. Here 224 is the
decimal value of the subnet bits i.e., the number of bits we have taken from the host. Now start from the block
size and keep on adding itself to next block till it reaches to maximum i.e., 224 which we cannot use. So we got
the blocks of 32, 64, 96, 128, 160 and 192. The valid IP address in first subnet starts from 202.10.4.33 to
202.10.4.62, the network address for this subnet 32 is 202.10.4.32 and the broadcast address 202.10.4.63. The
valid IP addresses in subnet 64 starts from 202.10.4.65 to 202.10.4.94, the network address for this subnet is
202.10.4.64 and the broadcast address is 202.10.4.95. The valid IP addresses in subnet 96 starts from
202.10.4.97 to 202.10.4.126, the network address for this subnet is 202.10.4.96 and the broadcast address is
202.10.4.127. The valid IP addresses in subnet 128 starts from 202.10.4.129 to 202.10.4.158, the network
address for this subnet is 202.10.4.128 and the broadcast address is 202.10.4.159. The valid IP addresses for the
subnet 160 are from 202.10.4.161 to 202.10.4.190, the network address is 202.10.4.160 and the broadcast
address is 202.10.4.191. The valid IP addresses for the subnet 192 starts from 202.10.4.193 to 202.10.4.222, the
network address for this subnet is 202.10.4.192 and the broadcast address is 202.10.4.223.
==================================================

Página ? de ? 
Now you can see that we have divided single class c network into six sub-networks. And we are using five
subnets out of six on different interfaces of the router. Every sub net is having the same subnet mask that is /27.
If you remember earlier IP address assignment, we were losing almost 1212 IP addresses out of 1270. Now
after sub-netting, we are saving almost 4*254=1016+30= 1046 IP addresses. Well that's really a huge saving.

Definitely we are able to save lot of IP addresses in the example but you can observe that we are still losing a
lot of IP addresses. We know that on the network-1 and network-2 side, we may use all the IP addresses in the
subnet, but what about router to router interfaces..? We are never going to use more than two IP address on the
point to point serial link between two routers. So if our sub-networks are having 30 hosts each, we are utilizing
only two IP addresses per subnet out of 30. Again we are losing almost 28 IP addresses per router to router
interfaces. To save IP addresses which are being wasted this way, we use a concept called VLSM or classless
routing. VLSM stands for Variable Length Subnet Mask. In classless routing we assign variable length subnet
mask to different interfaces of the routers. The contrary of the classless routing is class full routing where every
interface of the routers are having same subnet mask. By using classless routing we use different subnet mask
for the router to router interfaces and some other subnet mask for the hosts side.
====================================================

Página  de ? 
Now you can see that we are using different subnet mask for the router to router interfaces and router to host
interfaces. For router to router interfaces we are using slash 30 subnet masks, which provides only two IP
addresses per subnet while the router to hosts side we are using slash 27 which is providing 30 hosts per subnet.

Now let us subnet a class B network.

===================================================

We have a requirement of total of 13 subnets with minimum of 4000 hosts per subnet. We are using the class B
network 131.100.0.0. How many bits should we take from host portion to fulfill the above requirements? If we
take two bits, we will be getting 2^2-2= 2 subnets. But we need 13 subnets. So if we take 5 bits then we will get
2^5-2=30 subnets. Great we are getting more than what we needed. But what about hosts. Just let us calculate.
Since it is a class B network, the total number of host bits is 16, out of which we have taken 5 bits for sub-
Página  de ? 
netting. So the number of hosts per subnet will be 2^11-2=2046. But we require at least 4000 hosts per subnet.
So let us try once again. If we take 4 bits from hosts then? Let's calculate.
=========================== ========================

If we take four bits from host portion, then total number of network bits becomes 20. The new subnet mask for
each subnet will be 255.255.240.0. Number of subnets = 14 and number of hosts/subnet we get 4094. Exactly
what we needed. So four bits extra solves our problem. One more important thing you should know that the
representation of network addresses like 131.100.0.0/20 is referred as CIDR notation. CIDR stands for classless
inter-domain routing.

Now we are going to discuss another important term related to IP addressing, "Super-netting". You will be
wondering what is this new term? Very simple, remember what is sub netting? Division of one large network
into multiple smaller sub-networks. And super-netting? Grouping multiple networks into larger super networks.
Confused. We discussed that sub-netting is done to save the IP addresses, so super-netting is contrary to that, it
will waste IP addresses, if use on client side. So why do we need super-netting? Well it is used by ISP's for
route summarization. We do route summarization to bring down the number of routing table entry in the
internet routers. As you should know that internet routers must have every network route entry into its routing
table, in order to route packets to every possible destination. Routers simply drop packets if they don't find the
destination network in the routing table. So internet routers will have to maintain routing table entry of every
possible network around the world in order to provide connectivity from any where around the world to any
site. This will lead to hundreds of thousands of routing table entry. The result of so many routing table entry
will be slowed down routing performance, since routers will have to read through the very long list of routing
table to find out the destination network before it can forward the data packets on outbound interface. Hence to
reduce the number of routing table entry the ISP's gets assigned a large pool of IP addresses as super-nets.
======================== ===========================

Página  de ? 
Here you can see in the illustration, a large ISP has got 202.100.100.0/22 super-net assigned. The large ISP is
assigning small networks within the super-net to small ISP's. The small ISP's are further dividing the networks
into sub-nets and then assigning to the customers. Important thing to notice here is that all the networks
including sub-nets under the large ISP is represented as single super-net 202.100.100.0/22 to the internet. When
ever any data packets arrive to the internet router for any small ISP's customers, the internet router will simply
send to the Large ISP. Internet routers will have to remember only large ISP's network and not every network
under the large ISP; hence super-netting effectively solves the problem of large number of routing table entry
into the internet routers. Representation of large number of networks as single super-net into the internet routers
routing table is referred as route summarization, and the representation of super-nets in the form of
202.100.100.0/22 is referred as CIDR notation. CIDR stands for class less inter domain routing. So we learnt
how super-netting brings down the number of routing table entry into the internet routers. Now we will learn
how to create super-nets. ===================================================

Página  de ? 
Remember, for sub-netting, we take bits from host, but for super-netting we give bits to hosts. Just see the
figures. We had a class C network 202.100.100.0/24 but we removed two bits from the network portion and
added to host. Here removing means turning the network bits off. If you examine the figures closely, you will
find that each super-net here is a combination of four class C networks. The first super-net is ranging from
202.100.100.0 - 202.100.103.255, which includes network 202.100.100.0, network 202.100.101.0, network
202.100.102.0, and 202.100.103.0. The same way every super-net out here consists of four class C networks
with 1022 hosts per supernet.

Página r de ? 
http://www.johnpatricklockie.com/rmmylife/?p=163

x  %

VLSM is simple if you think of it this way.

I have this subnet

?    ?    

I want to tell an application to scan a range of IPs, but this application doesn¶t like to get ranges. It only works
with netmasks. So if I tell it 10.0.0.0 /22 then it will scan all 1,024 host address (or 1,022 usable hosts).

VLSM is a way of subneting an already subneted address. Suppose I want my machine to scan for IP¶s 10.0.3.0
± 10.0.3.100 because I know the host I am looking for should be in that range. Well, instead of scannng /22 I
can feed the application this IP subnet:

?    ? 

I just subneted my already subnet address 10.0.0.0 /22 in to a smaller network of 126 usable host address. Now
my application will scan for 10.0.3.1 ± 10.0.3.126. That¶s much better than scanning the entire /22 subnet! This
is kind of how route summarization works, only the other direction (taking lots of smaller routes to smaller
networks and summarizing them as larger blocks).

Well, we could just as easily segment a network at layer 3 by using VLSM in this way. There is no smoke and
mirror and no mystic guide required«

This is how I understand VLSM, and I think if you can come to grasp subnets then VLSM is simply an
extension of that. You must look at your IPv4 addresses as blocks of usable IP¶s in which you can build
layered networks to manage your broadcast domains even better«

Another real world example of this, is if you had to give IP¶s to 75 clients. Well, then you are forced to use the
/25 subnet which contains 126 host IP¶s. That¶s a waste of 51 IP¶s! So why not use VLSM to pick up these
IP¶s and use them inP  P which do not have as much an abundance of usable host IP¶s?

Well, we will be using these IP:

?   ??     

We will not be using these IP:

?    ?   ?  

Suppose our new network will require 28 hosts. We will want to subnet somewhere in the range of .76 and
.126, 28 IP¶s. We know from our subnet rules that to get 28 hosts requires we go with a 32 host network which
is 255.255.255.224 (/27). We need to determine the start and end ranges, which is pretty easy to do:

?   ??    
6 Ê  Ê 6?   ? ?     6 
?    ?   
6 Ê  Ê 6?   ? ?     6 
?    ?   

6 Ê  Ê 6?   ? ?     6 
?    ?   ? 
 
     

Therefore, we have the following VLSM scheme of contained IP¶s within the /25 subnet:

Página 3 de ? 
Host Network A
  6?      
6 ?   ?  
6   ?   ? ?   ? 
   ?   ? ?    

Host Network B (subnet the remaining host IP¶s in the /25 network to get 28 hosts an a new
network)
  6?      
6 ?   ?  
6   ?     ?   ? 
   ?     ?   ? 

&   


%

Subnetting is tricky, but not difficult. What sets the expert apart is the ability to subnet quickly, and then on top
of that to do variable length subnetting.

First, I would like to thank some people in teaching me some of the cool tricks of the trade, which guided me to
completing this chart.

1. Omar Faytrouni: originator of the chart that I based my chart off of«.great guy.
2. Richard Haskins: my first CCNA and CCSP instructor, who opened the world of networks and IT up to me!
He doesn¶t teach anymore, but he is missed!

So a few years ago when I was taking some Microsoft courses (after I had taken a bundle of CCNA and CCSP
courses) a professor by the name of Omar Faytrouni presented to us a nifty little chart to aid in subnetting. I
placed this chart on the internet, and over the years it has spread on the net. You can Google Omar and find
that chart. I currently host the original copy at my old site which is coming down in a couple of months. Here
it is in all it¶s glory (without explanation).

Página J de ? 
Omar Faytrouni's TCP Subnetting Chart

What¶s wrong with this chart? Nothing really. How the heck do you use it though (it does come with
instructions!)? I will say, it¶s a cinch to memorize, but if I have to use it on a test I think I would be faster just
counting bits on the paper. This chart requires a lot of memorization still, and requires doing math on the side.
Omar would probably argue with me on that, but he would be wrong. He¶s a brilliant guy, and I learned a ton
from him about Microsoft. But I don¶t think he realized just how fast his brain was. This chart was like a
string around his finger, and not all of us are that quick. I need the answer key, not the string. But I really felt
he was on to something all these years, and I watched many students get a lot out of using this chart. Wanting
to make something out of it for myself, and something that can carry me through a CCIE written and even a lab
environment I took some time to make this:

Página [ de ? 
Y

YYYY
 tY t iYiYYtt YY  YYYYl YiY
tY tY
 tYY YitiY
YYY Yi YYCRYYY
 tY YYit ll YiY  YiYttYYY Y iYti YtY
Y
 tY iYt YY Y
tYYl tYitY Y Y i
l Yl  Y
  t Yt Y t YY

 ttiYYYtiYYYYtY  tiY  YYY Yt Yt Y tY  t YY YtYiil YttY
it Y  YtY lit YYt tY YY Y t YY
i Y 
 YY YitY tillY t  l Y  YtY
   YY lit YYY  Y YCC Yit YtYt llY Yt Y
lY YYYti Y
 ttiYYY
ti YtYY  Y   iYYtY lit Yt YtYY!Yl t Y  YitYYYlittl Y"Y 
YYillY
  l Y
Yti Y tYtYitY l YtYi ti YYYtY
Yti YtiYiYit YtY i
Y

Y Y YtiY"Yti YtYi YtY   tY


Yt Yl YY# Yl Y Yt  YYi t
tiY"YtY Y
itY tYY$ i
%YtYt Y
  Y  tYY Y 
Yl YYtY
Yt YtYitY 
lY  Y
i
ll Y i
YY  YtY
Yit
tYt Yi t YlY   &Y

'i tYl t Yi 


YYtYi  Y t Y
iYti YtYY'Yt Y l  YttY Y  tiYli :Y
$¬  
 ¬  $YYY Y t
 tY Yti Yi YYC !!YBY
 YYtY YYt Y(Yt tYY#i YCRY YYi Y iY)Y it YYt Y/ )Y 
ltYiY 
Y
tYY/ )Yi Y+,,+,,--YYttYi Y i  YC !!YBYYY Y  YiYtY Y.Y it Yti Y
lY
YYCRYY/+-YY! Yi ti YillY
 tYit YY Yit
tY i tiYYl 
lY t  Y
itYi YYtYt tY Y Y Y$l l %YY'Y l Y 
YillY Yt Y$/-0Y tY
Y YYC !!Y
CYY Y  Yt
YYY$ t %Y   ti YitYi YC !!Y YYYYitYiY Y t Y Y
 tY
/-Y YY/++YY   Y i Y Y YYCRY YY
YttY YY ttiYitYYC Yt Yt Y$CR%Y
ti:Y

'Y
Y YillYlYtYt Y$1)0Yl
YY2 3YYB 
Y/++Yi Y//)1)4 Yl t Y Y  Y
Y it YlY Y
 Y YYY1)YCR4Y

c e? 

We immediately see how many NETWORKS we are going to have. That is, 64. This field is in blue. The
blue fields represent the last ³1Ǝ bit in our subnet mask. In this example we know that CIDR /22 is going to
give us 64 networks. Now let¶s examine the P P to determine the subnet mask, host ranges, and
total amount of hosts on this network. This chart is both vertical and horizontal, but 80% of the information
you get from it will be on the ³X´ axis. We simply use the ³Y´ axis to determine our CIDR (or if we only have
a CIDR to start with we start there!).

To the left is our subnet mask, 252. Being a CLASS B IP address, we now know our subnet mask for
172.16.26.4 is not only /22, but 255.255.252.0.

The body of the table is a logical representation of the bit masking going on. In the case of a CLASS B subnet
scenario we know this will be the structure of our 3rd octet:

1 1 1 1 1 1 0 0 < -- the reality


1 1 1 1 1 (64) (4) 0 < -- my representation to show where net work ends and hosts start

I have replaced the last ³1Ǝ and the first ³0Ǝ with the number of networks, and range of hosts!

The 2^2 is just another way of showing that we have 2 bits available for host address in this octet (2 to the
power of 2). That means every 4 numbers in this octet (the third octet) we have entered a new ³network´. But
this does not represent the total amount of host ID¶s for this subnet. It just tells us, look at the 3rd octet and
count in ³4¶s´ to find out what particular network an address is in«.

1,2,3,4 <new network> 5,6,7,8 <new network>, etc. 

So if we have IP 172.16.26.4 we know that¶s going to fall here:

172.16.0.1 - 172.16.3.254
172.16.4.1 - 172.16.9.254
172.16.8.1 - 172.16.11.254
172.16.12.1 - 172.16.15.254
172.16.16.1 - 172.16.19.254
172.16.20.1 - 172.16.2.254
172.16.24.1 - 172.16.27.254
172.16.28.1 - 172.16.31.254
....and so on for 64 total lines! 

172.16.26.4 /22 will have a default gateway of 172.16.24.1! How easy was that? Too easy. Let¶s try 1 more«.

What is the network range for the address: 172.16.63.25 /18

Página ? de ? 
//5Y6Y1+Y
1+Y6Y+,,+,,/7+-Y
.Y t YitY).Y t YiY Y tY

? ??? ? 
? ? ?? ??  
? ??
?? ?? ? 
? ?? ?? ?  Y

‰ 4 tY Yi YY

 ¬  ¬   !"#$$% & ' ()* +  ¬ ,-,-Y

#i Yi Y YY


tYt Y tYY tY YYt YtYYtYl tYtY ttYitYY#Y Yti YY$8%Y
 i YtYttY 
i Y  Ylittl Y$t
t%YY!YiY   Y  Y 
YtY
 tYt iYC !!YBY YtYi Y
Y/+Y t Y 
YYitYtYt Y l
Y$/)0Y 
Y/+Yi Y t YtY5Y
tYl YtY/)YttY it YYt Yl tY
itYYt Y t 4   Yt Y  Yill Y 
YYi
 Yt Y tY
t:Y

  Y lYilitYitY 
Y
Y

{Y ?3?r
{Y ÿ   ?3?r??3?r? 


{Y xÿ

YY

Y 
Y
lYli YtYY  Yti YYYtY
ilYt YtYY  Y Y4Y





      !

? 
? ?


"# # ?

?
$ %? 
? $% 

c e? 

224 + 16 = 240
240 + 8 = 248
248 + 4 = 252
252 + 2 = 254
254 + 1 = 254

Notice that the "+" is simply the binary steps (look at middle column of #'s!), starting
with 128 as the mask, and 64 to add.
...and the result carries over to calculate the next mask...if you stare at it long
enough you will catch on

Start by listing the subnet masks. If you know binary, just remember 128! Then go down
to 255.....

Now list all the "bits" from top down, starting with 1,0 like this:
1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0
1 1 1 0 0 0 0 0
1 1 1 1 0 0 0 0
1 1 1 1 1 0 0 0
1 1 1 1 1 1 0 0
1 1 1 1 1 1 1 0

On the last 1's of each row replace them with 2 -> 128
On the first 0's of each row replace them with 128 -> 2

Now top it off with CIDR numbers 1 -8 at the top! DONE!

In a test it will look like this:

+1 +2 +3 +4 +5 +6 +7 +8
[128] 2n 128c 0 0 0 0 0 0
[192] 1 4n 64c 0 0 0 0 0
[224] 1 1 8n 32c 0 0 0 0
[240] 1 1 1 16n 16c 0 0 0
[248] 1 1 1 1 32n 8c 0 0
[252] 1 1 1 1 1 64n 4c 0
[254] 1 1 1 1 1 1 128n 2c
[255] 1 1 1 1 1 1 1 255n

I used "n" for network bit, and "c" for client bit here....easy!

I built this by starting with the SUBNET MASKS

Give me network range for 192.168.63.177 /26


+2 for CIDR
4 networks, with 64 clients in each network (remember, drop DOWN to the network bit not
client bit)
just looking at that IP I can say it falls in the range:

192.168.63.128 ---> 192.168.63.191

Subnet mask: 255.255.255.192

Easy? Well, I hope I don't have any errors in my own article =P (I already had to fix a
couple)

Página  de ? 
http://clarkincnet.wordpress.com/subnetting-%E2%80%93-an-ipv4-primer/

Subnetting ± An IP64 Primer

 


I¶ve spent many hours helping people from the novice networking student to the seasoned technology
professional understand IP addresses and subnets. It¶s a core skill that is required to understand the basic
communication used in networking. Below is a summary of the information that I pass along to would-be
networking experts.

  £   

The Internet Protocol (IP) is used on almost every network in the world, from the largest to the smallest. Most
people are familiar with IP addresses, and that they are required in order to communicate on a network. But
some are confused as to how they work. An IP address is a unique identification assigned to a device so that it
can operate on a network.

An IP address consists of a 32-bit number that ranges from 0 to 4294967295. This means that theoretically, the
Internet can contain approximately 4.3 billion unique objects. Because computers read IP addresses in binary
(ones and zeros strung together to form a number) and because a 32-bit binary number would prove very
difficult for humans to read, IP addresses were divided into four base-256 digits. In other words, the IP address
was divided into four 8-bit numbers, or ³octets´, which are separated by a period. This form is known as
³dotted decimal´ notation.

The internet currently uses the IP version four (IPV4) addressing format that is now some 20 years old.
Because of the inherent address limitations IPV4 is being slowly replaced by IPV6. This newer version was
defined in December 1998 by the Internet Engineering Task Force (IETF) with the publication of an Internet
standard specification called RFC 2460. This paper will discuss IPV4, which is still the most widely used
addressing format.

Review of Key Points: An IP (Internet Protocol) address is a unique identifier for a device on an IP network.
An 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 form of writing IP addresses is known as
³dotted decimal´ notation (example, 10.68.131.22).

½  "$' 

Let¶s face it ± as humans we¶re kinda lazy and for most of us that means when it comes to reading and
remembering long numbers ± we¶d rather not. This is why the mathematicians developed the dotted decimal
notation for us network administrators. However, computers prefer to process their numbers in formats that we
humans find harder to remember, such as hexadecimal or binary.

For example, the dotted decimal notation of 10.68.131.22 is expressed as


00001010.01000100.10000011.00010110 in binary.

Of course the easiest way to convert binary numbers is to use a scientific calculator, which can easily convert
binary to decimal and decimal to binary for you; however there is another way to do it.

Let¶s take a look at one of the four octets. This octet has 8 bits, with each bit representing a certain value. If a
bit has a 1 in it, then the bit is ³on´, likewise, if the bit has a 0 in the placeholder position, the bit can be
described as being ³off´. In relating this to a light switch, the on position turns on the light and the off position
turns the light off.
Página  de ? 
If you read the bit positions from right to left (backwards from the normal left to right that we use when we read
a newspaper), the first position represents 1. The second position represents twice the first position or 2. The
third position represents twice the value of the preceding bit or 4. This continues until the eighth and final
position represents 128.

To convert the binary number 10110011 to decimal, you simply, line up the 1¶s and 0¶s according to their
position, and then multiple either the 1 or 0 against the numerical value of that position. The sum, or total, of
the multiplication equals the decimal number.

Review of Key Points: We¶re lazy. Because we are lazy, we like to turn long confusing streams of ones and
zeros into an easy to understand (and remember) decimal numbers. IP addresses are made of 4 octets, with
each octet comprising 8 bits. Each bit represents a certain value with the lowest value bit residing on the right-
most end of the octet. You can line up the 8 ones and zeros in the octet with each of the decimal numbers the
octet positions represent and multiply them. By adding each of the products you arrive at the binary number. A
scientific calculator does this for you without making you count on your fingers and toes.

 x

O*, so we understand that IP addresses come in dotted decimal notation, and the number ranges for each of the
four octets can be 0 thru 255 (for a total of 256 numbers). So, this means that we have the following IP
addresses available for use on the Internet ± 0.0.0.0.0 thru 255.255.255.255 ± right?

Well, not exactly. These IP addresses are actually divided into different classes. And some of these IP
addresses are reserved for special uses. For example, 127.0.0.1 is reserved for internal testing and is commonly
known as the loopback address.

There are five main classes of IP addresses:

Class A addresses begin with 0xxx (binary) or 1 to 126 (decimal)

Class B addresses begin with 10xx (binary) or 128 to 191 (decimal)

Class C addresses begin with 110x (binary) or 192 to 223 (decimal)

Class D addresses begin with 1110 (binary) or 224 to 239 (decimal)

Class E addresses begin with 1111 (binary) or 240 to 254 (decimal)

Of these classes, only Class A, Class B, and Class C addresses are used for common networking purposes.
Class D addresses are used for multicasting, and Class E addresses are reserved for future use (of what possible
future use, I cannot say« but they¶ve been reserved for at least as long as I¶ve been in networking).
Página  de ? 
How many possible addresses is there in a Class A range? There are 127 network licenses in a Class A network
with over 16 million possible addresses. A Class B range affords 16,000 network licenses with 65,000 possible
addresses per license. Finally, there are over 2 million network licenses for Class C, and each license allows for
254 possible addresses.

Review of Key Points: Each octet contains a total of 256 addresses. This number is taken by adding the 0
position to the maximum 255 positions available. Not all IP addresses can be used. IP addresses are divided
into classes and are broken up into large networks and small networks.

  $ ( 




It is important to understand the difference between the network portion of the IP address and the host portion.
The network portion, shown above in blue, denotes the portion of the IP address which describes the network.
The remaining part of the IP address, shown in green, denotes the possible host addresses. Therefore, on a
Class A network of 101.100.100.100, the network ID is 101.xxx.xxx.xxx, and the host ID is xxx.100.100.100.

I used lowercase x¶s for a reason. I want you to use your mind to carve out the network ID from the rest of the
IP address. When we refer to this network ID, we use 101.0.0.0. So, the IP address 101.100.100.100 has a
network ID of 101.0.0.0 and a broadcast address of 101.255.255.255.

Broadcast address? Remember in our discussion above, I stated that some IP addresses were reserved for
special reasons. Each network has two special reserved addresses. The first one, is of course, the network ID,
where all the bits in the remaining octets not used to distinguish the network ID are set to zeros. By turning all
these same bits to ones, you have the second reserved address ± the broadcast address.

Broadcast addresses are used to communicate with every device on the network. So, if you have a host device
and it needs to utilize a network service, but doesn¶t know which host on the network provides that service, it
can send out a special message to ask all hosts on the network if they offer the service. This happens by setting
the destination address of the packet to the broadcast address. This special packet, known as a broadcast
packet, will be seen by all devices (increased network traffic) but only devices that provide that service will
respond (potentially less network traffic).

Página r de ? 
Review of Key Points: The diagram above demonstrates the vast number of possible hosts available to a
single Class A network. Broadcasts are used to talk to all hosts on a network.

$ 

There are three private networks available. The addresses are 10.0.0.0, Subnet Mask 255.0.0.0, 172.16.0.0,
Subnet Mask 255.240.0.0, and 192.168.0.0, Subnet Mask 255.255.0.0. The inclusion of these private networks
has really been one of the saving graces of IPV4. These addresses can be used by anyone and are generally not
routable, or at least, are not routable out on the Internet.

The real world use of these addresses allow organizations to use relatively few public IP addresses, but have the
depth and range of a Class A address if needed.

£    

Ok, so we know how IP addresses work, but what¶s this stuff you¶re saying about subnets? The word subnet is
actually a shortened phrase for the term ³sub networks´, which means a small network within a larger one, or a
logically visible sub-section of a single Internet network. The smallest network within a larger network is
known as a ³broadcast domain´. The broadcast domain is a single local area network, or LAN, segment on a
switch.

A broadcast domain, or LAN, is the basic unit of a network. Here, computers can communicate directly with
each other by using the physical address, or MAC address. Since physical addresses are not routable, meaning
they cannot be accessed directly from one network to another one, all communication done at the MAC level
must be done on the same LAN. Communications on the MAC level require ARP broadcasting. Broadcasting
requires sending communication packets to every device on the network in order to identify who is on the
network. Large amount of broadcast traffic will depredate the network¶s performance. This is why the term
³broadcast domain´ is used to identify the LAN, or basic network unit.

Returning full-circle to the subject of subnetting, the size of the most common subnet is 8 bits, though networks
can be larger or smaller than that.

Subnets have both a beginning and an end. The beginning number, known as the ³Network ID´ is always even
and the ending number, known as the ³Broadcast ID´, is always odd. When creating subnets, you are not
allowed to use these numbers because they are reserved. Why are they reserved? Because they have special
meaning in the network. The Network ID is the designation for the network that you are referring to. When

Página 3 de ? 
you use the Network ID, you are referring to the network itself. The subnet mask defines the size of the
network. The Broadcast ID is the broadcast number that you would refer to if you wanted to communicate with
every device on the network.

Review of Key Points: The term subnet refers to a small network within a larger one. A broadcast domain is a
single local area network or segment between routers. Subnets begin with the Network ID and end with the
Broadcast ID.

Characteristics of ³Classful´ Subnets

Subnet masks allow you to see where the ³endpoints´ of the subnet are on any given IP address within the
subnet. This is done through a process known as ³ANDing´. In order to AND, you must first have two pieces
of information ± the IP address, and the subnet mask.

Computers perform the ANDing process to determine if the destination computer is on the local network or a
different network.

There are only 4 results of ANDing:

0 and 0 = 0

0 and 1 = 0

1 and 0 = 0

1 and 1 = 1

Ok, so let¶s assume that you have an IP address of 192.168.62.14 and a subnet mask of 255.255.248.0, and it
wants to communicate with a host with the IP address of 192.168.65.1. The process of ANDing provides for
the following outcome:

This process shows that the computers are on separate networks. The source computer is on network ID
192.168.56.0 and the destination computer is on network ID 192.168.64.0.

Review of Key Points: Anding is used when a host wishes to know if it can communicate with a destination
node. This is done in three steps:

Página J de ? 
1.Y The host takes its on IP address and ANDs it with its own subnet mask, producing a result.
2.Y The host takes the destination node IP address and ANDs it with its own subnet mask, producing a second
result.
3.Y The host compares the two results. If the results are the same, the host can communicate directly with the
destination node on the same network. If the results are dissimilar, the host knows that the destination node is
not on the same network, and communications to this node will be sent to the hosts default gateway.

Breaking up Networks

Subnetting can be taken a step further in order to break up large networks. This is accomplished by adding
more bits to the default subnet mask. In other words, you can take bits away from the host portion of the subnet
mask and assign them as part of the subnet mask.

To calculate the number of subnets or nodes, use the formula (2n-2) where n = number of bits in either field,
and 2n represents 2 raised to the nth power.

In the example above, a 3-bit subnet mask is applied to the default Class B subnet mask of 255.255.0.0 to create
a new subnet mask of 255.255.224.0. There are 6 (23-2) subnets available with this size mask. Remember to
subtract out 2 for the network ID and Broadcast ID reserved addresses. Each subnet has 8190 (213-2) nodes.
Each 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 using the new subnet.

Página [ de ? 
One thing that should strike your attention is the total number of addresses available for this network. A default
Class B network (not subnetted in this manner) has over 65,000 addresses. The process of subnetting always
reduces the total number of possible addresses, or in other words, there is a cost to the convenience of
subnetting.

x£  '   


x£ 

Can you believe the nerve of some people? There are more devices in the world that need IP addresses to
communicate than there are IP addresses. And when people know this fact, can you believe they are still going
to seedy Internet-based shopping sites and buying   devices which require IP addresses? Don¶t they
know there¶s not enough IP addresses to go around?

CIDR was invented some years ago to help alleviate the strain on the number of IP addresses available under
IPV4. After all, the classful system of assigning IP addresses was very wasteful. If you were a small or
medium business, you might be able to use all the IP addresses in a Class C address range. But how many
small and medium businesses exist in the world compared to the number of possible Class C addresses ranges?
(The Internal Revenue Service estimated there were 29.3 million nonfarm business tax returns filed in 2004,
and as we learned above, there are just over 2 million network licenses for all of Class C) Lastly, there but how
many Class A addresses do you think are actually assigned to devices? After all, how many organizations can
use 1.7 million IP addresses anyway (besides the government)?

In 1992, Supernetting (or ³slash´ notation, or CIDR) was proposed as a means to handle this issue. CIDR uses
a subnet mask to show where the line is drawn between host ID and network ID.

CIDR is sometimes called ³slash´ notation, or properly CIDR notation, because the subnet mask is expressed as
a ³/n´ behind the network address as a means to describe the subnet mask. The ³n´ in /n is the number of bits
used for the network ID.

Where¶s My Class?

Because CIDR was intended to make better use of the IP address space, the classes (Class A, Class B, Class C,
etc.) are obsolete. Therefore, since there are no address classes in CIDR, you cannot readily identify the size of
the network ID of an IP address by only looking at the IP address.

How it works

CIDR works by ³borrowing´ bits from the host ID portion of the IP address. Let¶s take a look at the address
192.168.12.0/23. Right off, the /23 tells us that we are going to take 23 bits from the binary IP address starting
at the left-most portion of the IP address.

Review of Key Points: CIDR was created to allow for better use of IP addresses. CIDR is also known as
supernetting or slash notation. There are no classes in CIDR (hence the term classless).

How CIDR is calculated

So, the first octet contains 8 bits. The second octet contains an additional 8 bits, making it a total of 16 bits.
Since we want to use a total of 23 bits, we need to ³borrow´ 7 additional bits from the next octet. This is

Página r de ? 
illustrated in the drawing above by coloring the 23 bits we are using green. That leaves us 9 bits for the host
IDs, meaning the one unused bit in the 3 rd octet and the 8 bits in the 4th octet.

So, how do we determine our IP address range for this subnet? We know the starting position ± 192.168.12.0.
The easiest way to determine the ending position is to count the number of unused bits in the 3rd octet. In this
example, there is one unused bit in the ³1´ position. So, we know that 12 + 1 = 13. The answer is 192.168.12.0
± 192.168.13.255. The 255 is the easiest to figure, because we are going to use all of the available bits in the 4 th
octet. The illustration below helps depict this.

Also, notice how the subnet mask of 255.255.254.0 is determined the same way. All the bits in the 3rd octet are
used but the last bit, so 255 ± 1 = 254.

So, the remaining question is how many possible hosts do you have for the /23 subnet? In calculating how
many hosts you have left, you take the number of unused bits and add them to this formula: (2^n)-2

Therefore, if you had a network which was 192.168.12.0/23, you would be using the following bits:

How CIDR is calculated

Página r? de ? 
The first 23 bits (colored in green) are used for the network ID. The remaining bits are used for the host ID.
Notice that there are 9 bits not colored in green. This nine becomes the ³n´ used in the formula (2^n)-2. So the
answer to the question of how many hosts are available in 192.168.12.0/23 is

Therefore, you have a possible 510 hosts for a /23 subnet. Now that you know the logic behind CIDR and
know how to figure out the math, below is a chart of all the possible combinations of CIDR for easy reference.

Página r de ? 
This table illustrates some interesting facts. The most obvious one to me at first glance is that every time the
number of bits used for the network ID increased by one, the number of available hosts is reduced by slightly
more than half. This makes sense when considered against what we have already learned ± there is always a
cost associated with subnetting.

Review of Key Points: CIDR allows you to take better advantage of limited IP addresses. For practice sake,
let¶s go over this one more time.

Let¶s take the following subnet ± 10.100.20.0/18. This tells us that we are going to use the first 18 bits as the
network ID and the remaining 14 bits as the host IDs.

Remember how you arrive at the ending subnet range of 10.100.83.255. You have 6 unused bits in the 3rd
octet. 00111111 = 63 (You can check this by adding the two used bits, the 8 th position (128) and the 7 th
position (64) to the 63 to equal 255 (128+64+63 = 255). So, 10.100.20 (plus 63) = 10.100.83. You will use all
the bits in the 4th octet, so the final number is 10.100.83.255.

To figure out the number of available host IDs, you use the same formula as above.

Página r de ? 
How does it work?

CIDR works its magic because enterprise routers are designed to support it. CIDR requires the network
segments involved to be contiguous (numerically adjacent) in the address space. CIDR cannot, for example,
aggregate 10.100.20.0 and 10.100.83.0 into a single route and somehow skip over or not include an
intermediate range such as 10.100.30.0 and 10.100.31.0 address ranges (such as 10.100.20.0/18 example
above).

It is highly unlikely that consumer routers will be designed to handle CIDR since it is generally an unnecessary
cost to add that functionality.

x   

Subnetting might not be something that comes easily to you, but it¶s not terribly difficult either. Yes, there is
some math involved, but the math is relatively simple and if you practice a few times, the logic will begin to
make sense.

Of course, IPV4 will become a thing of the past as IPV6 becomes more commonplace. But that¶s a discussion
for another day. I hope this has been beneficial for you. You are welcome to contact
me at AskClark@clarkinc.net for additional help. Check out our tutorials, blog entries, and user comments for
additional ideas.

Página r de ? 
http://learn-networking.com/network-design/how-to-subnet-a-network

Two Important Equations to Remember:

{Y 1. Usable Subnets = (2^n) ± 2 , where N = power of bits assigned


{Y 2. Usable Hosts = (2^n) ± 2 , where N = power of bits remaining

Let¶s start with usable subnets. Review the diagram below for a visual example.

If you are wondering what the ³-2´ part of the equation is for, this is how we account for the two addresses in
each subnet we can¶t use. We will review what these addresses are for more specifically later on. For now, let¶s
find out what our usable hosts are!

Alright Already! What¶s My Subnet Mask?!

Getting your subnet mask at this point is incredibly easy. Simply take all of your network bits, and add them up.
Look at the diagram below for a visual guide.

Página r de ? 
That¶s it! You¶re done. You have successfully created a subnet mask that can be used on the school¶s network.
*eep in mind that every computer must have the subnet mask set in order for them to be on the same network.
Also note that since we are using a class C network, the first three octets will always be 255. When subnetting
other classes, be sure to keep the network portions in mind.

Closing Comments

Subnetting may not be fun, but it is required for students to know on networking exams. That means you should
stay away from subnet calculators until you have grasped the full concept of how to do it yourself. These
calculators should only be used as a time saving tool, not a learning tool or way to cheat on homework.

With enough practice, subnetting will become much easier. Class A and Class B networks are a bit trickier, but
follow the same example as shown above and it should be quite easy to accomplish.

Página rr de ? 
http://consulteach.com.ar/Publicacion.asp?codGrupo=58

Capacitación\RECURSOS\Direccionamiento IP\
IANA

http://www.iana.org

DIRECCIONES IPv4

Dada la enorme cantidad de usuarios y servidores, se requiere de un mecanismo que permita identificar al
remitente y al destinatario de las comunicaciones en Internet. Esa clave de localización en la red, son las
direcciones IP.

Para que dos hosts ubicados en cualquier parte del mundo, puedan comunicarse, es necesario que se encuentren
unívocamente identificados mediante una dirección IP.

Dos computadoras no pueden tener una misma dirección IP.


Las computadoras utilizan ³1´ y ³0´ para representar letras, números y todo tipo de información (³piensan´ en
binario).

Con el objetivo de hacer que esa dirección sea más cómodamente legible por los seres humanos, se acostumbra
dividirla en 4 grupos de 8 bits (octetos o bytes), separados por puntos.

Entonces, cada octeto podrá tomar valores decimales desde el 0 (correspondiente a la combinación binaria
00000000), hasta el 255 (correspondiente a la combinación binaria 11111111). Es decir, desde el 0.0.0.0 hasta
el 255.255.255.255.

Para visualizar un esquema de formación de las direcciones IPv4, ejecutar el siguiente archivo pps:

direccionesIP.pps

CLASES DE DIRECCIONES IP (CLASSFUL)

Las direcciones con clase (Classfull) corresponden al esquema de segmentación original (RFC 791) de las
direcciones de 32 bits en clases específicas, en las que quedan identificados la numeración de la red y la
numeración del host dentro de esa red.

Los primeros bits (comenzando por la izquierda) de una dirección IP Classfull identifican la clase a la que
pertenece dicha dirección, y quedan automáticamente determinados la cantidad de bits que corresponden a la
red y al host.

Si el primer bit de una dirección IP es ³0´, dicha dirección pertenece a la clase A. En consecuencia, el primer
octeto (los 7 bits restantes) identifica a la red (NET ID), y los últimos 3 octetos identifican al host (HOST ID).

Si el primer bit es ³1´, y el siguiente ³0´, dicha dirección pertenece a la clase B. En consecuencia, los dos
primeros octetos (los 15 bits restantes) identifican a la red (NET ID), y los últimos 2 octetos identifican al host
(HOST ID).

Si los dos primeros bits son ³1´, y el siguiente ³0´, dicha dirección pertenece a la clase C. En consecuencia, los

Página r3 de ? 
tres primeros octetos (los 23 bits restantes) identifican a la red (NET ID), y el últimos octeto identifica al host
(HOST ID).

Las direcciones IP cuyos primeros 3 o 4 bits son ³1´, están reservadas para usos especiales.

REDES MAYORES

Las direcciones sin clase (Classless) permiten la utilización completa de todo el rango de direcciones, sin
ningún tipo de reserva de bits para identificar diferentes categorías o clases.

En la figura se muestra el octeto que corresponde al NETID de cada clase. También es posible entonces,
transgredir dichas fronteras para dar lugar a direcciones y direccionamientos que quedan definidos (en sus
NETID y HOSTID) exclusivamente por la Máscara de red (o Mascara de Subred).

Cuando se ³roban´ bits (hacia la derecha), que de acuerdo con la máscara natural de la clase pertenecen al
HOSTID para asignarlos a la NETID, se dice que estamos realizando subnetting.

Si por el contrario, mediante un prefijo y una máscara, se ³integran´ en un bloque una cantidad de direcciones
de una o más clases, se realiza supernetting o CIDR (Classless Inter Domain Routing).

Si se trabaja en actividades de subnetting, debe buscarse el ³octeto interesante´, moviéndonos hacia la derecha,

Página rJ de ? 
es decir aquel en el que se ³roban´ bits a los hosts para asignarlos a la subnet.

Si se trabaja en actividades de supernetting (sumarización y CIDR), el ³octeto interesante´ seria, moviéndonos


hacia la izquierda para agrupar redes.

Subnetting [1 bit y 2 bits]

Las redes IP pueden ser divididas en redes más pequeñas denominadas subredes (Subnetting: RFC950).

Este procedimiento provee al administrador varios beneficios, incluyendo la flexibilidad, el uso eficiente de las
direcciones de red y la capacidad de contener el tráfico broadcast (el broadcast no atraviesa al router).

Las subredes se encuentran bajo una administración local, y como tales el resto del mundo ve a la organización
como una red única, sin conocer los detalles de la estructura interna.
Una dirección de red puede ser dividida en varias subredes.
Una dirección de subred se crea "robando" bits del campo de host para asignarlos al campo de subred.

El número de bits "robado" es variable, y se especifican en la máscara.

En la figura se muestra el ³octeto interesante´ de una dirección (sin importar si la dirección es de clase A, B ó
C).
En ese octeto, se avanza un bit sobre la parte de la dirección correspondientes a los hosts (la máscara es
entonces /9 para la clase A, /17 para la clase B, y /25 para la clase C).

Y se muestra como se generan dos subredes a partir de la original.

De la misma manera, si se avanza dos bits sobre la parte de la dirección correspondientes a los hosts (la
máscara es entonces /10 para la clase A, /18 para la clase B, y /26 para la clase C), se generan cuatro subredes a
partir de la original.

Ver la Tabla Generalizada de Direcciones IP


Página r[ de ? 
Subnetting [3 bits y 4 bits]

Profundizando la penetración sobre los bits correspondientes a los hosts, se muestra el subnetting con tres y
cuatro bits, formándose 8 y 16 subredes, respectivamente.

Asimismo, se muestran los rangos de direcciones de cada una de las subredes generadas.

Desde el punto de vista de la dirección, una subred es una extensión del número de red. Los administradores de
red determinarán el tamaño de subred en función de las necesidades.
La recomendación de no utilizar la primera (todos ³0´) y última (todos ³1´) subred es obsoleta.
La única restricción vigente es la de no utilizar todos ³0´ ó todos ³1´ en la parte de HOST ID.

Todos ³0´ corresponde a la dirección de la subred.


Todos ³1´ corresponde a la dirección de broadcast de esa subred.

Ver la Tabla Generalizada de Direcciones IP

Página 3 de ? 
Subnetting direcciones clase C

Las tablas de la figura facilitan el subnetting de las direcciones de clase C.

La tabla superior muestra la máscara (cuarto octeto), el índice correspondiente, la cantidad de subredes y hosts,
y el total de hosts en todas las subredes. Además, la potencia de 2, que indica el factor de multiplicación de las
subredes.

Nótese como el número total de hosts en todas las subredes va disminuyendo a medida que se generan mayor
cantidad de subredes porque cada subred contiene dos direcciones inválidas para ser asignadas a los hosts (la de
la red y la de bc).

En la tabla inferior se indican las direcciones de las subredes generadas a partir de una máscara (se indica el
índice) determinado.

Por ejemplo, si tomáramos la red de clase C 192.168.1.0/24, y la subneteáramos con una máscara
255.255.255.224.

Tenemos que corresponde al índice /27, y que las subredes son múltiplos de 32. Que se forman 8 subredes con
un máximo de 30 direcciones disponibles, cada una.

Lo que totaliza una disponibilidad de 240 direcciones asignables (todo esto sale de la tabla superior).

Si quisiéramos conocer cuales son las direcciones de cada una de las 8 subredes, lo podemos obtener del cuadro
inferior (para /27: 192.168.1.0, 192.168.1.32, 192.168.1.64, 192.168.1.96, 192.168.1.128, 192.168.1.160,
192.168.1.192 y 192.168.1.224).

También puede verse el mismo resultado en la ³torta´ dividida con una profundidad de 3 bits (8 subredes)

Página 3? de ? 
Subnetting direcciones clase B

Las tablas de la figura facilitan el subnetting de las direcciones de clase B.

La tabla superior muestra la máscara (cuarto octeto), el índice correspondiente, la cantidad de subredes y hosts,
y el total de hosts en todas las subredes.

Además, la potencia de 2, que indica el factor de multiplicación de las subredes.

Nótese como el número total de hosts en todas las subredes va disminuyendo a medida que se generan mayor
cantidad de subredes porque cada subred contiene dos direcciones inválidas para ser asignadas a los hosts (la de
la red y la de bc).

En la tabla inferior se indican las direcciones de las subredes generadas a partir de una máscara (se indica el
índice) determinado.

En la tabla inferior se indican las direcciones de las subredes generadas a partir de una máscara (se indica el
índice) determinado.

Página 3 de ? 
Por ejemplo, si tomáramos la red de clase B 130.25.0.0/16, y la subneteáramos con una máscara 255.255.192.0.

Tenemos que corresponde al índice /18, y que las subredes son múltiplos de 64. Que se forman 4 subredes con
un máximo de 16382 direcciones disponibles, cada una. Lo que totaliza una disponibilidad de 65528
direcciones asignables (todo esto sale de la tabla superior).

Si quisiéramos conocer cuales son las direcciones de cada una de las 4 subredes, lo podemos obtener del cuadro
inferior (para /27: 130.25.0.0, 130.25.64.0, 130.25.128.0 y 130.25.192.0).

También puede verse el mismo resultado en la ³torta´ dividida con una profundidad de 2 bits (4 subredes)

Tabla Generalizada de Direcciones IP

La Tabla Generalizada de Direcciones IP permite:

a) Encontrar todas las subredes para cualquier esquema de subnetting dado (Subnetting)

b) Trabajar con máscaras de subred o índices de subred.

c) Encontrar las máscaras o índices que satisfagan un determinado conjunto de redes (Supernetting).

d) Encontrar los bits de wilcard de la máscara inversa de Cisco para las ACLs.

Conversiones binario a decimal, y decimal a binario en el rango 0 a 255

Página 3 de ? 
http://www.certprepare.com/forum/index.php?showtopic=3

You have a Class C address of 192.168.100.0 /24. Your company requires to use nine subnets. What is the
IP plan of network numbers, broadcast numbers, and valid host numbers? What is the subnet mask
needed for this plan?

Solution:

First, determine how many H (host) bits you need to borrow to create nine valid subnets, using the formula:

2N>=9 (N are the network bits)

N = 4 so you need to borrow 4 H bits and turn them into N bits and you will have 24=16 networks

Because the network mask is /24 = 11111111.11111111.11111111.00000000 (in binary form) = 255.255.255.0
(in decimal form) so we need to take host bits from the last octet. Let's consider our last octet:
Initial state:
HHHHHHHH (8 host bits)
Borrowed state:
NNNNHHHH (4 network bits, 4 host bits)

So our subnetwork mask is 11111111.11111111.11111111.11110000 -> 192.168.100.0 /28

From 11110000, we should take care of the last "1" bit because it will give us information about the increment.
See the picture below to understand how:

So we figured out the increment is 16, now we can create our sub-network list:

1st subnet-work: 192.168.100.0/28


2nd subnet-work: 192.168.100.16/28
3rd subnet-work: 192.168.100.32/28
4th subnet-work: 192.168.100.48/28
5th subnet-work: 192.168.100.64/28
6th subnet-work: 192.168.100.80/28
7th subnet-work: 192.168.100.96/28
Página 3 de ? 
8th subnet-work: 192.168.100.112/28
9th subnet-work: 192.168.100.128/28
10th subnet-work: 192.168.100.144/28
11st subnet-work: 192.168.100.160/28
12nd subnet-work: 192.168.100.176/28
13rd subnet-work: 192.168.100.192/28
14th subnet-work: 192.168.100.208/28
15th subnet-work: 192.168.100.224/28
16th subnet-work: 192.168.100.240/28

Página 3 de ? 
http://xentron.blogspot.com/

Ejercicio Completo de Subnetting

‰ 
x

a
!"a

En este ejercicio se describe los pasos necesarios para aplicar subnetting a un direccion IPde Clase C, asi como
las configuraciones respectivas en el escenario de la red realizado con Packet Tracert 5.2.

‰ 
 Dado la siguiente topologia y direccion IP 192.168.1.0/24. Mediante subnetting con VLSM
obtengamos direccionamiento IP para los Hosts de TRES subredes (Red 1: 20 hosts, Red 2: 100 hosts y Red 3:
50 hosts), las interfaces Ethernet de los Routers y los Enlaces seriales entre los Routers.

Para acelerar los calculos utilizamos la siguiente tabla (es valida solo para Redes Clases C):

La tabla general es la siguiente:






 
 Antes de iniciar con los calculos inicie con la subred que necesite mayor cantidad de Hosts.

x 
   # Se necesitan 100 hosts.

Trabajo con la subred: 192.168.1.0/24.

De la informacion anterior tomamos el valor de n=1 para la Tabla de Subnetting (primera fila "Bits prestados"),
ontendremos un valor de 128 (segunda fila "Variacion de subredes") es decir se tendra 128 saltos.

Las nuevas redes son las siguientes:

1.Y Red valida: 192.168.1.0/25.


Página 3r de ? 
2.Y Red valida: 192.168.1.128/25.
3.Y Red invalida: 192.168.1.256/25.

Con la red 192.168.1.0/25 cumplimos el requerimiento de los 100 hosts.

El direccionamiento final seria el siguiente (los .. significan que existen mas direcciones):

Direccion de Red: 192.168.1.0

Primer Hosts de Red: 192.168.1.1

Gateway de la Red: 192.168.1.126

Broadcast de la Red: 192.168.1.127

x 
   #  Se necesitan 50 hosts.

Trabajo con la subred: 192.168.1.128/25.

Las nuevas redes son las siguientes:

1.Y Red valida: 192.168.1.128/26.


2.Y Red valida: 192.168.1.192/26.
3.Y Red invalida: 192.168.1.256/26.

Con la red 192.168.1.128/26 cumplimos el requerimiento de los 50 hosts.

El direccionamiento final seria el siguiente:

Direccion de Red: 192.168.1.128


Primer Hosts de Red: 192.168.1.129
Gateway de la Red: 192.168.1.190
Broadcast de la Red: 192.168.1.191

x 
   #? Se necesitan 20 hosts.

Trabajo con la subred: 192.168.192/26

Página 33 de ? 
Las nuevas redes son las siguientes:

1.Y Red valida: 192.168.1.192/27.


2.Y Red valida: 192.168.1.224/27.
3.Y Red invalida: 192.168.1.256/27.

Con la red 192.168.1.192/27 cumplimos el requerimiento de los 20 hosts.

El direccionamiento final seria el siguiente:

Dirección de Red: 192.168.1.192


Primer Hosts de Red: 192.168.1.191
Gateway de la Red: 192.168.1.222
Broadcast de la Red: 192.168.1.223


x 
      a  
#
  Se necesitan 2 hosts.

Trabajo con la subred: 192.168.1.224/27

Las nuevas redes son las siguientes:

1.Y Red valida: 192.168.1.224/30.


2.Y Red valida: 192.168.1.228/30.
3.Y Red valida: 192.168.1.232/30.
4.Y Red valida: 192.168.1.236/30.
5.Y Red valida: 192.168.1.240/30.
6.Y Red valida: 192.168.1.244/30.
7.Y Red valida: 192.168.1.248/30.
8.Y Red valida: 192.168.1.252/30.
9.Y Red invalida: 192.168.1.256/30.

Con la red 192.168.1.224/30 cumplimos el requerimiento de los 2 hosts, con las direcciones sobrantes se
cubren para los otros routers.

El direccionamiento final sería el siguiente:

Dirección de Red: 192.168.1.224


Página 3J de ? 
Direccion para la Interfaz Serial 0 del Router 0: 192.168.1.225
Direccion para la Interfaz Serial 0 del Router 1: 192.168.1.227
Broadcast de la Red: 192.168.1.228

#  
   En la siguiente imagen se puede apreciar el escenario completo con las direcciones IP de
algunos Hosts y de los Routers según las Subredes seleccionadas.

x


  

#
 

Se incorpora la informacion base para la comunicación de los diferentes dispositivos en la red.

x
  
 #


Router>enable
Router#configure terminal
Router(config)#hostname Router0
Router0(config)#banner motd *Acceso prohibido. Derechos reservados Xentron 2010*
Router0(config)#enable secret cisco
Router0(config)#line console 0
Router0(config-line)#password cisco
Router0(config-line)#login
Router0(config-line)#exit
Router0(config)#line vty 0 4
Router0(config-line)#password cisco

Página 3[ de ? 
Router0(config-line)#login
Router0(config-line)#exit
Router0(config)#interface fastEthernet 0/0
Router0(config-if)#ip address 192.168.1.222 255.255.255.224
Router0(config-if)#description Conexion hacia la Red Local
Router0(config-if)#no shutdown
Router0(config-if)#exit
Router0(config)#interface serial 2/0
Router0(config-if)#ip address 192.168.1.225 255.255.255.252
Router0(config-if)#description Conexion hacia el Router1
Router0(config-if)#no shutdown
Router0(config-if)#exit
Router0(config)#exit
Router0#show cdp neighbors
Router0#show controllers serial 2/0
Router0#show ip interface brief
Router0#show ip route
Router0#configure terminal
Router0(config)#ip route 192.168.1.126 255.255.255.128 192.168.1.226
Router0(config)#ip route 192.168.1.190 255.255.255.192 192.168.1.226
Router0(config)#exit
Router0#show running-config
Router0#copy running-config startup-config
Router0#show startup-config
Router0#

x
  
 #
?

Router>enable
Router#configure terminal
Router(config)#hostname Router1
Router1(config)#banner motd *Acceso prohibido. Derechos reservados Xentron 2010*
Router1(config)#enable secret cisco
Router1(config)#line console 0
Router1(config-line)#password cisco
Router1(config-line)#login
Router1(config-line)#exit
Router1(config)#line vty 0 4
Router1(config-line)#password cisco
Router1(config-line)#login
Router1(config-line)#exit
Router1(config)#interface fastethernet 0/0
Router1(config-if)#ip address 192.168.1.126 255.255.255.128
Router1(config-if)#description Conexion hacia la Red Local
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#interface serial 2/0
Router1(config-if)#ip address 192.168.1.226 255.255.255.252
Router1(config-if)#description Conexion hacia el Router0
Router1(config-if)#clock rate 56000
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#interface serial 3/0
Router1(config-if)#ip address 192.168.1.229 255.255.255.252

Página J de ? 
Router1(config-if)#description Conexion hacia el Router2
Router1(config-if)#clock rate 56000
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#ip route 192.168.1.192 255.255.255.224 192.168.1.225
Router1(config)#ip route 192.168.1.128 255.255.255.192 192.168.1.230
Router1(config)#exit
Router1#show running-config
Router1#copy running-config startup-config
Router1#show startup-config
Router1#

x
  
 #


Router>enable
Router#configure terminal
Router(config)#hostname Router2
Router2(config)#banner motd *Acceso prohibido. Derechos reservados Xentron 2010*
Router2(config)#enable secret cisco
Router2(config)#line console 0
Router2(config-line)#password cisco
Router2(config-line)#login
Router2(config-line)#exit
Router2(config)#line vty 0 4
Router2(config-line)#password cisco
Router2(config-line)#loginRouter2(config-line)#exit
Router2(config)#interface fastEthernet 0/0
Router2(config-if)#ip address 192.168.1.190 255.255.255.192
Router2(config-if)#description Conexion hacia la Red Local
Router2(config-if)#no shutdown
Router2(config-if)#exit
Router2(config)#interface serial 2/0
Router2(config-if)#ip address 192.168.1.230 255.255.255.252
Router1(config-if)#description Conexion hacia el Router1
Router2(config-if)#no shutdown
Router2(config-if)#exit
Router2(config)#ip route 192.168.1.192 255.255.255.224 192.168.1.229
Router2(config)#ip route 192.168.1.0 255.255.255.128 192.168.1.229
Router2(config)#exit
Router2#show running-config
Router2#copy running-config startup-config
Router2#show startup-config
Router2#

Página J? de ? 
½   $
    ?3 ?rr 
Esta calculadora calculará la dirección de red, la dirección del host y la dirección de difusión de una
determinada dirección TCP / IP y la máscara de subred.

Estos cálculos son en realidad bastante sencillo. La forma más sencilla de hacerlo es para representar tanto la
dirección IP y la máscara de subred en binario. Tome 173.16.26.0 con máscara de subred 255.255.254.0
enumerados en binario:

Dirección IP: 10101101.00010000.00011010.00000000


máscara de subred: 11111111.11111111.11111110.00000000

Si un binario Y entre estos dos números, se obtiene la dirección de red:

Dirección IP: 10101101.00010000.00011010.00000000


máscara de subred: 11111111.11111111.11111110.00000000
Y -----------------------------------
dirección de red: 10101101.00010000.00011010.00000000

lo que se tradujo de nuevo a la notación decimal con puntos es 173.16.26.0

Para obtener la parte del host, invertir la máscara de subred y otra vez realizar un binario y con la dirección IP:

Dirección IP: 10101101.00010000.00011010.00000000


máscara de subred invertida: 00000000.00000000.00000001.11111111
Y -----------------------------------
porción de host: 00000000.00000000.00000000.00000000

lo que se tradujo de nuevo a la notación decimal con puntos es 0.0.0.0

Para obtener la dirección de difusión, de nuevo es el más simple de verlo en binario. Tome la máscara de
subred invertido y hacemos un XOR binario con la dirección de red:

dirección de red: 10101101.00010000.00011010.00000000


máscara de subred invertida: 00000000.00000000.00000001.11111111
----------------------------------- XOR
dirección de difusión: 10101101.00010000.00011011.11111111

lo que se tradujo de nuevo a la notación decimal con puntos es 173.16.27.255

Operaciones Binarias

En lo que sigue se adopta como convención la lógica positiva, lo que implica:


verdadero = 1 = activo, ------, falso = 0 = inactivo
Hay cinco operaciones binarias básicas: AND, OR, NOT, XOR y ADD. La resta, multiplicación y división se
derivan de estas cinco anteriores. Cualquiera sea la longitud de la palabra o palabras objeto de la operación,
siempre se hace de a un bit por vez de derecha a izquierda (tal como si fuera una suma o resta con números
decimales). Esto permite una definición de cada operación que es independiente de la longitud del o de los
operando(s). La operación NOT es la única que se realiza sobre un sólo operando (es unaria), y las otras cuatro
sobre dos operandos.

{Y La operación AND (Y) tiene resultado 1 si sus dos operandos son ambos 1
{Y La operación OR (O) tiene resultado 1 si cualquiera de sus operandos es 1
{Y La operación XOR tiene resultado 1 si los operandos son distintos (uno en 0 y el otro en 1)
{Y La operación NOT (NO) tiene resultado 1 si el operando es 0 y viceversa
Página J de ? 
{Y La operación ADD (SUMA) se define igual que con los números decimales

AND OR XOR NOT SUMA


0*0=0 0+0=0 0X0=0 NOT 1 = 0 0+0=0
0*1=0 0+1=1 0X1=1 NOT 0 = 1 0+1=1
1*0=0 1+0=1 1X0=1 --- 1+0=1
1*1=1 1+1=1 1X1=0 --- 1 + 1 = 10

Página J de ? 
Página J de ? 
Página J de ? 
http://juanfelipe.net/node/55

$)  *    "  x£x+


::[INTRO]::

Una vez más frente a los routers CISCO. Esta vez la película va de como realizar configuraciones en enrutadores y

swiches CISCO, en especial, lo referente a enlaces WAN, LAN y VLANs.

Este problema me lo encontré en el Politécnico Colombiano Jaime Isaza Cadavid y aquí le doy solución para futura

referencia.

Las herramientas que serán utilizadas para desarrollar este problema incluye el Packet Tracer de CISCO.

::[PROBLEMA]::

La empresa OTEON S.A. ha sido seleccionada para la implementación y configuración de la red LAN y WAN de la

empresa XYZ, la cual tiene como sedes las ciudades de Medellín y Bogotá, para esta implementación se ha dado la

mayor autonomía en la creación del direccionamiento IP bajo ciertos parámetros exigidos por la compañia,

adicionalmente se solicita tener en cuenta las siguientes variables:

1.Y Configurar el enlace WAN entre las sedes de Bogotá y Medellín, adicionalmente tener en cuenta las siguientes

recomendaciones:

6Y El enrutamiento debe ser estático.

6Y El enlace WAN no debe superar mas de 2 host.

2.Y La ciudad de Medellín debe tener tres VLANs creadas para: Usuarios, Proveedores, y Visitantes, las cuales

deben ser repartidas de la siguiente manera:

6Y Todo el direccionamiento debe ser entregado por la empresa OTEON S.A.

6Y La VLAN de usuarios debe tener capacidad para un máximo de 255 hosts.

6Y La VLAN de proveedores no puede superar más de 16 hosts.

6Y la VLAN de visitantes no puede superar más de 16 hosts.

6Y La sede deber tener dos swiches, en el primero deben estar conectados los usuarios, en el segundo los
proveedores y visitantes.

3.Y La ciudad de Bogotá debe tener dos VLAN creadas para: Usuarios y Servidores, las cuales deben ser

repartidas de la siguiente manera:

6Y Todo el direccionamiento debe ser entregado por la empresa OTEON S.A.

6Y La VLAN de usuarios debe tener capacidad para un máximo de 255 hosts.

6Y La VLAN de servidores no puede superar más de 16 hosts.

6Y Solo debe existir un swiche.

4.Y Todos los PC deben comunicarse con cada una de las áreas creadas.
Página Jr de ? 
5.Y La empresa OTEON S.A. debe entregar todo el direccionamiento IP.

::[SOLUxION]::

E ementos de  topo ogí:

{Y Mede ín:

6Y Un router (ROUTER-MED) conectando con Bogotá.

6Y Dos swiches:

cY SW-1: Swiche de usuarios (una VLAN).

cY SW-2: Swiche de proveedores y visitantes (dos VLANs - una para proveedores y otra para visitantes).

{Y Bogotá:

6Y Un router (ROUTER-BOG) conectando con Medellín.

6Y Un swiche:

cY SW-1: Swiche de usuarios y servidores (dos VLANs - una para usuarios y otra para servidores).

·ireccionmiento de en ce WAN (entre Mede ín y Bogotá):

{Y El numeral 1 nos dice que el direccionamiento en el enlace WAN no debe pasar de 2 hosts, por lo tanto voy a

seleccionar una dirección IP clase C, de la cual me queda el último octeto para direccionar hasta 2 hosts. Veamos:

6Y Dirección de red: 192.168.0.0.

6Y Máscara de subred: 255.255.255.0.

Para obtener máximo dos hosts de la dirección de red 192.168.0.0/255.255.255.0 necesito tomar del último octeto,

al menos 2 bits de host, ya que 2^2 - 2 = 2 Host. Veamos ese último octeto en binario:

R R R R R R 0 0

1 1 1 1 1 1

Por lo que me quedan 6 bits de subred:

00 en decimal equivale a 252. Por lo que la máscara de las subredes será 255.255.255.252. Ahora saquemos

las subredes:

256 - 252 = 4 (primera subred y tamaño del bloque).


Página J3 de ? 
4 + 4 = 8 (segunda subred).

8 + 4 = 12 (tercera subred).

...

240 + 8 = 248 (subred número 63).

248 + 8 = 252 (subred numero 64, no válida).

Para simplificar voy a tomar la primera subred (192.168.0.4/255.255.255.252) para direccionar el enlace WAN entre

las dos ciudades.

Primer U timo
Subred Máscr Brodcst
0ost 0ost

2.. .4 255.255.255.252 2.. .5 2.. . 2.. .7

Bien. Hasta este punto tenemos listo el númeral 1 del problema:

Router Interfce ·ireccion IP

ROUTER-ME· WAN 2.. .5/255.255.255.252

ROUTER-BOG WAN 2.. ./255.255.255.252

Y solo nos gastamos 2 direcciones de Host de la subred. Tal cual como lo pedía el enunciado.

·ireccionmiento de Mede ín:

{Y El númeral 2 nos dice en la primera parte que la VLAN de usuarios debe tener capacidad para 255 hosts, por lo que

aquí basta con elegir cualquier dirección de red clase C a excepción de la subred 192.168.0.0/255.255.255.0 que ya

fue elegida para direccionar el enlace WAN entre las dos ciudades. Así que para no enredarme la vida voy a elegir la

dirección de red 192.168.1.0/255.255.255.0 para direccionar la VLAN de usuarios de la ciudad de Medellín.

Página JJ de ? 
Subred Máscr Primer 0ost U timo 0ost Brodcst

2... 255.255.255. 2... 2...254 2...255

{Y En la segunda parte este mismo numeral nos dice que la VLAN de proveedores no debe superar más de 16 Hosts,

por lo que vuelvo a elegir otra dirección de red clase C y tomo 5 bits de hosts ya que 2^5 - 2 = 30. ¿Y porque no

tomo 4 bits de hosts ya que 2^4 = 16? Recordemos que la operación 2^y incluye restar al resultado el número 2,

por lo que si elijo 2^4 - 2 = 14 host, lo cual no cumple con el requerimiento del enunciado.

Por comodidad voy a elegir el siguiente segmento IP clase C:

{Y Dirección de red: 192.168.2.0.

{Y Máscara de subred: 255.255.255.0

Voy a tomar del último octeto 5 bits de host para obtener 30 host por subred. Veámos este octeto en binario:

R R R 0 0 0 0 0

1 1 1

Por lo que me quedan 3 bits para subred.

Ahora, 00000 en decimal equivale a 224. Por lo que la máscara de subred será 255.255.255.224. Saquemos las

subredes.

256 - 224 = 32 (primera subred y tamaño del bloque).

32 + 32 = 64 (segunda subred).

64 + 32 = 96 (tercera subred).

...

Para simplificar voy a tomar la primera subred (192.168.2.32/255.255.255.224) para direccionar la VLAN de

proveedores:

Página J[ de ? 
Primer U timo
Subred Máscr Brodcst
0ost 0ost

2..2.32 255.255.255.224 2..2.33 2..2.2 2..2.3

{Y La tercera parte de este numeral nos pide que la VLAN de visitantes no puede superar más de 16 Hosts y para no

reptir el proceso anterior digamos que se tomó el segmento clase C 192.168.3.0 con máscara 255.255.255.0 y se le

hizo el mismo proceso de subnetting. Por lo que la siguiente tabla sumariza el proceso para la VLAN de usuarios.

Primer U timo
Subred Máscr Brodcst
0ost 0ost

2..3.32 255.255.255.224 2..3.33 2..3.2 2..3.3

·ireccionmiento de Bogotá:

{Y La primera parte del numeral 3 nos dice que la VLAN de usuarios debe tener capacidad para un máximo de 255

hosts. Aquí vuelve y juega, seleccionamos una dirección de red clase C purita que no entre en conflicto con los

segmentos seleccionados para el direccionamiento de Medellín. Propongo entonces: 192.168.100.0/255.255.255.0

Subred Máscr Primer 0ost U timo 0ost Brodcst

2.. . 255.255.255. 2.. . 2.. .254 2.. .255

{Y La segunda parte del numeral 3 nos dice que la VLAN de servidores no puede superar más de 16 hosts, por lo que

aquí metemos otro gol diciendo que vamos a seleccionar una dirección de red clase C, digamos

192.168.101.0/255.255.255.0 y que pasando este segmento de red por un proceso de subnetting similar al de la

VLAN de proveedores para la ciudad de Medellín obtenemos:

Primer U timo
Subred Máscr Brodcst
0ost 0ost

Página [ de ? 
2.. .32 255.255.255.224 2.. .33 2.. .2 2.. .3

Tenemos hasta este punto todo el direccionamiento IP de las dos ciudades (Medellín y Bogotá) incluyendo el

direccionamiento del enlace WAN entre ambas ciudades.

{Y En ce WAN

Router Interfce ·ireccion IP

ROUTER-ME· WAN 2.. .5/255.255.255.252

ROUTER-BOG WAN 2.. ./255.255.255.252

{Y 6LAN: 2 usurios Mede ín

Subred Máscr Primer 0ost U timo 0ost Brodcst

2... 255.255.255. 2... 2...254 2...255

{Y 6LAN: 3 proveedores Mede ín

Subred Máscr Primer 0ost U timo 0ost Brodcst

2..2.32 255.255.255.224 2..2.33 2..2.2 2..2.3

{Y 6LAN: 4 visitntes Mede ín

Subred Máscr Primer 0ost U timo 0ost Brodcst

2..3.32 255.255.255.224 2..3.33 2..3.2 2..3.3

{Y 6LAN: 2 usurios Bogotá

Subred Máscr Primer 0ost U timo 0ost Brodcst

Página [? de ? 
... ? .?.?. ? .?.?.
? .?.?. ? .?.?.?
  

{Y 6L

Y

 
 Ul 
au 
Y   Y   Y
 Y  Y

? .?.??. ... ? .?.??. ? .?.??. ? .?.??.

 m sYYs cc


 Yc m YYY cYYcYs
Y(Y sY s)Y Y mYccYYYsY

s
YYcYs
:Y

{Y au
192 168 1 0Yu


nl
192 168 1 254 Y

{Y au 
192 168 2 32Yu


nl
192 168 2 62 Y

{Y au 
192 168 3 32Yu


nl
192 168 3 62 Y

{Y au 
192 168 100 0Yu


nl
192 168 100 254 Y

{Y au 
192 168 101 32Yu


nl
192 168 101 62 Y

YY

TlY

c [e? 

List det d de configurciones

Aquí incluyo los comandos más importantes hechos sobre los dispositivos más importantes de la topología. Al final de

este artículo se encuentran los archivos de Packet Tracer con la topología totalmente configurada. Usted por analogía

debe extrapolar estos resultados hacia los dispositivos que no se detallan en las siguientes tablas.

{Y ROUTER-ME· (Router Mede ín)

xomndo ·escripción

Entro a la configuración de la interface serial 0/0. Esta interface


interface serial 0/0
es la que hace el enlace con el router de la ciudad de Bogotá.

ip address 192.168.0.5 Se le asigna la dirección IP y la máscara de subred a la

255.255.255.252 interface serial 0/0.

Ya que esta interface es el componente DCE de la

clock rate 64000 comunicación, nos toca establecer el reloj para la sincronización

de la interface serial con su extremo.

Creamos la interface virtual 1/0.1 a partir de la interface 1/0.


interface FastEthernet 1/0.1
Recordemos que la interface 1/0 es la que está de cara a SW-1.

Definimos la encapsulación que va a manejar la interface. Como

estamos hablando de VLANs definimos la encapsulación 802.1Q

encapsulation dot1q 2 y a continuación definimos la VLAN a la que está asociada esta

sub-interface. En este caso la VLAN 2 (Usuarios). Recordemos

que esta interface es una "troncal".

Definimos la dirección IP y la máscara de subred de cada


ip address 192.168.1.254
subinterface. Esta dirección IP que le asignamos es la que
255.255.255.0
corresponde con la VLAN 2 (Usuarios) en Medellín.

Página [ de ? 
Definimos la sub-interface para manejar la VLAN 3

(Proveedores) en Medellín y repetimos los mismos pasos


interface FastEthernet 1/0.2
anteriores de acuerdo al direccionamiento seleccionado para la

VLAN 3.

encapsulation dot1q 3

ip address 192.168.2.62

255.255.255.224

Definimos la sub-interface para manejar la VLAN 4 (Visitantes)

en Medellín y repetimos los mismos pasos que se hicieron para


interface FastEthernet 1/0.3
la VLAN 2 de acuerdo con el direccionamiento seleccionado para

la VLAN 4.

encapsulation dot1q 4

ip address 192.168.3.62

255.255.255.224

Definimos una ruta estática diciendo como alcanzar la subred

192.168.100.0 (VLAN Usuarios Bogotá) que están en la ciudad de


ip route 192.168.100.0
Bogotá. Aquí recordemos la sintaxis:
255.255.255.0 192.168.0.6

ip route <red destino> <mascara red destino> <puerta de enlace>

Definimos otra ruta estática diciendo como alcanzar la subred


ip route 192.168.101.32
192.168.101.32 (VLAN Servidores Bogotá) que está en la
255.255.255.224 192.168.0.6
ciudad de Bogotá.

{Y SW- (Swiche - , Mede ín)

xomndo ·escripción

Ingresamos a la configuración de la interface Fasth Ethernet


SW-USUARIOS(config)#
0/1. Esta interface es la que está pegada directamente a

Página [ de ? 
interface fastEthernet 0/1 ROUTER-MED. Como esta interface va a transportar datos de

todas las VLANs de la ciudad de Medellín, hay que definirla

como una interface de tipo troncal para que agregue la

correspondiente encapsulación 802.1Q a las tramas Ethernet.

SW-USUARIOS(config-if)# Le decimos a la interface Fast Ethernet 0/1 que estará definida

switchport mode trunk como una interface de tipo troncal.

SW-USUARIOS(config)# vlan 2 Definimos la VLAN 2.

SW-USUARIOS(config-vlan)# Le asignamos un nombre a la VLAN 2. En este caso le

name USUARIOS asignamos el nombre USUARIOS.

Entramos a la configuración del puerto Fast Ethernet 0/2 del


SW-USUARIOS(config)#
swiche. Es en este puerto en donde tenemos conectado el
interface fastEthernet 0/2
equipo 192.168.1.1.

SW-USUARIOS(config-if)# Definimos que el puerto no es un puerto de "troncal" sino un

swicth port mode access puerto de acceso.

SW-USUARIOS(config-if)# Le decimos a la interface Fast Ethernet 0/2 que pernece a la

switchport access vlan 2 VLAN 2 creada previamente.

Entramos a la interface Fast Ethernet 0/3 para decirle que

SW-USUARIOS(config)# pertenece a la VLAN 2 como se hizo previamente con la

interface fastEthernet 0/3 interface Fast Ethernet 0/2. Esta interface es la que conecta al

equipo 192.168.1.2 de la topología.

SW-USUARIOS(config)# vlan 3 Definimos en este Swiche la VLAN 3.

SW-USUARIOS(config-vlan)# Definimos el nombre de la VLAN 3 pero no le asignamos

name PROVEEDORES ninguna interface, solo la definimos.

Página [ de ? 
SW-USUARIOS(config)# vlan 4 Definimos la VLAN 4.

SW-USUARIOS(config-vlan)#
Definimos el nombre para la VLAN 4.
name VISITANTES

Entramos a la configuración de la interface Fast Ethernet 0/4.


SW-USUARIOS(config)#
Esta interface es la que conecta el equipo 192.168.3.34 que
interface fastEthernet 0/4
pertenece a la VLAN de visitantes.

SW-USUARIOS(config-if)#

swicth port mode access

SW-USUARIOS(config-if)# Le decimos a la interface que pertenece a la VLAN 4 (la de

switchport access vlan 4 visitantes).

Esta interface también tiene un propósito especial: es la que

conecta a SW-1 con SW-2. Como esta interface está


SW-USUARIOS(config)#
interconectando a estos dos swiches, esta interface debe
interface fastEthernet 0/24
configurarse de modo troncal para que pueda transportar los

datos de las VLANs entre ambos swiches.

Definimos la interface de tipo "troncal". El proceso hay que


SW-USUARIOS(config-if)#
realizarlo exactamente igual en la interface Fast Ethernet 0/24
switchport mode trunk
en SW-2.

Hasta aquí considero que es suficiente ilustrar el proceso de configuración de un Swiche y un Router. Con estas

explicaciones es suficiente para realizar las configuraciones de los dispositivos que faltan en la topología. Solo ajuste

los parámetros de acuerdo a las VLANs y al direccionamiento seleccionado.

::[ARx0I6OS]::

Página [r de ? 
{Y Archivo de la topología realizado en Packet Tracer 4.1:

6Y LAB-VLAN-1.rar (md5sum: eeed953ff8d2c6ce46cc387b3503dc5b *LAB-VLAN-1.rar)

Página [3 de ? 
http://juanfelipe.net/node/53

 
    
  ,£ xx-
::[INTRO]::

Este post va de como hacer subnetting de direcciones IP de manera rápida. Este método me funciona bastante bien y

no tengo que enredarme mucho la vida con las famosas conversiones binario- decimal y visceversa. También me ha

funcionado muy bien para explicar subnetting en un abrir y cerrar de ojos. Eso si, valga la aclaración, este método es

un poco mecánico y vale la pena siempre y cuando usted comprenda bien de que va la pelicula del subnetting. Es más

creo que no es comprensible lo que se va a exponer a continuación si usted antes no ha comprendido por lo menos

que es una dirección IP, una máscara de subred y que es hacer subnetting en si mismo.

Lo expuesto en este post es una abstracción y traducción tomada de LAMMLE, Todd.CCNA Cisco Certified Network

Associate Study Guide. Fourth Edition.SYBEX.

::[A TOxAR]::

L ví rápid: Subnetting de un dirección IP c se x.

Lo único que necesita saber para hacer subnetting de una dirección IP clase C es responder a estas simples 5

preguntas:

{Y ¿Cuantas subredes produce la máscara de subred elegida? (¿Cuantas subredes?).

{Y ¿Cuantas direcciones IP de hosts válidas por subred quedan disponibles? (¿Cuantos hosts por subred?).

{Y ¿Cuales son las subredes válidas?

{Y ¿Cual es la dirección broadcast de cada subred?

{Y ¿Cuales son las direcciones IP válidas de los hosts de cada subred?

En este punto entonces es necesario que usted esté familiarizado y memorice las siguientes potencias de 2.

Potencis de 2 que se deben memorizr.

2^ = 2 2^2 = 4 2^3 =  2^4 = 

2^5 = 32 2^ = 4 2^7 = 2 2^ = 25

Las respuestas a las cinco preguntas anteriores son las siguientes:


Página [J de ? 
{Y ¿Cuantas subredes? 2^x - 2 = numero de subredes. Donde x es el número de bits enmascarados (del último

octeto), es decir, todos los bits que tengan el valor de 1 en la máscara: Por ejemplo: 11000000, el número de 1s en

este ejemplo nos da 2^2 - 2 subredes, lo cual daría como resultado 2 subereds en total.

{Y ¿Cuantos hosts por subred? 2^y - 2 = número de hosts por subred. Donde y es el número de bits no enmascarados,

es decir, todos los bits que tengan el valor de cero en la máscara. Por ejemplo: 11000000, el numero de 0s en este

ejemplo nos da 2^6 - 2 hosts, lo cual daría como resultado 62 hosts por subred.

{Y ¿Cuales son las subredes válidas? 256 - máscara de subred = tamaño del bloque o número base. Por ejemplo, 256 -

192 = 64. Entonces 64 es la primera subred. La siguiente subred sería el tamaño del bloque más el mismo: 64 + 64

= 128, (la segunda subred). Se continúa sumando el resultado al tamaño del bloque hasta que se alcance el valor

de la máscara de subred, el cual no sería una subred válida ya que tendría todos los bits en 1.

{Y ¿Cual es la dirección broadcast de cada subred? La dirección broadcast de cada subred son todos los bits de hosts

(del último octeto) puestos a 1. Lo cual corresponde al número inmediatamente anterior a la siguiente subred.

{Y ¿Cuales son las direcciones IP válidas de los hosts de cada subred? Los hosts válidos son los números entre las

subredes, omitiendo todos los 0s y todos los 1s.

Veámos todo este enredo con un simple ejemplo:

Ejemp o de práctic #: 2.. . /255.255.255.2 (/2)

Dirección de red: 192.168.10.0

Máscara de subred: 255.255.255.0

Ahora respondamos las cinco preguntas anteriores:

{Y ¿Cuantas subredes? Ya que 192 incluye solo 2 bits en 1 (000000), la respuesta debería ser: 2^2 - 2 = 2. (El

menos 2 es la subred cuyos bits de máscara se encuentran todos encendidos y la subredcuyos bits de hosts se

encuentran todos apagados, las cuales no son subredes válidas por defecto).

{Y ¿Cuantos hosts por subred? Tenemos entonces que para el octeto de la máscara solo cuenta con 6 bits de hosts en

0, por lo cual la respuesta debería ser 2^6 - 2 = 62 Hosts.

{Y ¿Cuales son las subredes válidas? 256 - 192 = 64, la cual es la primera subred y también tamaño de bloque.

Seguimos sumando al tamaño del bloque el resultado anterior hasta alcanzar el valor de la máscara: 64 + 64 = 128

(la segunda subred). 128 + 64 = 192 alcanzamos el valor de la máscara pero esta no es una subred válida. Así que

las ubredes válidas son: 64 y 128.

{Y ¿Cual es la dirección broadcast de cada subred? Es el número justo antes del valor de la siguiente subred. La

dirección broadcast de la subred 64 es 127 y la dirección broadcast de la subred 128 es 191.

{Y ¿Cuales son las direcciones IP válidas de los hosts de cada subred?Son los números entre el valor de la subred y el

valor del broadcast.

Página [[ de ? 
Para concluir:

Primer U timo
Subred Máscr Brodcst
0ost 0ost

2.. .4 255.255.255.2 2.. .5 2.. .2 2.. .27

2.. .2 255.255.255.2 2.. .2 2.. . 2.. .

Ejemp o de práctic #2: 2.. . /255.255.255.24 (/2)

Dirección de red: 192.168.10.0

Máscara de subred: 255.255.255.248

{Y ¿Subredes? 248 en binario es 000. 2^5 - 2 = 30 subredes.

6Y ¿Host por subred? 11111 . 2^3 - 2 = 6 Hosts por subred.

6Y ¿Subredes válidas? 256 - 248 = 8 (tamaño de bloque y primera subred). 8 + 8 = 16 (segunda subred). 16 + 8 = 24
(tercera subred). 24 + 8 = 32 (cuarta subred)....232 + 8 = 240 (subred No. 30). 240 + 8 = 248 (valor de la

máscara, subred no válida).

6Y ¿Broadcast de cada subred? Ver tabla de resultados.

6Y ¿Hosts válidos? Ver tabla de resultados.

Primer U timo
Subred Máscr Brodcst
0ost 0ost

2.. . 255.255.255.24 2.. . 2.. .4 2.. .5

2.. . 255.255.255.24 2.. .7 2.. .22 2.. .23

2.. .24 255.255.255.24 2.. .25 2.. .3 2.. .3

2.. .32 255.255.255.24 2.. .33 2.. .3 2.. .3

Página ? de ? 
... ... ... ... ...

2.. .232 255.255.255.24 2.. .233 2.. .23 2.. .23

2.. .24 255.255.255.24 2.. .24 2.. .24 2.. .247

Ejemp o de práctic #3: 0ciendo subnetting de un c se x "en  cbez"

Tomemos el siguiente ejemplo:

6Y Dirección IP: 192.168.10.33.

6Y Mascara de subred: 255.255.255.224.

Primero que todo determine la subred y la dirección broadcast de la dirección IP anterior. Usted puede hacer esto

respondiendo a la pregunta 3 de las 5 preguntas con las que hemos venido trabajando: 256- 224 = 32 (primera

subred y tamaño de bloque). 32 + 32 = 64 (segunda subred). Mire con atención y se dará cuenta que la dirección IP

192.168.10.33 se encuentra comprendida entre la subred 192.168.10.32 y la subred 192.168.10.64. Por lo que

concluimos que la dirección IP 192.168.10.33 está en la subred 192.168.10.32 y que la dirección broadcast de la

subred 192.168.10.32 es 192.168.10.63 (recuerde que la dirección broadcast de una subred es siempre el número

anterior al de la siguiente subred). Por lo tanto el rango de direcciones IP válidas para hosts en la subred

192.168.10.32 es desde 192.168.10.33 hasta 192.168.10.62.

Ejemp o de práctic #4: 0ciendo subnetting de un c se x "en  cbez"

6Y Dirección IP: 192.168.10.33

6Y Máscara de subred: 255.255.255.240.

¿Cual es la subred? 256 - 240 = 16 (primera subred y tamaño del bloque). 16 + 16 = 32 (segunda subred). 32 + 16

= 48 (tercera subred). Por lo que concluimos que la dirección IP 192.168.10.33 está entre las subredes

192.168.10.32 y 192.168.10.48. También podemos decir que la dirección broadcast de la subred 192.168.10.32 es

192.168.10.47. El rango de hosts válidos para la subred 192.168.10.32 es desde 192.168.10.33 hasta

192.168.10.46.

En conclusión...

6Y Dirección IP: 192.168.10.33.

6Y Máscara de subred: 255.255.255.240.


Página ?? de ? 
6Y Subred a la que pertenece: 192.168.10.32.

6Y Dirección de broadcast de la subred: 192.168.10.47.

6Y Rango de hosts válidos: 192.168.10.33 - 192.168.10.45.

::[xONxLUSIONES]::

6Y Siempre, siempre, siempre, siempre [for ($i = 0; $i < 1000; $i++) print "siempre"] (varias veces para que no se le
olvide) se trabaja (se responde a las preguntas) con el Ù timo octeto que nos dan en la mascara de subred.

6Y El valor de la última subred (la que no es válida) se tiene en cuenta simplemente para saber cual el broadcast de la
subred inmediatamente anterior.

6Y Sí, yo sé; tenemos que saber convertir de binario a decimal y de decimal a binario para poder responder
correctamente a las cinco preguntas trabajando únicamente con el último octeto de la máscara de subred.

::[xRE·ITOS]::

6Y Fuente blibliográfica y método: LAMMLE, Todd. CCNA Cisco Certified Network Associate Study Guide. Fourth
Edition.SYBEX.

Página ? de ? 
http://www.netstorming.com.ar/2009/06/08/guia-de-subnetting/

m. 


En este post explicaré cómo realizar una división en subredes, comenzando desde los aspectos básicos y
llegando a incluir temas avanzados como VLSM y CIDR.

El mismo se escribe para que sirva como guía para los alumnos de CCNA pero puede aplicarse para cualquiera
que desee aprender la estrategia de subnetting e incluso como ayuda memoria para quienes ya conozcan el
tema.

   

1.Y Prerrequisitos
2.Y Marco teórico
1.Y Motivación
2.Y ¿En qué consiste la división en suredes?
3.Y Concepto de máscara de subred
3.Y Mecanismo de subnetting
4.Y Cálculo de cantidad de subredes y hosts
1.Y Tabla de potencias de 2
2.Y Cálculo de máscara de subred sabiendo la cantidad de subredes necesarias
3.Y Cálculo de máscara de subred sabiendo la cantidad de hosts
5.Y Calcular la n-ésima subred
6.Y Ejemplo integrador
1.Y Decisión de la máscara de subred
2.Y Cantidad de subredes y de hosts por subred
3.Y Cálculo de subredes solicitadas
4.Y Asignación de IPs a los routers
7.Y CIDR
1.Y VLSM
2.Y Resumen de rutas

 /   

Se asume para el siguiente tutorial que el lector ya tiene conocimiento acerca del trabajo con números binarios.

 , 

Cuando se crearon las direcciones IPv4 se las dividió en cinco clases, con la intención de asignar redes de cada
clase según las necesidades de direccionamiento de cada usuario. Así, se obtuvieron:

Primer Cant. Cant.


Clase Rango Objetivo
octeto redes hosts
Organizaciones
1.0.0.0 ʹ con grandes 2^24
A 0xxxxxxx 2^7
127.255.255.255 cantidades de ʹ2
hosts
Organizaciones
128.0.0.0 ʹ 2^16
B 10xxxxxx de tamaño 2^14
191.255.255.255 ʹ2
mediano y
Página ? de ? 
grande
192.0.0.0 ʹ 2^8 ʹ
C 110xxxxx Pequeñas redes 2^21
223.255.255.255 2
224.0.0.0 ʹ Direcciones de
D 1110xxxx - -
239.255.255.255 multicast
Direcciones
240.0.0.0 ʹ reservadas (para
E 1111xxxx - -
255.255.255.255 investigacion y
otros fines)

El problema que surgió fue que las clases A y B se agotaron muy rápidamente, con lo cuál el número de
direcciones IP disponibles se redujo drásticamente. El gran problema de las clases es que la diferencia de hosts
que cada una admite es muy grande entre sí. Para entenderlo mejor, servirá un ejemplo:

Se tiene una organización con 1000 hosts en su red. Una red de clase C no satisface sus necesidades, dado que
admite como máximo 254 hosts. Entonces, la siguiente opción es una clase B, que tiene una capacidad de
direccionamiento de 65534 hosts. Por lo tanto la organización despediciará 64534 direcciones IP, lo que
representa el 98,47% de las direcciones!

Motivación

Se hizo evidente que la asignación basada en clases era ineficiente para la asignación de direcciones de red. Por
ello se pensó una estrategia para reducir al mínimo el desperdicio de direcciones IP y fue así como se creó el
concepto de subnetting.

¿En qué consiste la división en suredes?

Básicamente, la división en subredes plantea que si una red de clase despedicia muchas direcciones IP entonces
la misma sea dividida en N subredes más pequeñas que aprovechen mejor el espacio de direccionamiento. La
forma más sencilla de entender esto es con un ejemplo.

Suponiendo el caso de la organización anterior para la cuál una red de clase C es muy chica y, a su vez, un red
de clase B es demasiado grande, entonces se puede dividir la red de clase B en redes más chicas que se ajusten
más a las realidades de la organización. De esta manera se podría, por ejemplo, dividir una red de clase B en 64
subredes de 1024 hosts cada una (en realidad 1022, pues la primer y última dirección no pueden utilizarse para
hosts). De esta forma, la organización que antes desperdiciaba el 98,47% de sus direcciones IP ahora
despediciará sólo el 2,34% y quedará la posibilidad de tener direcciones para 63 organizaciones más de similar
tamaño!

Concepto de máscara de subred

El concepto de máscara indica en una dirección IP qué bits son de red y qué bits son de host. Con el uso de
redes con clases, la máscara estaba implícita en la dirección de clase, pues se conocía a priori los bits para red y
los bits para host. Cuando se creó el concepto de subredes también se les asoció una máscara de subred, que
resultó de utilizar bits de hosts para la máscara y de esta manera obtener varias subredes con menos hosts cada
una.

  '  


Partiendo de una red dada, para obtener dos subredes será necesario un único bit, ya que con él pueden
representarse dos números. Si fueran necesarias tres subredes ya se necesitaría un bit más, que daría como
resultado la posibilidad de obtener cuatro subredes. Lógicamente, al utilizar bits de hosts para crear subredes,
cuantas más subredes se necesiten menos hosts podrá albergar cada una.
Página ? de ? 
Con la pequeña introducción teórica ya vista se analizará el procedimiento de subnetting utilizando un ejemplo.
Para ello, se utilizará una empresa ficticia que está dividida en 4 áreas con 55 hosts cada una y cuenta con la red
192.10.10.0.

En primera instancia lo conveniente es tomar la red asignada y escribirla, junto con su máscara, en números
binarios. Así, la red anterior, que según la tabla es una clase C y su máscara es 255.255.255.0 se escribe como:

??  ? ?  ? ?   ÊÊ  
????????????????????????  
     6Ê  !    6Ê 
 6 

Ahora bien, según los requerimientos se necesitan cuatro subredes (una para cada área de la empresa) por lo
cuál deberán tomarse dos bits de la parte de host para representarlas. Entonces lo anterior se podría dividir de la
siguiente manera:

??  ? ?  ? ?  00 ÊÊ  
???????????????????????? 11 
 ss    6Ê !   6Ê 
"!    6Ê  6 

Notar que ahora, los dos bits más significativos de la parte de host forman parte de la máscara de subred. Con
ello, hay 2 bits para subred lo que hace un total de 4 subredes y 6 bits para hosts, lo que significa un total de 64
hosts (62 en realidad). ¿Qué habría pasado si el requerimiento hubiera sido 4 subredes con 70 hosts cada una y
la clase C dada? Simplemente no podría haberse satisfecho porque no hay manera que las direcciones IP sean
suficientes.

x*     " 

Un cálculo muy común al realizar subnetting es el de computar la cantidad de hosts y de subredes que pueden
obtenerse cuando se subnetea. Las cuentas son realmente simples y se basan en las siguientes fórmulas:

 "# Ê" ÊÊ$ 6 bs"Ê  " 


 " # Ê 6  ÊÊ$ 6 bh"Ê   6  

El motivo por el cuál se restan los dos bits en la última fórmula es porque la primer y última IP de una subred
no pueden utilizarse, debido a que la primer dirección es la dirección de subred y la última la de broadcast.

Tabla de potencias de 2

A continuación se presenta una tabla con los resultados para cada potencia de 2, abarcando desde el 1 hasta el
12. Será de gran utilidad para los primeros cálculos y con la práctica ya no será necesaria.

Bits (x) Resultado


1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512

Página ? de ? 
10 1024
11 2048
12 4096

Cálculo de máscara de subred sabiendo la cantidad de subredes necesarias

El primer caso simple es dada una cantidad de subredes obtener la cantidad de bits necesarios para la máscara
de subred. Por ejemplo, si se tiene la subred 170.25.0.0 y se necesitan crear 27 subredes es necesario calcular
cuántos bits se necesitan para representar el número 27. Para ello se puede buscar en la tabla anterior
encontrando que con 4 bits es posible representar 16 direcciones (no alcanza) y con 5 bits se obtienen 32
direcciones. Entonces, la máscara se transformará en:

? ? ? ?  ?? ?   ?   
????????????????   6ÊÊ  
???????????????? 11111   " 

La máscara anterior en decimal sería ´255.255.248.0´.

Cálculo de máscara de subred sabiendo la cantidad de hosts

Para calcular la máscara en base a la cantidad de hosts el mecanismo es muy similar al anterior con una
consideración más y es que al valor de la tabla es necesario restarle 2 unidades (por las direcciones de subred y
de broadcast). Tomando como ejemplo una organización que cuenta con la clase B 181.67.0.0 y está dividida
en varias áreas donde la más grande de ellas tiene 500 hosts, se debe calcular cuántos bits destinar a host.
Buscando en la tabla se ve que la opción adecuada es utilizar 9 bits que nos da un total de 510 hosts.

x  !0 ' 

Suponiendo que se cuenta con la red de clase A 20.0.0.0 y se necesitan 4000 subredes. Siguiendo los pasos que
se han realizado hasta el momento se necesitarían 12 bits para obtener 4096 subredes, con lo que se obtendría lo
siguiente:

? ?         
????????         6% 6 
????????11111111 1111   
  " 

Ahora bien, puede resultar necesario en algún caso obtener una determinada subred. Para ello se realiza una
cuenta muy simple que consiste en representar el número de subred que desea obtenerse menos una unidad en
la posición de los bits asignados para subred. El motivo por el cuál se resta una unidad es porque debe
considerarse la red 0. Se puede ver esto con un ejemplo basados en la subred anterior.

Para obtener la 2000º subred con la división en subredes hechas en el ejemplo anterior se deben realizar los
siguientes pasos:

{Y Escribir el número 1999 en binario.

????? ? 

{Y Ubicar el número obtenido en la dirección IP ocupando la posición de los bits asignados a subred (se realiza en
la segunda línea). Se puede ver que ya se separa el número en dos octetos, utilizando los ocho bits superiores
para el segundo octeto y los cuatro inferiores como los cuatro superiores del tercer octeto. El resto de los bits se
dejan en cero pues son los que corresponden a host.

? ?         ÊÊ  

Página ?r de ? 
? ? 01111101 0000    ?   ÊÊ " 
????????11111111 1111   
  " 

‰)'  
 

Se tiene la red de clase B 146.201.0.0 y se la desea subnetear para el siguiente esquema. Tener en cuenta que el
número de hosts que se especifica ´¶incluye´¶ la dirección IP de los routers.

Los pasos a seguir son:

1.Y Decidir la máscara de subred que se va a aplicar a las subredes.


2.Y Especificar la cantidad de subredes que pueden obtenerse y la cantidad de hosts que pueden direccionarse por
subred.
3.Y Calcular las redes que se piden.
4.Y Asignar las redes para adaptarse a lo solicitado.
5.Y Designar una IP para los routers (suelen utilizarse la primera o última IP del rango).

La resolución se haría de la siguiente manera.

Decisión de la máscara de subred

Para decidir la máscara de subred que se va a utilizar pueden escogerse dos criterios:

{Y Tomando la subred con mayor cantidad de hosts y utilizando dicha información para calcular los bits necesarios
para hosts. De ahí es trivial obtener los bits para subred y, con ellos, la máscara de subred.
{Y Tomando la cantidad de subredes necesarias y eligiendo la cantidad de bits que se necesitan para
representarlas.

En este caso, dado que se provee la información de la red con mayor cantidad de hosts se va a utilizar ese
criterio para elegir la máscara de subred. Para ello, se ve que la subred más grande que tiene 126 hosts. Según la
tabla, se necesitarían 7 bits para cubrir el espacio de direcciones de dicha subred. Entonces:

? ? ? ?? ? ?   ?
 ?   ÊÊ  
????????????????       
???????????????? 11111111 1 ? " 

La máscara anterior surgió de utilizar 7 bits para hosts (los últimos 7 bits de la dirección) y el resto asignarlos a
subred.

Cantidad de subredes y de hosts por subred

Según lo visto anteriormente, para obtener la cantidad de subredes es necesario elevar 2 a la cantidad de bits
para subred. Se puede ver que se cuenta con 9 bits para subred, por lo tanto:

Página ?3 de ? 
 ?

Es así que se puede concluir en que se podrán obtener 512 subredes. La cantidad de hosts por subred ya está
calculada, dado que fue el criterio que se utilizó para obtener la máscara de subred. No obstante, para seguir los
pasos del procedimiento se muestra. Lo que debe hacerse es elevar 2 a la cantidad de bits utilizados para hosts y
al resultado restarle dos unidades.

 ?

Por lo tanto, se concluye que se podrán tener 512 subredes donde cada una de ellas será capaz de tener un
máximo de 126 hosts.

NOTA: es importante notar que cuando se escogió utilizar 7 bits para hosts no queda ninguna vacancia de
direcciones IP en la subred de mayor tamaño, lo que puede ser un problema si se necesita agregar un nuevo host
más tarde a la misma. En ese caso podría tomarse 1 bit más para poder afrontar un crecimiento futuro, aunque
desperdiciando muchas direcciones IP. No existe una regla para decidir, dependerá del espacio de direcciones
con el que se cuente, de la proyección de crecimiento y otros factores más. De cualquier manera, siempre es
recomendable dejar una vacancia de direcciones, aunque sea mínima.

Cálculo de subredes solicitadas

El próximo paso es calcular qué subred corresponde con cada una de las que se pide utilizar. Recordando lo
visto, se debe restar una unidad a la subred a obtener, representar ese número en binario (utilizando todos los
bits dedicados a subred) y luego colocarlo en la posición de los bits de subred. Entonces:

{Y 1º subred: 000000000.

? ? ? ?? ? ? 00000000 0 ?


 ?   ÊÊ ? " 
??????????? ?????11111111 1 ? " 

{Y 3º subred: 000000010.

? ? ? ?? ? ? 00000001 0 ?


 ??  ÊÊ  " 
???????????????? 11111111 1 ? " 

{Y 21º subred: 000010100.

? ? ? ?? ? ? 00001010 0 ?


 ??   ÊÊ ? " 
???????????????? 11111111 1 ? " 

{Y 126º subred: 001111101.

? ? ? ?? ? ? 00111110 1 ?


 ?? ÊÊ ? " 
???????????????? 11111111 1 ? " 

Asignación de IPs a los routers

Para asignar las IPs se utilizará la primera de cada subred, excepto en el caso de las punto a punto. Así las
asignaciones serán:

{Y Router A:
6Y 146.201.0.1
6Y 146.201.10.1
6Y 146.210.62.129

Página ?J de ? 
{Y Router B:
6Y 146.201.0.2
6Y 146.201.1.1

x£

El concepto de CIDR (classless inter-domain routing) se definió en la RFC 1519 como una estrategia para
frenar algunos problemas que se habían comenzado a manifestar con el crecimiento de Internet. Los mismos
son:

{Y Agotamiento del espacio de direcciones de clase B.


{Y Crecimiento de las tablas de enrutamiento más allá de la capacidad del software y hardware disponibles.
{Y Eventual agotamiento de las direcciones IP en general.

CIDR consiste básicamente en permitir máscaras de subred de longitud variable VLSM para optimizar la
asignación de direcciones IP y utilizar resumen de rutas para disminuir el tamaño de las tablas de enrutamiento.

6LSM

La técnica de VLSM (variable-length subnet masking) consiste en realizar divisiones en subredes con máscaras
de longitud variable y es otra de las técnicas surgidas para frenar el agotamiento de direcciones IPv4.
Básicamente, VLSM sugiere hacer varios niveles de división en redes para lograr máscaras más óptimas para
cada una de las subredes que se necesiten.

Trabajando con el ejemplo anterior puede verse que hay 512 subredes con la capacidad de contener 126 hosts
cada una. Suponiendo que, excepto la única área que tiene 126 hosts, las demás áreas no tienen más de 30 hosts
se estarían desperdiciando entonces alrededor de 90 direcciones IP por subred.

También podría darse la situación de, aún teniendo direcciones IP suficientes, no puedan direccionarse todos
los hosts. Nuevamente, se va a trabajar con un ejemplo. Dada la siguiente topología de red, se tiene para asignar
direcciones la clase C 199.210.66.0.

Si se utilizara el esquema tradicional de división en subredes no sería posible asignar direcciones a todos los
hosts, ya que al dividir las subredes para soportar la que requiere 120 hosts quedarían tan sólo dos redes de 126

Página ?[ de ? 
hosts cada una. Con VLSM es posible asignar direcciones para todos los hosts en el esquema anterior haciendo
divisiones sucesivas en subredes más pequeñas.

Los pasos para dividir en subredes utilizando VLSM son:

1.Y Subnetear para la red con mayor cantidad de hosts.


2.Y De las subredes obtenidas, asignar las que mejor se ajusten a las subredes.
3.Y Si aún quedan segmentos de red sin una subred asignada volver al paso 1.

Con el algoritmo anterior se dividiría entonces de la siguiente manera:

1) Tomar el segmento con 120 hosts y subnetear para él. Se necesitan 7 bits para 126 hosts, lo cuál queda bien
para este caso. Entonces:

?? ????? ? ?  ? ?   ? ?   ÊÊ  


????????????????????????    
???????????????????????? 1 ? " 

Se ve que se utilizaron 7 bits para hosts (para direccionar 126 hosts) y quedó tan sólo 1 bit para subred, por lo
que se podrán obtener sólo 2 subredes. Lo que se hará en este caso es asignar la primera de las subredes al
segmento con 120 hosts y la otra se volverá a dividir. Entonces:

{Y 199.210.66.0/255.255.255.128 ʹ Red de 120 hosts.


{Y 199.210.66.128/255.255.255.128 ʹ Red a subnetear nuevamente.

2) Tomar el segmento con 60 hosts y subnetear para él. Se necesitan 6 bits para 62 hosts, por lo que se
utilizarán 6 bits. Quedaría:

?? ????? ? ?  ? ? ?  ? ? ? ÊÊ " 


?????????????????????????  ? " 
????????????????????????? 1 ?   &'" 

En este caso se utilizaron 6 bits para hosts y quedó 1 bit para subred, por lo que será posible obtener 2 subredes
de 62 hosts cada una. El siguiente paso es asignar una de ellas al segmento con 60 hosts:

{Y 199.210.66.128/255.255.255.192 ʹ Red de 60 hosts.


{Y 199.210.66.192/255.255.255.192 ʹ Red a subnetear nuevamente.

3) Tomar el segmento con 22 hosts y subnetear para él. Se necesitan 5 bits para 30 hosts. El resultado será:

?? ????? ? ?  ? ? ??  ? ? ?  ÊÊ " 


??????????????????????????  ?  " 
?????????????????????????? 1 
  &'" 

En la división anterior se utilizaron 5 bits para hosts y nuevamente quedó 1 bit para subred, por lo que será
posible obtener 2 subredes de 30 hosts cada una. Nuevamente se asigna una de ellas al segmento de 22 hosts y
la otra se volverá a subnetear:

{Y 199.210.66.192/255.255.255.224 ʹ Red de 22 hosts.


{Y 199.210.66.224/255.255.255.224 ʹ Red a subnetear nuevamente.

4) Tomar el segmento con 10 hosts y subnetear para él. Se necesitan 4 bits para 14 hosts. Se obtendrá lo
siguiente:

?? ????? ? ?  ? ? ???  ? ? 


 ÊÊ " 
???????????????????????????  
 " 
Página ?? de ? 
??????????????????????????? 1 
  &'" 

Se ve que se utilizaron 4 bits para hosts y quedó 1 bit para subred, con lo que se tendrán 2 subredes de 14 hosts
cada una. Ya casi terminando, se asigna una de las subredes al segmento con 10 hosts y se deja la otra para
subnetear nuevamente para los enlaces punto a punto.

{Y 199.210.66.224/255.255.255.240 ʹ Red de 10 hosts.


{Y 199.210.66.240/255.255.255.240 ʹ Red a subnetear nuevamente.

5) Para terminar se tomarán los dos enlaces entre los routers. Se necesita que cada enlace tenga dos hosts como
máximo, con lo cual se utilizarán sólo 2 bits, quedando 2 bits para subred. Así:

?? ????? ? ?  ? ? ????  ? ? 


 ÊÊ " 
????????????????????????????  
 " 
???????????????????????????? 11   &'" 

En este caso se utilizaron 2 bits para hosts y quedaron 2 bits para subred, con lo que se tendrán 4 subredes de 2
hosts cada una. En este punto ya no se puede volver a hacer una división de subred, pero sí quedarán 2 redes
con 2 hosts cada una libres para una futura asignación.

{Y 199.210.66.240/255.255.255.252 ʹ Enlace entre router A y B.


{Y 199.210.66.244/255.255.255.252 ʹ Enlace entre router B y C.
{Y 199.210.66.248/255.255.255.252 ʹ Red libre.
{Y 199.210.66.252/255.255.255.252 ʹ Red libre.

Se puede resumir lo realizado en un esquema que suele resultar útil para utilizar mientras se realiza el proceso:

? ?  

? ? ? 
()? ? ?  
? ? ?  ()? ? ?   
? ? 
()? ? 
 
? ? 
()? ? 
 
? ? 

 
? ? 
  
? ?   

Para concluir se ve que partiendo de poder direccionar sólo dos de los segmentos se pasó a direccionar todos y
hasta quedando con dos redes punto a punto libres. Esto implica un gran ahorro de direcciones.

Resumen de rutas

El resúmen de rutas se conoce también como agregación de prefijos y consiste básicamente en tomar una
cantidad de direcciones de subred y resumirlas en una sola. La principal utilidad del mismo es ´¶reducir las
tablas de ruteo´¶, ya que en lugar de una entrada por cada subred se tiene una sola entrada de superred.

Por ejemplo, para el caso anterior, suponiendo que existe un router de borde que conecta con un ISP, el mismo
podría publicar las redes:

{Y 199.210.66.0/25
{Y 199.210.66.128/26
{Y 199.210.66.192/27
{Y 199.210.66.224/28
{Y 199.210.66.240/30
{Y 199.210.66.244/30
{Y 199.210.66.248/30
{Y 199.210.66.252/30
Página ??? de ? 
O simplemente publicar la dirección de red que las resume a todas ellas, que es la red:

{Y 199.210.66.0/24

Se ve claramente que se redujeron las rutas publicadas de 8 entradas a sólo 1. Y esto para una muy pequeña red!
Si se lleva a gran escala, como es internet, la reducción de las tablas de ruteo con el esquema anterior es
realmente drástica.

Las ventajas de una tabla de ruteo más pequeña son claras:

{Y Los routers requieren menos memoria para almacenar la tabla.


{Y Se ahorra mucho procesamiento al buscar en una tabla de ruteo reducida.
{Y Los retrasos por enrutamiento son menores.

El procedimiento es el siguiente:

{Y Las redes a resumir deben ser consecutivas.


{Y Se escriben las direcciones IP y se arma la máscara con unos en todos los lugares donde coincidan los bits de las
direcciones.
{Y Se hace un AND con cualquiera de las direcciones IP y la máscara obtenida y dicha ruta, junto con la máscara,
será la ruta de resúmen.

Ejemplo: se tienen las siguientes cuatro subredes consecutivas y se las quiere resumir en una sola.

{Y 192.168.0.0/24
{Y 192.168.1.0/24
{Y 192.168.2.0/24
{Y 192.168.3.0/24

11000000 10101000 000000   ? ?  


11000000 10101000 000000 ?  ? ?? 
11000000 10101 000 000000 ?   ? ? 
11000000 10101000 000000 ??  ? ? 

11111111 11111111 111111   
 

Se ve que las cuatro redes anteriores pueden resumirse con la dirección de superred 192.168.0.0/22.

Página ?? de ? 

e e  s c  2008 12 ejecc -e-s e

EJE E B ETT

‰ese s eéejecc s esey es vee s‰seeséccev


eevssees

ese eseee4 s c se ee esee ce eee
ecc e cyseesej  ss


e e  s c  2008 11 ecc e - -sse- 

e e  s c  2008 11 e-2-cses-e- 

e e  s c  2008 11 e-3-cec-e-sees-se
y   seese e  es e eecee c  e sseese sev
 se eese ee

e e  s c  2008 11 y s-sc -y-c c 
cs sc  es

‰ec esesee
Seesevec c19373yc  sce2552552550e
5sees  e s  eesees esejecc  ceeseees c

es ve eejecc


!  s s e sec see

-"eesecse ee e ce es ee192y223
-" scs ces sc eec 
-‰#e e seeese254
-$es ésevee5seessee  sce255255255 ese v e
ee sve
-"s5seese e se254 s‰s  ec  s e se#  ce %8s  
cesey!e s ss ecsseese cese#e  & e s
sesse e 254"e   ecse s

*c e#e esese!  ecssees

$ee  cc cce#e esse cseeecc

2^>='#e eees

 ees ece()esee v ec ec cec sc e#e es
 ces cs e#e eeesse


2^>=5

c   ev e()se3
‰s eeece3s  sseee s c e#  ce  ecssees

**ee ev sc  sssees



‰ ces3s ey5s  s
‰#e eeesse
2^3=8
‰#e e s ese
2^-2=2^5ʹ2=30 ss
Sees2 e se ece ec secese! ecey

c ?? e? 

c ! c   cs
c # ev scse

255255255224

‰#e 224seccs  e#e  11100000eesc  e ev e# 
ce 

*$ee ssees

‰ev ecee  sv ec sc  ssseesy s c es
ccceev ecee eessees e sce e s s

1F 
 es #e  &  seev ese eeee ce  se256ev 
e ce e scese c 
‰sec
256ʹ224=32

2F 
+! e& es2^ecesccseecee sscv e
ev sc
‰sec
2^5=32



* sye eseesye s

$ece é   c ! s sc  ssseese s  v
ee#e   & s c ‰es s 8seese  sece
c e s c %5sees c ,eee -e3seesSe#seecs es ecc ess
essees se!s se eece e eeeccs  ee
s cs*écces! V"S !c s eey  ecsee#e e
seeseecese s‰e  eec  e& cces eccc es ec ee
V"S !‰s e ey e ‰s e eeseejecc esse#S s




c ??e? 

http://mundoimd.com/2009/03/16/subnetting-cuantas-subredes-i/

 
  £ 
Publicado: 16 de marzo de 2009 | Categorias: Networking
Revisado: 14 de febrero de 2010 | etiquetas: ccna, Cisco, Documentacion, Networking

Primera entrega de una serie de artículos sobre subnetting. En esta entrega vamos a calcular cuantas redes se
obtienen cuando se hace subnetting.

Supongamos que tenemos la máscara 255.255.255.224 y lo aplicamos a un red de clase C, cuantas subredes
obtenemos al aplicar esta máscara ?

Primero pasamos de decimal a binario: 11111111.11111111.11111111.11100000 . Al ser una clase C nos


fijamos SOLO en el último octeto (11100000) que tenemos 3 bits a ³1´ y 5 a ³0³, pero para las redes SOLO nos
interesa los que están a ³1³.

Para calcular cuantas subredes se obtienen debemos usar esta formula: 2n-2, donde n son los bits a ³1³, por lo
que en este caso obtenemos: 23-2 = 6 subredes. Recordar que si usamos el comando ip subnet-zero podemos
usar la primera red de todas, para más información la web de Cisco sobre subnet-zero.

Si cambiamos la red clase C por una clase B, debemos fijarnos en los 2 últimos octetos (11111111.11100000),
ahora tenemos 11 bits a ³1´ por lo que la formula pasa a ser: 211-2 = 2046 subredes.

x '  

³Si cambiamos la red clase C por una clase B, debemos fijarnos en los 2 últimos octetos
(11111111.11100000), ahora tenemos 11 bits a ³1´ por lo que la formula pasa a ser: 211 -2 = 2046 subredes´
hola una cosa q me intriga al hacer el cambio de clase C por B, dices q ³debemos fijarnos en los 2 últimos
octetos (11111111.11100000)´
mi duda es pasando a clase B los dos ultimos octetos no serian (11100000.00000000) y nos daria las mismas
subredes no?

Página ?? de ? 
 
   ££ 
Publicado: 17 de marzo de 2009 | Categorias: Networking
Revisado: 14 de febrero de 2010 | etiquetas: ccna, Cisco, Documentacion, Networking

Segunda entrega de una serie de artículos sobre subnetting. En esta entrega vamos a calcular cuantos hosts se
obtienen cuando se hace subnetting.

Supongamos que tenemos la máscara 255.255.255.224 y lo aplicamos a un red de clase C, cuantos hosts
obtenemos por subred al aplicar esta máscara ?

Primero pasamos de decimal a binario: 11111111.11111111 .11111111.11100000 . Al ser una clase C nos
fijamos SOLO en el último octeto (11100000) que tenemos 3 bits a ³1´ y 5 a ³0³, pero para los hosts SOLO nos
interesa los que están a ³0³, que son hosts por cada subred.

Para calcular cuantas subredes se obtienen debemos usar esta formula: 2h-2, donde h son los bits a ³0³, por lo
que en este caso obtenemos: 25-2 = 30 hosts por subred.

Si cambiamos la red clase C por una clase B, debemos fijarnos en los 2 últimos octetos (11111111.11100000),
tenemos los mismos bits a ³0´ por lo que tenemos los mismos hosts por subred (aunque más subredes).

Cambiemos de máscara por 255.255.240.0 de una clase B. Pasamos a binario:


11111111.11111111.11110000.00000000 . Nos fijamos en los 2 últimos octetos (Clase B) y tenemos 12 bits a
³0´ y volvemos a usar la formula: 212-2 = 4094 hosts por subred.

Página ??r de ? 
 
   "  £££ 
Publicado: 18 de marzo de 2009 | Categorias: Networking
Revisado: 14 de febrero de 2010 | etiquetas: ccna, Cisco, Documentacion, Networking

Tercera entrega de subnetting en la que vamos a validar subnets, hosts y broadcasts.

Vamos a partir de un ejemplo, imaginemos que tenemos que crear subredes a partir de la dirección
192.168.78.0 usando la máscara de red 255.255.255.224 (o /27). Empezamos obteniendo el número base con la
fórmula: 256 ± subnetmask = número base, que en nuestro caso es: 256 -224 = 32. Ahora vamos a calcular las
subredes:

"  ?* ( 


"  * (

"  *
(  
"  
*  (? 
"  *? (? 
"  *? (?  
 ?  (


No podemos sumar 32 a 192 por que nos da 224 que es nuestra máscara de subred, por lo que no es una subred
válida más información en la web de Cisco.

Para calcular el broadcast podemos hacer de 2 formas, sumar 31 (el número base menos 1) a cada subnet (por
ejemplo 32 + 31 = 63) o restar 1 a cada subred superior de la siguiente forma:

"6 "  ?*


?(
"6 "  *  ?( 
"6 "  *? ?(?
"6 "  
*? ?(? 
"6 "  *?  ?(? ?
"6 "  *
?(

Con esto ya tenemos los broadcasts calculados. Para calcular los hosts válidos son los que quedan entre la
subred y el broadcast, por ejemplo para la primera subred sería:

"*? ? 
 6 *? ? ? ? 
"6 *? ? 

Hagamos un par de ejercicios como ejemplos:

1) Usando la máscara 255.255.255.224, cual es al subred a la que pertenece el host 192.168.78.133 y cual
es su broadcast ?

Primero la formula: 256 ± 224 = 32, que es la primera subred 192.168.78.32. Ahora sumamos 32 hasta alcanzar
la IP 133:

"  ?* ( 


"  * (

"  *
(  
"  
*  (? 
"  *?  (? 

Por lo que podemos concluir que:

"*? ?? 
 6 *? ??  ? ?? 
"6 *? ?? 
Página ??3 de ? 
2) Con la IP 172.16.68.17 y la máscara de red 255.255.192.0, buscar la subred a la que pertenece y el
broadcast.
Como antes 256 ± 192 = 64.

"  ?* 
(

"  *

(? 
 ? 
(?  

Por lo que tenemos solo 2 subredes: 172.16.64.0 y 172.16.128.0 (al ser clase B miramos el tercer octeto). por lo
que las 2 subredes completas son:

"*??
  "*??? 
 6 *??
?  6 *???? 
 ???
  ??? ?

"6 *??? "6 *??? ? 

Con esto podemos decir que la IP 172.16.68.17 está en la primera subred 172.16.64.0 y que su broadcast es
172.16.127.255.

Página ??J de ? 
 
   1'  " "£ 
Publicado: 19 de marzo de 2009 | Categorias: Networking
Revisado: 14 de febrero de 2010 | etiquetas: ccna, Cisco, Documentacion, Networking

Cuarta y última entrega de subnetting, donde vamos a aplicar todo lo que hemos aprendido. Recordemos las 2
formulas:

número de subredes = 2n-2, donde n es el número de bits a ³1³.

número de hosts = 2h-2, donde h es el número de bits a ³0³.

Vamos a realizar un ejemplo, tenemos la red 130.175.0.0 y queremos al menos 70 subredes y 500 hosts por
subred. ¿ ´ué máscara de subred debemos usar ?

Empezamos por detectar que es una red de la clase B por lo que debemos mirar los 2 últimos octetos
(00000000.00000000). Ahora vamos a calcular cuantos bits para las subredes son necesarios para ello usamos
la formula 2n-2, vamos probando valores de n hasta que nos dé suficiente para todas las subredes que nos hacen
falta. Vemos que con 7 bits obtenemos 28-2 = 126 (ya que con 6 obtenemos 62 y necesitamos 70), con lo que
los 2 octetos se nos queda de la siguiente forma:

???????  

Tenemos 7 bits a ³1´ para subredes y 9 bits a ³0´ para los hosts, por lo que vamos a comprobar que con 9 bits
tenemos hosts suficientes para los que necesitamos usando la otra formula 2h-2, 29 -2 = 510 hosts así que nos dá
demás.
Ya solo nos queda calcula la máscara que nos dá: 255.255.254.0.

Página ??[ de ? 
x '  '*  '      
Publicado: 19 de septiembre de 2008 | Categorias: Cisco, Networking
Revisado: 19 de septiembre de 2008 | etiquetas: Cisco, Networking

Algunos pueden tener confusiones entre subnetmask y wildcard ya que se tiene la creencia de que simplemente
uno es la inversa del otro, pero no es simplemente eso, aunque casi el 100% de los casos sea lo correcto.
Wildcard es bastante más que la inversa de subnetmask de hecho tiene mucha más potencia y versatilidad

Subnetmask

Aparece de la adaptación de clases (classful) a las subredes (sin clase o classless) hace ya bastante tiempo para
poder aprovechar correctamente el direccionamiento IPv4. Lo que indica la máscara de red es la cantidad de bit
dedicados a la red expezando de izquierda a derecha. Cada clase tiene una longitud fija de bits. Classless
Interdomain Routing (CIDR) se desarrolló para proporcionar una longitud variable de bits de red a partir de
cada clase, por decirlo de una forma sencilla robar bits a la parte de hosts para dárselos a la parte de red dentro
de cada clase. Sólo hay 33 posibles máscaras de subred IPv4, de 0.0.0.0 a 255.255.255.255, o desde / 0 a / 32.

Wildcard

Wildcards define un host o un número de hosts en una subred u octeto y son mucho más flexibles que las
máscaras de subred, ya que no hay requisito de que los bits a 1 estén continuos. Otro punto que se diferencia es
que los bits a tener en cuenta son al contrario que subnetmask, es decir, que el que tiene peso es el 0 y no el 1.
Es muy típico en las listas de acceso (ACLs) que las wildcards aparezcan como la inversa de subnetmak, por
ejemplo, 0.0.0.255 coincide con cualquier valor para el último octeto de una dirección IP en una subnetmask
255.255.255.0. Pero esto no es estrictamente necesario. Se puede conseguir todo tipo de extrañas coincidencias
con una wildcard; algunos ejemplos de ACLs:

{Y Permitir todas las direcciones 192.168.x.1:


{Y 'Ê ? ? ?   
   )  ???????? 

{Y Permitir todas las direcciones PARES 192.168.x.0/24:


{Y 'Ê ? ?    
 
 
 )  ??????? ???????? 

Hay que tener en cuenta que ninguna de las wildcard de arriba son contiguas sino que se compara un lado (IP)
con el otro (wildcard), cada bit es mantenido (si es 0) o ignorado (si es 1) independiente.

Un pequeño truco para determinar la wildcard correspondiente a una subred es restando 255 a cada octeto de la
máscara de subred. Dos ejemplos con sub redes de /25 y /18:

 
?  ?   ? 
   
   ?   

Página ? de ? 
http://www.taringa.net/posts/ebooks-tutoriales/3840923/Que-es-el-subneteo-y-como-hacerlo.html

Subneteo:

Es dividir una red primaria en una serie de subredes, de tal forma


que

cada una de ellas va a funcionar luego, a nivel de envío y

recepción de paquetes, como una red individual, aunque todas


pertenezcan

a la misma red principal y por lo tanto, al mismo dominio.

Porque Subnetear? >>

x  
        
 
 


 

          
 


Página ?? de ? 

 
      
 

 

            

 

        
  x !"  

  




#  
   
   

          
  
   
$


 $
  

%  &  
  

"&          #' 

    
  
        
 

(    
  )*x* +  &  
  

   ,--,--,--,--  &  (    
+ .



(     
        
     
         
   

+ +      
  
  

¿Como rayos se hace?>>

Página ? de ? 
Okz es bien fácil , vamos a tomar de ejemplo una dirección clase C.

Wait ......

1 al 126 Clase A el primer octeto empieza con 0.


128 al 191 Clase B el primer octeto empieza con 10
192 al 223 Clase C el primer octeto empieza con 110
224 al 239 Clase D el primer octeto empieza con 1110
240 al 255 Clase E el primer octeto empieza con 11110

La 127 está reservada para loopback, usada para pruebas en la maquina


local.

(Esto es historia patria): Una IP se divide en dos partes


"Identificador de red" y "Identificador de host", en la mayoría de los
casos es fácil identificar la porción de host y de red con conocer la clase
de la IP. Con el rápido crecimiento de internet y en redes privadas es
necesario la creación de mas direcciones, la estructura actual de clases se
ha extendido prestando bits de la parte de host para tener más redes. Este
proceso es el que conocemos como "Subnetear".

El estándar por defecto de las mascaras de red es el siguiente:


=====================================================
Dirección | Mascara
-----------------------------------------------------
Clase A | 255.0.0.0
Clase B | 255.255.0.0
Clase C | 255.255.255.0
-----------------------------------------------------
Para conocer a la red que pertenece una IP se le aplica la técnica

del "AND" con la algebra booleana :

1 and 1 = 1
1 and 0 = 0
0 and 1 = 0
0 and 0 = 0

Vamos a hacer una ejemplo : Tenemos la ip "206.175.162.21" sabemos


que es una clase C y en binario seria :

11001110.10101111.10100010.00010101

Decimal : 206. 175. 162. 21


Binario : 11001110.10101111.10100010.00010101

También sabemos que la máscara por defecto de una clase C es


255.255.255.0 que en binario seria : 11111111.11111111.11111111.00000000

Página ? de ? 
Si le aplicamos el "AND" resultaría en :

11001110.10101111.10100010.00010101
AND 11111111.11111111.11111111.00000000
-----------------------------------
11001110.10101111.10100010.00000000
*Nota :recordemos que solamente dará "1" cuando los DOS bits sean "1".

El resultado es: 11001110.10101111.10100010.00000000 que en decimal


seria 206.175.162.0 la red a la que pertenece.

Entendiendo esto vamos a empezar a "Subnetear" propiamente.

La clave del Subneteo reside en el hecho de cojer prestado de la parte de


host para la parte de red para crear una subred. Para cada clase de ip's
solo ciertos bits pueden cogerse prestado para utilizarse en la subred.

Clase Bits de Host Bits utilizables


A 24 22
B 16 14
C86

En una red clase C :

MS = Mascara de Subred

#BM = # de Bits en la Mascara

#S = # de Subredes

#HxS = # Host por Subred

MSB = Mascara Subred en Binario (Parte de Red con 1's para


abreviar)
MS #BM #S #HxS MSB
255.255.255.0 24 0 254 1.1.1.00000000
255.255.255.192 26 2 62 1.1.1.11000000
255.255.255.224 27 6 30 1.1.1.11100000
255.255.255.240 28 14 14 1.1.1.11110000
255.255.255.248 29 30 6 1.1.1.11111000
255.255.255.252 30 62 2 1.1.1.11111100

Como vemos a medida que se usan mas bits de host se crean mas

Página ? de ? 
subredes pero disminuye la cantidad de host por subred.

Para determinar el número de subredes y host por subred, para cada


una de las mascaras de subred, tenemos las siguientes formulas :

Numero de Host x Subred = (2 elevado al número de bits usados de hots)-2


Numero de Subredes = (2 elevado al número de bits usados para subnetear)-2

*Nota ~ame* : Se le resta 2, debido a que se reservan para las direcciones


de red y broadcast respectivamente.

Eje: Queremos calcular la cantidad de host x cada subred en una clase C


Subneteada con 2 bits prestados.

Numero de Host x Subred = (2^6)-2 = (64)-2 = 62 Host x Cada Subred


Numero de Subredes = (2^2)-2 = (4)-2 = 2 Subredes

Para saber la máscara le sumamos 24 bits (11111111.11111111.11111111.)al


numero de bits prestados que son dos.

Resultado:

11111111.11111111.11111111.110000:255.255.255.192

Solo nos queda por saber la dirección de red y broadcast de cada subred:

Restamos la máscara de subred a 255.

255-192 = 63 de manera que la Dirección de red de la 1ra subred es 64

Numero de red: 206.175.162.64


Host validos que son "62͟: 206.175.162.65-126
Dirección de Broadcast : 206.175.162.127
Mascara de Subred : 255.255.255.192

Sumamos 64 a la 1ra subred dando como resultado = 128 Dir de red de la 2da
subred.

2da subred

Numero de red: 206.175.162.128


Host validos que son "62͟: 206.175.162.129-190
Dirección de Broadcast : 206.175.162.191
Mascara de Subred : 255.255.255.192

Con los que hemos subneteado nuestra red.

* Comprobemos el "AND" de la dirección "206.175.162.120" para ver a que red


pertenece, haciendo un paneo rápido vemos que está en el rango 65-126 de la
red .64 pero comprobémoslo.

En decimal: 206.175.162.120
En Binario: 11001110.10101111.10100010.01111000

Página ? de ? 
Mascara: 255.255.255.192
En Binario: 11111111.11111111.11111111.11000000

 Ê 6""66   '6



?? ??? ? ? ????? ? ?  ????  

 ?????? ???????????????????? 

?? ??? ? ? ????? ? ?  ? (
 

#6' 6"6

----------------Bonus----------------
Voy a tratar de explicar un poco el tema del uso de la subnet zero y la subnet de broadcast y cuando es
recomendable usarla o no.

No Subnet Zero y No Subred de Broadcast

Originalmente cuando se realizaba el subneteo de una red la fórmula para obtener la cantidad de subredes era
2N - 2, donde "N" es el número de bits robados a la porción de host y "- 2" porque la primer subred y la última
subred no eran utilizables ya que contenían la dirección de la red y de broadcast respectivamente.
Este procedimiento, que se lo puede llamar No Subnet Zero, está explicado en la RFC950 y se generó con el fin
evitar conflictos entre implementaciones, protocolos y tecnologías propietarias.

Se puede usar:
Siempre (sin importar dispositivos, protocolos, etc.).

Subnet Zero y Subred de Broadcast


El uso de la Subnet Zero y de la Subred de Broadcast permite asignar la primera y última subred para su uso. En
vez de usar la fórmula 2N - 2, para obtener las subredes utiliza la fórmula 2N para que no se desperdicien esas
dos subredes.
Este cambio se debe principalmente a la evolución de los protocolos, todos los protocolos modernos soportan
su uso, que hizo que los principales fabricantes de dispositivos consideraran la Subnet Zero por default en sus
equipos. En el caso de Cisco a partir de la versión 12.0 de su IOS lo trae por defecto y para sus certificaciones
toman como única opción su uso. Pueden leer más en la RFC1878 y en el documento de Cisco Subnet Zero and
the All-Ones Subnet.

Se puede usar:
Si estamos seguros que los dispositivos lo soportan.
Si no se denegó su uso con el comando ͞no ip subnet zero͟.
Si el protocolo de enrutamiento es sin clase (RIP v.2, EIGRP, OSPF).

No se puede usar:
Si no estamos seguros o los dispositivos no lo soportan.
Si el protocolo de enrutamiento es con clase (RIP v.1, IGRP).
Si aparecen conflictos con su uso.

Bueno, espero que se haya entendido el tema y no me hagan más preguntas sobre este tema en los tutoriales
Página ?r de ? 
de subneteo. En verdad eluso de una u otra es casi indiferente, yo por mi parte las pocas vecesque subneteo
lo hago sin utilizar la subnet zero, pero para los tutoriales y explicaciones que van a encontrar en el blog utilizo
la subnet zero, que es el método más moderno y que se enseña en el CCNA 4.0 y en otras certificaciones.

Página ?3 de ? 
Gente espero serles de ayuda....
Comentarios y dudas:

fluxfluxor@gmail.com

Página ?J de ? 
+  ".  ,£ 

Muchos habrán notado que al ingresar en algunos sitios web éstos modifican su contenido, incluyendo idioma,
publicidad, textos, etc., dependiendo del país desde el que estamos ingresando, por ejemplo, al ingresar en
www.linksys.com desde Argentina éste nos redirecciona a www-ar.linksys.com, o al ingresar a
www.google.com nos reenvía a www.google.com.ar. Para poder hacer esto la aplicación web busca la IP con la
que estamos ingresando en una base de datos donde previamente se cargaron rangos de IP con su respectivo
país.

Hasta acá todo parece muy obvio, el problema surge cuando nos preguntamos: ¿Dónde conseguimos estas bases
de datos? La respuesta es sencilla: en internet.

En internet hay varios sitios que ofrecen, gratuitamente o como servicio pago, archivos con rangos de IP con su
respectivo país. Muchos de estos sitios ofrecen además web services para poder consultar contra su base de
datos la ubicación correspondiente a una dirección IP sin necesidad de tener los datos alojados en nuestro sitio.
En este artículo voy a mostrar cómo obtener la ubicación consultando los datos en una base de datos local.

Uno de los sitios desde donde se pueden bajar estos datos es WebHosting.Info (www.webhosting.info), un sitio
dedicado a dar servicios y estadísticas sobre ISP, WHOIS, Reverse IP Lookup, etc. Los datos que estos sitios
ofrecen casi siempre están en archivos CSV, donde el país está codificado en ISO 3166 y la dirección IP está
como un entero sin signo de 4 bytes llamado ³número IP´.

Para obtener la lista de códigos de países según la ISO 3166 pueden ver en el sitio mismo de ISO,
http://www.iso.org/iso/country_codes, o en Wikipedia, http://es.wikipedia.org/wiki/ISO_3166-1.
Para convertir la dirección IP en un número IP (un entero de 4 bytes) es una simple fórmula matemática donde
lo que tenemos que hacer es un ³shift left´ de cada número para ³posicionarlo´ en el octeto correspondiente o,
en español, moverlo hasta el byte correspondiente. Como cada byte representa 256 números (de 0 a 255), lo que
debemos hacer es multiplicar cada octeto de la dirección por 256 elevado a la posición de ese byte.
Supongamos que nuestra dirección a convertir es A.B.C.D, entonces lo que debemos hacer es:

+  +  #+ ? + 

Si reemplazamos las constantes por su resultado nos quedaría lo siguiente:

+?? +  #+ 

Ahora supongamos que la IP de mi cliente es la 190.2.8.88, entonces deberíamos hacer:

? +?? + + (


??
 ??  
 (?



Cabe mencionar que para obtener la dirección IP del usuario que se está conectando a nuestro sitio se debería
leer el encabezado de la petición http. Para los desarrolladores de .NET esto se puede hacer simplemente
utilizando la propiedad UserHostAddress del objeto Request del Page, por ejemplo, en C# sería:

 Ê    (, 6 ! 




o, para los usuarios de Visual Basic.NET:

Página ?[ de ? 
Ê'    Ê (, 6 

Obviamente la IP está en un string, con lo cual debería dividir cada octeto de la dirección, convertirlo a un tipo
de dato numérico y hacer la fórmula. A continuación les dejo un ejemplo en C#:

? #6 &Ê 6   6"Ê 


  Ê -. / (, 6  Ê !
 Ê Ê  '6 (

Ê  / - .+ ??


 Ê  / -?.+
 Ê  / -.+
 Ê  / -.!

y, para los usuarios de Visual Basic.NET:

? #6 &Ê 6   6"Ê 


 Ê'  /   Ê ( , 6  Ê 
 Ê' Ê  '6   (0

  /  +?? 0


   / ?+ 0
   / + 0
   / 

Nótese que en el ejemplo utilicé un entero sin signo, esto es porque el número IP no lleva signo. También cabe
notar que, aunque cada octeto se puede representar con un byte, yo lo convierto a un entero sin signo para evitar
la conversión del tipo de dato al almacenarlo en la variable final.

Ahora con este número en mente lo podemos buscar en el archivo con la información de la localización de las
IPs. Obviamente lo mejor es guardar previamente la información de este archivo en una base de datos. Como
mínimo deberíamos guardar la dirección IP y el país. Muchos de estos archivos de IP nos traen una ³dirección
desde´ y una ³dirección hasta´ por cada línea del archivos, pero con almacenar la ³dirección desde´ ya nos
alcanza.
Para los usuarios de motores de bases de datos como Oracle o MySql no tendrán problema con guardar los
números IP en campos enteros de 4 bytes sin signo, pero para los usuarios de SQL Server se nos complica, ya
que este motor no permite utilizar este tipo de datos. Para solucionar este inconveniente podemos hacer dos
cosas: guardar el número en un campo del tipo entero de 8 bytes o a cada número IP restarle 2147483648.

Ahora sólo nos quedaría buscar la IP del usuario en la base, con un script sencillo como el siguiente para SQL
Server:

? #1 12 ?Ê


 2 Ê  
  )(?



2 3 #

Si en SQL Server elegimos utilizar un entero de 4 bytes (int) y restarle la mitad para no utilizar un entero de 8
bytes (bigint) habría que utilizar el valor 1040320600 en lugar de 3187804248.

Si quisiéramos hacer esta misma consulta pero utilizando MySql como motor de base de datos deberíamos
utilizar un script como el siguiente:

Página ?  de ? 
? #1 Ê
 2 Ê  
  )(?



2 3 #
   1?

Bien, hasta acá ya sabemos cómo obtener el país correspondiente a una dirección IP pero, como el título bien
dice, también podemos obtener la ciudad correspondiente a esta dirección. Para esto la solución vuelve a ser
sencilla, solamente tenemos que buscar en internet donde se puede conseguir una lista de IPs correspondiente a
cada ciudad. Un lugar donde se puede obtener esta lista es en IP Location Tools (http://iplocationtools.com),
donde se puede conseguir la lista de país por IP y ciudad por IP, en formato CSV y en SQL. La única diferencia
con el proceso anterior es que en la base de datos, además o en lugar de guardar el país, se debería guardar la
ciudad.

Página ? ? de ? 
http://krow.net/dict/subnet.html

x

0
    

 x x

  4 255.255.255.252 1/64
[ 8 255.255.255.248 1/32
J 16 255.255.255.240 1/16
3 32 255.255.255.224 1/8
r 64 255.255.255.192 1/4
 256 255.255.255.0 1
  512 255.255.254.0 2
 1024 255.255.252.0 4
? 2048 255.255.248.0 8
 4096 255.255.240.0 16
?[ 8192 255.255.224.0 32
?J 16384 255.255.192.0 64
?3 32768 255.255.128.0 128
?r 65536 255.255.0.0 256

m  ! x 


a ?r0
 a  ra 0
 a

  
 
½
  ½
 
% #  % # 
.0 .1-.126 .127 .0 .1-.2 .3
.129- .4 .5-.6 .7
.128 .255
.254 .8 .9-.10 .11
ra r0
 a .12 .13-.14 .15

  .16 .17-.18 .19
½
 
% #  .20 .21-.22 .23
.0 .1-.62 .63 .24 .25-.26 .27
.64 .65-.126 .127 .28 .29-.30 .31
.129- .32 .33-.34 .35
.128 .191
.190
.36 .37-.38 .39
.193-
.192 .255 .40 .41-.42 .43
.254
.44 .45-.46 .47
3Ja  0
 a
.48 .49-.50 .51

 
½
  .52 .53-.54 .55
% # 
.0 .1-.30 .31 .56 .57-.58 .59
.32 .33-.62 .63 .60 .61-.62 .63
.64 .65-.94 .95 .64 .65-.66 .67

Página ?  de ? 
.96 .97-.126 .127 .68 .69-.70 .71
.129- .72 .73-.74 .75
.128 .159
.158 .76 .77-.78 .79
.161- .80 .81-.82 .83
.160 .191
.190
.84 .85-.86 .87
.193-
.192 .223 .88 .89-.90 .91
.222
.92 .93-.94 .95
.225-
.224 .255 .96 .97-.98 .99
.254
J?ra ?0
 a .101-
.100 .103
.102

 
½
  .105-
% #  .104 .107
.106
.0 .1-.14 .15
.109-
.16 .17-.30 .31 .108 .111
.110
.32 .33-.46 .47
.113-
.48 .49-.62 .63 .112 .115
.114
.64 .65-.78 .79 .117-
.116 .119
.80 .81-.94 .95 .118
.96 .97-.110 .111 .121-
.120 .123
.113- .122
.112 .127 .125-
.126 .124 .127
.129- .126
.128 .143 .129-
.142 .128 .131
.145- .130
.144 .159 .133-
.158 .132 .135
.161- .134
.160 .175 .137-
.174 .136 .139
.177- .138
.176 .191 .141-
.190 .140 .143
.193- .142
.192 .207 .145-
.206 .144 .147
.209- .146
.208 .223 .149-
.222 .148 .151
.225- .150
.224 .239 .153-
.238 .152 .155
.241- .154
.240 .255 .157-
.254 .156 .159
.158
[ a r0
 a
.161-

  .160 .163
½
  .162
% # 
.165-
.0 .1-.6 .7 .164 .167
.166
.8 .9-.14 .15
.169-
.16 .17-.22 .23 .168 .171
.170
.24 .25-.30 .31 .173-
.172 .175
.32 .33-.38 .39 .174
.40 .41-.46 .47 .176 .177- .179

Página ? de ? 
.48 .49-.54 .55 .178
.56 .57-.62 .63 .181-
.180 .183
.64 .65-.70 .71 .182
.72 .73-.78 .79 .185-
.184 .187
.186
.80 .81-.86 .87
.189-
.88 .89-.94 .95 .188 .191
.190
.96 .97-.102 .103
.193-
.105- .192 .195
.104 .111 .194
.110
.197-
.113- .196 .199
.112 .119 .198
.118
.201-
.121- .200 .203
.120 .127 .202
.126
.205-
.129- .204 .207
.128 .135 .206
.134
.209-
.137- .208 .211
.136 .143 .210
.142
.213-
.145- .212 .215
.144 .151 .214
.150
.217-
.153- .216 .219
.152 .159 .218
.158
.221-
.161- .220 .223
.160 .167 .222
.166
.225-
.169- .224 .227
.168 .175 .226
.174
.229-
.177- .228 .231
.176 .183 .230
.182
.233-
.185- .232 .235
.184 .191 .234
.190
.237-
.193- .236 .239
.192 .199 .238
.198
.241-
.201- .240 .243
.200 .207 .242
.206
.245-
.209- .244 .247
.208 .215 .246
.214
.249-
.217- .248 .251
.216 .223 .250
.222
.253-
.225- .252 .255
.224 .231 .254
.230
.233-
.232 .239
.238
.241-
.240 .247
.246
.249-
.248 .255
.254

Página ?  de ? 

S-ar putea să vă placă și