Download presentation
Presentation is loading. Please wait.
1
© The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 Chapter 4 IP 定址:分級式定址
2
4 - 2 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 目標 本章結束後,您將能夠: 了解 IPv4 的位址與等級 辨識 IP 位址的等級 找出任一個 IP 位址所在的網路位址 了解遮罩及其使用方式 了解子網路及超網路
3
4 - 3 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 4.1 簡介 本節所討論的主題包括: 位址空間 表示法 在 TCP/IP 通訊協定組的 IP 層裡,用來辨識每台電腦的 東西,稱為網際網路位址 ( Internet address ) 或 IP 位址 ( IP address ) 。 IP 位址是一個 32 位元的二進制數字,具有全域性,用來 唯一的定義 Internet 上的一台電腦或一台路由器。 所有 IP 位址都是唯一的。「唯一」是指一個位址只定義 一個與 Internet 的連接 ( connection ) 。 Internet 上不可以有 兩台裝置有著相同的 IP 位址。
4
4 - 4 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 一個 IP 位址為一個 32 位元的位址。 請注意:
5
4 - 5 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 IP 位址是唯一的。 請注意:
6
4 - 6 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 IPv4 的位址空間為 2 32 或 4,294,967,296 。 請注意:
7
4 - 7 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
8
4 - 8 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 1 解答 我們將每個 8 位元的群組分別改成等效的十進制數字,並 用英文句點加以隔開。 a)129.11.11.239 b)193.131.27.255 c)231.219.139.111 d)249.155.251.15 將下列 IP 位址從二進制表示法改為點式十進制表示法。 a)10000001 00001011 00001011 11101111 b)11000001 10000011 00011011 11111111 c)11100111 11011011 10001011 01101111 d)11111001 10011011 11111011 00001111
9
4 - 9 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 2 解答 我們將每個十進制數字分別改成等效的二進制數字。 a)01101111 00111000 00101101 01001110 b)11011101 00100010 00000111 01010010 c)11110001 00001000 00111000 00001100 d)01001011 00101101 00100010 01001110 將下列 IP 位址從點式十進制表示法改為二進制表示法。 a)111.56.45.78 b)221.34.7.82 c)241.8.56.12 d)75.45.34.78
10
4 - 10 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 3 解答 a) 以點式十進制表示,數字前面不用加零 ( 045 ) 。 b)IP 位址不可以超過 4 個數字。 c) 以點式十進制表示,最大值為 255 ,但 301 大於 255 的範圍。 d) 不可以將二進制及點式十進制混合使用。 將下列 IP 位址的錯誤找出來。 a)111.56.045.78 b)221.34.7.8.20 c)75.45.301.14 d)11100010.23.14.67
11
4 - 11 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 4 解答 我們將每 4 個位元以其等效十六進制數字取代。注意十六進 制表示法,通常不會加入空白或句點。不過,可以在前面 加入 0X ( 或 0x ) 或以下標 16 說明數字為十六進制。 a)0X810B0BEF 或 810B0BEF 16 b)0XC1831BFF 或 C1831BFF 16 將下列 IP 位址從二進制表示法改為十六進制表示法。 a)10000001 00001011 00001011 11101111 b)11000001 10000011 00011011 11111111
12
4 - 12 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 4.2 分級式定址 本節所討論的主題包括: 等級的分辨 網路代碼與主機代碼 等級和區塊 網路位址 足夠的資訊 遮罩 CIDR 表示法 位址耗盡 IP 位址在幾十年前開始時,使用等級 ( class ) 的觀念。這 種架構稱為分級式定址 ( classful addressing ) 。 在 1990 年代中期,一種新的架構稱為無級式定址 ( classless addressing ) 被提出來。這個架構最終將會取代原來的分級 式架構。 儘管部份的 Internet 依舊是使用分級式定址,但轉變程序 進行的相當快。
13
4 - 13 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
14
4 - 14 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
15
4 - 15 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
16
4 - 16 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
17
4 - 17 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 5 我們如何證明等級 A 有 2,147,483,648 個位址。 解答 在等級 A 中,只有一個位元定義其等級。 剩下的 31 個位元可以作為定址用。 所以 2 31 = 2,147,483,648 個位址。
18
4 - 18 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 6 解答 見圖 4.4 的步驟。 a) 第一個位元 0 ,這是等級 A 位址。 b) 最前兩個位元為 1 ,第三個位元為 0 ,這是等級 C 位址。 c) 最前一個位元 0 ,第二個位元為 1 ,這是等級 B 位址。 d) 最前四個位元為 1 ,這是等級 E 位址。 找出下列各位址的等級。 a) 00000001 00001011 00001011 11101111 b) 11000001 10000011 00011011 11111111 c) 10100111 11011011 10001011 01101111 d) 11110011 10011011 11111011 00001111
19
4 - 19 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
20
4 - 20 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 7 找出下列位址的等級。 a) 227.12.14.87 b) 193.14.56.22 c) 14.23.120.8 d) 252.5.15.111 e) 134.11.78.56 解答 a) 第一個位元組 227 ( 在 224 和 239 之間 ) ;等級是 D 。 b) 第一個位元組 193 ( 在 192 和 223 之間 ) ;等級是 C 。 c) 第一個位元組 14 ( 在 0 和 127 之間 ) ;等級是 A 。 d) 第一個位元組 252 ( 在 240 和 255 之間 ) ;等級是 E 。 e) 第一個位元組 134 ( 在 128 和 191 之間 ) ;等級是 B 。
21
4 - 21 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 8 在範例 5 ,我們證明等級 A 的位址有 2 31 個,如果改以點式十 進制表示,要如何證明呢? 解答 等級 A 的位址範圍從 0.0.0.0 到 127.255.255.255 。我們必須 證明這二個數值之差為 2,147,483,648 。這是一個很好的題 目,因為它說明二個位址之間的範圍有多大。我們注意到, 這是基底 ( base ) 為 256 的數字,每個位元組有一個權重。 分別是:
22
4 - 22 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 8 ( 續 ) 要找出每個數目之整數值,我們將每個位元組乘以其權重: 將上面第一個數字減第二個數字再加 1 , 我們得到 2,147,483,648 即 2 31 。
23
4 - 23 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
24
4 - 24 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 很多等級 A 的位址都被浪費掉。 請注意:
25
4 - 25 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
26
4 - 26 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
27
4 - 27 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 不少等級 B 的位址都被浪費掉。 請注意:
28
4 - 28 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
29
4 - 29 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 等級 C 的位址數目對大多數使用單位來講, 可能都太少。 請注意:
30
4 - 30 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 等級 D 的位址做為群播之用,只有一個區塊。 請注意:
31
4 - 31 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 等級 E 的位址保留給特定之用途, 但大部分的位址都被浪費掉了。 請注意:
32
4 - 32 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 在分級式定址架構中,核給使用單位的位址, 即為網路位址 ( 區塊的第一個位址 ) 。 給予一個網路位址,我們可以從這個位址, 自動推算出來網路的位址範圍。 請注意:
33
4 - 33 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 9 解答 這是等級 A 的位址,因為第一個位元組在 0 到 127 之間。 區塊的 Netid 為 17 , 位址範圍從 17.0.0.0 到 17.255.255.255 。 給予網路位址 17.0.0.0 ,找出其等級、區塊、與位址範圍。
34
4 - 34 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 10 解答 這是等級 B 的位址,因為第一個位元組在 128 到 191 之間。 區塊的 Netid 為 132.21 , 位址範圍從 132.21.0.0 到 132.21.255.255 。 給予網路位址 132.21.0.0 ,找出其等級、區塊、與位址範圍。
35
4 - 35 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 11 解答 這是等級 C 的位址,因為第一個位元組在 192 到 223 之間。 區塊的 Netid 為 220.34.76 , 位址範圍從 220.34.76.0 到 220.34.76.255 。 給予網路位址 220.34.76.0 ,找出其等級、區塊、與位址範圍。
36
4 - 36 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
37
4 - 37 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
38
4 - 38 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
39
4 - 39 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 網路位址為每一個區塊的起始位址, 可藉由預設遮罩而獲得 ( 包括它自己 ) 。 它保留了區塊的 Netid ,並且將 Hostid 設為 0 。 請注意:
40
4 - 40 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 12 解答 預設遮罩為 255.0.0.0 ,表示第一個位元組被保留,其他三 個位元組則設為 0 。所以網路位址為 23.0.0.0 。 給予位址 23.56.7.91 ,找出其區塊起始位址 ( 網路位址 ) 。
41
4 - 41 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 13 解答 預設遮罩為 255.255.0.0 ,表示前二個位元組被保留,其他 二個位元組則設為 0 。所以網路位址為 132.6.0.0 。 給予位址 132.6.17.85 ,找出其區塊起始位址 ( 網路位址 ) 。
42
4 - 42 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 14 解答 預設遮罩為 255.255.255.0 ,表示前三個位元組被保留,剩 下一個位元組則設為 0 。所以網路位址為 201.180.56.0 。 給予位址 201.180.56.5 ,找出其區塊起始位址 ( 網路位址 ) 。
43
4 - 43 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 注意,我們不可以將某一等級的預設遮罩, 用到屬於其他等級的位址。 請注意:
44
4 - 44 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 4.3 其他議題 在本節中,我們介紹其他與定址相關的議題,特別是有關分 級式定址的議題。 本節所討論的主題包括: 多重位址裝置 IP 是地點,不是名字 特殊位址 私有位址 單點傳播、群播及廣播位址
45
4 - 45 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
46
4 - 46 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
47
4 - 47 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
48
4 - 48 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
49
4 - 49 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
50
4 - 50 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
51
4 - 51 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
52
4 - 52 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
53
4 - 53 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
54
4 - 54 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 在第 15 章,會有更多關於群播傳遞的介紹。 請注意:
55
4 - 55 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
56
4 - 56 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
57
4 - 57 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
58
4 - 58 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 4.4 子網路化 與超網路化 在前一節,我們討論到分級式定址的相關問題,尤其是剩下 來可供申請的網路位址幾乎耗盡。然而,還有很多組織單位 想要連上 Internet 。在本節中,我們會介紹二種解決方法: 子網路化 ( subnetting ) 與超網路化 ( supernetting ) 。 本節所討論的主題包括: 子網路化 超網路化 超網路遮罩 陳舊過時
59
4 - 59 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 IP 位址設計為兩個階層。 請注意:
60
4 - 60 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
61
4 - 61 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
62
4 - 62 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
63
4 - 63 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
64
4 - 64 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
65
4 - 65 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 範例 15 解答 將位址與子網路遮罩做 AND 運算 所以子網路位址為 200.45.32.0 。 如果目的位址為 200.45.34.56 ,子網路遮罩為 255.255.240.0 , 則子網路位址為何?
66
4 - 66 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
67
4 - 67 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
68
4 - 68 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 實現子網路時,我們需要子網路的第一個位址 與子網路遮罩以定義該子網路的位址範圍。 實現超網路時,我們需要超網路的第一個位址 與超網路遮罩以定義該超網路的位址範圍。 請注意:
69
4 - 69 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007
70
4 - 70 © The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 分級式定址中 子網路化與超網路化的概念幾乎被淘汰。 請注意:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.