Presentation is loading. Please wait.

Presentation is loading. Please wait.

HANNAM UNIVERSITY 1 Chapter 8 Internet Protocol (IP)

Similar presentations


Presentation on theme: "HANNAM UNIVERSITY 1 Chapter 8 Internet Protocol (IP)"— Presentation transcript:

1 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 1 Chapter 8 Internet Protocol (IP)

2 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 2CONTENTS DATAGRAM FRAGMENTATION OPTIONS CHECKSUM IP PACKAGE

3 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 3 인터넷 프로토콜 (IP)  TCP/IP 에서 사용하는 전송 메커니즘  신뢰성 없는 비연결형 데이터그램 프로토콜  최선노력 (best effort) 전달 서비스  오류 검사 및 추적 기능을 수행하지 않음  각 데이터그램은 독립적으로 처리  각 데이터그램은 서로 다른 경로로 전달될 수 있음  각 데이터그램은 순서가 바뀌어 전달될 수 있음

4 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 4 TCP/IP 프로토콜에서 IP 의 위치

5 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 5 DATAGRAM 8.1

6 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 6 8.1 데이터 그램  IP 데이터 그램

7 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 7 8.1 IP 데이터 그램  가변 길이 패킷  헤더와 데이터 부분으로 구성  헤더 : 20 ~ 60 바이트 길이, 라우팅과 전달에 필요한 정보  헤더 내의 필드  버전 (Ver) - IP 프로토콜 버전 (4 비트 )  헤더길이 (HLEN) - 헤더의 전체 길이를 4 바이트 단위로 표 시 (4 비트 )

8 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 8 8.1 IP 데이터 그램  서비스 유형 (Service type) - (8 비트 )  라우터에 의해 처리하는 방법  3 bit 는 우선 순위, 4 bit 는 서비스 유형

9 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 9 8.1 IP 데이터 그램  TOS(type of service) 비트  서비스 유형 TOS Bits Description 0000 Normal (default) 0001 Minimize cost 0010 Maximize reliability 0100 Maximize throughput 1000 Minimize delay

10 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 10 8.1 IP 데이터 그램  응용 프로그램들의 서비스 유형 기본 값 ProtocolTOS Bits Description ICMP 0000 Normal BOOTP 0000 Normal NNTP 0001 Minimize cost IGP 0010 Maximize reliability SNMP 0010 Maximize reliability TELNET 1000 Minimize delay FTP (data) 0100 Maximize throughput FTP (control) 1000 Minimize delay TFTP 1000 Minimize delay SMTP (command) 1000 Minimize delay SMTP (data) 0100 Maximize throughput DNS (UDP query) 1000 Minimize delay DNS (TCP query) 0000 Normal DNS (zone) 0100 Maximize throughput

11 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 11 8.1 IP 데이터 그램  차별화된 서비스 (Differentiated Service)  오른쪽 3 비트가 0 이면 우선순위와 같은 의미로 해석  오른쪽 3 비트가 0 이 아니면 기관에서 정의된 서비스  코드 포인트의 값 The precedence subfield is not used in version 4. CategoryCodepointAssigning Authority 1XXXXX0Internet 2XXXX11Local 3XXXX01Temporary or experiment

12 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 12 8.1 IP 데이터 그램 The total length field defines the total length of the datagram including the header.

13 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 13 8.1 IP 데이터 그램  전체 길이 (total length)  16 bit 필드 (65,535 까지 표현 )  IP 데이터그램의 전체 길이를 바이트 단위로 표시  데이터 길이 = 전체 길이 – 헤더 길이  이더넷 프레임에서 작은 데이터그램의 캡슐화

14 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 14 8.1 IP 데이터 그램  식별 (Identification) – 단편화에 사용  플래그 (flag) – 단편화에 사용  단편 옵셋 (fragmentation offset) – 단편화에 사 용  수명 (time to live) – 데이터그램의 수명

