Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 7 ARP and RARP.

Similar presentations


Presentation on theme: "Chapter 7 ARP and RARP."— Presentation transcript:

1 Chapter 7 ARP and RARP

2 CONTENTS ARP ARP PACKAGE RARP

3 인터넷에서 사용하는 주소 논리 주소(logical address) 물리 주소(physical address)
호스트나 라우터가 사용하는 네트워크 레벨 주소 전세계적으로 유일한 주소 IP 주소 32 비트 길이 물리 주소(physical address) 로컬 네트워크에서 유효한 주소 로컬 주소(local address) 로컬에서만 유일하면 됨 보통 하드웨어로 구현 호스트나 라우터내에 설치된 NIC에 들어 있음

4 인터넷에서 사용하는 주소 호스트나 라우터로 패킷을 전달하기 위해 논리 및 물리 주소가 모두 필요
논리 주소를 물리 주소로 변환 또는 그 반대가 필요 정적 또는 동적 변환 가능

5 인터넷에서 사용하는 주소 정적 변환(static mapping) 논리 주소와 물리 주소 연관 테이블 생성
네트워크상의 각 시스템에 저장 필요시 테이블 검색 물리 주소가 변경될 경우 정적 테이블의 주기적인 갱신으로 인한 오버헤드 (NIC 변경, 이동 컴퓨터의 네트워크 이동 등)

6 인터넷에서 사용하는 주소 동적 변환(dynamic mapping)
물리 주소와 논리 주소 쌍 중 하나만 알면 프로토콜을 이용하여 다른 하나를 알아냄 ARP : 논리 주소를 물리 주소로 변환 RARP : 물리 주소를 논리 주소로 변환

7 인터넷에서 사용하는 주소 ARP와 RARP Address Resolution Protocol
Reverse Address Resolution Protocol

8 인터넷에서 사용하는 주소 TCP/IP 프로토콜에서 ARP와 RARP의 위치

9 A R P 7.1

10 7.1 ARP ARP 동작

11 7.1 ARP ARP 패킷 형식

12 7.1 ARP Hardware type : 네트워크 유형 정의(이더넷 : 1)
Protocol type : 프로토콜 정의(IPv4 : ) Hardware length : 물리 주소의 바이트 단위 길이 Protocol length : 논리 주소의 바이트 단위 길이 Operation : 패킷 유형-ARP 요청(1), ARP 응답(2) Sender hardware address : 송신자 물리 주소 Sender protocol address : 송신자 논리 주소 Target hardware address : 타겟 물리 주소 Target protocol address : 타겟 논리 주소

13 7.1 ARP ARP 패킷의 캡슐화

14 7.1 ARP ARP 프로세스의 캡슐화 동작 과정 송신자는 타겟 IP 주소를 알고있다
IP가 ARP에게 ARP 요청 메시지 생성 요청 (송신자 물리 주소, IP 주소; 타겟 IP 주소, 물리 주소(O)) 데이터링크층에 전달되면 발신지 주소는 송신자의 물리주소, 목적지 주소는 물리 브로드캐스트 주소로 하는 프레임에 캡슐화 모든 호스트나 라우터가 프레임을 수신하여 자신의 ARP에 전달

15 7.1 ARP 타겟 시스템을 자신의 물리 주소를 포함한 ARP 응답 메시지 송신(유니케스트)
송신자는 응답 메시지를 받고 타겟 시스템의 물리 주소를 알게 된다 IP 데이터그램은 프레임으로 캡슐화 되어 목적지에 유니캐스트

16 7.1 ARP ARP 서비스가 사용되는 4 가지 경우 송신자가 호스트로서 같은 네트워크상에 다른 호스트에 패킷 전송(논리주소는 목적지 IP주소) 송신자가 호스트이고 다른 네트워크상에 있는 다른 호스트에게 패킷 전송(논리 주소는 라우터의 IP 주소) 송신자는 다른 네트워크상에 있는 호스트로 가는 데이터그램을 수신한 라우터(논리 주소는 다음 홉 라우터의 IP 주소) 송신자는 같은 네트워크 상에 있는 호스트로 가는 데이터그램을 수시한 라우터(논리 주소는 목적지 IP 주소)

17 7.1 ARP ARP를 사용 예

18 7.1 ARP ARP 사용 예

19 7.1 ARP ARP 사용 예

20 7.1 ARP ARP 사용 예

21 An ARP request is broadcast;
an ARP reply is unicast.

22 7.1 ARP Example 1 A host with IP address and physical address 0xB has a packet to send to another host with IP address and physical address 0xA46EF45983AB. The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames.

23 7.1 ARP Solution Figure 7.7 shows the ARP request and reply packets. Note that the ARP data field in this case is 28 bytes, and that the individual addresses do not fit in the 4-byte boundary.

24 7.1 ARP 예제 1

25 7.1 ARP 예제 1(계속)

26 7.1 ARP Proxy ARP 서브넷팅 효과를 만들기 위해 사용

27 ARP PACKAGE 7.2

28 7.2 ARP 설계 구성 모듈 캐쉬 테이블 출력 모듈 입력 모듈 캐쉬 제어 모듈

29 7.2 ARP 설계 ARP 컴포넌트

30 7.2 ARP 설계 캐쉬 테이블 송신자가 같은 목적지에 여러 개의 IP 데이터그램을 보낼때 매번 ARP 프로토콜을 사용하는 것은 비 효율적 호스트나 라우터가 IP 데이터그램에 해당되는 물리 주소를 수신하면 캐쉬 테이블에 저장 그런 다음 같은 수신자로 보내지는 데이터그램에 사용

