Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 65

IP Addressing Part I.

Basic understanding of IP
address.
Now that we know and understand the components, topology and
design of the network, we now have the understanding kung ano nga
ba ito. But I know it’s not enough. 

How these devices  know each other? 

How do they talk? 

Pano nila nalalaman kung kanino sila “makiki-pag-usap or


communicate”? 

That’s what would be our topic now. On this lesson, we are going to
talk about IP addresses. Simula na ito ng mga interesting at exciting
na topic mga idol kaya sit back and relax. 

What is an IP address?

Ano nga ba ang IP address? Bakit nga ba meron nito at saan ito
ginagamit?

Sa isang simpleng paliwag, ang IP address ay isang logical


addressing sytem na ginagamit upang ma-identify ang isang network
or group of computers at kasama na rin ang mga individual or bawat
isang “host” or end devices na member na naturang network. 

Let me explain further.


Kung makikita mo sa sample image natin sa taas, ito ay isang street
sa isang subdivision sa Manila. Para ma-identify n’yo kung saan at
kanino mismo ang mga bahay na ito, meron pa silang specific address
na ginagamit na unique lamang sa kanila.

For example #101 Mahogany st. Tondo, Manila ang complete address
ni Mike. Let’s say magpapadala tayo ng letter kay Mike na nakatira
dito sa Mahogany st., kelangan nating alamin kung saan sa
mahogany st. ang “address” mismo ni Mike. Para malaman ng mail
man kung saan talaga ito i-dedeliver. Hindi pwedeng street lang ang
alam natin.

Bakit? 

Syempre para alam ng mail man kung saan eksatong bahay i-


dedeliver ang letter natin. Hindi makakarating ang letter natin kung
walang specific na “destination address” kung saan natin ito
ipapadala. Hindi pwedeng basta Mahogany street lang.

It could be a waste of time kung magtatanong ang mail man or iisa-


isahin pa n’ya ang mga bahay sa buong Mahogany st. Eh pano kung
sing haba ng Edsa ang Mahogany st. na ito? Tapos maraming Mike
na nakatira doon. Imagine isang letter pa lamang ito para kay Mike.
Pano kung meron din letter na kailangan i-deliver ang mail man sa
Narra st., Yakal st. etc.

Make sense?

Ganun din sa network at mga computers. Lahat ng network at mga


connected devices ay kailangan ng IP address. Ito ay para alam din
ng ibang mga network devices or computers kung kanino at saan sila
makiki-pagcommunicate.

Ang mahogany st. na sample natin sa taas ay maihahalintulad natin


sa isang network address at ang specific address ng mga bahay ang
mismong IP address naman ng mga devices na member ng naturang
network.

Fundamentals of IPv4 address

Since focus tayo sa basic dito sa book, IPV4 muna ang pag-uusapan
natin. Ito rin naman ang karaniwang ginagamit pa sa ngayon sa real
world. In the future lesson, dadaanan din natin ang topic ng IPV6.

Let’s see the basic of an IPV4 (IP version 4) address.

Ang image natin sa taas ay halimbawa ng isang IPV4 address. Ito ay


binubuo ng apat ng grupo ng decimal numbers (0 – 255) at nahahati
sa pamamagitan ng period.
Ang bawat grupo(before the period) ay tinatawag na octet. Kada-octet
or kada grupo ng decimal address ay may katumbas na 8 bits in
binary. In total, ang isang ipv4 ay binubuo ng 32-bit addressing
scheme. Meaning, kung ico-convert natin ang mga addresses sa
binary, it is composed of 32 pieces of 0s and 1s.

Ang isang ipv4 din ay binubuo ng network and host portion. Meaning
its corresponding “network address” or street address kagaya n gating
analogy sa taas at ang mismong “host address” or ang eksaktong
house number address. Let’s talk about them.

Understanding the network and host portion

Sa sample IP address na ipinakita natin kanina, ang IP address na ito


ay nahahati sa dalawang portion, ito nga ay ang network portion at
ang mismong host or end device portion. Kagaya din ng sample natin
sa itaas, kung si Mike ay nakatira sa 105 Mahogany st., ang
Mahogany st. ang maituturing na network address at ang #105 ang
mismong address ng bahay n’ya or ip address ng host or end device. 

Now, pano natin malalaman kung alin ang network portion at host
portion sa isang IPV4 address? Dito pumapasok ang subnet mask.
Let’s see.
Dito sa sample IP address natin kanina, kung ito lamang ang titingnan
natin, hindi natin masasabi or matutukoy kung alin or ano ang network
address portion at host portion dito. Sa pamamagitan ng subnet mask,
malalaman natin kung saan at alin ang network at host portion sa
isang ip address.

Ang mask or subnet mask ang nag-didivide or nag-iidentify kung saan


or alin ang network address portion at alin ang host portion sa isang
ipv4 address. Ito ang nagtatakda kung alin ang “street” at mismong
“house number” pagdating sa networking. The network portion can
start somewhere in an ip address and always goes to the LEFT.
Tapos ang host portion naman can start somewhere in an ip address
and always goes to the RIGHT. 

Let’s give an example.

Dito sa sample image natin sa taas, let’s say ang unang tatlong octet
ang network portion at ang huling octet ang host portion. Ibig sabihin
ang network address natin ay laging magsisimula sa 192.168.1, ito rin
ang street address(Mahogany st.) kung ihahalintulad natin sa
halimbawa natin kanina.
Then ang .1 ang pinaka-ip address ng ating device or host, based dito
sa ating example.

Ang mga possible host or end devices address natin ay magsisimula


sa .1 hanggang .254. Pwedeng 192.168.1(.2, .3, .4 etc.
hanggang .254) kagaya ng nakikita mo sa ating image sa itaas. Ito ay
katulad din sa mga house number na #101, #102 etc.

Ito rin ang pwedeng mga maging house address number kung
gagamitin ang halimbawa natin kanina. Siguro naitanong mo sa sarili
mo, bakit sa .1 nagsimula at nagtatapos sa .254 lang ang usable ip
address sa ating example? Hindi ba kasama ang 0 at 255? Good
question! Here’s why.

Ang pinaka-una at huling address ay hindi maaring gamitin ng isang


device. Hindi ito usable. 

Bakit? 

Kasi ang pinaka-unang address ay ang mismong network


address(192.168.1.0) sa ating halimbawa. Ito ang magsisilbing “street
address” or “Mahogany st.” ng lahat ng mga host or end devices or
houses. Ito ang nakikita at tinatandaan ng mga network devices or
routers para padalhan ng mga packets or traffic. Kumbaga ito ang
tinatandaan ng mga mail man bago nila hanapin ang mismong house
number.

Ang pinaka-huling address naman ay hindi rin pwedeng gamitin dahil


ito ang tinatawag na broadcast address(192.168.1.255). Ang
broadcast address naman ang ginagamit ng mga switch para
padalhan ng brodcast message at para ma-identify kung kaninong
mac-address ang nakaninong port(We will talk about this pagdating sa
switching).

As what you can see on our image above, sa given example natin,
ang mga address lang ng 1 – 254(in the last octet) ang pwedeng ma-
assign sa mga host or computer or network devices. Hindi natin
pwedeng gamiting ang starting address(192.168.1.0 = network
address) at ang last address(192.168.1.255 = broadcast address). 

Gets na ba? 

Now it’s making sense right? 

Ngayon, I know you maybe asking yourself, paano natin nalalaman


kung alin ang network at host portion sa isang ip address?

In our example(192.168.1.1), paano ko nalaman na ang network


address ay 192.168.1.0 at paano ko nalaman na ang broadcast
address ay 192.168.1.255?
If you’re asking that with yourself, then good. That means you’re
getting more curious and you’re learning more. So here it goes.

Ang sample ip address natin ay isang class C ip address(we will talk


about this later), ito ay may “default subnet mask” na 255.255.255.0 or
/24. Sa pamamagitan ng subnet mask, nalalaman natin kung alin ang
network at host portion sa isang given ip address.

Let’s talk about subnet mask.

What is a subnet mask?

Subnet mask is a 32-bit identifier(in binary) that masks an IP address.


