You are on page 1of 29

SDN-

Software Defined Network


Các “mặt phẳng” trong mạng
•  Data plane: processing and delivery of packets with
local forwarding state
–  Forwarding state + packet header à forwarding decision
–  Filtering, buffering, scheduling
•  Control plane: computing the forwarding state in
routers
–  Determines how and where packets are forwarded
–  Routing, traffic engineering, failure detection/recovery, ...
•  Management plane: configuring and tuning the
network
–  Traffic engineering, ACL config, device provisioning, ...
Data plan
Data Plane
Streaming algorithms on packets
–  Matching on some header bits
–  Perform some actions

Example: IP Forwarding
1.2.3.4 1.2.3.7 1.2.3.156 5.6.7.8 5.6.7.9
host host ... host host host ... host

LAN 1 LAN 2
router router router
WAN WAN

1.2.3.0/24
5.6.7.0/24
11
forwarding table
Control plan
•  Compute paths the packets will follow
–  Populate forwarding tables
–  Traditionally, a distributed protocol
•  Example: Link-state routing (OSPF, IS-IS)
–  Flood the entire topology to all nodes
–  Each node computes shortest paths
–  Dijkstra’s algorithm
Control plan
1.  Figure out which routers and links are present.
2.  Run Dijkstra’s algorithm to find shortest paths.

“If a packet is going to B,


then send it to output 3”

Data
2
1 “If , send to 3”

3
Management plan
Management Plane
Traffic Engineering: setting the weights
–  Inversely proportional to link capacity?
–  Proportional to propagation delay?
–  Network-wide optimization based on traffic?

2
3 1
1
3
2 3
1 5

4 3
15
Time scales
Timescales

Data Control Management

Time- Packet Event (10 Human (min


scale (nsec) msec to sec) to hours)

Location Linecard Router Humans or


hardware software scripts

9
Data plan vs Control plan
Data and Control Planes
control plane
data plane Processor

Line card Line card

Line card
Switching
Line card
Fabric

Line card Line card

10
SDN Network
•  A network in which the control plane is
physically separate from the data plane.
–  Control plan of conventional routers are moved
up to centralized control programs
•  A single (logically centralized) control plane
controls several forwarding devices
SDN network
SoJware Defined Network (SDN)

Control Program A Control Program B

Network OS

Packet
Forwarding Packet
Forwarding

Packet
Packet Forwarding
Forwarding
Packet
Forwarding
26
Application of SDN: Network
virtualisation
•  Consider a multi-tenant datacenter
–  Want to allow each tenant to specify virtual topology
–  This defines their individual policies and requirements
•  Datacenter’s network hypervisor compiles these
virtual topologies into set of switch
configurations
–  Takes 1000s of individual tenant virtual topologies
–  Computes configurations to implement all
simultaneously
•  This is what people are paying money for....
–  Enabled by SDN︎s ability to virtualize the network
Control program
•  Control program operates on view of network
– Input: global network view (graph/database)
– Output: configuration of each network
device
•  Control program is not a distributed system
–  Abstraction hides details of distributed state
Network OS (on Controller)
•  Network OS: creates a consistent, up-to-date
network view
–  Runs on servers (controllers) in the network
–  ONOS, NOX, ONIX, Floodlight, Trema,
OpenDaylight, HyperFlow, Kandoo, Beehive,
Beacon, Maestro, ... + more
•  Uses forwarding abstraction to:
–  Get state information from forwarding elements
–  Give control directives to forwarding elements
OpenFlow basics
OpenFlow Basics

Control Program A Control Program B

Network OS

OpenFlow Protocol

Ethernet Switch
Control Path OpenFlow

Data Path (Hardware)

35
OpenFlow basics
•  Means of communication between controller and
switch
•  OpenFlow enables network controllers to determine
the path of network packets across a network of
switches
•  OpenFlow allows remote administration of a layer 3
switch's packet forwarding tables, by adding,
modifying and removing packet matching rules and
actions.
•  The OpenFlow uses TCP for encapsulating Openflow
packets. Controllers should listen on TCP port 6653 for
switches that want to set up a connection.
OpenFlow basics
Basics
OpenFlow

Control Program A Control Program B

Network OS
If header = p, send to port 4
Packet If header = q, overwrite header with r,
Forwarding add header s, and send to ports 5,6
If header = ?, send to me

Flow
Packet Table(s)
Forwarding Packet
Forwarding
36
Primitives <Match, Action>
Primitives <Match, Action>
Match arbitrary bits in headers:
Header Data

Match: 1000x01xx0101001x

–  Match on any header, or new header


–  Allows any flow granularity

Action
–  Forward to port(s), drop, send to controller
–  Overwrite header with mask, push or pop
–  Forward at specific bit-rate

OpenFlow Rules
OpenFlow Rules
Exploit the flow table in switches, routers, and chipsets

Flow 1. Rule
AcNon StaNsNcs
(exact & wildcard)

Flow 2. Rule
AcNon StaNsNcs
(exact & wildcard)

Flow 3. Rule
AcNon StaNsNcs
(exact & wildcard)

