Computer Network Lab. 1 제 11 장 사용자 데이터그램 프로토콜. Computer Network Lab. 2 Content n Introduction n UDP Header n UDP Checksum n IP Fragmentation n ICMP 도달불가.

Slides:



Advertisements
Similar presentations
TCP/IP TCP/IP architecture
Advertisements

CS 356: Computer Network Architectures Lecture 10: IP forwarding
CSCI 4550/8556 Computer Networks Comer, Chapter 23: An Error Reporting Mechanism (ICMP)
TCP/IP Illustrated Vol 1 ARP & RARP ARP & RARP ( 화 ) 이 병 희
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Internet Control Message Protocol (ICMP)
1 Internet Networking Spring 2002 Tutorial 4 ICMP (Internet Control Message Protocol)
The Network Layer Chapter 5. The IP Protocol The IPv4 (Internet Protocol) header.
Chapter 5 The Network Layer.
CS335 Networking & Network Administration Tuesday, May 11, 2010.
Internet Networking Spring 2003
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Internet Control Message Protocol (ICMP) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute.
1 Application Presentation Session Transport Network Datalink Physical OSI model Application IPv4, IPv6 Device Driver Hardware TCPUDP Internet.
Internet Command Message Protocol (ICMP) CS-431 Dick Steflik.
4: Network Layer4a-1 IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time.
Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Control Message Protocol ICMP author -- J. Postel, September The purpose.
ICMP (Internet Control Message Protocol) Computer Networks By: Saeedeh Zahmatkesh spring.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
IP (Internet Protocol) –the network level protocol in the Internet. –Philosophy – minimum functionality in IP, smartness at the end system. –What does.
1 ECE453 – Introduction to Computer Networks Lecture 12 – Network Layer (IV)
ICMP : Internet Control Message Protocol. Introduction ICMP is often considered part of the IP layer. It communicates error messages and other conditions.
1 IP: putting it all together Part 2 G53ACC Chris Greenhalgh.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
The Source : Source 의 출처 제목 : Link Layer ( 수 ) 양 우 철
CDPA 網管訓練 駭客任務 2 Ethernet Switching ARP, IP, LAN, Subnet IP Header, Routing ICMP
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 5 Internet Protocol (IP) Basics.
Protocols 1 Objective: Build a protocol foundation for Client / Server programming in an Internet Environment Note: RFCs available from
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 ICMP: A helper protocol to IP The Internet Control Message Protocol (ICMP) is the protocol used for error.
TCOM 515 IP Routing. Syllabus Objectives IP header IP addresses, classes and subnetting Routing tables Routing decisions Directly connected routes Static.
TCP/IP Illustrated Volume I Internet Protocol 백 일 우.
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
1 Internet Control Message Protocol (ICMP) Used to send error and control messages. It is a necessary part of the TCP/IP suite. It is above the IP module.
CS4550 Computer Networks II IP : internet protocol, part 2 : packet formats, routing, routing tables, ICMP read feit chapter 6.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
1 Network Layer Lecture 16 Imran Ahmed University of Management & Technology.
Chapter 23 Internet Control Message Protocol used to report information and errors IP uses ICMP when it sends an error message ICMP uses IP to transport.
ICMP : Internet Control Message Protocol
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
1 Chapter 23 Internetworking Part 3 (Control Messages, Error Handling, ICMP)
CSC/ECE 573 Internet Protocols User Datagram Protocol.
Network Layer4-1 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection”
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.
1 Requirements for Internet Routers (Gateways) and Hosts Relates to Lab 3. (Supplement) Covers the compliance requirements of Internet routers and hosts.
TCP/IP Illustracted Vol1. 제목 : IP Routing ( 수 ) 한 민 규
ICMPv6 Error Message Types Informational Message Types.
Net7: IP 協定 Internet Protocol 授課教師:雲林科技大學 張慶龍 老師.
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 ICMP The PING Tool Traceroute program IGMP.
UDP : User Datagram Protocol 백 일 우
IP Internet Protocol. IP TCP UDP ICMPIGMP ARP PPP Ethernet.
Packet Switch Network Server client IP Ether IPTCPData.
4: Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Graciela Perera Department of Computer Science and Information Systems Slide 1 of 18 INTRODUCTION NETWORKING CONCEPTS AND ADMINISTRATION CSIS 3723 Graciela.
Internet Control Message Protocol (ICMP)
© 2003, Cisco Systems, Inc. All rights reserved.
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
COMPUTER NETWORKS CS610 Lecture-33 Hammad Khalid Khan.
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Advanced Computer Networks
Some slides have been taken from:
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Wide Area Networks and Internet CT1403
Chapter 4 Network Layer Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April Network Layer.
46 to 1500 bytes TYPE CODE CHECKSUM IDENTIFIER SEQUENCE NUMBER OPTIONAL DATA ICMP Echo message.
32 bit destination IP address
Presentation transcript:

