Presentation is loading. Please wait.

Presentation is loading. Please wait.

Term Project Detail Design 2 Traffic Generator 2003-12-1 So Jung LEE Dpnm Lab. CSE POSTECH

Similar presentations


Presentation on theme: "Term Project Detail Design 2 Traffic Generator 2003-12-1 So Jung LEE Dpnm Lab. CSE POSTECH"— Presentation transcript:

1 Term Project Detail Design 2 Traffic Generator 2003-12-1 So Jung LEE Dpnm Lab. CSE POSTECH annie@postech.ac.kr

2 2 Contents Introduction System Requirement Traffic Generator System Overall Architecture XML schema definition for Configuration File Module Design Detail Q & A

3 3 Introduction Motivation 현재 dpnm lab. 에서 개발 중인 NG-MON 과 NSAA 에 대한 performance test. Goal 원하는 Application traffic 에 대하여 type 과 bandwidth 를 정하여 packet 들을 보냄으로써 network 상에 traffic 을 generate 하는 것.

4 4 System Requirement (1/2) Functional Requirements 구현할 Protocol 은 IP, TCP, UDP, ICMP 의 네 가지이다. 사용자는 원하는 protocol 내에 있는 header field 값을 직접 정할 수 있어야 한다. 사용자는 bandwidth 는 직접 정할 수 있어야 한다. header field 값과 bandwidth 에 대해 set/increment / random option 을 설정할 수 있다. 사용자는 보내고자 하는 총 packet 의 갯수를 조절할 수 있어야 한다. 사용자는 traffic 을 generate 하여 보내는 시간 (period) 을 조 절 할 수 있어야 한다.

5 5 System Requirement (2/2) Non-Functional Requirements Consistency Extensibility user-friendly 한 User Interface

6 6 Traffic Generator System Overall Architecture CLI (Command Line Interface) Configuration File Flow specification Configuration file Flooder Xml File Parser Traffic Generator

7 7 각각의 Module 설명 Configuration file 사용자는 CLI 를 통해 정의된 XML schema 에 따라 직접 generate 하고자 하는 flow 에 대한 구성 정보들을 저장. Configuration file 을 xml schema 로 정의하는 이유 - 사용자가 한눈에 알아볼 수 있음. - xml tag 의 내용만 숙지하면 쉽게 사용할 수 있음. Traffic generator Xml file parser - xml file 을 parsing 하여 원하는 값들을 가져와 flow 구성을 정의함. Flooder - 정의된 flow 구성에 따라 flow 들을 생성하여 소켓을 통해 보냄.

8 8 XML schema definition for configuration file (1/2) Sample configuration file set | inc | random 141.223.82.152 141.223.82.255 set | inc | random 141.223.82.152 141.223.82.255 tcp | udp | icmp set | inc | random 141.223.82.152 141.223.82.255 set | inc | random 141.223.82.152 141.223.82.255

9 9 XML schema definition for configuration file (2/2) 3 set | inc | random 60 80 1000 second | minute | hour | continue| count 5 3 4 10000

10 10 Flooder Module Design Client Sockaddr_in 구성 Flow 구조체 선언 Packet count module PPS module Send module Sock 개설 close 서버의 IP 주소와 Port 번호 Packet 을 보냄 Timer module Packet 구조체 선언 Header module Packet Length module period Second Minute, Hour, continue count

11 11 Flooder Module Design 1. Flow 구조체 (1/2) Xml File Parser module Flow 구조체 Flow specification TCP Packet 구조체 Protocol UDP Packet 구조체 ICMP Packet 구조체 TCP UDP ICMP

12 12 Flooder Module Design 1. Flow 구조체 (2/2) Flow 구조체 생성 Protocol Source IP ( type, start IP, end IP ) Destination IP ( type, start IP, end IP ) Source Port ( type, start Port, end Port ) Destination Port ( type, start Port, end Port ) Packet Length ( type, start Length, end Length) PPS Options ( icmp type, icmp code, ttl, tcp flag ) Period ( second, minute, hour, packet count )

13 13 Flooder Module Design 2. Packet 구조체 Packet 구조체 생성 TCP Packet - IP header (source IP, destination IP) - TCP header (source Port, destination Port) - payload UDP Packet - IP header (source IP, destination IP) - UDP header (source Port, destination Port) - payload ICMP Packet - IP header (source IP, destination IP) - ICMP message (type, code)

