HANNAM UNIVERSITY 1 Chapter 8 Internet Protocol (IP)

Slides:



Advertisements
Similar presentations
Chapter 20 Network Layer: Internet Protocol
Advertisements

Internet Protocol/ Network Layer.
CE363 Data Communications & Networking Chapter 7 Network Layer: Internet Protocol.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Internet Protocol/ Network Layer. 2 Position of IP in TCP/IP protocol suite.
Network Layer – IPv4 Dr. Sanjay P. Ahuja, Ph.D.
Chapter 20 Network Layer: Internet Protocol Stephen Kim 20.1.
Internet Protocol (IP)
1 TDC TDC 365 Network Interconnections Technologies Lecture #4 Notes Spring, 2009.
TCP/IP Protocol Suite 1 Chapter 8 Upon completion you will be able to: Internet Protocol Understand the format and fields of a datagram Understand the.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Internet Protocol Version4.
1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 9 Internet Control Message.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a
1 Kyung Hee University Chapter 7 Internet Protocol Version 4 (IPv4)
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
資 管 Lee Lesson 5 IP Packets: Delivery and Routing IP Layer operation.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 5 Internet Protocol (IP) Basics.
1 IP : Internet Protocol Computer Network System Sirak Kaewjamnong.
Dr. John P. Abraham Professor UTPA
Internet Protocol --- Connectionless Datagram Delivery Linda Wu (CMPT )
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ECE 4110 – Internetwork Programming IP Protocol. 2 * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall Position of IP in TCP/IP Protocol Suite.
Network Layer: Internet Protocol.
Chapter 19 Network Layer Protocols Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CS4550 Computer Networks II IP : internet protocol, part 2 : packet formats, routing, routing tables, ICMP read feit chapter 6.
1 Chapter 8 Internet Protocol (IP) Chapter 8 Internet Protocol (IP) Mi-Jung Choi Dept. of Computer Science and Engineering
TCP/IP Protocol Suite 1 Chapter 8 Upon completion you will be able to: Internet Protocol Understand the format and fields of a datagram Understand the.
Communications Services Connection Oriented Service  A connection is established  Data is sent or received over this connection  Connection may be terminated.
Chapter 20 Network Layer: Internet Protocol
1 Kyung Hee University Chapter 8 Internet Protocol (IP)
TCP/IP Protocol Suite 1 Chapter 8 Upon completion you will be able to: Internet Protocol Understand the format and fields of a datagram Understand the.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
Chapter 8 Internet Protocol (IP)
1 Computer Communication & Networks Lecture 19 Network Layer: IP and Address Mapping Waleed Ejaz.
Internet Protocol Version 4 VersionHeader Length Type of Service Total Length IdentificationFragment Offset Time to LiveProtocolHeader Checksum Source.
Net7: IP 協定 Internet Protocol 授課教師:雲林科技大學 張慶龍 老師.
Network Layer Protocols COMP 3270 Computer Networks Computing Science Thompson Rivers University.
IP Fragmentation. Network layer transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side,
Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Internet Protocol Version4.
IPv4 IPv4 The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the TCP/IP protocols. Datagram Fragmentation Checksum Options Topics.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 User Datagram Protocol
Chapter 19 Network Layer Protocols
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
IP - The Internet Protocol
7 Network Layer Part IV Computer Networks Tutun Juhana
Chapter 8: Internet Protocol (IP)
Chapter 7: The Infamous IP
Internet Protocol Version4
Chapter 20 Network Layer: Internet Protocol
Internet Protocol Version4
Chapter 14 User Datagram Protocol (UDP)
Chapter 7: The Infamous IP
Dr. John P. Abraham Professor UTPA
Chapter 20 Network Layer: Internet Protocol
Dr. John P. Abraham Professor UTRGV, EDINBURG, TX
Dr. John P. Abraham Professor UTPA
Net 323 D: Networks Protocols
Chapter 7 Internet Protocol Version 4 (IPv4)
Internet Protocol (IP)
ITIS 6167/8167: Network and Information Security
NET 323D: Networks Protocols
32 bit destination IP address
Presentation transcript:

HANNAM UNIVERSITY 1 Chapter 8 Internet Protocol (IP)

HANNAM UNIVERSITY 2CONTENTS DATAGRAM FRAGMENTATION OPTIONS CHECKSUM IP PACKAGE

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

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

HANNAM UNIVERSITY 5 DATAGRAM 8.1

HANNAM UNIVERSITY 데이터 그램  IP 데이터 그램

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

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

HANNAM UNIVERSITY IP 데이터 그램  TOS(type of service) 비트  서비스 유형 TOS Bits Description 0000 Normal (default) 0001 Minimize cost 0010 Maximize reliability 0100 Maximize throughput 1000 Minimize delay

HANNAM UNIVERSITY 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

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