Computer Network Lab. 1 제 11 장 사용자 데이터그램 프로토콜

Computer Network Lab. 2 Content n Introduction n UDP Header n UDP Checksum n IP Fragmentation n ICMP 도달불가 에러 [ 단편화 요구 ] n Traceroute 를 이용한 Path MTU 결정 n UDP 를 이용한 Path MTU 발견 n UDP 와 ARP 간의 상호 작용 n UDP 데이터그램 크기의 최대값 n ICMP 발신지 억제 에러 n UDP 서버 설계 n Summary

Computer Network Lab. 3 Introduction n Simple, datagram-oriented, transport layer protocol n 프로세스에 의한 output 으로 하나의 UDP datagram 을 생성 l stream-oriented protocol 인 TCP 와 다름 n No reliability l 목적지에 도착을 보장하지 못함

Computer Network Lab. 4 UDP Header n Port number l sending process 와 receiving process 구별 l UDP 와 TCP port 는 IP 로부터 구별 됨 (figure 1.8) n UDP length: UDP header+data 의 길이 l 최소 크기 8 바이트 (data 가 0 일 경우 ) l IP datagram total length - IP header length

Computer Network Lab. 5 UDP Header 16-bit source port number16-bit destination port number 16-bit UDP length16-bit UDP checksum Data(if any) Figure 11.2 UDP header

Computer Network Lab. 6 UDP Checksum n UDP header 와 UDP data 를 체크 l IP checksum 은 IP header 만 체크 n IP header checksum 과 유사하지만 차이점이 있음 l UDP datagram 의 길이는 홀수일 수 있지만, checksum algorithm 은 16-bit word ä0 값의 pad byte 를 붙임으로서 해결 l 12-byte pseudo-header 포함 ä 데이터가 보내질 올바른 목적지를 2 번 체크

Computer Network Lab. 7 UDP Checksum n UDP checksum 계산 필드 32-bit source IP address 16-bit UDP lengthzero8-bit protocol 16-bit source port number16-bit dest port number 16-bit UDP length16-bit UDP checksum data Pad byte(0)

Computer Network Lab. 8 UDP Checksum n TCP 와 UDP 는 헤더에 checksum 을 가짐 l UDP 는 optional, TCP 는 mandatory l UDP 는 optional 이지만, 항상 checksum 을 사용해야 함 n tcpdump Output sun.1900 > gemini.echo: udp 9 (UDP cksum=6e90) (0.3038)gemini.echo > sun.1900: udp 9 (UDP cksum =0) ( ) sun.1904 > aix.echo: udp 9 (UDP cksum=6e3b) (0.2219) axi.echo > sun.1904:udp 9 (UDP cksum=6e3b)

