Birkhoff-von Neumann Crossbar 光交換網絡的調度方案

Birkhoff-von Neumann Crossbar 光交換網絡的調度方案


Network Architecture and Optical Switching Technology

​ 這裏首先對 optical data center network 的目標優點與挑戰進行一些概述 [1],然後介紹這一技術中佔據較重要地位的光交換機 (我有時也很隨意地直接叫它光開關) 技術css

Demands of Optical Data Center Networks

​ 光數據中心網絡 (optical data center networks, optical DCNs) 是被用以符合高容量,低延遲,細粒度的 DCN 需求的一種架構,它有望彌補下面列舉的幾條傳統電子方案的缺陷 [1.1]node

  • In hierarchical tree-like topology based on electronic switch, the scaling issues of ball grid array (BGA) package causing bandwidth limited by application-specific integrated circuits (ASICs) input/output (I/O) bandwidth
  • Electronic switch achieves higher bandwidth by stacking ASICs in multitier structure, which leads to larger latency and higher cost;
  • Electronic circuit-based solution is facing a difficulties when large interconnectivity and fast reconfiguration are required;
  • Storing and transmitting properties of electronic switch have significant power dissipation, and the optical/electronic/optical (O/E/O) conversions and format-dependent interfaces will perform lower power/cost efficiency.

​ 這就成爲了故事的開端,能夠發現這些困境大致是電子器件的一些內稟性質 (fermion... ... 好麻煩... ...) 所致使的,有一些甚至是不可避免的算法

​ 另外一方面,從下面的表格就能夠看出光子學解決方案的「顯著」優點,它幾乎覆蓋了人們對於將來 DCN 的全部幻想,這樣,各類光交換機與一些調度算法或許能在這裏擁有本身的一片天空... ...緩存

Requirements Optical Solution
Capacity
<bandwidth for more inter-rack & intra-cluster communication>
<wavelength division multiplex (WDM) to provide power per unit bandwidth>
Latency
<switch latency from buffering & routing algorithm & arbitration>
<optical packet/burst switching (OBS, OPS) based on fast optical circuit switching (OCS)>
Interconnectivity
<support concurrent flows & bandwidth ultilization & service delivery>
<(high-capacity) optical interconnection technology>
Scalability
<scale nodes number for future capacity & cost>
<photonic integration may provide scaling without loss of capacity and power/cost>
Flexibility
<manage servise delivery & adapt to changing needs>
<software-defined networking (SDN) is used to facilitate highly flexible provisioning>
Power/Cost Efficiency
<reduce cost & scale bandwidth>
<data traffic in optical domain, no O/E/O power consumption>

​ 順帶一提,裏面涉及到的 OPS/OBS,光分組交換/光突發交換技術能借由突發流的統計複用實現亞波長的帶寬粒度,其中,OPS 網絡在相同信道中同時/前後傳輸包頭 (package header) 與數據包 (package, \(\it10^2\rm\ ns\sim\it10^2\rm\ ms\)),不須要提早預留鏈接,也有很好的 bandwidth efficiency,適合於 DC 較小數據量的傳輸,OBS 則藉助於大量的突發 (burst, \(\it10\sim10^3\rm\ ms\)) 與先於其在 (物理上的) 分離信道中發送的塊控制數據頭 (block control header, BCH) 實現資源預留,保留 OPS 的 flexibility 以及 efficiency 的同時下降了對光交換機和光緩存的要求,由於通常光交換機的 reconfiguration time 須要遠小於包/突發的時長網絡

​ 做爲 optical DCNs 架構的實例,能夠參考 Opsquare: A flat DCN architecture based on flow-controlled optical packet switches [4] 以及 Torus-topology Data Center Network based on Optical Packet/Agile Circuit Switching with Intelligent Flow Management [5] 這兩種基於 OPS 的架構,它們在當前 (\(\it2020\pm\)) 各類架構中擁有相對較優的性能,都有將 electronic buffer (EB) 設置在網絡鏈接部分,從而起到在衝突中重傳數據包或等待調度指令的做用。兩個網絡分別是基於 OPS 與 OCS 的 Torus (同時使用了 Deflection, ODL 和 EB) 以及基於 OPS 的 OPSquare,順帶一提,它們在 scalability, flexibility 以及 power/cost 方面也都有不錯的表現架構

Optical Switches

​ 由上所述,optical DCNs 的性能很大程度上受制於光交換機的性能。下面是一些比較經常使用,且有可能 (有些已經具有了商業化的能力甚至已經進入市場) 被用於集成的光交換機,它們的 switching time 基本都控制在 \(\it1\rm\ ns\sim\it10\rm\ \mu s\) 的範圍內 [1.1]app

