计网实验data link layer simulation_第1页
计网实验data link layer simulation_第2页
计网实验data link layer simulation_第3页
计网实验data link layer simulation_第4页
计网实验data link layer simulation_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

计算机通信与网络实验 课程实验报告实验二 : 2.data link layer simulation实验名称:2.data link layer simulation1.实验内容1.Draw Figure7.12 and 7.13.2.Simulation on Performance of Data Link Control Protocols Using the same assumptions that are used for Figure 7.13 in Appendix 7A, plot line utilization as a function of P, the probability that a single frame is in error for the following error-control techniques: a. Stop-and-wait b. Go-back-N with w=7 c. Go-back-N with w=127 d. Selective reject with w=7 e. Selective reject with w=127 Do all of the preceding for the following values of a: 0.1, 1, 10, 100. Draw conclusions about which technique is appropriate for various ranges of a. 2.实验结果A=0.1A=1A=10A=100a=0.1时,W=7或者127都是大于2a+1; a=1时,W=7或者127都是大于2a+1; a=10时,则选择拒绝和返回N都是一个分段函数.a=100时,则选择拒绝和返回N都是一个分段函数。 3.实验程序Figure7.12a = 0:0.1:1000;W = 1,7,127;for j = 1:3 for i = 1:length(a) if W(j) = 2*a(i)+1 U(i) = 1; else U(i) = W(j)/(2*a(i)+1); end end if j = 1 W1 = U; end if j = 2 W7 = U; end if j = 3 W10 = U; endendplot(a,W1);hold on;plot(a,W7);plot(a,W10);set(gca,xscale,log);axis(0.1 1000 0 1);Figure7.13a = 0:0.1:1000;W = 1,7,127,127;P=10(-3);for j = 1:4 for i = 1:length(a) if W(j) =1 U(i) = (1-P)/(1+2*a(i); end if W(j)=7 if W(2) = 2*a(i)+1 U(i) = 1-P; else U(i) = W(j)*(1-P)/(2*a(i)+1); end end if W(j)=127 if W(j) = 2*a(i)+1 U(i) = (1-P)/(1+2*a(i)*P); Y(i) = 1-P; else U(i) = W(j)*(1-P)/(2*a(i)+1)*(1-P+W(j)*P); Y(i) = W(j)*(1-P)/(2*a(i)+1); end end if j = 1 W1 = U; end if j = 2 W7 = U; end if j = 3 W10 = U; end if j = 4 W = Y; end endendplot(a,W1);hold on;plot(a,W7);plot(a,W10);plot(a,W);set(gca,xscale,log);axis(0.1 1000 0 1);2、Drawfunction U=stopandwait(a,P) U=(1-P)./(1+2*a); end function U=selective_reject(a,W,P) U=(1-P).*(W=2*a+1)+W.*(1-P)./(2.*a+1).*(W=2*a+1)+W.*(1-P)./(2.*a+1)./(1-P+W.*P).*(W2*a+1); endfunction lab2_draw(a) P=0:0.1:1000; U=stopandwait(a,P); semilogx(P,U,r); hold on U=selective_reject(a,7,P); semilogx(P,U,g); hold on U=gobackn(a,7,P); semilogx(P,U,b); hold on U=selective_reject(a,127,P); semilogx(P,U,k); hold on U=gobackn(a,127,P); semilogx(P,U,y); ylabel(Utilization) ;xlabel(P); legend(Stop-and

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论