Introduction to the SDN lab · 2020. 12. 15. · TNG group-Politecnico di Torino Introductionto SDN...
Transcript of Introduction to the SDN lab · 2020. 12. 15. · TNG group-Politecnico di Torino Introductionto SDN...
-
Introduction to SDN lab - 1TNG group - Politecnico di Torino
Introduction to the SDN lab
Andrea Bianco, Paolo Giaccone, German Sviridovhttp://www.telematica.polito.it/
-
Introduction to SDN lab - 2TNG group - Politecnico di Torino
Mininet• network emulator
host
switch
SDN controller
host
switch
SDN controller
Mininet
-
Introduction to SDN lab - 3TNG group - Politecnico di Torino
Mininet• network emulator
– host– switch (in our lab: P4 switch)– SDN controller
• linux container/process for each node• command line interface CLI
– global commands for the emulator– local commands for the nodes
-
Introduction to SDN lab - 4TNG group - Politecnico di Torino
Mininet global commands• nodes display nodes
– h1 -> host 1– s1 -> switch 1
• links display links– h1-eth0s1-eth1
• net display a summary of all the nodes and links– h1 h1-eth0:s1-eth1
• dump dump information about all nodes–
-
Introduction to SDN lab - 5TNG group - Politecnico di Torino
Mininet local commands• local commands for the nodes
– if the first string typed a host, switch or controller name, the command is executed on that node
• h1 ifconfig provides the list of the network interfaces attached to h1
• h1 ping h2 sends ICMP packets from h1 to h2• h1 iperf –c 10.0.0.1 uses iperf to test the
bandwidth towards 10.0.0.1 • etc.
-
Introduction to SDN lab - 6TNG group - Politecnico di Torino
Network performance tool• iperf to test the available bandwidth between two
hosts• client server application
– client: generates the traffic (TCP/UDP)– server: receives the traffic (TCP/UDP)
• iperf –c dest_IP run the test as client• iperf –s run the test as server
– by default, each host is already running it in background • many options are available: iperf --help
-
Introduction to SDN lab - 7TNG group - Politecnico di Torino
Lab steps1. preliminary steps to become familiar with
Mininet and its commands2. test topology
– discovery in terms of node graph and IP addresses
– test connectivity3. modify flow tables to provide full connectivity4. experiments with rate limiting
– meters to classify flows based on rates5. experiments with load balancer
-
Introduction to SDN lab - 8TNG group - Politecnico di Torino
Tools and configuration• main folder /lab/forwarding• forwarding.p4 describes the model
implemented in the switch– based on v1model.p4
• Makefile runs the emulator• simple_topology.json describes the
topology (specified in Makefile)• under tables/, sX-commands describes the
actual processing of the packets– routing, rate limiting, load balancing
-
Introduction to SDN lab - 9TNG group - Politecnico di Torino
Lab logistics• you must follow the instructions available
under Materiale/Lab Info– install VirtualBox– download the ISO of the VM for the lab– start the VM
• the installation of the VM must be working by Monday 21th at 12AM– if assistance needed, please send an email to
-
Introduction to SDN lab - 10TNG group - Politecnico di Torino
Lab logistics• the lab will be managed through individual
Breakout Rooms through BBB– mandatory to activate the microphone when you
join the lab– (optional) enable the webcam– be prepared to share your screen when
interacting with the professors
-
Introduction to SDN lab - 11TNG group - Politecnico di Torino
P4 for programming the data plane
-
Introduction to SDN lab - 12TNG group - Politecnico di Torino
P4 as language
• Programming Protocol-independent Packet Processor
• language to describe how the packet are processed within the switch
• allows to program the switch• specifies the data plane and
the interface between the data plane and the control plane
• does not specify the control plane
-
Introduction to SDN lab - 13TNG group - Politecnico di Torino
Switch OS
Run-time APIDriver
“This is how I know toprocess packets”
(i.e. the ASIC datasheetmakes the rules)
Fixed-function ASIC
Status Quo: Bottom-up design
?slides taken from P4 language tutorial https://bit.ly/p4d2-2018-spring
-
Introduction to SDN lab - 14TNG group - Politecnico di Torino
Switch OS
Run-time APIDriver
“This is how I want the network to behave and how to
switch packets…”(the user / controller
makes the rules)P4 Programmable Device
A Better Approach: Top-down design
14
P4
Feedback
slides taken from P4 language tutorial https://bit.ly/p4d2-2018-spring
-
Introduction to SDN lab - 15TNG group - Politecnico di Torino
P4 vs traditional networking
• the data plane functionality is not fixed in advance
• data plane is configured at initialization time• no built-in knowledge of preexisting network
protocols• set of tables defined by a P4 program
P4 switch
-
Introduction to SDN lab - 16TNG group - Politecnico di Torino
P4 vs Openflow• Very different!• Openflow is just a southbound protocol/API
– prefixed matching fields and actions– no internal states within the switches
• P4 is a language to program the data plane– can be used to program a switch to act as an
Openflow switch– protocol independence
• flexibility in defining the protocol parser – stateful SDN
-
Introduction to SDN lab - 17TNG group - Politecnico di Torino
PISA: Protocol-Independent Switch Architecture
17
ProgrammableParser
ProgrammableDeparser
Programmable Match-Action Pipeline
Programmer declares the headers that should be
recognized and their order in the packet
Programmer defines the tables and the exact processing algorithm
Programmer declares how the output packet will look on the wire
slides taken from P4 language tutorial https://bit.ly/p4d2-2018-spring
-
Introduction to SDN lab - 18TNG group - Politecnico di Torino
P416 Language Elements
Architecture Description
Extern Libraries
Programmable blocks and their interfaces
Support for specialized components
Data Types Bistrings, headers, structures, arrays
Controls Tables, Actions, control flow statements
Parsers
Expressions Basic operations and operators
State machine, bitfield extraction
slides taken from P4 language tutorial https://bit.ly/p4d2-2018-spring
-
Introduction to SDN lab - 19TNG group - Politecnico di Torino
Example Architectures and Targets
19
TM
TM
TM
V1Model
Anything
SimpleSumeSwitch
Portable Switch Architecture (PSA)
slides taken from P4 language tutorial https://bit.ly/p4d2-2018-spring
-
Introduction to SDN lab - 20TNG group - Politecnico di Torino
Programming a P4 Target
P4 ArchitectureModel
P4 Compiler
Target-specific configuration
binaryData PlaneTables ExternobjectsLoad
TargetVendor supplied
P4 Program
User supplied
Control Plane
Add/removetable entries
CPU port
Packet-in/outExterncontrol
RU
NTI
ME
slides taken from P4 language tutorial https://bit.ly/p4d2-2018-spring