1 / 25

Term Project Detail Design 2 Traffic Generator

Term Project Detail Design 2 Traffic Generator. 2003-12-1 So Jung LEE Dpnm Lab. CSE POSTECH annie@postech.ac.kr. Contents. Introduction System Requirement Traffic Generator System Overall Architecture XML schema definition for Configuration File Module Design Detail Q & A.

elliston
Download Presentation

Term Project Detail Design 2 Traffic Generator

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. Term Project Detail Design 2Traffic Generator 2003-12-1 So Jung LEE Dpnm Lab. CSE POSTECH annie@postech.ac.kr

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

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

  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. System Requirement (2/2) • Non-Functional Requirements • Consistency • Extensibility • user-friendly한 User Interface

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

  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. XML schema definitionfor configuration file (1/2) • Sample configuration file <flows> <srcIP> <type> set | inc | random </type> <startIP> 141.223.82.152 </startIP> <endIP> 141.223.82.255 </endIP> </srcIP> <dstIP> <type> set | inc | random </type> <startIP> 141.223.82.152 </startIP> <endIP> 141.223.82.255 </endIP> </dstIP> <Protocol> tcp | udp | icmp </Protocol> <srcPort> <type> set | inc | random </type> <startIP> 141.223.82.152 </startIP> <endIP> 141.223.82.255 </endIP> </srcPort> <dstPort> <type> set | inc | random </type> <startIP> 141.223.82.152 </startIP> <endIP> 141.223.82.255 </endIP> </dstPort>

  9. XML schema definitionfor configuration file (2/2) <Options> <icmptype> 3 </icmptype> <icmptcode> 3 </tcmpcode> </Options> <pktLength> <type> set | inc | random </type> <startLength> 60 </startLength> <endLength> 80 </endLength> </pktLength> <pps> 1000 </pps> <period> <type> second | minute | hour | continue| count </type> <second> 5 </second> <minute> 3 </minute> <hour> 4 </hour> <count> 10000 </count> </period> </flows>

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

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

  12. Flooder Module Design1. 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. Flooder Module Design2. 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. Flooder Module Design3. Timer module Flow 구조체 Continue second, minute, hour Signal (SIGINT, end) Timer 구조체 구성 Signal(SIGALRM, end) setitimer() Header module Packet Length module Header module PPS module Packet Length module Send module PPS module Send module 사용자가 Ctral+C 누름 Timer가 종료되어 alarm발생 종료 End() Exit(1)함수 호출 종료

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

  16. Flooder Module Design5. 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. Flooder Module Design5. Header Module (2/4) TCP Header module protocol ICMP TCP UDP TCP Header module UDP Header module ICMP Header module srcIP module srcIP module type module dstIP Module dstIP Module code Module srcPort module srcPort module dstPort module dstPort module

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

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

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

  21. Flooder Module Design6. Packet Length module (2/3) • 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가 달라짐. Flow 구조체 Packet Length (start Length, end Length) Packet Length (start Length, end Length) type, code Packet Length (start Length) Set module Increment Module Random Module Set module ICMP pkt_len module TCP / UDP pkt_len module

  22. Flooder Module Design6. Packet Length module (3/3) • 각 ICMP message 별 bytes 수

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

  24. Flooder Module Design7. PPS module (2 /2) • pps = 1000 이라고 가정 (1초에 1000개의 packet을 보내야 함.) • 1 packet이 1ms안에 보내져야 함. • 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하지 않는다. tc ti time PA, PC

  25. Q & A

More Related