(IP) dan Subnet Mask

advertisement
Part two
Ip Subnetting
Subnetmask
Classless IP
Classless Inter-domain
Routing(CIDR)
• Penggunaan Classlfull IP tdk mampu tampung kepesatan
penggunaan internet diseluruh dunia.
• RCF mendapati mereka perlu cara lain bagi memastikan
penggunaan IP mencukupi untuk semua.
• Maka lahirlah CIDR..Class~ Less
• Ia berdasarkan variable-length subnetmasking (VLSM) yg
membenarkan pembahagian alamat IP dan routing
berdasarkan arbitrary-length prefixes.
• Masalah utama rekabentuk Classful subnetting
(fixed length) ialah ia memerlukan semua subnet
dalam kelas berada dalam saiz yang sama.
• Ini akan menyebabkan pembaziran IP berlaku
• Protokol CIDR pula membebaskan router dari
hanya menggunakan bit tertinggi untuk
menentukan kelas network itu.
• Dengan kata lain CIDR mengabaikan kelas
network
• Contohnya, sebuah organisasi dengan 3 bangunan.
• Sila rujuk rajah di bawah.
• Setiap bangunan mempunyai jumlah host yang berbeza.
• Apabila menggunakan fixed-length subnet mask, setiap
subnet perlu menyokong sekurang-kurangnya 8,000 hosts.
• Walaupun, keperluan sebenarnya hanyalah 100 IP sahaja.
Discovery2
Slide page 4.1.4.1
• VLSM membantu menyelesaikan masalah ini. Ia membenarkan
IP dibahagikan kepada keperluan dan saiz network itu.
• Ia membenarkan ruangan IP dibahagikan kepada pelbagai saiz
atau mengikut keperluan host
• Hasilnya, VLSM berjaya mengelakkan pembaziran IP berlaku
Subnet…
• Apabila satu network dipecahkan kepada
subnets, setiap subnet sebenarnya terpisah.
Walaupun IP Addressnya nampak sama
• Oleh sebab itu, apabila host dalam satu
subnet berkomunikasi antara host dalam
subnet yang berbeza ia memerlukan router
sebagai perantara.
• Apabila menentukan berapa banyak host yang
diperlukan untuk setiap subnet, ip untuk router
interface, atau gateway interface perlu diambil kira
• Setiap interface router yang tersambung terus
kepada satu network perlu memiliki IP address yang
sama dengan semua host dalam network itu
• Dalam sesetengah keadaan, router
memerlukan sambungan kedua kepada satu
router lain
• Interface kedua ini pula perlulah mempunyai
IP address yang sama subnet dengan interface
router yang tersambung dengannya, tetapi
tidak sama dengan subnet network-network
lain
Sila hafal rajah disebelah..
Tak boleh ke? Hehe takper2 kita kira
pakai kalkulator
Rumus Pengiraan :
1
2
Bits = 32 - Prefix
Possible Host
= 2n - 2
Contoh :
Diberi subnetmask berikut. Kenalpasti possible host dan
bilangan bit host.
255.255.192.0
LANGKAH 1
o tukar kepada subnetmask kepada nilai binary dan
kenalpasti prefix notation.
255.255.192.0
11111111.11111111.11000000.00000000
/18
LANGKAH 2
o Guna rumus bits untuk mendapatkan bilangan bit yang
ada untuk host
1
Bits = 32 - Prefix
bit dalam host = 32 – (nilai ‘/’ baru)
= 32 – 18
= 14
LANGKAH 2
o Guna rumus Possible Host untuk mendapatkan
bilangan host yang mungkin bagi subnetmask ini
2
Possible Host
= 2n - 2
Possible Host = 2(nilai bit) – 2
= 2(14) – 2
= 16382
LATIHAN 1
• Dari Decimal Subnet mask, dapatkan Slash Notation, bilangan
bit bagi Host dan Possible Host bagi setiap soalan dibawah :
LATIHAN 2
• Kenalpasti samaada kedua-dua host ini berada
dalam Network yang sama atau tidak. Tanda √.
Reserved IP address
• Walaupun dikatakan ada 4096 M IP address , ada
sebilangan IP address tidak boleh digunakan
walaupun ia terdapat dalam mana-mana kelas.
• Ia dikenali sebagai ‘Reserved IP’
• semua bahagian host 1 = multicast,broadcast
IP
• semua bahagian host 0 = network number
Kenalpasti Broadcast dan Network ID
• Apabila anda menghasilkan subnet, anda
memperolehi satu julat IP yang boleh
digunakan dalam subnet tersebut.
• Walaubagaimanapun, Broadcast Address dan
Network Address perlu diketahui bagi setiap
subnet yang dihasilkan.
• Ini kerana kedua-dua IP ini, tidak boleh
diberikan kepada host kerana ia mempunyai
keperluan tersendiri.
Contoh :
• Diberi 3 subnet untuk yang telah dihasilkan dari 1
Network ID. Tentukan Broadcast ID dan Network
ID bagi ketiga-tiga subnet ini :
– Network 0
• 192.168.1.0/26
– Network 1
• 192.168.1.64/26
– Network 2
• 192.168.1.128/26
Langkah 1
Ambil Subnet 1/Network 0
– 192.168.1.0
• Kenalpasti bit yg telah dipinjam dari subnet
tersebut
192
168
1
0
11000000
10101000
000000001
00000000
– dalam kes ini ada 2 bit setiap subnet.
Langkah 2
• Dari maklumat berikut:
– NETWORK ID : semua 0 kecuali bahagian subnet(berubah mengikut
subnet)
– BROADCAST ID : semua 1 kecuali bahagian subnet(berubah mengikut
subnet)
– FIRST VALID HOST : bit paling kanan 1 yang lain 0 kecuali bahagian
subnet(berubah mengikut subnet)
– LAST VALID HOST : bit paling kanan 0 yang lain 1 kecuali bahagian
subnet(berubah mengikut subnet)
Langkah 3
• Masukkan maklumat ke dalam jadual berikut :
SUBNET
HOST
MEANING
00
00000000=0
NETWORK ID
00
00000001=1
FIRST VALID HOST
00
00111110=62
LAST VALID HOST
00
00111111=63
BROADCAST ID
Variable Length Subnet Masks (VLSM)
• Custom Subnetmask membenarkan Host Portion
dipecahkan dan dijadikan sebagai subnet.
• Namun begitu ia tidak sesuai untuk enterprise network
yang besar.
• VLSM menyediakan penggunaan ruang IP address yang
efisyen
• Ia juga membenarkan hierarchal IP addressing yang
membenarkan route summarization.
• Route summarization mengurangkan saiz routing
tables
• Routing tables yang kecil memerlukan kurang masa
untuk CPU melaksanakan routing lookups.
• VLSM merupakan konsep “subnetting a subnet “
(memecahkan subnet kepada subnet).
• Ia dilakukan bagi memaksimakan penggunaan IP
address.
• Namun begitu, tidak semua routing protocol
menyokong penggunaan VLSM
“Subnetting a subnet”
• Classful Routing protocols, seperti RIPv1, tidak
membenarkan perubahan kepada medan (portion)
subnet mask.
• Sebuah router dengan subnet mask yang diberikan
kepada interfacenya mengandaikan semua packet
data berada dalam kelas yang sama mempunyai
subnet mask yang sama
• Classless Routing protocols, menyokong VLSM
• Antara Classless routing protocols ialah :
– RIPv2
– EIGRP
– OSPF.
• VLSM membenarkan mask yang berbeza
untuk setiapsubnet.
• Selepas memecahkan (subnetted) network
address, subnet itu masih lagi boleh
dipecahkan kepada sub-subnets.
Memecahkan subnet(Subdivides)
• Contohnya,
Network 10.0.0.0/8 dengan subnet mask /16
di bahagikan kepada (subdivides into) 256
subnet, setiap subnet boleh menghasilkan
alamat untuk 65532 hosts.
– 10.0.0.0/16
– 10.1.0.0/16
– 10.2.0.0/16 sehingga ;
– 10.255.0.0/16
• Dengan meletakkan subnet mask /24 kepada
mana-mana subnet /16 ini akan menyebabkan
satu subdivison boleh wujud dengan 256 subnet
• Andaikan,
10.1.0.0/16 dilaksanakan subdivision /24. Setiap
subnet baru ini boleh memberi alamat kepada
254 hosts.
–
–
–
–
10.1.1.0/24
10.1.2.0/24
10.1.3.0/24 sehingga;
10.1.255.0/24
• Dengan meletakkan subnet mask /28 kepada
mana-mana subnet /24 ini akan menyebabkan
satu subdivison boleh wujud dengan 16 subnet
• Andaikan,
10.1.3.0/24 dilaksanakan subdivision /28. Setiap
subnet baru ini boleh memberi alamat kepada 14
hosts.
–
–
–
–
10.1.3.0/28
10.1.3.16/28
10.1.3.32/28 sehingga;
10.1.3.240/28
Subnet kali
kedua
Subnet kali
pertama
Subnet kali
ketiga
• Menghasilkan skema IP addressing dengan
VLSM memerlukan latihan dan perancangan
yang sempurna.
Mengaplikasikan VLSM
• Hasilkan satu rekabentuk Hierarchical Addressing
dengan maklumat dibawah :
–
–
–
–
–
–
Atlanta HQ = 58 host addresses
Perth HQ = 26 host addresses
Sydney HQ = 10 host addresses
Corpus HQ = 10 host addresses
WAN links = 2 host addresses (each)
NetID 192.168.0.0/24
Fikirkan ini…
LANGKAH 1
• Bina jadual seperti dibawah.
• When implementing a VLSM subnetting scheme,
always allow for some growth in the number of hosts
when planning subnet requirements.
LANGKAH 2
• Kenalpasti network dgn keperluan host paling banyak
– AtlantaHQ ~ 58 host
• Pinjam bit untuk hasilkan subnet yang mencukupi
keperluan keseluruhan network
– 2 bit dipinjam, guna /26
– Ini menghasilkan 4 subnet
• 192.168.15.0
• 192.168.15.64 dll…
• Pilih NetID yang pertama untuk AtlantaHQ
– 192.168.15.0/26
LANGKAH 3
• Kenalpasti network seterusnya
– PerthHQ ~ 28 host
• Pilih IP yang seterusnya ialah :
• sbb range awal tadi IP terakhirnya 192.168.15.63
– 192.168.15.64
• Pinjam bit untuk hasilkan subnet kedua
– 3 bit dipinjam, untuk hasilkan subnet /27
– Ini menghasilkan beberapa subnet lagi
• 192.168.15.64
• 192.168.15.96
• Pilih subnet pertama untuk PerthHQ
– 192.168.15.64/27
Jalan Kira
LANGKAH 4
• Kenalpasti network seterusnya
– SydneyHQ ~ 10 host
– CorpusHQ ~ 10 host
• Pilih IP yang seterusnya ialah :
• sbb range awal tadi IP terakhirnya
192.168.15.95
– 192.168.15.96
• Pinjam bit untuk hasilkan
subnet ketiga dan keempat
– 4 bit dipinjam, untuk hasilkan
subnet /28
– Ini menghasilkan beberapa
subnet lagi
• 192.168.15.96
• 192.168.15.112
• Pilih NetID SydneyHQ dan
CorpusHQ
Jalan Kira
LANGKAH 5
• Kenalpasti network
seterusnya
– 3 point-to-point WAN memerlukan
2 IP untuk setiap satu interface
yang bersambung dengan kabel
• Pilih IP yang seterusnya
ialah :
• sbb range awal tadi IP terakhirnya
192.168.15.127
– 192.168.15.128
• Pinjam bit untuk
hasilkan subnet kelima
– 6 bit dipinjam, untuk hasilkan
subnet /30
• Ini menghasilkan
beberapa subnet lagi
– 192.168.15.128
– 192.168.15.132
– 192.168.15.136
• Pilih NetID ini untuk
ketiga-tiga WAN
Jalan Kira
Jom cuba cara jadual
Jangan malass..belajar jadi rajin!!
FAKTA KUNCI
• CIDR, an ISP requiring 3,000 host addresses could
request either a full Class B address space or
multiple Class C network addresses to meet its
requirements. With a Class B address space, the
ISP would waste thousands of registered
addresses. If it requested multiple Class C
addresses, it could be difficult to design the ISP
network so that no single section required more
than 254 host addresses. Routing tables
containing many Class C addresses can also get
large and difficult to manage.
• By ignoring the traditional address classes, CIDR
enables the ISP to request a block of addresses based
on the number of host addresses it requires.
Supernets, created by combining a group of Class C
addresses into one large block, enable addresses to be
assigned more efficiently.
• An example of a supernet is 192.168.0.0/19. Using the
first 19 bits of the IP address for the network prefix
enables this supernet to contain 8,190 possible host
addresses. An ISP can use a supernet as one large
network or divide it into as many smaller networks as
needed to meet its requirements.
• In this example of a supernet, the private Class C
address of 192.168.0.0 is used. In reality, most
networks that use private addressing use either
the Class A or B reserved addresses and
subnetting.
• Although classed addressing and fixed-length
subnet masking are becoming less common, it is
important to understand how these addressing
methods work. Many devices still use the default
subnet mask if no custom subnet mask is
specified.
• In an IPv4 network, the hosts can communicate one of
three different ways:
– Unicast - the process of sending a packet from one host to
an individual host
– Broadcast - the process of sending a packet from one host
to all hosts in the network
– Multicast - the process of sending a packet from one host
to a selected group of hosts
• These three types of communication are used for
different purposes in the data networks. In all three
cases, the IPv4 address of the originating host is placed
in the packet header as the source address.
Unicast Traffic
• Unicast communication is used for the normal
host-to-host communication in both a
client/server and a peer-to-peer network. Unicast
packets use the host address of the destination
device as the destination address and can be
routed through an internetwork. Broadcast and
multicast, however, use special addresses as the
destination address. Using these special
addresses, broadcasts are generally restricted to
the local network. The scope of multicast traffic
also may be limited to the local network or
routed through an internetwork.
Broadcast Transmission
•
•
•
Because broadcast traffic is used to send packets to all hosts in the network, a
packet uses a special broadcast address. When a host receives a packet with the
broadcast address as the destination, it processes the packet as it would a packet
to its unicast address.
Broadcast transmission is used for the location of special services/devices for
which the address is not known or when a host needs to provide information to all
the hosts on the network.
Some examples for using broadcast transmission are:
– Mapping upper layer addresses to lower layer addresses
– Requesting an address
– Exchanging routing information by routing protocols
•
•
When a host needs information, the host sends a request, called a query, to the
broadcast address. All hosts in the network receive and process this query. One or
more of the hosts with the requested information will respond, typically using
unicast.
Unlike unicast, where the packets can be routed throughout the internetwork,
broadcast packets are usually restricted to the local network. This restriction is
dependent on the configuration of the router that borders the network and the
type of broadcast. There a
Multicast Transmission
•
•
Multicast transmission is designed to conserve the bandwidth of the IPv4 network.
It reduces traffic by allowing a host to send a single packet to a selected set of
hosts. To reach multiple destination hosts using unicast communication, a source
host would need to send an individual packet addressed to each host. With
multicast, the source host can send a single packet that can reach thousands of
destination hosts.
Some examples of multicast transmission are:
–
–
–
–
•
Video and audio distribution
Routing information exchange by routing protocols
Distribution of software
News feeds
Multicast Clients
–
–
Hosts that wish to receive particular multicast data are called multicast clients. The multicast clients
use services initiated by a client program to subscribe to the multicast group.
Each multicast group is represented by a single IPv4 multicast destination address. When an IPv4
host subscribes to a multicast group, the host processes packets addressed to this multicast address
as well as packets addressed to its uniquely allocated unicast address. As we will see, IPv4 has set
aside a special block of addresses f
You can do it if you try…verry-verry
hard!!
Download