SlideShare a Scribd company logo
SDN Programming
with Golang
28 Feb 2019
Donaldson Tan
donaldson.tan@shukra-networks.com
Founder / Software Engineer
Shukra Networks
● Telecommunications startup
● Developing our own proprietary SDN stack
● Our focus is on
○ Wide Area Networking
○ inter-AS routing
Table of Content
● Network Programmability
● OSI Reference Model
● SDN Architecture
● Decoupling
● Using NFF-Go
● Packet Processing Graph
● User Defined Functions
● Packet Modification
Network Programmability
● Network Programmability is the capacity to
initialise, control, change and manage network
behavior dynamically via open interfaces.
● Software Defined Networking (SDN) is a specific
type of network programmability that supports the
separation of the control and forwarding planes via
standardised interfaces.
RFC 7426
Terminology
➔ Forwarding Plane
Collection of all network devices
responsible for forwarding packets.
Also known as Data Plane.
➔ Control Plane
Collection of functions that instructs
network devices how to process and
forward packets.
➔ Management Plane
Collection of functions that is
responsible for monitoring, configuring,
and managing network devices.
RFC 7426
OSI Reference Model
● The OSI paradigm describes computer networking
between 2 hosts from an application developer’s
perspective.
● The application developer emphasises on
transmitting/receiving data across the network.
● Network topology, network services, network
management are an awkward fit in the OSI model.
SDN Architecture
Network Services
Control Plane Management Plane
Forwarding Plane
● The SDN paradigm describes
computer networking from a
network operator’s perspective.
● The network operator emphasises
on managing and optimising the
network for cost and reliability.
● Note: The Management Plane
talks to the Forwarding Plane
because it uses the Forwarding
Plane to collect network statistics.
Applications
Decoupling Forwarding and Control Planes
● There are many ways to access the Forwarding Plane but we will be
focusing how to do it via Golang.
● Data Plane Development Kit (DPDK)
○ Hardware support by Intel, Marvell, Mellanox, Cavium
○ QEMU-Virtio also supports DPDK
○ NFF-Go provides Go binding to the DPDK
○ Install DPDK and NFF-Go separately.
○ Important: Register the NIC(s) with the DPDK driver and setup 1GB
Huge Pages. Don’t register the Management NIC.
Using NFF-Go
● import “github.com/intel-go/nff-go/flow”
● import “github.com/intel-go/nff-go/packet”
● A skeletal NFF-Go program consists of
○ A packet processing graph
■ A DAG consists of Entry, Transient and Exit Nodes
○ User Defined Functions (UDF)
■ UDFs may be attached to each flow
■ UDFs are responsible for processing individual packets, such as
● Modify packet content
● Update flow counters, program state
○ An optional interface for communicating with an external controller
■ E.g. API, RPC, RMI, XMPP
■ Important: Run the interface on the Management NIC.
Packet Processing Graph
Entry
Transient
Exit
Packet Processing Graph
● Directed Acyclic Graph (DAG), which means NO LOOPS.
● Initialise with flow.SystemInit(flow.Config{CPUList:”0-7”})
○ This tells NFF-Go to reserve logical cores 0-7 exclusively.
○ Do not use up all the logical cores, so they may be assigned to the Go
scheduler, hypervisor.
○ Use Go’s default scheduler to run the Management Interface.
● Launch the Packet Processing Graph with flow.SystemStart()
Packet Processing Graph
● Entry Nodes are specified by
○ flow1, err := flow.SetReceiver( uint port)
○ flow1, err := flow.SetGenerator(UDF, speed, context)
○ flow1, err := flow.SetReader(pcap_file, n)
● Exit Nodes are specified by
○ flow.SetStopper(flow1)
○ flow.SetSender(flow1, port_number)
○ flow.SetWriter(flow1, pcap_filename)
Packet Processing Graph
● Transient Nodes are specified by
○ rejectedFlow, err := flow.SetSeparator(flow1, UDF, context)
○ outputFlows, err := flow.SetSplitter(flow1, UDF, num_outflows, context)
○ mFlow, err := flow.SetPartitioner(flow, N, M)
○ mergedFlow, err := flow.SetMerger(flowArrays)
User Defined Functions
● Attach UDF to a flow using
○ err := flow.SetHandler(UDF, flow1)
● Take note of the several UDF types
○ HandleFunction(Packet, Context)
○ VectorHandleFunction(PacketVector[], Context)
○ SeparateFunction(Packet, Context) Bool
● Packet modification takes place inside the UDF
○ The first parameter is the packet itself.
Packet Modification
● Packet headers can be read and modified with the packet data type.
● Built-in methods for generating
○ default packets for Ethernet, IPv4, IPv6
○ ICMP/ARP requests / replies
● The more important methods are
○ pkt.GetIPv4NoCheck() /pkt.GetIPv6NoCheck()
○ pkt.GetTCPNoCheck()
○ pkt.GetUDPNoCheck()
● These methods return the packet’s relevant header which you may
rewrite directly.
● Next slides show the header format for IPv4, IPv6, TCP and UDP.
Packet Modification
● IPv4 Header ● IPv6 Header
Packet Modification
● TCP Header ● UDP Header
-The End-
But how do I separate the
forwarding and control
planes in the OSI model?
You don’t!
Open vSwitch
VM1 VM2
Open vSwitch
VM3 VM4
Host 1 Host 2
Physical Network
VXLAN Tunnel
What is SDN used for?
● Network Virtualisation. E.g. Amazon’s VPC is actually a
L2VPN distributed across multiple hypervisors.
VPC
What is SDN used for?
● High Performance
Cloud Network
Appliances
● Security
○ DDoS Filtering
○ Deep Packet
Inspection
What is SDN used for?
● Custom Traffic Engineering
○ Network telemetry
○ Load Balancing
○ Intelligent Routing
○ Congestion Control
○ Traffic Shaping
○ QoS

