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 IPv4 Network IPv4 Header
Packet
`
IPv4 Network
IPv6 Network IPv6 Header
IPv6 Network IPv6 Header
Packet
IPv4 Header
Packet
IPv4 Header
Packet
Packet
6
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 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1
0 0 0 1 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 0 1 1 1
0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 1
= = = = = = = =
128 192 224 240 248 252 254 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 subnetmask. 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
10011010 01000111 10010110 00101010 IP Address (154) (71) (150) (42) 11111111 11111111 11111000 00000000 Subnet Mask (255) (255) (248) (0) Result of AND 10011010 01000111 10010000 00000000 Masking (154) (71) (144) (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 000 001 010 011 100 101 110 111
Host 00000 - 11111 00000 – 11111 00000 – 11111 00000 – 11111 00000 – 11111 00000 – 11111 00000 – 11111 00000 - 11111
Decimal 0-31 32 – 63 64 – 95 96 - 127 128 - 159 160 – 191 192 – 223 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. 30 You can do it if you start with 172.16.0.0/21 (172.16.0.0 –
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Addressing example no VLSM 172.16.0.0/21
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
31
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:
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Student LAN has 481 hosts Instructor LAN has 69 hosts Administrator LAN has 23 hosts WAN has 2 hosts
32
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.0
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
33
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
34
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
172.16.0.0 172.16.2.0 172.16.4.0 172.16.6.0
Subnet with no VLSM 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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Network
35
Addressing example with VLSM 172.16.0.0/22 is OK
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
36
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:
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Student LAN has 481 hosts Instructor LAN has 69 hosts Administrator LAN has 23 hosts WAN has 2 hosts
37
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 38 Network address 172.16.0.0 Broadcast address 172.16.1.255
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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 39 Network address 172.16.2.0 Broadcast address 172.16.2.127
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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 40 Network address 172.16.2.128 Broadcast address 172.16.2.159
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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 41 Broadcast address 172.16.2.163
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Visually with VLSM 172.16.0.0
172.16.1.0
172.16.2.0
172.16.3.0 Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Instructor Student Admin
WAN
42
Case 2. Given 192.168.1.0/24
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
43
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 Subnet address Host range Broadcast Network bits 32 - 6 = 26address 192.168.1.0/26 192.168.1.1 so /26 or subnet mask 192.168.1.63 - 192.168.1.62 255.255.255.192 44
B E
192.168.1.64/26
192.168.1.65 192.168.1.126
192.168.1.127
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Network
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 Subnet address Host range so /27 or subnet mask Broadcast address 255.255.255.224 192.168.1.128/27 192.168.1.129 192.168.1.159 192.168.1.158 0-127 range already used
A
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Network
45
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 used
Subnet address
Host range
Broadcast address
D
192.168.1.160/28
192.168.1.161 192.168.1.174
192.168.1.175
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Network
46
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 used
Subnet address
Host range
C
192.168.1.176/30 192.168.1.177 192.168.1.178
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Network
Broadcast address 192.168.1.179
47
Subnet plan with VLSM 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.179
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Networ k
48
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
E One octet available
B
Visual
A D
C
49
Subnetting class A
50
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Without subnetting masking 255.0.0.0 In binarry : 11111111 00000000 00000000 0000000 Net id Host id
With subnetting Masking 255.255.192.0 In binarry : 11111111 11111111 11000000 Net id Host id SubNet id 00000000 52
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Theres is 1024 subnets Each subnet can have 16,384 hosts/computer
53
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
54
Subnetting class B
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Without subnetting masking 255.0.0.0 In binarry : 11111111 11111111 00000000 0000000 Net id Host id
With subnetting Masking 255.255.240.0 In binarry : 11111111 11111111 11110000 Net id SubNet id Host id 00000000 57
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
58
Each subnet 4094 hosts/computers
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
59
Subnetting class C
60
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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 (2 8 – 2) host on that network If we want more physical network, we can divide this one range into several smaller range.
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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 ( 2 2< 7 < 2 3)
61
Net id
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Without subnetting masking 255.0.0.0 In binarry : 11111111 11111111 11111111 0000000 Host id
With subnetting Masking 255.255.240.0 In binarry : 11111111 11111111 11111111 11100000 Net id
Host id SubNet id
62
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
63
There is 8 subnet Each subnet can have 32 hosts
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
64
Supernetting
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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Depend on the need of an organization
Supernetting
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
66
Supernet Mask
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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
Can be assigned to a block of class C network address, if the number of net. Address is a power of two
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
The beginning address can be X.Y.32.0, but it can not be X.Y.33.0
68
69
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
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 supernet mask 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
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
70
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
71
Computer Network - Industrial Engineering - Faculty of Industrial Engineering
CIDR Classless Interdomain Routing
72