NetFPGA Cambridge Workshop 15-16 Sep 2008 1 Day 2: NetFPGA Cambridge Workshop Module Development and Testing Presented by: Andrew W. Moore and David Miller.

Slides:



Advertisements
Similar presentations
Getting ready for day 2 Yesterday’s tree was moved to NetFPGA-10G-live-BACKUP-Day1/ IF you edited code cp NetFPGA-10G-live-BACKUP-Day1/projects/crypto_nic/hw/
Advertisements

Network II.5 simulator ..
IP Router Architectures. Outline Basic IP Router Functionalities IP Router Architectures.
Michaelmas 2009Building an Internet Router (P33)Handout 1 1 Building an Internet Router (P33) Handout 1: What’s a router? Class project and logistics Dr.
Simulation executable (simv)
P4 demo: a basic L2/L3 switch in 170 LOC
IP Forwarding Relates to Lab 3.
Discussion Monday ( ). ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live.
NetFPGA Project: 4-Port Layer 2/3 Switch Ankur Singla Gene Juknevicius
Berlin – November 10th, 2011 NetFPGA Programmable Networking for High-Speed Network Prototypes, Research and Teaching Presented by: Andrew W. Moore (University.
ECE Department: University of Massachusetts, Amherst ECE 354 Lab 3: Transmitting and Receiving Ethernet Packets.
An Overview of Software-Defined Network Presenter: Xitao Wen.
Lab 4: Simple Router CS144 Lab 4 Screencast May 2, 2008 Ben Nham Based on slides by Clay Collier and Martin Casado.
1 CS 577 “TinySec: A Link Layer Security Architecture for Wireless Sensor Networks” Chris Karlof, Naveen Sastry, David Wagner UC Berkeley Summary presented.
Introduction to Management Information Systems Chapter 5 Data Communications and Internet Technology HTM 304 Fall 07.
Project: Evaluating SNMP Application Level Gateway (SNMP ALG) Eyal Kessler Alexander Shifrin Dmitri Gorbenko
Altera’s Quartus II Installation, usage and tutorials Gopi Tummala Lab/Office Hours : Friday 2:00 PM to.
Chapter 3 Review of Protocols And Packet Formats
An Overview of Software-Defined Network
Foundation and XACTstepTM Software
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
CS 838: NetFPGA Tutorial Theophilus Benson.
An Overview of Software-Defined Network Presenter: Xitao Wen.
1 Lab 3 Transport Layer T.A. Youngjoo Han. 2 Transport Layer  Providing logical communication b/w application processes running on different hosts 
QualNet 2014/05/ 尉遲仲涵. Outline Directory Structure QualNet Basic Message & Event QualNet simulation architecture Protocol Model Programming.
Aug 20 th, 2002 Sigcomm Education Workshop 1 Teaching tools for a network infrastructure teaching lab The Virtual Router and NetFPGA Sigcomm Education.
Paper Review Building a Robust Software-based Router Using Network Processors.
NetFPGA: Reusable Router Architecture for Experimental Research Jad Naous, Glen Gibb, Sara Bolouki, and Nick Presented.
Crete Tutorial – September 16-17, NetFPGA Workshop Day 2 Presented by: Hosted by: Manolis Katevenis at FORTH, Crete September , 2010
G64INC Introduction to Network Communications Ho Sooi Hock Internet Protocol.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Hands-on Training – June 18-19, NetFPGA Hands-on Training Day 2 Presented by: Adam Covington (Stanford University) Indiana University, Bloomington.
NetFPGA Tsinghua Tutorial May S T A N F O R D U N I V E R S I T Y NetFPGA Tutorial Tsinghua University – Day 2 Presented by: James Hongyi.
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
Hands-on Training – June 18-19, NetFPGA Hands-on Training Day 1 Presented by: Adam Covington (Stanford University) Indiana University, Bloomington.
NetFPGA Cambridge Spring School Mar Day 2: NetFPGA Cambridge Spring School Module Development and Testing Presented by: Andrew W. Moore and.
The Layered Protocol Wrappers 1 Florian Braun, Henry Fu The Layered Protocol Wrappers: A Solution to Streamline Networking Functions to Process ATM Cells,
IP Forwarding.
Applied research laboratory David E. Taylor Users Guide: Fast IP Lookup (FIPL) in the FPX Gigabit Kits Workshop 1/2002.
Client – Server Application Can you create a client server application: The server will be running as a service: does not have a GUI The server will run.
ECE 526 – Network Processing Systems Design Networking: protocols and packet format Chapter 3: D. E. Comer Fall 2008.
CS/CoE 536 : Lockwood 1 CS/CoE 536 Reconfigurable System On Chip Design Lecture 4 : Demonstration of Machine Problem 1 : CAM-based Firewall Washington.
1 - Charlie Wiseman - 05/11/07 Design Review: XScale Charlie Wiseman ONL NP Router.
802.11n Sniffer Design Overview Vladislav Mordohovich Igor Shtarev Luba Brouk.
The FPX KCPSM Module Exercise 1 Henry Fu The FPX KCPSM Module Exercise: Network Data Encryption / Decryption Using ROT13 Algorithm Henry Fu Washington.
Fall 08, Oct 31ELEC Lecture 8 (Updated) 1 Lecture 8: Design, Simulation Synthesis and Test Tools ELEC 2200: Digital Logic Circuits Nitin Yogi
Michael Wilson Block Design Review: Line Card Key Extract (Ingress and Egress)
4/19/20021 TCPSplitter: A Reconfigurable Hardware Based TCP Flow Monitor David V. Schuehler.
Final Presentation Implementation of DSP Algorithm on SoC Student : Einat Tevel Supervisor : Isaschar Walter Accompanying engineer : Emilia Burlak The.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
1 CSE 5346 Spring Network Simulator Project.
Packet Switch Architectures The following are (sometimes modified and rearranged slides) from an ACM Sigcomm 99 Tutorial by Nick McKeown and Balaji Prabhakar,
THE A-TEAM MATHIVATHANI BARATHI MOHAN DINESH UDAYAKUMAR BHARGAV BHAT BHASKAR.
David M. Zar Block Design Review: PlanetLab Line Card Header Format.
Graciela Perera Department of Computer Science and Information Systems Slide 1 of 18 INTRODUCTION NETWORKING CONCEPTS AND ADMINISTRATION CSIS 3723 Graciela.
InterVLAN Routing 1. InterVLAN Routing 2. Multilayer Switching.
Layered Architectures
Reference Router on NetFPGA 1G
IP Forwarding Relates to Lab 3.
Washington University
An NP-Based Router for the Open Network Lab Overview by JST
IP Forwarding Relates to Lab 3.
After the Spring School…
Implementing an OpenFlow Switch on the NetFPGA platform
Networking and Network Protocols (Part2)
IP Forwarding Relates to Lab 3.
Reference Router on NetFPGA 1G
ITIS 6167/8167: Network and Information Security
NetFPGA - an open network development platform
Chapter 4: outline 4.1 Overview of Network layer data plane
Presentation transcript:

NetFPGA Cambridge Workshop Sep Day 2: NetFPGA Cambridge Workshop Module Development and Testing Presented by: Andrew W. Moore and David Miller (University of Cambridge) Martin Žádník (Brno University of Technology) Cambridge UK September 15-16, Based on original slides by Glen Gibb and G. Adam Covington – thanks!

NetFPGA Cambridge Workshop Sep Outline Tree Structure Develop a cryptography module –Quick overview of XOR “cryptography” –Implement crypto module –Write software simulations –Synthesize –Write hardware tests

NetFPGA Cambridge Workshop Sep Tree Structure NF2 bin lib projects bitfiles (scripts for running simulations and setting up the environment) (contains the bitfiles for all projects that have been synthesized) (stable common modules and common parts needed for simulation/synthesis/design) (user projects, including reference designs)

NetFPGA Cambridge Workshop Sep Tree Structure (2) lib C java Makefiles Perl5 python scripts verilog (common software and code for reference designs) (contains software for the graphical user interface) (makefiles for simulation and synthesis) (common libraries to interact with reference designs and aid in simulation) (common libraries to aid in regression tests) (scripts for common functions) (modules and files that can be reused for design)

NetFPGA Cambridge Workshop Sep Tree Structure (3) projects doc include regress src sw synth verif (project specific documentation) (contains file to include verilog modules from lib, and creates project specific register defines files) (regression tests used to test generated bitfiles) (contains non-library verilog code used for synthesis and simulation) (all software parts of the project) (contains user.xco files to generate cores and Makefile to implement the design) (simulation tests)

NetFPGA Cambridge Workshop Sep Cryptography Simple cryptography – XOR ABA ^ B

NetFPGA Cambridge Workshop Sep Cryptography (cont.) Example: Explanation: –A ^ A = 0 –So, M ^ K ^ K = M ^ 0 = M Message: Key: Message ^ Key: Message ^ Key ^ Key:

NetFPGA Cambridge Workshop Sep Implementing a Crypto Module (1) What do we want to encrypt? –IP payload only Plaintext IP header allows routing Content is hidden –Encrypt bytes 35 onward Bytes 1-14 – Ethernet header Bytes – IPv4 header (assume no options) –Assume all packets are IPv4 for simplicity

NetFPGA Cambridge Workshop Sep Implementing a Crypto Module (2) State machine (draw on next page): –Module headers on each packet –Datapath 64-bits wide 34 / 8 is not an integer!  Inside the crypto module

NetFPGA Cambridge Workshop Sep Crypto Module State Diagram Hint: We suggest 4 states (or 3 if you’re feeling adventurous) Skip Module Headers

NetFPGA Cambridge Workshop Sep State Diagram to Verilog (1) Module location 1.Crypto module to encrypt and decrypt packets MAC RxQ MAC RxQ CPU RxQ CPU RxQ MAC RxQ MAC RxQ CPU RxQ CPU RxQ MAC RxQ MAC RxQ CPU RxQ CPU RxQ MAC RxQ MAC RxQ CPU RxQ CPU RxQ Input Arbiter Output Port Lookup MAC TxQ MAC TxQ CPU TxQ CPU TxQ MAC TxQ MAC TxQ CPU TxQ CPU TxQ MAC TxQ MAC TxQ CPU TxQ CPU TxQ MAC TxQ MAC TxQ CPU TxQ CPU TxQ Output Queues Crypto

NetFPGA Cambridge Workshop Sep Inter-module Communication data ctrl wr rdy

NetFPGA Cambridge Workshop Sep State Diagram to Verilog (2) Projects: –Each design represented by a project Format: NF2/projects/ –NF2/projects/crypto_nic –Consists of: –Missing: Verilog source Simulation tests Hardware tests Libraries Optional software State diagram implementation Simulation tests Regression tests

NetFPGA Cambridge Workshop Sep State Diagram to Verilog (3) Projects (cont): –Pull in modules from NF2/lib/verilog Generic modules that are re-used in multiple projects Specify shared modules in project’s include/lib_modules.txt –Local src modules override shared modules –crypto_nic: Local user_data_path.v, crypto.v Everything else: shared modules

NetFPGA Cambridge Workshop Sep State Diagram to Verilog (4) Your task: 1.Copy NF2/lib/verilog/module_template/src/module_template.v to NF2/projects/crypto_nic/src/crypto.v 2.Implement your state diagram in src/crypto.v –Small fallthrough FIFO –Generic register interface –Registers to be used defined in include/crypto_defines.v

NetFPGA Cambridge Workshop Sep Generic Registers Module generic_regs # (.UDP_REG_SRC_WIDTH (UDP_REG_SRC_WIDTH),.TAG (`CRYPTO_BLOCK_TAG),.REG_ADDR_WIDTH (`CRYPTO_REG_ADDR_WIDTH),.NUM_COUNTERS (0),.NUM_SOFTWARE_REGS (1),.NUM_HARDWARE_REGS (0)) crypto_regs (.reg_req_in (reg_req_in), ….reg_src_out (reg_src_out), ….software_regs (key),.hardware_regs (), …

NetFPGA Cambridge Workshop Sep Testing: Simulation (1) Simulation allows testing without requiring lengthy synthesis process NetFPGA provides Perl simulation infrastructure to: –Send/receive packets Physical ports and CPU –Read/write registers –Verify results Simulations run in ModelSim/VCS

NetFPGA Cambridge Workshop Sep Testing: Simulation (2) Simulations located in project/verif Multiple simulations per project –Test different features Example: –crypto_nic/verif/test_nic_short Send one packet from CPU, expect packet out physical port Send one packet in physical port, expect packet to CPU

NetFPGA Cambridge Workshop Sep Testing: Simulation (3) Useful functions: –nf_PCI_read32(delay, batch, addr, expect) –nf_PCI_write32(delay, batch, addr, value) –nf_packet_in(port, length, delay, batch, pkt) –nf_expected_packet(port, length, pkt) –nf_dma_data_in(length, delay, port, pkt) –nf_expected_dma_data(port, length, pkt) –make_IP_pkt(length, da, sa, ttl, dst_ip, src_ip) –encrypt_pkt(key, pkt) –decrypt_pkt(key, pkt)

NetFPGA Cambridge Workshop Sep Testing: Simulation (4) Your task: 1.Template files NF2/projects/crypto_nic/verif/test_crypto_encrypt/make_pkts.pl NF2/projects/crypto_nic/verif/test_crypto_decrypt/make_pkts.pl 2.Implement your Perl verif tests –Use the example verif test (test_nic_short )

NetFPGA Cambridge Workshop Sep Running Simulations Use command nf21_run_test.pl –Optional parameters --major --minor --gui (starts the default viewing environment) test_crypto_encrypt Set env. variables to reference your project NF2_DESIGN_DIR=/root/NF2/projects/ PERL5LIB=/root/NF2/projects/ /lib/Perl5: /root/NF2/lib/Perl5: majorminor

NetFPGA Cambridge Workshop Sep Running Simulations When running modelsim interactively: –Click "no" when simulator prompts to finish –Changes to code can be recompiled without quitting ModelSim: bash# cd /tmp/$(whoami)/verif/ ; make model_sim VSIM 5> restart -f; run -a –Do ensure $NF2_DESIGN_DIR is correct

NetFPGA Cambridge Workshop Sep Synthesis To synthesize your project –Run make in the synth directory (NF2/projects/crypto_nic/synth)

NetFPGA Cambridge Workshop Sep Regression Tests Test hardware module Perl Infrastructure provided to –Read/Write registers –Read/Write tables –Send Packets –Check Counters

NetFPGA Cambridge Workshop Sep Example Regression Tests Reference Router –Send Packets from CPU –Longest Prefix Matching –Longest Prefix Matching Misses –Packets dropped when queues overflow –Receiving Packets with IP TTL <= 1 –Receiving Packets with IP options or non IPv4 –Packet Forwarding –Dropping packets with bad IP Checksum

NetFPGA Cambridge Workshop Sep Perl Libraries Specify the Interfaces –eth1, eth2, nf2c0 … nf2c3 Start packet capture on Interfaces Create Packets –MAC header –IP header –PDU Read/Write Registers Read/Write Reference Router tables –Longest Prefix Match –ARP –Destination IP Filter

NetFPGA Cambridge Workshop Sep Regression Test Examples Reference Router –Packet Forwarding regress/test_packet_forwarding –Longest Prefix Match regress/test_lpm –Send and Receive regress/test_send_rec

NetFPGA Cambridge Workshop Sep Creating a Regression Test Useful functions: –nftest_regwrite(interface, addr, value) –nftest_regread(interface, addr) –nftest_send(interface, frame) –nftest_expect(interface, frame) –encrypt_pkt(key, pkt) –decrypt_pkt(key, pkt) –$pkt = NF2::IP_pkt->new(len => $length, DA => $DA, SA => $SA, ttl => $TTL, dst_ip => $dst_ip, src_ip => $src_ip);

NetFPGA Cambridge Workshop Sep Creating a Regression Test (2) Your task: 1.Template files NF2/projects/crypto_nic/regress/test_crypto_encrypt/run 2.Implement your Perl verif tests

NetFPGA Cambridge Workshop Sep Running Regression Test Run the command nf21_regress_test.pl --project crypto_nic

NetFPGA Cambridge Workshop Sep Visit

NetFPGA Cambridge Workshop Sep Join the NetFPGA.org Community Log into the Wiki Access the Beta code Join the netfpga-beta mailing list Join the discussion forum

NetFPGA Cambridge Workshop Sep Contribute to the Project Search for related work List your project on the Wiki Link your project homepage

NetFPGA Cambridge Workshop Sep Survey How did you like this this tutorial? –What did you find useful? –What should be improved? –What should be removed? –What should be added? Can we post the video from this event? –If not, please let us know. Complete On-line survey –

NetFPGA Cambridge Workshop Sep Special thanks to: Other NetFPGA Tutorial Presented At: SIGMETRICS Patrick Lysaght, Veena Kumar, Paul Hartke, Anna Acevedo Xilinx University Program (XUP) See:

NetFPGA Cambridge Workshop Sep Acknowledgments Support for the NetFPGA project has been provided by the following companies and institutions Disclaimer: Any opinions, findings, conclusions, or recommendations expressed in these materials do not necessarily reflect the views of the National Science Foundation or of any other sponsors supporting this project.