Rule
Flow N. Default AcNon StaNsNcs
(exact & wildcard)
Testbed
•  Network emulation tools
–  Mininet
–  Openvswitch
•  SDN Controller (Network OS)
–  Opendaylight, Floodlight, POX, ONOS….
Bài tập
•  Cài đặt thử nghiệm mạng SDN
–  Sử dụng Mininet mô phỏng mạng các switch
–  Sử dụng 1 controller: Opendaylight, Floodlight, ONOS,
POX
–  Xây dựng ứng dụng người dùng cho phép định tuyến
dữ liệu giữa 2 điểm nguồn đích theo một tuyến
đường nhất định.
•  Ứng dụng cho phép nhập vào switch nguồn, đích và danh
tuyến đường. Ví dụ: A ->B: A1-A2-A3… B
•  Yêu cầu các chuyển mach phải được cấu hình để vận chuyển
dữ liệu đúng theo tuyến đường trên.
Ghép nối SDN-IP
•  Vì sao phải ghép nối SDN và IP?
•  Mạng IP sử dụng các router để định tuyến. Các router trao
đổi thông tin định tuyến để xây dựng bảng định tuyến.
•  Mạng SDN không sử dụng router mà định tuyến tập trung
từ Controller.
•  Dữ liệu cần được vận chuyển từ 1 nút trọng mạng IP sang 1
nút (host) trong mạng SDN.
•  Không có sự trao đổi thông tin định tuyến giữa 2 mạng
•  Câu hỏi:
–  Làm thế nào 1 nút trong mạng IP biết làm thế nào để đi đến 1
đích trong mạng SDN và ngược lại?
–  Làm thế nào đi từ mạng IP này sang mạng IP kia “qua” mạng
SDN
Ghép nối SDN-IP

Mạng SDN
Ý tưởng ghép nối
•  Cần trao đổi thông tin reachability giữa vùng SDN và
vùng IP
–  Nhờ đó 1 mạng IP biết đến sự tồn tại của các host trong
mạng SDN và biết làm thế nào đi đến các host này
•  Giải pháp:
–  Coi mạng SDN là 1 AS, có 1 router BGP
–  Sử dụng BGP để trao đổi thông tin định tuyến với các
mạng IP bên ngoài.
–  Mỗi mạng IP bên ngoài cần có router BGP riêng
•  Làm sao để router BGP của SDN thiết lập được thông
tin định tuyến cho AS tương ứng mạng SDN
Ý tưởng ghép nối
•  Controller của SDN cần có khả năng xây dựng
được bảng định tuyến BGP cho AS của SDN
•  Trao đổi bảng định tuyến này với router BGP
của SDN.
•  Router BGP của SDN trao đổi với các router
BGP của các mạng IP bên ngoài.
•  ONOS là 1 controller cung cấp khả năng này.
Giải pháp SDN-IP với ONOS
Chúng ta có thể sử dụng phần mềm nguồn mở BIRD hoặc Quagga để triển khai.
Các BGP speaker ngang hàng trong mạng SDN có hai đường kết nối: Một là kết nối

Khung nhìn từ mặt phẳng điều khiển


với mặt phằng dữ liệu mạng SDN, nó sẽ ngang hàng với các BGP router bên ngoài,
kết nối sử dụng eBGP. Hai là mỗi BGP speaker kết nối với mỗi instance SDP-IP sử
dụng iBGP do đó nó sẽ chuyển tiếp các tuyến đường đến các instance SDN-IP.
Yêu cầu mỗi SDN-IP có thể nhận tất cả các tuyến đường được quảng bá đến
mạng SDN qua iBGP.

Hình 22: Cấu hình mạng SDN-IP với BGP.

Hình trên cho thấy các đường màu đen là các phiên eBGP giữa BGP speaker
bên trong và BGP router bên ngoài, đường màu đỏ là các phiên iBGP giữa các BGP
speaker và các instance SDN-IP.
Mỗi router BGP bên ngoài ngang hàng với một hoặc nhiều speaker BGP
Giải pháp SDN-IP với ONOS
•  Bên cạnh việc trao đổi bảng định tuyến, cần thiết
lập các đường truyền dữ liệu giữa IP và SDN, giữa
IP-SDN-IP
•  Đường truyền dữ liệu giữa IP và SDN
–  Router IP mạng ngoài nối vào switch của mạng SDN
–  Tạo các kênh truyền giữa mỗi router IP và mỗi mạng
IP bên trong mạng SDN bằng các “intents”
–  Việc tạo kênh được giải quyết bằng ứng dụng SDN-IP
của ONOS.
•  Cần cung cấp cho ứng dụng một số thông tin cấu hình kênh:
cổng switch nối với router IP, địa chỉ mạng trong SDN
Giải pháp SDN-IP với ONOS
•  Đường truyền dữ liệu giữa IP-SDN-IP
–  Mạng SDN đóng vai trò transit
–  Router IP 2 bên nối vào switch.
–  Cần thiết lập một kênh truyền giữa cổng switch
nối 2 routers.
–  Việc tạo kênh được giải quyết bằng ứng dụng
SDN-IP của ONOS.
•  Cần cung cấp cho ứng dụng một số thông tin cấu hình
kênh: cổng switch nối với các router IP
Bài tập
•  Ghép nối mạng SDN và mạng IP sử dụng ONOS
•  Yêu cầu:
–  ping được giữa mạng SDN và Mạng IP
–  ping được giữa 2 mạng IP thông qua mạng SDN.
•  Chỉ dẫn chi tiết thiết lập cấu hình:
https://wiki.onosproject.org/display/ONOS/
SDN-IP

You might also like