Skip to content

amir-FM/parallel_firewall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parallel_Firewall

An application that simulates a firewall and checks packets with filters, deciding whether to allow the packet to continue to its destination or not. The model is using the producer --- consumer scenario.

Technical Details

In our case, the packets are provided in a binary file and inserted by the producer in a circular buffer, from where the consumers take and process them. The consumers are notified by a semaphore each time the producer has put an item in the buffer. After the processing, is done the packets are inserted in order of their timestamp in an output file.

Response Sorting

The sorting is done by using a barrier to wait for all threads to finish processing. Next, each thread inserts its packet in a min-heap and waits at another barrier (to make sure all the threads have introduced their respective packet), after which each extracts a packet from the min-heap and puts it in the output file.

Installation and Running

# Installation
git clone https://github.com/amir-FM/parallel_firewall [installation directory]
cd [installation directory]/src
make

# Generating packets
cd [installation directory]/tests
./gen_packets.py generate [filename] [count]

# Running
cd [installation directory]/src
./firewall [input-file] [output-file] [num-consumers:1-32]

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors