1 / 70

Understanding IP Datagram Format and Fragmentation

Learn about the format and fields of an IP datagram, the need for fragmentation, and the options available. Understand how to perform checksum calculations and the components and interactions of an IP package.

amcmahan
Download Presentation

Understanding IP Datagram Format and Fragmentation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 8 Internet Protocol Objectives Upon completion you will be able to: Understand the format and fields of a datagram Understand the need for fragmentation and the fields involved Understand the options available in an IP datagram Be able to perform a checksum calculation Understand the components and interactions of an IP package

  2. CONTENTS DATAGRAM FRAGMENTATION OPTIONS CHECKSUM IP PACKAGE

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

  4. TCP/IP 프로토콜에서 IP의 위치

  5. 8.1 DATAGRAM A packet in the IP layer is called a datagram, a variable-length packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and contains information essential to routing and delivery.

  6. 8.1 데이터 그램 • IP 데이터 그램

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

  8. 8.1 IP 데이터 그램 • 서비스 유형(Service type) - (8 비트) • 라우터에 의해 처리하는 방법 • 3 bit는 우선 순위, 4 bit는 서비스 유형

  9. 8.1 데이터 그램 Note: The precedence subfield was designed, but never used in version 4.

  10. 8.1 IP 데이터 그램 • TOS(type of service) 비트 • 서비스 유형

  11. 8.1 IP 데이터 그램 • 응용 프로그램들의 서비스 유형 기본 값

  12. 8.1 IP 데이터 그램 • 차별화된 서비스(Differentiated Service) • 오른쪽 3비트가 0이면 우선순위와 같은 의미로 해석 • 오른쪽 3비트가 0이 아니면 기관에서 정의된 서비스 • 코드 포인트의 값 The precedence subfield is not used in version 4.

  13. 8.1 데이터 그램 Note: The total length field defines the total length of the datagram including the header.

  14. 8.1 IP 데이터 그램 • 전체 길이(total length) • 16 bit 필드(65,535 까지 표현) • IP 데이터그램의 전체 길이를 바이트 단위로 표시 • 데이터 길이 = 전체 길이 – 헤더 길이 • 이더넷 프레임에서 작은 데이터그램의 캡슐화

  15. 8.1 IP 데이터 그램 • 식별(Identification) –단편화에 사용 • 플래그(flag) –단편화에 사용 • 단편 옵셋(fragmentation offset) –단편화에 사용 • 수명(time to live) –데이터그램의 수명

  16. 8.1 IP 데이터 그램 • 프로토콜(protocol) – IP 계층의 서비스를 사용하는 상위 계층 프로토콜 • 검사합(checksum) –오류 확인 • 발신지 주소 (source address) • 목적지 주소 (destination address)

  17. Example 1 An IP packet has arrived with the first 8 bits as shown: 01000010 The receiver discards the packet. Why? SolutionThere 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. 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? SolutionThe 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 base header, the next 12 bytes are the options.

  19. Example 3 In an IP packet, the value of HLEN is 516 and the value of the total length field is 002816 . Howmany bytes of data are being carried by this packet? SolutionThe 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).

  20. 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? SolutionTo find the time-to-live field, we 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 (see Table 8.4).

  21. 8.2 FRAGMENTATION The format and size of a frame depend on the protocol used by the physical network. A datagram may have to be fragmented to fit the protocol regulations. The topics discussed in this section include: Maximum Transfer Unit (MTU) Fields Related to Fragmentation

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

  23. 8.2 단편화 • MTU(Maxmum Transfer Unit)

  24. 8.2 단편화 • 서로 다른 네트워크의 MTU

  25. 8.2 단편화 • 단편화와 관련된 필드 • 식별자(identification) – 단편들은 같은 식별자 값을 가짐 • 플래그(flag) – 3 비트 필드

  26. 8.2 단편화 • 단편화 옵셋(Fragmentationoffset) : 13 비트 필드 • 전체 데이터그램에서 단편의 상대적인 위치(8 바이트 단위) • 단편화 예

  27. 8.2 단편화 • 상세한 단편화 예

  28. 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? SolutionIf 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.

  29. 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? SolutionIf 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). See also the next example.

  30. 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?. SolutionBecause 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.

  31. 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? SolutionTo 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.

  32. 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? SolutionThe 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 be 879.

  33. 8.3 OPTIONS The header of the IP datagram is made of two parts: a fixed part and a variable part. The variable part comprises the options that can be a maximum of 40 bytes. The topics discussed in this section include: Format Option Types

  34. 8.3 옵션 • 옵션 형식 • IP 데이터그램 헤더 내의 가변 부분(최대 40바이트)

  35. 8.3 옵션 • 코드 필드(8 비트) : 고정 길이 • 복사(copy) • 단편화에 옵션을 포함시킨 것인지 제어 • 클래스(class) • 옵션의 목적을 나타냄 • 번호(number) • 옵션 유형 • 길이 필드(8 비트) : 고정길이 • 옵션의 전체 길이 • 데이터 필드 : 가변 길이

  36. 8.3 옵션 • 옵션 유형

  37. 8.3 옵션 • 무연산(No Operation) • 옵션 사이의 여백을 채워줌(1byte option)

  38. 8.3 옵션 • 종료 옵션(End of Option) • 옵션 필드의 패딩 목적으로 사용 (1byte option)

  39. 8.3 옵션 • Record Route 옵션 • 데이터그램을 처리한 인터넷 라우터들 기록

  40. 8.3 옵션 • Record route 개념

  41. 8.3 옵션 • 엄격한 발신지 경로 지정 (Strict Source Route) 옵션 • 데이터그램이 거쳐야할 경로를 미리 지정하기 위해 사용 • 데이터그램은 옵션에 정의된 모든 라우터 방문

  42. 8.3 옵션 • 엄격한 발신지 경로 지정 개념

  43. 8.3 옵션 • 느슨한 발신지 경로 지정(Loose Source Route) 옵션 • 엄격한 발신지 경로와 비슷하지만 리스트에 없는 라우터도 방문 가능

  44. 8.3 옵션 • 타임스탬프(Timestamp) 옵션 • 라우터가 데이터그램을 처리하는 시간 기록 • 세계 표준시 이용 millisecond 단위 표시

  45. 8.3 옵션 • 타임스탬프에서 플래그 사용

  46. 8.3 옵션 • 타임스탬프 개념

  47. Example 10 Which of the six options must be copied to each fragment? SolutionWe look at the first (left-most) bit of the code for each option. a. No operation: Code is 00000001; not copied.b. End of option: Code is 00000000; not copied.c. Record route: Code is 00000111; not copied.d. Strict source route: Code is 10001001; copied.e. Loose source route: Code is 10000011; copied.f. Timestamp: Code is 01000100; not copied.

  48. Example 11 Which of the six options are used for datagram control and which are used for debugging and management? SolutionWe look at the second and third (left-most) bits of the code. a. No operation: Code is 00000001; datagram control.b. End of option: Code is 00000000; datagram control.c. Record route: Code is 00000111; datagram control.d. Strict source route: Code is 10001001; datagram control.e. Loose source route: Code is 10000011; datagram control.f. Time stamp: Code is 01000100; debugging and management control.

  49. Example 12 One of the utilities available in UNIX to check the travelling of the IP packets is ping. In the next chapter, we talk about the ping program in more detail. In this example, we want to show how to use the program to see if a host is available. We ping a server at De Anza College named fhda.edu. The result shows that the IP address of the host is 153.18.8.1. $ ping fhda.eduPING fhda.edu (153.18.8.1) 56(84) bytes of data.64 bytes from tiptoe.fhda.edu (153.18.8.1): .... The result shows the IP address of the host and the number of bytes used.

  50. 8.4 CHECKSUM The error detection method used by most TCP/IP protocols is called the checksum. The checksum protects against the corruption that may occur during the transmission of a packet. It is redundant information added to the packet. The topics discussed in this section include: Checksum Calculation at the Sender Checksum Calculation at the Receiver Checksum in the IP Packet

More Related