It is also written in dotted decimal and divided into four octects like an
ipv4 address. Kapag ini-apply natin ang subnet mask sa isang ip
address, it separates the network portion and host portion.

Kagaya ng nabanggit ko kanina, ang subnet mask ang nagta-takda


kung alin ang network portion(street address) at host portion(house
number) sa isang ipv4 address. 

Ito ay parang isang dividing line kung saan ini-indicate ang start ng
network address at start host address. It also defines the range of
usable IP address na pwede natin magamit sa ating network para sa
mga end devices.
Ang isang ip address ay laging may katapat or kasama na subnet
mask. Ito ang nagtatakda kung saang network or subnet siya
nabibilang. As you can see in our image above, ang subnet mask ay
nag-sisilbing diving line at nagtatakda kung saan nagsisimula at
network address at host address. Remember, the network address is
going to the left ng subnet mask at ang host address naman ay going
to the right. 

In IPv4, Ang subnet mask ang nagse-set sa network bits to all “1”s
and setting host bits to all “0”s. Meaning, kapag converted in binary,
lahat ng 1s ay nabibilang sa network address at lahat ng 0s ay
nabibilang sa host address.  Let’s have an example to make it even
more simple.

For example:

As you can see sa ating example sa taas, makikita mo na ang subnet


mask natin ay 255.255.255.0. And if you take a look at its binary
equivalent, you can see that each 255 is equal to 8 group of 1s.
Meaning, we have 24 consecutive 1s(tatlong octet, 8 pieces of 1s
kada octet, so meron tayong 24 na 1s).

In short format we can write or use /24. Ito rin ang tinatawag na slash
notation.

Bakit 24?

Kasi nga we have 24 consecutive of 1s. Remember na pagdating sa


subnet mask, lahat ng 1s indicates the network portion or network
address. Ang mga 0s naman ay para sa host portion.

So kung makakakita ka ng mga subnet mask na /22 or /23 or di kaya


naman /19. Ibig sabihin lang noon ay meron silang ganun kadami na
consecutive 1s(in binary). 

For example:

/22 = 11111111.11111111.11111100.00000000

/23 = 11111111.11111111.11111110.00000000

/19 = 11111111.11111111.11100000.00000000

If you take a look at our example, ang /22 ay meron 22 consecutive 1s


in binary. Siyempre divided sila into groups of 8 kasi nga ang ipv4 is 8-
bits kada octet. Ganun din sa /23(23 na 1s) at ganun din sa /19(19 na
1s). The rest or yung mga 0s ay para sa host portion na.

Does it make sense?

Let’s dig a little deeper.


Paano naman yung mga subnet mask na nakikita natin like
255.255.255.0. Or di kaya naman 255.255.240.0? Or 255.0.0.0? They
are the same. Ang tawag naman sa kanila ay long format.They are
just a decimal equivalent of those binary digits. For example, kung ico-
convert natin ang walong 1s sa decimal, it will be equal to 255. 

11111111 = 255

11110000 = 240

Remember our conversion from binary to decimal? Or the decimal to


binary? This is how they come into play. 

Let’s have a little refresh. 

To convert binary into decimal, nilalagyan or tinatapatan natin ng


digits na 1, 2 , 4, 8, 16, 32, 64, at 128(from right to left) ang kada-
binary digit(since 8-bits ang ipv4). Tapos ia-add or pagpa-plus-in lang
natin ang mga values na nasa tapat ng 1. Pwede na natin i-ignore ang
mga 0s. Parang ganito.

Katulad nang nakikita mo sa image natin sa taas, it’s the same


process when we look and how we get those decimal values sa long
format ng subnet mask. Ginagawa natin ito kada-octet sa ating ipv4
dahil meron tayong 8-bits kada-octet. Kung lahat sila ay 1s, they will
be equal to 255.
Kagaya ng ating example kanina, ganito siya kinuha.

Ngayon gets mo na idol?

Masalimuot at mahaba ba? 

I know, pero medyo lang. Right? 

And don’t worry, I have a good news. What I showed you is the long
process kung paano ito tingnan at paano ito nangyayari. There’s a
better way and shortcut kung paano sila kunin at malaman ng hindi
dumudugo ang ating ilong. 

Isipin mo yun, meron pala shortcut bakit ko pa dinaanan ang


mahabang proseso? 

That’s because I want you to see how both of them works and I want
you to understand both of the concepts. That way mas mauunawaan
at mas magiging madali para sayo ang mga future lessons and topic
natin na may kinalaman ditto.

Are you ready for the shortcut?

Let’s dive in.

Ninja-way of subnet mask


Earlier, pinag-usapan at ipinakita ko sayo kung papaano nakuha at
paano na-coconvert an gating mga subnet mask. Ang problema, that
was a long process. And it will take time. On this one, we will going to
use the “ninja-way of mastering the subnet mask”.

I want you to look at the green numbers(128, 192, 224, 240, 248, 252,
254, 255). Paki-ignore mo na lang muna yung mga nasa taas, we will
talk about them in the future lessons.

Those fingers with green numbers represent 1s in our subnet mask.


Kung saan nakatapat ang huling 1 natin from our consecutive 1s, ang
katapat na subnet mask values nito an gating decimal subnet mask
value. Sa parehong pagkaka-sunod, from left to right.
For example, kung meron kang /24(in short format). Alam natin na
meron tayong 24 consecutive 1s. Parang ganito:
11111111.11111111.11111111.00000000. Ngayon, kada-octet nay an
at katumbas din ng ating subnet mask values.

First octet: 11111111 (you can see na ang huling 1 natin ends at 255
subnet mask value).

Ganun din sa second octet: 11111111(our last 1 is at 255 subnet


mask value).
Siyempre ganun din sa 3rd octet: 11111111(the last 1 is at the 255
subnet mask value).

Since ang last octet natin is 00000000, alam na natin na ito ay para sa
host portion. At kagaya ng nabanggit natin kanina, ang host portion
are all 0s sa ating subnet mask. We do this process in every octet.
Meaning 4 na beses kasi 4 octets meron tayo sa ipv4. 

Now, let’s take a look at some other examples.

What if we have 11111111.11111111.11110000.00000000. What’s


the decimal subnet mask equivalent of it? 

Instead na i-convert natin ito into decimals, we can use our fingers to
easily get them. Here’s how:

Since ang first and second octets ay all 1s, alam na natin na ito ay
255. 

Ngayon, in our 3rd octet we can see that we have 4 consecutive


1s(11110000). At ang last 1s natin ay nasa pang-apat na daliri(kung
itatapat natin). That means our subnet mask value for the 3rd octet is
240. Last octet will be 0 since 0s na sila.

That means, in our example we have 255.255.240.0 as subnet mask.


Ginamit natin ang process in all of the octets(maliban sa last octet kasi
0 naman na lahat). Even if we compute or convert those binary into
decimal, 240 pa rin ang lalabas sa sagot natin.

Does it all make sense now?


So if we have /25 meaning we have 25 consecutive
1s(11111111.1111111.11111111.10000000). Or 255.255.255.128.
Bakit 128? If you take a look at the last octet, ang last 1 natin ay nag-
end sa first finger(from left to right) na merong subnet mask value na
128.

If we have /30 meaning we have 30 consecutive


1s(11111111.11111111.11111111.11111100). Or 255.255.255.252.
Kasi ang last 1 natin ay nag-end sa 6th finger(from left to right) na
merong subnet mask value na 252.

If we have /12 meaning we have 12 consecutive


1s(11111111.11110000.00000000.00000000). Or 255.240.0.0. Kasi
ang last 1 natin ay nag-end sa 4th finger(from left to right) na merong
subnet mask value na 240.

If we have /21 that means we have 21 consecutive


1s(11111111.11111111.11111000.00000000). Or 255.255.248.0. Kasi
ang last 1 natin ay nag-end sa 5th finger(from left to right) na merong
subnet mask value na 248.

Gets na? Super easy right?

Now, where do we get all these subnet mask. Alam na natin kung
paano tingnan at basahin pero san natin ito kinukuha? I mean, paano
natin malalaman ang subnet mask ng isang given ip address?