Switch Type Switching Time Scale Loss
Mach-Zehnder interferometer (MZI, thermo-optic) \(\sim\it10\rm\ \mu s\) \(\it32\times32\) High
micro-ring resonator (MRR, thermo-optic) \(\sim\it10\rm\ \mu s\) \(\it8\times8\) Fair
PLZT MZI \(\sim\it10\rm\ ns\) \(\it8\times8\) High
InP MZI \(\sim\it2.5\rm\ ns\) \(\it8\times8\) High
LiNbO3 MZI \(\sim\it1\rm\ ns\) \(\it32\times32\) High
MZI + electro-absorption modulator (EAM) \(<\it10\rm\ ns\) \(\it8\times8\) Fair
tunable wavelength converters (TWCs) + arrayed waveguide grating router (AWGR) \(\sim\it10s\rm\ ns\) \(\it10s\times10s\) Fair
tunable lasers (TLs) + AWGR \(\sim\it10s\rm\ ns\) \(\it100s\times100s\) Low
semiconductor optical amplifier (SOA) multistage \(<\it10\rm\ ns\) \(\it16\times16\) Fair

​ 稍慢一些的光交換機如基於微機電系統 (microelectromechanical system, MEMS) 的光交換機沒有列在上面,這些光交換機大致能夠 (依據其構造原理) 分爲以下幾類 [1.2]dom

  • Microelectromechanical system optical switch (基於控制微鏡的運動控制,大致分爲利用反射機制改變光的傳播方向以及利用干涉衍射機制改變光的相位兩類,前者易於進行批量製造)electron

    特徵數值 \(T=50\rm\ ms,IL=3.5\ dB\)async

  • Beam-steering-based optical switch (經過 2D piezoelectric actuators 將束流引導至對應的 \(\varphi,\theta\) 位置,並由 integrated position sensor 探測光束指導反饋對束流的優化,具有軟件定義網絡 (software-defined networking, SDN) 的特性)

  • Liquid crystal optical switch (利用電壓控制液晶 (liquid crystal, LC) 中分子取向實現極化或折射率的變動,有些設計涉及到了雙折射及 Liquid crystal on silicon (LCoS) 的技術,受限於 polarization-dependent loss (PDL) 以及較高的串擾)

  • Electro-optic optical switch (基於電光效應 (electro-optic effect, EO effect,外加電場改變材料折射率,具有 \(\rm ns\) 級的超快響應),結合相位調製和干涉機制設計,採用 LiNbO3,PLZT 等材料,較高的插損限制了 scalability)

  • Semiconductor optical amplifier-based switch (這個原理相似於一種開關器件,有外加電流的狀況下,入射光就成功引起受激輻射光放大,沒有的話也就沒有了出射光,以後經過 broadcast-and-select 架構將其排列爲光交換機的陣列,可是批量生產時這種設計須要 \(N^2\) 個 SOA)

  • Thermo-optic optical switch (電流控制電極溫度,進而影響材料的折射率,這樣就能製造一些耦合器件做爲開關使用,可是須要一些熱光係數高且熱導率低的材料,其優點在於不依賴於波長與偏振)

    下面表格對這幾類光交換機的性能給出了更加詳細的評價 [1.2]

Characteristics MEMS based Beam-Steering Liquid crystal Electro-optic SOA based Thermo-optic
Switching speed \(\it10\sim20\rm\ ms\) \(\it25\rm\ ms\) \(\it100\rm\ ms\) \(\mathbf{\sim\ ns}\) \(\mathbf{\sim\ ns}\) \(\it5\sim10\rm\ ms\)
Insertion loss Medium Low High High Low Low
Power efficiency Medium Low High High Low Low
Scalability Large
(\(\it320\times320\))
Large
(\(\it384\times384\))
Medium
(\(\it1\times20\))
Medium
(\(\it32\times32\))
Medium
(\(\it16\times16\))
Small
(\(\it8\times8\))
Reliability Low Low High High Medium High
Implementation cost Medium Medium Low High High Low

Challenges of Optical DCN Solution

​ 因爲當前缺乏有效的光記憶器件,DC 中重要的衝突解決 (contention resolution) 功能不易實現,做爲解決方案,fixed fiber delay line (FDL) 能夠在時域暫存衝突包/突發,wavelength conversion 方法可以在頻域將衝突轉發到其它信道,deflection routing 提供在空域將衝突轉發到其它端口的方案,可是它們都不可避免地引入了路由控制 (routing control) 以及包同步的問題。另外一方面,將來 DCN 對於光交換機的高速切換以及一些相應的系統控制機制提出了更高的要求,當前的 optical DCNs 在 scaling 方面也受制於光交換機的端口數目,要想在這方面既避免使用層次結構,又保留不錯的緩衝控制機制,或許得期待 photonic integration 的後續發展了

​ 這些問題的解決方案更多來自於硬件方面如光器件的性能,但也並不是不能考慮從一些調度算法 (scheduling algorithm) 的軟件方面入手尋找思路,關於這一方面,能夠直接轉到後面的 scheduling algorithm,那裏會有一些介紹性的內容,若是想看一個比較完整的算法,請移步 crossbar switches as example (●'◡'●)

