22
Một số TIPs và kĩ thuật chia SUBNET nhanh chóng. The Fast Way: Subnetting a Class C Address When you’ve chosen a possible subnet mask for your network and need to determine the num- ber of subnets, valid hosts, and broadcast addresses of a subnet that the mask provides, all you need to do is answer five simple questions: 1. How many subnets does the chosen subnet mask produce? 2. How many valid hosts per subnet are available? 3. What are the valid subnets? 4. What’s the broadcast address of each subnet? 5. What are the valid hosts in each subnet? At this point it’s important that you both understand and have memorized your powers of 2. Here’s how you get the answers to those five big questions: How many subnets? 2^x – 2 = number of subnets. x is the number of masked bits, or the 1s. For example, in

Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

  • Upload
    songaco

  • View
    147

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Một số TIPs và kĩ thuật chia SUBNET nhanh chóng.The Fast Way: Subnetting a Class C Address

When you’ve chosen a possible subnet mask for your network and need to determine the num-ber of subnets, valid hosts, and broadcast addresses of a subnet that the mask provides, all you need to do is answer five simple questions:

1.How many subnets does the chosen subnet mask produce?

2.How many valid hosts per subnet are available?

3.What are the valid subnets? 4.What’s the broadcast address of each

subnet? 5.What are the valid hosts in each subnet?

At this point it’s important that you both understand and have memorized your powers of 2. Here’s how you get the answers to those five big questions:

How many subnets?

2^x – 2 = number of subnets. x is the number of masked bits, or the 1s. For example, in 11000000, the number of ones gives us 2^2 - 2 = 2 subnets . In this example , there are 2 subnets .

How many hosts per subnet?

2^y – 2 = number of hosts per subnet. y is the number of unmasked bits, or the 0s. For example, in 11000000, the number of zeros gives us 2^6 - 2

Page 2: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

hosts . In this example, there are 62 hosts per subnet.

What are the valid subnets?

256 – subnet mask = block size, or base number. For example, 256 – 192 = 64. 64 is the first subnet. The next subnet would be the base number plus itself, or 64 + 64 = 128, (the second subnet). You keep adding the base number to itself until you reach the value of the subnet mask, which is not a valid subnet because all subnet bits would be turned on (1s).

What’s the broadcast address for each subnet?

The broadcast address is all host bits turned on, which is the number immediately preceding the next subnet.

What are the valid hosts?

Valid hosts are the numbers between the subnets, omitting all 0s and all 1s.

Practice Example #1C: 255.255.255.192 (/26)

192.168.10.0 = Network address255.255.255.192 = Subnet mask

How many subnets? Since 192 is 2 bits on (11000000), the answer would be 2^2– 2 = 2. (The minus 2 is the subnet bits all on or all off, which are not valid by default.)

Page 3: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

How many hosts per subnet?We have 6 host bits off (11000000), so the equation would be 2^6 -2 = 62 hosts.

What are the valid subnets?256 – 192 = 64, which is the first subnet and our base number or block size. Keep adding the block size to itself until you reach the subnet mask. 64 + 64 = 128. 128 + 64 = 192, which is invalid because it is the subnet mask (all subnet bits turned on). Our two valid subnets are, then, 64 and 128

What’s the broadcast address for each subnet?

The number right before the value of the next subnet is all host bits turned on and equals the broadcast address.

What are the valid hosts? These are the numbers between the subnet and broadcast address. The easiest way to find the hosts is to write out the subnet address and the broadcast address. This way the valid hosts are obvious. The following table shows the 64 and 128 subnets, the valid host ranges of each, and the broadcast address of both subnets:

The subnets (do this first)------------------------64------------128Our first host (perform host addressing last)-------65------------129Our last host ------------------------------------126-----------190

Page 4: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

The broadcast address (do this second)-----------127-----------191

192.168.10.0 = Network address255.255.255.224 = Subnet mask

How many subnets?224 is 11100000, so our equation would be 2^3 - 2 = 6

How many hosts?2^5 -2 = 30

What are the valid subnets? 256 – 224 = 32. 32 + 32 = 64. 64 + 32 = 96. 96 + 32 = 128. 128 + 32 = 160. 160 + 32 = 192. 192 + 32 = 224, which is invalid because it is our subnet mask (all subnet bits on). Our subnets are 32, 64, 96, 128, 160, and 192.

What’s the broadcast address for each subnet (always the number right before the next subnet)?

What are the valid hosts (the numbers between the subnet number and the broadcast address)?