Dito pumapasok ang susunod natin na topic which is ip address


classes.

Ang mga ip address ay nahahati into different classes. At kada-class


ng ip address ay merong mga default subnet mask.

Meaning, kapag nakita natin ang isang ip address, kelangan natin ma-
identify kung anong class siya nabibilang para malaman natin ang
kanyang default subnet mask. With that, malalaman na natin kung alin
ang network address, broadcast address at iba pang impormasyon
about that ip address. 

Let’s go and talk about ip address classes.

IP Addressing Part II. IP address classes and


Private/Private IP address
Sa Part I, pinag-usapan natin ang pinaka-basic ng ip addressing.
Ngayon naman, itutuloy natin ito. Ang pag-uusapan naman natin
ngayon ay about IP address classes and Private IP address. 

IP Address classes

Sa IPv4 addressing, meron tayong tinatawag na classes ng mga IP


address. Ito ang mga sumusunod.

Sa image natin sa itaas, makikita mo na meron tayong 5 classes of ip


addresses. Pero 3 classes lamang ang usable sa mga yan. Sila ay
ang class A, class B and class C. Ito ang mga usable IP addresses
para sa network at sa mga host or end devices. 

Ang class D(224 – 239) & class E (240 – 254.x.x.x) ay hindi ginagamit
dahil ito ay for multicast(class D) and reserved sa research or future
use(class E). Hindi na rin natin isinama sa range ng class A ang
0.0.0.0 dahil s’ya ay ginagamit naman sa default routing. At ang range
din na 127.x.x.x ay hindi kasama dahil ito naman ay ginagamit sa
loopbacks.

So in real world, talagang ang mga class A, B and C lang ang


ginagamit as usable ip addresses in the network.

By knowing the ip address classes, we can now identify kung anong


class ang isang given ip address. 

Paano? 

By looking at its first octet numbers.

For example kapag nakita natin na ang umpisa ng isang given ip is


between 1 and 126, that means it’s a class A ip address. Kung nag-
start sa 128 hanggang 191, it’s a class B. Then kung ang start naman
is 192 hanggang 223, it is a class C ip address. 

Again, by looking on the first octet, kailangan lang natin matandaan


kung saang range pumapasok ang naturang ip address. If the ip
address starts with 10, that means it’s a class A. If it starts with 20,
class A pa rin. If it starts with 121 class A pa rin. 

Examples of class A ip address: 10.10.10.1, 125.100.10.1,


121.10.10.1.

As you can see, ang first octet nila ay pasok sa range ng class A ip
address(1 – 126). Again, ang kailangan lang natin tingnan ay ang first
octet. 

Examples of class B ip address: 128.1.1.1, 130.10.10.1, 190.10.10.1


If you take a look, their first octet(128) belongs to class B range(128 –
191). Again ha, first octet ang ginagawang batayan. 

Examples of class C ip address: 192.168.1.1, 200.10.10.1,


195.10.10.1

Ganun din. Ang mga first octet nila ay nabibilang sa range ng class C
ip address (192 – 223). Madali lang di ba? 

So kapag nakakita ka ng isang ipv4 address, tingnan mo lang ang


unang octet and boom! Malalman mo na agad kung saang class siya
nabibilang.

Kung ang UNANG OCTET ng given IP address ay nagsisimula or less


than sa 126, ito ay pasok sa class A. Kung ito naman ay less than or
nagsisimula sa 191 pasok ito sa class B then kung less than or
nagsisimula sa 223 pasok ito sa class C. 

So ang technic, tingnan mo yung FIRST OCTET ng given IP address,


then isipin mo kung nagsisimula or less than ba sila sa 126, 191 or
223. From there madali mong makukuha kung saan class ng IP
address sila pasok.

More examples:

10.160.193.129 – class A IP address


139.81.218.58 – class B IP address
203.55.45.100 – class C IP address

By just looking at the first octet, alam na agad natin kung anong ip
address class sila pumapasok. To make it easier to remember, we
can summarize the ip address classes like the sample image below.
Two Reasons why we need to know IP address classes

Una, kailangan natin maka-bisado ang mga classes na ito dahil


kasama ito sa CCNA exam. 

For example, sa exam, may mga random questions na what class of


ip address is 10.25.26.254? 

So para masagot mo ito ng tama, dapat kabisado at naiintindihan mo


ang table natin sa taas. Para mas madali mo itong matandaan, ang
pinaka-madaling technic ay kabisaduhin mo ung octet or number
before the period or dot. In short, ito lang ang kailangan mong
tandaan, 126, 191 and 223. Base dito maari mo ng malaman kung
ano ang class ng isang IP address.

Pangalawa at ang pinaka-importanteng dahilan kung bakit natin


malaman at makabisado ang classes ng IP address ay para malaman
din natin ang kanilang default subnet mask. Kung natatandaan mo,
nabanggit natin sa previous lesson na ang subnet mask ang
nagtatakda kung alin ang network portion at host portion sa isang IP
address. 

Ang mga classes ng IP address na napag-usapan natin sa itaas ay


may kanya-kanyang default subnet mask.
Sa sample image natin sa itaas, ipinapakita ng table kung ano ang
default subnet mask ng bawat class ng IP address. Nakikita n’yo rin
ang kanilang kaukulang slash notation format. 

Sa ating class A ip address, ang default mask nito ay 255.0.0.0 or /8.


Ibig sabihin, ang first octet ay para sa network portion at ang 3
remaining octets ay para naman sa mga hosts
(Network.Host.Host.Host). Ibig sabihin, ang first octet ng subnet mask
natin kung binary ay 11111111.00000000.0000000.00000000. Ito ay
katumbas din nga ng /8(8 consecutive 1s) or 255.0.0.0 in long format.

Sa class B ip address naman natin, ang default subnet mask ay


255.255.0.0 or /16. So ganun din, meron tayong 16 consecutive 1s
kung binary(11111111.11111111.00000000.00000000). Sa slash
notation or short format ito ay /16 or in long format naman ito ay
255.255.0.0.

Pagdating naman sa class C ip address, same concept lang din. So


this time, we have /24 or in long format 255.255.255.0. Ito ay
katumbas din ng 24 consecutive 1s in
binary(11111111.11111111.11111111.00000000).

Ano ang relasyon ng ip address class sa ating subnet mask? Well,


gaya nga ng sinabi ko kanina, each ip address class has their own
default subnet mask. Meaning pagnaka-kita ka ng isang ip at nalaman
mo kung anong class ito, automatic alam mo na din ang kanyang
default subnet mask.  
For example, ang given ip natin ay 10.10.10.1. From our table, alam
natin na ito ay isang class A ip address. At based from that, alam natin
na ang default subnet mask ng class A na ip address ay /8 or
255.0.0.0. Ibig sabihin, ang network portion ay ang first octet na 10,
and the last 3 octets ay for hosts.

Kung ang given ip natin ay 195.10.10.1, alam natin na ang default


subnet mask nito ay /24 or 255.255.255.0 dahil ito ay isang class C ip
address. Ibig sabihin, ang network portion niya ay 195.10.10 at ang
host portion niya ay 1 – 255. Again, kagaya ng napag-usapan natin,
hindi kasama ang first ip(dahil it ay network address) at ang pinaka-
huling ip ng isang subnet(dahil ito ay broadcast address).

Does it make sense? 

Kung medyo hindi agad makuha, break muna then basa ulit. Lalo sa
mga beginners. It can take time pero once nan a-gets mo ito, tuloy-
tuloy nay an.

Let’s move on.

Private and Public IP address

Kung kanina, classes ang pinag-usapan natin, let’s talk about public
and private ip addresses on this one.  Kada-class(A, B or C) ng ating
ip address, meron tayong tinatawag na public and private ip address.
From the word itself, ang private ip address ay ang mga ip address na
pwede natin magamit privately.

Meaning, inside our organization or our company. Ang mga public ip


addresses naman ay siyang ginagamit sa internet or outside our
organization.
Take note, hindi mo pwedeng magamit or hindi gagana outside or in
public ang mga private ip addresses. It can only be used inside our
organization.

Sa image natin sa itaas, ipinapakita ang mga private ip address na


