annotate FinalThesis/chapter2.tex @ 29:f26ac86036ba

bibliography
author riono <e165729@ie.u-ryukyu.ac.jp>
date Sat, 15 Feb 2020 22:59:52 +0900
parents 3a6c2fd368b4
children 77951f2269aa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
1 \chapter{TreeVNCの基本概念}
1
c1f1f84bb7b6 add template
e165729 <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 \label{chap:concept}
c1f1f84bb7b6 add template
e165729 <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
4 \section{Virtual Network Computing}
29
f26ac86036ba bibliography
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
5 Virtual Network Computing\cite{vnc}(以下VNC)は、サーバ側とクライアント(ビューワー)側からなるリモートデスクトップソフトウェアである。遠隔操作にはサーバを起動し、クライアント側がサーバに接続することで可能としている。
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
7 \section{Remote Frame Bufferプロトコル}
29
f26ac86036ba bibliography
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
8 Remote Frame Buffer(以下RFB)プロトコル\cite{rfbprotocol}とはVNC上で使用される、自身のPC画面をネットワーク上に送信し他人のPC画面に表示を行うプロトコルである。画面が表示されるユーザ側をRFBクライアントと呼び、画面送信を行うためにFrameBufferの更新が行われる側をRFBサーバと呼ぶ。
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
9
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
10 FrameBufferとは、メモリ上に置かれた画像データのことである。RFBプロトコルでは、最初にプロトコルのバージョンの確認や認証が行われる。その後、RFBクライアントへ向けてFramebufferの大きさやデスクトップに付けられた名前などが含まれている初期メッセージを送信する。
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
11
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
12 RFBサーバ側はFramebufferの更新が行われるたびに、RFBクライアントに対してFramebufferの変更部分を送信する。さらに、RFBクライアントからFramebuffer - UpdateRequestが来るとそれに答え返信する。変更部分のみを送信する理由は、更新があるたびに全画面を送信すると、送信するデータ面と更新にかかる時間面において効率が悪くなるからである。
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
13 \newpage
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
14 \section{TreeVNCの構造}
29
f26ac86036ba bibliography
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
15 TreeVNCはjavaを用いて作成されたTight VNC\cite{tightvnc}を元に作成されている。 TreeVNCはVNCを利用して画面配信を行っているが、従来のVNCでは配信(サーバ)側のPCに全ての参加者(クライアント)が接続するため負荷が大きくなってしまう(図\ref{fig:vncStruct})。
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
16
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
17 \begin{figure}[htb] %PDF
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
18 \begin{center}
12
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
19 \includegraphics[scale=0.33]{fig/vncStruct.pdf}
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
20 \figcaption{従来のVNCでの接続構造}
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
21 \label{fig:vncStruct}
6
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
22 \end{center}
ce78d25fe03e add images
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
23 \end{figure}
1
c1f1f84bb7b6 add template
e165729 <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
c1f1f84bb7b6 add template
e165729 <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
26 そこでTreeVNCではサーバに接続を行ってきたクライアントをバイナリツリー状(木構造)に接続する。接続してきたクライアントをノードとし、その下に新たなノードを最大2つ接続していく。これにより人数分のデータのコピーと送信の手間を分散することができる(図\ref{fig:TreevncStruct})。
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
27
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
28 \begin{figure}[htb] %PDF
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
29 \begin{center}
12
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
30 \includegraphics[scale=0.35]{fig/TreevncStruct.pdf}
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
31 \figcaption{TreeVNCでの接続構造}
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
32 \label{fig:TreevncStruct}
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
33 \end{center}
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
34 \end{figure}
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
35
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
36
8
79d35da7b115 update and add Bloking img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
37 バイナリツリー状に接続することで、N台のクライアントが接続を行ってきた場合、従来のVNCではサーバ側がN回のコピーを行って画面配信する必要があるが、TreeVNCでは各ノードが最大2回ずつコピーするだけで画面配信が可能となる。
79d35da7b115 update and add Bloking img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
38
79d35da7b115 update and add Bloking img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
39 送信されるデータは従来の方法だとN個のノードに対してN-1回の通信が必要である。これはバイナリツリー状の構造を持っているTreeVNCでも通信の数は変わらない。
79d35da7b115 update and add Bloking img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
40
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
41 木構造のルートのノードをRoot Nodeと呼び、そこに接続されるノードをNodeと呼ぶ。Root Nodeは子Nodeにデータを渡す機能、各Nodeの管理、VNCサーバから送られてきたデータの管理を行っている。各Nodeは、親Nodeから送られてきたデータを自身の子Nodeに渡す機能、子Nodeから送られてきたデータを親Nodeに渡す機能がある。
8
79d35da7b115 update and add Bloking img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
42
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
43 \section{TreeVNCの通信プロトコル}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
44 TreeVNCの通信経路としては以下が挙げられる。
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
45 \begin{itemize}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
46 \item 任意のNodeからRoot Nodeに直接通信を行うsend direct message (Node to Root)
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
47 \item Root Nodeから任意のNodeに直接通信を行うsend direct message (Root to Node)
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
48 \item 任意のNodeから木構造を上に辿ってRoot Nodeまで通信を行う message up tree (Node to Root)
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
49 \item Root Nodeから木の末端のNodeまでの全てのNodeに通信を行うmessage down tree (Root to Node)
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
50 \item Root Nodeから配信者のVNCサーバへの通信を行う send message (Root to VNC Server)
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
51 \item 配信者のVNCサーバからRoot Nodeへの通信を行う send message (VNC Server to Root)
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
52 \end{itemize}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
53
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
54 Node間で行われるメッセージ通信にはRFBプロトコルで提供されているメッセージに加え、TreeVNC独自のメッセージを使用している。TreeVNCで使用されるメッセージの一覧を表\ref{tb:messageTable}に示す。
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
55
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
56 \begin{table}[tbp]
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
57 \begin{center}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
58 \tblcaption{通信経路とメッセージ一覧}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
59 \scalebox{0.7}{
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
60 \begin{tabular}{|l|l|l|} \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
61 通信経路 & message & 説明 \\ \hline \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
62 & FIND\_ROOT & TreeVNC接続時にRoot Nodeを探す. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
63 send direct message & WHERE\_TO\_CONNECT & 接続先をRoot Nodeに聞く. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
64 (Node to Root) & LOST\_CHILD & 子Nodeの切断をRoot Nodeに知らせる. \\ \hline \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
65
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
66 & FIND\_ROOT\_REPLY & FIND\_ROOTへの返信. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
67 send direct message & CONNECT\_TO\_AS\_LEADER & 左子Nodeとして接続する.接続先のNodeが含まれている. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
68 (Root to Node) & CONNECT\_TO & 右子Nodeとして接続する.接続先のNodeが含まれている. \\ \hline \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
69
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
70 message down tree & FRAMEBUFFER\_UPDATE & 画像データ.EncodingTypeを持っている.\\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
71 (Root to Node) & CHECK\_DELAY & 通信の遅延を測定する. \\ \hline \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
72
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
73 message up tree & CHECK\_DELAY\_REPLY & CHECK\_DELAYへの返信. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
74 (Node to Root) & SERVER\_CHANGE\_REQUEST & 画面切り替え要求. \\ \hline \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
75
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
76 & FRAMEBUFFER\_UPDATE\_REPLY & 画像データの要求. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
77 send message & SET\_PIXEL\_FORMAT & pixel値の設定. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
78 (Root to VNCServer) & SET\_ENCODINGS & pixelデータのencodeTypeの設定. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
79 & KEY\_EVENT & キーボードからのイベント. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
80 & POINTER\_EVENT & ポインタからのイベント. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
81 & CLIENT\_CUT\_TEXT & テキストのカットバッファを持った際のmessage. \\ \hline \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
82
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
83 & FRAMEBUFFER\_UPDATE & 画像データ.EncodingTypeを持っている. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
84 send message & SET\_COLOR\_MAP\_ENTRIES & 指定されているpixel値にマップするRGB値. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
85 (VNCServer to Root) & BELL & ビープ音を鳴らす. \\ \cline{2-3}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
86 & SERVER\_CUT\_TEXT & サーバがテキストのカットバッファを持った際のmessage. \\ \hline
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
87 \end{tabular}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
88 }
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
89 \label{tb:messageTable}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
90 \end{center}
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
91 \end{table}
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
92
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
93 \newpage
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
94
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
95 \section{MulticastQueue}
27
3a6c2fd368b4 fix chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
96 配信側の画面が更新されると、VNCサーバから画面データがFRAME\_BUFFER\_UPDATEメッセージとして送られる。その際親Nodeが受け取った画像データを、同時に複数の子Nodeに伝えるためにMulticastQueueというキューにデータを蓄積を行う。
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
97
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
98 各NodeはMulticastQueueからデータを取得するスレッドを持つ。MulticastQueueは複数のスレッドから使用される。
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
99 MulticastQueueはjava.util.concurrent.CountDownLatchを用いて実装されている。CountDownLatchとはjavaの並列実行用に用意されたAPIで、他のスレッドで実行中の操作が完了するまで、複数のスレッドを待機させることができるクラスである。スレッドを解放するカウントを設定することができ、カウントが0になるまでawaitメソッドでスレッドをブロックすることができる。
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
100
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
101 TreeVNCでは、親NodeがMulticastQueueを持っており、接続されている子Nodeの数だけ画像データにカウントを設定する。子Nodeが画像データを取得すると、そのカウントが減る。接続している全ての子Nodeが画像データを取得するとカウントが0になり、MulticastQueueから画像データが削除される。
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
102
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
103 \newpage
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
104
8
79d35da7b115 update and add Bloking img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
105 \section{木の再構成}
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
106 TreeVNCはバイナリツリー状での接続のため、Nodeが切断されたことを検知できずにいると構成した木構造が崩れてしまい、新しいNodeを適切な場所に接続できなくなってしまう。そこで木構造を崩さないよう、Node同士の接続の再構成を行う必要がある。
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
107
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
108 TreeVNCの木構造の接続形態はRoot Nodeが持っているnodeListというリストで管理している。nodeList内のtreeNumという値が各Nodeに割り当てられており、これによって木構造のどの位置にNodeが接続されているかの判別が可能である。
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
109 よって、Nodeの接続が切れた場合Root Nodeに切断を知らせなければならない。TreeVNCはLOST\_CHILDというメッセージ通信で、Node切断の検知および木構造の再構成を行っている。
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
110
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
111 LOST\_CHILDの検出方法には、MulticastQueueを用いている。親NodeがMulticastQueueを持っているが、接続している全ての子Nodeが画像データを取得するまでMulticastQueueの中に入っている画像データを削除することができない。子NodeがMulticastQueueから画像データを取得せずに、画像データが溜まり続けると親NodeがMemoryOverFlowを起こしてしまう。この問題を回避するためにTimeoutスレッドが用意されている。Timeoutを検知した際にNodeとの接続が切れたと判断する。
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
112 LOST\_CHILDの検知と木構造の再構成の手順を以下に示す。
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
113
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
114 \begin{itemize}
12
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
115 \item 子Nodeの切断を検知したNodeがRoot NodeへLOST\_CHILDメッセージを送信する(図\ref{fig:lostchild}中、1: lostChild())
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
116 \item LOST\_CHILDメッセージを受け取ったRoot NodeはnodeListの更新を行う(図\ref{fig:lostchild}中、2: updateNodeList())
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
117 \item 切断したNodeをnodeListから削除し、nodeListの最後尾のNodeに切断したNodeとtreeNumを割り当てる
12
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
118 \item Root Nodeは最後尾のNodeに、切断した子Nodeが接続していた親Nodeに接続するよう、COMMECT\_TOメッセージを送信する(図\ref{fig:lostchild}中、3: connectTo(1))
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
119 \item 最後尾のNodeが子Nodeを失った親Nodeへ接続を行う(図\ref{fig:lostchild}中、4: connectToParent(1))
11
357b0da7e417 update chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
120 \end{itemize}
9
772ccca4fb6e update thesis
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
121
12
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
122 \begin{figure}[htb] %PDF
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
123 \begin{center}
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
124 \includegraphics[scale=0.5]{fig/LostChild.pdf}
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
125 \figcaption{LOST\_CHILDの検知・再接続}
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
126 \label{fig:lostchild}
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
127 \end{center}
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
128 \end{figure}
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
129
14
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
130 LOST\_CHILDによって、切断された全てのNodeを検知することができるため、nodeListの更新が正しく行われる。よって、新しく接続を行ってきたNodeを適切な場所に接続することが可能となる。
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
131
12
edcd2f53121b update chapter2 and add lostchild img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
132 \section{データの圧縮形式}
29
f26ac86036ba bibliography
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
133 TreeVNCはZRLEE\cite{taninari:2012a}というエンコードタイプでデータのやり取りを行う。ZRLEEはRFBプロトコルで使用できるZLREというエンコードタイプを元に生成される。
14
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
134
29
f26ac86036ba bibliography
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
135 ZLRE(Zlib Run-Length Encoding)とは可逆圧縮可能なZlib形式\cite{zlib}とRun-Length Encoding方式を組み合わせたエンコードタイプである。
14
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
136
18
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
137 ZLREはZlibで圧縮されたデータとそのデータのバイト数がヘッダーとして付与され送信される。Zlibはjava.util.zip.deflaterとjava.util.zip.inflaterで圧縮と解凍が行える。しかしjava\.util.zip.deflaterは解凍に必要な辞書を書きだす(flush)ことが出来ない。従って、圧縮されたデータを途中から受け取ってもデータを正しく解凍することが出来ない(図\ref{fig:ZRLE})。
14
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
138
16
ece683512a08 add ZRLE encode img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
139 \begin{figure}[htb] %PDF
ece683512a08 add ZRLE encode img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
140 \begin{center}
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
141 \includegraphics[scale=0.5]{fig/EncodeZRLE.pdf}
18
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
142 \figcaption{ZRLEでデータを途中から受け取った場合}
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
143 \label{fig:ZRLE}
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
144 \end{center}
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
145 \end{figure}
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
146
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
147 \newpage
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
148
21
fa92cb03dac1 update chapter3 and add Blocking UpdateRectangle image
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
149 そこでZRLEEは一度Root Nodeで受け取ったZRLEのデータをunzipし、後述するUpdate Rectangleと呼ばれる画面ごとのデータに辞書を付与してzipし直すことで、初めからデータを読み込んでいなくても解凍を出来るようになっている(図\ref{fig:ZRLEtoZRLEE})。
18
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
150
27
3a6c2fd368b4 fix chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
151 一度ZRLEEに変換してしまえば、子Nodeはそのデータをそのまま流すだけでよい。ただし、deflaterとinflaterでは前回までの通信で得た辞書をクリアしないとけないため、Root Node側とNode側では毎回新しく作る必要がある。辞書をクリアすることで短時間で解凍され画面描画されるという、適応圧縮を実現していることになり圧縮率が向上する。
18
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
152
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
153 \begin{figure}[htb] %PDF
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
154 \begin{center}
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
155 \includegraphics[scale=0.5]{fig/EncodeZRLEtoZRLEE.pdf}
18
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
156 \figcaption{ZRLEEへ再圧縮されたデータを途中から受け取った場合}
16
ece683512a08 add ZRLE encode img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
157 \label{fig:ZRLEtoZRLEE}
ece683512a08 add ZRLE encode img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
158 \end{center}
ece683512a08 add ZRLE encode img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
159 \end{figure}
14
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
160
18
c62e7b4ffa54 fix finalMid abstract
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
161 \newpage
14
2acb79484a99 update chapter2 "ZRLEE"
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
162
21
fa92cb03dac1 update chapter3 and add Blocking UpdateRectangle image
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
163 TreeVNCではRFBプロトコルによって配信側の画面の変更部分はFRAME\_BUFFER\_UPDATEメッセージとして送られてくる。メッセージの中には変更部分の原点のx,y座標と縦横の幅等が含まれており、長方形として展開される。この長方形をUpdate Rectangleと呼ぶ。
19
279572a352f3 update chapter2 ZRLEE and Share Screen
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
164
279572a352f3 update chapter2 ZRLEE and Share Screen
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
165 \section{ShareScreen}
279572a352f3 update chapter2 ZRLEE and Share Screen
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
166 ゼミでは発表者が順々に入れ替わる。発表者が入れ替わるたびに共有する画面の切り替えが必要となる。ゼミを円滑に進めるために、画面の切り替えをスムーズに行いたい。
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
167
19
279572a352f3 update chapter2 ZRLEE and Share Screen
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
168 画面の共有にプロジェクタを使用する場合、発表者が変わるたびにケーブルの抜き差しを行う必要がある。その際に、PCとプロジェクタを接続するための変換アダプタが必要になる場合や、接触不良が起こる等の煩わしい問題が生じることがある。
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
169
19
279572a352f3 update chapter2 ZRLEE and Share Screen
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
170 従来のVNCでは、配信者が切り替わるたびにVNCの再起動、サーバ・クライアント間の再接続を行う必要がある。TreeVNCは配信者の切り替えのたびに生じる問題を解決している。
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
171
19
279572a352f3 update chapter2 ZRLEE and Share Screen
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
172 TreeVNCを立ち上げることでケーブルを使用する必要なしに、各参加者の手元のPCに発表者の画面を共有することができる。画面の切り替えについてはユーザがVNCサーバへの際接続を行うことなく、ビューワー側のShare Screenボタンを押すことで配信者の切り替えが可能となっている。
7
f03759ec7fe6 udpate chapter2
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
173
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
174 TreeVNCのRoot Nodeは配信者のVNCサーバと通信を行なっている。VNCサーバから画面データを受信し、そのデータを子Nodeへと送信している。配信者切り替え時にShare Screenを実行すると、Root Nodeに対しSERVER\_CHANGE\_REQUESTというメッセージが送信される。このメッセージにはShare Screenボタンを押したNodeの番号やディスプレイ情報が付与されている。メッセージを受け取ったRoot Nodeは配信を希望しているNodeのVNCサーバと通信を始める。そのためTreeVNCは配信者切り替えのたびにVNCを終了し再接続する必要がない。
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
175
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
176 \newpage
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
177
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
178 \section{複数のネットワーク接続時の木の構成}
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
179 TreeVNCはRoot Nodeが複数のネットワークに接続している場合、図\ref{fig:multinetwork}のようにネットワーク別にを形成する。TreeVNCはRoot NodeがTreeManagerを持っている。TreeManagerはTreeVNCの接続部分を管理しており、木構造を管理するnodeListの生成を行う。このnodeListを元に、新しいNodeの接続や、切断検出時の接続の切り替え等を行なっている。
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
180
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
181 TreeManagerはRoot Nodeの保持しているネットワーク毎に生成される。新しいNodeが接続してきた際、interfacesからNodeのネットワークと一致するTree Managerを取得し、Node接続の処理を任せる。
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
182
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
183 \begin{figure}[htb] %PDF
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
184 \begin{center}
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
185 \includegraphics[scale=0.7]{fig/MultiNetworkTree.pdf}
25
f98010ed4fa9 add TileLoop flow img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
186 \figcaption{Multi Network Tree}
22
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
187 \label{fig:multinetwork}
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
188 \end{center}
0f95ad78a36c update chapter2 and add multinetworkTree img
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
189 \end{figure}