SlideShare a Scribd company logo
Networkプログラマビリティとステート性・トランザクション性

Network	
  Programmability	
  and	
  the	
  statefulness/transac9onality	
9	
  November	
  2015	
  
Miya	
  Kohno	
  (mkohno@cisco.com)	
  
2© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
SDNの本質的価値	
  
•  MPLS	
  Japan	
  2012	
  Panel	
  Discussionより	
  
hKp://www.mpls.jp/2012/presenta9ons/MK_SDN_Panel_MPLSJapan2012_rev3.pdf	
  
あれから3年!	
  
	
  
真に求められていたのは	
  
プログラマビリティと,	
  
それによるサービス迅速化	
  
+運用自動化だった!	
  
	
  
「ネットワーク仮想化」に求め
られていたことも同様…	
  
3© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
では,どう「プログラム」するか?	
  
…という訳で,	
  
本日はNetworking領域におけるプログラミングスタイルを議論します	
  
	
  
議論のポイント	
  
•  プログラミングスタイルの重要性	
  
•  ステート性	
  –	
  ステートをどう扱うか	
  
•  トランザクション性	
  –	
  分散システムにおける整合性問題	
  
4© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Network領域におけるプログラミングスタイル	
  
• Waterfallよりも Agile	
  
	
  	
  	
  	
  	
  -­‐-­‐-­‐-­‐	
  フィードバックと継続的改善	
  
•  Impera9ve(命令的)よりも Declara+ve(宣言的)	
  
 	
  	
  -­‐-­‐-­‐-­‐	
  Howを指示するのでなく,Whatを合意	
  
• Procedureよりも Model	
  driven	
  
	
   	
  -­‐-­‐-­‐-­‐	
  逐次命令するのではなく,あるべき姿をモデルで示す
ネットワークは不確定性の高い,並列分散システム
Wikipedia:	
  Barabasi-­‐Albert	
  Model	
  
5© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
オーケストラ・コントローラ	
デバイス・インフラ	
仮想	
 物理	
サービス・アプリケーション	
“Declara9ve”	
  “Model-­‐driven”	
  性	
  の強み	
  
“How”を”記述”する 場合	
  
•  Script	
  
•  Workflow	
  
•  CLI	
  
•  Openflow	
  protocol	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
状態変化に
対応困難	
  
部分的変更,
削除が困難	
  
ß	
  Procedure	
  
ß	
  Command	
  
6© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
“What”を”合意”する 場合	
  
	
  
•  Service	
  Model	
  
•  Device	
  Models	
  
部分的変更や削除を,
一貫性,整合性をもっ
て実施可能	
  
Transac/on	
  Engine	
  
迅速(Agile)な	
  
フィードバックループ	
  
“Declara9ve”	
  “Model-­‐driven”	
  性	
  の強み	
  
•  並列分散処理への親和性	
•  不測の事態への対処、頑健性	
•  再利用性、保守性,スケール性	
ß	
  Inten/on	
  
ß	
  Promise	
  
比較的	
  
Top	
  down	
  
比較的	
  
BoKom	
  Up	
  
オーケストラ・コントローラ	
デバイス・インフラ	
仮想	
 物理	
サービス・アプリケーション	
トポロジー
7© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Compu9ng領域におけるプログラミングスタイルの変遷	
  
手続き型	
  
Procedural	
  
構造化	
  
Structuralized	
  
REST	
  
(Representa9onal	
  State	
  Transfer)	
  
オブジェクト指向	
  
OOP	
  
関数型	
  
Func9onal	
  Programming	
  
処理	
  
処理	
  
条件	
  
処理	
  
A
C D E
B
オブジェクトが
データ(ステート)
を内包する	
  
冪等性	
  
(Idempotence)	
  
	
  
参照透過性	
  
(Referen9al	
  
Transparency)	
  
データ(ステート)
データ(ステート)
データ(ステート)
ステートの明示化
ステートレス化
8© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
[補足]	
  冪等性(Idempotence),参照透過性(Referen9al	
  
Transparency)	
  
参照透過性(Referen9al	
  Transparency)	
  
	
  
文脈に依らず、式の値はその構成要素だけによって決まる。	
  
同じ条件を与えると、必ず同じ値が返る。	
  
(外部変数・グローバル変数とかを使ってはいけない。)	
  
冪等性(Idempotence)	
  
	
  