Computer Network Lab. 9 IP Fragmentation n IP fragmentation 을 하는 이유 l 데이터 그램의 크기가 물리적인 네트워크 계층이 전송할 수 있는 frame 의 최대 크기보다 클때 n Fragmentation 과정 l IP 는 상위계층에서 전달받은 IP datagram 을 어느 local interface 를 통해 전달할 것인지를 결정 (MTU 를 질의 ) l MTU 와 IP datagram 을 비교 ä if ( IP datagram > MTU ) then Fragmentation n Fragmentation 발생 위치 l 송신 host 또는 중간 router

Computer Network Lab. 10 IP Fragmentation n Reassemble l 최종 목적지에 도달 후, reassemble 됨 l 몇몇 다른 네트워크 프로토콜은 최종 목적지가 아닌 다음 hop 에 서 reassemble 하기도 함 l 목적지의 IP Layer 가 수행 n Fragmentation & Reassemble 목적 l 처리 속도를 저하시키지 않는 범위에서 transport layer 에서 transparency 을 제공하기 위함 n Fragmentation 의 재 fragmentation 이 가능 l IP header 에 reassemble 을 위한 정보를 유지

Computer Network Lab. 11 IP Fragmentation n IP header field l Identification field : 송신자가 전송하는 각 IP 데이터그램에 대하 여 유일한 값을 포함, 번호는 해당 데이터그램의 각 단편에 복사 l Flags field ämore fragment bit : fragment 가 더 있다는 것을 의미하기 위함, 마지막 fragment 를 제외하고 각 fragment 는 이 비트를 set ädon’t fragment bit : IP 는 datagram 을 단편화하지 못함, 그러나 ICMP error 를 본래 전송자에게 보냄 (ICMP error : fragmentation 이 필요한데 don’t fragment bit 가 set 되어 있음을 의미 ) l Fragment offset field : 해당 fragment 의 offset 을 나타냄

Computer Network Lab. 12 IP Fragmentation n Routing of Fragments l 각각의 fragment 는 자신의 IP header 를 갖는 독립된 패킷 l 다른 패킷과 독립적으로 전송, 최종 목적지에 다른 순서로 도착 할 수 있지만 IP header 정보로 재조립 n Fragmentation 의 단점 l fragment 를 하나라도 분실하면 datagram 의 모든 fragment 를 재전 송 l fragmentation 이 중간 router 에서 이루어진 경우 발신지는 datagram 의 fragmentation 정보를 알 수 없음

Computer Network Lab. 13 IP Fragmentation n Example l sock 프로그램을 이용해서 fragmentation 이 일어날 때까지 datagram 의 크기를 증가시킨다. l Ethernet 의 MTU = 1500 bytes l user data = (IP header) - 8(UDP header) = 1472 bytes bsdi % sock -u -I -n1 -w1471 svr4 discard bsdi % sock -u -I -n1 -w1472 svr4 discard bsdi % sock -u -I -n1 -w1473 svr4 discard bsdi % sock -u -I -n1 -w1474 svr4 discard

