This is the first article in a series about Service Function Chaining (SFC for short), and its OpenStack implementation, networking-sfc, that I have been working on.
The SFC acronym can easily appear in Software-defined networking (SDN), in a paper about Network function virtualization (NFV), in some IETF documents, … Some of these broader subjects use other names for SFC elements, but this is probably a good topic for another post/blog.
If you already know SFC elements, you can probably skip to the next blog post.
So what is this “Service Function Chaining”? Let me quote the architecture RFC:
The delivery of end-to-end services often requires various service functions. These include traditional network service functions such
as firewalls and traditional IP Network Address Translators (NATs),
as well as application-specific functions. The definition and instantiation of an ordered set of service functions and subsequent
“steering” of traffic through them is termed Service Function
I see SFC as a higher level of abstraction routing: in a typical network, you route all the traffic coming from Internet through a firewall box. So you set up the firewall system, with its network interfaces (Internet and intranet sides), and add some IP routes to steer the traffic through.
SFC uses the same concept, but with logical blocks: if a packet matches some conditions (it is Internet traffic), force it through a series of “functions” (in that case, only one function: a firewall system). And voilà, you have your Service function chain!
I like this simple comparison as it introduces most of the SFC elements:
- service function: a.k.a. “bump in the wire”. This is a transparent system that you want some flows to go through (typical use cases: firewall, load balancer, analyzer).
- flow classifier: the “entry point”, it determines if a flow should go through the chain. This can be based on IP attributes (source/dest adress/port, …), layer 7 attributes or even from metadata in the flow, set by a previous chain.
- port pair: as the name implies, this is a pair of ports (network interfaces) for a service function (the firewall in our example). The traffic is routed to the “in” port, and is expected to exit the VM through the “out” port. This can be the same port
- port chain: the SFC object itself, a set of flow classifiers and a set of port pairs (that define the chain sequence).
An additional type not mentioned before is the port pair group: if you have multiple service functions of an identical type, you can regroup them to distribute the flows among them.
Use cases and advantages
OK, after seeing all these definitions, you may wonder “what’s the point?” What I have seen so far is that it allows:
- complex routing made easier. Define a sequence of logical steps, and the flow will go through it.
- HA deployments: add multiple VMS in a same group, and the load will be distributed between them.
- dynamic inventory. Add or remove functions dynamically, either to scale a group (add a load balancer, remove an analyzer), change functions order, add a new function in the middle of some chain, …
- complex classification. Flows can be classified based on L7 criterias, output from a previous chain (for example a Deep-Packet Inspection system).
Going beyond these technical advantages, you can read an RFC that is actually a direct answer to this question: RFC 7498
To keep a reasonable post length, I did not talk about:
- How does networking-sfc tag traffic? Hint: MPLS labels
- Service functions may or may not be SFC-aware: proxies can handle the SFC tagging
- Upcoming feature: support for Network Service Header (NSH)
- Upcoming feature: SFC graphs (allowing complex chains and chains of chains)
- networking-sfc modularity: reference implementation uses OVS, but this is juste one of the possible drivers
- Also, networking-sfc architecture in general
- SFC use in VNF Forwarding Graphs (VNFFG)
SFC has abundant documentation, both in the OpenStack project and outside. Here is some additional reading if you are interested (mostly networking-sfc focused):
- The OpenStack networking guide has a SFC chapter
- Official networking-sfc developer documentation
- networking-sfc project overview page
- Openstack wiki page on Service Insertion and Chaining
- A recent presentation from the Barcelona summit, describing the current state of the networking-sfc project and upcoming extensions