More Related Content

PDF
42Crunch Security Audit for WSO2 API Manager 3.1
PPT
Google Glass ppt
PDF
Kong, Keyrock, Keycloak, i4Trust - Options to Secure FIWARE in Production
PDF
옛날 웹 개발자가 잠깐 맛본 Vue.js 소개
PDF
API Security Best Practices & Guidelines
PDF
Intro to Open Source Hardware (OSHW)
PDF
Exploiting Deserialization Vulnerabilities in Java
PDF
Rapid prototyping with ScriptableObjects
42Crunch Security Audit for WSO2 API Manager 3.1
Google Glass ppt
Kong, Keyrock, Keycloak, i4Trust - Options to Secure FIWARE in Production
옛날 웹 개발자가 잠깐 맛본 Vue.js 소개
API Security Best Practices & Guidelines
Intro to Open Source Hardware (OSHW)
Exploiting Deserialization Vulnerabilities in Java
Rapid prototyping with ScriptableObjects

What's hot (20)

PDF
APIsecure 2023 - Security Considerations for API Gateway Aggregation, Yoshiyu...
PDF
Introduction to OpenID Connect
PPTX
API Security Lifecycle
PDF
Going realtime with Socket.IO
PDF
Surya resume WSU
PDF
Three.js basics
PDF
Extending WSO2 API Manager's Key Management Capabilities - WSO2 API Manager C...
PPTX
Building Next-Generation Web APIs with JSON-LD and Hydra
PDF
Naked Performance With Clojure
PDF
I Love APIs 2015: Crash Course Foundational Topics in Apigee Edge Workshop
PPTX
Game Project / Working with Unity
PDF
金融 API 時代のセキュリティ: OpenID Financial API (FAPI) WG
PPT
OAuth 2.0 and OpenId Connect
PDF
introduction to Vue.js 3
PPTX
Introducing Azure Arc
PDF
6 Reasons Why APIs Are Reshaping Your Business
PPT
API 101 - Understanding APIs
ODP
Introduction to Swagger
PDF
Restful api design
PDF
Schema-First API Design
APIsecure 2023 - Security Considerations for API Gateway Aggregation, Yoshiyu...
Introduction to OpenID Connect
API Security Lifecycle
Going realtime with Socket.IO
Surya resume WSU
Three.js basics
Extending WSO2 API Manager's Key Management Capabilities - WSO2 API Manager C...
Building Next-Generation Web APIs with JSON-LD and Hydra
Naked Performance With Clojure
I Love APIs 2015: Crash Course Foundational Topics in Apigee Edge Workshop
Game Project / Working with Unity
金融 API 時代のセキュリティ: OpenID Financial API (FAPI) WG
OAuth 2.0 and OpenId Connect
introduction to Vue.js 3
Introducing Azure Arc
6 Reasons Why APIs Are Reshaping Your Business
API 101 - Understanding APIs
Introduction to Swagger
Restful api design
Schema-First API Design
Ad

