基于asn.1 ber規(guī)約的編解碼系統(tǒng)設計.doc
基于asn.1 ber規(guī)約的編解碼系統(tǒng)設計,基于asn.1 ber規(guī)約的編解碼系統(tǒng)設計摘要asn.1是一種高級抽象語法標記語言,在任何需要以數(shù)字方式發(fā)送信息的地方,asn.1都可以發(fā)送各種形式的信息(聲頻、視頻、數(shù)據(jù)等),它以一種獨于計算機架構(gòu)和語言的方式來描述數(shù)據(jù)。ber是asn.1中的基本編碼規(guī)則,它描述具體的asn.1對象如何編碼成比特流在網(wǎng)絡上進行傳輸,...
內(nèi)容介紹
此文檔由會員 資料題庫大全 發(fā)布基于ASN.1 BER規(guī)約的編解碼系統(tǒng)設計
摘要
ASN.1是一種高級抽象語法標記語言,在任何需要以數(shù)字方式發(fā)送信息的地方,ASN.1都可以發(fā)送各種形式的信息(聲頻、視頻、數(shù)據(jù)等),它以一種獨于計算機架構(gòu)和語言的方式來描述數(shù)據(jù)。BER是ASN.1中的基本編碼規(guī)則,它描述具體的ASN.1對象如何編碼成比特流在網(wǎng)絡上進行傳輸,數(shù)據(jù)首先經(jīng)過BER編碼,再經(jīng)由傳輸層協(xié)議發(fā)送到接收方,接收方在相應的端口收到數(shù)據(jù)包后,經(jīng)過BER解碼,得到具體的操作數(shù)據(jù)。本文的主要工作就是設計實現(xiàn)一個基于ASN.1 BER規(guī)約的編解碼系統(tǒng)。
本文分析比較了ASN.1定義的數(shù)據(jù)值編碼算法。開始部分對BER編碼規(guī)則進行比較詳細的分析,按照標識符八位位組,長度八位位組,內(nèi)容八位位組的編碼結(jié)構(gòu),討論比較編碼的各種算法及其特點,并由此確定本文數(shù)據(jù)值編碼環(huán)節(jié)中所采用的編碼算法。由ASN.1 BER定義的數(shù)據(jù)值編碼的算法,設計出各種數(shù)據(jù)值編碼程序的流程圖,用C/C++程序設計語言,在Microsoft Visual C++ 6.0環(huán)境下編寫編碼程序。在編寫出完整的編碼程序后,運行測試程序,給出相應的數(shù)據(jù)值編碼結(jié)果截圖,驗證編碼算法的正確性。
本文成功實現(xiàn)了一個基于ASN.1 BER規(guī)約的可視化編解碼通信系統(tǒng)。在VC(MFC)平臺下,基于已實現(xiàn)的數(shù)據(jù)值編碼模塊和解碼模塊,使用UDP協(xié)議,簡單模擬兩臺計算機通過ASN.1 BER規(guī)約,編碼、傳輸、解碼數(shù)據(jù)。所設計的編解碼可視化通信系統(tǒng),在一定程度上模擬了ASN.1在表示層的具體應用。
關鍵詞:ASN.1,BER,編碼,算法,可視化編程
Design of Encoding and Decoding System
Based on ASN.1 BER
Abstract
ASN.1--Abstract Syntax Notation One--is a high-level language, which can send information in various forms, such as audio, video, data, etc, to anywhere that information can be sent through figures. It describes data in the way owned by computer structure and computer language. BER is the basic encoding rules of ASN.1, which describes how a specific object ASN.1 encoded bit stream for transmission on the network. The data first passes through the BER encoding, then being sent to the receiver via the transport layer protocol. The receiver receives data packets in the corresponding port, and then gets the specific operation data after BER decoding. This paper is designed to implement an encoding and decoding system based on the ASN.1 BER Statute.
This paper analyzes and compares the data value encoding algorithm defined in ASN.1. This paper first gives a detailed analysis of BER encoding rules, discussing and comparing the various algorithms encoding and characteristics in accordance with the identifier octet, octet length, content, coding structure octets. In this way, the author determines the data value encoding part of the encoding algorithm used in this paper. Design a variety of data value encoding process flow chart according to the ASN.1 BER encoded data value algorithm. Write code procedures under Microsoft Visual C + + 6.0 environment by using C / C + + programming language. Run the test program after encoding in the preparation of a complete program, and then give the results of the corresponding data value encoding capture, verifying the coding algorithm.
This paper is designed to implement a visualizing system based on ASN.1 BER Statute successfully. Based on data values that have been achieved encoding module and decoding module, this paper, using the UDP protocol in the VC (MFC) platform, demonstrates a simple simulation of two computers coding, transmission and decoding data through ASN.1 BER. The encoding and decoding visual communication system designed in this paper, to a certain extent, is a simulation of ASN.1 specific application in the presentation layer.
Keywords: ASN.1, BER, Encoding, Algorithm, Visual programming
目錄
摘要 I
Abstract II
目錄 III
第一章 緒論 1
1.1 ASN.1 BER規(guī)約概述 1
1.2 ASN.1 BER規(guī)約的應用與發(fā)展前景 2
1.3 本文內(nèi)容和結(jié)構(gòu)安排 3
第二章 ASN.1 BER的編碼算法 4
2.1 ASN.1 BER數(shù)據(jù)值的編碼組成 4
2.1.1 標識符八位位組 4
2.1.2 長度八位位組 5
2.1.3 內(nèi)容八位位組 6
2.1.4 內(nèi)容結(jié)束八位位組 6
2.1.5 數(shù)據(jù)值編碼結(jié)果的存儲方式 6
2.2 布爾值 7
2.3 整數(shù)值和枚舉值 7
2.4 實數(shù)值 9
2.4.1 實數(shù)值的編碼規(guī)則 9
2.4.2 實數(shù)值的精度 10
2.4.3 實數(shù)值的編碼算法 11
2.5 位串值 12
2.6 八位位組串值 13
2.7 空值 13
2.8 結(jié)構(gòu)化值 13
2.8.1 序列值 13
2.8.2 單一序列值 14
2.8.3 集合值 14
2.8.4 單一集合值 15
2.8.5 選擇值 15
2.9 本章小結(jié) 15
第三章 基于ASN.1 BER規(guī)約的編碼實現(xiàn) 16
3.1 布爾值的編碼 16
3.2 整數(shù)值和枚舉值的編碼 17
3.3 實數(shù)值的編碼 19
3.3.1 實數(shù)值編碼分析 19
3.3.2 單精度浮點數(shù)編碼 21
3.3.3 雙精度浮點數(shù)編碼 22
3.4 位串值的編碼 23
3.5 八位位組串值的編碼 24
3.6 空值的編碼 25
3.7 結(jié)構(gòu)化編碼 27
3.7.1 序列值的編碼 27
3.7.2 單一序列值的編碼 29
3.7.3 集合值的編碼 29
3.7.4 單一集合值的編碼 30
3.8 編碼系統(tǒng) 30
3.8.1 編碼系統(tǒng)的設計說明 30
3.8.2 編碼系統(tǒng)設計流程圖 31
3.8.3 編碼系統(tǒng)運行結(jié)果 32
3.9 本章小結(jié) 34
第四章 基于ASN.1 BER規(guī)約的可視化編解碼系統(tǒng)及通信 35
4.1 ASN.1 BER 可視化編解碼系統(tǒng) 35
4.2 編解碼系統(tǒng)通信的實現(xiàn) 36
4.3 編解碼通信系統(tǒng)功能擴展 39
4.4 編解碼通信系統(tǒng)測試 40
4.5 本章小結(jié) 44
第五章 總結(jié) 45
5.1 主要內(nèi)容回顧 45
5.2 本次設計的不足和進一步的完善 45
致謝 47
參考文獻 48
附錄A High-performance ASN.1 compiler 49
附錄B 高性能的ASN.1編譯器 55