【正文】
unicast to the destination 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛473 ARP Packet Hardware Type Protocol Type Hardware length Protocol length Operation Request1, Reply2 Sender hardware address Sender protocol address Target hardware address Target protocol address 00 01 08 00 06 04 00 02 00 05 5D 06 14 18 CA 73 0C 22 00 90 27 A7 98 41 CA 73 0C 3E 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛474 ARP Request Packet 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛475 ARP Reply Packet 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛476 Four Cases Using ARP: 1 Sender Case1: A host has a packet to send to another host on the same work Receiver Target IP address: Destination address in the IP datagram Host Host LAN 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛477 Four Cases Using ARP: 2 Sender Case2: A host wants to send a packet to another host on another work Receiver Target IP address: IP address of the default router Host Router LAN 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛478 Four Cases Using ARP: 3 Sender Case3: A router receives a packet to be sent to a host on another work Receiver Target IP address: IP address of the appropriate router Router LAN Router 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛479 Four Cases Using ARP: 4 Sender Case4: A router receives a packet to be sent to a host on the same work Receiver Target IP address: Destination address in the IP datagram Host Router LAN 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛480 IP Address Cheating Cache Table Logical address Physical address IP A MAC A IP R MAC R Host A Host B Router AHost A cheats, so all the packets routed to the router from host B redirect to host A 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛481 Static Address Binding ? Static address binding declines IP address cheating ? ARP maintains these static entries until they?re updated by the administrator 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛482 Denial of Invalid User Network accesses from these two hosts are denied by the router 2022/3/13 第四章 網(wǎng)絡(luò)層 網(wǎng)絡(luò)工程系 董剛483 IP 數(shù)據(jù)報的格式 ? 一個 IP 數(shù)據(jù)報由首部和數(shù)據(jù)兩部分組成。 ? 路由器的路由表中的每一個項目,除了要給出目的網(wǎng)絡(luò)地址外,還必須同時給出該網(wǎng)絡(luò)的子網(wǎng)掩碼。 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 add