• 沒有找到結果。

第五章  實驗結果及分析

5.3  分析與比較

平行LFSR編碼法改進的速度比原本的方法快很多,甚至贏了LLM相當 之多,當糾錯數為1的情況下是非常好的,如圖9所示:

圖 9 未使用查表法及使用各種查表法之所需時間整合比較圖

而若將數據做一成長的幅度表則可以表示成如下圖:

圖 10 兩種方法改進後的成長幅度

建表的資料大小會隨不同的糾錯數或不同的迦羅瓦場,而有不同的儲 存體。LLM方法的建表法是以兩項資料為一組當索引值,因此組合數是資 料大小乘上資料大小;在糾錯數是1時建表法在3.2中有提到,而在糾錯數增 加至2時,依然可使用3.2中所建的表格做計算,而在改進後的LLM方法的儲 存體使用量為symbol大小乘上symbol大小再加上M(α0)的表格所需之儲存 體,可視為固定的儲存體使用量。因此若在symbol大小是28、糾錯個數是1 的情況下就需要256*256+256*256=128k bytes。平行LFSR方法則必需考量資

料硬碟數、訊息值以及儲存表格所需要的儲存體,因此所需要之儲存體是 硬碟總個數(n-2t)乘上資料值(2m)大小再乘上儲存在儲存體所需之空間 (2t*2m bits),若m是8、糾錯個數是1、硬碟總個數255的情況下,可以得出 253*256*2*256 bits,化簡過後便是126.5k bytes。

在symbol大小同為256 bits、糾錯數同樣為1時,不同的硬碟數可以獲得 圖11的結果。LLM的方法在symbol大小不變的情況下,所需的表格都為固 定的,只需在一開始判斷是為偶數硬碟數還是奇數硬碟數,其後便可使用 查表法加快計算冗餘資料。平行LFSR方法則必需在不同的硬碟數時,先行 計算冗餘係數組以及次方、訊息對應的結果資料表後,才能較直接的計算 冗餘資料。

圖 11 LLM與pLSFR之不同硬碟數所需儲存體

提升糾錯個數時,LLM之建表法只與symbol大小有關,因此可以繼續 使用於計算冗餘資料;平行LFSR方法則因為建表過程中需使用生成多項式 計算係數後,再乘上資料值完成表格,因此必須更新其建表之表單,並且 因為儲存在儲存體所需之空間變多而需要更多的儲存體(如圖12)

圖 12 糾錯數為2時LLM與pLSFR之不同硬碟數所需儲存體

增加糾錯個數時,LLM計算冗餘資料的方法複雜度會提升,因此計算 冗餘的時間也因此會增加。平行LFSR則因只受資料硬碟數、訊息值以及儲 存表格所需之儲存體影響,因此其計算的時間並不受影響,能說是處在一 種時間穩定的狀態。

第六章 結論

由成長幅度圖(圖10)可知Lagrange-Like Method在改進後計算冗餘資料 的速度,明顯的比傳統的方法快40%以上,且需要使用128k bytes的儲存體。

平行LFSR Method明顯的可以發現改進後的方法比使用傳統的LFSR方法還 快80%以上,且僅需要使用126.5K Bytes的儲存體。

Lagrange-Like Method能在不同的糾錯數依然可使用,並且儲存體並不 受影響,只是必須考量額外的冗餘資料所帶來的時間複雜度。平行LFSR Method則因冗餘資料增加,必需付出更多的儲存體,但其計算冗餘資料的 時間卻是穩定的。

目前的RAID6或稱為n+2 parity的磁碟陣列方法中,以RS code之生成多 項式的架構去做是為一不錯的方法,因可以視需求而改變不同的糾錯數,

雖必須付出額外的儲存體,不過以現今來說此儲存體的使用量不算多,而 可使計算冗餘資料的時間處在一穩定的時間裡;RS code之生成多項式的架 構使磁碟陣列有著更高的彈性及可靠度,只是若還要更高的糾錯個數,便 需要在儲存體及運算速度上做一考量。

參考文獻

[1] David A. Patterson , Garth Gibson, Randy H. Katz, “A case for redundant arrays of inexpensive disks (RAID)”, Proceedings of the 1988 ACM SIGMOD international conference on Management of data, Chicago, Illinois, United States, pp.109-116, June 01-03, 1988

[2] Patterson, D.A.; Chen, P.; Gibson, G.; Katz, R.H.; “Introduction to redundant arrays of inexpensive disks (RAID) “, COMPCON Spring ‘89.

Thirty-Fourth IEEE Computer Society International Conference:

Intellectual Leverage, Digest of Papers., pp.112-117, 1989

[3] Stephen B. Wicker. “Error Control Systems for Digital Communication and Storage”, Prentice-Hall, Inc, 1995

