chapter 7

53
1 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr Chapter 7 Chapter 7 Upon completion you will be able to: ARP and RARP ARP and RARP Understand the need for ARP Understand the cases in which ARP is used Understand the components and interactions in an ARP package Understand the need for RARP Objectives

Upload: cain

Post on 05-Jan-2016

48 views

Category:

Documents


0 download

DESCRIPTION

Chapter 7. ARP and RARP. Objectives. Upon completion you will be able to:. Understand the need for ARP Understand the cases in which ARP is used Understand the components and interactions in an ARP package Understand the need for RARP. CONTENTS. ARP ARP PACKAGE RARP. 인터넷에서 사용하는 주소. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter   7

1HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Chapter 7Chapter 7

Upon completion you will be able to:

ARP and RARPARP and RARP

• Understand the need for ARP• Understand the cases in which ARP is used• Understand the components and interactions in an ARP package• Understand the need for RARP

Objectives

Page 2: Chapter   7

2HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

CONTENTSCONTENTS

• ARP• ARP PACKAGE• RARP

Page 3: Chapter   7

3HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

인터넷에서 사용하는 주소인터넷에서 사용하는 주소

1. 논리 주소 (logical address) 호스트나 라우터가 사용하는 네트워크 레벨 주소 전세계적으로 유일한 주소 IP 주소 32 비트 길이

2. 물리 주소 (physical address) 로컬 네트워크에서 유효한 주소 로컬 주소 (local address)

로컬에서만 유일하면 됨 보통 하드웨어로 구현 호스트나 라우터내에 설치된 NIC 에 들어 있음

Page 4: Chapter   7

4HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

인터넷에서 사용하는 주소인터넷에서 사용하는 주소

호스트나 라우터로 패킷을 전달하기 위해 논리 및 물리 주소가 모두 필요

논리 주소를 물리 주소로 변환 또는 그 반대가 필요

정적 또는 동적 변환 가능

Page 5: Chapter   7

5HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

인터넷에서 사용하는 주소인터넷에서 사용하는 주소

정적 변환 (static mapping)논리 주소와 물리 주소 연관 테이블 생성

네트워크상의 각 시스템에 저장

필요시 테이블 검색

물리 주소가 변경될 경우 정적 테이블의 주기적인 갱신으로 인한 오버헤드

(NIC 변경 , 이동 컴퓨터의 네트워크 이동 등 )

Page 6: Chapter   7

6HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

인터넷에서 사용하는 주소인터넷에서 사용하는 주소

동적 변환 (dynamic mapping)물리 주소와 논리 주소 쌍 중 하나만 알면

프로토콜을 이용하여 다른 하나를 알아냄

ARP : 논리 주소를 물리 주소로 변환

RARP : 물리 주소를 논리 주소로 변환

Page 7: Chapter   7

7HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

인터넷에서 사용하는 주소인터넷에서 사용하는 주소

ARP 와 RARP Address Resolution Protocol Reverse Address Resolution Protocol

Page 8: Chapter   7

8HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

인터넷에서 사용하는 주소인터넷에서 사용하는 주소

TCP/IP 프로토콜에서 ARP 와 RARP 의 위치

Page 9: Chapter   7

9HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP

ARP associates an IP address with its physical address. On a typical ARP associates an IP address with its physical address. On a typical physical network, such as a LAN, each device on a link is identified by a physical network, such as a LAN, each device on a link is identified by a physical or station address that is usually imprinted on the NIC.physical or station address that is usually imprinted on the NIC.

The topics discussed in this section include:The topics discussed in this section include:

Packet FormatPacket FormatEncapsulation Encapsulation OperationOperationARP over ATMARP over ATMProxy ARPProxy ARP

Page 10: Chapter   7

10HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 동작

Page 11: Chapter   7

11HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 패킷 형식

Page 12: Chapter   7

12HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