pwede natin gamitin sa loob ng isang organization or internal network.

Bawat classes ng IP address ay may naka-define na private IP


address range na maaring gamitin ng isang company or organization.

Ginagamit ang mga ito upang ma-segragate ang mga addresses na


ginagamit internally at sa public gaya ng internet. At ang mga private
ip addresses na ito ay hindi maaring gamitin in public or sa internet. 

Pano ito nangyayari at pano ito gumagana? 

Let’s see.
Sa isang internal network or kahit sa inyong bahay, most likely na
pasok sa alin man sa private ip address range na nasa sample natin
ang iyong ip address. Kagaya nga ng sinabi ko, ito ang ginagamit
internally at hindi pwedeng gamitin outside or in public. 

Kapag tayo ay nag-browse sa internet or sa labas ng ating internal


network, dumadaan tayo sa router at itina-translate nito ang ating
private ip address into a public ip address. Ito ang tinatawag na NAT
or network address translation. Pag-uusapan natin ito in the future.

All private ip addresses going out to internet are being translated into
a public ip address. This process is called NAT(Network Address
Translation).

Let’s say ang ip ng iyong pc ngayon (run ipconfig in command prompt)


ay 192.168.1.5, that is a private ip address at ang nakakakita lamang
nito ay ang ibang devices na naka-connect din sa iyong network or
iyong router (internal!). 

Pag-browse mo ng internet, let say nag-login ka sa facebook, hindi


nakikita ni facebook at ng ibang users or network na ang ip mo is
192.168.5. Ang nakikita ni facebook or ng iba ay ang iyong public ip
address which is ang ip address na allocated ng iyong ISP (PLDT,
Globe, Bayan etc.). 

You can check your private ip in the command prompt by using the
command ‘ipconfig’. Then you can check your public ip by going to
whatismyip.com Try and see. 

Now you understand?

Remember, sa bawat classes ng IP meron tayong private and public


ip addresses. To make it more easier to understand, please see
image below that shows the private and public ip ranges.

Para sa karagradagang kaalaman, ito ang hierarchy kung papaano


na-aasign at namamange ang mga public ip addresses natin over the
internet. 

Ang IANA(Internet Assigned Numbers Authority) ang nagde-delegate


sa mga RIR(Regional Internet Registry) upang mag-organize at mag-
manage ng allocation at registration ng mga internet number
resources within particular region sa buong mundo. 

Kasama dito ang IP addresses(public) at mga AS or autonomous


system numbers. Under IANA, meron tayong kabuuang limang RIRs.
Ito ang mga sumusunod.

 African Network Information Center (AFRINIC) for Africa


 American Registry for Internet Numbers (ARIN) for the United
States, Canada, several parts of the Caribbean region, and
Antarctica.
 Asia-Pacific Network Information Centre (APNIC) for Asia,
Australia, New Zealand, and neighboring countries
 Latin America and Caribbean Network Information Centre
(LACNIC) for Latin America and parts of the Caribbean region
 Réseaux IP Européens Network Coordination Centre (RIPE NCC)
for Europe, Russia, the Middle East, and Central Asia

Ito naman ang world-map view ng mga RIRs na ito.

 Para mas maintindihan pa natin kuna papaano na-aassign ang public


IP address or internet address dito sa atin, ito naman ang hierarchy ng
APNIC(Asia-Pacipic) kung saan tayo nabibilang. Image was taken
from APNIC official website.
Ang ISP na nakikita natin sa image ay ang mga internet providers
natin gaya ng PLDT, Globe, Bayan etc. Then tayo yung mga EU or
end users.

Woohooo!

Another long lesson pero I’m sure marami kang natutunan idol.

I hope by this far, you now understand the basics and fundamentals of
IP addressing. Kung papaano nalalaman ang mga classes, kung ano
ang mga default subnet mask nito at kung para saan ito in general.

In the CCNA Masterclass, we get deeper into this. We have more


examples how it is being use in the real world and more deeper
explanation in videos. If you’re interested, send me an email or wait
for my announcement when it will be open again. For now, enjoy the
free lessons we have here on the blog.

Let’s keep moving.


How to subnet. Subnetting tutorial for beginners
Part I
Maraming tanong sa CCNA exam ang tungkol sa subnetting at
syempre ito rin ay magagamit natin sa “real world” kapag tayo ay nag-
tatrabaho na bilang isang network administrator. 

I decided to divide this lesson into five main parts(bonus na yung Part
V) para mas maging madali para sa katulad mong nagsisimula pa
lang na matutunan ang pagsu-subnet. I assure you na isa ito sa mga
importanteng skill na dapat mong matutunan if you want to pass the
exam and if you want to become a good network engineer. 

Part I. Subnetting Fundamentals

You may be wondering bakit meron tayong nakikita na class A ip


address pero using different subnet mask(for example 10.10.10.0/24).
It’s called a subnetted networks. Or subnet. Ginagawa ito para ma-
organize at ma-manage ng maayos ang mga ip addresses natin.

Let’s dive in.

What is subnetting?

Kung matatandaan n’yo, sa Part II ng ating IP addressing lesson ay


pinag-usapan natin ang IP address classes. Kasama ng mga IP
address classes na ito ay ang kanilang mga default subnet mask.
Ito din ay tinatawag din na classful addressing or pagsunod or
paggamit ng mga default subnet mask. Katulad ng nakikita n’yo sa
sample image natin sa ibaba. At gaya nga ng sabi natin, ang subnet
mask ang nagtatakda ng network portion at host portion sa isang IPV4
ip address.

In real world or sa mga real networking scenario, kadalasan na hindi


ginagamit ang mga default subnet mask or classful addressing. Ang
kadalasang ginagamit ay ang classless addressing. Ito ay ang pag-
gamit ng customized na mga subnet mask para sa mga IP addresses.
Ito rin ang tinatawag na subnetted networks. 

Ang subnetting ay ang proseso ng pag-customize ng default subnet


mask para i-extend ang network portions ng isang IP address. Ito ay
ginagawa sa pamamagitan ng pag-hiram or “pag-steal” ng mga bits
galing sa host portions.

Sa pamamagitan ng subnetting, maari nating ma-accomodate ang


required number of needed network/s for a given IP address.

For example, kailangan nating mag-create ng 3 new networks para sa


ating existing network na 192.168.1.0/24.

Ibig sabihin, sa 192.168.1.0/24 din manggaling ang ating new


networks. Magagawa natin ito sa pamamagitan ng subnetting.
Kailangan lang nating “manghiram or mag-steal ng bits” galing sa host
portions para ma-accomodate ang hinihinging number ng new
networks.

Let’s see how that works.


How to subnet. An easy way of subnetting.

Ngayon idol, ito ang isa sa pina-importanteng skill na dapat nating


matutunan bilang CCNA. Hindi lamang para sa CCNA exam kundi
para na rin sa real world scenario. Malaki ang maitutulong nito para
maipasa mo ang CCNA certification exam at maintindihan kung paano
ito ginagamit sa real networking world.

Maraming ways at paraan ng subnetting. They can all be accurate and


correct. Pero ang subnetting tutorial na ituturo ko sa inyo ay ang
pinaka-madali at pinaka-mabilis na paraan ng subnetting na aking
natutunan. 

Sa subnetting questions sa CCNA exam, oras ang kalaban mo so


kinakailangan mo na mabilis magawa or ma-solve ang mga subnetting
questions. Maximum of 1 minute per questions! Although maraming
subnetting tutorial ang available sa internet, mostly ay English at
super technical ng mga explanations kaya hindi agad natin ma-adapt
or matutunan lalo na ng mga beginners. Kung problema mo ang
subnetting at nahihirapan ka, ito na ang sagot. Padadaliin at
pabibilisin natin sa maliwanag na paraan upang ma-solve ang iyong
problema. Let’s go!

Sa given example natin kanina, naatasan tayong mag-create ng 3


new networks sa ating existing network na 192.168.1.0/24. Para
madali at mabilis natin itong makuha, kailangan nating i-identify ang
sumusunod.

 No. of networks needed


 No. of bits “stolen or borrowed“
 New subnet mask