Similar to SDN Programming with Go (20)

PDF
intro lect.pdfkkpkpkpkpkpjjkojkopjjojjoj
PPTX
Software Defined Networking(SDN) and practical implementation_trupti
PPTX
SDN approach.pptx
PDF
SDN Software Defined Networks 1st Edition Thomas Nadeau D.
PPTX
Software defined network
PPTX
PPTX
Software defined networks and openflow protocol
PPTX
sdnppt-140325015756-phpapp01.pptx
PDF
SDN basics
PDF
Software Defined Networking: A Concept and Related Issues
PPTX
Software-Defined Networking (SDN) is a transformative networking paradigm
PPT
Software defined networking
PPTX
Software defined networking
PPTX
Network programmability: an Overview
PPTX
Software Define Network, a new security paradigm ?
PPTX
veryOLONADE MAHMpppUD PRESENTATIONrrr.pptx
ODP
Why sdn
PPTX
FIOT_Uni4.pptx
PDF
CampusSDN2017 - Jawdat: SDN Technology Evolvement
PDF
Introduction to Software Defined Networking (SDN)
intro lect.pdfkkpkpkpkpkpjjkojkopjjojjoj
Software Defined Networking(SDN) and practical implementation_trupti
SDN approach.pptx
SDN Software Defined Networks 1st Edition Thomas Nadeau D.
Software defined network
Software defined networks and openflow protocol
sdnppt-140325015756-phpapp01.pptx
SDN basics
Software Defined Networking: A Concept and Related Issues
Software-Defined Networking (SDN) is a transformative networking paradigm
Software defined networking
Software defined networking
Network programmability: an Overview
Software Define Network, a new security paradigm ?
veryOLONADE MAHMpppUD PRESENTATIONrrr.pptx
Why sdn
FIOT_Uni4.pptx
CampusSDN2017 - Jawdat: SDN Technology Evolvement
Introduction to Software Defined Networking (SDN)
Ad

Recently uploaded (20)

PDF
Well-logging-methods_new................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
web development for engineering and engineering
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
UNIT 4 Total Quality Management .pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Well-logging-methods_new................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
web development for engineering and engineering
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
bas. eng. economics group 4 presentation 1.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Model Code of Practice - Construction Work - 21102022 .pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
UNIT 4 Total Quality Management .pptx
Mechanical Engineering MATERIALS Selection
Lecture Notes Electrical Wiring System Components
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...