Switching Architectures and Scheduling Algorithms

​ 下面將重點放在了關於高速交換技術的一些基礎知識,固然也涉及到了一些相關的調度算法

Basic Knowledge on Packet Switching

​ 設計一個交換網絡 (基於轉發表 (forwarding table),注意交換和路由是不一樣的,前者是對於特定網絡節點而言,然後者關注大規模網絡中節點間的信息傳遞),須要考慮「輸出衝突 (output contention)」、「出入端口鏈接的創建速度 (最好可以具有 self-routing 的能力)」的問題。在這裏,首先咱們須要一些定義來描述衝突,關於這點,有內部阻塞以及輸出衝突兩種類型,分別稱做 blocking 和 output contention,與此同時,一些無阻塞的交換網絡也是存在的,如 crossbar switch

​ 在以上基礎上,定義描述交換網絡性能的兩個物理量 throughput \(X\propto\mathbb{E}[C_{\rm input}]/\mathbb{E}[\tau_{\rm output}]\) 以及 speedup \(S=T_{\rm input}/T_{\rm forwarding}\),更高的 speedup 說明網絡具有更強的衝突化解能力,對應着更高的 throughput

交換架構能夠分爲以下幾類:

Packet switches
├── Time division switching (TDS)
│	├── Shared medium
│	└── Shared memory
└── Space division switching (SDS)
	├── Single path
	│	├── Crossbar
	│	├── Fully interconnected
	│	└── Banyan
	└── Multipath
		├── Augmented banyan
		├── Clos
		├── Multiplane
		└── Recirculation

​ 其中,TDS 須要內部的通訊帶寬大於全部輸入端口彙集的帶寬,但可以輕鬆支持多播/廣播,shared memory type 相比於 shared medium type 有更高的內存利用率但須要雙倍內存速度;SDS 中,crossbar (更多信息見後面的 Crossbar Switches as Example) 是 fully interconnected type 的拓撲學等價,兩者具有差很少的特性 (如 \(N^2\) 複雜度和非阻塞結構);而 banyan-based 交換機 (包含 Delta-Omega-Banyan 這三類同構的拓撲) 中,每條信息需經 \(\log N\) 的節點以到達終點;Multipath 相比於 single path 具有了更強的容錯能力,其中的 multiplane type,recirculation type 還能增大 throughput,但 recirculation 有時會致使信息的順序錯亂

數據緩衝策略有以下幾類:

Buffering strategy
├── Shared-memory queuing
├── Output queuing (OQ)
├── Input queuing
├── Virtual output queuing (VOQ)
└── Combined input and output queuing (CIOQ)
.(Crosspoint queuing? place incoming cells in crosspoing buffer (XB))

​ 其中,shared-memory queuing structure 經過輸出端對於內存的共享實現了內存的最大利用率,但面臨尺寸的限制;而 OQ 在以上缺點的基礎上,又失去了內存利用率的優點 ε=ε=ε=┏(゜ロ゜;)┛,在服務質量 (Quality of Service, QoS) 的控制上有了一些提升;相比於這兩個, input queuing 不受限於尺寸,但帶來了線段阻塞 (head-of-line blocking, HOL blocking,儘管輸出端口空閒,數據卻被堵在了輸入隊列) 的問題,這使得它的 throughput 稍低一些 (\(\it58.6\%\));爲解決 HOL blocking,VOQ 中的每一個輸入緩衝被分紅 \(N\) 份,這個多是當下的研究熱點 (\(\it 2020\pm\)),其調度算法比前幾個要複雜;CIOQ 則是另外一種用於解決 HOL 的策略,它經過交換結構的 speedup 換取更高的 throughput

大規模 (多模塊) 交換結構分爲以下兩種類型

Large-scale switch
├── Single-stage switch
│	└── Parallel packet switch (PPS)
└── Multistage switch
	├── Partially connected multistage network
	│	└── Banyan-based switch
	└── Fully connected multistage network
		└── Clos-network switch

​ 其中,PPS 有最大的 throughput,其性能隨 speedup 的大小而變化,可是 single-stage 不免沒法支持龐大的端口數目;banyan-based network 和 Clos network 做爲 multistage 則避免了上述缺陷,banyan network (\(N\times N\) network, \(\log_bN\) stages, \(b\times b\) switching elements) 也支持 self-routing,但會帶來內部阻塞,交換機數目的增大將致使其性能驟減;Clos network (\(N\times N\) network, \(\it3\) stages, \(n\) input lines, \(\it m\geq2n-1\) middle-stage switch modules, maximum number of crosspoints \(N_x=O(N^{\it3/2})\)) 儘管內部全連通,但須要相應 (複雜) 的調整纔可以使網絡具有非阻塞性質,但即使如此也沒法避免內部阻塞的發生,解決方案通常只能是粗暴地增長內部鏈接數目和帶寬了... ...

Performance Analysis