ある操作を一度行っても複数回行っても結果が変わらないことを表す概念	
(例えば、n++;は冪等でない.冪等性が保証できないと、例えば	
  9meout	
  -­‐>	
  retry	
  の
場合に結果が変わってしまう可能性がある)	
  
à	
  並列分散処理,ネットワークプログラミングにも重要な概念	
  
9© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Stateの問題	
  
x1
y1
a1
x1
y1
a1
b1
c1State	
  
*	
  Stateless	
  
*	
  Stateful	
   Stateによって結果が異なる	
  
 à並列分散処理に適しにくい	
  
	
  
•  並列分散するエンティティにおける
Stateの一貫性が必要	
  
•  High	
  Availabilityを実現する際に,	
  	
  
Stateの複製が必要	
  
e.g.	
  a	
  =	
  f(x	
  +	
  y	
  *	
  Nstate)	
  
e.g.	
  a	
  =	
  f(x	
  +	
  y)	
  
10© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Networkは Statefulな並列分散システム	
  
State	
  Mismatch	
  	
  ß	
  Topology	
  Convergence,	
  RIB(CP)-­‐FIB(DP)	
  inconsistency	
  	
  	
  
Rou9ng	
  Loop,	
  Black-­‐holing	
  
x
11© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Stateの度合いはさまざま	
  
Route情報	
  	
  
	
  +	
  	
  
Tunnel	
  Endpoint情報	
  
	
  +	
  	
  
RSVP	
  state	
  
Route情報	
  	
  
	
  +	
  	
  
Tunnel	
  Endpoint情報	
  
Route情報のみ	
  	
  
RSVP	
  TE	
  tunnel	
  
IP	
  tunnel	
  
Na9ve	
  IP	
  
•  ステートとスケールはTrade-­‐off	
  
•  ステートフルの場合,N:1冗長などもやりにくい	
  
その他	
  
 PPP/L2TPとか	
  
 IPSec/SSLとか	
  
 SIPとかMobileとか..	
  
 	
  
12© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Compu9ng	
  SystemにおけるMassive	
  Scaling	
  
Source:	
  
Colin	
  Kincade@Cisco	
  
•  超並列分散化	
  
•  ACID	
  -­‐>	
  BASE	
  
13© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
ACID	
  –	
  分散システムの整合性問題	
  
•  Atomicity	
  
	
  	
  	
  	
  	
  原始性	
  –	
  操作は,完了するか,一切なにもしないかのどちらかである	
  
	
  
•  Consistentncy	
  
	
  	
  	
  	
  	
  一貫性	
  –	
  整合性条件が一貫して保持される	
  
	
  
•  Isola9on	
  	
  
	
  	
  	
  	
  	
  	
  独立性 –	
  処理中の中間状態は隠蔽される	
  
  	
  
•  Durablity	
  
  永続性	
  –	
  完了したトランザクションは取消されず,	
  
  システムは継続する	
  
Controller	
   Device-­‐A	
   Device-­‐B	
  
Prepare	
  Commit	
  
OK	
  
Prepare	
  Commit	
  
OK	
  
Commit	
  
OK	
  
Commit	
  
OK	
  
Two-­‐Phase	
  Commit	
  
(Transac9on	
  Complete)	
  
14© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
ACID	
  –	
  分散システムの整合性問題	
  
……
(1)	
  口座Aから	
  
3,000,000円	
  
引いてください	
  
OK!	
  
(例)口座AからBへの振込処理
(2)	
  口座Bに	
  
3,000,000円	
  
足してください	
  
OK!	
  
•  (1)と(2)の両方の処理が成功しなければ, 
操作は完了しない	
  
•  どちらかが失敗した場合は,全て元に戻す	
  
このためには,2	
  phase	
  commit	
  + 	
  
操作完了するまでのデータベースロック	
  
が必要	
  
	
  
 à スケールしない!!!!	
  
15© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Your	
  Coffeshop	
  doesn’t	
  use	
  two	
  phase	
  commit!	
  
hKp://www.enterpriseintegra9onpaKerns.com/docs/IEEE_Sopware_Design_2PC.pdf	
  
顧客から注文を受けたらすぐに作り始める
注文の言い間違い・聞き間違いなどで,
欲しいものと違うものを作ってしまったら?
 → 謝って作りなおす(やりなおし)
