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

PPSX
IEEE Membership Benefits for Students
PDF
GDSC SKCT - INFO SESSION
PPTX
Srs present
PPTX
PPSX
IEEE Membership Awareness & Benefits - 2014
PPTX
What is IEEE? {IEEE-ZC}
PDF
Berkenalan dengan Ansible Automation
PDF
DSC Aswan University info session
IEEE Membership Benefits for Students
GDSC SKCT - INFO SESSION
Srs present
IEEE Membership Awareness & Benefits - 2014
What is IEEE? {IEEE-ZC}
Berkenalan dengan Ansible Automation
DSC Aswan University info session

What's hot (14)

PPTX
How to make a simple application on packet tracer
PPTX
Ieee student branch final -nitp
ODP
Internet of Things - Overview
PPTX
Benefits of IEEE
PPTX
Developer Student Clubs
PDF
Introduction to SDN
PDF
Sobanski odl summit_2015
PPSX
IEEE benefits
DOC
Pajo cyber internet isp wireless business plan
DOCX
linux fresher resume
PPTX
Different Types of Engineering
PPTX
IEEE Presentation
PDF
Sdn and open flow tutorial 4
PPTX
Intelligent Avatars in the Metaverse.pptx
How to make a simple application on packet tracer
Ieee student branch final -nitp
Internet of Things - Overview
Benefits of IEEE
Developer Student Clubs
Introduction to SDN
Sobanski odl summit_2015
IEEE benefits
Pajo cyber internet isp wireless business plan
linux fresher resume
Different Types of Engineering
IEEE Presentation
Sdn and open flow tutorial 4
Intelligent Avatars in the Metaverse.pptx
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)

PPTX
communication and presentation skills 01
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PPTX
UNIT - 3 Total quality Management .pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
introduction to high performance computing
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPT
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
Current and future trends in Computer Vision.pptx
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PDF
PPT on Performance Review to get promotions
communication and presentation skills 01
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
UNIT - 3 Total quality Management .pptx
R24 SURVEYING LAB MANUAL for civil enggi
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
introduction to high performance computing
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
Visual Aids for Exploratory Data Analysis.pdf
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
Exploratory_Data_Analysis_Fundamentals.pdf
Current and future trends in Computer Vision.pptx
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPT on Performance Review to get promotions

SDN Programming with Go

  • 1. SDN Programming with Golang 28 Feb 2019 Donaldson Tan [email protected] 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