15 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 15 8.1 IP 데이터 그램  프로토콜 (protocol) – IP 계층의 서비스를 사용 하는 상위 계층 프로토콜  검사합 (checksum) – 오류 확인  발신지 주소 (source address)  목적지 주소 (destination address) OSPF89 UDP17 TCP6 IGMP2 ICMP1 protocoladdress

16 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 16 8.1 IP 데이터 그램 Example 1 An IP packet has arrived with the first 8 bits as shown:  01000010 The receiver discards the packet. Why?

17 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 17 8.1 IP 데이터 그램 Solution There is an error in this packet. The 4 left-most bits (0100) show the version, which is correct. The next 4 bits (0010) show the header length, which means (2  4  8), which is wrong. The minimum number of bytes in the header must be 20. The packet has been corrupted in transmission.

18 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 18 8.1 IP 데이터 그램 Example 2 In an IP packet, the value of HLEN is 1000 in binary. How many bytes of options are being carried by this packet?

19 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 19 8.1 IP 데이터 그램 Solution The HLEN value is 8, which means the total number of bytes in the header is 8  4 or 32 bytes. The first 20 bytes are the main header, the next 12 bytes are the options.

20 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 20 8.1 IP 데이터 그램 Example 3 In an IP packet, the value of HLEN is 5 16 and the value of the total length field is 0028 16. How many bytes of data are being carried by this packet?

21 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 21 8.1 IP 데이터 그램 Solution The HLEN value is 5, which means the total number of bytes in the header is 5  4 or 20 bytes (no options). The total length is 40 bytes, which means the packet is carrying 20 bytes of data (40  20).

22 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 22 8.1 IP 데이터 그램 Example 4 An IP packet has arrived with the first few hexadecimal digits as shown below:  45000028000100000102................... How many hops can this packet travel before being dropped? The data belong to what upper layer protocol?

23 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 23 8.1 IP 데이터 그램 Solution To find the time-to-live field, we should skip 8 bytes (16 hexadecimal digits). The time-to-live field is the ninth byte, which is 01. This means the packet can travel only one hop. The protocol field is the next byte (02), which means that the upper layer protocol is IGMP.

24 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 24 FRAGMENTATION 8.2

25 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 25 8.2 단편화  네트워크가 사용하는 프로토콜에 따라 프레임 형식과 크기가 서로 다르다  각 네트워크에서 전달되는 최대 전송 길이를 MTU (Maximum Transfer Unit) 라고 함  MTU 길이에 따라 나누어 보내는 것을 단편화 (fragmentation) 라고 함

26 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 26 8.2 단편화  MTU(Maxmum Transfer Unit)

27 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 27 8.2 단편화  서로 다른 네트워크의 MTU Protocol MTU Hyperchannel 65,535 Token Ring (16 Mbps) 17,914 Token Ring (4 Mbps) 4,464 FDD 4,352 Ethernet 1,500 X.25 576 PPP 296

28 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 28 8.2 단편화  단편화와 관련된 필드  식별자 (identification) – 단편들은 같은 식별자 값을 가짐  플래그 (flag) – 3 비트 필드

29 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 29 8.2 단편화  단편화 옵셋 (Fragmentation offset) : 13 비트 필드  전체 데이터그램에서 단편의 상대적인 위치 (8 바이 트 단위 )  단편화 예

30 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 30 8.2 단편화  상세한 단편화 예

31 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 31 8.2 단편화 Example 5 A packet has arrived with an M bit value of 0. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?

32 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 32 8.2 단편화 Solution If the M bit is 0, it means that there are no more fragments; the fragment is the last one. However, we cannot say if the original packet was fragmented or not. A nonfragmented packet is considered the last fragment.

33 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 33 8.2 단편화 Example 6 A packet has arrived with an M bit value of 1. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?

34 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 34 8.2 단편화 Solution If the M bit is 1, it means that there is at least one more fragment. This fragment can be the first one or a middle one, but not the last one. We don’t know if it is the first one or a middle one; we need more information (the value of the fragmentation offset). However, we can definitely say the original packet has been fragmented because the M bit value is 1.

