| CS/COE 536 | Reconfigurable System on Chip Design | Lockwood, Fall 2002 |
| Assigned | Wednesday, September 4, 2002 |
| Due Date | Wednesday, September 18, 2002 @ noon originally Tuesday, September 17, 2002 @ 5pm |
| Purpose: | Introduction to the FPX Environment and CAD Synthesis Tools |
| Points | 75 |
The FPX provides simple and fast mechanisms to process cells or packets directly in hardware. By performing all computations in FPGA hardware, cells and packets can be processed at the full line speed of the card [currently 2.4 Gbits/sec].
Your goal in this problem is to implement a simple firewall that filters datagram packets according to the destination IP address. Secondary goals include familiarization with the suite of CAD tools used in FPGA design such as ModelSim for simulation/verification, Simplify for synthesis, and the Xilinx backend tools for place and route and critical path information. If you have not previously used these tools please take the time during this short machine problem to familiarize yourself with these tools and ask questions about their use. A couple hours investigating the tools will save you considerable time in the future. The TA's are available to answer CAD tools problems and may be able to show you aspects of the program to increase your productivity.
This circuit will be implemented as a module on the FPX. It instantiates the Layered Protocol Wrappers, which takes ATM Cells from the RAD and implements the firewall application with IP control signals and TCP/IP payload, and selectively forwards the packet based on the destination IP address. An extension to the machine problem uses CAMs to selectively forward packets based on source IP, destination IP, source port, destination port, and protocol. In this machine problem packets are dropped by setting the TTL field in the header of the packet to zero.
The Layered Protocol Wrappers are used to streamline and simplify the networking functions to process ATM cells, AAL5 frames, IP packets and UDP datagrams directly in hardware. It is a layered design and consists of different processing circuits in each layer. The block diagram of the Layered Protocol Wrappers is shown in Figure 1. At the lowest level, the Cell Processor processes raw ATM cells between network interfaces. At the higher levels, the Frame Processor processes variable length AAL5 frames while the IP Processor processes IP packets. At the user level, the UDP Processor transmits and receives UDP messages. Different layers of abstraction are important for networks because they allow application to be implemented at a level where important details are exposed and irrelevant details are hidden. This way, an application that interacts with IP packets or an application that interacts with UDP messages can equally use the Layered Protocol Wrappers effectively. Similar to the network stack on a PC the wrapper's each level of abstraction maintains state by using headers as shown in Figure 2. Specifically in this problem the IP Header is of interest and the source IP address field of the header.

Figure 1: Block Diagram of the Layered Protocol Wrappers

Figure 2: Protocol header format
Each circuit in the Layered Protocol Wrappers can be used separately. Also, multiple circuits can be connected together to form a high level wrapper. For example, the Frame Wrapper is formed by connecting the Cell Processor and the Frame Processor together; the IP Wrapper is formed by connecting the Frame Wrapper and the IP Processor together; and the UDP Wrapper is formed by connecting the IP Wrapper and the UDP Processor together. For this assignment, the IP Wrapper will be used to encapsulate the data sent and received between the RAD and the simple firewall application. The block diagram of the application module is shown in Figure 3.

Figure 3: Block Diagram of the Application Module
Background: The CAM Filter
Firewalls can decide when to drop packets by comparing the packet header to a range of addresses. Content Addressable Memory (CAM) is one method of implementing a fast, parallel lookup table. In this machine problem you will implement a CAM table lookup by comparing select fields from the packet header (Src IP, Dest IP, Src Port, Dest Port, and Proto) to CAM_VALUE and CAM_MASK pairs, as shown below. If the packet header matches either CAM entries (with a result of all ones), then the packet should be dropped. (Assume that mask bits that are zero are "don't care" bits)

Figure 4: Diagram of the CAM Lookup Circuit
The application will be programmed by UDP control packets, which will be sent to a fixed Destination IP (192.168.30.13) and Port (800). Control packets contain CAM_VALUE and CAM_MASK pairs that you will need to store so that you can dynamically program the lookup table.

