CS434/534: Topics in Network Systems High-Level Programming for Programmable Networks Yang (Richard) Yang Computer Science Department Yale University.

Slides:



Advertisements
Similar presentations
Internetworking II: MPLS, Security, and Traffic Engineering
Advertisements

RIP V1 W.lilakiatsakun.
CPSC Network Layer4-1 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration-
An Overview of Software-Defined Network Presenter: Xitao Wen.
OpenFlow Costin Raiciu Using slides from Brandon Heller and Nick McKeown.
OpenFlow : Enabling Innovation in Campus Networks SIGCOMM 2008 Nick McKeown, Tom Anderson, et el. Stanford University California, USA Presented.
Flowspace revisited OpenFlow Basics Flow Table Entries Switch Port MAC src MAC dst Eth type VLAN ID IP Src IP Dst IP Prot L4 sport L4 dport Rule Action.
Traffic Management - OpenFlow Switch on the NetFPGA platform Chun-Jen Chung( ) SriramGopinath( )
An Overview of Software-Defined Network
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
An Overview of Software-Defined Network Presenter: Xitao Wen.
Connecting LANs, Backbone Networks, and Virtual LANs
Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Network Redundancy Multiple paths may exist between systems. Redundancy is not a requirement of a packet switching network. Redundancy was part of the.
OpenFlow: Enabling Technology Transfer to Networking Industry Nikhil Handigol Nikhil Handigol Cisco Nerd.
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Connecting to the Network Networking for Home and Small Businesses.
OpenFlow: Enabling Innovation in Campus Networks
Traffic Management - OpenFlow Switch on the NetFPGA platform Chun-Jen Chung( ) Sriram Gopinath( )
Router and Routing Basics
IP Forwarding.
Polytechnic University1 The internetworking solution of the Internet Prof. Malathi Veeraraghavan Elec. & Comp. Engg. Dept/CATT Polytechnic University
Mahindra-British Telecom Ltd. Exploiting Layer 2 By Balwant Rathore.
Networks and Protocols CE Week 7b. Routing an Overview.
Basic Routing Principles V1.2. Objectives Understand the function of router Know the basic conception in routing Know the working principle of router.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
Switching Topic 2 VLANs.
Slide 1 Simple, Flexible Programming of Data Movement Paths using Algorithmic Policies PIs: Y. Richard Yang, Robert Bjornson, Andrew Sherman Architect:
Cisco Confidential © 2013 Cisco and/or its affiliates. All rights reserved. 1 Cisco Networking Training (CCENT/CCT/CCNA R&S) Rick Rowe Ron Giannetti.
SDN basics and OpenFlow. Review some related concepts SDN overview OpenFlow.
Basic network flows; OpenFlow as a datapath programming standard
Chapter 4 Network Layer: The Data Plane
Datagram Forwarding.
CS434/534: Topics in Networked (Networking) Systems High-Level Programming for Programmable Networks: A Blackbox Approach Yang (Richard) Yang Computer.
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
IP: Addressing, ARP, Routing
Some slides have been adapted from:
Exploiting Layer 2 By Balwant Rathore.
Link Layer 5.1 Introduction and services
Announcement Written Homework Assignment 2: Due Fri. November 18, 11:59pm Programming Assignment 3: Due Mon. Nov ember 14, 11:59pm Group of three students.
Scaling the Network: The Internet Protocol
CS4470 Computer Networking Protocols
MAC Addresses and ARP 32-bit IP address:
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
Network Data Plane Part 2
ARP: Address Resolution Protocol
Chapter 6: Network Layer
SDN Overview for UCAR IT meeting 19-March-2014
Net 323: NETWORK Protocols
SDN basics and OpenFlow
IP Forwarding Relates to Lab 3.
LAN switching and Bridges
Chapter 5 Network Layer: The Control Plane
UNIT III ROUTING.
The Stanford Clean Slate Program
Magellan: Automatic SDN Pipelining from Algorithmic Policies
Software Defined Networking
CS434/534: Topics in Networked (Networking) Systems High-Level Programming for Programmable Networks Yang (Richard) Yang Computer Science Department.
Delivery, Forwarding, and Routing of IP Packets
IP Forwarding Relates to Lab 3.
LAN switching and Bridges
Programmable Networks
Scaling the Network: The Internet Protocol
Delivery, Forwarding, and Routing of IP Packets
Ch 17 - Binding Protocol Addresses
Chapter 5 Network Layer: The Control Plane
Lecture 9 – Chapter 4 Network Data Plane CIS 5617, Spring2019
Control-Data Plane Separation
Chapter 4: outline 4.1 Overview of Network layer data plane
Presentation transcript:

CS434/534: Topics in Network Systems High-Level Programming for Programmable Networks Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu http://zoo.cs.yale.edu/classes/cs434/

Outline Admin and recap SND Datapath model SDN programming Basic datapath model: flow tables Improved datapath model: flow table pipelines SDN programming Higher-level logic driven user programming