​ 瞭解了一些基本交換結構後,下面利用一點基礎的排隊論知識給出 input-buffered switches, output-buffered switches 以及 completely shared-buffer switches 這三種交換策略的性能分析 [2]

Source Model

​ 注意,這裏採用的交通源模型是上圖所示的幾何分佈流,因而負載 \(\rho\) 就是每一個時間間隔內信源處於激活狀態的佔比

\[\begin{equation} \begin{split} \rho=\frac{\beta=E[X]}{\beta=E[X]+\alpha=E[Y]}=\frac{\sum_{i=1}^\infty i{\rm Pr}\{X=i\}}{\sum_{i=1}^\infty i{\rm Pr}\{X=i\}+\sum_{j=1}^\infty j{\rm Pr}\{Y=j\}}=\frac{q}{q+p-pq}, \end{split} \end{equation} \]

Input-Buffered Switches

​ 在有 HOL blocking 存在的情形下,老是會有信息傳輸延遲,於是這種方案沒法得到 \(\it100\%\) throughput,倘若將信源定爲無記憶型 (Markov),每一個端口就至關於一個 \(\it M/D/1\) 排隊模型,穩態下應有每段時間內傳輸的信息單元數 \(\bar{F}\) 與目標爲 \(i\) 端口的,每段時間後仍滯留的信息單元數 \(\bar{B}^i\) 知足以下關係

\[\begin{equation} \begin{split} \bar{F}=\sum_{i=1}^N\bar{B}^i, \end{split} \end{equation} \]

​ 又注意到 \(\bar{B}^i=\rho_0^2/[2(1-\rho_0)]\)\(\rho_0\) 是歸一化 throughput,能夠由上式獲得 \(\bar{B}^i\) 的另外一種表示方式

\[\begin{equation} \begin{split} \bar{B}^i=\frac1N\sum_{i=1}^N\bar{B}^i=1-\frac{\bar{F}}{N}=1-\rho_0=\frac{\rho_0^2}{2(1-\rho_0)}, \end{split} \end{equation} \]

​ 由此可得 \(\rho_0=(2-\sqrt2)\approx0.586\),這也就是 input-buffered switches 在這種信源下的漸進吞吐量了,換句話說,一旦輸入速率大於這個值,系統就會飽和

​ 下面藉由基於上述幾何分佈的 \(\it Geom/G/1\) 模型考察這種調度方式的等待時間,可是須要首先接受「到達每一個端口的信息單元遵循獨同分布以及擁有相同機率 \(p\)」以及「每一個單位有相同概率選取任意輸出端口爲目標」這兩個假設,再借助 \(\it Geom/G/1\) 模型的結論,就能夠知道平均等待時間爲 (用到了服務時間 \(S\),對於每段時間而言是一個隨機變量)

\[\begin{equation} \begin{split} \overline{W}=\frac{p\overline{S(S-1)}}{2(1-p\bar{S})}+\bar{S}-1, \end{split} \end{equation} \]

​ 顯然,它的漸進形式仍是蠻可憐的,隨着 \(N\to\infty\),它也以一個很快的速率趨近於 \(\infty\) [2]

Output-Buffered Switches

​ 這裏 \(N\to\infty\) 將致使信息單元到達輸出端口的數目遵循指數分佈 \(p^ke^{-p}/k!\),其中的 \(p\) 即爲輸入負載,由此能夠馬上獲得所謂信息單元丟失率 (若服務率/吞吐量沒法知足輸入負載的需求,則在輸出端口的信息累積會致使溢出 output buffer 而丟失) 爲 \(1-\rho_0/p\),舉個例子,對於 \(\it80\%\) 的負載,須要 buffer 大小大於 \(\it28\) 才能保證幾乎無丟失

​ 咱們能夠運用 little's law 來求得平均等待時間,也即,平均到達數 \(\bar{Q}\) 等於平均等待時間 \(\overline{W}\) 乘以服務率 \(\rho_0\),對於 \(N\to\infty,b\to\infty\),有

\[\begin{equation} \begin{split} \overline{W}=\frac{p}{2(1-p)}, \end{split} \end{equation} \]

Completely Shared-Buffered Switches

​ 這裏的全部信息單元都儲存在同一個 buffer 中,也就是說輸入與輸出共享 buffer,它的性能顯然會稍高於前兩種方案,可是彷佛只能靠一些數值模擬的方式獲知它的具體的表現,與 output-buffered switches 不一樣的是,其丟失率隨 buffer 大小變化呈現非線性 (buffer 越大,丟失率以越大的斜率迅速減少),而前者是呈 (近似) 線性的恆定速率減少的,也就是說這裏可使用較小的 buffer 達到 \(\it100\%\) throughput

Scheduling Algorithms

​ 剛剛已經屢次提到調度算法的由來了,簡單歸納一下,也就是說

  1. 首先因爲日益增長的,對於高線速,高端口數的大規模交換機的需求,人們再也不知足於 output buffer 的內存高利用率,由於其不具有這種 scalability ;
  2. 可是一旦開始使用 input buffer 或 combined-input-output-buffered 策略,就不可避免地須要一些增大 throughput 的方法 (提升交換機速度或增大路徑數以解決 HOL blocking + 仲裁機制以解決衝突問題);
  3. 應運而生的就是這些調度算法和路由技術了... ...

​ 一個有不錯性能的調度算法應具有以下特性

  1. Efficiency​,有高 throughput 同時也能有較低的 delay,對每一個時段選取最多邊的二部圖匹配;
  2. Fairness,可以避免單個 VOQ 的過分調用;
  3. Stability,每一個 VOQ 的佔有數目都爲有限值;
  4. Implementation complexity,易於在硬件以較高速度實現

​ 固然這裏有不少算法都能符合要求,因而這裏就直截了當地介紹一些適用於 input-buffered switches 的調度算法,也就是下面這些,它們不是所有,並且我也不會把每一個都解釋清楚,總之先對這幾種算法有個大體印象叭...

  • 二部圖最大權匹配 (maximum weight matching,MWM, \(O(N^3)\)),是我以爲最直接的一種方法,也即

    \[\begin{equation} \begin{split} \max_{w_{ij}}\sum_{e_{(i,j)\in M}}w_{ij}, \end{split} \end{equation} \]

    包含如 LQF (longest queue first, \(w_{ij}(t)\leftarrow L_{ij}(t)\)),OCF (oldest cell first, \(w_{ij}(t)\leftarrow \tau_{ij_{\rm HOL}}(t)\)) 和 LPF (longest port first, \(w_{ij}(t)\leftarrow\delta[L_{ij}(t)]\times[R_{i}(t)+C_{j}(t)]\)) 的一系列算法

    • 由它產生的有近似最大權 (1-APRX,犧牲了一些穩定性以換取低一些的複雜度) 和最大尺寸匹配 (maximum size matching, MSM, \(O(N^{2.5})\)),是當邊權爲 \(\it1\) 時的 MWM
  • 極大匹配 (maximal matching),對於 speedup \(N\),老是能夠由最多 \(N\) 次迭代求出匹配結果,複雜度通常比較大

    • 在其中已經有了如 parallel iterative matching (PIM), iterative round-robin matching (iRRM), iterative round-robin with SLIP (iSLIP), FIRM, dual round-robin matching (DRRM), pipelined maximal matching 和 exhaustive service dual round-robin matching (EDRRM) 等算法
  • 隨機匹配 (randomized matching),儘管不必定一直選到最好的,但卻有很高的穩定性和線性/對數複雜度

    • 包含如 De-randomized, SERENA, HE-\(i\)SLIP 等算法
  • 幀匹配 (frame-based matching),爲適應光交換的環境,採用多個 cells 合成單幀進行調度以提升效率,性能高開銷低

    • 包含如 reducing the reconfiguration frequency (exact covering, minimum switching, double), fixed-size frame-based matching (frame-based MWM, frame-based maximal weight matching, frame-based multiple iteration weight matching) 和 asynchronous variable-size frame-based matching (EDRRM) 等匹配算法
  • Speedup 下的穩定匹配,可以保證已匹配的端口具備足夠高的優先級

    • 包含如 most-urgent-cell-first algorithm (MUCFA), critical cell first (CCF), last-in-highest-priority (LIHP) 和 lowest-output-occupancy-cell-first (LOOFA) 等匹配算法

​ 上面涉及到的符號都是網絡科學中的慣常了,應該沒啥理解誤差了,在知足必定條件的情形下,上述的各類調度算法均可以達到 \(\it100\%\) 的 throughput

Crossbar Switches as Example

​ 下面首先介紹一下 input buffered crossbar switches [3] 的基本結構,而後以一種適用於其的調度算法 (這種算法基於雙隨機矩陣的 Birkhoff-von Neumann 定理,且不須要 framing 以及 internal speedup) 做爲例子來熟悉這類交換結構的功能