The subnet address------32-------- 64 -----------96 -------128 -----160 --------192The first valid host-------33-------- 65 -----------97 -------129 -----161 --------193The last valid host-------62---------94 -----------126 ------

Page 5: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

158 -----190 --------222The broadcast address---63---------95 -----------127 ------159 -----191 --------223192.168.10.0 = Network address255.255.255.240 = Subnet mask

Subnets? 240 is 11110000 in binary. 2^4 - 2 = 14 .

Hosts? 4 host bits, or 2^4 - 2 = 14

Valid subnets?256 – 240 = 16. 16 + 16 = 32. 32 + 16 = 48. 48 + 16 = 64. 64 + 16 = 80. 80 + 16 = 96. 96 + 16 = 112. 112 + 16 = 128. 128 + 16 = 144. 144 + 16 = 160. 160 + 16 = 176. 176 + 16 = 192. 192 + 16 = 208. 208 + 16 = 224. 224 + 16 = 240, which is our subnet mask and therefore invalid. So, our valid subnets are 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, and 224.

Broadcast address for each subnet?

Valid hosts?

Page 6: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Trích:

tuxuong Practice Example #1C: 255.255.255.192 (/26)

The subnets (do this first)------------------------64------------128Our first host (perform host addressing last)-------65------------129Our last host ------------------------------------126-----------190The broadcast address (do this second)-----------127-----------191

Vậy kết quả là :

Sub Add: 192.168.10.64First: 192.168.10.65Last: 192.168.10.126Broad : 192.168.10.127Sub Mask : 192.168.10.64/26

Sub Add: 192.168.10.128First: 192.168.10.129Last: 192.168.10.190Broad : 192.168.10.191Sub Mask : 192.168.10.128/26

Đúng ko anh ?

Trích:

The subnet address------32-------- 64 -----------96 -------128 -----160 --------192The first valid host-------33-------- 65 -----------97 -------129 -----161 --------193

Page 7: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

The last valid host-------62---------94 -----------126 ------158 -----190 --------222The broadcast address---63---------95 -----------127 ------159 -----191 --------223

tuong tu vay 10.32/2710.64/2710.96/27

à ?

Hình như tư từ hiểu rồi !

192.168.10.0 = Network address255.255.255.248 = Subnet mask

Subnets? 248 in binary = 11111000 . 2^5– 2 = 30.

Hosts?2^3 - 2 = 6

Valid subnets? 256 – 248 = 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, and 240.

Broadcast address for each subnet?

Valid hosts?

Page 8: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

192.168.10.0 = Network address255.255.255.252 = Subnet mask

Subnets?62.

Hosts? 2.

Valid subnets? 4, 8, 12, etc., all the way to 248.

Broadcast address for each subnet? (always the number right before the next subnet)

Valid hosts? (the numbers between the subnet number and the broadcast address)

Page 9: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Mình làm thử một ví dụ sau đây nhé . Chúng ta được cấp một dãy địa chỉ là :

172.16.0.0/16 .

Yêu cầu : Hãy chia vùng địa chỉ trên thành những subnet sao cho mỗi subnet có 30 hosts .

Ta thấy là nếu để nguyên vùng địa chỉ như trên , chúng ta chỉ có duy nhất một network . Network này có rất là nhiều hosts : 2^16-2 hosts , vùng địa chỉ ip ta có thể gán cho các hosts nằm trong khoảng 172.16.0.1 đến 172.16.255.254 .

Bước 1 : Tìm xem subnet mask ứng với các subnet cần chia là bao nhiêu ? Ta cần có 30 hosts , như vậy số bits dành cho hosts là 5 bits vì 2^5 - 2 = 30 . Như vậy còn bao nhiêu bits là dành cho network ? Ta lấy 32 - 5 = 27 bits . Ta có 27 bits là số lượng các bit dành cho network .

11111111.11111111.11111111.11100000255 . 255 .255 .224

Vậy ta có subnet mask cho các subnet phải tìm là : 255.255.255.224 .

Bước 2 : Tìm bước nhảy .

Ta lấy 255.255.255.256 - 255.255.255.224 = 0.0.0.32 .

Bước 3 : Tìm ra Subnet đầu tiên và các subnet kế tiếp

Page 10: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Đề bài cho ta :

172.16.0.0 = network address .

Ta không lấy subnet 0 nên Subnet đầu tiên là : 172.16.0.0+ 0. 0.0.32= 172.16.0.32Subnet thứ 2 là : 172.16.0.32+ 0 .0 .0.32= 172.16.0.64Tương tự như vậy ta có được bảng chia SUBNET như sau :

