Académique Documents
Professionnel Documents
Culture Documents
com/simplify-routing-how-to-organize-your-network-into-
smaller-subnets/2007-11-08/
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.
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.
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.
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.
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.
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 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.
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:
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.
Some IP addresses are reserved to serve certain purposes and they cannot be assigned to hosts. These special
purpose addresses include:
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:
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£
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.
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:
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.
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
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)
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.
What's wrong with this picture??? Well, you can't have a /31. Here's why...
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
When the netmask is only one bit, it can't help but being all zeroes or all ones.
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.
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
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:
(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!
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.
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.
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.
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.
Página de ?
http://www.svrops.com/svrops/documents/subnetshortcut.htm
Subnetting Shortcuts
Class C
Página r de ?
x ss B ± borrowing the 3 rd octet
x ss B ± borrowing in the 4 th octet
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
To find the value of the 4 th octet multiply the remainder (5) times the increment (32)
--------------------------------------------------------------------------------
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
To find the value of the 4 th octet multiply the remainder (0) times the increment (32)
Another Method
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/
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:
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.
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)
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
?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.
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
From the example above it is visible that with this subnet mask the netid and hostid remained unchanged by
bitwise ANDing.
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.
The diagram below shows that when subnetting an IP address the Netid remains unchanged but the Hostid is
further sectioned or divided up.
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"
Before defining a subnet mask, you need to determine the number of segments and hosts per segment
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 C: 192.168.xx.xx
P
Página 3 de ?
http://hubpages.com/hub/ip-tutorial-subnetting
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.
===================================================
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 %
? ?
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?
? ??
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 iYiYYttYY YYYYl YiY
tY tY
tYYYitiY
YYY Yi YYCRYYY
tY YYitll
YiY YiYttYYY Y iYti YtY
Y
tY iYt
YYY
tYYl tYitY
YYi
l
Yl
Y
t YtYt YY
ttiYYYtiYYYYtY tiYYYYYtYtY tY t YY YtYiil
YttY
it Y
YtYlitYYt tY
YYYtYY
iY
YYYitY tillY tl
Y
YtY
YYlitYYY
Y
YCC YitYtYtllYYt
Y
lYYYYtiY
ttiYYY
ti YtYYYiYYtYlitYtYtYY!Ylt YYitYYYlittlY"Y
YYillY
l
Y
Yti Y tYtYitYlYtYiti YYYtY
Yti YtiYiYit YtYi
Y
'Y
YYillYlYtYtY$1)0Yl
YY2
3YYB
Y/++Yi Y//)1)4 Ylt Y YY
Yit YlYY
YYYY1)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:
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«.
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«.
Página ? de ?
//5Y6Y1+Y
1+Y6Y+,,+,,/7+-Y
.Yt YitY).Y t YiYYtY
? ??? ?
? ? ?? ??
? ??
?? ???
? ???? ? Y
¬ ¬ !"#$$% & ' ()* + ¬ ,-,-Y
YlYilitYitY
Y
Y
{Y ?3?r
{Y ÿ ?3?r??3?r?
{Y xÿ
YY
Y
Y
lYliYtYY Yti YYYtY
ilYtYtYY
YY4Y
!
?
? ?
"#
#
?
?
$ %?
?$%
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
+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!
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/
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.
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.
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.
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.
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.
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).
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:
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
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!
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.
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
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.
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.
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).
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.
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.
Página 3 de ?
Subnetting direcciones 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
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.
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)
a) Encontrar todas las subredes para cualquier esquema de subnetting dado (Subnetting)
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.
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:
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)
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:
Página 3 de ?
http://xentron.blogspot.com/
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):
Antes de iniciar con los calculos inicie con la subred que necesite mayor cantidad de Hosts.
x
# Se necesitan 100 hosts.
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.
El direccionamiento final seria el siguiente (los .. significan que existen mas direcciones):
x
# Se necesitan 50 hosts.
x
#? Se necesitan 20 hosts.
Página 33 de ?
Las nuevas redes son las siguientes:
x
a
#
Se necesitan 2 hosts.
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.
#
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:
Para obtener la parte del host, invertir la máscara de subred y otra vez realizar un binario y con la dirección IP:
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:
Operaciones Binarias
{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
Página J de ?
Página J de ?
Página J de ?
http://juanfelipe.net/node/55
Una vez más frente a los routers CISCO. Esta vez la película va de como realizar configuraciones en enrutadores y
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,
1.Y Configurar el enlace WAN entre las sedes de Bogotá y Medellín, adicionalmente tener en cuenta las siguientes
recomendaciones:
2.Y La ciudad de Medellín debe tener tres VLANs creadas para: Usuarios, Proveedores, y Visitantes, las cuales
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
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]::
{Y Mede ín:
6Y Dos swiches:
cY SW-2: Swiche de proveedores y visitantes (dos VLANs - una para proveedores y otra para visitantes).
{Y Bogotá:
6Y Un swiche:
cY SW-1: Swiche de usuarios y servidores (dos VLANs - una para usuarios y otra para servidores).
{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:
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
00 en decimal equivale a 252. Por lo que la máscara de las subredes será 255.255.255.252. Ahora saquemos
las subredes:
8 + 4 = 12 (tercera subred).
...
Para simplificar voy a tomar la primera subred (192.168.0.4/255.255.255.252) para direccionar el enlace WAN entre
Primer U timo
Subred Máscr Brodcst
0ost 0ost
Y solo nos gastamos 2 direcciones de Host de la subred. Tal cual como lo pedía el enunciado.
{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
Página JJ de ?
Subred Máscr Primer 0ost U timo 0ost Brodcst
{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.
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
Ahora, 00000 en decimal equivale a 224. Por lo que la máscara de subred será 255.255.255.224. Saquemos las
subredes.
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
{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
·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
{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
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
{Y En ce WAN
Página [? de ?
... ? .?.?. ? .?.?.
? .?.?. ? .?.?.?
{Y 6L
Y
Ul
au
Y Y Y
Y Y
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.
xomndo ·escripción
clock rate 64000 comunicación, nos toca establecer el reloj para la sincronización
Página [ de ?
Definimos la sub-interface para manejar la VLAN 3
VLAN 3.
encapsulation dot1q 3
ip address 192.168.2.62
255.255.255.224
la VLAN 4.
encapsulation dot1q 4
ip address 192.168.3.62
255.255.255.224
xomndo ·escripción
Página [ de ?
interface fastEthernet 0/1 ROUTER-MED. Como esta interface va a transportar datos de
interface fastEthernet 0/3 interface Fast Ethernet 0/2. Esta interface es la que conecta al
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
SW-USUARIOS(config-if)#
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
::[ARx0I6OS]::
Página [r de ?
{Y Archivo de la topología realizado en Packet Tracer 4.1:
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
::[A TOxAR]::
Lo único que necesita saber para hacer subnetting de una dirección IP clase C es responder a estas simples 5
preguntas:
{Y ¿Cuantas direcciones IP de hosts válidas por subred quedan disponibles? (¿Cuantos hosts por subred?).
En este punto entonces es necesario que usted esté familiarizado y memorice las siguientes potencias de 2.
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
{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
{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
{Y ¿Cual es la dirección broadcast de cada subred? Es el número justo antes del valor de la siguiente subred. La
{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
Página [[ de ?
Para concluir:
Primer U timo
Subred Máscr Brodcst
0ost 0ost
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
Primer U timo
Subred Máscr Brodcst
0ost 0ost
Página ? de ?
... ... ... ... ...
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
¿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...
::[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:
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.
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!
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.
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:
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.
Página ? de ?
10 1024
11 2048
12 4096
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 "
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.
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 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.
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.
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.
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.
{Y 3º subred: 000000010.
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:
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.
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:
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:
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:
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:
3) Tomar el segmento con 22 hosts y subnetear para él. Se necesitan 5 bits para 30 hosts. El resultado será:
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:
4) Tomar el segmento con 10 hosts y subnetear para él. Se necesitan 4 bits para 14 hosts. Se obtendrá lo
siguiente:
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.
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í:
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.
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.
El procedimiento es el siguiente:
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
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
200812ejecc
-e-s e
EJE E B ETT
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
se
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 ?
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).
Página ??r de ?
"
£££
Publicado: 18 de marzo de 2009 | Categorias: Networking
Revisado: 14 de febrero de 2010 | etiquetas: ccna, Cisco, Documentacion, Networking
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:
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*? ?
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:
"*? ??
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:
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:
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:
x
Página ?? de ?
x!"
#
$
$
%
&
"&
#'
(
)*x*
+
&
,--,--,--,-- &
(
+ .
(
++
Página ? de ?
Okz es bien fácil , vamos a tomar de ejemplo una dirección clase C.
Wait ......
1 and 1 = 1
1 and 0 = 0
0 and 1 = 0
0 and 0 = 0
11001110.10101111.10100010.00010101
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".
MS = Mascara de Subred
#S = # de Subredes
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.
Resultado:
11111111.11111111.11111111.110000:255.255.255.192
Solo nos queda por saber la dirección de red y broadcast de cada subred:
Sumamos 64 a la 1ra subred dando como resultado = 128 Dir de red de la 2da
subred.
2da subred
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
----------------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.
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.).
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:
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:
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#:
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:
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
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 ?