0% found this document useful (0 votes)
290 views6 pages

Simple Firewall with OpenFlow 1.3

Objects of this class describe packet header fields and an input port to match on. All fields are optional -- items that are not specified are "wildcards" and will match on anything. Some notable fields of ofp_match objects are

Uploaded by

Zaskel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
290 views6 pages

Simple Firewall with OpenFlow 1.3

Objects of this class describe packet header fields and an input port to match on. All fields are optional -- items that are not specified are "wildcards" and will match on anything. Some notable fields of ofp_match objects are

Uploaded by

Zaskel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lab 3: Simple Firewall using OpenFlow

This lab builds on the knowledge acquired through Lab 1 where you were first introduced to the
Mininet environment. It will also help you prepare for the class project. In Lab 1, you were
introduced to some basic functionality of Mininet. In this lab, we will take that one step further by
introducing you to Software-Defined Networking (SDN) and the OpenFlow protocol.

Software-Defined Networking & OpenFlow:


Software-Defined Networking (SDN) is a recently proposed networking paradigm in which the
data and the control planes are decoupled from one another. One can think of the control plane
as being the network’s “brain”, i.e., it is responsible for making all decisions, for example, how to
forward data, while the data plane is what actually moves the data. In traditional networks, both
the control- and data planes are tightly integrated and implemented in the forwarding devices
that comprise a network.

The SDN control plane is implemented by the “controller” and the data plane by “switches”. The
controller acts as the “brain” of the network, and sends commands (a.k.a. “rules”) to the
switches on how to handle traffic. OpenFlow has emerged as the de facto SDN standard and
specifies how the controller and the switches communicate as well as the rules controllers install
on switches.

Mininet and OpenFlow:


In Lab 1, we experimented with Mininet using its internal controller. In this lab (and the final
project), we will instead be using our own controller to send commands to the switches. We will
be using the POX controller, which is written in Python.

OpenFlow 1.3 Overview:


OpenFlow 1.3 is the version of the OpenFlow protocol supported within the Mininet
environment. The following diagram explains the operation of OpenFlow switches.
Note that when the packet comes into an OpenFlow switch, the switch will reference a table
containing “rules” and “actions”. This “flow” table contains the following fields:

The figure below shows the flow of execution that follows. If an ofp_packet_in does not match
any of the flow entries and the flow table does not have a “table-miss” flow entry, the packet will
be dropped. If the packet matches the “table-miss” flow entry, it will be forwarded to the
controller. If there is a match-entry for the packet, the switch will execute the action stored in
the instruction field of the corresponding flow table.
All of the figures and information in this section are from the ​OpenFlow 1.3 specification​, which
you can reference if you would like additional information

Assignment:
​ ere​.
The python files are available in a zip file h

For this assignment you will create a simple firewall using OpenFlow-enabled switches. The
term “firewall” is derived from building construction: a firewall is a wall you place in buildings to
stop a fire from spreading. In the case of networking, it is the act of providing security by not
letting specified traffic pass through the firewall. This feature is good for minimizing attack
vectors and limiting the network “surface” exposed to attackers.

In this Lab, we will provide you with the Mininet configuration, [Link],​ to setup your
network which assumes a remote controller listening on the default IP address and port number
[Link]:6633. You do not need to (and should not) modify this file.

In this Lab, we will also provide you with a skeleton POX controller: [Link]​.
This file will be where you will make your modifications to create the firewall.

Running the Code:


To run the controller, place [Link] in the ~/pox/pox/misc directory. You can then
launch the controller with the command s ​ udo ~/pox/[Link] misc.lab3controller

To run the mininet file, place it in ~ and run the command ​sudo python ~/[Link]
To do this assignment, you will need to be running both files at the same time (in 2
different terminal windows).

The topology that will be created will look as follows:

Rules:
The rules that you will need to implement in OpenFlow for this assignment are:

src ip dst ip protocol action

any ipv4 any ipv4 tcp accept

any any arp accept

any ipv4 any ipv4 - drop

Basically, your Firewall should allow all ARP and TCP traffic to pass. However, any other type of
traffic should be dropped. It as acceptable to flood the allowable traffic out all ports.

Be careful! Flow tables match the rule with highest priority first, where priority is established
based on the order rules are placed in the table.

When you create a rule in the POX controller, you need to also have POX “install” the rule in the
switch. This makes it so the switch “remembers” what to do for a few seconds. You will be
downgraded if your switch simply asks the controller what to do for every packet it receives.
Hint: To do this, look up ofp_flow_mod.

Useful Resources:
[Link]
Inside your VM, the pox/forwarding/l2_learning.py example file.

Testing/Submission/Grading:
To test your controller, first start the controller, then start the mininet script. When you are
prompted with the mininet CLI, run the following commands and take a screenshot of each:

[30 points] ​pingall : This should fail, since ICMP traffic should be blocked.
-20 points: ping succeeds
The remaining 10 points will be awarded depending on the quality of the explanation
given.

[70 points] ​dpctl dump​-flows : This should show a few entries. These are the entries that you
installed into the switch with of_flow_mod. You’ll need to do this within the timeout you specified
in your of_flow_mod for the entries to show up!
-40 points: no flows shown
The remaining 30 points will be awarded depending on the quality of the explanation
given.

[70 points] ​iperf : This should succeed.


-40 points: iperf fails
The remaining 30 points will be awarded depending on the quality of the explanation
given.

Additionally, you must submit your firewall code. It should be named l​ [Link]​.
Note:​ Your code will be tested. Ensure the screenshots are of your own code. Submitting
screenshots that are not of your own code is considered c ​ heating​ and a violation of the
academic integrity agreement.

