1 / 19

ARP ( Address Resolution Protocol )

ARP ( Address Resolution Protocol ). 協定位址 ( Protocol Address ). 像 IP 位址這樣由上層軟體設計的協定位址,實體網路是不瞭解的。 實體網路無法用協定位址 找到主機 。 因此網路存取層必須將主機的 協定位址 轉成實體位址 ,才能送出封包 。. 位址解析 ( Address Resolution ). 當要送資料給在 同一實體網路上 的電腦時,便會使用到位址解析的功能。 將 電腦 的 協定位址 轉成實體位址 ,稱為位址解析。

kira
Télécharger la présentation

ARP ( Address Resolution Protocol )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ARP(Address Resolution Protocol)

  2. 協定位址(Protocol Address) • 像 IP 位址這樣由上層軟體設計的協定位址,實體網路是不瞭解的。 • 實體網路無法用協定位址找到主機。 • 因此網路存取層必須將主機的協定位址轉成實體位址,才能送出封包 。

  3. 位址解析(Address Resolution) • 當要送資料給在同一實體網路上的電腦時,便會使用到位址解析的功能。 • 將電腦的協定位址轉成實體位址,稱為位址解析。 • 主機不會要知道遠端網路的電腦實體位址,主機只會要知道下一個 Hop 的電腦實體位址。 • 位址解析在求取同一實體網路上電腦的實體位址。

  4. 位址解析技巧 • 查表(Table lookup) • 計算(Closed-form computation) • 當網路使用可設定組態的定址(configurable addressing)時,區域網路的管理者必須挑選協定位址和實體位址。這兩個位址必須使位址解析的計算越簡單越好。 • 訊息交換(Message exchange)

  5. Table lookup

  6. 以索引(index)查表

  7. Comparison T: Table lookup C: Computation D: Data exchange

  8. 位址解析協定(Address Resolution Protocol,ARP) • 將 IP 位址轉換成 Ethernet 的 MAC 位址。 • ARP software 建立位址解析表格。 • 當有轉換 IP 位址為MAC位址的要求時,ARP software 便查詢表格 • exist:傳回 Ethernet 位址 • Not exist:ARP 對 Ethernet 上所有 host 廣播,詢問此 IP 位址的 host。如果有 host 確認為其 IP,便會回傳。ARP 就可將其記錄於表中。

  9. 廣播 ARP 要求

  10. ARP 訊息格式(1)

  11. ARP 訊息格式(2) • Hardware Type:指定實體網路的型態。如 Ethernet 為 type 1。 • Protocol Type:指定協定的型態。如 IPv4 為 type 080016。 • HADDR LEN:實體位址的byte 數。 • PADDR LEN:協定位址的byte 數。 • Operation:指定 packet 的型態。ARP request 為 1,ARP reply 為 2。

  12. ARP 訊息格式(3) • ARP 訊息格式足以轉換任意的協定位址(PADDR)與實體位址(HADDR) • 目前 ARP 幾乎都是用於將 32-bit IP位址轉成 48-bit Ethernet 位址

  13. Hardware Type Value Description 17 HDLC. 18 Fibre Channel. 19 ATM, Asynchronous Transmission Mode. 20 Serial Line. 21 ATM, Asynchronous Transmission Mode. 22 MIL-STD-188-220. 23 Metricom. 24 IEEE 1394.1995. 25 MAPOS. 26 Twinaxial. 27 EUI-64. 28 HIPARP. 29 IP and ARP over ISO 7816-3. 30 ARPSec. 31 IPsec tunnel. 32 Infiniband. 33 CAI, TIA-102 Project 25 Common Air Interface. Value Description 1 Ethernet. 2 Experimental Ethernet. 3 Amateur Radio AX.25. 4 Proteon ProNET Token Ring. 5 Chaos. 6 IEEE 802. 7 ARCNET. 8 Hyperchannel. 9 Lanstar. 10 Autonet Short Address. 11 LocalTalk. 12 LocalNet (IBM PCNet or SYTEK LocalNET). 13 Ultra link. 14 SMDS. 15 Frame Relay 16 ATM, Asynchronous Transmission Mode.

  14. 送出 ARP 訊息 • 指認 ARP Frames • 在 Frame 表頭指定為ARP 訊息型態- 0806 • 捕捉 ARP 回應並存檔

  15. 處理 ARP 訊息 • 兩項事實: • 大多數電腦的通訊為雙向(two-way)溝通 -當訊息由一端送到另一端,通常都會送訊息回來。 • 儲存位址連結(address binding)資訊需要記憶體空間,因此電腦不可能儲存過多的資料。

  16. 位址解析表格 • UNIX以指令 arp 顯示位址解析表格 • $ arp -n ms • ? (140.126.111.3) at 0:a0:c9:8b:61:e3 permanent [ethernet]

  17. arp usage: arp [-n] hostname arp [-n] -a arp -d hostname [proxy] arp -d -a arp -s hostname ether_addr [temp] [pub] arp -S hostname ether_addr [temp] [pub] arp -f filename

  18. C:\>Documents and Settings\arp –a Interface Address Physical Address Type 192.168.0.1 00-26-5a-b5-9c-2d dynamic 192.168.0.1 04 00-1e-65-81-3-aa dynamic

  19. UNIX位址解析表格 $arp -a dns.chinmin.edu.tw (140.126.111.1) at 0:90:27:76:a2:62 [ethernet] ms.chinmin.edu.tw (140.126.111.3) at 0:a0:c9:8b:61:e3 permanent [ethernet] bbs.chinmin.edu.tw (140.126.111.6) at 0:90:27:a2:bc:b5 [ethernet] ? (140.126.111.19) at 0:90:27:a2:bb:d1 [ethernet] ? (140.126.111.20) at 0:e0:63:3:df:80 [ethernet] cmcln.chinmin.edu.tw (140.126.111.100) at 0:90:27:76:a2:60 [ethernet] ? (140.126.111.153) at 0:80:c8:ef:46:5d [ethernet] ? (140.126.111.155) at 0:80:c8:ef:7f:f4 [ethernet] o161.chinmin.edu.tw (140.126.111.161) at 0:80:c8:ef:50:d2 [ethernet] ? (140.126.111.163) at 0:50:ba:da:1d:45 [ethernet] ? (140.126.111.174) at 0:80:c8:ef:7f:f2 [ethernet] ? (140.126.111.255) at ff:ff:ff:ff:ff:ff permanent [ethernet]

More Related