* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Final Presentation - High Speed Digital Systems Laboratory
Survey
Document related concepts
Airborne Networking wikipedia , lookup
Network tap wikipedia , lookup
Computer network wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Distributed firewall wikipedia , lookup
Internet protocol suite wikipedia , lookup
Point-to-Point Protocol over Ethernet wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Asynchronous Transfer Mode wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
TCP congestion control wikipedia , lookup
Serial digital interface wikipedia , lookup
Real-Time Messaging Protocol wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Packet switching wikipedia , lookup
Transcript
Network Packet Generator Final Presentation Presenting: Igor Brevdo Eugeney Ryzhyk, Supervisor: Mony Orbach 1 Agenda • Introduction • Packet generator role in networking • Packet Generator in details • Usage of Packet Generator • Results 2 Project goals • Building network packet generator (using ML310 board and Linux OS as a platform). • Allow customization and fine-tuning of the various packet generation parameters at different network stack layers (Ethernet frame, IP packet, TCP/UDP packet) 3 Agenda • Introduction • Packet generator role in networking • Packet Generator in details • Usage of Packet Generator • Results 4 The use of packet generator in networking (1) • Test resistance and durability of networks connecting/serving devices as routers, servers or switches – Are some sort of packets get lost in particular device ? – What is the maximum rate of packets per second that a specific router can route ? – What is maximum open connections a target server can handle ? 5 The use of packet generator in networking (2) • Physical device transmitting capability – • • Test the maximum speed of physical networking card attached to system Creation of artificial packet saturation in particular network Test firewall for penetrability (port scan) 6 General approach to solution (1) • On one hand, freedom of OS constraints such as – – – – Will not use OS TCP/IP stack Eliminate context switches Complete freedom in packet crafting Talking to network device directly • On other hand, exploit the full advantages of running within OS – Use running environment – Use networking services and data structures 7 General approach to solution (2) • As in our case the OS is Linux, the self evident solution is use a kernel loadable modules mechanism • That way the kernel networking stack is not forced but offered to our use (skb buffers, netdevice structure) • Running in kernel mode – no context switches and system calls overpays • Direct access to network card • Accurate timing measurement • On fly inserting to running kernel 8 General approach to solution (3) • Disadvantages to this approach – Various libraries are not provided when running kernel code – not even C standard library. Only kernel API can be used – The debugging is tricky: no debugger for kernel, only special printk() function – How to tell kernel module what we want? 9 Project requirements (1) A Packet Generator should be able to craft standard networking packets of type UDP, TCP, IP, Ethernet Full control over UDP and TCP ports should be provided to user of Packet Generator Full control over IP addresses should be provided to user of Packet Generator UDP and TCP and IP checksums must be calculated and set in packets headers A user should be able to insert a data in packets which can allow faster packet recognition Ethernet header IP header TCP header Data 10 Project requirements (2) Provide a way to configure a stream of packets of particular protocol type when both IP addresses and UDP/TCP addresses limits are set by user. Packet Generator will provide for user configuration number of packets in stream, the desired rate (speed) of packets network device to use for transmitting. Easy to use and detailed user interface which runs on PC will be provided to configure Packet Generator tasks 11 Development Environment (1) Xilinx ML310 Two PowerPC 405 cores 256 MB DDR Onboard 10/100 Ethernet NIC Standard output through COM serial connection (on RS-232 cable) Sansa Flash as storage device Cross LAN network cable Linux with kernel 2.4.20 Bash shell 12 Development Environment (2) Monta Vista development environment Cross compilation for PPC 405 Linux tools on Windows like bash, make and gcc Linux kernel sources – must be used to compile the kernel module Microsoft Visual studio – developing Packet Generator GUI and COM serial communicator Ethereal Network sniffer – great (and free) tool for receiving and checking the packet streams Putty – free program for serial communication with the target while debugging 13 Agenda • Introduction • Packet generator role in networking • Packet Generator in details • Usage of Packet Generator • Results 14 Implementation: GUI agent on PC Written in MFC Provides an easy interface for scenario configuration Presents the results output Serial communicatio n with target 15 Implementation: user-mode agent on ML310 16 Implementation: kernel-mode part of Packet Generator Implemented as kernel loadable module Communicates with user mode through /proc file system Uses SK buffers to build networks packets Activates NIC directly through net device interface 17 Communicating with kernel through /proc file system in-memory file system used to provide file based communication with the kernel. o Any kernel component that wants to communicate with the user can create a file under the proc and that can be used to exchange data Common operations like reading from or writing to file are accessible to all user processes. All the files under the proc file system reside in memory. 18 Building the packets with help of SK buffers (1) • "SKB" is the most fundamental data structure in the Linux networking code. – Every packet sent or received is handled using this data structure. • Skbuffers are held within list data structure 19 Building the packets with help of SK buffers (2) • Four pointers that responsible for data handling inside sk buffer • Functions that manipulate these pointers are in heavy use by packet engine and are participate in building of every packet, 20 Implementation: kernel-mode part of Packet Generator 21 Agenda • Introduction • Packet generator role in networking • Packet Generator in details • Usage of Packet Generator • Results 22 Usage of Packet Generator (1) • Step 0: Set up ml310 board (power, memory, network connection, serial COM connection) • Step 1: Run Packet Generator GUI from the pc and turn on board’s power supply. 23 Usage of Packet Generator: starting serial connection • Step 2: Invoke serial connection – Connect/Disconnect will establish serial connection to board and also will start kernel booting and Linux OS will load. 24 Usage of Packet Generator: Module initialization • Step 3: Inserting module and initialization – Pressing Init Generator button will insert Packet Generator module into running kernel and bring up the network card 25 Scenario configuration • Step 4: Configure the scenario – choose transport layer protocol type TCP or UDP – Choose minimum and maximum ports numbers (destination and source) – Choose minimum and maximum IP addresses (destination and source) 26 Scenario configuration • Step 4(continued): Scenario configuration – Choose MAC layer addresses, destination and source – Insert the data of the generated packets – General configurations. • network device to use • number of packets to generate • a time gap between every two packets • Randomization flags: random transportation ports, random IP addresses. 27 Running the scenario • Step 5: Run the scenario • Start ethereal sniffer on destination machine and press start to begin the generation and sending process. • When the scenario will stop running the packet generator will print it’s performance results: – Time to do the job consisting of idle and working time – Packets length in [Bytes] – Sending rate in [packets/second] – Speed of sending in [bytes/second] 28 Inspecting the results 29 Another example (TCP packet) • Here is another example • TCP protocol is chosen • the increment of IP addresses can be seen. 30 Another example (cont) 31 Agenda • Introduction • Packet generator role in networking • Packet Generator in details • Usage of Packet Generator • Results 32 Results (1) • Time unit for sending one packet consists of: SK buffer allocation Population of buffer by packet’s data, including adjustment of header fields. (work time) Waiting for device and sending it through device or if device is busy going to next iteration (work time) Checking whether process rescheduling is needed (goes to idle time) Waiting inter packet gap time it done by user (goes to idle time) 33 Results: Transmitting rate as function of packets number Sending rate (small packets) 12000000 bits per second 10000000 8000000 length 70 B 6000000 10 Mb per second 4000000 2000000 0 10 100 1000 10,000 100,000 1,000,000 number of packets 34 Results: Controlling the speed by artificial gaps between packets Accuracy of artificial rate setting 60,000,000 Bits per second 50,000,000 40,000,000 Measured rate 30,000,000 Ideal rate 20,000,000 10,000,000 0 10,000 100,000 1,000,000 Gap between packet [nsec] 35 Improvements and expansions o Trying the alternative to communication with kernel module through it’s own API and not by /proc files. o Use of skb clones to utilize the sending speed of the packets o Rewrite the packet generator for current kernel (2.6.X) o Usage of packet generator with specially designed devices o Usage of packet generator in large networks o Usage of packet generator in high speed networks 36 Bibliography • TCP/IP Illustrated Volume 1 – The Protocols, Richard Stevens • Linux Device Drivers, 2nd edition – Alessandro Rubini, Jonathan Corbet • Linux Kernel Sources (version 2.4) • Linux Kernel Modules Programming Guide • • Transmission Control Protocol, RFC 793 http://tools.ietf.org/html/rfc793 • • Proc file system guide http://www.geocities.com/ravikiran_uvs/articles/proc.html • • How SKB work http://vger.kernel.org/~davem/skb_data.html 37