[30 points] ​Firewall code and screenshots submitted and named properly:
-10 points: [Link] wrong format or name.
-10 points: [Link] wrong format, wrong name, or missing.
-10 points: README not submitted

Deliverables:

1. [Link]​: Screenshots of the above commands. If you are not able to get the expected
results, below your screenshot, explain what you think is going on (for partial credit).
2. [Link]​: Your firewall code.
3. README (or [Link])​: A readme file explaining your submission.

Note: You do not need to submit [Link]. You SHOULD NOT modify [Link].

Common questions

Powered by AI

Software-Defined Networking (SDN) offers both opportunities and risks regarding network security. On the positive side, SDN centralizes control, allowing for uniform implementation of security policies across the network and rapid responses to threats. However, this centralization also creates a significant risk: the controller itself becomes a high-value target for attacks. If compromised, it could lead to widespread network disruption or unauthorized data access. Furthermore, the dynamic nature of SDN configurations requires rigorous security measures to ensure that only trusted entities can modify network rules. Finally, as SDN networks lack the deterministic behavior typical of traditional networks, more complex validation and monitoring mechanisms are necessary to ensure consistent security standards .

The POX controller acts as the central intelligence in a Software-Defined Network using OpenFlow, orchestrating network flow by installing and managing flow entries on the switches. It translates high-level network policies into specific OpenFlow rules, which direct how switches handle traffic. This controller ensures compliance by continuously monitoring network traffic conditions and making real-time adjustments to flow rules as necessary, thus enforcing the desired network policy. Additionally, it processes table-miss scenarios by deciding whether to install new rules, drop packets, or forward them to a specific endpoint, thereby maintaining a regulated and orderly flow of traffic .

The configuration of flow rules in a Software-Defined Network (SDN) directly impacts both performance and reliability. Efficiently configured rules ensure rapid packet processing by matching common traffic patterns early, minimizing delay and optimizing switch resources. Poorly ordered or overly complex rules can lead to performance bottlenecks, causing increased latency as packets are processed by the controller rather than at the switch. Furthermore, incomplete or incorrect rules can lead to security vulnerabilities or misconfigured traffic, potentially causing network outages or unintended data exposure. Therefore, careful planning and testing of flow rules are crucial for a robust and efficient network .

Timeouts in flow mod commands are crucial as they determine the lifespan of flow entries in an OpenFlow switch. Timeout settings help manage the switch’s memory resources by removing obsolete or stale entries after a specified period, thereby preventing the switch's flow table from becoming overfilled with outdated information. Also, timeouts can cater to temporary network policies or test scenarios, enabling rules that should only affect the network for a limited duration. Overall, effective use of timeouts contributes to efficient traffic management and operational integrity of an SDN by ensuring that only relevant flow rules remain active .

Decoupling the control and data planes in Software-Defined Networking (SDN) allows for more centralized and flexible network management. In traditional networking, both planes are tightly integrated within network devices, which can lead to complexities in managing numerous devices separately. The SDN paradigm centralizes the control functions at the controller which acts as the network's "brain," allowing it to make decisions independently of the physical data handling on the switches. This separation enables dynamic and programmatic control over the network, simplifies the process of configuring network devices, improves scalability, and allows for more rapid deployment of new network policies or protocols .

When configuring OpenFlow rules in a POX controller for a firewall, several considerations must be addressed. First, prioritize rules carefully since flow tables match the rule with the highest priority first. Second, ensure that rules allow necessary traffic, such as ARP and TCP, while blocking undesired traffic types. Third, when installing rules, use ofp_flow_mod to set them in the switch's memory to avoid reliance on the controller for each packet decision, which could degrade performance. Lastly, specify a timeout for rules to ensure they persist only as needed without unnecessary overhead .

Allowing ARP and TCP traffic while dropping others is significant for maintaining necessary network services while enhancing security. ARP is essential for resolving IP addresses to MAC addresses, a basic networking function that must remain operational. TCP is a common protocol used for reliable data transmission in applications like web browsing and file transfers. Blocking other traffic types minimizes exposure to security vulnerabilities and attack vectors, focusing on protocols that are generally trustworthy and necessary for legitimate network activities .

Transitioning from traditional network architecture to Software-Defined Networking (SDN) involves several challenges, particularly in control plane management. The decoupling of the control and data planes necessitates a centralized controller, creating a potential single point of failure if not adequately designed for redundancy and scalability. Additionally, network administrators must adapt to new ways of programming and managing network behavior, requiring both an understanding of SDN concepts and skills in network scripting or programming environments like POX. There can also be challenges in integrating SDN solutions into existing infrastructure without disrupting current services, and ensuring compatibility and interoperability between different hardware and software components all adhering to SDN and OpenFlow standards .

Using both Mininet and a POX controller is important because they collectively simulate a realistic network environment for testing SDN concepts. Mininet provides the network topology and hosts, simulating a full network on a single machine, while the POX controller implements and controls SDN-specific functionalities like network traffic management through OpenFlow rules. This combination allows for experimentation with SDN concepts in a controlled and efficient environment, providing practical experience in configuring and managing networks programmatically .

The table-miss flow entry in an OpenFlow switch is a fallback mechanism that specifies the default action for packets not matching any explicit flow entry. If an incoming packet doesn't match any rules in the flow table and there is no table-miss entry, it will be dropped. However, if a table-miss entry is present, the packet can be redirected to the controller for further inspection or decision making. This mechanism ensures that non-matching packets are still handled in a controlled manner, allowing for customized responses to unidentified traffic, which can be critical for detecting and managing unexpected traffic patterns or potential security threats .

You might also like