Yung number of networks needed is of course given na sa ating


questions which is 3. Ang kailangan natin alamin is yung no. of bits
needed to steal or borrow sa host portion para ma-accomodate ang
hinihinging number of networks. Dito papasok ang pag-gamit ng ating
mga fingers or tinatawag ding finger subnetting. Let’s continue.

Para naman makuha natin ang number of bits needed to


accommodate the given networks(3 in our example), kelangan lang
natin gamitin ang ating mga daliri sa pagbilang ng bits starting from 2
then duplicating or doubling itself(2, 4, 8, 16, 32, 64, 128 and so on if
needed) from right to left hanggang sa ma-accomodate na natin ung
hinihinging bilang ng network.

To do this, tingnan mo lang yung kanang kamay mo na nakatalikod


sayo(yung parang nanunumpa) gaya ng nasa larawan sa taas. Then
starting from hinliliit, magbilang ka starting from 2 then gaya ng sinabi
ko kanina, doblehin or duplicate mo lang yung value hanggang
makuha mo yung needed number of networks. 

So sa ating example, 3 networks ang needed natin. Magbilang tayo


from hinliliit starting from 2 hanggnang ma-abot or ma-accomodate na
natin yung 3 na bilang ng networks na kelangan.
Therefore sa value pa lang ng pangalawang daliri(4) pasok na yung 3
networks na hinahanap natin. So dalawang bits lang ang
kailangan(kung ilan yung bilang ng daliri na nagamit).

So ang number of bits stolen or borrowed natin is 2. Balikan natin


yung mga kelangan.

Given IP/Network: 192.168.1.0/24

 No. of networks needed = 3


 No. of bits = 2
 New subnet mask = ?

Para naman makuha natin ang new or bagong subnet mask, napaka-
simple lang. Ito ang secret formula.
Sa ating example, NSM = 24 + 2. Saan naman nanggaling ang /24?
Sa default subnet mask! Ang ip address na 192.168.1.0 ay isang class
C ip address at may default subnet mask na 255.255.255.0 or /24.

So ang new subnet mask natin is 26 or /26 or in long format is


255.255.255.192. Therefore we can conclude na para makapag-
create tayo ng 3 new networks from 192.168.1.0/24 our new
subnetted network is 192.168.1.0/26.

Pano naman nakuha yung 255.255.255.192? It’s just the long format
of /26. Kung babalikan mo yung subnet mask topic natin sa naunang
lessons, we know that a /26 is composed of 26 consecutive 1s in
binary(11111111.11111111.11111111.11000000).

We also know that each 8 consecutive 1s is equivalent to 255 in


decimal. So for the first 3 octets, since lahat sila ay 1s, we can say na
meron na tayong 255.255.255.

Then on the last octet, we just have to look where ‘the last 1s’ end and
remember the subnet mask value ng finger natin(see photo below).
Using our formula, sa unang given network natin, given na yung /24
diba, so ibig sabihin yung first 3 octets ay 255 na or 3 groups of eight
1s (11111111.11111111.11111111.?). 

Ang kailangan lang natin is yung last octet kung saan tayo nanghiram
ng bits. Before tayo manghiram ng bits, ang bits ng last octet ay eight
0s(00000000) kasi nga siya ay para sa host. Remember, ang /24 ay
katumbas din ng 255.255.255.0(or
11111111.11111111.11111111.00000000). 

After natin manghiram ito ay magiging 11000000 na. Ibig sabihin yung
dalawang bits na hiniram natin is ginawa nating 1. Kagaya ng
nabanggit natin sa mga unang lessons, sa subnet mask ang 1s ay
para sa network portion at ang 0s ay para sa host portions in binary.
At ang subnet mask value ng 11000000 in decimal is 192. Even if you
convert or compute that from binary to decimal, 192 pa rin. 

Make sense idol?


Madali lang diba? 

Kung hindi agad nakuha idol, break muna. Basahin at balikan ulit
kapag medyo unwind na.   Kung meron ka naman ng existing way
of subnetting at mas mabilis at bihasa ka na doon, mas ok na dun
kana mag-focus. Sabi ko nga, maraming paraan basta kelangan
nagagawa mo ng mabilis.

Let me summarize.

 Ilang networks ang kailangan


 Ilang bits ang nagamit mo(bilang ng daliri) para ma-accomodate
mo yung bilang ng networks na kailangan(RIGHT TO LEFT sa
ating example)
 New Subnet Mask(NSM) = Old Subnet Mask(OSM) + No. of bits
borrowed

Let’s see more examples.

A.) 201.50.65.0/24, 10 networks >>> 4 bits | NSM = /28 or


255.255.255.240 | New subnetted network = 201.50.65.0/28

Explanation: Sa pagkuha ng bits, ang value ng fourth finger natin is


16(2,4,8,16) | Sa pagkuha ng subnet mask, ang value ng 4th finger is
240(128,192,224,240) | NSM = OSM + Bits or /24 + 4 = /28
(255.255.255.240)

B.) 160.40.0.0/16, 1000 networks >>> 10 bits | NSM = /26 or


255.255.255.192 | New subnetted network = 160.40.0.0/26

Explanation: Sa pagkuha ng bits, ang value ng 10th finger natin is


1024(2,4,8,16,32,64,128,256,512,1024) | Sa pagkuha ng subnet
mask, ang value ng 2nd finger is 192(128,192) Dito nasa 4th octet
kana kasi ung first 3 octets ay puro 1s na or 24 na 1s| NSM = OSM +
Bits or /16 + 10 = /26(255.255.255.192)
C.) 100.0.0.0/8, 2000 networks >>> 11 bits | NSM = /19 or
255.255.224.0 | New subnetted network = 100.0.0.0/19

Explanation: Sa pagkuha ng bits, ang value ng 11th finger natin is


2048(2,4,8,16,32,64,128,256,512,1024,2048) | Sa pagkuha ng subnet
mask, ang value ng 3rd finger is 224(128,192,224) Dito nasa 3rd octet
kana kasi ung first 2 octets ay puro 1s na or 16 na 1s| NSM = OSM +
Bits or /8 + 11 = /19(255.255.224.0)

In case na yung number of needed networks ay matataas na, basta


ituloy lang natin ung rule na duplicate or idouble yung value at
tandaan kung ilang daliri na ang nagamit natin. So sa value na 1000
nakagamit tayo ng 10 daliri na ang value eh 1024 kaya pasok ito. Pati
na din sa 2000 network na may 11 bits(or 11 daliri) na may value na
2048. And it goes on and on.

Wag din kayong malilito sa pag-kuha ng bits para sa needed number


of networks at sa pag-kuha ng bits para sa subnet mask. Sa pag-kuha
ng no. of bits para sa no. of needed networks, always start at 2 then
doubling or duplicate the value hanggang sa ma-accomodate na nung
value yung needed no. of networks then kunin mo kung ilang daliri
ang nagamit(10 bits or daliri sa 1000 networks). It doesn’t matter
where you start! Sa sample ko lang ginamit na sa kanan kasi dito ako
nasanay. Basta make sure the rule is applied.

Sa shortcut ng pag-kuha naman ng subnet mask decimal value, yung


value naman ng fingers natin from LEFT TO RIGHT starting from 128.
Kada-eight 1s 255 na yun so next octet kana, then ganun ulit, value
ng fingers from LEFT TO RIGHT starting from 128.

Sa sample natin na 160.40.0.0/16, 1000 networks needed, meron na


tayong 16 1s(11111111.11111111.00000000.00000000) given and
since 10 bits ang kelangan para ma-accomodate yung 1000 networks,
hiniram or ginamit natin yung 10 0s galing sa host portions kaya
naging (11111111.11111111.11111111.11000000) or
255.255.255.192 or /26(or 26 consecutive 1s). Nakita n’yo na ang last
octet na lang ang ni-compute natin kasi nga kada eight 1s is 255 na. 

Alright idol, hanggang dito na lang muna itong subnetting tutorial


natin. Para hindi ma-overload lalo na yung mga beginners.

Sa Part II itutuloy natin ito. Pag-uusapan natin kung pano naman


