1. Homepage
  2. Programming
  3. Operating Systems and Systems Programming - Exercise 2: Firewall Configuration

Operating Systems and Systems Programming - Exercise 2: Firewall Configuration

Engage in a Conversation
The University of BirminghamOperating Systems and Systems ProgrammingFirewallCC++

Operating Systems and Systems Programming CourseNana.COM

The Task CourseNana.COM

17 October, 2023 CourseNana.COM

Exercise 2 CourseNana.COM

Deadline: 13 November, 11:00am CourseNana.COM

Write a set of programs which maintains the firewall configuation. You should provide two programs: CourseNana.COM

1. The first one is a server program. Once started, the server should run forever. It should listen on a port and wait for requests from clients, process them and send a specified response back to the client. CourseNana.COM

The server maintains a collection of firewall rules. Clients may request operations on these rules. For each rule in the collection of rules, the server also maintains a list of pairs of IP addresses and ports which have been queried and found to match this rule. The server program should accept and process the following requests and return a response to the client making the request: CourseNana.COM

  • ˆ  Adding a rule to the stored rules. This request expects a string which contains a firewall rule as specified in exercise 1. If the rule is valid, the rule is added the set of firewall rules. The server returns the string Rule added if the rule has been added, and Invalid rule if the string is not a valid rule. CourseNana.COM

  • ˆ  Checking whether a given IP address and port are allowed according to the rules. If this is the case, the IP address and port are added to list of matched queries for this rule. If the given address and port are allowed according to several rules, you should add the IP address and port to only one rule. If the given IP address and port is checked again, they may be added to a different rule. If the input does not provide a valid IP address and a valid port, the server should return Illegal IP address or port specified. If the IP address and port are valid and should be accepted according to the rules, the server should return Connection accepted. If the IP address and port are valid and should be rejected according to the rules, the server should return Connection rejected. CourseNana.COM

  • ˆ  Delete a valid rule from the stored rules. This should also delete the list of IP addresses and ports stored for this rule. The rule should only be deleted if the server stores exactly the same rule. In all other cases, no action should be taken except returning a suitable message. If the specification of the rule is invalid, the server should return Rule invalid. If the rule is successfully deleted, the server CourseNana.COM

should return Rule deleted. If the rule is valid but not found on the server, the server should return Rule not found. CourseNana.COM

  • ˆ  Return all rules and for each rule list all IP addresses and ports which are stored with it. More precisely, for each rule, the server should return the line CourseNana.COM

    Rule: <rule>
    where <rule> is the specification of the rule as given in exercise 1, CourseNana.COM

    followed by the line CourseNana.COM

           Query: <IPaddress> <port>
    

    for each query stored with this firewall rule. CourseNana.COM

  • ˆ  For any other request, the server should return Illegal request. CourseNana.COM

    The server program should be started with CourseNana.COM

      <ServerProgram> <port>
    

    where <ServerProgram> is the way to call the server program, typically ./server, and <port> is the port on which the server listens for incoming connections. CourseNana.COM

2. The second program is a client program. This program makes it possible send requests to a server program and display the results. The client should be called with CourseNana.COM

  <ClientProgram> <serverHost> <serverPort> A <rule>

for adding a rule, CourseNana.COM

  <ClientProgram> <serverHost> <serverPort> C <IPAddress> <port>

for checking an IP address and port, CourseNana.COM

for showing the current firewall rules. CourseNana.COM

All other ways of calling the client program should return an error mes- sage. CourseNana.COM

<ClientProgram> is the way to call the client program, typically ./client, <serverHost> is the hostname of the server, and <serverPort> is the port on which the server is listening. CourseNana.COM

CourseNana.COM

The specification of a firewall rule is the same as for exercise 1. It is repeated here. CourseNana.COM

A rule is of the form CourseNana.COM

<IPAddresses> <ports>

where <IPAddresses> is either a single IP address, which has the form xxx.xxx.xxx.xxx, where xxx is a number between 0 and 255, or <IPAddress1>-<IPAddress2>,
where
<IPAddress1> and <IPaddress2> are IP addresses, and <IPAddress1> is
smaller than
<IPaddress2>. Assume that IP addresses and ports are separated CourseNana.COM

Your server program should maximise the degree of concurrency and not contain any memory leaks. CourseNana.COM

Submission and Marking CourseNana.COM

  • ˆ  You should submit a zip-file on canvas containing a directory called ex2. This directory should contain all the sources. The marking scripts will execute the command make to produce all required binaries. CourseNana.COM

  • ˆ  Do not add files or directories to the source that start with test, since we use those files for the marking scripts. CourseNana.COM

  • ˆ  A basic test script is provided on canvas. We will use more advanced scripts for marking which test all the specified functionality, including concurrency and memory leaks. If the basic test script does not work, all other scripts are likely to fail as well. CourseNana.COM

  • ˆ  Code which does not compile on the virtual machine provided will be awarded 0 marks. CourseNana.COM

    Hints CourseNana.COM

    You may use the code provided in the lectures in your assignments as you see fit, in particular the solutions to the first exercise and the multi-threaded server.  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
The University of Birmingham代写,Operating Systems and Systems Programming代写,Firewall代写,C代写,C++代写,The University of Birmingham代编,Operating Systems and Systems Programming代编,Firewall代编,C代编,C++代编,The University of Birmingham代考,Operating Systems and Systems Programming代考,Firewall代考,C代考,C++代考,The University of Birminghamhelp,Operating Systems and Systems Programminghelp,Firewallhelp,Chelp,C++help,The University of Birmingham作业代写,Operating Systems and Systems Programming作业代写,Firewall作业代写,C作业代写,C++作业代写,The University of Birmingham编程代写,Operating Systems and Systems Programming编程代写,Firewall编程代写,C编程代写,C++编程代写,The University of Birminghamprogramming help,Operating Systems and Systems Programmingprogramming help,Firewallprogramming help,Cprogramming help,C++programming help,The University of Birminghamassignment help,Operating Systems and Systems Programmingassignment help,Firewallassignment help,Cassignment help,C++assignment help,The University of Birminghamsolution,Operating Systems and Systems Programmingsolution,Firewallsolution,Csolution,C++solution,