7 Subnet đầu tiên là :

7 Subnet kế tiếp là :

Page 11: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Và 7 Subnet cuối cùng của bảng chia subnet là :

chào anh tuxuong . Có network này : 172.16.0.0/16 gồm có 2 subnet và 1000 host . em chia thế này :

+ đầu tiên ta tìm subnet mask : 2^2 -2 = 2 sub và 2^10 -2 =1022 ( nhưng ở đây chỉ có 1000 host ) , như vậy số bit dành cho host là : 2+10=12 bit , vậy số bit dành cho network là : 32-12 = 20 bit 11111111.11111111.11110000.000000000255.255.240.0 subnet mask

+kế tiếp ta tìm bước nhảy :255.255.256.0-255.255.240.0= 0.0.16.0 --> bước nhảy là 16

anh giúp em làm tiếp phần còn lại , hic hic hicDear anhxitin ,Số hosts bạn cần là 1000 hosts , do đó bạn phải tính toán làm sao đủ số lượng bit hosts . Ta thấy 2^10 = 1024 , 1024-2 = 1022 > 1000 , như vậy là đã đủ số lượng bit hosts cho 1000 host rồi đấy . Vậy số lượng bit hosts ( hay số bit 0 ) là : 10 .

Page 12: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Do vậy số bit còn lại sẽ là bit network ( số bit 1 ) : 32 - 10 = 22 . Ta thấy rằng đề bài cho ta 172.16.0.0/16 . Số bit network của chúng ta cần là 22 . Do đó ta cần mượn thêm 6 bit nữa . Vậy số lượng subnet ta có được là : 2^6 - 2 = 62 networks .

Ta tính subnet mask cho từng subnet này nhé : 22 bits 1 , 10 bits 0 . Khi viết ra dạng Decimal thì có dạng : 255.255.252.0 ( bạn đếm xem : có 22 bits 1 , 10 bits 0 đấy )Như vậy bước nhảy của mình là : 0.0.4.0Subnet đầu tiên là ( không tính subnet 0 )172.16.4.0172.16.4.1 ( first host )|||172.16.7.254 ( last host )172.16.7.255 ( broadcast )

Subnet kế tiếp là 172.16.8.0172.16.8.1 ( first host )|||172.16.11.254 ( last host )172.16.11.255 ( broadcast )

Tương tự , bạn cộng tiếp theo xem sao nha , rồi post lên đây cho các bạn khác xem nữa nhé .

Page 13: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

em xin cộng tiếp

Subnet kế tiếp172.16.12.0172.16.12.1 first host...............172.16.15.254 last host172.16.15.255 broadcast

Subnet kế tiếp 172.16.16.0172.16.16.1 first host...............172.16.19.254 last host172.16.19.255 broadcast

Tương tự em có subnet cuối cùng172.16.248.0172.16.248.1 first host.................172.16.251.254 last host172.16.251.255 broadcast

mà anh tuxuong ơi , ở đây sao chỉ tính 1000 host mà không tính cho 2 subnet vậy anh ??Trong phần chia subnet , chúng ta đặc biệt chú ý đến : phải đảm bảo đủ số lượng cho host , không dư quá nhiều mà cũng không được thiếu . Ở đây bạn chỉ dùng có 2 subnet thôi , do đó bạn chỉ cần chọn ra 2 subnet bất kì trong số 62 subnets mà chúng ta đã có .

Rõ ràng nhu cầu của bạn chỉ cần có 2 subnet mà trong đó mỗi subnet có 1000 hosts . Ở đây chúng ta

Page 14: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

có 62 subnets , mỗi subnet có 1000 hosts . Bạn chỉ việc lựa ra 2 trong số 62 subnets này để gán cho các interface .

Tính nhẩm subnet Class B

Question: What subnet and broadcast address is the IP address 172.16.10.33 255.255.255.224 a member of?Answer: 256 – 224 = 32. 32 + 32 = 64. Bingo: 33 is between 32 and 64. However, remember that the third octet is considered part of the subnet, so the answer would be the 10.32 sub-net. The broadcast is 10.63, since 10.64 is the next subnet.

Question: What subnet and broadcast address is the IP address 172.16.90.66 255.255.255.192 a member of?Answer: 256 – 192 = 64. 64 + 64 = 128. The subnet is 172.16.90.64. The broadcast must be 172.16.90.127, since 90.128 is the next subnet.

Question: What subnet and broadcast address is the IP address 172.16.50.97 255.255.255.224 a member of?Answer: 256 – 224 = 32, 64, 96, 128. The subnet is 172.16.50.96, and the broadcast must be 172.16.50.127 since 50.128 is the next subnet.

Question: What subnet and broadcast address is the IP address 172.16.10.10 255.255.255.192 a member of?Answer: 256 – 192 = 64. This address must be in the 172.16.10.0 subnet, and the broadcast must be

Page 15: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

172.16.10.63.

Question: What subnet and broadcast address is the IP address 172.16.10.10 255.255.255.252 a member of?Answer: 256 – 252 = 4. The subnet is 172.16.10.8, with a broadcast of 172.16.10.11.

Have fun .

Chia subnet và xác định network thứ N !

Cao thủ nào có thể cho em biết cách xác định đường mạng thứ n khi đã chia subnet rồi không ? Bài toán của em thế này .--------------------------------Cho đường mạng 15.0.0.0/8.Hãy chia subnet để mỗi subnet có 2000 máy tính.Ghi ra đường mạng thứ 10, 1000----------------------------------Đổi network ra nhị phân được như sau :15. 00000000 . 00000|000 . 00000000|Bước 1: mượn 13 bit làm networkBước 2: subnet mask 255.255.248.0Bước 3: Xác định subnet , các subnet là bội số của 8Subnet 1: 15.0.8.0Subnet 10: 15.0.80.0IP đầu: 15.0.80.1IP cuối 15.0.87.254BC 15.0.87.255Subnet 11: 15.0.88.0

Page 16: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

Chỉ tính được đến đây thôi , còn subnet thứ 1000 không biết cách nào xác định được mong các cao thủ cho em một qui tắc tính ,hoặc hướng dẫn em tính . Xin cảm ơn .Subnet thứ n là bao nhiêu ? Subnet thứ n = n / bước nhảy . Kết quả :Nếu là số nguyên . --> đây là subnet thứ n Nếu không là số nguyên --> subnet là số phần nguyên cộng thêm ( phần dư – 1 ) số các bước nhảy .

Subnet----------------------------Subnet thứ

10.0.0.0/28------------------------010.0.0.16--------------------------110.0.0.32--------------------------2‘‘‘‘‘10.0.0.240-------------------------1510.0.1.0---------------------------1610.0.2.0---------------------------32=16*210.0.3.0---------------------------48=16*310.0.4.0---------------------------64=16*4;;; 10.0.255.0-------------------------255*1610.1.0.0---------------------------256*1610.1.1.0---------------------------257*16;

Page 17: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

;;;;10.255.255.0-----------------------255*256*16

Tổng số subnet là 256*256*16 = 2^20

Ví dụ : tìm subnet thứ 1000 là subnet nào ? 1000/16 = 62 , dư 8

1000=62*16+8

62 nghĩa là ta có subnet 10.0.62.0 ; dư 8 nghĩa là phải thêm 8-1=7 ( nếu tính rằng subnet đầu tiên là subnet 0 ) bước nhảy 16 nữa sau subnet 10.0.62.0

10.0.62.0-------------------------subnet thứ 993( sẽ là subnet 992 nếu không tính subnet 0 )10.0.62.16------------------------subnet thứ 99410.0.62.32 ; 10.0.62.48 ;10.0.62.64 ;10.0.62.80 :10.0.62.96 :10.0.62.112----------------------subnet thứ 1000

Từ Subnet 10.0.62.0 , ta tính thêm 7 bước nhảy 16 nữa và được subnet thứ 1000.

Vậy subnet thứ 1000 là 10.0.62.112

Bài viết trên tính subnet thứ nhất là subnet 0 . Thực tế thì mình cũng không phải quá quan tâm vào

Page 18: Một số TIPs và kĩ thuật chia SUBNET nhanh chóng

việc đi tính subnet thứ n nào đó cả . Boson cung cấp cho ta một công cụ tính subnet rất tiện lợi , bạn hãy truy cập và dùng thử xem thế nào nhé :

http://www.boson.com/FreeUtilities.htmlcon cach nay nhanh hon ne !!

lay 1000 doi sang bit nhi phan =1111101000 sau co ap vao the nay ne15. 00000000 . 00000|000 . 00000000|15. 00011111 . 01000

-> suy ra subnet thu 1000 la : 15.31.64.0 / 21nhu vay do nhanh lam muon tinh subnet nao cung duoc mien dung vuot qua' gioi han la ok roi