顧客が料金を払わなかったら?
 → コーヒーは廃棄(無かったコトにする)
 
	
  
 à スケールする!!!!	
  
	
  
[東京のStarbucksでの体験からの考察]	
  
16© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
BASE	
  –	
  ACIDの代替手段として	
  
hKp://queue.acm.org/detail.cfm?id=1394128	
  
•  Basically	
  Available	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  基本的に動作している	
  
	
  
•  Sop-­‐state	
  
	
  	
  	
  	
  	
  ソフトステート	
  –	
  あまり厳密なステートの一貫性を求めない	
  
	
  	
  	
  	
  	
  	
  楽観的,Best	
  effort,	
  Simple,	
  Weak	
  Consistency…	
  	
  
	
  
•  Evetually	
  consistent	
  
	
  	
  	
  	
  	
  	
  結果整合 –	
  一時的に不整合が起こりえるが,	
  
  結果的には整合性が取れる	
  
17© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Network	
  Programmingは元々BASE	
  !	
  
宛先Aに到達する
ためにはBを経由
してください	
  
TTL	
  expireしたので,	
  
	
  ドメインAに対応する
IPアドレスを教えて下
さい	
  
Rou9ng	
  Protocols	
  (e.g.	
  BGP)	
  
RR	
  
(Route	
  Reflector)	
  
RR	
  clients	
  
DNS	
  	
  
Root	
  Server	
  
DNS	
  Cache	
  Servers	
  
DNS	
  
Eventually	
  consistent	
  !	
  
18© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
NETCONFは..?!	
  
顧客AのためのVRFを
設定してください..	
  OK?	
   Controller	
  
(NETCONF	
  client)	
  
Devices	
  
ACID可能!	
  
OK	
  
OK	
  
OK	
  
	
  
RFC6241	
  :	
  	
  
	
  
The	
  NETCONF	
  protocol	
  contains	
  
sufficient	
  primitives	
  upon	
  which	
  
transaction-­‐oriented	
  operations	
  
can	
  be	
  built.	
  	
  Providing	
  complete	
  
transactional	
  semantics	
  across	
  
multiple	
  devices	
  is	
  prohibitively	
  
expensive,	
  but	
  the	
  size	
  and	
  
number	
  of	
  windows	
  for	
  failure	
  
scenarios	
  can	
  be	
  reduced.	
  
	
  
では,Commit!	
  
19© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
ACIDを適用したほうが良いかもしれないところ	
  
ACID可能!	
  
スケール制御可能な範囲であれば,効用が大きい	
  
•  ASドメイン内	
  Controller	
  –	
  Device	
  
•  Cluster	
  Controller	
  –	
  DC	
  Fabric/Cluster	
  
Rou9ng	
  loopやパケットロス,
ブラックホールなどの	
  
いかなる不整合を防ぐことが
できる!	
  
20© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Network	
  Programmability	
  –	
  まとめ	
  
ネットワークは,不確定性の高い並列分散システム	
  
• Model-­‐driven,	
  Declara9ve	
  なプログラミングスタイルが適する	
  
• ステートはできるだけ最小化,局所化する	
  
• 必要性,適用性に応じて,トランザクション一貫性を実装する	
  
Network Programmability and the statefulness/transactionality

More Related Content

PDF
「宣言的プログラミング」とSDNのひとつの形態
PDF
Mk network programmability-03
PDF
災害対策セミナー 「検証プロジェクト報告と事例紹介」
PDF
コンテナは次世代サービスの主流になるか?
PDF
[Modern Cloud Day Tokyo 2019] オラクルクラウド移行を完了したゲストに聞くOracle Cloudを選択する理由&次世代インフ...
PDF
SAIS/SIGMOD参加報告 in SAIS/DWS2018報告会@Yahoo! JAPAN
PPTX
ななめ45°から見たJavaOne
PDF
セミナ受講レポート NRI Senju V12
「宣言的プログラミング」とSDNのひとつの形態
Mk network programmability-03
災害対策セミナー 「検証プロジェクト報告と事例紹介」
コンテナは次世代サービスの主流になるか?
[Modern Cloud Day Tokyo 2019] オラクルクラウド移行を完了したゲストに聞くOracle Cloudを選択する理由&次世代インフ...
SAIS/SIGMOD参加報告 in SAIS/DWS2018報告会@Yahoo! JAPAN
ななめ45°から見たJavaOne
セミナ受講レポート NRI Senju V12

