ºÝºÝߣ

ºÝºÝߣShare 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
Ad

More Related Content

What's hot (14)

JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
Stephen Chin
?
???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...
???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...
???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...
Amazon Web Services Korea
?
AWS? ??? ?? ? ??? ??? (???)- ???? ?? 2015
AWS? ??? ?? ? ??? ??? (???)- ???? ?? 2015 AWS? ??? ?? ? ??? ??? (???)- ???? ?? 2015
AWS? ??? ?? ? ??? ??? (???)- ???? ?? 2015
Amazon Web Services Korea
?
Openstack Trunk Port
Openstack Trunk PortOpenstack Trunk Port
Openstack Trunk Port
benceromsics
?
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
?
Automating Network Infrastructure : Ansible
Automating Network Infrastructure : AnsibleAutomating Network Infrastructure : Ansible
Automating Network Infrastructure : Ansible
Bangladesh Network Operators Group
?
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
Mehmet Ali Ayd?n
?
An Introduction to the SAM Pattern
An Introduction to the SAM PatternAn Introduction to the SAM Pattern
An Introduction to the SAM Pattern
Jean-Jacques Dubray
?
AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)
AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)
AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)
Amazon Web Services Korea
?
2019.06.27 Intro to Ceph
2019.06.27 Intro to Ceph2019.06.27 Intro to Ceph
2019.06.27 Intro to Ceph
Ceph Community
?
NiosII ¤È RTOS ¤Ë¤Ä¤¤¤Æ
NiosII ¤È RTOS ¤Ë¤Ä¤¤¤ÆNiosII ¤È RTOS ¤Ë¤Ä¤¤¤Æ
NiosII ¤È RTOS ¤Ë¤Ä¤¤¤Æ
ryos36
?
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
?
Git Notes and GitHub
Git Notes and GitHubGit Notes and GitHub
Git Notes and GitHub
Matthew McCullough
?
AWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ë
AWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ëAWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ë
AWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ë
Amazon Web Services Japan
?
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
Stephen Chin
?
???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...
???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...
???? NoSQL (Elasticahe / DynamoDB) ??? ? ?? ?? (??? & ???, AWS ???? ????) :: ...
Amazon Web Services Korea
?
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
?
AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)
AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)
AWS Lambda? API Gateway? ?? Serverless Architecture ?? (???)
Amazon Web Services Korea
?
NiosII ¤È RTOS ¤Ë¤Ä¤¤¤Æ
NiosII ¤È RTOS ¤Ë¤Ä¤¤¤ÆNiosII ¤È RTOS ¤Ë¤Ä¤¤¤Æ
NiosII ¤È RTOS ¤Ë¤Ä¤¤¤Æ
ryos36
?
AWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ë
AWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ëAWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ë
AWS ¤Ë¤ª¤±¤ë Microservices Architecture ¤È DevOps ¤òÍÆßM¤¹¤ë½M¿—¤ÈÈˤȥĩ`¥ë
Amazon Web Services Japan
?

Similar to SDN Programming with Go (20)

Gluster dev session #6 understanding gluster's network communication layer
Gluster dev session #6  understanding gluster's network   communication layerGluster dev session #6  understanding gluster's network   communication layer
Gluster dev session #6 understanding gluster's network communication layer
Pranith Karampuri
?
MTCNA Intro to routerOS
MTCNA Intro to routerOSMTCNA Intro to routerOS
MTCNA Intro to routerOS
GLC Networks
?
Layer 7 Firewall on Mikrotik
Layer 7 Firewall on MikrotikLayer 7 Firewall on Mikrotik
Layer 7 Firewall on Mikrotik
GLC Networks
?
software defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllerssoftware defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllers
Isaku Yamahata
?
Apache spark - Spark's distributed programming model
Apache spark - Spark's distributed programming modelApache spark - Spark's distributed programming model
Apache spark - Spark's distributed programming model
Martin Zapletal
?
MTCNA : Intro to RouterOS - Part 1
MTCNA : Intro to RouterOS - Part 1MTCNA : Intro to RouterOS - Part 1
MTCNA : Intro to RouterOS - Part 1
GLC Networks
?
Rlite software-architecture (1)
Rlite software-architecture (1)Rlite software-architecture (1)
Rlite software-architecture (1)
ARCFIRE ICT
?
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
?
Terraforming your Infrastructure on GCP
Terraforming your Infrastructure on GCPTerraforming your Infrastructure on GCP
Terraforming your Infrastructure on GCP
Samuel Chow
?
BGP Services IP Transit vs IP Peering
BGP Services  IP Transit vs IP PeeringBGP Services  IP Transit vs IP Peering
BGP Services IP Transit vs IP Peering
GLC Networks
?
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoS
Linaro
?
Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1
GLC Networks
?
Understanding Hadoop
Understanding HadoopUnderstanding Hadoop
Understanding Hadoop
Ahmed Ossama
?
Zabbix for Monitoring
Zabbix for MonitoringZabbix for Monitoring
Zabbix for Monitoring
GLC Networks
?
btNOG 9 presentation Introduction to Software Defined Networking
btNOG 9 presentation Introduction to Software Defined NetworkingbtNOG 9 presentation Introduction to Software Defined Networking
btNOG 9 presentation Introduction to Software Defined Networking
APNIC
?
NetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and VerticaNetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and Vertica
Josef Niedermeier
?
sdnppt.pdf
sdnppt.pdfsdnppt.pdf
sdnppt.pdf
AbhayDonde
?
Spark Driven Big Data Analytics
Spark Driven Big Data AnalyticsSpark Driven Big Data Analytics
Spark Driven Big Data Analytics
inoshg
?
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
GLC Networks
?
OVN Controller Incremental Processing
OVN Controller Incremental ProcessingOVN Controller Incremental Processing
OVN Controller Incremental Processing
Han Zhou
?
Gluster dev session #6 understanding gluster's network communication layer
Gluster dev session #6  understanding gluster's network   communication layerGluster dev session #6  understanding gluster's network   communication layer
Gluster dev session #6 understanding gluster's network communication layer
Pranith Karampuri
?
MTCNA Intro to routerOS
MTCNA Intro to routerOSMTCNA Intro to routerOS
MTCNA Intro to routerOS
GLC Networks
?
Layer 7 Firewall on Mikrotik
Layer 7 Firewall on MikrotikLayer 7 Firewall on Mikrotik
Layer 7 Firewall on Mikrotik
GLC Networks
?
software defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllerssoftware defined network, openflow protocol and its controllers
software defined network, openflow protocol and its controllers
Isaku Yamahata
?
Apache spark - Spark's distributed programming model
Apache spark - Spark's distributed programming modelApache spark - Spark's distributed programming model
Apache spark - Spark's distributed programming model
Martin Zapletal
?
MTCNA : Intro to RouterOS - Part 1
MTCNA : Intro to RouterOS - Part 1MTCNA : Intro to RouterOS - Part 1
MTCNA : Intro to RouterOS - Part 1
GLC Networks
?
Rlite software-architecture (1)
Rlite software-architecture (1)Rlite software-architecture (1)
Rlite software-architecture (1)
ARCFIRE ICT
?
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
?
Terraforming your Infrastructure on GCP
Terraforming your Infrastructure on GCPTerraforming your Infrastructure on GCP
Terraforming your Infrastructure on GCP
Samuel Chow
?
BGP Services IP Transit vs IP Peering
BGP Services  IP Transit vs IP PeeringBGP Services  IP Transit vs IP Peering
BGP Services IP Transit vs IP Peering
GLC Networks
?
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoS
Linaro
?
Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1
GLC Networks
?
Zabbix for Monitoring
Zabbix for MonitoringZabbix for Monitoring
Zabbix for Monitoring
GLC Networks
?
btNOG 9 presentation Introduction to Software Defined Networking
btNOG 9 presentation Introduction to Software Defined NetworkingbtNOG 9 presentation Introduction to Software Defined Networking
btNOG 9 presentation Introduction to Software Defined Networking
APNIC
?
NetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and VerticaNetFlow Data processing using Hadoop and Vertica
NetFlow Data processing using Hadoop and Vertica
Josef Niedermeier
?
Spark Driven Big Data Analytics
Spark Driven Big Data AnalyticsSpark Driven Big Data Analytics
Spark Driven Big Data Analytics
inoshg
?
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
GLC Networks
?
OVN Controller Incremental Processing
OVN Controller Incremental ProcessingOVN Controller Incremental Processing
OVN Controller Incremental Processing
Han Zhou
?
Ad

Recently uploaded (20)

Compiler Design_Code Optimization tech.pptx
Compiler Design_Code Optimization tech.pptxCompiler Design_Code Optimization tech.pptx
Compiler Design_Code Optimization tech.pptx
RushaliDeshmukh2
?
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
?
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxbMain cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
SunilSingh610661
?
ISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptxISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptx
mesfin608
?
W1 WDM_Principle and basics to know.pptx
W1 WDM_Principle and basics to know.pptxW1 WDM_Principle and basics to know.pptx
W1 WDM_Principle and basics to know.pptx
muhhxx51
?
Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1
remoteaimms
?
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Guru
?
Compiler Design_Syntax Directed Translation.pptx
Compiler Design_Syntax Directed Translation.pptxCompiler Design_Syntax Directed Translation.pptx
Compiler Design_Syntax Directed Translation.pptx
RushaliDeshmukh2
?
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
?
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
?
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
?
NOMA analysis in 5G communication systems
NOMA analysis in 5G communication systemsNOMA analysis in 5G communication systems
NOMA analysis in 5G communication systems
waleedali330654
?
Analog electronic circuits with some imp
Analog electronic circuits with some impAnalog electronic circuits with some imp
Analog electronic circuits with some imp
KarthikTG7
?
Surveying through global positioning system
Surveying through global positioning systemSurveying through global positioning system
Surveying through global positioning system
opneptune5
?
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
?
How to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdfHow to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdf
jamedlimmk
?
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
?
New Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdfNew Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdf
mohamedezzat18803
?
Compiler Design_Code generation techniques.pptx
Compiler Design_Code generation techniques.pptxCompiler Design_Code generation techniques.pptx
Compiler Design_Code generation techniques.pptx
RushaliDeshmukh2
?
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
?
Compiler Design_Code Optimization tech.pptx
Compiler Design_Code Optimization tech.pptxCompiler Design_Code Optimization tech.pptx
Compiler Design_Code Optimization tech.pptx
RushaliDeshmukh2
?
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
?
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxbMain cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
SunilSingh610661
?
ISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptxISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptx
mesfin608
?
W1 WDM_Principle and basics to know.pptx
W1 WDM_Principle and basics to know.pptxW1 WDM_Principle and basics to know.pptx
W1 WDM_Principle and basics to know.pptx
muhhxx51
?
Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1
remoteaimms
?
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Guru
?
Compiler Design_Syntax Directed Translation.pptx
Compiler Design_Syntax Directed Translation.pptxCompiler Design_Syntax Directed Translation.pptx
Compiler Design_Syntax Directed Translation.pptx
RushaliDeshmukh2
?
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
?
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
?
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
?
NOMA analysis in 5G communication systems
NOMA analysis in 5G communication systemsNOMA analysis in 5G communication systems
NOMA analysis in 5G communication systems
waleedali330654
?
Analog electronic circuits with some imp
Analog electronic circuits with some impAnalog electronic circuits with some imp
Analog electronic circuits with some imp
KarthikTG7
?
Surveying through global positioning system
Surveying through global positioning systemSurveying through global positioning system
Surveying through global positioning system
opneptune5
?
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
?
How to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdfHow to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdf
jamedlimmk
?
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
?
New Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdfNew Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdf
mohamedezzat18803
?
Compiler Design_Code generation techniques.pptx
Compiler Design_Code generation techniques.pptxCompiler Design_Code generation techniques.pptx
Compiler Design_Code generation techniques.pptx
RushaliDeshmukh2
?
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
?
Ad

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