kukunin yung number of networks, number of hosts, increment,
network range, valid host range, network address or broadcast
address of a cert Subnetting tutorial for beginners Part
II
Last time, pinag-usapan natin ang Subnetting tutorial Part I or basic
ng subnetting tutorial given yung hinihinging number of networks. This
time pag-aaralan naman natin yung ibang type ng questions or ibang
angle ng subnetting. I assure you na kung nakuha at naintindihan n’yo
yun, mabibilis n’yong maiintindihan itong mga susunod na lessons at
pati na rin ang mga subnetting questions sa CCNA exam.

Let’s begin.

Subnetting: Needed number of hosts given

Kung last time, certain number of networks ang hinihingi sa ating


subnetting question, silipin naman natin this time kapag number of
hosts ang kailangan nating hanapin. Same concept at technic lang din
ang ating gagamitin although yun nga, kailangan natin makuha is
yung number of hosts na hinihingi.

Let’s have an example.

195.50.65.0/24, 20 hosts per subnet


No. of hosts needed: 20 per subnet
No. of bits taken:
New subnet mask:

Para makuha natin ang number of bits needed, same technic pa rin
tayo. Bilang lang tayo ng 2 sa ating mga daliri from hinliliit and then i-
double natin ito. To satisfy the 20 hosts needed, makakagamit tayo ng
5 daliri or 5 bits(2,4,8,16,32). Pasok na yung hinihinging number of
hosts sa value ng pang-limang daliri natin(32). So 5 bits ang
kailangan.

To get the new subnet mask, bago na ang formula natin.

Kung nung una sa number of networks given, New Subnet Mask =


Old Subnet Mask + Bits this time sy’mpre maiiba kasi number of hosts
ang hinahanap natin. Laging tatandaan na sa subnet mask, ang mga
1s ay para sa network at ang mga 0s ay para sa hosts.

Ito ang ating new formula.

So base sa ating formula, to get the new subnet mask, kailangan natin
bawasin ang number of bits na nagamit natin from 32. So 32 – 5 = 27.
Ang NSM natin would be /27 or 255.255.255.224 or 195.50.65.0/27.

Pano naging 255.255.255.224 ang /27?

Kagaya nung sa subnetting part I natin, balikan natin yung mga value
nung daliri natin kapag subnet mask ang usapan, ibig sabihin from
LEFT TO RIGHT.
Meron ka nang 24 na 1s galing sa first 3 octets(255.255.255).
Kailangan mo na lang ituloy hanggang 27. So from left to right, 25, 26,
27 ang magiging value is 128, 192, 224. Kaya s’ya naging 224.

Get’s ba idol? 

So ang sagot natin doon sa hinihingi is:

No. of hosts needed: 20 hosts per subnet


No. of bits taken: 5 bits
New subnet mask: 195.50.65.0/27 (255.255.255.224)

Ibig sabihin ang subnet na /27 or 255.255.255.224 can accomodate


20 usable hosts per subnet.

Let’s have another example.

10.0.0.0/8, 5000 hosts per subnet

No. of hosts needed: 5000 per subnet


No. of bits taken: 13
New subnet mask: /19 or 255.255.224.0

Therefore, 10.0.0.0/19 or 255.255.224.0 can accomodate 5000 hosts


per subnet. 

Let me explain.

13 bits ang nagamit natin to accomodate 5000. Ang value ng pang


12th na daliri is 4096 so hindi pa pasok ang 5000 so next daliri tayo.
Then ang pang-13th na daliri is 8192. Boom! So 13 bits nagamit natin.

New Subnet Mask = 32 – bits.


So 32 – 13 = 19. Pano naman naging 255.255.224.0? Ang /19 at
255.255.224.0 ay pareho lang. Isang short format or slash notation at
isang long format. That means meron tayong 19 consecutive
1s(11111111.1111111.11100000.00000000).

The first 2 octets, since lahat sila ay 1s, alam na natin na sila ay
255.255. Right? Ngayon sa 3rd octet, since andun yung last 1s,
kelangan lang natin alamin ang kanyan subnet mask value galing sa
ating finger formula, which is 224. See image below.

Same technic lang din katulad nung mga nauna idol. The first 16 1s
natin is 255.255. Then continue tayo sa daliri from LEFT to RIGHT.
17, 18, 19. Kagay nga ng image natin sa taas, ang value nito(pang 3rd
na daliri) is 128, 192, 224. Nasa 3rd octet lang tayo, so we will leave
the last octet to 0. 

That’s it!

Finding the magic number(increment)


Ang increment is kung gaano kalaki ang pagitan ng bawat networks
natin. Sa pamamagitan ng pagkuha na increment, malalaman natin
ang mga posibleng networks na pwede natin gamitin. Ang pagkuha
din ng increment ang heart or puso ng subnetting.

Kapag nakuha mo na ang increment, masasagot mo na ang halos


lahat ng subnetting questions sa CCNA exam or even in real world.
Mostly, it is called the magic number.

Let’s see kung paano.

Para makuha ang increment, gagamitin ulit natin ang ating finger
technique. This time, meron tayong bagong values. Ito ay ang
increment values. Ang nasa itaas ay ang “increment values” at ang
nasa ibaba ay ang “subnet mask values” natin.  

Again, take note na yung ang numbers na green ay para sa subnet


mask(128, 192, 224 etc.), then ang nasa taas na value(128, 64, 32
etc.) is para naman sa increment. 
To get the increment, kung saan tumapat yung subnet mask (green
numbers), ang increment n’ya is yung value na nasa taas. Boom!
That’s it!

Ibig sabihin, kung ano ang makukuha mong subnet mask value,
kukunin or tatandaan mo lang din ang increment value na katapat niya
sa ibabaw.

For example: subnet mask value:192. Ang increment value niya is


64(kasi sila yung magkatapat). Another example: subnet mask value:
248. Ang increment value niya is 8. 

Last example, subnet mask value 224. Increment is 32.

Gets na?

Good!

Ngayon, saan at paano naman natin ito gagamitin sa ating


subnetting? Ganito kasi, sa CCNA exam or maybe sa interview at
even sa real world, meron kang ma-eencounter na mga ganitong
klase ng tanong:

 What is the first valid host on the subnet 192.x.x.x?


 What is the last valid host on the subnet 10.10.10.0?
 What is the network address?
 What is the broadcast address?
 What subnet does 192.10.10.1 belongs to?
 What subnet mask need to be use? 

At marami pang iba. Those questions can be answered quickly by


knowing and getting the increment. Kagaya nga ng sinabi ko kanina,
ito ang puso ng subnetting. By knowing this, we can probably answer
all subnetting questions na makakasalamuha natin.
So how does this work?

Napaka-simpe, kelangan lang natin i-plus or idagdag yung increment


number sa octet kung saan tayo nag-subnet. Let’see.

Sa ating example sa taas:

195.50.65.0/27 (255.255.255.224)

To get and see the actual networks for this subnet, gagamitin natin
yung increment. Ang increment nito is 32. Bakit? Kung babalikan n’yo
yung sample image, yung 224 na mask ang increment value n’ya is
32. 

That’s it! So kelangan lang natin s’ya i-add sa octet(kung saan


nangyari yung change). 
Kopyahin lang natin yung base or classful address, then add tayo ng
32 sa last octet kasi dun tayo nag subnet.

Kung makikita n’yo sa taas nag-add lang tayo ng 32 doon sa last


octet.

Dahil 32 ang increment natin. Dun tayo sa last octet nag-add kasi yun
ung octet kung saan tayo nag-subnet. Or kung saan nangyari yung
change.Then to complete each subnet, subtract lang tayo ng 1 para
naman doon sa last IP address ng given sinundan na network.

Ganito.

Based sa ating sagot, we can see the following details:


Remember, the first ip in the subnet is not usable kasi ito ang
mismong network address. Ang last ip din ay not usable kasi ito
naman ang broadcast address. Ang first usable ip in the subnet ay
ang ip na kasunod ng network address, then ang last usable ip
address naman ay ang ip bago mag-broadcast address.

To make it more simple, we can use this formula:

first valid ip = network address + 1        