31 7.2 ARP 설계 캐쉬 테이블의 엔트리 구성 상태(State) : FREE, PENDING, RESOLVED
하드웨어 유형(Hardware type) : 하드웨어 길이(Hardware length) : 프로토콜 길이(Protocol length) : 인터페이스 번호(Interface number) : 큐 번호(Queue number) : 시도(Attempt) : ARP 요청 횟수 타임아웃(Time-out) : 엔트리 수명 하드웨어 주소(Hardware address) : 목적지 하드웨어 주소 프로토콜 주소(Protocol address) : 목적지 IP 주소

32 7.2 ARP 설계 출력 모듈 1. Sleep until an IP packet is received from IP software. 2. Check cache table for an entry corresponding to the destination of this IP packet. 3. If(found) 1. If(the state is RESOLVED) 1. Extract the value of the hardware address from the entry. 2. Send the packet and the hardware address to data link layer. 3. Return. 2. If(the state is PENDING) 1. Enqueue the packet to the corresponding queue. 2. Return.

33 7.2 ARP 설계 4. If(not found) 1. Create a cache entry with state set to PENDING and ATTEMPTS set to 1. 2. Create a queue. 3. Enqueue the packet. 4. Send an ARP request. 5. Return.

34 7.2 ARP 설계 입력 모듈 1. Sleep until an ARP packer(request or reply) arrives. 2. Check the cache table to find an entry corresponding to this ARP packet. 3. If(found) 1. Update the entry. 1. While the queue is not empty 2. If(the state is PENDING) 1. Dequeue one packet. 2. Send the packet and the hardware address to data link

35 7.2 ARP 설계 4. If(not found) 1. Create an entry.
2. Add the entry to the table. 5. If(the packet is a request) 1. Send an ARP relay 6. Return.

36 7.2 ARP 설계 캐쉬 제어 모듈 1. Sleep until the periodic timer matures.
2. For every entry in the cache table 1. If(the state is FREE) 1. Continue. 2. If(the state is PENDING) 1. Increment the value of attempts by 1. 2. If(attempts greater than maximum) 1. Change the state to FREE. 2. Destroy the corresponding queue.

37 7.2 ARP 설계 3. Else 1. Send an ARP request. 4. Continue.
3. If(the state is RESOLVED) 1. Decrement the value of time-out by the value of elagsed time. 2. If(time-out less than or equal to zero) 1. Change the state to FREE. 2. Destroy the corresponding queue 3. Return.

38 7.2 ARP 설계 ARP 예 Original cache table
State Queue Attempt Time-out Protocol Addr. Hardware Addr. R ACAE P P R ACAE32 P F R E3242ACA P

39 7.2 ARP 설계 Example 2 The ARP output module receives an IP datagram (from the IP layer) with the destination address It checks the cache table and finds that an entry exists for this destination with the RESOLVED state (R in the table). It extracts the hardware address, which is ACAE32, and sends the packet and the address to the data link layer for transmission. The cache table remains the same.

40 7.2 ARP 설계 Example 3 Twenty seconds later, the ARP output module receives an IP datagram (from the IP layer) with the destination address It checks the cache table and does not find this destination in the table. The module adds an entry to the table with the state PENDING and the Attempt value 1. It creates a new queue for this destination and enqueues the packet. It then sends an ARP request to the data link layer for this destination.

41 7.2 ARP 설계 예제 3의 캐쉬 테이블 State Queue Attempt Time-out Protocol Addr. Hardware Addr. R ACAE P P R ACAE32 P P R E3242ACA P

42 7.2 ARP 설계 Example 4 Fifteen seconds later, the ARP input module receives an ARP packet with target protocol (IP) address The module checks the table and finds this address. It changes the state of the entry to RESOLVED and sets the time-out value to 900. The module then adds the target hardware address (E ACA) to the entry. Now it accesses queue 18 and sends all the packets in this queue, one by one, to the data link layer.

43 7.2 ARP 설계 예제 4의 캐쉬 테이블 State Queue Attempt Time-out Protocol Addr. Hardware Addr. R ACAE P P R ACAE32 P P R E3242ACA R E ACA

44 7.2 ARP 설계 Example 5 Twenty-five seconds later, the cache-control module updates every entry. The time-out values for the first three resolved entries are decremented by 60. The time-out value for the last resolved entry is decremented by 25. The state of the next-to-the last entry is changed to FREE because the time-out is zero. For each of the three entries, the value of the attempts field is incremented by one. After incrementing, the attempts value for one entry (the one with IP protocol address ) is more than the maximum; the state is changed to FREE, the queue is deleted.

45 7.2 ARP 설계 예제 5의 캐쉬 테이블 State Queue Attempt Time-out Protocol Addr. Hardware Addr. R ACAE P F R ACAE32 P P R E ACA

46 RARP 7.3

47 7.3 RARP 물리 주소는 알고 있으나 논리 주소를 모를 때 사용 물리 주소는 NIC로 부터 얻어진다
디스크가 없는 시스템 부팅시 이용 요청 장치는 RARP 클라이언트 프로그램 수행 응답 장치는 RARP 서버 프로그램 수행

48 7.3 RARP RARP 동작

49 7.3 RARP The RARP request packets are broadcast; the RARP reply packets are unicast.

50 7.3 RARP RARP 패킷

51 7.3 RARP RARP 패킷의 캡슐화

52 7.3 RARP Alternative Solutions to RARP
When a diskless computer is booted, it needs more information in addition to its IP address. It needs to know its subnet mask, the IP address of a router, and the IP address of a name server. RARP cannot provide this extra information. New protocols have been developed to provide this information. In Chapter 17 we discuss two protocols, BOOTP and DHCP, that can be used instead of RARP.


Download ppt "Chapter 7 ARP and RARP."

Similar presentations


Ads by Google