CRC码的编码和解码程序是什么?

来源:百度知道 编辑:UC知道 时间:2024/06/16 03:23:33
--CRC校验码实验要求:编写出CRC码的编码和解码程序。
(1)实验框架:CRC编码-信道传输-CRC解码。
(2)CRC编码将原始数据按照既定的生成多项式进行编码;
(2)信道传输中实现模拟信道,某些位数据随机发生差错;
(3)CRC解码要能准确判断是否有差错,无差错要恢复出原始数据。

--ARQ协议
实验要求:模拟不同信道环境(6种,三种基本协议,三种滑动窗)下的数据通讯。
(1)实验框架:数据发送程序--模拟信道--数据接收程序
(2)要求理解ARQ协议的内容,分析实验现象

上机实验(3)--获取本地主机名和IP地址
(1)实验要求:通过编程来获取本地主机名和IP地址
(2)学习使用winsock编程,通过WinSock来简单容易的获取IP地址

上机实验(4)--网络命令的应用
(1)实验要求:对ping、tracert、netstat、nslookup、arp、route、nbtstat、net等网络命令进行上机实验。
(2)熟悉各个命令的主要功能,记录实验数据,并进行分析

注:对所有的实验均应提交实验报告,实验报告包括实验目的、实验环境(软、硬件)、实验方法、实验分析和结论等内容。
也可自选题目,但工作量和难度不应低于本大纲。

我有一个别人变得CRC程序,其中有好几种CRC的编码方法,也许会有用
using System;

namespace Communication.IO.Tools
{
/// <summary>
/// Tool to calculate and add CRC codes to a string
///
/// ***************************************************************************
/// Copyright (c) 2003 Thoraxcentrum, Erasmus MC, The Netherlands.
///
/// Written by Marcel de Wijs with help from a lot of others,
/// especially Stefan Nelwan
///
/// This code is for free. I ported it from several different sources to C#.
///
/// For comments: Marcel_de_Wijs@hotmail.com
/// ***************************************************************************
/// </summary>
public class CRCTool
{
// 'order' [1..32] is the CRC polynom order, counted without the leading '1' bit
// 'polynom' is the CRC polynom without leading '1&