L3: Example 1 (same network): A->B Look up dest address in routing table find dest is on same net (what is the matching alg?) Hand datagram to L2 to send inside a link-layer frame

ARP Protocol Issue: Need to convert L3 address to L2 address Current solution: Data structure: each host has an ARP table mapping IP to L2 arp –a IP -> MAC Protocol: a broadcast protocol Client broadcasts query frame, containing queried IP address Node with queried IP receives ARP frame, replies its MAC address

ARP Format and Features Query: Layer 2 (Link layer) broadcast: destination ff:ff:ff:ff:ff:ff to be received by all hosts at the same local network Response: Host with the MAC returns its MAC if it has the query IP Gratuitous ARP: A host sends this message to update other devices if it changes MAC

A -> B in Layer 2 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B After A finds the link-layer (MAC) address of B, it constructs the L2 frame: A’s MAC addr B’s MAC A’s IP B’s IP IP payload datagram frame source, dest address

Datapath: Example 2 (Different Networks): A-> E Look up dst address in routing table routing table: next hop router to dest is 223.1.1.4 Hand datagram to link layer to send to router 223.1.1.4 inside a link-layer frame

Datapath: Example 2 (Different Networks): A-> E look up dest address in router’s forwarding table E on same network as router’s interface 223.1.2.9 link layer sends datagram to 223.1.2.3 inside link-layer frame via interface 223.1.2.9

Recap: Basic Network Device Data Structure and Operations Function Data Structure How currently populated? L2 basic switch table MAC -> ports flooding +self learning +spanning tree protocol L2 VLAN MAC+VLAN -> ports Flooding +selflearning +config+spanning tree L3 lookup routing table (forwarding information base) IP -> next hop router IP; longest prefix match distributed routing protocols; command line ARP arp table IP -> MAC ARP protocol NAT/LB NAT/LB table srcIP, srcPort, dstIP, dstPort -> srcIP, srcPort, dstIP, dstPort NAT/LB controller through config

Exercise: Draw a Big Picture of Internet using (L2/L3) Tables

Exercise: Visualize a Real Network using Tables Internet CE F2 F1 (Firewall) S2 R1 S1 LB2 LB1 (Load balancer) IPS3 IPS2 IPS1 (Intrusion prevention) S6 S5 S4 S3 tier-1 H6 H5 H3 H4 H1 H2 Logger Tier-3 Tier-2 Tier-1

Exercise: Visualize a Real Network using Tables Internet CE F2 F1 (Firewall) S2 S1 R1 LB2 LB1 (Load balancer) IPS3 IPS2 IPS1 (Intrusion prevention) S6 S5 S4 S3 tier-1 H6 H5 H3 H4 H1 H2 VLAN 300 VLAN 400 Logger Tier-3 Tier-2 Tier-1

Recap: Software Defined Network Basic ideas Multiple protocols Distributed protocols Vendor manual configuration Common datapath abstraction Programmable network

Recap: OpenFlow + mask what fields to match Switch Port MAC src dst Eth type VLAN ID IP Src Dst Prot L4 sport dport + mask what fields to match pcp ToS Forward packet to zero or more ports Encapsulate and forward to controller Send to normal processing pipeline Modify Fields Any extensions you add!

Example OF Test Commands sudo mn --topo single,3 --mac --switch ovsk --controller remote sh ovs-ofctl dump-flows s1 sh ovs-ofctl add-flow s1 in_port=1,actions=output:2 sh ovs-ofctl add-flow s1 in_port=2,actions=output:1 sh ovs-ofctl del-flows s1 sh ovs-ofctl add-flow s1 "priority=0,action=normal” sh ovs-ofctl add-flow s1 "priority=100,eth_type=0x800,ip_dst=10.0.0.1,action=drop” sh ovs-ofctl add-flow s1 "priority=100,eth_type=0x806,dl_dst=00:00:00:00:00:02,action=drop"

SDN Example: Google WAN 52 edge switches interconnecting google data centers ~143,000 OF rules

Exercise: What does this switch do?

OpenFlow: Group table A group table consists of group entries A group entry may consist of zero or more buckets A bucket typically contains actions that modify the packet and an output action that forwards it to a port

OpenFlow: Group table There are 4 group types All (Required)

OpenFlow: Group table There are 4 group types All (Required) Select (Optional)

OpenFlow: Group table There are 4 group types All (Required) Select (Optional) Fast failover (Optional)

OpenFlow: Group table There are 4 group types All (Required) Select (Optional) Fast failover (Optional) Indirect (Required)

OpenFlow: Meter Table ? Flow Table Enables OpenFlow to implement rate-limiting Each meter may have one or more meter bands. The bands define the behavior of the meters on packets for various ranges rate. ? Flow Table

Discussion Is the flow table computation model complete? Realize any function: (headers) -> output_ports Realize any function (mapping+transformation): (headers) -> [new headers, output_ports]

Flow Table Efficiency Policy: srcType = lookup ethSrc in hostTypeTable; dstType = lookup ethDst in hostTypeTable; Compute routing according to srcType, dstType MAC hostType Mac1 Linux v1 Mac2 Linux v2 Mac3 IOS12 Mac4 IOS11 Mac5 Win10 … Assume n hosts in hostTypeTable; Assume k types of hosts