14 14 Flooder Module Design 3. Timer module Timer 구조체 구성 Signal(SIGALRM, end) setitimer() Flow 구조체 PPS module Send module Header module Packet Length module End() Timer 가 종료되어 alarm 발생 Exit(1) 함수 호출 Signal (SIGINT, end) second, minute, hour Continue PPS module Send module Header module Packet Length module 사용자가 Ctral+C 누름 종료

15 15 Flooder Module Design 4. Packet count module packet count=0 PPS module Send module Header module Packet Length module Packet count++ Packet Count = count End() Exit(1) 로 프로그램을 종료시킴 yes no Flow 구조체 count

16 16 Flooder Module Design 5. Header Module (1/4) 각 Header field 에 3 option 을 적용하는 rule Set Source IP, Destination IP, Source Port, Destination Port, Protocol, Packet Size, pps, timer, packet count, options 에 모두 적용 Increment Source IP, Destination IP, Source Port, Destination Port, Packet Length 들에만 적용 Random Source IP, Destination IP, Source Port, Destination Port, Packet Length 들에만 적용

17 17 Flooder Module Design 5. Header Module (2/4) TCP Header module TCP Header module srcIP module dstIP Module protocol UDP Header module ICMP Header module type module code Module TCP UDP ICMP srcPort module dstPort module srcIP module dstIP Module srcPort module dstPort module

18 18 Flooder Module Design 5. Header Module (3/4) Flow 구조체 TCP / UDP srcIP module Set moduleIncrement ModuleRandom Module TCP / UDP srcPort module Set module Increment Module Random Module TCP / UDP dstIP module Set moduleIncrement ModuleRandom Module Set module Increment Module Random Module TCP/UDP dstPort module startIP startIP, endIP startIP, endIP startPort, endPort startPort, endPort startPort, endPort startPort, endPort startIP, endIP startIP, endIP startPort startIP

19 19 Flooder Module Design 5. Header Module (4/4) Flow 구조체 Set module ICMP type module ICMP code module Icmp type Icmp code

20 20 Flooder Module Design 6. Packet Length module (1/3) TCP Packet Length module TCP pkt_len module Set module Increment Module Random Module protocol UDP pkt_len module Set module Increment Module Random Module ICMP pkt_len module Set module TCP UDPICMP

21 21 Flooder Module Design 6. Packet Length module (2/3) TCP / UDP pkt_len module Set module Increment Module Random Module Flow 구조체 Packet Length (start Length) Packet Length (start Length, end Length) Packet Length (start Length, end Length) TCP 와 UDP 는 packet 구조체에서 payload 값을 변화시킴. TCP packet Length = IP header(20)+ TCP header(20) + payload UDP packet Length = IP header(20)+ UDP header(8) + payload ICMP 의 경우 type 과 code 에 따른 format 이 정해져 있음. ICMP packet Length = IP header(20)+ ICMP message ICMP message 종류에 따라 packet Length 가 달라짐. Set module ICMP pkt_len module type, code

22 22 Flooder Module Design 6. Packet Length module (3/3) typecodedescriptionbyte 00Echo reply (ping)64 30-15Destination unreachable36 40Source quench36 50-3Redirect36 80Echo request (ping)64 110Time exceeded36 13-140Timestamp request/ reply20 17-180Address mask request/ response12 300-1Traceroute20 370Domain Name request8 각 ICMP message 별 bytes 수

23 23 Flooder Module Design 7. PPS module (1/2) Flow 구조체 PPS (packet per second) 값 Set module PPS module

24 24 Flooder Module Design 7. PPS module (2/2) ti: 처음 packet 을 보낸 시간 tc: 현재 시간 PA: (tc-ti) 의 시간 동안 받아야 하는 이상적인 packet 의 개수. (packet 들이 대체적으로 1ms 안에 보내졌다고 가정한 경우 ) PC: (tc-ti) 의 시간 동안 보낸 실질적인 packet 의 개수. 한 packet 을 보낼 때마다 PA 와 PC 값을 비교하여 nanosleep time 을 다르게 적용. (case 1) PC = PA 일 경우 : 1ms 만큼 sleep 한다. (case 2) PC > PA 일 경우 : PC 의 packet 을 보내기 위해 이상적으로 도착할 시 까지 sleep 하고 1ms 만큼 더 sleep. (case 3) PC < PA 일 경우 : sleep 하지 않는다. ti tc PA, PC pps = 1000 이라고 가정 (1 초에 1000 개의 packet 을 보내야 함.) 1 packet 이 1ms 안에 보내져야 함. time

25 25 Q & A


Download ppt "Term Project Detail Design 2 Traffic Generator 2003-12-1 So Jung LEE Dpnm Lab. CSE POSTECH"

Similar presentations


Ads by Google