HANNAM UNIVERSITY IP 데이터 그램 The total length field defines the total length of the datagram including the header.

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

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

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

HANNAM UNIVERSITY IP 데이터 그램 Example 1 An IP packet has arrived with the first 8 bits as shown:  The receiver discards the packet. Why?

HANNAM UNIVERSITY 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.

HANNAM UNIVERSITY 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?

HANNAM UNIVERSITY 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.

HANNAM UNIVERSITY IP 데이터 그램 Example 3 In an IP packet, the value of HLEN is 5 16 and the value of the total length field is How many bytes of data are being carried by this packet?

HANNAM UNIVERSITY 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).

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

HANNAM UNIVERSITY 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.

HANNAM UNIVERSITY 24 FRAGMENTATION 8.2

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

HANNAM UNIVERSITY 단편화  MTU(Maxmum Transfer Unit)

HANNAM UNIVERSITY 단편화  서로 다른 네트워크의 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 PPP 296

HANNAM UNIVERSITY 단편화  단편화와 관련된 필드  식별자 (identification) – 단편들은 같은 식별자 값을 가짐  플래그 (flag) – 3 비트 필드

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

HANNAM UNIVERSITY 단편화  상세한 단편화 예

HANNAM UNIVERSITY 단편화 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?

HANNAM UNIVERSITY 단편화 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.

HANNAM UNIVERSITY 단편화 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?

HANNAM UNIVERSITY 단편화 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.

HANNAM UNIVERSITY 단편화 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?

HANNAM UNIVERSITY 단편화 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.

HANNAM UNIVERSITY 단편화 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?

HANNAM UNIVERSITY 단편화 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.

HANNAM UNIVERSITY 단편화 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?

HANNAM UNIVERSITY 단편화 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.

HANNAM UNIVERSITY 41 OPTIONS 8.3

HANNAM UNIVERSITY 옵션  옵션 형식  IP 데이터그램 헤더 내의 가변 부분 ( 최대 40 바이트 )

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

HANNAM UNIVERSITY 옵션  옵션 유형

HANNAM UNIVERSITY 옵션  무연산 (No Operation)  옵션 사이의 여백을 채워줌 (1byte option)

HANNAM UNIVERSITY 옵션  종료 옵션 (End of Option)  옵션 필드의 패딩 목적으로 사용 (1byte option)

HANNAM UNIVERSITY 옵션  경로 기록 (Record Route) 옵션  데이터그램을 처리한 인터넷 라우터들 기록

HANNAM UNIVERSITY 옵션  데이터그램이 라우터를 경유하여 이동하는 과정

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

HANNAM UNIVERSITY 옵션  엄격한 발신지 경로 개념

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

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

HANNAM UNIVERSITY 옵션  타임스탬프에서 플래그 사용

HANNAM UNIVERSITY 옵션  타임스탬프 개념

HANNAM UNIVERSITY 옵션 Example 10 Which of the six options must be copied to each fragment?

HANNAM UNIVERSITY 옵션 Solution We look at the first (left-most) bit of the code for each option. No operation: Code is ; no copy. End of option: Code is ; no copy. Record route: Code is ; no copy. Strict source route: Code is ; copied. Loose source route: Code is ; copied. Timestamp: Code is ; no copy.

HANNAM UNIVERSITY 옵션 Example 11 Which of the six options are used for datagram control and which are used for debugging and management?

HANNAM UNIVERSITY 옵션 Solution We look at the second and third (left-most) bits of the code. No operation: Code is ; control. End of option: Code is ; control. Record route: Code is ; control. Strict source route: Code is ; control. Loose source route: Code is ; control. Timestamp: Code is ; debugging

HANNAM UNIVERSITY 59 CHECKSUM 8.4

HANNAM UNIVERSITY 검사합 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.

HANNAM UNIVERSITY 검사합  검사합 개념

HANNAM UNIVERSITY 검사합  1 의 보수를 이용한 검사합

HANNAM UNIVERSITY 검사합  이진수 검사합 예

HANNAM UNIVERSITY 검사합  16 진수 검사합 예

HANNAM UNIVERSITY 검사합 Check Appendix C for a detailed description of checksum calculation and the handling of carries.

HANNAM UNIVERSITY 66 IP PACKAGE 8.5

HANNAM UNIVERSITY IP 설계  IP 컴포넌트

HANNAM UNIVERSITY IP 설계  IP 구성 요소  헤더 추가 모듈  처리 모듈  큐  라우팅 테이블  라우팅 모듈  MTU 테이블  단편화 모듈  재조립 모듈

HANNAM UNIVERSITY 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.

HANNAM UNIVERSITY 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.

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

HANNAM UNIVERSITY 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.

HANNAM UNIVERSITY IP 설계  재조립 테이블 (Reassembly table)  재조립 모듈에 의해 사용  재조립 테이블

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

HANNAM UNIVERSITY 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.

HANNAM UNIVERSITY 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