Flow Table Efficiency p1 pn p pn2 a1 an ethSrc ethDst Action a1 p1 a2 .. … an pn2 n2 entries

Outline Admin and recap SDN datapath model Basic datapath model: flow tables Improved datapath model: flow table pipelines

Multi-Table (2 Tables) Design ethSrc Action a1 regsrcType=y1 jump 2 a2 regsrcType=y2 jump 2 .. … an regsrcType=yn jump 2 otherwise drop Table 1 Table 2 regsrcType ethDst Action y1 a1 p1,1 a2 p1,2 .. … yk an pk,n otherwise drop n + kn entries

Multi-Table (3 Tables) Design ethSrc Action a1 regsrcType=y1 jump 2 a2 regsrcType=y2 jump 2 .. … an regsrcType=yn jump 2 otherwise drop Table 3 regsrcType regdstType Action y1 p1,1 y2 p1,2 .. … yk yn pk,k otherwise drop Table 2 ethDst Action a1 regdsType=y1 jump 3 a2 regdstType=y2 jump 3 .. … an regdstType=yn jump 3 otherwise drop 2n + k2 entries

Comparison of 3 Designs Assume n = 4000, k = 100 Design #flow rules 1 table 2 tables 3 tables 16,000,000 = 16M 4000+400,000 = 404K 8000+10,000 = 18K

Example Pipeline: OF-DPA https://www.broadcom.com/products/ethernet-connectivity/software/of-dpa#documentation

Outline Admin and recap SDN datapath model SDN programming Basic datapath model: flow tables Improved datapath model: flow table pipelines SDN programming

Discussion Components of a programming environment to control programmable switches (switches with table pipelines)?

Extremely High-Level Programmable Network Arch logically centralized data store Network View Service/ Policy NE Datapath NE Datapath

Two Basic Types of Programming Reactive First packet of flow triggers controller to insert flow entries Pros Efficient use of flow table Cons Every flow incurs additional flow setup time If control connection lost, switch has limited utility Proactive Controller pre-populates flow table in switch Pro Zero additional flow setup time Loss of control connection does not disrupt traffic Con Need large flow table Many entries maybe cold

Outline Admin and recap Datapath model SDN programming Basic datapath model: flow tables Improved datapath model: flow table pipelines SDN programming Reactive, higher-level logic driven user programming (i.e., user generates all the flow rules)

An Example Higher-Level Logic badPort = 22 // policy hostTbl = {A:1,B:2, C:3,D:4} // net view def onPacketIn(p): if badPort == p.tcp_dst: drop else: forward([hostTbl(p.eth_dst)]) 1 4 2 3 A B D C Logic: Assume only packets to A,B,C,D can appear Block traffic to SSH (port 22)

Higher-Level Logic with Datapath Generation hostTbl = {A:1,B:2,C:3,D:4} def onPacketIn(p): if 22 == p.tcp_dst: drop installRule({‘match':{'tcp_dst':22}, ‘action’:[]}) else: forward([hostTbl(p.eth_dst)]) installRule({‘match’: {‘eth_dst’:p.eth_dst, ’tcp_dst’!=22}, ‘action’:[hostTbl(p.eth_dst)]}) match does not support logic negation

Higher-Level Logic with Datapath Generation hostTbl = {A:1,B:2,C:3,D:4} def onPacketIn(p): if 22 == p.tcp_dst: drop installRule({‘priority’:1, ‘match’:{'tcp_dst':22}, ‘action’:[]}) else: forward([hostTbl(p.eth_dst)]) installRule({‘priority’:0, ‘match’: {‘eth_dst’:p.eth_dst}, ‘action’:[hostTbl(p.eth_dst)]})

Does the Program Work? EthDst:A, TcpDst:80 Switch {`priority`:0,’match’:{‘eth_dst’:A},'action':[1]} EthDst:A, TcpDst:22 A security bug! def onPacketIn(p): if 22 == p.tcp_dst: // drop installRule({`priority`:1,’match’:{‘tcp_dst':22},'action':[]}) else: installRule({`priority`:0,’match’:{‘eth_dst’:p.eth_dst}, 'action':[hostTbl(p.eth_dst)]}) // forward([hostTbl(p.eth_dst)]) Controller Unfortunately, this program has a bug. To see where the program goes wrong, let’s watch what happens when we connect this controller to a single switch and let two packets arrive. Both packets have destination mac A. The red packet is to TCP destination 80, while the green packet is to TCP destination 22. When the red packet arrives, the switch has an empty flow table and sends the packet to the controller. The controller determines that the packet should be forwarded to the next hop, and installs the appropriate rule. The red packet returns to the switch and moves onward. Now, the port 22 packet arrives at the switch, and instead of being dropped or sent to the controller, it matches the low priority rule for Ethernet destination A and is therefore forwarded onward. This violates the user’s intentions and may represent a security violation.