Similar to Network Programmability and the statefulness/transactionality (20)

PDF
増加するコアを使い切れ!!
PDF
Aws summits2014 nttデータaws上のシステムはこう作る!
PDF
Bind Peek をもっと使おうぜ!(柴田 歩) - JPOUG Advent Calendar 2014(Day 5) -
PDF
Data Engineering at VOYAGE GROUP #jawsdays
PDF
Data Engineering at VOYAGE GROUP #jawsdays
PDF
論理レプリケーションのアーキテクチャ (第52回 PostgreSQLアンカンファレンス@オンライン 発表資料)
PDF
Mk model driven-automation
PPTX
Hueによる分析業務の改善事例
PDF
[Modern Cloud Day Tokyo 2019] Oracle CloudでDevOps!?Javaアプリケーションのモダン開発を支援するOra...
PPT
Yahoo!Japan北米DCでOCPのツボをみせてもらってきました - OpenStack最新情報セミナー 2016年5月
PPTX
Spring I/O 2019 報告 Spring Frameworkのロードマップと5.2の新機能
PDF
第5回札幌SoftLayer勉強会資料_20150311
PDF
Microservices and Servcie Mesh on Azure
PDF
業務システムで使うSpring Dynamic Modules
PDF
130710 02
PDF
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
PPTX
mruby/c適用期待分野20160329
PPTX
Com camp2014
PPTX
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
PPTX
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
増加するコアを使い切れ!!
Aws summits2014 nttデータaws上のシステムはこう作る!
Bind Peek をもっと使おうぜ!(柴田 歩) - JPOUG Advent Calendar 2014(Day 5) -
Data Engineering at VOYAGE GROUP #jawsdays
Data Engineering at VOYAGE GROUP #jawsdays
論理レプリケーションのアーキテクチャ (第52回 PostgreSQLアンカンファレンス@オンライン 発表資料)
Mk model driven-automation
Hueによる分析業務の改善事例
[Modern Cloud Day Tokyo 2019] Oracle CloudでDevOps!?Javaアプリケーションのモダン開発を支援するOra...
Yahoo!Japan北米DCでOCPのツボをみせてもらってきました - OpenStack最新情報セミナー 2016年5月
Spring I/O 2019 報告 Spring Frameworkのロードマップと5.2の新機能
第5回札幌SoftLayer勉強会資料_20150311
Microservices and Servcie Mesh on Azure
業務システムで使うSpring Dynamic Modules
130710 02
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
mruby/c適用期待分野20160329
Com camp2014
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
GraalVM を普通の Java VM として使う ~クラウドベンチマークなどでの比較~
Ad

More from Miya Kohno (15)

PDF
Mk data intensive-onic2021
PDF
Mk application aware-hicn
PPTX
Network as a Service - Data plane evolution and abstraction by NSM
PDF
Mk onic data-intensive-public
PDF
Mk onic data-intensive-2020-edge-rev1
PDF
Mk onic data-intensive-public
PDF
Mk vpp for-containers-vppug
PDF
Beyond Cloud Computing - Network as a platform
PDF
Systems Theory for Cisco SE
PDF
BGP evolution -from SDN perspective
PDF
BGP as a method for Abstraction
PDF
Segment Routing @ SDN Japan 2013
PDF
Model Driven Automation
PDF
Declarative Programming and a form of SDN
PDF
SRv6 Network Programmability - Dis-aggregation and Re-aggregation of Network ...
Mk data intensive-onic2021
Mk application aware-hicn
Network as a Service - Data plane evolution and abstraction by NSM
Mk onic data-intensive-public
Mk onic data-intensive-2020-edge-rev1
Mk onic data-intensive-public
Mk vpp for-containers-vppug
Beyond Cloud Computing - Network as a platform
Systems Theory for Cisco SE
BGP evolution -from SDN perspective
BGP as a method for Abstraction
Segment Routing @ SDN Japan 2013
Model Driven Automation
Declarative Programming and a form of SDN
SRv6 Network Programmability - Dis-aggregation and Re-aggregation of Network ...
Ad