[4] H. Peter Anvin, “The mathematics of RAID-6”, http://kernel.org/pub/linux/kernel/people/hpa/raid6.pdf, 2007

[5] Min-An Song, Sy-Yen Kuo, I-Feng Lan, “A Low Complexity Design of Reed Solomon Code Algorithm for Advanced RAID System”, IEEE Transactions on Consumer Electronics, Volume 53 , Issue 2, Dec. 2006 [6] M. Blaum, J. Brady, J. Bruck, and J. Menon, “EVENODD: An efficient

scheme for tolerating double disk failures in RAID architectures”, IEEE Transactions on Comput., pp. 192-202. Feb. 1995.

[7] I. S. Reed and G. Solomon, “Polynomial codes over certain finite fields”, Journal of the Society of industrial and Applied Mathematics., vol. 8. pp.

300-304, June 1960.

[8] Wicker and Bhargava, “Reed-Solomon Codes and Their Applications”, IEEE Press, 1994.

[9] Lloyd N. Trefethen, “Barycentric Lagrange Interpolation”, SIAM REVIEW, pp. 501–502, Vol. 46, No. 3, 2004

[10] 喻強, “利用查表法於(204,188,t=8)RS 編碼", 義守大學資訊工程研 究所碩士論文, July, 2010.

[11] “ Linear feedback shift register”, http://en.wikipedia.org/wiki/Linear_feedback_shift_register, last modified

at 17:29 on 30 June 2011

[12] W. G. Horner, “A New Method of Solving Numerical Equations of All Orders, by Continuous Approximation”, Published by: The Royal Society, pp. 308-335, 1819

[13] 袁國元. “利用 RS-code 編解碼積體電路實現高可靠度磁碟陣列之研 究", 義守大學資訊工程研究所碩士論文. 八十九年六月.

[14] “Dictionary R”. Storage Networking Industry Association. Retrieved Nov.

24, 2007

附錄 A

//---galois field 之乘法器--- unsigned char TForm1::GFM(unsigned char x,unsigned char y)

{

unsigned char c=0;

if (x!=0 && y!=0)

c=a[(b[x]+b[y])%255];

return c;

}

//---galois field 之元素表產生法--- unsigned char one,pr,n,m;

char temp[80]; //for output m=8; //8 bits of a symbol pr=29; //primitive polynomial n=pow(2,m)-1; //codeword length one=1; //a register to compute element //make element table

a=new unsigned char[n+1];

b=new unsigned char[n+1];

a[n]=1;

for(int i=0;i<pow(2,m);i++) {

a[i]=0;

b[i]=0;

}

for(int i=0;i<pow(2,m);i++) {

b[one]=(unsigned char)i;

one=((one<<1)&(unsigned char)(pow(2,m)-1))^(((unsigned char)(one>>(m-1))&0x01)*pr);

}

//---LLM_ori--- clock_t start, end;

int n1=0;

unsigned char I1[256]; //message char temp[80];

for(int i=0;i<255;i++) I1[i]=0;

//I1[1] is map to Q, I1[0] is map to P for(int l=2;l<255;l++)

I1[l]=I[l];

for(int k=4;k<253;k++) {

n1=k+1;

start=clock();

for(int i=0;i<COUNTER;i++) {

I1[0]=0;

I1[1]=0;

for(int j=n1;j>=2;j--) {

I1[0]=I1[0]^I1[j];

I1[1]=GFM(I1[1]^I1[j],2);

} }

end=clock();

}

sprintf(temp,"LLM_ori is finished");

ListBox3->Items->Add(temp);

//---LLM_tab--- clock_t start, end;

unsigned char Table[65536];

unsigned char I1[256];

char temp[80];

int n1=0;

int mdata;

for(int data0=0;data0<256;data0++) for(int data1=0;data1<256;data1++) {

mdata=((data1<<8)&0xffff)|(data0)&0xff;

Table[mdata]=GFM(data1,2)^(data0&0xff);

}

for(int i=0;i<255;i++) I1[i]=0;

//I1[1] is map to Q, I1[0] is map to P for(int i=2;i<255;i++)

I1[i]=I[i];

for(int k=4;k<253;k++) {

n1=k+1;

if(k%2==0) //even {

for(int i=0;i<COUNTER;i++) {

I1[0]=0;

I1[1]=0;

for(int j=n1;j>=2;j--) I1[0]=I1[0]^I1[j];

for(int j=n1;j>=5;j=j-2)

I1[1]=GFM(I1[1]^Table[(I1[j]<<8|I1[j-1])],4);

I1[1]=I1[1]^Table[(I1[3]<<8|I1[2])];

}

end=clock();

}

else //odd {

start=clock();

