Subnetting & CIDR
Fakultas Rekayasa Industri
Institut Teknologi Telkom
Soal 1
Diketahui IP Address 172.128.127.24
dengan netmask 255.255.255.240.
tentukanlah network address dengan
broadcast address yang digunakan
oleh IP address tersebut.
Soal 2
Diketahui IP address 172.128.127.24
dengan netmask 255.255.240.0.
tentukan Broacast dan Networknya
dan ada berapa jumlah subnetwork
yang dapat dibentuk dari kombinasi IP
Address dan netmask tersebut!
Soal 3
Dua buah network yaitu 131.0.0.0/8
dan 131.7.0.0/16 akan di aggregate
menjadi satu. Tentukan netmask hasil
supernetting untuk kedua network tsb
Network Address dan Broadcast
Addressnya
Soal Tugas Dikumpul 9 Des 2011
pukul 08.30-09.00 WIB di C203 Sebuah perusahan IT bernama PT. Majuterus
hendak membangun jaringan internet yang
terdiri atas 4 buah divisi. Divisi marketing, divisi
produk, divisi IT dan divisi keungan. Total IP
address yang telah disiapkan untuk divisi
marketing 58 komputer, divisi produk 28, divisi
IT 13 komputer, divisi keuangan 5 komputer. IP
yang digunakan adalah IP kelas C yaitu
192.168.2.0. bagaimana konfigurasi IP untuk
masing-masing divisi.
Address Translation
`
IPv6
Network
IPv6
Network
IPv4
Network
PacketIPv6
Header
PacketIPv4
Header
PacketIPv6
Header
IPv4
Network
PacketIPv4
Header
PacketIPv4
Header6
Subnetting &
Supernetting
Mengapa SubNetting?
SubNetting adalah proses membagi
sebuah network menjadi beberapa
Sub-network.
Sebagai contoh, dalam sebuah
jaringan lokal yang menggunakan
alamat kelas B 172.16.0.0 terdapat
65.534 host address.
Efisiensi pengelolaan jaringan dapat
ditingkatkan dengan cara melakukan
subnetting terhadap network tersebut.
Mengapa SubNetting (Cont.)
Alasan-alasan perlunya dibentuk subnetting antara lain :
- Memudahkan pengelolaan jaringan.
- Mereduksi traffic yang disebabkan oleh broadcast maupun benturan (collision).
- Membantu pengembangan jaringan ke jarak geografis yang lebih jauh (LAN ke MAN).
Subnetting
The increasing number of host connected to the internet
Restrictions on the network size
In subnetting, a network is divided into smaller subnetworks with each subnet having its own subnet address
In supernetting, a organization can combine several class C to create a large range of addresses. In other word, several networks are combined to create a supernetwork
10
Without subnetting
11
With Subnettiing
12
Masking
13
Applying bit-wise-and operation to achieve masking
14
Ilustrasi sebuah Network
tanpa Subnet
SubNetting
Pembentukan subnet dilakukan
dengan cara mengambil beberapa bit
pada bagian HostId untuk dijadikan
SubnetId. Contoh:
Source: www.tcpipguide.com
Subnet Mask
Source: www.tcpipguide.com
Subnet Mask (Cont.)
Dalam contoh di atas, sebuah
jaringan kelas B dengan Network-Id :
154.71.0.0.
Subnet Mask dalam bentuk desimal
adalah: 255.255.248.0
Dengan demikian 5 bit pertama pada
octet ke 3 adalah Subnet-Id,
sedangkan sisa bit adalah Host-Id.
Default Subnet-Mask
Konversi Subnet-Mask
1 0 0 0 0 0 0 0 = 128
1 1 0 0 0 0 0 0 = 192
1 1 1 0 0 0 0 0 = 224
1 1 1 1 0 0 0 0 = 240
1 1 1 1 1 0 0 0 = 248
1 1 1 1 1 1 0 0 = 252
1 1 1 1 1 1 1 0 = 254
1 1 1 1 1 1 1 1 = 255
Menentukan SubNet-Id
Source: www.tcpipguide.com
Menentukan Subnet-Id
Router menentukan sebuah IP address merupakan anggota dari subnet tertentu melalui proses masking seperti dalam gambar di atas.
IP address: 154.71.150.42 dioperasikan AND dengan subnet-mask. Didapat Subnet-Id: 18.
Sedangkan IP address dari subnet tersebut adalah: 154.71.144.0.
IP Address dari Subnet
Determining the Subnet ID of an IP Address
Through Subnet Masking
Component Octet 1 Octet 2 Octet 3 Octet 4
IP Address10011010
(154)
01000111
(71)
10010110
(150)
00101010
(42)
Subnet Mask11111111
(255)
11111111
(255)
11111000
(248)
00000000
(0)
Result of AND
Masking
10011010
(154)
01000111
(71)
10010000
(144)
00000000
(0)
Dengan CIDR, dapat dituliskan sebagai:
154.71.150.42/21.
Contoh Kasus 1
Sebuah jaringan dengan network-id: 192.16.9.0 akan dibagi ke dalam 3 buah subnet. Tentukan IP address untuk setiap subnet.
No IP 192.16.9.0 adalah Kelas C, dengan host-Id berada pada 8 bit terakhir. Karena itu, subnet-id harus berada pada 8 bit terakhir.
Penyelesaian Kasus 1
Kebutuhan 3 subnet berarti
membutuhkan sebanyak 3 bit.
Karena itu subnet-mask ditentukan:
11111111.11111111.11111111.11100000
255. 255. 255. 224
Penyelesaian Kasus 1
Kombinasi subnet: 000, 001, 010, 011, 100, 101, 110, 111.
Karena itu 3 bit pertama dialokasikan untuk subnet.
192.16.9.b b b b b b b b
subnet
Penyelesaian Kasus 1:
Subnet Host Decimal
000 00000 - 11111 0-31
001 00000 – 11111 32 – 63
010 00000 – 11111 64 – 95
011 00000 – 11111 96 - 127
100 00000 – 11111 128 - 159
101 00000 – 11111 160 – 191
110 00000 – 11111 192 – 223
111 00000 - 11111 224 - 255
Kesimpulan Kasus 1
Jumlah subnet yang terbentuk ada 23=8. Tetapi subnet 000 dan 111 tidak dapat digunakan. Karena itu jumlah subnet yang dapat digunakan adalah: (23-2=6).
Jumlah host yang terbentuk untuk masing-masing subnet 25=32. Sedang host yang dapat digunakan sebanyak 25-2=30. Host-Id: 00000 dan 11111 tidak dapat digunakan.
29
Addressing example
The example given in the curriculum
shows subnetting without VLSM using
172.16.0.0/22. (172.16.0.0 –
172.16.3.255)
They produce 4 subnets each with
510 addresses.
This is impossible. It will be
corrected.
You can do it if you start with
172.16.0.0/21 (172.16.0.0 –
172.16.7.255)
30
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Addressing example no
VLSM
172.16.0.0/21
31
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
What we have and need
Given IP address 172.16.0.0/21
That’s 172.16.0.0 to 172.16.7.255
4 subnets needed:
Student LAN has 481 hosts
Instructor LAN has 69 hosts
Administrator LAN has 23 hosts
WAN has 2 hosts
32
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Without VLSM – same size subnets
Biggest subnet has 481 hosts.
Formula for hosts is 2n – 2
n = 9 gives 510 hosts (n = 8 gives
only 254)
So 9 host bits needed.
That means 32 – 9 = 23 network bits
/23 or subnet mask 255.255.254.033
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Network addresses
/23 so subnet mask in binary is
11111111 11111111 11111110.00000000
Octet 3 is the interesting one.
Value of last network bit in octet 3 is 2
So network numbers go up in 2s
172.16.0.0
172.16.2.0
172.16.4.0
172.16.6.0
34
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnet with no VLSM
Network Subnet
address
Host range Broadcast
address
Student 172.16.0.0/23 172.16.0.1 -
172.16.1.254
172.16.1.255
Instructor 172.16.2.0/23 172.16.2.1 -
172.16.3.254
172.16.3.255
Admin 172.16.4.0/23 172.16.4.1 -
172.16.5.254
172.16.5.255
WAN 172.16.6.0/23 172.16.6.1 -
172.16.7.254
172.16.7.255
35
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Addressing example with VLSM
172.16.0.0/22 is OK
36
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
What we have and need
Given IP address 172.16.0.0/22
That’s 172.16.0.0 to 172.16.3.255
4 subnets needed:
Student LAN has 481 hosts
Instructor LAN has 69 hosts
Administrator LAN has 23 hosts
WAN has 2 hosts
37
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
With VLSM
Student subnet has 481 hosts.
Formula for hosts is 2n – 2
n = 9 gives 510 hosts (n = 8 gives
only 254)
So 9 host bits needed.
That means 32 – 9 = 23 network bits
/23 or subnet mask 255.255.254.0
Network address 172.16.0.0
Broadcast address 172.16.1.255
38
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
With VLSM
Instructor subnet has 69 hosts.
Formula for hosts is 2n – 2
n = 7 gives 126 hosts (n = 6 gives
only 62)
So 7 host bits needed.
That means 32 – 7 = 25 network bits
/25 or subnet mask 255.255.255.128
Network address 172.16.2.0
Broadcast address 172.16.2.127
39
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
With VLSM
Admin subnet has 23 hosts.
Formula for hosts is 2n – 2
n = 5 gives 30 hosts (n = 4 gives only
14)
So 5 host bits needed.
That means 32 – 5 = 27 network bits
/27 or subnet mask 255.255.255.224
Network address 172.16.2.128
Broadcast address 172.16.2.159
40
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
With VLSM
WAN subnet has 2 hosts.
Formula for hosts is 2n – 2
n = 2 gives 2 hosts
So 2 host bits needed.
That means 32 – 2 = 30 network bits
/30 or subnet mask 255.255.255.252
Network address 172.16.2.160
Broadcast address 172.16.2.16341
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Visually with VLSM
Student
Instructor
Admin
WAN
172.16.0.0 172.16.1.0 172.16.2.0 172.16.3.0
42
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Case 2. Given
192.168.1.0/24
43
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnet 192.168.1.0/24
2 subnets with 28 hosts each (largest)
5 host bits 25 - 2 = 30 would be just
enough
But allow for expansion: 6 host bits
give 62
Network bits 32 - 6 = 26
so /26 or subnet mask
255.255.255.192
Network Subnet address Host range Broadcast
address
B 192.168.1.0/26 192.168.1.1
- 192.168.1.62
192.168.1.63
E 192.168.1.64/26 192.168.1.65 -
192.168.1.126
192.168.1.12744
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnet 192.168.1.1/24
1 subnets with 14 hosts
4 host bits 24 - 2 = 14 would be just
enough
But allow for expansion: 5 host bits
give 30
Network bits 32 - 5 = 27
so /27 or subnet mask
255.255.255.224
0-127 range already used
Network Subnet address Host range Broadcast
address
A 192.168.1.128/27 192.168.1.129 -
192.168.1.158
192.168.1.159 45
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnet 192.168.1.1/24
1 subnets with 7 hosts
4 host bits 24 - 2 = 14 is enough
Network bits 32 - 4 = 28
so /28 or subnet mask
255.255.255.240
0-159 range already usedNetwork Subnet address Host range Broadcast
address
D 192.168.1.160/28 192.168.1.161 -
192.168.1.174
192.168.1.175 46
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnet 192.168.1.1/24
1 subnets with 2 hosts
2 host bits 22 - 2 = 2 is enough
Network bits 32 - 2 = 30
so /30 or subnet mask
255.255.255.252
0-175 range already usedNetwork Subnet address Host range Broadcast
address
C 192.168.1.176/30 192.168.1.177 -
192.168.1.178
192.168.1.179 47
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnet plan with VLSM
Networ
k
Subnet address Host range Broadcast
address
B 192.168.1.0/26 192.168.1.1
- 192.168.1.62
192.168.1.63
E 192.168.1.64/26 192.168.1.65 -
192.168.1.126
192.168.1.127
A 192.168.1.128/27 192.168.1.129 -
192.168.1.158
192.168.1.159
D 192.168.1.160/28 192.168.1.161 -
192.168.1.174
192.168.1.175
C 192.168.1.176/30 192.168.1.177 -
192.168.1.178
192.168.1.17948
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
VisualB
E
A
D
C
One octet
available
49
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnetting class A
A class A address:
Is made of a one-byte netid and a three-byte hostid
Can have one single physical network with up to 16.777.214 (224-2)
If we want more physical networks, we can divide this one range into several smaller ranges
50
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Example :
A organization with a class A needs a least 1000 subnetworks. Find the subnet mask and configuration of each network
Solution:
• We need at least 1002 subnet to allow the all-1s and all-0s subnetids
• This means that the minimum number of bits to be allocated for subnetting should be 10 (29 < 1,002< 1010)
• Fourteen bits are left to define the hostid
51
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Without subnetting
masking 255.0.0.0
In binarry : 11111111 00000000 00000000 0000000
With subnetting
Masking 255.255.192.0
In binarry : 11111111 11111111 11000000 00000000
52
Net id Host id
Net id SubNet id Host id
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Theres is 1024 subnets Each subnet can have 16,384 hosts/computer
53
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
54
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnetting class B
A class B:
Is made A two byte netid and two-byte hostid
Can have one single physical network and up to 65,534 hosts on the network.
If we wan more physical network, we can divide this one big range into several smaller ranges.
55
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Example
An organization with a class B address needs at least 12 subnetwork. Find subnet mask and configuration of each subnetwork
Solution:
There is a need for at least 14 subnetworks, 12 as specified plus 2 reserve as special address. This means that the minimum number of bits should be 4 (23 < 14 < 24)
56
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Without subnetting
masking 255.0.0.0
In binarry : 11111111 11111111 00000000 0000000
With subnetting
Masking 255.255.240.0
In binarry : 11111111 11111111 11110000 00000000
57
Net id Host id
Net id SubNet id Host id
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Each subnet 4094 hosts/computers58
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
59
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Subnetting class C
A class C address:
is made of a three byte netid and one-byte hostid
Can have one single physical network and up to 254 (28 –2) host on that network
If we want more physical network, we can divide this one range into several smaller range.
60
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Example:
An organization with a class C needs at least five subnetworks. Find the subnet mask and configuration of each subnetwork
Solution:
There is a need for at least seven subnetworks, five specifief and two reserved a special address.
This means that minimum number of bits should be 3 ( 22< 7 < 23)
61
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
62
Without subnetting
masking 255.0.0.0
In binarry : 11111111 11111111 11111111 0000000
With subnetting
Masking 255.255.240.0
In binarry : 11111111 11111111 11111111 11100000
Net id Host id
Net id
SubNet id
Host id
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
There is 8 subnet
Each subnet can have 32 hosts 63
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
64
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Supernetting
Depend on the need of an organization
One or more classes c can be jointed to make one supernetwork
Example: an organization that needs 1000 address can be granted four class c addresses. The organization can then use these address in one supernetwork, in four network, or in more then four networks.
65
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Supernetting
66
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Supernet Mask
Can be assigned to a block of class C network address, if the number of net. Address is a power of two
Default mask for a class C address 255.255.255.0
If some of the 1s are changed to 0s, we can have a mask for a group of class C
Supernet mask is the reverseof the subnet mask
67
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
68
The beginning address can beX.Y.32.0, but itcan not be X.Y.33.0
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
Example:
With supernet 255.255.252.0, we can have four class C combined into one supernetwork
If we choose the first address to be X.Y.32.0, the other three addres X.Y.33.0, X.Y.34.0 and X.Y.35.0
If the router recieves a packet, it applies the supernetmask to the destination address and compare the result to the lowest address. If the result and the lowest address are the same, the packet belong to the supernet
Suppose a packet arrives with destination address X.Y.33.4. After applying the mask, the result is X.Y.32.0 (the lowest address), the packet belong to the supernet
69
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
70
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
71
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g
72
CIDRClasslessInterdomainRouting
Com
pute
r Netw
ork
-In
dustria
l Engin
eerin
g -
Faculty
of In
dustria
l Engin
eerin
g