Figure 5: UDP Control Packet
Directions:
Table 1: Symbol Key
|
|
|
|
| Of Interest | Modify | Synthesizable |
Table 2: Contents of MP1.tar.gz
|
|
FireWall/sim/ Simulation Folder | ||||||
|
|
/testbench/ | ||||||
|
|
testbench.vhd | The testbench for this FPX module. | |||||
|
|
clock.vhd | The clock for this FPX module. | |||||
|
|
fake_NID_in.vhd | The fake input from the NID | |||||
|
|
fake_NID_out.vhd | The fake output from the NID | |||||
|
|
INPUT_CELLS.DAT | The input files read by the testbench. Modify this file so that the desired data input is being injected into the RAD |
|
||||
|
|
LC_CELLSOUT.DAT | The output files from the ingress. Because the FireWall_module is instantiated at the ingress, the output data is modified by the FireWall_module. Look at this file to check if the FireWall_module is actually blocking unwanted packets. (Only present after running simulation) |
|
||||
|
|
testbench.do | The Modelsim macro files. | |||||
|
|
Makefile | Example make file used to automate compilation and simulation |
|
||||
|
|
FireWall/syn/ Synthesis Folder | ||||||
|
|
/rad-xcv2000e/ | ||||||
|
|
fpx.ucf | The FPGA chip pin constraints file | |||||
|
|
bitgen.ut | The BITGEN option file. | |||||
|
|
build | The backend script for executing the Xilinx backend tools |
|
||||
|
|
*.edn | The EDIF Macro files for synthesis with the Xilinx backend tools. |
|
||||
|
|
wrapper_app.prj | The project files for Synplicity Pro. It tells Synplicity Pro which vhdl files should be included for synthesis. | |||||
|
|
Makefile | Example make file used to automate synthesis | |||||
|
|
FireWall/vhdl/ VHDL Source Folder | ||||||
|
|
FireWall/wrappers/ | ||||||
|
|
cellproc_sim.vhd | The vhdl file for simulating the Cell Processor. | |||||
|
|
frameproc_sim.vhd | The vhdl file for simulating the Frame Processor. | |||||
|
|
ipproc_sim.vhd | The vhdl file for simulating the IP Processor. | |||||
|
|
udpproc_sim.vhd | The vhdl file for simulating the UDP Processor. | |||||
|
|
framewrapper.vhd | The vhdl file for the Frame Wrapper. It instantiates the Cell Processor and the Frame Processor and connects them together. |
|
||||
|
|
ipwrapper.vhd | The vhdl file for the IP Wrapper. It instantiates the Frame Wrapper and the IP Processor and connects them together. |
|
||||
|
|
udpwrapper.vhd | The vhdl file for the UDP Wrapper. It instantiates the IP Wrapper and the UDP Processor and connects them together. |
|
||||
|
|
/rad_loopback/ The Rad_Loopback Package Folder | ||||||
|
|
blink.vhd | he vhdl file for the blink component. It controls the blinking of the LED on the FPX. |
|
||||
|
|
loopback_module.vhd | The vhdl file for the loopback_module that is instantiated by the rad_loopback_core |
|
||||
|
|
rad_loopback_core.vhd | The vhdl file for the rad_loopback_core component. It instantiates the wrapper_module at the ingress and the loopback_module at the egress. |
|
||||
|
|
rad_loopback.vhd | The vhdl file for the top-level design of the rad_loopback. |
|
||||
|
|
wrapper_app.vhd | The vhdl file for the FireWall. Modify this file to selectively pass packets based on IP source address.. |
|
|
|
||
|
|
wrapper_module.vhd | The vhdl file for the FireWall_module. |
|
||||
Things to Turn In:
Here is a checklist of the things you need to turn in: