计网实验lab1 coding on error dectecting algorithms(c++)

上传人:第*** 文档编号:30570169 上传时间:2018-01-30 格式:DOC 页数:6 大小:60.67KB
返回 下载 相关 举报
计网实验lab1 coding on error dectecting algorithms(c++)_第1页
第1页 / 共6页
计网实验lab1 coding on error dectecting algorithms(c++)_第2页
第2页 / 共6页
计网实验lab1 coding on error dectecting algorithms(c++)_第3页
第3页 / 共6页
计网实验lab1 coding on error dectecting algorithms(c++)_第4页
第4页 / 共6页
计网实验lab1 coding on error dectecting algorithms(c++)_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《计网实验lab1 coding on error dectecting algorithms(c++)》由会员分享,可在线阅读,更多相关《计网实验lab1 coding on error dectecting algorithms(c++)(6页珍藏版)》请在金锄头文库上搜索。

1、 计算机通信与网络实验课程实验报告实验一 : LAB1 Coding on error dectecting algorithms(C+)实验名称:LAB1 Coding on error dectectingalgorithms(C)1.实验内容1. Cyclic redundancy checkUsing the polynomials below to encode random generated data stream (40-100bits). Show the FEC, and encoded data frame.CRC-4 x4+x+1 ITU G.704CRC-16 x16

2、+x15+x2+1 IBM SDLCCRC-32 x32+x26+x23+.+x2+x+1 ZIP, RAR, IEEE 802 LAN/FDDI, IEEE 1394, PPP-FCSFor the error patter listed below, what the conclusion does the receiver get? Can the receiver findthe errors?Case Error patternNo error 00000000One error 1000.000Two errors 100.001Random errors Random error

3、 pattern2.Parity checkUsing even or odd parity check on random generated data stream (8-20bits).Show encoded data frame.For the error patter listed below, what the conclusion does the receiver get? Can the receiver find the errors?Case Error patternNo error 00000000One error 1000.000Two errors 100.0

4、012.实验结果一、二、3.实验程序一、#include #include #include stdlib.hunsigned int char2int(char *str)unsigned int count=0, ret=0;for(count = 0; count1;return c;void CRC(char *scode, char *p, char*g )unsigned int iP = char2int(p);unsigned int iG = char2int(g);unsigned int r= getR(g);unsigned int code = iP = getRi(

5、iG);) yx = yx (iG#include void fun(char *s)int i=0;int sum=0;for(i=0;i200;i+)sum=sum+si;if(sum+1)%2=0)printf(+1 通过偶校验);if(sum+0)%2!=0)printf(+0 通过奇校验);if(sum+1)%2=1)printf(+1 通过奇校验);if(sum+0)%2=0)printf(+0 通过偶校验);int main()printf(输入二进制码:n);char scr200;gets(scr);fun(scr);奇校验:就是让原有数据序列中(包括你要加上的一位)1 的个数为奇数。偶校验:就是让原有数据序列中(包括你要加上的一位)1 的个数为偶数

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号