35 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 35 8.2 단편화 Example 7 A packet has arrived with an M bit value of 1 and a fragmentation offset value of zero. Is this the first fragment, the last fragment, or a middle fragment?

36 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 36 8.2 단편화 Solution Because the M bit is 1, it is either the first fragment or a middle one. Because the offset value is 0, it is the first fragment.

37 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 37 8.2 단편화 Example 8 A packet has arrived in which the offset value is 100. What is the number of the first byte? Do we know the number of the last byte?

38 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 38 8.2 단편화 Solution To find the number of the first byte, we multiply the offset value by 8. This means that the first byte number is 800. We cannot determine the number of the last byte unless we know the length of the data.

39 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 39 8.2 단편화 Example 9 A packet has arrived in which the offset value is 100, the value of HLEN is 5 and the value of the total length field is 100. What is the number of the first byte and the last byte?

40 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 40 8.2 단편화 Solution The first byte number is 100  8  800. The total length is 100 bytes and the header length is 20 bytes (5  4), which means that there are 80 bytes in this datagram. If the first byte number is 800, the last byte number must 879.

41 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 41 OPTIONS 8.3

42 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 42 8.3 옵션  옵션 형식  IP 데이터그램 헤더 내의 가변 부분 ( 최대 40 바이트 )

43 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 43 8.3 옵션  코드 필드 (8 비트 ) : 고정 길이  복사 (copy)  단편화에 옵션을 포함시킨 것인지 제어  클래스 (class)  옵션의 목적을 나타냄  번호 (number)  옵션 유형  길이 필드 (8 비트 ) : 고정길이  옵션의 전체 길이  데이터 필드 : 가변 길이

44 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 44 8.3 옵션  옵션 유형

45 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 45 8.3 옵션  무연산 (No Operation)  옵션 사이의 여백을 채워줌 (1byte option)

46 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 46 8.3 옵션  종료 옵션 (End of Option)  옵션 필드의 패딩 목적으로 사용 (1byte option)

47 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 47 8.3 옵션  경로 기록 (Record Route) 옵션  데이터그램을 처리한 인터넷 라우터들 기록

48 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 48 8.3 옵션  데이터그램이 라우터를 경유하여 이동하는 과정

49 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 49 8.3 옵션  엄격한 발신지 경로 (Strict Source Route) 옵션  데이터그램이 거쳐야할 경로를 미리 지정하기 위해 사용  데이터그램은 옵션에 정의된 모든 라우터 방문

50 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 50 8.3 옵션  엄격한 발신지 경로 개념

51 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 51 8.3 옵션  느슨한 발신지 경로 (Loose Source Route) 옵션  엄격한 발신지 경로와 비슷하지만 리스트에 없는 라우터도 방 문 가능

52 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 52 8.3 옵션  타임스탬프 (Timestamp) 옵션  라우터가 데이터그램을 처리하는 시간 기록  세계 표준시 이용 millisecond 단위 표시

53 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 53 8.3 옵션  타임스탬프에서 플래그 사용

54 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 54 8.3 옵션  타임스탬프 개념

55 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 55 8.3 옵션 Example 10 Which of the six options must be copied to each fragment?

56 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 56 8.3 옵션 Solution We look at the first (left-most) bit of the code for each option. No operation: Code is 00000001; no copy. End of option: Code is 00000000; no copy. Record route: Code is 00000111; no copy. Strict source route: Code is 10001001; copied. Loose source route: Code is 10000011; copied. Timestamp: Code is 01000100; no copy.

57 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 57 8.3 옵션 Example 11 Which of the six options are used for datagram control and which are used for debugging and management?

58 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 58 8.3 옵션 Solution We look at the second and third (left-most) bits of the code. No operation: Code is 00000001; control. End of option: Code is 00000000; control. Record route: Code is 00000111; control. Strict source route: Code is 10001001; control. Loose source route: Code is 10000011; control. Timestamp: Code is 01000100; debugging

59 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 59 CHECKSUM 8.4