Network Programmability and the statefulness/transactionality

  • 1. Networkプログラマビリティとステート性・トランザクション性
 Network  Programmability  and  the  statefulness/transac9onality 9  November  2015   Miya  Kohno  (mkohno@cisco.com)  
  • 2. 2© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential SDNの本質的価値   •  MPLS  Japan  2012  Panel  Discussionより   hKp://www.mpls.jp/2012/presenta9ons/MK_SDN_Panel_MPLSJapan2012_rev3.pdf   あれから3年!     真に求められていたのは   プログラマビリティと,   それによるサービス迅速化   +運用自動化だった!     「ネットワーク仮想化」に求め られていたことも同様…  
  • 3. 3© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential では,どう「プログラム」するか?   …という訳で,   本日はNetworking領域におけるプログラミングスタイルを議論します     議論のポイント   •  プログラミングスタイルの重要性   •  ステート性  –  ステートをどう扱うか   •  トランザクション性  –  分散システムにおける整合性問題  
  • 4. 4© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Network領域におけるプログラミングスタイル   • Waterfallよりも Agile            -­‐-­‐-­‐-­‐  フィードバックと継続的改善   •  Impera9ve(命令的)よりも Declara+ve(宣言的)        -­‐-­‐-­‐-­‐  Howを指示するのでなく,Whatを合意   • Procedureよりも Model  driven       -­‐-­‐-­‐-­‐  逐次命令するのではなく,あるべき姿をモデルで示す ネットワークは不確定性の高い,並列分散システム Wikipedia:  Barabasi-­‐Albert  Model  
  • 5. 5© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential オーケストラ・コントローラ デバイス・インフラ 仮想 物理 サービス・アプリケーション “Declara9ve”  “Model-­‐driven”  性  の強み   “How”を”記述”する 場合   •  Script   •  Workflow   •  CLI   •  Openflow  protocol                                                                                           状態変化に 対応困難   部分的変更, 削除が困難   ß  Procedure   ß  Command  
  • 6. 6© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential “What”を”合意”する 場合     •  Service  Model   •  Device  Models   部分的変更や削除を, 一貫性,整合性をもっ て実施可能   Transac/on  Engine   迅速(Agile)な   フィードバックループ   “Declara9ve”  “Model-­‐driven”  性  の強み   •  並列分散処理への親和性 •  不測の事態への対処、頑健性 •  再利用性、保守性,スケール性 ß  Inten/on   ß  Promise   比較的   Top  down   比較的   BoKom  Up   オーケストラ・コントローラ デバイス・インフラ 仮想 物理 サービス・アプリケーション トポロジー
  • 7. 7© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Compu9ng領域におけるプログラミングスタイルの変遷   手続き型   Procedural   構造化   Structuralized   REST   (Representa9onal  State  Transfer)   オブジェクト指向   OOP   関数型   Func9onal  Programming   処理   処理   条件   処理   A C D E B オブジェクトが データ(ステート) を内包する   冪等性   (Idempotence)     参照透過性   (Referen9al   Transparency)   データ(ステート) データ(ステート) データ(ステート) ステートの明示化 ステートレス化
  • 8. 8© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential [補足]  冪等性(Idempotence),参照透過性(Referen9al   Transparency)   参照透過性(Referen9al  Transparency)     文脈に依らず、式の値はその構成要素だけによって決まる。   同じ条件を与えると、必ず同じ値が返る。   (外部変数・グローバル変数とかを使ってはいけない。)   冪等性(Idempotence)     ある操作を一度行っても複数回行っても結果が変わらないことを表す概念 (例えば、n++;は冪等でない.冪等性が保証できないと、例えば  9meout  -­‐>  retry  の 場合に結果が変わってしまう可能性がある)   à  並列分散処理,ネットワークプログラミングにも重要な概念  
  • 9. 9© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Stateの問題   x1 y1 a1 x1 y1 a1 b1 c1State   *  Stateless   *  Stateful   Stateによって結果が異なる    à並列分散処理に適しにくい     •  並列分散するエンティティにおける Stateの一貫性が必要   •  High  Availabilityを実現する際に,     Stateの複製が必要   e.g.  a  =  f(x  +  y  *  Nstate)   e.g.  a  =  f(x  +  y)  
  • 10. 10© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Networkは Statefulな並列分散システム   State  Mismatch    ß  Topology  Convergence,  RIB(CP)-­‐FIB(DP)  inconsistency       Rou9ng  Loop,  Black-­‐holing   x
  • 11. 11© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Stateの度合いはさまざま   Route情報      +     Tunnel  Endpoint情報    +     RSVP  state   Route情報      +     Tunnel  Endpoint情報   Route情報のみ     RSVP  TE  tunnel   IP  tunnel   Na9ve  IP   •  ステートとスケールはTrade-­‐off   •  ステートフルの場合,N:1冗長などもやりにくい   その他    PPP/L2TPとか    IPSec/SSLとか    SIPとかMobileとか..      
  • 12. 12© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Compu9ng  SystemにおけるMassive  Scaling   Source:   Colin  Kincade@Cisco   •  超並列分散化   •  ACID  -­‐>  BASE  
  • 13. 13© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential ACID  –  分散システムの整合性問題   •  Atomicity            原始性  –  操作は,完了するか,一切なにもしないかのどちらかである     •  Consistentncy            一貫性  –  整合性条件が一貫して保持される     •  Isola9on                独立性 –  処理中の中間状態は隠蔽される        •  Durablity     永続性  –  完了したトランザクションは取消されず,     システムは継続する   Controller   Device-­‐A   Device-­‐B   Prepare  Commit   OK   Prepare  Commit   OK   Commit   OK   Commit   OK   Two-­‐Phase  Commit   (Transac9on  Complete)  
  • 14. 14© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential ACID  –  分散システムの整合性問題   …… (1)  口座Aから   3,000,000円   引いてください   OK!   (例)口座AからBへの振込処理 (2)  口座Bに   3,000,000円   足してください   OK!   •  (1)と(2)の両方の処理が成功しなければ,  操作は完了しない   •  どちらかが失敗した場合は,全て元に戻す   このためには,2  phase  commit  +    操作完了するまでのデータベースロック   が必要      à スケールしない!!!!  
  • 15. 15© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Your  Coffeshop  doesn’t  use  two  phase  commit!   hKp://www.enterpriseintegra9onpaKerns.com/docs/IEEE_Sopware_Design_2PC.pdf   顧客から注文を受けたらすぐに作り始める 注文の言い間違い・聞き間違いなどで, 欲しいものと違うものを作ってしまったら?  → 謝って作りなおす(やりなおし) 顧客が料金を払わなかったら?  → コーヒーは廃棄(無かったコトにする)      à スケールする!!!!     [東京のStarbucksでの体験からの考察]  
  • 16. 16© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential BASE  –  ACIDの代替手段として   hKp://queue.acm.org/detail.cfm?id=1394128   •  Basically  Available                        基本的に動作している     •  Sop-­‐state            ソフトステート  –  あまり厳密なステートの一貫性を求めない              楽観的,Best  effort,  Simple,  Weak  Consistency…       •  Evetually  consistent              結果整合 –  一時的に不整合が起こりえるが,     結果的には整合性が取れる  
  • 17. 17© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Network  Programmingは元々BASE  !   宛先Aに到達する ためにはBを経由 してください   TTL  expireしたので,    ドメインAに対応する IPアドレスを教えて下 さい   Rou9ng  Protocols  (e.g.  BGP)   RR   (Route  Reflector)   RR  clients   DNS     Root  Server   DNS  Cache  Servers   DNS   Eventually  consistent  !  
  • 18. 18© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential NETCONFは..?!   顧客AのためのVRFを 設定してください..  OK?   Controller   (NETCONF  client)   Devices   ACID可能!   OK   OK   OK     RFC6241  :       The  NETCONF  protocol  contains   sufficient  primitives  upon  which   transaction-­‐oriented  operations   can  be  built.    Providing  complete   transactional  semantics  across   multiple  devices  is  prohibitively   expensive,  but  the  size  and   number  of  windows  for  failure   scenarios  can  be  reduced.     では,Commit!  
  • 19. 19© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential ACIDを適用したほうが良いかもしれないところ   ACID可能!   スケール制御可能な範囲であれば,効用が大きい   •  ASドメイン内  Controller  –  Device   •  Cluster  Controller  –  DC  Fabric/Cluster   Rou9ng  loopやパケットロス, ブラックホールなどの   いかなる不整合を防ぐことが できる!  
  • 20. 20© 2014 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Network  Programmability  –  まとめ   ネットワークは,不確定性の高い並列分散システム   • Model-­‐driven,  Declara9ve  なプログラミングスタイルが適する   • ステートはできるだけ最小化,局所化する   • 必要性,適用性に応じて,トランザクション一貫性を実装する