Chapter 7 ARP and RARP Http netwk hannam

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

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

CONTENTS • ARP PACKAGE • RARP Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 2

CONTENTS • ARP PACKAGE • RARP Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 2

인터넷에서 사용하는 주소 <ARP와 RARP ÜAddress Resolution Protocol ÜReverse Address Resolution Protocol Http: //netwk.

인터넷에서 사용하는 주소 <ARP와 RARP ÜAddress Resolution Protocol ÜReverse Address Resolution Protocol Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 7

인터넷에서 사용하는 주소 <TCP/IP 프로토콜에서 ARP와 RARP의 위치 Http: //netwk. hannam. ac. kr HANNAM

인터넷에서 사용하는 주소 <TCP/IP 프로토콜에서 ARP와 RARP의 위치 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 8

7. 1 ARP Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 9

7. 1 ARP Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 9

7. 1 ARP <ARP 동작 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 10

7. 1 ARP <ARP 동작 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 10

7. 1 ARP <ARP 패킷 형식 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 11

7. 1 ARP <ARP 패킷 형식 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 11

7. 1 ARP < Hardware type : 네트워크 유형 정의(이더넷 : 1) < Protocol

7. 1 ARP < Hardware type : 네트워크 유형 정의(이더넷 : 1) < Protocol type : 프로토콜 정의(IPv 4 : 080016) < Hardware length : 물리 주소의 바이트 단위 길이 < Protocol length : 논리 주소의 바이트 단위 길이 < Operation : 패킷 유형-ARP 요청(1), ARP 응답(2) < Sender hardware address : 송신자 물리 주소 < Sender protocol address : 송신자 논리 주소 < Target hardware address : 타겟 물리 주소 < Target protocol address : 타겟 논리 주소 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 12

7. 1 ARP <ARP 패킷의 캡슐화 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 13

7. 1 ARP <ARP 패킷의 캡슐화 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 13

7. 1 ARP <ARP를 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 17

7. 1 ARP <ARP를 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 17

7. 1 ARP <ARP 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 18

7. 1 ARP <ARP 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 18

7. 1 ARP <ARP 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 19

7. 1 ARP <ARP 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 19

7. 1 ARP <ARP 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 20

7. 1 ARP <ARP 사용 예 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 20

7. 1 ARP An ARP request is broadcast; an ARP reply is unicast. Http:

7. 1 ARP An ARP request is broadcast; an ARP reply is unicast. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 21

7. 1 ARP Example 1 A host with IP address 130. 23. 43. 20

7. 1 ARP Example 1 A host with IP address 130. 23. 43. 20 and physical address 0 x. B 23455102210 has a packet to send to another host with IP address 130. 23. 43. 25 and physical address 0 x. A 46 EF 45983 AB. The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 22

7. 1 ARP Solution Figure 7. 7 shows the ARP request and reply packets.

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 23

7. 1 ARP <예제 1 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 24

7. 1 ARP <예제 1 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 24

7. 1 ARP <예제 1(계속) Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 25

7. 1 ARP <예제 1(계속) Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 25

7. 1 ARP <Proxy ARP Ü서브넷팅 효과를 만들기 위해 사용 Http: //netwk. hannam. ac.

7. 1 ARP <Proxy ARP Ü서브넷팅 효과를 만들기 위해 사용 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 26

7. 2 ARP PACKAGE Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 27

7. 2 ARP PACKAGE Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 27

7. 2 ARP 설계 <ARP 컴포넌트 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 29

7. 2 ARP 설계 <ARP 컴포넌트 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 29

7. 2 ARP 설계 < 캐쉬 테이블의 엔트리 구성 Ü 상태(State) : FREE, PENDING,

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 주소 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 31

7. 2 ARP 설계 < 출력 모듈 1. Sleep until an IP packet is

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 32

7. 2 ARP 설계 4. If(not found) 1. Create a cache entry with state

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 33

