+ All Categories
Home > Documents > When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative...

When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative...

Date post: 13-Jul-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
15
When Raft Meets SDN: How to Elect a Leader and Reach Consensus in an Unruly Network Yang Zhang, Eman Ramadan, Hesham Mekky, Zhi-Li Zhang University of Minnesota
Transcript
Page 1: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

WhenRaftMeetsSDN:HowtoElectaLeaderandReachConsensusinan

UnrulyNetworkYangZhang,Eman Ramadan,Hesham Mekky,Zhi-LiZhang

UniversityofMinnesota

Page 2: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

Introduction

ConsensusAlgorithm

Page 3: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

Introduction

ConsensusalgorithmisessentialforSDNdistributedcontrolplane

ConsensusAlgorithm

SoftwareDefinedNetworkApplicationLayer

ControlPlane

DataPlane

Applications

NetworkOperatingSystems

NetworkDevice

NetworkDevice

NetworkDevice

NetworkDevice

API

API

API

ControltoDataPlaneInterface

Page 4: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

ProblemsinSDNDistributedControlPlane

SDNcontrolplanesetup Cyclicdependencies• controlnetworkconnectivity• consensusalgorithm• controllogicmanagingthenetwork

Inconsensusalgorithm• serverfailurehasbeenstudiedfor

decades• fullmeshconnectivityisassumed• whatifnetworkfails?• newfailurescenariosariseinSDN

Page 5: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

RAFT:arepresentativeconsensusalgorithm

• Atanygiventime,eachserveriseither:– Leader:handlesallclientinteractions,logreplication,etc.– Follower:completelypassive– Candidate:usedtoelectanewleader

•Normaloperation:1leader,N-1followers

Follower Candidate Leader

Page 6: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

RAFTLeaderElection

Follower Candidate Leader

timesout,startelection

receivesvotesfrommajority

timesout,newelection

discoversserverwithhigherterm

discoverscurrentleaderorahigherterm

start

*TermisdefinedasvirtualtimeperiodinRaftVotecriteria:1)highestterm,2)latestlog

Page 7: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

RAFTMEETSSDN

Control Cluster under Normal Operations.

R2

R3 R4

R5

R1

Page 8: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

RAFTMEETSSDNR1

R3

Control Cluster under Normal Operations. Oscillating Leadership. Condition. Up-to-date servers have a quorum, but they cannot communicate with each other.

R3

R1

R3

R1

R3

R1

R4

R5R2R2

R3 R4

R5

R1

Page 9: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

RAFTMEETSSDN

No Leader Exists.

Condition. Some servers have a quorum, but they have obsolete logs, and servers having up-to-date logs, do not have a quorum.

R5

R4R3

R2

R1R1

Page 10: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

POSSIBLESOLUTIONS

• SolutionExpectation• all-to-allconnectivityamongclustermembersaslongasthenetworkisnotpartitioned.

• Gossiping(overlaynetwork)• Pros:easytoimplement• Cons:noguaranteetoworkinallscenarios;heavyoverhead

• RoutingviaPreorders• Pros:built-inresiliencyincontrolplane;nomodificationtoconsensusalgorithm• Cons:requirespathcalculationaheadoftime

Page 11: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

RoutingviaPreorder:FailureHandling

• FailureHandlingProcess:• Uponfailures,usealternativeoutgoinglinksifexist• Grouptableisusedforimplementingallpossiblealternativepaths

d=G

E

F

C

D

B

s=A

Itguaranteesanetworkwheretwonodesarealwaysreachableaslongasthereisnopartition.

Page 12: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

PRELIMINARYRESULTS

• ExperimentSetup

• RaftImplementation:RaftC++implementationinLogCabin

• SixDockercontainers:5serversand1client• FiveSoftwareswitches:OpenvSwitch• Simulatingthetwofailurescenarios:

§ OscillatingLeadership§ NoExistingLeader

Page 13: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

PRELIMINARYRESULTS

Raft: leadership keeps oscillating among servers (unstable).

Raft: no viable leader (liveness lost). PrOG: leadership is stable.

Vanilla Raft is not stable under failure scenarios, while PrOG-assisted Raft is stable.

Page 14: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

PRELIMINARYRESULTS

Latency of a request operation increases under failure scenarios

Client suffers much more failed attempts for accessing cluster leader in vanilla Raft.

Page 15: When Raft Meets SDN: How to Elect a Leader and Reach Consensus … · RAFT: a representative consensus algorithm •At any given time, each server is either: –Leader: handles all

Summary

• SDNcontrollerlivenessdependsonall-to-allmessagedeliverybetweenclusterservers• RaftisusedtoillustratetheprobleminducedbyinterdependencyinthedesignofSDNdistributedcontrolplane• Possiblesolutionsarediscussedtocircumventinterdependencyissues.• PreliminaryresultsshowtheeffectivenessofPrOG inimprovingtheavailabilityofleadershipinRaftusedbycriticalapplicationslikeONOS.


Recommended