60 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 60 8.4 검사합 To create the checksum the sender does the following: 1. The packet is divided into k sections, each of n bits. 2. All sections are added together using one’s complement arithmetic. 3. The final result is complemented to make the checksum.

61 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 61 8.4 검사합  검사합 개념

62 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 62 8.4 검사합  1 의 보수를 이용한 검사합

63 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 63 8.4 검사합  이진수 검사합 예

64 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 64 8.4 검사합  16 진수 검사합 예

65 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 65 8.4 검사합 Check Appendix C for a detailed description of checksum calculation and the handling of carries.

66 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 66 IP PACKAGE 8.5

67 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 67 8.5 IP 설계  IP 컴포넌트

68 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 68 8.5 IP 설계  IP 구성 요소  헤더 추가 모듈  처리 모듈  큐  라우팅 테이블  라우팅 모듈  MTU 테이블  단편화 모듈  재조립 모듈

69 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 69 8.5 IP 설계  헤더 추가 모듈 (Header-Adding Module)  알고리즘  Header-Adding Module Receive: data, destination address 1. Encapsulate the data in an IP datagram. 2. Calculate the checksum and insert it in the checksum field. 3. Send the data to the corresponding input queue. 4. Return.

70 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 70 8.5 IP 설계  처리 모듈 (Processing Module)  알고리즘  Processing Module 1. Remove one datagram from one of the input queues. 2. If (destination address is 127.X.Y.Z or matches one of the local addresses) 1. Send the datagram to the reassembly module. 2. Return. 3. If (machine is a router) 1. Decrement TTL. 4. If (TTL less than or equal to zero) 1. Discard the datagram. 2. Send an ICMP error message. 3. Return. 5. Send the datagram to the routing module. 6. Return.

71 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 71 8.5 IP 설계  큐 (Queue) – 입 / 출 큐  라우팅 테이블 : 패킷의 다음 홉 주소 결정하기 위해 라 우팅 모듈이 사용  라우팅 모듈 : 6 장 참조  MTU 테이블 : 단편화 모듈이 특정 인터페이스의 MTU 를 찾기 위해 사용

72 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 72 8.5 IP 설계  단편화 모듈 (Fragmentation Module) Receive: an IP packet from routing module 1. Extract the size of the datagram. 2. If (size > MTU of the corresponding network) 1. If (D (do not fragment) bit is set) 1. Discard the datagram. 2. Send an ICMP error message 3. Return. 2. Else 1. Calculate the maximum size. 2. Divide the datagram into fragments. 3. Add header to each fragment. 4. Add required options to each fragment. 5. Send the datagrams. 6. Return. 3. Else 1. Send the datagram. 4. Return.

73 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 73 8.5 IP 설계  재조립 테이블 (Reassembly table)  재조립 모듈에 의해 사용  재조립 테이블

74 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 74 8.5 IP 설계  재조립 테이블 필드  상태 (state) : FREE 또는 IN-USE  IP 주소 : 발신지 주소  데이터그램 ID : 단편을 구분하는 번호  타임 아웃 : 단편이 도착해야 하는 시간  단편 : 연결 리스트의 포인터

75 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 75 8.5 IP 설계  재조립 모듈 (Reassembly Module) Receive: an IP datagram from the processing module 1. If (offset value is zero and the M bit is 0) 1. Send the datagram to the appropriate queue. 2. Return. 2. Search the reassembly table for the corresponding entry. 3. If (not found) 1. Create a new entry.

76 HANNAM UNIVERSITY Http://netwk.hannam.ac.kr 76 8.5 IP 설계  재조립 모듈 (Reassembly Module) ( 계속 ) 4. Insert the fragment at the appropriate place in the link list. 1. If(all fragments have arrived) 1. Reassemble the fragments. 2. Deliver the datagram to the corresponding upper layer protocol. 3. Return. 2. Else 1. Check the time-out. 2. If(time-out expired) 1. Discard all fragments. 2. Send an ICMP error message(see chapter 9). 5. return


Download ppt "HANNAM UNIVERSITY 1 Chapter 8 Internet Protocol (IP)"

Similar presentations


Ads by Google