1 / 50

Chapter 11

Chapter 11. User Datagram Protocol. Objectives. Upon completion you will be able to:. Be able to explain process-to-process communication Know the format of a UDP user datagram Be able to calculate a UDP checksum Understand the operation of UDP

plato
Download Presentation

Chapter 11

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 11 User DatagramProtocol Objectives Upon completion you will be able to: Be able to explain process-to-process communication Know the format of a UDP user datagram Be able to calculate a UDP checksum Understand the operation of UDP Know when it is appropriate to use UDP Understand the modules in a UDP package

  2. CONTENTS PROCESS-TO-PROCESS COMMUNICATION USER DATAGRAM CHECKSUM UDP OPERATION USE OF UDP UDP PACKAGE

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

  4. UDP 전송 프로토콜 임무 • 프로세스-대-프로세스 통신 생성 : 포트번호 이용 • 최소한의 오류 제어 메커니즘 수행 • 프로세스로부터 데이터 단위를 받아 신뢰성 없는 전달 제공 • 비연결형, 신뢰성이 없는 전송 프로토콜 • 최소한의 오버헤드만 사용하는 간단한 프로토콜

  5. 11.1 PROCESS-TO-PROCESS COMMUNICATION Before we examine UDP, we must first understand host-to-host communication and process-to-process communication and the difference between them. The topics discussed in this section include: Port Numbers Socket Addresses

  6. 11.1 프로세스-대-프로세스 통신 • UDP 대 IP

  7. 11.1 프로세스-대-프로세스 통신 • 포트 번호 • 프로세스-대-프로세스 통신 방법 : 클라이언트 / 서버 • 클라이언트와 서버 프로세스는 같은 이름을 가짐 • Daytime client process / daytime server • 원격 컴퓨터는 여러 개의 서버 프로그램 실행 • 로컬 컴퓨터로 여러 개의 클라이언트 프로그램 수행

  8. 11.1 프로세스-대-프로세스 통신 • 프로세스 통신을 위해 필요한 사항 • 로컬 호스트(local host) • 로컬 프로세스(local process) • 원격 호스트(remote host) • 원격 프로세스(remote process)

  9. 11.1 프로세스-대-프로세스 통신 • 프로세스 통신에서 포트 번호의 역할 • 로컬 호스트와 원격 호스트 : IP 주소 • 프로세스 : 포트 번호 • 포트 번호 범위 : 0 ~ 65,535 사이 정수 • 잘 알려진 포트 번호(well-known port number) • 임시 포트 번호(ephemeral port number)

  10. 11.1 프로세스-대-프로세스 통신 • 포트 번호

  11. 11.1 프로세스-대-프로세스 통신 • IP 주소 대 포트 번호

  12. 11.1 프로세스-대-프로세스 통신 • IANA(Internet Assigned Numbers Authority) 범위 • 잘 알려진 포트 : 0 ~ 1,023 • 등록된 포트(registered port) : 1,024~ 49,151 • 동적 포트(dynamic port) : 49,152~ 65,535

  13. 11.1 프로세스-대-프로세스 통신 Note: The well-known port numbers are less than 1024.

  14. 11.1 프로세스-대-프로세스 통신 • UDP에서사용되는 잘 알려진 포트

  15. Example 1 In UNIX, the well-known ports are stored in a file called /etc/services. Each line in this file gives the name of the server and the well-known port number. We can use the grep utility to extract the line corresponding to the desired application. The following shows the port for TFTP. Note TFTP can use port 69 on either UDP or TCP. $ grep tftp /etc/services tftp 69/tcp tftp 69/udp

  16. Example 1 SNMP uses two port numbers (161 and 162), each for a different purpose, as we will see in Chapter 21. $ grep snmp /etc/services snmp 161/tcp #Simple Net Mgmt Proto snmp 161/udp #Simple Net Mgmt Proto snmptrap 162/udp #Traps for SNMP

  17. 11.1 프로세스-대-프로세스 통신 • 소켓 주소(Socket Address) • 각 종단 점에서 연결을 만들기 위해 필요한 주소

  18. 11.2 USER DATAGRAM UDP packets are called user datagrams and have a fixed-size header of 8 bytes.

  19. 11.2 사용자 데이터그램 • 8 바이트 고정 크기 헤더 • 발신지 포트 번호(source port number) • 목적지 포트 번호(destination port number) • 길이(length) : 헤더 + 데이터 • 검사합 : 오류 발견

  20. 11.2 사용자 데이터그램 Note: UDP length = IP length − IP header’s length

  21. 11.3 CHECKSUM UDP checksum calculation is different from the one for IP and ICMP. Here the checksum includes three sections: a pseudoheader, the UDP header, and the data coming from the application layer. The topics discussed in this section include: Checksum Calculation at Sender Checksum Calculation at Receiver Optional Use of the Checksum

  22. 11.3 검사합 • UDP 검사합에 포함된 부분 • 의사 헤더(Pseudoheader) • UDP 헤더 • 응용 계층으로부터 온 데이터

  23. 11.3 검사합 • UDP 헤더에 첨부된 의사 헤더

  24. 11.3 검사합 • 송신자 검사합 계산 • UDP 데이터그램에 의사 헤더 추가 • 검사합 필드 0으로 채움 • 전체를 16 비트(2 바이트) 단위로 나눔 • 전체 바이트가 짝수가 아니면 값이 0 인 바이트 추가 • 1 의 보수 연산 이용 16 비트 섹션을 전부 더함 • 결과의 부수를 취하여 검사합 필드에 삽입 • 의사 헤더와 추가된 패딩 제거 • 데이터그램을 IP 소프트웨어에 전달

  25. 11.3 검사합 • UDP 사용자 데이터그램 검사합 계산

  26. 11.4 UDP OPERATION UDP uses concepts common to the transport layer. These concepts will be discussed here briefly, and then expanded in the next chapter on the TCP protocol. The topics discussed in this section include: Connectionless Services Flow and Error Control Encapsulation and Decapsulation Queuing Multiplexing and Demultiplexing

  27. 11.4 UDP 동작 • 비 연결형 서비스 • 각 데이터그램은 서로 독립적 • 연결 설정과 종료 과정 없이 서로 다른 경로로 전달될 수 있음 • 작은 메시지를 보내는 프로세스만이 UDP 사용 • 흐름제어와 오류제어 • 간단하고 신뢰성 없는 프로토콜 • 흐름제어도 없고 윈도우 메커니즘도 없음 • 검사합 외에는 오류 제어 메커니즘이 없음

  28. 11.4 UDP 동작 • 캡슐화와 역 캡슐화

  29. 11.4 UDP 동작 • UDP에서 사용되는 큐(Queue)

  30. 11.4 UDP 동작 • 큐잉(Queueing) • 클라이언트에서 프로세스가 시작될 때 운영체제에게 포트번호 요청(임시) • 구현에 따라 입력 큐 또는 입/출력큐 생성 • 프로세스가 종료 되면 큐는 제거 • 큐가 생성되어 있지 않으면 ICMP 프로토콜에게 “port unreachable” 메시지를 보낸데이터그램은 폐기

  31. 11.4 UDP 동작 • 다중화와 역 다중화

  32. 11.5 USE OF UDP We discuss some uses of the UDP protocol in this section.

  33. 11.5 UDP 용도 • 단순한 요청-응답을 필요로 하는 프로세스 • 흐름 제어와 오류 제어가 크게 필요하지 않은 프로세스 • 내부적인 흐름 제어와 오류 제어 메커니즘을 가지고 있는 프로세스 • 멀티캐스팅과 브로드캐스팅을 위한 전송 프로토콜 • SNMP와 같은 관리 프로세스 • RIP(Routing Information Protocol)와 같은 경로 갱신 프로토콜에 사용

  34. 11.6 UDP PACKAGE To show how UDP handles the sending and receiving of UDP packets, we present a simple version of the UDP package. The UDP package involves five components: a control-block table, input queues, a control-block module, an input module, and an output module. The topics discussed in this section include: Control-Block Table Input Queues Control-Block Module Input Module Output Module

  35. 11.6 UDP 설계 • UDP 패키지 구성 요소 • 제어 블록 테이블 • 입력 큐 • 제어 블록 모듈 • 입력 모듈 • 출력 모듈

  36. 11.6 UDP 설계 • UDP 설계

  37. 11.6 UDP 설계 • 제어 블록 테이블(Control Block Table) • 연결 포트를 추적하기 위한 테이블 • 테이블 엔트리(상태, 프로세스 ID, 포트 번호, 큐 번호) • 입력 큐(Input Queue) • 프로세스당 하나씩 배정

  38. 11.6 UDP 설계 • 제어 블록 모듈(Control-Block Module) • 제어 블록 테이블 관리 담당 • 프로세스가 시작될 때 운영체제에게 포트 번호 요청 • 운영 체제는 서버에게 잘 알려진 포트 번호, 클라이언트는 임시 포트 번호 배정 • 프로세스 번호와 포트 번호를 제어 블록으로 보냄

  39. 11.6 UDP 설계 • 제어 블록 번호 알고리즘 Receive: a process ID and a port number. 1. Search the control block table for a FREE entry. 1. If(not found) 1. Delete an entry using a predefined strategy. 2. Create a new entry with the state IN-USE. 3. Enter the process ID and the port number. 2. Return

  40. 11.6 UDP 설계 • 입력 모듈(Input Module) • IP로 부터 데이터그램을 받는다 • 제어 블록 테이블을 찾아서 데이터그램과 같은 포트 번호를 가진 엔트리를 찾는다 • 있으면 엔트리 정보를 이용하여 데이터를 큐에 넣는다 • 없으면 ICMP 메시지를 생성

  41. 11.6 UDP 설계 • 입력 모듈 알고리즘 Receive: a user datagram from IP 1. Look for the corresponding entry in the control-block table. 1. If(found) 1. Check the queue field to see if a queue is allocated. 1. If(no) 1. Allocate a queue. 2. Enqueue the data in the corresponding queue. 2. If(not found) 1. Ask the ICMP module to send an “unreachable port” message. 2. Discard the user datagram. 2. Return

  42. 11.6 UDP 설계 • 출력 모듈(output module) • 데이터그램을 생성하여 보내는 책임을 가짐 Receive: data and information from a process • Create a UDP user datagram. • Send the user datagram. • Return.

  43. 11.6 UDP 설계 • 제어 블록 데이터의 초기값

  44. Example 2 The first activity is the arrival of a user datagram with destination port number 52,012. The input module searches for this port number and finds it. Queue number 38 has been assigned to this port, which means that the port has been previously used. The input module sends the data to queue 38. The control-block table does not change.

  45. Example 3 After a few seconds, a process starts. It asks the operating system for a port number and is granted port number 52,014. Now the process sends its ID (4,978) and the port number to the control-block module to create an entry in the table. The module takes the first FREE entry and inserts the information received. The module does not allocate a queue at this moment because no user datagrams have arrived for this destination (see Table 11.3).

  46. 11.6 UDP 설계 • 예제 2후에 수정된 테이블

  47. Example 4 A user datagram now arrives for port 52,011. The input module checks the table and finds that no queue has been allocated for this destination since this is the first time a user datagram has arrived for this destination. The module creates a queue and gives it a number (43). See Table 11.4.

  48. 11.6 UDP 설계 • 예제 3후에 수정된 테이블

  49. Example 5 After a few seconds, a user datagram arrives for port 52,222. The input module checks the table and cannot find an entry for this destination. The user datagram is dropped and a request is made to ICMP to send an “unreachable port” message to the source.

  50. 알림 연습문제 풀이해서 Report로 다음주까지(일주일 후) 제출해 주세요!

More Related