for(int i=0;i<COUNTER;i++) {

I1[0]=0;

I1[1]=0;

for(int j=n1;j>=2;j--) I1[0]=I1[0]^I1[j];

for(int j=n1;j>=6;j=j-2)

I1[1]=GFM(I1[1]^Table[(I1[j]<<8|I1[j-1])],4);

I1[1]=GFM(I1[1]^Table[((I1[4]<<8)|I1[3])],2);

I1[1]=I1[1]^I1[2];

}

end=clock();

} }

sprintf(temp,"LM_tab was finished");

ListBox4->Items->Add(temp);

//---LLM_tab0--- clock_t start, end;

unsigned char Table[65536],Table0[65536];

unsigned char I1[256];

char temp[80];

int n1=0;

int mdata;

for(int data0=0;data0<256;data0++) for(int data1=0;data1<256;data1++) {

mdata=((data1<<8)&0xffff)|(data0)&0xff;

Table0[mdata]=data1^data0;

Table[mdata]=GFM(data1,2)^(data0&0xff);

}

for(int i=0;i<255;i++) I1[i]=0;

//I1[1] is map to Q, I1[0] is map to P for(int i=2;i<255;i++)

I1[i]=I[i];

for(int k=4;k<253;k++) {

n1=k+1;

if(k%2==0) //even {

for(int i=0;i<COUNTER;i++) {

I1[0]=0;

I1[1]=0;

for(int j=n1;j>=5;j=j-2) {

I1[0]^=Table0[(I1[j]<<8|I1[j-1])];

I1[1]=GFM(I1[1]^Table[(I1[j]<<8|I1[j-1])],4);

}

I1[0]^=Table0[(I1[3]<<8|I1[2])];

I1[1]=I1[1]^Table[(I1[3]<<8|I1[2])];

}

end=clock();

}

else //odd {

start=clock();

for(int i=0;i<COUNTER;i++) {

I1[0]=0;

I1[1]=0;

for(int j=n1;j>=6;j=j-2) {

I1[0]^=Table0[(I1[j]<<8|I1[j-1])];

I1[1]=GFM(I1[1]^Table[(I1[j]<<8|I1[j-1])],4);

}

I1[0]^=Table0[(I1[4]<<8|I1[3])];

I1[0]=I1[0]^I1[2];

I1[1]=GFM(I1[1]^Table[((I1[4]<<8)|I1[3])],2);

I1[1]=I1[1]^I1[2];

}

end=clock();

} }

sprintf(temp,"LM_tab0 was finished");

ListBox4->Items->Add(temp);

//---pLFSR_ori--- int n1=0;

int oldd1;

int I1[255],d1[256],d0[256];

char temp[80];

clock_t start, end;

int sum=0;

for(int j=254;j>=2;j--) {

for(int i=0;i<255;i++) I1[i]=0;

d1[j]=0;d0[j]=0;

I1[j]=1;

for(int i=254;i>=0;i--) {

oldd1=d1[j];

d1[j]=GFM(oldd1,3)^d0[j];

d0[j]=GFM(oldd1,2)^I1[i];

} }

I1[i]=0;

for(int i=2;i<255;i++) I1[i]=I[i];

for(int k=4;k<253;k++) {

n1=k+1;

start=clock();

for(int i=0;i<COUNTER;i++) {

I1[0]=0;

I1[1]=0;

for(int j=2;j<n1;j++) {

I1[1]=I1[1]^GFM(I1[j],d1[j]);

I1[0]=I1[0]^GFM(I1[j],d0[j]);

} }

end=clock();

}

sprintf(temp,"pLFSR_ori was finished");

ListBox5->Items->Add(temp);

//---pLFSR_tab--- int d1=0,d0=0;

int oldd1;

char temp[80];

int I1[255];

int d[255];

int cc[256][256];

int n1=0;

int sum=0;

clock_t start, end;

for(int j=254;j>=2;j--) {

for(int i=0;i<255;i++) I1[i]=0;

d1=0;d0=0;

I1[j]=1;

for(int i=254;i>=0;i--) {

oldd1=d1;

d1=GFM(oldd1,3)^d0;

d0=GFM(oldd1,2)^I1[i];

}

for(int k=0;k<255;k++){

cc[j][k]=(GFM(d1,k)<<8)|GFM(d0,k);

} }

//compute the remainder & all data by random & sum of all of them for(int i=0;i<255;i++)

I1[i]=0;

for(int i=2;i<255;i++) I1[i]=I[i];

for(int k=4;k<253;k++) {

n1=k+1;

start=clock();

I1[1]=0;

for(int j=0;j<COUNTER;j++) {

sum=0;

for(int i=2;i<n1;i++) sum=sum^cc[i][I1[i]];

I1[1]=(sum>>8)&0xff;

I1[0]=sum&0xff;

}

end=clock();

}

sprintf(temp,"pLFSR_tab was finished");

ListBox6->Items->Add(temp);

相關文件