Crossbar-Structure ​ 如上圖所示 (是一個 $\it4\times4$ 的 crossbar 的結構示意圖,以及它的基本衝突形式,這種結構顯然很簡單,且易於對其進行模塊化與控制),所謂 crossbar 就是由 $N\times N$ 個全交叉的鏈接組成的一個陣列 (i.e.,共 $\it2N$ 個 bars,一種 single path 的 SDS),它們之間的鏈接在每個時間均可以被一個置換矩陣 (permutation matrix) $P_k$ 描述,從 $i$ 端口到 $j$ 端口的 requested rate 爲 $R=(r_{ij})$ 的矩陣元,若保證網絡中沒有超額訂閱 (overbooking),則須使非負矩陣 $R$ 爲雙隨機的 (doubly stochastic) $$ \begin{equation} \begin{split} \left\{ \begin{split} \sum_{i=1}^Nr_{ij}\leq1,\ \ \forall j,\\ \sum_{j=1}^Nr_{ij}\leq1,\ \ \forall i, \end{split} \right. \end{split} \end{equation} $$ ​ 能夠得知,只要可以獲得一組正數 (做爲權值) $\phi_k$ (固然,知足 $\sum_{k=1}^K\phi_k=1$ 且 $\it K\leq N^2-2N+2$) 與 $P_k$ 的組合,使得如下分解不等式成立,便可直接將每個 $P_k$ 設置爲與其對應的 $\phi_k$ 成正比的形式 $$ \begin{equation} \begin{split} R\leq\sum_{k=1}^K\phi_kP_k, \end{split} \end{equation} $$

​ 這種雙隨機矩陣的分解恰好對應着所謂 Birkhoff-von Neumann 算法,其正規表述見 付録┍1┙,分解步驟能夠僞代碼的形式表示以下,注意,這裏涉及到共兩個步驟,首先是尋找更大元素的雙隨機矩陣 (von Neumann),然後對這個雙隨機矩陣進行分解,得到對應的正權與置換矩陣乘積之和的形式 (Birkhoff),它們的複雜度都在下面標示出來了

\(\mathbf{Algorithm}\):\(\mathbf{\ Birkhoff}\)-\(\mathbf{von\ Neumann}\)
\(\mathbf{Input}\): the double stochastic matrix \({\color{#ff6347}{\boldsymbol{R}}}=[r_{ij}]\)
\(\mathbf{Output}\): the set/vector of positive numbers and permutation matrices \(\{{\color{#c71585}{\boldsymbol{\Phi}}}=[{\color{#c71585}{\boldsymbol{\phi}}}_k],{\color{#c71585}{\boldsymbol{\mathscr{P}}}}=[{\color{#c71585}{\boldsymbol{P}}}_k]\}\)

// find doubly stochastic matrix \(\tilde{{\color{#ff8c00}{\boldsymbol{R}}}}=[\tilde{r}_{ij}],{\text{s.t.}}\forall i,j,\tilde{r}_{ij}\geq{r}_{ij}\), with total complexity of \(O(N^3)\)
\(\tilde{{\color{#ff8c00}{\boldsymbol{R}}}}\leftarrow{\color{#ff6347}{\boldsymbol{R}}}\);
// with complexity of \(O(2N-1)\sim O(N)\)
\(\color{#3cb371}{\mathbf{REPEAT}}\)
| // with complexity of \(O(N^2)\)
| \([i,j]\leftarrow{\color{#696969}{\mathbf{find}}}(\tilde{{\color{#ff8c00}{\boldsymbol{R}}}},{\color{#696969}{\mathbf{bind}}}(\sum_nr_{in}<1,\sum_mr_{mj}<1))\);
| \(\epsilon\leftarrow1-\max[\sum_nr_{in},\sum_mr_{mj}]\);
| \(r_{ij}\leftarrow\epsilon+r_{ij}\);
| \({\color{#696969}{\mathbf{update}}}(\tilde{{\color{#ff8c00}{\boldsymbol{R}}}})\);
\(\color{#3cb371}{\mathbf{UNTIL}}\) \(\sum_{n,m}r_{nm}=N\);

// find set of positive numbers \({\color{#c71585}{\boldsymbol{\phi}}}_k>0\) with permutation matrices \({\color{#c71585}{\boldsymbol{P}}}_k,{\rm\ st.\ }\tilde{{\color{#ff8c00}{\boldsymbol{R}}}}=\sum_k{\color{#c71585}{\boldsymbol{\phi}}}_k{\color{#c71585}{\boldsymbol{P}}}_k\), with total complexity of \(O(N^{4.5})\), which further means \(\sum_{k=1}^K{\color{#c71585}{\boldsymbol{\phi}}}_k=1\), doubly stochastic matrices are within the convex hull of permutation matrices
\([i_1,i_2,\cdots,i_N]\leftarrow{\color{#696969}{\mathbf{find}}}(\tilde{{\color{#ff8c00}{\boldsymbol{R}}}},{\color{#696969}{\mathbf{bind}}}(\prod_{k=1}^N\tilde{r}_{ki_k}>0))\);
\(\phi'\leftarrow\min_{1\leq k\leq N}[\tilde{r}_{ki_k}]\);
// the permutation matrix of \([i_1,i_2,\cdots,i_N]\)
\(s_{perm}\leftarrow{\color{#696969}{\mathbf{to\_perm}}}([i_1,i_2,\cdots,i_N])\);
\(R'\leftarrow\tilde{{\color{#ff8c00}{\boldsymbol{R}}}}-\phi's_{perm}\);
// with complexity of \(O(N^2-2N+2)\sim O(N^2)\)
\(\color{#2e8b57}{\mathbf{FOR}}\) \({\color{#696969}{\mathbf{true}}}\)
| \(\color{#6b8e23}{\mathbf{IF}}\) \(\phi'<1\)
| | // with complexity improved to \(O(N^{2.5})\)
| | \([i_1,i_2,\cdots,i_N]\leftarrow{\color{#696969}{\mathbf{find}}}(R',{\color{#696969}{\mathbf{bind}}}(\prod_{k=1}^N\tilde{r}_{ki_k}>0))\);
| | \(R'\leftarrow R'/(1-\phi')\);
| | \(\phi'\leftarrow\min_{1\leq k\leq N}[\tilde{r}_{ki_k}]\);
| | \(\mathbf{s}_{perm}\leftarrow{\color{#696969}{\mathbf{to\_perm}}}([i_1,i_2,\cdots,i_N])\);
| | \(R'\leftarrow R'-\phi's_{perm}\);
| \(\color{#6b8e23}{\mathbf{ELSE}}\)
| | \(\color{#6b8e23}{\mathbf{BREAK}}\);
| \(\color{#6b8e23}{\mathbf{END}}\)
| \([{\color{#c71585}{\boldsymbol{\Phi}}},{\color{#c71585}{\boldsymbol{\mathscr{P}}}}].{\color{#696969}{\mathbf{emplaced\_back}}}[\phi',R']\);
\(\color{#2e8b57}{\mathbf{END}}\)

​ 裏面的 \({\color{#2e8b57}{\mathbf{FOR}}}\)-\({\color{#6b8e23}{\mathbf{IF}}}\) loop 也能夠直接表示爲一個帶條件的 \({\color{#2e8b57}{\mathbf{FOR}}}\) loop,只是我本身以爲這樣寫會稍微清楚一些。這樣子獲得了分解後,就能夠進一步在每一輪仲裁中,都以每個分解後的置換矩陣對應的正數的倒數做爲此交換的虛完成時間 \(F_k^\ell=1/\phi_k\),做爲一種方案,這裏將全部 \(F_k^\ell,k=1,\cdots,K\) 從小到大排序,每次選最小的那個做爲這輪的鏈接方式,若這一輪選了 \(F_k^\ell\),那麼下一輪的 \(F_k^{\ell+1}=F_k^\ell+1/\phi_k\) 就行了,這個複雜度顯然能夠由 \(K\leq N^2-2N+2\) 看出,是 \(O(\log N)\) (這種方法算是 packetized generalized processor sharing, PGPS 算法的簡化版本)

​ 爲了獲得一種既考慮 efficiency 又顧及 fairness 的調度方案,上面用到的速率矩陣 \(R\) 須要仔細地進行測量,這顯然是一個優化問題 (resource sharing problem),首先記 guaranteed-rate services 爲 \(R^g=(r_{ij}^g)\),再如下面的 online measurement 方法迭代求得第 \(n\) 次測量週期下的 demand rate \(r_{ij}^e(n)\)

\[\begin{equation} \begin{split} &r_{ij}^e(n+2)=(1-\alpha(n))r_{ij}^e(n+1)+\alpha(n)\bigg[\frac{A_{ij}(nT)-A_{ij}((n-1)T)}T\bigg],\\ &r_{ij}^e(0)=r_{ij}^e(1)=\frac1N, \end{split} \end{equation} \]

​ 裏面的 \(\alpha(n)\) 算是可調整佔比的常數,若是網絡流變化很迅速的話,適當調高 \(\alpha(n)\) 有利於調度算法快速適應變化,\(T\) 爲測量週期,\(A_{ij}\) 爲累計到達量。能夠看出,咱們所須要的最優解必須介於 demand rate \(r_{ij}^e\) 與 guaranteed-rate \(r_{ij}^g\) 之間,把它看成一種約束,這就轉化爲一個對於效益函數 \(U(\cdot)\) 的優化問題

\[\begin{equation} \begin{split} &\max\ \ \ \ \ \ \ &U(r_{ij},i,j=1,\cdots,N)\sim\sum_{i=1}^Nr_{ij}\sim\text{fairness},\\ &\text{s.t.}& \left\{ \begin{split} &r_{ij}^g\leq r_{ij}\leq r_{ij}^e,\ \ &i,j=1,2,\cdots,N,\\ &\sum_{i=1}^Nr_{ij}\leq1,&j=1,2,\cdots,N,\\ &\sum_{j=1}^Nr_{ij}\leq1,&i=1,2,\cdots,N, \end{split} \right. \end{split} \end{equation} \]

​ 效益函數的不一樣取值就表明了 efficiency 與 fairness,前者對應一個最大流問題,然後者能夠用水漫法 (water filling) 進行求解,這就完成了整個調度算法的流程,據仿真結果顯示 [3] 它可以達到 \(\it100\%\) 的 throughput,只是平均隊列長度要稍微高於 output buffered switch 的模擬值

​ 這種 crossbar 結構也能夠經過多層網絡的鏈接而得到 scalability,基本思路就是將每個 crossbar 模塊看做一個單元,用網絡拓撲將它們鏈接起來,例如能夠用 Banyan 拓撲將 \(\it4\times4\) 的 Birkhoff-von Neumann crossbar switches鏈接成一個二層網絡,然而這種結構具備三條關於 no overbooking 的約束 (前面只有兩個),其速率受到限制,爲此能夠再加一層網絡,這至關於使用十二個 \(\it4\times4\) 的置換矩陣來表示一個 \(\it16\times16\) 的置換矩陣,在這裏的調度算法就須要先求解優化問題獲得 allocated rate matrix \(R\),只不過這個 \(R\) 應該是一個 \(\it16\times16\) 的矩陣,對它做分解獲得 \(\it16\times16\)\(K\) 個置換矩陣們,再以 Slepian-Duguid 算法將它們分解爲 \(\it12K\)\(\it4\times4\) 的置換矩陣,將它們反過來合成 \(\it1\sim12\) crossbar 對應的 \(R\) 陣,最後用 Birkhoff-von Neumann 進行分解求得調度權值進行調度便可


[0.0] 面號:[OPTSxNaN]

Too basic to have NN... ...

[1] Optical switching in next generation data centers[M]. Springer, 2017.

[1.1] Calabretta N, Miao W. Optical switching in data centers: Architectures based on optical packet/burst switching[M]//Optical Switching in Next Generation Data Centers. Springer, Cham, 2018: 45-69.

[1.2] Huang Q. Commercial Optical Switches[M]//Optical Switching in Next Generation Data Centers. Springer, Cham, 2018: 203-219.

[2] Chao H J, Liu B. High performance switches and routers[M]. John Wiley & Sons, 2007.

[3] Chang C S, Chen W J, Huang H Y. Birkhoff-von Neumann input buffered crossbar switches[C]//Proceedings IEEE INFOCOM 2000. Conference on Computer Communications. Nineteenth Annual Joint Conference of the IEEE Computer and Communications Societies (Cat. No. 00CH37064). IEEE, 2000, 3: 1614-1623.

[4] Yan F, Miao W, Raz O, et al. Opsquare: A flat DCN architecture based on flow-controlled optical packet switches[J]. IEEE/OSA Journal of Optical Communications and Networking, 2017, 9(4): 291-303.

[5] Kitayama K I, Huang Y C, Yoshida Y, et al. Torus-topology data center network based on optical packet/agile circuit switching with intelligent flow management[J]. Journal of Lightwave Technology, 2015, 33(5): 1063-1071.

[6] https://math.stackexchange.com/questions/47175/does-birkhoff-von-neumann-imply-any-of-the-fundamental-theorems-in-combinatori

付録┍1┙

​ 這裏稍微嚴格一點寫一下先前提到的 Birkhoff-von Neumann 定理,首先是文字表述,也即雙隨機矩陣都包含於置換矩陣的凸包 (convex hull),反之亦然,那麼如今記一個雙隨機矩陣 \(R=[r_{ij}]\),則定理表述爲

\[\begin{equation} \begin{split} R\in\bigcup_{K=1}^{n!}\bigg\{\sum_{k=1}^K\phi_kP_k:\sum_{k=1}^K\phi_k=1,\alpha_k\in\R_+,P_k\in S_n\bigg\}\in{\rm co}(S_n), \end{split} \end{equation} \]

​ 不失廣泛性,能夠令 \(M\leq n^2-n+1\),其證實過程用到 Frobenius‐König 定理 [6] ,思路以下

​ 對於 \(\boxplus(R)=|\{(i,j):r_{ij}\neq0\}|\) 進行概括,\(\boxplus(R)=n\) 對應着 \(R\) 置換矩陣的情形,此時若假設以上命題對 \(\boxplus(\cdot)=N\) 成立,考慮 \(\boxplus(R)=N>n\),下列條件知足

\[\begin{equation} \begin{split} \forall1\leq i\leq n,\mathcal{I}\in\bigg(\begin{matrix}[n]\\r\end{matrix}\bigg),\mathcal{J}\in\bigg(\begin{matrix}[n]\\s\end{matrix}\bigg),{\ \text{s.t.}\ }r+s=n+1\to R[\mathcal{I},\mathcal{J}]\neq\mathbf{0}_{r\times s}, \end{split} \end{equation} \]

​ 則由 Frobenius‐König 定理,總能取置換 \(\tau\in S_n{\ \text{s.t.}\ }R[i,\tau(i)]\neq0\),這裏記 \(\phi=\min_{1\leq i\leq n}R[i,\tau(i)]\in(0,1)\),則有分解 \(R=\phi\tau+(1-\phi)R'\),其中的 \(R'=(1-\phi)^{-1}(R-\alpha\tau)\) 仍爲雙隨機矩陣,又有 \(\boxplus(R')<\boxplus(R)=N\),由概括假設得證 \(\blacksquare\)

相關文章
相關標籤/搜索