Hardware type : 네트워크 유형 정의 ( 이더넷 : 1) Protocol type : 프로토콜 정의 (IPv4 : 080016)

Hardware length : 물리 주소의 바이트 단위 길이 Protocol length : 논리 주소의 바이트 단위 길이 Operation : 패킷 유형 -ARP 요청 (1), ARP 응답 (2) Sender hardware address : 송신자 물리 주소 Sender protocol address : 송신자 논리 주소 Target hardware address : 타겟 물리 주소 Target protocol address : 타겟 논리 주소

Page 13: Chapter   7

13HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 패킷의 캡슐화

Page 14: Chapter   7

14HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 프로세스의 캡슐화 동작 과정

1. 송신자는 타겟 IP 주소를 알고있다

2. IP 가 ARP 에게 ARP 요청 메시지 생성 요청

( 송신자 물리 주소 , IP 주소 ; 타겟 IP 주소 , 물리 주소 (O))

3. 데이터링크층에 전달되면 발신지 주소는 송신자의 물리주소 ,

목적지 주소는 물리 브로드캐스트 주소로 하는 프레임에 캡슐화

4. 모든 호스트나 라우터가 프레임을 수신하여 자신의 ARP 에 전달

Page 15: Chapter   7

15HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

5. 타겟 시스템을 자신의 물리 주소를 포함한 ARP 응답 메시지 송신 ( 유니케스트 )

6. 송신자는 응답 메시지를 받고 타겟 시스템의 물리 주소를 알게 된다

7. IP 데이터그램은 프레임으로 캡슐화 되어 목적지에 유니캐스트

Page 16: Chapter   7

16HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 서비스가 사용되는 4 가지 경우1. 송신자가 호스트로서 같은 네트워크상에 다른

호스트에 패킷 전송 ( 논리주소는 목적지 IP 주소 )2. 송신자가 호스트이고 다른 네트워크상에 있는

다른 호스트에게 패킷 전송 ( 논리 주소는 라우터의 IP 주소 )

3. 송신자는 다른 네트워크상에 있는 호스트로 가는 데이터그램을 수신한 라우터 ( 논리 주소는 다음 홉 라우터의 IP 주소 )

4. 송신자는 같은 네트워크 상에 있는 호스트로 가는 데이터그램을 수시한 라우터 ( 논리 주소는 목적지 IP 주소 )

Page 17: Chapter   7

17HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 를 사용 예

Page 18: Chapter   7

18HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 사용 예

Page 19: Chapter   7

19HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 사용 예

Page 20: Chapter   7

20HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

ARP 사용 예

Page 21: Chapter   7

21HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

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

Note:Note:

7.1 ARP7.1 ARP

Page 22: Chapter   7

22HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

A host with IP address 130.23.43.20 and physical address B2:34:55:10:22:10 has a packet to send to another host with IP address 130.23.43.25 and physical address A4:6E:F4:59:83:AB (which is unknown to the first host). The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames.

Example 1

Page 23: Chapter   7

23HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

SolutionFigure 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. That is why we do not show the regular 4-byte boundaries for these addresses. Also note that the IP addresses are shown in hexadecimal. For information on binary or hexadecimal notation see Appendix B.

Example 1 (Continued)

Page 24: Chapter   7

24HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

예제 1

Page 25: Chapter   7

25HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

예제 1( 계속 )

Page 26: Chapter   7

26HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.1 ARP7.1 ARP

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

Page 27: Chapter   7

27HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP PACKAGE

In this section, we give an example of a simplified ARP software package In this section, we give an example of a simplified ARP software package to show the components and the relationships between the components. to show the components and the relationships between the components. This ARP package involves five modules: a cache table, queues, an This ARP package involves five modules: a cache table, queues, an output module, an input module, and a cache-control module. output module, an input module, and a cache-control module.

The topics discussed in this section include:The topics discussed in this section include:

Cache TableCache TableQueuesQueuesOutput ModuleOutput ModuleInput ModuleInput ModuleCache-Control ModuleCache-Control Module

