Solved Notes For CN Chapter 6 SEM 5 AIML MU
Solved Notes For CN Chapter 6 SEM 5 AIML MU
Ref: Software Defined Networking with Open Flow : PACKT Publishing Siamak Azodolmolky, Chapter 1: Introducing
OpenFlow
■ Conventional Networking:
■ The networking protocols are distributed among the devices (routers, switches,
firewalls etc)
■ The control and data planes are tightly coupled
■ No common view of the network
■ New networking features are commonly introduced via expensive, specialized
and hard to configure equipments
■ Hard to implement new features and protocols as this means changing the
control plane of all devices which are part of the topology
■ Each device has to be configured separately which is prone to errors. Many
configurations changes are done manually
Understanding SDN and Open Flow
■ Three Layers/Planes:
■ Application - Layer/Plane
■ Control - Layer/Plane
■ Infrastructure/ Forwarding/Data - Layer/ Plane
■ Application Layer:
■ Includes different applications that interact with SDN controller
■ Programs that communicate behaviors and needed resources to the
controller via APIs.
■ Applications can build an abstract view of network by collecting information
from controller for decision making.
■ Application examples: network management, QoS incorporation, data
analysis, business applications etc.
SDN Architecture
■ Control Layer/Plane :
■ It’s a logical entity that receives instructions or requirements from SDN
application layer
■ Relays them to networking components in the infrastructure layer
■ It extracts information about network (such as traffic statistic, network events)
from hardware devices and communicates it to application layer
■ Data Plane:
■ SDN data plane consist of physical switches and virtual switches
■ They are responsible for data processing and forwarding packets for a network
based on instructions from control plane
SDN Architecture
■ Data Plane (contd….) : The forwarding hardware (data plane) consists of the
following:
■ A flow table containing flow entries consisting of match rules and actions that needs
to be taken on active flows.
■ A transport layer protocol that securely communicates with a controller about new
entries that are not currently in the flow table.
SDN Functional Architecture
Application
Load Traffic/ Security ----------
Monitoring Layer
Balancing
Control
POX OpenDayLight ---------
Layer
Data
Routers Switches --------- Layer
Advantages of SDN
■ The separation of the forwarding hardware from the control logic allows
easier deployment of new protocols and applications
■ Straightforward network visualization and management, and consolidation
of various network functions into software control is possible
■ Instead of enforcing policies and running protocols on a convolution of
scattered devices, the network is reduced to simple forwarding hardware
and the decision-making network controller(s).
SDN Building Blocks
SDN Building Blocks
■ Counters are used to collect statistics for the particular flow, such as number of
received packets, number of bytes, and duration of the flow
■ They are maintained per table, per flow, per port and per queue
■ Counters wrap around with no overflow indicator
Open flow Counters
Open flow Actions
■ Each flow entry is associated with zero or more actions that instruct the
OpenFlow switch how to handle matching packets.
■ If no forward actions are present, the packet is dropped.
■ Action lists must be processed in the specified order.
■ Pure OpenFlow switches only support the Required Actions, while hybrid
OpenFlow switches may also support the NORMAL Action.
Open flow Actions
■ The Required Actions :
■ Forward: OpenFlow switches must support forwarding the packet to physical
ports and the following virtual ones:
■ ALL: Send the packet on to all interfaces, excluding the incoming port
■ CONTROLLER: Encapsulate and send the packet to the controller
■ LOCAL: Send the packet to the local networking stack of the switch
■ TABLE (Only for packet-out message): Perform action in the flow table
■ IN_PORT: Send the packet out through the input port
■ Drop: This indicates that all the matching packets should be dropped. A flow
entry with no specified action is considered as a Drop action.
Open flow Actions
■ The Optional Actions :
■ NORMAL: Process the packet using the traditional
forwarding path supported by the switch (that is
traditional L2, VLAN, and/or L3 processing)
■ FLOOD: Flood the packet along the minimum spanning
tree, not including the incoming interface.
■ Enqueue: This forwards a packet through a queue
attached to a port. Forwarding behaviour is dictated by
the configuration of the queue and is used to provide the
basic QoS support.
Open flow Actions
■ Modify field: supports following modification actions,
■ Setting VLAN ID
■ Setting VLAN priority
■ Striping the VLAN header
■ Modifying the Ethernet source/destination MAC address
■ Modifying the IPv4 source/destination address
■ Modifying the IPv4 ToS bits
■ Modifying the transport source/destination port
Open Flow Table Examples
■ The communication between the controller and switch happens using the
OpenFlow protocol, where a set of defined messages can be exchanged
between these entities over a secure channel.
■ The secure channel is the interface that connects each OpenFlow switch to
a controller.
■ The Transport Layer Security (TLS) connection to the user-defined
(otherwise fixed) controller is initiated by the switch on its power on.
■ The controller's default TCP port is 6633.
■ The switch and controller mutually authenticate by exchanging certificates
signed by a site-specific private key.
■ Each switch must be user-configurable with one certificate for
authenticating the controller (controller certificate) and the other for
authenticating to the controller (switch certificate).
OpenFlow Messaging Process
■ Traffic to and from the secure channel is not checked against the flow table and
therefore the switch must identify incoming traffic as local before checking it against
the flow table.
■ In the case that a switch loses contact with the controller, as a result of an echo
request timeout, TLS session timeout, or other disconnection, it should attempt to
contact one or more backup controllers.
■ If some number of attempts to contact a controller fail, the switch must enter
emergency mode and immediately reset the current TCP connection.
■ Then the matching process is dictated by the emergency flow table entries (marked
with the emergency bit set).
OpenFlow Messages
■ The OpenFlow protocol defines three message types, each with multiple
subtypes:
■ Controller-to-switch
■ Symmetric
■ Asynchronous
OpenFlow Messages - Controller-to-switch
■ Features
■ Upon establishment of the TLS session, the controller sends a feature request
message to the switch.
■ The switch must reply with a features reply message that specifies the features
and capabilities that are supported by the switch.
■ Configuration
■ The controller is able to set and query configuration parameters in the switch.
■ The switch only responds to a query from the controller.
OpenFlow Messages - Controller-to-switch
■ Modify-State
■ These messages are sent by the controller to manage the state of the switches.
■ They are used to add/delete or modify flow table entries or to set switch port
priorities.
■ Flow table modification messages can have the following types:
■ ADD
■ MODIFY
■ DELETE
■ MODIFY and DELETE
OpenFlow Messages - Controller-to-switch
■ Read-State
■ These messages collect statistics from the switch flow tables, ports, and the
individual flow entries.
■ Send-Packet
■ These are used by the controller to send packets out of a specified port on the
switch.
■ Barrier
■ Barrier request/reply messages are used by the controller to ensure message
dependencies have been met or to receive notifications for completed operations.
OpenFlow Messages - Symmetric messages
■ Symmetric messages are initiated by either the switch or the controller and sent
without solicitation.
■ Three subtypes are:
■ Hello
■ Hello messages are exchanged between the switch and controller upon connection
setup.
■ Echo
■ Echo request/reply messages can be sent from either the switch or the controller,
and must return an echo reply.
■ These messages can be used to indicate the latency, bandwidth, and/or liveliness of a
controller-switch connection
■ Vendor
■ These messages offer additional functionality within the OpenFlow message type
space for future revisions of OpenFlow
OpenFlow Messages - Asynchronous messages
■ Initiated by the switch and used to update the controller of network events and
changes to the switch state.
■ Switches send asynchronous messages to the controller to denote a packet arrival,
switch state change, or an error.
■ Four asynchronous messages are:
■ Packet-in
■ For all packets that do not have a matching flow entry or if a packet matches an entry with a
send to controller action, a packet-in message is sent to the controller.
■ If the switch has sufficient memory to buffer packets that are sent to the controller, the
packet-in message contains some fraction of the packet header (by default, 128 bytes) and a
buffer ID to be used by the controller when it is ready for the switch to forward the packet.
■ Switches that do not support internal buffering (or have run out of internal buffer space)
must send the full packet to the controller as part of the message.
OpenFlow Messages - Asynchronous messages
■ Flow-Removal
■ When a flow entry is added to the switch by a flow modify
message (the Modify State type message), an idle timeout value
indicates when the entry should be removed due to the lack of
activity as well as a hard timeout value.
■ The hard timeout value indicates when the entry should be
removed, regardless of activity.
■ The flow modify message also specifies whether the switch
should send a flow removal message to the controller when the
flow expires.
■ Flow modify messages, which delete flow entries may also cause
flow removal messages.
OpenFlow Messages - Asynchronous messages
■ Port-status
■ The switch send port-status messages to the controller as the
port configuration state changes.
■ These events include changes in port status (for example,
disabled by the user) or a change in the port status as specified
by 802.1D (Spanning Tree).
■ Error
■ The switch is able to notify the controller of problems using error
messages.
SDN - Northbound interface
OpenFlow Switch Implementation
■ ‘OpenFlow switch’ is a basic forwarding element, which is
accessible via OpenFlow protocol and interface.
■ In SDN, switches come in two flavours:
■ hybrid (OpenFlow enabled)
■ pure (OpenFlow only).
■ Hybrid switches support OpenFlow in addition to traditional
operation and protocols (L2/L3 switching).
■ Pure OpenFlow switches have no on-board control, and
completely rely on a controller for forwarding decisions.
■ Every ‘OF switch’ needs to maintain forwarding table entries,
buffer space, and statistical counters
■ Difficult to implement in traditional switches with
application specific Ics (ASICs).
OpenFlow Switch Implementation
■ The reference implementation of the OpenFlow switch (from
Stanford University) includes
■ ofdatapath, which implements the flow table in user space;
■ ofprotocol, a program that implements the secure channel
component of the reference switch
■ dpctl, which is a tool for configuring the switch.
■ controller, a simple controller program that connects to any
number of OpenFlow switches and a Wireshark dissector that
can decode the OpenFlow protocol).
OpenFlow Switch Implementation
OpenFlow Switch Implementation
■ Features:
■ Upon the establishment of the TLS session (using TCP, on port 6633/6653),
the controller sends an OFPT_FEATURES_REQUEST message to the switch
■ the OpenFlow switch reports back (via OFPT_FEATURES_REPLY message) the
features and capabilities that it has and supports.
■ The datapath identifier (datapath_id), number of supported flow tables by
data path (OpenFlow switch), switch capabilities, supported actions, and
definition of ports are the important features that are reported to the
controller.
■ The datapath_id field uniquely identifies an OpenFlow switch. It is a 64-bit
entity and the lower 48 bits are intended for the switch MAC address, while
the top 16 bits are up to the manufacturers.
OpenFlow Switch Implementation
■ Configuration:
■ The controller is able to set and query configuration
parameters in the switch with the OFPT_SET_CONFIG and
OFPT_GET_CONFIG_REPLY messages, respectively.
■ The switch responds to a configuration request with an
OFPT_GET_CONFIG_REPLY message; it does not reply to a
request to set the configuration.
OpenFlow Switch Implementation
■ Modify state:
■ Modifications to the flow table from the controller are done with the
OFPT_FLOW_MOD message and the controller uses the OFPT_PORT_MOD
message to modify the behavior of the physical ports.
■ The flow modification commands are ADD, MODIFY, MODIFY_STRICT,
DELETE, and DELETE_STRICT.
■ The port configuration bits indicate whether a port has been
administratively brought down, options for handling 802.1D spanning tree
protocol (STP) packets, and how to handle incoming and outgoing packets.
■ The controller may set OFPPFL_NO_STP to 0 to enable STP on a port, or to 1
to disable STP on a port. ‘0’is a default value (enabling STP).
OpenFlow Switch Implementation
■ NOX was the first OpenFlow controller written in Python and C++.
■ POX is a general, open-source SDN controller written in Python.
■ NodeFlow is an OpenFlow controller written in JavaScript for Node.js.
■ Floodlight is a Java-based OpenFlow controller, based on the Beacon
implementation, that works with physical and virtual OpenFlow switches.
■ FlowVisor and RouteFlow as special controllers which acts as a transparent
proxy between OpenFlow switches and multiple OpenFlow controllers.