last valid ip = broadcast address – 1
Sa second example naman natin. 10.0.0.0/19 or 255.255.224.0. It is
also equal to 11111111.11111111.11100000.00000000. We have 19
consecutive 1s. Ang subnet mask value natin is 224(in the 3 rd octet).
At ang increment value natin is 32(kasi siya ang katapat ni 224). See
image below. And that’s it.
So since ang increment natin is 32, parang katulad din kanina,
increment natin is 32 (ito yung increment value ng 224 na mask). Pero
this time nasa 3rd octet tayo so dun naman tayo mag-aadd(andun
yung change).

Then para makuha natin yung buong network for each subnet,
subtract tayo ng 1 para doon sa last IP address ng sinundan na
network.

By getting that increment, we can get the following information.


Super easy right?

Actually, ito na alaga yun. Once na nakabisado at nakuha mo ‘to, isa


ka nang subnetting ninja.

Kung medyo nalito, break muna mga idol. Balik-balikan lang sure ako
makukuha n’yo rin ito. At pag-nakuha n’yo ‘to, I promise kaya n’yo
iperfect ang mga subnetting questions sa exam.

That’s the actual networks for those subnets. At base d’yan pwede na
natin masagot ang mga tanong sa subnetting questions sa CCNA
exam or even sa real world. 

Halimbawa ng mga tanong sa exam ay, what is the first usable ip


address on that subnet or what is the last usable ip address, or pwede
rin na what is the first and last usable ip address on the 3rd network
and many more. Gamit ang increment kaya natin masagot ang mga
tanong na ito.

Let’s dive a little bit deep.

How to get the actual number of networks and number of usable hosts

1. To get the actual number of networks, ito ang formula.


Kagaya ng nakikita n’yo sa taas, to get the actual number of networks
ang formula natin is 2 raise to the no. of 1s added or NSM – OSM.

So sa ating 1st example sa taas(195.50.65.0/27), ito yung gagawin.

Then ito naman yung sagot.

Sa 2nd example natin (10.0.0.0/19 or 255.255.224.0).

2 raise to 11. Bakit? kasi NSM(19) – OSM(8) = 11.

2 ^11 = 2048.

San nanggaling ang OSM(old subnet mask)? Sa ip address classes at


kanilang default subnet mask! Di ba nung nakaraan we talked about ip
address classes. Bawat ip ay nabibilang sa kanyan-kanyang class at
meron silang default subnet mask.

Class A: 1 – 126 (Default subnet mask is 255.0.0.0 or /8)

Class B: 128 – 191 (Default subnet mask is 255.255.0.0 or /16)

Class C: 192 – 223 (Default subnet mask is 255.255.255.0 or /24)


So ang actual number of networks for that is 2048. Ibig sabihin sa
10.0.0.0/19 pwede tayong makapag-create ng 2048 na networks.

2. To get the actual number of usable hosts, ito naman yung


formula.

Para naman makuha natin yung actual number of usable hosts, 2


(raise to the no of 0s remaining or 32 – NSM) – 2 . Kagaya ng
nabanggit natin nitong mga nakaraan, yung 0s is para sa host portion.
So yung mga natitirang 0s yun ang pwedeng ilaan para sa IP address
ng mga hosts or end devices.

Pero take note na we need to subtract 2 sa final answer. Bakit? Kasi


nga, yung first and last IP address ay hindi usable. Yung first IP
address is para sa network at yung last IP address ay para sa
broadcast. Remember what we talked in the IP Addressing?

So sa ating 1st example, ito ang gagawin.

Dun naman sa ating 2nd example (10.0.0.0/19 or 255.255.224.0).

2 ^ 13 minus 2. Bakit? 32 – NSM(19) = 13.

So 2 ^ 13 = 8192. Then need natin mag-subtract ng 2. 8192 – 2 =


8910. Therefore, sa 10.0.0.0/19 or 255.255.224.0 meron tayong 8910
usable hosts kada subnets.
Wheeeew! 

That’s it! 

By this far, I hope ay natutunan mo na ang iba’t ibang way nag pag-
subnet. Kung medyo nalito, gaya ng sabi ko, break muna. Practice
lang makukuha din yan. Kung meron naman na kayo existing technic
at mas mabilis at mas-ok sa inyo un, mas maganda stick na lang tayo
dun.

Pero wait…

There’s more!

On the next lesson, we’re gonna have some practice of this activity
para mas mahasa pa ang iyong natutunan. For now, absorb
everything I shared on these subnetting lessons and I can assure you,
it will help you a lot in your CCNA career.

If you think you know someone needs it, feel free to share our blog
and website to them. Just tell them to visit ccnaphilippines.com.
Salamat.

Practice of sample subnetting questions in CCNA


exam.
On this lesson, I will share some sample subnetting questions para
mas ma-practice pa natin ang subnetting skills natin. Mahalaga na
makabisado natin at mabilis natin itong magawa dahil malaki ang
maitutulong nito para maipasa n’yo ang CCNA exam at syempre sa
real networking world.

All of these questions came from subnettingquestions.com(it’s a good


site para makapag-practice ka ng subnetting).
Ready? 

Let’s do this!

Practice #1

Let’s see kung pano nakuha yung sagot.

Gaya ng formulang pinag-aralan natin nung naunang lessons, gamitin


natin ang ating mga daliri. Sa ating question, we need to have 29
subnets that can accomodate 4 hosts each galing sa
192.168.253.0/24.

Given: 192.168.253.0/24
Needed: 29 subnets(or network), 4 hosts each
Find: Bits and NSM

Let’s use our finger subnetting technique. To get the number of bits
need to borrow or take from the host portions, need natin ng 5 bits.

Why?

32 ang value ng pang-limang daliri natin kapag nag-bilang tayo ng


bits(2,4,8,16,32) from right to left. That can satisfy 29 subnets needed.
See the image below that we also used last time.
Ang NSM(New Subnet Mask) naman natin is /29. Why? Eh kasi /24
and old subnet mask natin. Remember our formula for new subnet
mask kapag # of networks is NSM = OSM + bits barrowed. 

So /24 + 5(bits taken) = 29. Remember, 192 is a Class C ip address


na merong 255.255.255.0 or /24 na default subnet mask. Therefore,
192.168.253.0/29 is the subnetted network that can accomodate the
question.

/29 = 255.255.255.248. Why? Gaya din ng ginamit natin sa mga


naunang lessons, meron na tayong 24 1s galing sa given, so that’s
255.255.255. Then 5 bits or 5 1s ang nadagdag, so count tayo sa
ating daliri sa from LEFT TO RIGHT(25, 26, 27, 28, 29). 

Ang subnet mask value ng pang-limang daliri from LEFT TO RIGHT is


248(128, 192, 224, 240, 248). See image below(green numbers) na
ginamit din natin last time.
Can /29 or 255.255.255.248 accomodate 4 hosts each subnet? Yes!
How? Sa ating formula before, para makuha natin ang actual number
of hosts ito ang formula.

So in our sample, 2 raise to 3(32 – 29) then minus 2.

2 raise to 3 = 8 minus 2 is 6. So pasok ang hinihingi nating 4 hosts


each subnet.

That’s it pansit! So dahil ang tanong is what subnet mask should we


use, ang sagot is /29 or 255.255.255.248.

Practice #2
Let see how we got that.

Sa mga ganitong klase ng tanong, kelangan natin makuha ang


increment. At gaya ng mga nauna nating lessons, we can get the
increment by just getting the increment value of the subnet mask
value. Kung ano yung katapat niya. So sa subnet mask na
255.255.255.248, ang value ng increment is 8.

Why? Ang increment value ng 248 is 8. Like what we see on our


sample image below.

Then gaya nung mga naunang sample natin sa mga unang lessons,
we just need to add the increment to the base network.
As you can see, nag-add lang tayo ng 8(kasi siya yung increment
value) sa last octet kung saan nangyari yung change. We keep adding
8 until marating natin yung hinahanap na subnet kung saan pasok
yung ip na binigay sa given.

From there we can get the following answers:

Subnet: 192.169.189.128 – 192.168.189.135


Network address: 192.169.189.128
Broadcast address: 192.168.189.135
First valid ip: 192.169.189.129
Last valid ip: 192.169.189.134