7. 2 ARP 설계 < 입력 모듈 1. Sleep until an ARP packer(request or

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 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 34

7. 2 ARP 설계 4. If(not found) 1. Create an entry. 2. Add the

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 35

7. 2 ARP 설계 < 캐쉬 제어 모듈 1. Sleep until the periodic timer

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 36

7. 2 ARP 설계 3. Else 1. Send an ARP request. 4. Continue. 3.

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 37

7. 2 ARP 설계 <ARP 예 Original cache table State Queue Attempt Time-out Protocol

7. 2 ARP 설계 <ARP 예 Original cache table State Queue Attempt Time-out Protocol Addr. Hardware Addr. 900 180. 3. 6. 1 ACAE 32457342 R 5 P 2 2 129. 34. 4. 8 P 14 5 201. 11. 56. 7 R 8 P 12 450 1 114. 5. 7. 89 457342 ACAE 32 220. 55. 5. 7 F R 9 P 18 60 3 Http: //netwk. hannam. ac. kr 19. 1. 7. 82 4573 E 3242 ACA 188. 11. 8. 71 HANNAM UNIVERSITY 38

7. 2 ARP 설계 Example 2 The ARP output module receives an IP datagram

7. 2 ARP 설계 Example 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 457342 ACAE 32, and sends the packet and the address to the data link layer for transmission. The cache table remains the same. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 39

7. 2 ARP 설계 Example 3 Twenty seconds later, the ARP output module receives

7. 2 ARP 설계 Example 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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 40

7. 2 ARP 설계 <예제 3의 캐쉬 테이블 State Queue Attempt Time-out Hardware Addr.

7. 2 ARP 설계 <예제 3의 캐쉬 테이블 State Queue Attempt Time-out Hardware Addr. 180. 3. 6. 1 ACAE 32457342 R 5 P 2 2 129. 34. 4. 8 P 14 5 201. 11. 56. 7 R 8 P 12 1 220. 55. 5. 7 P 23 1 116. 1. 7. 22 R 9 P 18 Http: //netwk. hannam. ac. kr 900 Protocol Addr. 450 60 3 114. 5. 7. 89 19. 1. 7. 82 457342 ACAE 32 4573 E 3242 ACA 188. 11. 8. 71 HANNAM UNIVERSITY 41

7. 2 ARP 설계 Example 4 Fifteen seconds later, the ARP input module receives

7. 2 ARP 설계 Example 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 (E 34573242 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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 42

7. 2 ARP 설계 <예제 4의 캐쉬 테이블 State Queue Attempt Time-out Protocol Addr.

7. 2 ARP 설계 <예제 4의 캐쉬 테이블 State Queue Attempt Time-out Protocol Addr. Hardware Addr. R 5 180. 3. 6. 1 ACAE 32457342 P 2 2 129. 34. 4. 8 P 14 5 201. 11. 56. 7 R 8 P 12 1 220. 55. 5. 7 P 23 1 116. 1. 7. 22 R 9 R 18 Http: //netwk. hannam. ac. kr 900 450 60 114. 5. 7. 89 457342 ACAE 32 19. 1. 7. 82 4573 E 3242 ACA 188. 11. 8. 71 E 34573242 ACA HANNAM UNIVERSITY 43

7. 2 ARP 설계 Example 5 Twenty-five seconds later, the cache-control module updates every

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 201. 11. 56. 7) is more than the maximum; the state is changed to FREE, the queue is deleted. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 44

7. 2 ARP 설계 <예제 5의 캐쉬 테이블 State Queue R 5 P 2

7. 2 ARP 설계 <예제 5의 캐쉬 테이블 State Queue R 5 P 2 Attempt Time-out 840 3 Protocol Addr. Hardware Addr. 180. 3. 6. 1 ACAE 32457342 129. 34. 4. 8 F R 8 390 114. 5. 7. 89 P 12 2 220. 55. 5. 7 P 23 2 116. 1. 7. 22 457342 ACAE 32 F R 18 Http: //netwk. hannam. ac. kr 874 188. 11. 8. 71 E 34573242 ACA HANNAM UNIVERSITY 45

7. 3 RARP Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 46

7. 3 RARP Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 46

7. 3 RARP <RARP 동작 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 48

7. 3 RARP <RARP 동작 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 48

7. 3 RARP The RARP request packets are broadcast; the RARP reply packets are

7. 3 RARP The RARP request packets are broadcast; the RARP reply packets are unicast. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 49

7. 3 RARP <RARP 패킷 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 50

7. 3 RARP <RARP 패킷 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 50

7. 3 RARP <RARP 패킷의 캡슐화 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 51

7. 3 RARP <RARP 패킷의 캡슐화 Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 51

7. 3 RARP Alternative Solutions to RARP When a diskless computer is booted, it

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. Http: //netwk. hannam. ac. kr HANNAM UNIVERSITY 52