chapter 7

52
1 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr Chapter 7 ARP and RARP

Upload: trynt

Post on 05-Jan-2016

43 views

Category:

Documents


1 download

DESCRIPTION

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

TRANSCRIPT

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

Chapter 7

ARP and

RARP

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

CONTENTSCONTENTS

• ARP• ARP PACKAGE• RARP

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

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

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

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

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

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

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

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

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

정적 또는 동적 변환 가능

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

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

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

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

필요시 테이블 검색

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

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

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

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

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

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

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

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

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

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

ARP 와 RARPAddress Resolution ProtocolReverse Address Resolution Protocol

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

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

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

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

A R P

7.17.1

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

7.1 ARP7.1 ARP

ARP 동작

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

7.1 ARP7.1 ARP

ARP 패킷 형식

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 : 타겟 논리 주소

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

7.1 ARP7.1 ARP

ARP 패킷의 캡슐화

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

7.1 ARP7.1 ARP

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

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

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

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

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

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

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

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

7.1 ARP7.1 ARP

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

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

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

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

7.1 ARP7.1 ARP

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

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

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

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

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

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

7.1 ARP7.1 ARP

ARP 를 사용 예

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

7.1 ARP7.1 ARP

ARP 사용 예

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

7.1 ARP7.1 ARP

ARP 사용 예

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

7.1 ARP7.1 ARP

ARP 사용 예

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

7.1 ARP7.1 ARP

An ARP request is An ARP request is broadcastbroadcast; ;

an ARP reply is an ARP reply is unicastunicast..

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

7.1 ARP7.1 ARP

Example 1Example 1

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

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

7.1 ARP7.1 ARP

SolutionSolution

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.

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

7.1 ARP7.1 ARP

예제 1

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

7.1 ARP7.1 ARP

예제 1( 계속 )

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

7.1 ARP7.1 ARP

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

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

ARP PACKAGE

7.27.2

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

7.2 ARP 7.2 ARP 설계설계

구성 모듈캐쉬 테이블

출력 모듈

입력 모듈

캐쉬 제어 모듈

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

7.2 ARP 7.2 ARP 설계설계

ARP 컴포넌트

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

7.2 ARP 7.2 ARP 설계설계

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

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

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

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

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

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.

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.

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

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.

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.

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.

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

7.2 ARP 7.2 ARP 설계설계

ARP 예

State Queue Attempt State Queue Attempt Time-out Time-out Protocol Addr. Protocol Addr. Hardware Addr.Hardware Addr.

R 5 900 180.3.6.1 ACAE32457342

P 2 2 129.34.4.8

P 14 5 201.11.56.7

R 8 450 114.5.7.89 457342ACAE32

P 12 1 220.55.5.7

F

R 9 60 19.1.7.82 4573E3242ACA

P 18 3 188.11.8.71

Original cache table

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

7.2 ARP 7.2 ARP 설계설계

Example 2Example 2

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.

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

7.2 ARP 7.2 ARP 설계설계

Example 3Example 3

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.

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

7.2 ARP 7.2 ARP 설계설계

예제 3 의 캐쉬 테이블

State Queue Attempt Time-out State Queue Attempt Time-out Protocol Addr. Protocol Addr. Hardware Addr.Hardware Addr.

R 5 900 180.3.6.1 ACAE32457342

P 2 2 129.34.4.8

P 14 5 201.11.56.7

R 8 450 114.5.7.89 457342ACAE32

P 12 1 220.55.5.7

P 23 1 116.1.7.22

R 9 60 19.1.7.82 4573E3242ACA

P 18 3 188.11.8.71

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

7.2 ARP 7.2 ARP 설계설계

Example 4Example 4

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.

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

7.2 ARP 7.2 ARP 설계설계

예제 4 의 캐쉬 테이블

State Queue Attempt Time-out State Queue Attempt Time-out Protocol Addr. Protocol Addr. Hardware Addr.Hardware Addr.

R 5 900 180.3.6.1 ACAE32457342

P 2 2 129.34.4.8

P 14 5 201.11.56.7

R 8 450 114.5.7.89 457342ACAE32

P 12 1 220.55.5.7

P 23 1 116.1.7.22

R 9 60 19.1.7.82 4573E3242ACA

R 18 188.11.8.71 E34573242ACA

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

7.2 ARP 7.2 ARP 설계설계

Example 5Example 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 201.11.56.7) is more than the maximum; the state is changed to FREE, the queue is deleted.

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

7.2 ARP 7.2 ARP 설계설계

예제 5 의 캐쉬 테이블

State Queue Attempt Time-out State Queue Attempt Time-out Protocol Addr. Protocol Addr. Hardware Addr.Hardware Addr.

R 5 840 180.3.6.1 ACAE32457342

P 2 3 129.34.4.8

F

R 8 390 114.5.7.89 457342ACAE32

P 12 2 220.55.5.7

P 23 2 116.1.7.22

F

R 18 874 188.11.8.71 E34573242ACA

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

RARP

7.37.3

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

7.3 RARP7.3 RARP

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

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

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

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

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

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

7.3 RARP7.3 RARP

RARP 동작

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

7.3 RARP7.3 RARP

The RARP request packets are The RARP request packets are broadcastbroadcast; ;

the RARP reply packets are the RARP reply packets are unicastunicast..

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

7.3 RARP7.3 RARP

RARP 패킷

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

7.3 RARP7.3 RARP

RARP 패킷의 캡슐화

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