So dito natin makikita kung bakit 192.168.189.135 ang sagot. Makse


sense?

Practice #3

On this type of question din, kelangan natin makuha ang increment.


What’s the increment? 16! Why? 16 ang increment value ng 240
subnet mask. This time nasa 3rd octet lang tayo pero same technique
mga idol.
So start tayo from base address(3rd octet) then increment tayo ng 16
kada network. Continue lang hanggang maabot natin ung hinahanap.
Ganito dapat mangyayari.

And from there, makikita n’yo kung bakit network 10.173.208.0 ang
naging sagot. Why? Kasi yung host na hinahanap natin is pasok sa
network na yan. Ang mga valid host IP address niya is 10.173.208.1 –
10.173.223.254.

Make sense idol?

Practice #4
Again, we need to find the increment in this type of question. Ang
increment dito is 2! Why? Kasi 2 ang increment value ng 254 subnet
mask gaya ng finger subnetting technique na ginagamit natin simula
pa nung una.

So to prove na tama yung sagot, let’s compute again. madali lang ito.

Bakit naging 172.18.252.1 ang sagot? Syempre ang tanong is what is


the first valid host on the network that node 172.18.252.28, which is
pasok sa network na 172.18.252.0 kagaya ng nakikita natin sa image. 

Ang range ng valid hosts nito are 172.18.252.1 – 172.18.253.254.


Laging tandaan na ang first address ay para sa network address at
ang last address ay para sa broadcast, so hindi sila valid host
address.

To summarize, here’s what we can get from that answer:

Subnet: 172.18.252.0 – 172.18.253.255


Network address: 172.18.252.0
Broadcast address: 172.18.253.255
First valid ip: 172.18.252.1
Last valid ip: 172.18.253.254

Let’s have a final sample subnetting question.

Practice #5

Sa subnet mask na 255.255.254.0, we used or added 7 bits (FROM


LEFT TO RIGHT) from the original subnet mask. To get the actual
number of networks, gaya ng pinag-aralan natin last time ang formula
is:

So to get the answer, we just need to compute 2 raise to 7.

7 na 1s ang nadagdag natin or pwede rin na /23(.254) – /16 which is 7


din naman ang sagot. 2 raise to 7 = 128. Kaya 128 networks ang
sagot. 
Paano natin nalaman na 7 ang nadagdag na bits? Eh ang subnet na
172.30.0.0 ay isang class B ip address. Meaning meron siyang default
subnet mask na /16 or 255.255.0.0.

From the given, we can see na hindi na default subnet mask ang
gamit niya dahil ito ay 255.255.254.0 na. Meaning, ito ay subnetted
na. Kaya gaya ng sabi ko, importante na alam mo ang mga ip address
classes kasama ng kanilang mga default subnet mask.

Para naman sa actual number of hosts, ang formula natin kung


natatandaan n’yo sa mga Part II ng subnetting lessons is ganito:

So to get the answer, 2 raise to 9(0s remaining) minus 2 or pwede rin


na 2 raise to 32 – 23(NSM) which is 9 din naman. Ang sagot is 512. 

Then syempre minus 2 kasi hind kasali ang network at broadcast


address kaya 510 valid hosts addresses.

Gotcha? Let me show it to you below. 

We’re good?

With that 5 practice questions and samples, I hope by this far you now
know understand the process and the reasons why we need to know
subnetting. Kapag nakabisado mo ito, it will make your life easier.
Hindi lang sa CCNA kundi pati na rin sa ‘real world.

If you’ve helped by this article, share it to others or post it on social


media. That way, we can help and inspire more aspiring network
engineers like you.

This is the end of our subnetting topic. In the CCNA Fundamentals


Ebook, we cover advance subnetting katulad ng VLSM(variable
subnet mask) and Route summarization.

The ebook covers other CCNA 200-301 topics na wala at hindi


kasama dito sa blog. It’s also in taglish like what you’re reading right
now. In fact, all these free lessons are taken from the ebook. Hindi
nga lang lahat.

IPv6 Fundamentals
In the earlier lesson, we talked about ipv4 addresses. Ito kasi ang
traditional at common way when implementing ip addressing in the
network. Pero since there is a ‘shortage’ coming for ipv4,
organizations and modern enterprise started adapting ipv6(ip version
6). On this lesson, pag-uusapan natin ang tungkol dito.

What is an IPv6 address?

Althrough out sa aking mga naunang lessons, I only shared about


IPv4 which is the traditional IP addressing na ginagamit natin. Pag
sinabing IPv6, ito ang newest version ng IP addressing or IP protocol
to eliminate the shortage of IPv4. 

Sa dami ng mga devices at IPv4 connections, nakikita ng mga expert


na dadating ang time na mauubos at kakapusin ito, kaya they come
up with the new and sustainable version which is IPv6 or IP version 6.
Kung si IPv4 ay isang 32 bit address, ang isang IPv6 address ay
binubuo ng 128 bit address. Here’s an example of IPv6 address
format.

As you can see in our image above, meron tayong 64 characters of


hexadecimal. Kung ico-convert natin sila into binary, they are a total of
128 bits.

Kung ang ipv4 ay binubuo ng 4 octets na decimal numbers, ang ipv6


naman ay binbuo ng 8 quartets of hexadecimal numbers. Each quartet
composed of 16 bits. Then each character(hexadecimal) is equal to 4
bits. So if we’re gonna look at the binary equivalent nito, we will have
128 bits of 0s and 1s.

For example, ang first quartet natin(2001) will look like this:
0010000000000001. Bakit? They are hexadecimal. So 2 = 0010, 0 =
0000, 0 = 0000 and 1 = 0001. Then it is the same concept for all the
remaining 7 quartets. 

Kung nakalimutan mo naman or hindi ka familiar on how to convert


hexadecimal to binary, here’s the table to remind you idol.
Ang ipv6 ay binubuo din ng network at host portion. Ang pinaka-tawag
talaga natin ditto ay network prefix(network address) at interface
id(host address). For example, sa ating example sa taas kanina, we
can see na meron tayong /64 mask for that ipv6 address. 

Ang ibig sabihin lang nito, the first 64 bits is the network prefix at ang
sumunod na 64 bits ay para sa interface id. See photo below.

To make a comparison with ipv4 and ipv6, here’s a a table that shows
some of the differences.
Features of IPv6 address

Ito naman ang ilan sa mga importanteng features ng ating IPv6.

1. Large address space

Gaya ng ng nabanggit ko sa taas, si IPv6 ay gumagamit ng 128 bit


address unlike IPv4 which is a 32 bit address only. Ibig sabihin, super
dami at super laki ng network space or IP space na kayang i-
accomodate ni IPv6. Sabi nga nila, hindi na tayo magkakaroon ng
shortage sa IP if IPv6 will be implemented.

2. Enhanced security

Ang IPSec or (Internet Protocol Security) ay built in na sa IPv6 as part


of the protocol . Ibig sabihin, two devices can dynamically create a
secure tunnel without user intervention.

3. No need for NAT

Since super laki at super dami nang pwedeng IP na magamit thru


IPv6, hindi na required or kelangan pang mag-NAT if ever
implemented. 

Note: Ang NAT ang isa sa mga dahilan kung bakit tayo nakakatipid ng
IPv4 at hanggang ngayon is hindi pa rin tayo kinakapos.

4. Stateless address autoconfiguration

Ang mga IPv6 devices ay may kakayanan na automatically mag-


configure ng sarili nilang IPv6 addresses.

That’s basically the fundamentals of IPv6. In the CCNA Fundamentals


Ebook, we dig deeper into it. We talked about the process of
‘shortening the IPv6 address’. We also have some samples on how to
use and apply them on our network devices like router.

If you’re interested with CCNA Fundamentals, you can go ahead and


check the details here.

The ebook contains other CCNA topics na wala dito sa blog like NAT,
ACL, Wireless, HSRP and more. It was updated to cover all the new
topics for CCNA 200-301(the new CCNA exam).

Again, go ahead and check the details here.

By now, you now understand the fundamentals of IPv6 address. Let’s


move on to the next lesson.

You might also like