计网实验data-link-layer-simulation_第1页
计网实验data-link-layer-simulation_第2页
计网实验data-link-layer-simulation_第3页
免费预览已结束,剩余4页可下载查看

下载本文档

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

文档简介

1、?电脑通信与网络实验?课程实验报告实验二 : 2.data link layer simulation实验名称: 2.data link layer simulation2.Simulation on Performance of Data Link Control ProtocolsUsing 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

2、error for the following error-control techniques:a. Stop-and-waitb. Go-back-N with w=7c. Go-back-N with w=127d. Selective reject with w=7e. Selective reject with w=127Do all of the preceding for the following values of a: 0.1, 1, 10, 100. Draw conclusions about which technique is appropriate for var

3、ious ranges oaf.2.实验结果V一一IToLFmNEJb jn£NWJZt沖 Wtw f®MDWM 口 inNr-pui-d=v-IDODiSmp rd iQEMiKi-Hwih i NvKha137 'satedM fei *ii r Saterfcq rapid wti * 可A=100a=0.1时,W=7或者127都是大于2a+1;a=1时,W=7或者127都是大于2a+1;a=10时,那么选择拒绝和返回 N都是一个分段函数. a=100时,那么选择拒绝和返回 N都是一个分段函数。3实验程序a = 0:0.1:1000;W = 1,7,127;f

4、or j = 1:3for i = 1:le ngth(a)if W(j) >= 2*a(i)+1U(i) = 1;elseU(i) = W(j)/(2*a(i)+1);endendif j = 1W1 = U;endif j = 2W7 = U;endif j = 3W10 = U;endend plot(a,W1); hold on;plot(a,W7); plot(a,W10); set(gca,'xscale','log'); axis(0.1 1000 0 1);a = 0:0.1:1000;W = 1,7,127,127;P=10A(-3);f

5、or j = 1:4 for i = 1:length(a)if W(j) =1U(i) = (1-P)/(1+2*a(i);endif W(j)=7if W(2) >= 2*a(i)+1U(i) = 1-P;elseU(i) = W(j)*(1-P)/(2*a(i)+1);endendif W(j)=127 if W(j) >= 2*a(i)+1U(i) = (1-P)/(1+2*a(i)*P); Y(i) = 1-P;elseU(i) = W(j)*(1-P)/(2*a(i)+1)*(1-P+W(j)*P);Y(i) = W(j)*(1-P)/(2*a(i)+1);endend

6、if j = 1W1 = U;endif j = 2 W7 = U;endif j = 3W10 = U;endif j = 4 W = Y;endend end plot(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);endfunction U=selective_reject(a,W,P)U=(1-P).*(W&g

7、t;=2*a+1)+W.*(1-P)./(2.*a+1).*(W<2*a+1);endfunction U=gobackn(a,W,P)U=(1-P)./(1+2.*a.*P).*(W>=2*a+1)+W.*(1-P)./(2.*a+1)./(1-P+W.*P).*(W<2*a+1); endfunction lab2_draw(a)P=0:0.1:1000;U=stopandwait(a,P);semilogx(P,U,'r');hold onU=selective_reject(a,7,P);semilogx(P,U,'g');hold onU=gobackn(a,7,P);semilogx(P,U,'b');hold onU=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-wait','Go-back-N with

温馨提示

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

最新文档

评论

0/150

提交评论