Page 28: Chapter   7

28HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

구성 모듈캐쉬 테이블

출력 모듈

입력 모듈

캐쉬 제어 모듈

Page 29: Chapter   7

29HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

ARP 컴포넌트

Page 30: Chapter   7

30HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

캐쉬 테이블송신자가 같은 목적지에 여러 개의 IP 데이터그램을

보낼때 매번 ARP 프로토콜을 사용하는 것은 비 효율적

호스트나 라우터가 IP 데이터그램에 해당되는 물리 주소를 수신하면 캐쉬 테이블에 저장

그런 다음 같은 수신자로 보내지는 데이터그램에 사용

Page 31: Chapter   7

31HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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 주소

Page 32: Chapter   7

32HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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.

Page 33: Chapter   7

33HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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.

Page 34: Chapter   7

34HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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

Page 35: Chapter   7

35HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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.

Page 36: Chapter   7

36HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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.

Page 37: Chapter   7

37HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 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.

Page 38: Chapter   7

38HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

ARP 예

Original cache table

Page 39: Chapter   7

39HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

The ARP output module receives an IP datagram (from the IP layer) with the destination address 114.5.7.89. 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 457342ACAE32, and sends the packet and the address to the data link layer for transmission. The cache table remains the same.

Example 2

Page 40: Chapter   7

40HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Twenty seconds later, the ARP output module receives an IP datagram (from the IP layer) with the destination address 116.1.7.22. 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. The new cache table is shown in Table 7.2.

Example 3

Page 41: Chapter   7

41HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

예제 3 의 캐쉬 테이블

Page 42: Chapter   7

42HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

Fifteen seconds later, the ARP input module receives an ARP packet with target protocol (IP) address 188.11.8.71. 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 (E34573242ACA) to the entry. Now it accesses queue 18 and sends all the packets in this queue, one by one, to the data link layer. The new cache table is shown in Table 7.3.

Example 4

Page 43: Chapter   7

43HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

예제 4 의 캐쉬 테이블

Page 44: Chapter   7

44HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

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 pending entries, the value of the attempts

Example 5

Page 45: Chapter   7

45HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.2 ARP 7.2 ARP 설계설계

예제 5 의 캐쉬 테이블

Page 46: Chapter   7

46HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.3 RARP

RARP finds the logical address for a machine that only knows its RARP finds the logical address for a machine that only knows its physical address.physical address.

The topics discussed in this section include:The topics discussed in this section include:

Packet FormatPacket FormatEncapsulationEncapsulationRARP ServerRARP ServerAlternative Solutions to RARPAlternative Solutions to RARP

Page 47: Chapter   7

47HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.3 RARP7.3 RARP

물리 주소는 알고 있으나 논리 주소를 모를 때 사용

물리 주소는 NIC 로 부터 얻어진다

디스크가 없는 시스템 부팅시 이용

요청 장치는 RARP 클라이언트 프로그램 수행

응답 장치는 RARP 서버 프로그램 수행

Page 48: Chapter   7

48HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.3 RARP7.3 RARP

RARP 동작

Page 49: Chapter   7

49HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

The RARP request packets are broadcast;

the RARP reply packets are unicast.

Note:Note:

7.3 RARP7.3 RARP

Page 50: Chapter   7

50HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.3 RARP7.3 RARP

RARP 패킷

Page 51: Chapter   7

51HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.3 RARP7.3 RARP

RARP 패킷의 캡슐화

Page 52: Chapter   7

52HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

7.3 RARP7.3 RARP

Alternative Solutions to RARPAlternative 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 16 we discuss two protocols, BOOTP and DHCP, that can be used instead of RARP.

Page 53: Chapter   7

53HANNAM UNIVERSITYHttp://netwk.hannam.ac.kr

연습문제 풀이해서

Report 로 다음주까지 ( 일주일 후 )

제출해 주세요 !

알림알림