Computer Network Lab. 14 IP Fragmentation n tcpdump output bsdi.1112 >svr4.discard: udp ( ) bsdi.1114 >svr4.discard: udp ( ) bsdi.1116 >svr4.discard: udp 1473 (frag ( ) bsdi>svr4: (frag ( ) bsdi.1118>svr4.discard: udp 1474 (frag ( ) bsdi>svr4: (frag l line 1, 2 : not fragmented l line 3, 4, 5, 6 : fragmented l identification number : 26304, l 1480= 1472(user data)+8(UDP header) - excluding IP header l 다음의 number : offset l + : more fragment, if (not +) then last fragment

Computer Network Lab. 15 IP Fragmentation n 생성된 fragment 의 크기는 마지막 fragment 를 제외하고 8 의 배수가 되어야 함 n 첫번째 fragment 를 제외한 나머지는 프로토콜과 source, destination 의 port number 를 생략함 n terminology l IP datagram : IP Layer 에서 종단간 전송의 단위 l packet : IP Layer 와 Link layer 간에 전달되는 데이터의 단위 packet 은 하나의 IP datagram 이 되거나 fragment 가 될 수 있음

Computer Network Lab. 16 IP header UDP header UDP data (1473 bytes) 20 byte8 byte UDP datagram IP header UDP header 1472 bytes 20 byte8 byte IP header 20 byte1 byte packet Figure 11.8 Example of UDP Fragmentation

Computer Network Lab. 17 ICMP Unreachable Error (Fragmentation Required) n router 가 fragmentation 이 필요한 datagram 을 받은 경우, DF flag 가 set 되어 있을 때 발생 n 목적지까지의 경로에서 가장 작은 MTU 를 결정할 필요가 있는 프로그램은 이러한 error 를 이용 l (path MTU discovery Mechanism)

Computer Network Lab. 18 type(3)code(4)checksum Unused (must be 0) MTU of next-hop network IP header(including options) + first 8bytes of original IP datagram data bytes Figure 11.9 ICMP unreachable error options)+first 8bytes of original IP datagram data Newer Format of ICMP Unreachble Error

Computer Network Lab. 19 MTU=1500 bsdi MTU=1500 sunnetbsolaris MTU=1500 SLIP MTU=552MTU=? fragment watch with tcpdump fragmentation ping ICMP echo request Figure Systems being used to determine MTU of SLIP link from netb to sun

Computer Network Lab. 20 ICMP Unreachable Error (Fragmentation Required) n tcpdump output on bsdi 1 0.0solaris > bsdi : icmp : echo request (DF) (0.0000)bsdi>solaris : icmp : echo reply (DF) (0.0000)sun>bsdi icmp : solaris unreachable - need to frag, mtu = 0 (DF) (0.7384)solaris > bsdi : icmp : echo request (DF) (0.0104)bsdi>solaris : icmp : echo reply (DF) (0.0000)sun>bsdi icmp : solaris unreachable - need to frag, mtu = 0 (DF) l Solaris 2.2 는 대개 DF 를 set 한다. 이는 path MTU discovery mechanism 의 한 부분 이다.

Computer Network Lab. 21 MTU=1500 bsdi MTU=1500 sunnetbsolaris MTU=1500 SLIP MTU=552MTU=? ICMP echo request ICMP echo request ICMP echo request ICMP echo reply ICMP unreachable fragmentation required and DF set Figure Packets exchanged in example

Computer Network Lab. 22 Determining the path MTU using Traceroute n path MTU discovery 성질이 없다고 해도, path MTU 를 결 정하기 위해 traceroute version 을 수정할 수 있다. n example scenario l DF set packet 을 보냄 l 1 번 packet 의 크기 = sending interface 의 MTU l ICMP “can’t fragment” error 를 받을 때 마다 packet 의 크기를 줄임 l 만약 ICMP error 를 보내는 router 가 sending interface 의 MTU 를 포 함하는 새로운 version 을 보내면, 이 값을 사용할 것이다. 그렇지 않으면, 다음 작은 MTU 를 시도 äRFC 1191 에서는 MTU 의 수를 제한 -> 본 프로그램은 유사한 테이블을 갖고 있어서 다음 작은 값으로 시도 l sun -> slip (SLIP link MTU = 295)

Computer Network Lab. 23 Determining the path MTU using Traceroute n traceroute output (sun -> slip) sun % traceroute.pmtu slip traceroute to slip ( ), 30 hop max outgoing MTU = bsdi ( )15 ms6ms6ms 2 bsdi ( )6 ms fragmentation required and DF set, trying new MTU = 1492 fragmentation required and DF set, trying new MTU = 1006 fragmentation required and DF set, trying new MTU = 576 fragmentation required and DF set, trying new MTU = 552 fragmentation required and DF set, trying new MTU = 544 fragmentation required and DF set, trying new MTU = 512 fragmentation required and DF set, trying new MTU = 508 fragmentation required and DF set, trying new MTU = slip( )377 ms 377 ms 377ms

Computer Network Lab. 24 n Modify ICMP code on bsdi n sun % traceroute.pmtu slip traceroute to slip ( ), 30 hop max outgoing MTU = bsdi( )53ms6ms6ms 2 bsdi ( )6ms fragmentation required and DF set, Next hop MTU = slip ( )377ms378MS377 MS n 올바른 MTU 를 찾기 전에 8 개의 다른 값으로 시도할 필요없다. n router 는 제대로 된 값을 전달한다. Determining the path MTU using Traceroute

Computer Network Lab. 25 Path MTU Discovery with UDP n UDP 를 이용하는 application 과 path MTU discovery mechanism 간의 상호작용을 알아본다. n Example – application 이 중간의 link 에 대해서 상당히 큰 datagram 을 write 한다 – solaris : source host, slip : destination host – sending data : solaris -> slip – size of data : 650 bytes – SLIP link MTU behind slip : 296 – 268 byte ( ) 이상되는 UDP datagram( DF set) 은 router bsdi 가 ICMP error 를 생성하게 한다. – solaris % sock -u -i -n10 -w650 slip discard

Computer Network Lab. 26 MTU=1500 bsdi MTU=1500 sunnetbsolaris MTU=1500 SLIP MTU=552MTU=1500 SLIP slip MTU=296 run tcpdump here 650-byte UDP datagram with DF bit set ICMP can’t fragment error Figure Systems used for path MTU discovery using UDP

Computer Network Lab. 27 n tcpdump output on sun 1 0.0solaris.36196>slip.discard:udp 650 (DF) (0.0042) bsdi>solaris: icmp: slip unreachable - need to frag, mtu=0 (DF) (4.9763) solaris.36196>slip.discard:udp 650 (DF) (0.0040) bsdi>solaris: icmp: slip unreachable - need to frag, mtu=0 (DF) (4.9763) solaris.36196>slip.discard:udp 650 (frag (0.0896) solaris>slip: (frag (4.9763) solaris.36196>slip.discard:udp 650 (DF) (0.0040) bsdi>solaris: icmp: slip unreachable - need to frag, mtu=0 (DF) (4.9763) solaris.38196>slip.discard:udp 650 (frag (0.0604) solaris>slip: (frag (5.0100) solaris.36196>slip.discard:udp 650 (DF) (0.0040) bsdi>solaris: icmp: slip unreachable - need to frag, mtu=0 (DF)

Computer Network Lab. 28 Path MTU Discovery with UDP n tcpdump output on slip 10.0 solaris.38196>slip.discard: udp 650 (frag (0.3045) solaris>slip: (frag (0.0301) solaris>slip: (frag (0.1320) solaris>slip: (frag l solaris 는 fragmetation(x), but DF bit 를 off

Computer Network Lab. 29 Path MTU Discovery with UDP n Modify router bsdi – return next-hop MTU(ICMP error) 10.0 solaris.37974>slip.discard: udp 650 (DF) (0.0042) bsdi>solaris: icmp : slip unreachable - need to frag, mtu = 296 (DF) (4.9460) solaris >slip.discard: udp 650 (DF) (0.0041) bsdi>solaris: icmp : slip unreachable - need to frag, mtu = 296 (DF) (4.8255) solaris.37974>slip.discard:udp 650 (frag (0.1502) solaris>slip: (frag (0.0602) solaris>slip: (frag source host 가 fragmentation 실행

Computer Network Lab. 30 Interaction Between UDP and ARP n UDP 와 ARP 의 상호작용을 알아본다. n Example l sock 프로그램을 사용해서 8192 byte 를 생성 l Ethernet 상에서 6 개의 fragment 로 나뉘어 질것이다. l 프로그램 실행 전에 ARP cache 가 비어있는지 확인 ä 첫 번째 fragment 가 전송되기 전에 ARP request 와 reply 가 교환되어야 한다 l bsdi % arp -a l bsdi % sock -u -iI -w8192 svr4 discard ä 첫 번째 fragment 는 ARP request 를 전송하도록 유도 ä 나머지 fragment 들은 reply 가 오기전에 전송준비

Computer Network Lab. 31 Interaction Between UDP and ARP n tcpdump output 10.0 arp who-has svr4 tell bsdi (0.0012)arp who-has svr4 tell bsdi (0.0045)arp reply svr4 is-at 0:0:c0:c2:9b: (0.0011)arp reply svr4 is-at 0:0:c0:c2:9b: (0.0012)bsdi>svr4: (frag (0.0041)arp reply svr4 is-at 0:0:c0:c2:9b:26 n reply 가 돌아오기 전에 6 개의 ARP request 가 생성되었다. 이는 6 개의 fragment 는 빠르게 생성이 되었고 각각의 fragment 에 의해서 ARP request 가 생성되었다. n last packet 만이 전송되었다.

Computer Network Lab. 32 Interaction Between UDP and ARP n ICMP error 는 전송되지 않았다. n IP layer 는 반드시 첫번째 fragment 가 도착할 때 timer 를 start 시켜야 한다. l “first” : first arrival fragment, not first fragment n timer 가 종료될 때 까지 해당 datagram 의 모든 fragment 가 도착하지 않았다면, 모든 fragment 들은 discard 될 것이다. l 그렇지 않으면 수신자의 buffer 가 넘치게 되는 결과를 초래할 것 이다. n ICMP error 가 전송되지 않은 이유 l Berkely : timer 가 종료되어, 모든 fragment 를 거부 l other : first fragment 가 도착되지 않았기 때문

Computer Network Lab. 33 Maximum UDP Datagram Size n 이론상, IP datagram 의 최대 크기는 bytes l lenth field : 16 bit -> n UDP datagram 에서 User data 의 최대 크기는 bytes l = IP header(20) - UDP header(8)

Computer Network Lab. 34 ICMP source Quench Error n 처리할 수 없을 정도로 빠르게 datagram 을 받을 때, system(host or router) 에 의해서 생성되기도 한다. l 시스템의 buffer 가 넘쳐서 datagram 을 버릴지라도 “source quench” 의 전송은 반드시 이루어져야 하는 아니다. n Example l bsdi -> sun : Ethernet, sun -> : SLIP l SLIP link = 100 * Ethernet link 이기 때문에 sun 의 버퍼가 쉽게 넘 칠 것이다. l 100 개의 1024-byte datagram 을 전송 : bsdi -> sun -> solaris l bsdi % sock -u -i -w1024 -n 100 solaris discard

Computer Network Lab. 35 ICMP source Quench Error type(4)code(0)checksum Unused (must be 0) IP header(including options) + first 8bytes of original IP dagagram data bytes Figure ICMP source quench error

Computer Network Lab. 36 ICMP source Quench Error n tcpdump output 10.0bsdi.1403 > solaris.discard:udp lines thar we don’t show (0.00)bsdi.1403>solaris.dicard: udp (0.01)sun>bsdi: icmp: source quench (0.00)bsdi.1403>solaris.discard:udp (0.00)sun>bsdi: icmp: source quench 142 lines thar we don’t show (0.06)bsdi.1403>solaris.discard:udp (0.00)sun>bsdi: icmp: source quench

Computer Network Lab. 37 ICMP source Quench Error n 26 개의 datagram 은 에러없이 전송, but 27 번째 datagram 부 터는 전송할 때마다 error 에러를 받는다. n original tcpdump ouptut l 26+(74( 버려진 datagram)*2(line))=174 n 전송 시간 l sun -> solaris(SLIP) : 9600 bits/sec 로 1024byte 전송하는데 걸리는 시간은 1 초 조금 넘게 걸린다. l bsdi->sun(Ethernet) : 100 개의 datagram 이 1 초 이내에 sun 에 도착한 다.( 첫번째 datagram 이 SLIP Link 를 통과하기 전에 )

Computer Network Lab. 38 UDP Server Design n UDP 를 이용하는 서버의 설계 및 구현시 고려사항 l Client IP Address and Port Number l Destination IP Address l UDP Input Queue l Restricting Local IP Address l Restricting Foreign IP Address l Multiple Recipients per Port n 서버의 설계 및 구현은 대개 클라이언트 보다 어렵다. l O/S 와의 interaction, 동시에 여러 클라이언트들을 처리 n Protocol 특성이라는 측면에서 다룬다.

Computer Network Lab. 39 UDP Server Design n Client IP Address and Port Number l 서버에 클라이언트의 UDP datagram 이 도착 äIP header = Source IP Addr. + Destination IP Addr. äUDP header = Source Port Num. + Destication Port Num l 서버의 O/S 는 Source IP Addr. 와 Port Num. 을 통해서, 도착한 메시 지의 발신지를 알 수 있다. l 동시에 여러 클라이언트를 처리가능하게 한다. äSource Addr. 과 Port Num. 을 통해서 각각의 request 에 대한 반복을 가 능하게 한다.

Computer Network Lab. 40 UDP Server Design n Destination IP Address l 몇몇 application 들은 datagram 이 어디로 전송되는지를 알고자 한 다. l Host Requirement RFC äTFTP server 는 반드시 Destination 주소가 broadcast 주소로 된 datagram 은 무시한다. l 이는 O/S 가 수신된 UDP datagram 의 destination IP 주소를 Application 에 넘기도록 요구한다. l 모든 application 이 이 기능을 제공하는 것은 아니다.

Computer Network Lab. 41 UDP Server Design n UDP Input Queue l 필요성 äUDP 서버는 단일 port 를 통해서 모든 클라이언트의 요청을 처리한 다. l 각 UDP port 와 관계된 제한된 크기의 Input queue 가 존재 ä 여러 클라이언트로부터 동시에 도착한 요청들이 자동적으로 UDP 에 의해서 Queue 에 저장된다. l Application 에 Datagram 전달 순서 ä 도착한 순서대로 전달.(FIFO) äQueue Overfolw 가 발생하면, 커널의 UDP module 이 incoming datagram 을 무시한다.

Computer Network Lab. 42 UDP Server Design n example of Input Queue overflow 서버 bsdi bsdi % sock -s -u -v -E -R256 -r256 -P from , to : from sun, to broadcast address from , to : from sun, to broadcast address 클라이언트 sun sun % sock -u -v to Ethernet broadcat address connected on to bytes of data (with newline) bytes of data (with newline) bytes of data (with newline)

Computer Network Lab. 43 UDP Server Design 클라이어트 svr4 svr4 % sock -u -v bsdi 6666 connected on to bytes of data (with newline) bytes of data (with newline) bytes of data (with newline) n tcpdump output 10.0sun.1252 > : UDP (2.4992)svr > bsdi.6666: UDP (2.4600)sun.1252 > : UDP (2.4992)svr > bsdi.6666: UDP (2.4719)sun.1252 > : UDP (2.3369)svr > bsdi.6666: UDP 9

Computer Network Lab. 44 UDP Server Design l Input Queue Overflow 발생시, UDP 는 application 에 알리지 않는다. ä 초과된 datagram 들은 UDP 에 의해서 거절된다. l datagram 이 거절되었다는 것을 클라이언트에게 알리지 않는다. l UDP Input Queue 는 FIFO(first-in, first-out)

Computer Network Lab. 45 UDP Server Design n Restricting Local IP Address l 대부분의 UDP 서버들은 UDP end point 를 생성할때, 자신들의 local IP 주소를 wildcard 로 한다. ä 서버의 port 로 들어오는 UDP datagram 은 어떤 local interface 에서 든 지 받아들여 진다. l Example sun % sock -u -s 7777 sun % netstat -a -n -f inet Active Internet Connections (including sercers) proto Recv-Q Send-Q Local Address Foreign Address(state) udp 0 0 *.7777 *.* flag -a : reports on all network end points, -n : print IP addr. as decimal number -f net : report only TCP and UDP end point

Computer Network Lab. 46 UDP Server Design l 서버가 자신의 end point 를 생성시, end point 에 대한 local IP addr. 로 호스트의 local IP address 중 하나를 명시하는 것이 가능. äif (destination addr. = specified local addr.), incomming datagram 이 end point 에 pass 됨. l Example sun % sock -u -s proto Recv-Q Send-Q Local Address Foreign Address(state) udp 0 0 *.7777 *.* tcpdump output 10.0bsdi.1723 > sun.7777: UDP (0.0008)sun > bsdi: icmp: sun udp port 7777 unreachable

Computer Network Lab. 47 UDP Server Design l 동일한 port 에 다른 local IP addr. 를 갖는 Server ä 대개, 동일한 port 를 재사용한다 라는 것을 Application 에 알려야 한 다. l Example sun % sock -u -s for SLIP link sun % sock -u -s -A for Ethernet sun % sock -u -s -A for loopback interface sun % sock -u -s -A for Ethernet broadcasts sun % sock -u -s -A 8888everything else (wildcard IP address) proto Recv-Q Send-Q Local Address Foreign Address (state) udp 0 0 *.8888 *.* udp *.* udp *.* udp *.* udp *.*

Computer Network Lab. 48 UDP Server Design l Priority äwildcard address 를 갖는 end point 가 있다면, 묵시적인 우선순 위가 존재. ä“destination IP addr. = specific IP addr” 인 종단점은 wildcard 보 다 먼저 선택된다. ämatch 되는 것이 없을 경우에만 wildcard end point 가 이용된다.

Computer Network Lab. 49 UDP Server Design n Restricting Foreign IP Address l 대부분의 implementations 경우, UDP end point 로 하여금 foreign addr. 를 제한. äend point 는 명시한 IP addr. 과 port 로 부터만 datagram 을 수신. l Example sun % sock -u -s -f proto Recv-Q Send-Q Local Address Foreign Address (state) udp

Computer Network Lab. 50 UDP Server Design n Multiple Recipients Per Port l 대부분의 implementation äAn application end point - An local Addr.& port number l Example sun % sock -u -s 9999 sun % sock -u -s 9999 we expect this to fail can’t bind local address: Address Already in use sun % sock -u -s -A 9999 so we try -A flag this time can’t bind local address: Address Already in use

Computer Network Lab. 51 UDP Server Design l multicating 을 지원하는 시스템의 경우 äMultiple end point - same local IP addr & UDP port number 가능 ä 예 ) 4.4BSD 는 multicasting 을 지원 l Multiple end point - same local IP addr & UDP port number ädestination IP addr =broadcast or multicast addr.  incoming datagram 이 각 end point 에 전달됨. ädestination IP addr =broadcast or multicast addr.  incoming datagram 이 하나의 end point 에만 전달됨.

Computer Network Lab. 52 Summary n UDP is a simple protocol. l UDP 가 user process 에 제공하는 서비스는 단지 port number 들과 optional checksum 뿐이다. n ICMP unreachable error 는 new path MTU discovery feature 이다. l Traceroute 와 UDP 를 이용한 path MTU discovery n UDP 와 ARP 간의 interaction l 대부분의 ARP implementation 들은 ARP 응답을 기다리는 동안, 주어진 목적지에 가장 최근에 전송된 datagram 을 보류한다. n ICMP source quech error 는 처리할 수 없을 정도로 빠르게 datagram 을 받을 때 발생할 수 있다. l UDP 를 이용하면, 쉽게 error 를 발생시킬 수 있다.