SDN Programming with Go

  • 1. SDN Programming with Golang 28 Feb 2019 Donaldson Tan donaldson.tan@shukra-networks.com Founder / Software Engineer
  • 2. Shukra Networks ● Telecommunications startup ● Developing our own proprietary SDN stack ● Our focus is on ○ Wide Area Networking ○ inter-AS routing
  • 3. Table of Content ● Network Programmability ● OSI Reference Model ● SDN Architecture ● Decoupling ● Using NFF-Go ● Packet Processing Graph ● User Defined Functions ● Packet Modification
  • 4. Network Programmability ● Network Programmability is the capacity to initialise, control, change and manage network behavior dynamically via open interfaces. ● Software Defined Networking (SDN) is a specific type of network programmability that supports the separation of the control and forwarding planes via standardised interfaces. RFC 7426
  • 5. Terminology ➔ Forwarding Plane Collection of all network devices responsible for forwarding packets. Also known as Data Plane. ➔ Control Plane Collection of functions that instructs network devices how to process and forward packets. ➔ Management Plane Collection of functions that is responsible for monitoring, configuring, and managing network devices. RFC 7426
  • 6. OSI Reference Model ● The OSI paradigm describes computer networking between 2 hosts from an application developer’s perspective. ● The application developer emphasises on transmitting/receiving data across the network. ● Network topology, network services, network management are an awkward fit in the OSI model.
  • 7. SDN Architecture Network Services Control Plane Management Plane Forwarding Plane ● The SDN paradigm describes computer networking from a network operator’s perspective. ● The network operator emphasises on managing and optimising the network for cost and reliability. ● Note: The Management Plane talks to the Forwarding Plane because it uses the Forwarding Plane to collect network statistics. Applications
  • 8. Decoupling Forwarding and Control Planes ● There are many ways to access the Forwarding Plane but we will be focusing how to do it via Golang. ● Data Plane Development Kit (DPDK) ○ Hardware support by Intel, Marvell, Mellanox, Cavium ○ QEMU-Virtio also supports DPDK ○ NFF-Go provides Go binding to the DPDK ○ Install DPDK and NFF-Go separately. ○ Important: Register the NIC(s) with the DPDK driver and setup 1GB Huge Pages. Don’t register the Management NIC.
  • 9. Using NFF-Go ● import “github.com/intel-go/nff-go/flow” ● import “github.com/intel-go/nff-go/packet” ● A skeletal NFF-Go program consists of ○ A packet processing graph ■ A DAG consists of Entry, Transient and Exit Nodes ○ User Defined Functions (UDF) ■ UDFs may be attached to each flow ■ UDFs are responsible for processing individual packets, such as ● Modify packet content ● Update flow counters, program state ○ An optional interface for communicating with an external controller ■ E.g. API, RPC, RMI, XMPP ■ Important: Run the interface on the Management NIC.
  • 11. Packet Processing Graph ● Directed Acyclic Graph (DAG), which means NO LOOPS. ● Initialise with flow.SystemInit(flow.Config{CPUList:”0-7”}) ○ This tells NFF-Go to reserve logical cores 0-7 exclusively. ○ Do not use up all the logical cores, so they may be assigned to the Go scheduler, hypervisor. ○ Use Go’s default scheduler to run the Management Interface. ● Launch the Packet Processing Graph with flow.SystemStart()
  • 12. Packet Processing Graph ● Entry Nodes are specified by ○ flow1, err := flow.SetReceiver( uint port) ○ flow1, err := flow.SetGenerator(UDF, speed, context) ○ flow1, err := flow.SetReader(pcap_file, n) ● Exit Nodes are specified by ○ flow.SetStopper(flow1) ○ flow.SetSender(flow1, port_number) ○ flow.SetWriter(flow1, pcap_filename)
  • 13. Packet Processing Graph ● Transient Nodes are specified by ○ rejectedFlow, err := flow.SetSeparator(flow1, UDF, context) ○ outputFlows, err := flow.SetSplitter(flow1, UDF, num_outflows, context) ○ mFlow, err := flow.SetPartitioner(flow, N, M) ○ mergedFlow, err := flow.SetMerger(flowArrays)
  • 14. User Defined Functions ● Attach UDF to a flow using ○ err := flow.SetHandler(UDF, flow1) ● Take note of the several UDF types ○ HandleFunction(Packet, Context) ○ VectorHandleFunction(PacketVector[], Context) ○ SeparateFunction(Packet, Context) Bool ● Packet modification takes place inside the UDF ○ The first parameter is the packet itself.
  • 15. Packet Modification ● Packet headers can be read and modified with the packet data type. ● Built-in methods for generating ○ default packets for Ethernet, IPv4, IPv6 ○ ICMP/ARP requests / replies ● The more important methods are ○ pkt.GetIPv4NoCheck() /pkt.GetIPv6NoCheck() ○ pkt.GetTCPNoCheck() ○ pkt.GetUDPNoCheck() ● These methods return the packet’s relevant header which you may rewrite directly. ● Next slides show the header format for IPv4, IPv6, TCP and UDP.
  • 16. Packet Modification ● IPv4 Header ● IPv6 Header
  • 17. Packet Modification ● TCP Header ● UDP Header
  • 19. But how do I separate the forwarding and control planes in the OSI model? You don’t!
  • 20. Open vSwitch VM1 VM2 Open vSwitch VM3 VM4 Host 1 Host 2 Physical Network VXLAN Tunnel What is SDN used for? ● Network Virtualisation. E.g. Amazon’s VPC is actually a L2VPN distributed across multiple hypervisors. VPC
  • 21. What is SDN used for? ● High Performance Cloud Network Appliances ● Security ○ DDoS Filtering ○ Deep Packet Inspection
  • 22. What is SDN used for? ● Custom Traffic Engineering ○ Network telemetry ○ Load Balancing ○ Intelligent Routing ○ Congestion Control ○ Traffic Shaping ○ QoS