【正文】
(但主機必須知道是哪一類網(wǎng)絡(luò),以確定網(wǎng)絡(luò)號位數(shù),及 0的個數(shù) )。 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛442 特殊的 IP地址(總結(jié)) Special Address Netid Hostid Source or Destination Network address Specific All 0s None Direct broadcast address Specific All 1s Destination Limited broadcast address All 1s All 1s Destination This host on this work All 0s All 0s Source Specific host on this work All 0s Specific Destination Loopback address 127 Any Destination 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛443 網(wǎng)絡(luò)地址舉例 Specific All 0s Netid Hostid A類 B類 C類 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛444 直接廣播地址舉例 Used by a router to send a message to every host on a local work. Every host/router receives and processes the packet with a direct broadcast address. 目的 IP地址 : 主機 id: 255 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛445 有限廣播地址舉例 Used by a host to send a packet to every host on the same work. However, the packet is blacked by routers to confine the packet to the local work. 目的 IP地址 : Router blocks the limited broadcast packet 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛446 ”This” Host on ”This” Network舉例 ?.?.?.? Bootstrat server 源 IP地址: A host which does not know its IP address uses the IP address as the source address and as the destination address to send a message to a bootstrap server. 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛447 Specific Host on “This” work舉例 目的 IP地址 : Used by a router or host to send a message to a specific host on the same work. 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛448 Example: Loopback Address Process 1 Process 2 目的 IP地址 : A packet with a loopback address will not reach the work. TCP or UDP IP 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛449 私有地址 ? ? ? 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛450 子網(wǎng)掩碼 一個某類網(wǎng)絡(luò)只給一個單位 ,浪費太大 . ? 當(dāng)單位物理地域很大時 ,使用網(wǎng)橋效果不好 ,要使用路由器就必須在不同的網(wǎng)絡(luò)中 . ? 劃分子網(wǎng)更安全 . ? 劃分子網(wǎng)其實就是資源的再分配 . 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛451 子網(wǎng)化技術(shù) ? 根據(jù)實際的需要來劃分子網(wǎng) ? 若不進行子網(wǎng)劃分 ,則其子網(wǎng)掩碼為默認值 ,此時子網(wǎng)掩碼中” 1”的長度就是網(wǎng)絡(luò)號的長度 . ? A類 子網(wǎng)掩碼默認值 : ? B類 子網(wǎng)掩碼默認值 : ? C類 子網(wǎng)掩碼默認值 : 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛452 子網(wǎng)化技術(shù) 劃分子網(wǎng)的本質(zhì)就是從網(wǎng)絡(luò)的主機號里借用若干個比特作為子網(wǎng)號 (subid)而主機號 (hostid)也就相應(yīng)地減少了若干個比特 .請注意 :劃分子網(wǎng)只是將 IP地址的本地部分再劃分 . 根據(jù) IP地址可以判斷是 A,B,C類中的哪一類 ,子網(wǎng)掩碼指出子網(wǎng)號 (subid)和主機號 (hostid)的分界線 . 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛453 子網(wǎng)掩碼舉例 Q:某網(wǎng)絡(luò)子網(wǎng)掩碼為 0xFFFFFFE0,IP地址為 號 . 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛454 10001100 140 11111100 252 00010100 20 01000100 68 11111111 255(FF) 11111111 255(FF) 11111111 255(FF) 11100000 224(E0) 子網(wǎng)掩碼舉例 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛455 子網(wǎng)掩碼舉例 A:該 IP為 B類網(wǎng)絡(luò) ,故其默認子網(wǎng)掩碼應(yīng)為 , 后面的 11位是子網(wǎng)號 ,最后 5位是主機號 既 :網(wǎng)絡(luò)號為 ,子網(wǎng)號為 162, 主機號為 4. 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛456 子網(wǎng)化技術(shù) 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛457 A Subted Network Subwork Subwork Subwork Site Network 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛458 141 14 2 21 ? ? ? Netid Hostid Network access Host access Hostid Subwork access Host access Subid 子網(wǎng)的分層 定位站點 子網(wǎng)號 子網(wǎng)中的主機號 Three steps of the routing of an IP datagram: ?Delivery to the site ?Delivery to the subwork ?Delivery to the host 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛459 Masking Masking ? 是一種對 IP地址進行再劃分的技術(shù) ? 不一定非要使用 ? 由 mask 的長度來決定網(wǎng)絡(luò)號的長度 Mask ? A 32bit number ? The bit 1 corresponding to the bit of workid in an IP address, and the bit 0 corresponding to the bit of hostid 11001010 01110011 00001100 00000000 11111111 11111111 11111111 00000000 1 10Mask 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛460 地址計算 Mask IP address Network address . Mask IP address Network address .32 Network address = (IP address ) ? (Mask) Host ?address? = (IP address) ? (Mask) Address range = {(Network address), (Network address + – Mask)} 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛461 子網(wǎng)化的問題 ? 如何劃分子網(wǎng) ? 劃分了子網(wǎng)之后如何路由 Subting 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛462 例 1: 對 A 類網(wǎng)絡(luò)進行子網(wǎng)劃分 問題 給一個 A類網(wǎng)絡(luò)劃分 1000個子網(wǎng),請確定子網(wǎng)掩碼并配置每個子網(wǎng) 答案 ? Need for at least 1000 subworks ? Theoretically, we need at least 1002 subworks to allow for the all1s and all0s subids ? Because 291002210, so the minimum number of bits to be allocated for subting should be 10 ? 32810=14, so fourteen bits are left to define the hostids , which means that 16382 puters can be attached to each subwork 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛463 11111111 00000000 00000000 00000000 例 1的子網(wǎng)掩碼 Mask Netid Hostid 未劃分子網(wǎng) Mask Netid Hostid 劃分了子網(wǎng)之后 11111111 11111111 11000000 00000000 Subid ( 192D=11000000 00000000B ) 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛464 例 1的地址范圍 第一個子網(wǎng) 第二個子網(wǎng) 第 1022個子網(wǎng) 特殊地址 (subid all 0s) 特殊地址 (subid all 1s) 特殊地址 (hostid all 0s) 特殊地址 (hostid all 1s) 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛465 例 1的子網(wǎng) 子網(wǎng) 子網(wǎng) 本站點 去 Inter的出口 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛466 例 2: 對 B 類網(wǎng)絡(luò)進行子網(wǎng)劃分 問題 給一個 B類網(wǎng)絡(luò)劃分 10個子網(wǎng),請確定子網(wǎng)掩碼并配置每個子網(wǎng) 答案 ? Need for at least 12 subworks ? Theoretically, we need at least 14 subworks to allow for the all1s and all0s subids ? Because 231424, so the minimum number of bits to be allocated for subting should be 4 ? 32164=12, so twelve bits are left to define the hostids , which means that 4094 puters can be attached to each subwork 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛467 11111111 11111111 00000000 00000000 例 2的子網(wǎng)掩碼 Mask Netid Hostid 未劃分子網(wǎng) Mask Netid Hostid 劃分了子網(wǎng)之后 Subid ( 240D=11110000 00000000B ) 11111111 11111111 11110000 00000000 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛468 例 2的地址范圍 第一個子網(wǎng) 第二個子網(wǎng) 第 14個子網(wǎng)