Presentation is loading. Please wait.

Presentation is loading. Please wait.

Net5: ARP 協定 授課教師:雲林科技大學 張慶龍 老師. IP Address/Physical Address Static Mapping  IP broadcast address maps to Ethernet broadcast address  IP Multicast Address.

Similar presentations


Presentation on theme: "Net5: ARP 協定 授課教師:雲林科技大學 張慶龍 老師. IP Address/Physical Address Static Mapping  IP broadcast address maps to Ethernet broadcast address  IP Multicast Address."— Presentation transcript:

1 Net5: ARP 協定 授課教師:雲林科技大學 張慶龍 老師

2 IP Address/Physical Address Static Mapping  IP broadcast address maps to Ethernet broadcast address  IP Multicast Address maps to Ethernet Multicast Address lower 23bits of class D IP map into the lower 23bits of Ethernet address 01:00:5e:00:00:00 Dynamic Mapping  ARP  RARP

3 Address Resolution Protocol (ARP) Address Resolution Protocol RFC-826 Mapping between IP address and the physical address(such as MAC)

4 LAN MAC Addresses and ARP Each adapter on LAN has unique LAN address 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless) Broadcast address = FF-FF-FF-FF-FF-FF = adapter

5 LAN MAC Address (more) MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure uniqueness) Analogy: – MAC address: like Social Security Number – IP address: like postal address MAC flat address ➜ portability – can move LAN card from one LAN to another IP hierarchical address NOT portable – depends on IP subnet to which node is attached

6 ARP: Address Resolution Protocol Question: how to determine MAC address of B knowing B’s IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 237.196.7.23 237.196.7.78 237.196.7.14 237.196.7.88 Each IP node (Host, Router) on LAN has ARP table ARP Table: IP/MAC address mappings for some LAN nodes – TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)

7 ARP protocol: Same LAN (network) A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address – Dest MAC address = FF-FF-FF- FF-FF-FF – all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address – frame sent to A’s MAC address (unicast) A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out)  soft state: information that times out (goes away) unless refreshed ARP is “ plug-and-play ” :  nodes create their ARP tables without intervention from net administrator

8 walkthrough: send datagram from A to B via R assume A know’s B IP address Two ARP tables in router R, one for each IP network (LAN) In routing table at source Host, find router 111.111.111.110 In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc Routing to another LAN A R B

9 A creates datagram with source A, destination B A uses ARP to get R’s MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram A’s adapter sends frame R’s adapter receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram sends to B A R B

10 Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 used to synchronize receiver, sender clock rates

11

12 ARP/RARP Packet Format sender ethernet address target ethernet address target IP address hard type proto type 01631 HLEN PLEN op sender ether addr sender IP addr target ether addr Hardware type = 1 : Ethernet Protocol type = 0800 16 : IP address HLEN: hardware address length = 6 : Ethernet MAC address length PLEN: protocol address length = 4 : IP address length OP(operation): 1: ARP request, 2: ARP response, 3: RARP request, 4: RARP response

13

14 How it works ? Ethernet ARP IPARP IP To :140.113.25.6 Ethernet  ‚  „   140.113.25.6 (broadcast) Ethernet


Download ppt "Net5: ARP 協定 授課教師:雲林科技大學 張慶龍 老師. IP Address/Physical Address Static Mapping  IP broadcast address maps to Ethernet broadcast address  IP Multicast Address."

Similar presentations


Ads by Google