数据链路层协议仿真实验.doc

上传人:土8路 文档编号:10128650 上传时间:2021-04-22 格式:DOC 页数:25 大小:97.50KB
返回 下载 相关 举报
数据链路层协议仿真实验.doc_第1页
第1页 / 共25页
数据链路层协议仿真实验.doc_第2页
第2页 / 共25页
数据链路层协议仿真实验.doc_第3页
第3页 / 共25页
数据链路层协议仿真实验.doc_第4页
第4页 / 共25页
数据链路层协议仿真实验.doc_第5页
第5页 / 共25页
点击查看更多>>
资源描述

《数据链路层协议仿真实验.doc》由会员分享,可在线阅读,更多相关《数据链路层协议仿真实验.doc(25页珍藏版)》请在三一文库上搜索。

1、数据链路层协议仿真实验信息安全 092370 董琦【实验目的】了解各个协议的组成,原理以及帧传输方式,掌握每个协议之间的关系【实验准备】通过在puternetworks5e.org下载的linux仿真器源码包进行编译,能够得到协议2-协议6的模拟器模拟数据链路协议。通过运行模拟器,能够仿真几个协议的运行模式,得到实验数据。【实现功能】分别运行协议2-协议6的模拟器模拟数据链路协议,输入不同的参数,观察运行结果【实验环境】core 2 T4200 2GHz 内存 2G内核:Linux version 3.0.0-12-generic (builddvernadsky)操作系统:ubuntu 11

2、.10【实验步骤】1根据说明文当,可以使用以下方法运行程序。 ./protocol-program events timeout pct_loss pct_cksum debug_flags datafile_flagwhere * events tells how long to run the simulation * timeout gives the timeout interval in ticks * pct_loss gives the percentage of frames that are lost (0-99) * pct_cksum gives the percenta

3、ge of arriving frames that are bad (0-99) * debug_flags enables various tracing flags: 1frames sent 2frames received 4timeouts 8periodic printout for use with long runs* datafile_flag enables output of summary data to a data filefor later processing with a script (includingthe GUI). The output file

4、will be totdata.txt. Values of this flag are 0 or 1:0do not append data to totdata.txt0append data to totdata.txtFor example ./protocol6 100000 40 20 10 3 1 【实验结果】1.运行protocol2 参数为./protocol2 100 50 20 10 1 1protocol2是一个无措信道上的单工停等协议。其基本原理是发送方以高于接收方处理能力的速度发送帧,导致接收方被淹没。我们假设通信信道不会出错,并且数据流量是单工的。发送方发送一帧,

5、等待确认到达后才能继续发送。其中100表示他将以50个tick的时间间隔运行100个协议实体进程。20的丢包率,10的校验和错误率(的80通过),它会打印出每帧的行发送或接收。汇总数据也将被追加到totdata.txt。运行结果如下: Simulating Protocol 2 Events: 100 Parameters: 50 20 10 Tick 0. Proc 0 sent frame: type=Data seq=134529037 ack=0 payload=0 Tick 3. Proc 1 sent frame: type=Ack seq=0 ack=0 payload=0 Ti

6、ck 7. Proc 0 sent frame that got lost: type=Data seq=134529038 ack=0 payload=1 Process 0: Total data frames sent: 2 Data frames lost: 1 Data frames not lost: 1 Frames retransmitted: 0 Good ack frames recd: 1 Bad ack frames recd: 0 Good data frames recd: 0 Bad data frames recd: 0 Payloads accepted: 0

7、 Total ack frames sent: 0 Ack frames lost: 0 Ack frames not lost: 0 Timeouts: 0 Ack timeouts: 0 Process 1: Total data frames sent: 0 Data frames lost: 0 Data frames not lost: 0 Frames retransmitted: 0 Good ack frames recd: 0 Bad ack frames recd: 0 Good data frames recd: 1 Bad data frames recd: 0 Pay

8、loads accepted: 1 Total ack frames sent: 1 Ack frames lost: 0 Ack frames not lost: 1 Timeouts: 0 Ack timeouts: 0 Efficiency (payloads accepted/data pkts sent) = 50% End of simulation. Time=100 从运行结果之中可以看出,有两个进程,分别指明了发送和接受的情况,丢包律、误码率等等都和事先设定好的参数一致。2.运行protocol3 参数设定为./protocol3 500 50 20 10 2 1protoc

9、ol3是一个有错信道上的单工停等协议。帧可能会损坏,也可能会完全丢失。如果一帧在传输过程之中被破坏,则接收方硬件在计算校验和时会检测出来,如果一帧在被破坏之后校验和仍然是正确的,则这个协议将会失败。发送方在他送法送的每一个帧的头部放上一个序号。发送方发送一帧,等待确认到达后才能继续发送。其中100表示他将以50个tick的时间间隔运行100个协议实体进程。20的丢包率,10的校验和错误率(的80通过),它会打印出每帧的行发送或接收。汇总数据也将被追加到totdata.txt。运行结果:Simulating Protocol 3 Events: 500 Parameters: 50 20 10

10、Tick 0. Proc 0 sent frame: type=Data seq=0 ack=0 payload=0 Tick 1. Proc 1 got good frame: type=Data seq=0 ack=0 payload=0 Tick 1. Proc 1 sent frame: type=Ack seq=1 ack=0 payload=0 Tick 7. Proc 0 got good frame: type=Ack seq=1 ack=0 payload=0 Tick 7. Proc 0 sent frame that got lost: type=Data seq=1 a

11、ck=0 payload=1 Tick 50. Proc 0 sent frame that got lost: type=Data seq=1 ack=0 payload=1 Tick 102. Proc 0 sent frame that got lost: type=Data seq=1 ack=0 payload=1 Tick 153. Proc 0 sent frame: type=Data seq=1 ack=0 payload=1 Tick 158. Proc 1 got good frame: type=Data seq=1 ack=0 payload=1 Tick 158.

12、Proc 1 sent frame that got lost: type=Ack seq=1 ack=1 payload=0 Tick 206. Proc 0 sent frame that got lost: type=Data seq=1 ack=0 payload=1 Tick 257. Proc 0 sent frame: type=Data seq=1 ack=0 payload=1 Tick 268. Proc 1 got bad frame: type=Data seq=1 ack=0 payload=1 Tick 308. Proc 0 sent frame: type=Da

13、ta seq=1 ack=0 payload=1 Tick 311. Proc 1 got good frame: type=Data seq=1 ack=0 payload=1 Tick 311. Proc 1 sent frame that got lost: type=Ack seq=1 ack=1 payload=0 Tick 358. Proc 0 sent frame: type=Data seq=1 ack=0 payload=1 Tick 365. Proc 1 got good frame: type=Data seq=1 ack=0 payload=1 Tick 365.

14、Proc 1 sent frame: type=Ack seq=1 ack=1 payload=0 Tick 368. Proc 0 got good frame: type=Ack seq=1 ack=1 payload=0 Tick 368. Proc 0 sent frame: type=Data seq=0 ack=0 payload=2 Tick 373. Proc 1 got good frame: type=Data seq=0 ack=0 payload=2 Tick 373. Proc 1 sent frame that got lost: type=Ack seq=1 ac

15、k=0 payload=0 Tick 408. Proc 0 sent frame: type=Data seq=0 ack=0 payload=2 Tick 412. Proc 1 got good frame: type=Data seq=0 ack=0 payload=2 Tick 412. Proc 1 sent frame: type=Ack seq=1 ack=0 payload=0 Tick 415. Proc 0 got good frame: type=Ack seq=1 ack=0 payload=0 Tick 415. Proc 0 sent frame: type=Da

16、ta seq=1 ack=0 payload=3 Tick 420. Proc 1 got good frame: type=Data seq=1 ack=0 payload=3 Tick 420. Proc 1 sent frame: type=Ack seq=1 ack=1 payload=0 Tick 421. Proc 0 got good frame: type=Ack seq=1 ack=1 payload=0 Tick 421. Proc 0 sent frame that got lost: type=Data seq=0 ack=0 payload=4 Tick 468. P

17、roc 0 sent frame: type=Data seq=0 ack=0 payload=4 Tick 471. Proc 1 got good frame: type=Data seq=0 ack=0 payload=4 Tick 471. Proc 1 sent frame that got lost: type=Ack seq=1 ack=0 payload=0 Process 0: Total data frames sent: 14 Data frames lost: 5 Data frames not lost: 9 Frames retransmitted: 9 Good

18、ack frames recd: 4 Bad ack frames recd: 0 Good data frames recd: 0 Bad data frames recd: 0 Payloads accepted: 0 Total ack frames sent: 0 Ack frames lost: 0 Ack frames not lost: 0 Timeouts: 9 Ack timeouts: 0 Process 1: Total data frames sent: 0 Data frames lost: 0 Data frames not lost: 0 Frames retra

19、nsmitted: 0 Good ack frames recd: 0 Bad ack frames recd: 0 Good data frames recd: 8 Bad data frames recd: 1 Payloads accepted: 5 Total ack frames sent: 8 Ack frames lost: 4 Ack frames not lost: 4 Timeouts: 0 Ack timeouts: 0 Efficiency (payloads accepted/data pkts sent) = 35% End of simulation. Time=

20、500 从运行结果之中可以看出,有两个进程,分别指明了发送和接受的情况,丢包律、误码率等等都和事先设定好的参数一致。然而,其中也存在了一些不可预测的情况,有些晕行多次以后每次的运行结果是不同的。3.运行protocol4 参数设定为:./protocol 500 50 20 10 2 1protocol4是一个一位滑动窗口协议。由于发送方在发出一帧以后必须等待前一帧的确认到来以后才能发送下一帧。其中1000表示他将以50个tick的时间间隔运行1000个协议实体进程。20的丢包率,10的校验和错误率(的80通过),它会打印出每帧的行发送或接收。汇总数据也将被追加到totdata.txt。运行结

21、果:Simulating Protocol 4 Events: 500 Parameters: 50 20 10 Tick 2. Proc 0 got good frame: Tick 3. Proc 1 got good frame: type=Data seq=0 ack=1 payload=0 type=Data seq=0 ack=1 payload=0 Tick 158. Proc 1 got bad frame: Tick 157. Proc 0 got bad frame: type=Data seq=0 ack=0 payload=0 type=Data seq=0 ack=0

22、 payload=0 Tick 159. Proc 1 got good frame: type=Data seq=0 ack=0 payload=0 Tick 163. Proc 0 got good frame: type=Data seq=0 ack=0 payload=0 Tick 164. Proc 0 got good frame: type=Data seq=1 ack=0 payload=1 Tick 167. Proc 1 got good frame: type=Data seq=1 ack=0 payload=1 Tick 168. Proc 0 got good fra

23、me: type=Data seq=1 ack=1 payload=1 Tick 173. Proc 1 got good frame: type=Data seq=1 ack=1 payload=1 Tick 174. Proc 0 got good frame: Tick 175. Proc 1 got good frame: type=Data seq=0 ack=1 payload=2 type=Data seq=0 ack=1 payload=2 Tick 176. Proc 1 got good frame: type=Data seq=0 ack=0 payload=2 Tick

24、 181. Proc 0 got good frame: type=Data seq=0 ack=0 payload=2 Tick 183. Proc 1 got bad frame: Tick 184. Proc 0 got bad frame: type=Data seq=1 ack=0 payload=3 type=Data seq=1 ack=0 payload=3 Tick 187. Proc 0 got good frame: Tick 186. Proc 1 got good frame: type=Data seq=1 ack=0 payload=3 type=Data seq

25、=1 ack=0 payload=3 Tick 188. Proc 1 got good frame: type=Data seq=1 ack=1 payload=3 Tick 195. Proc 0 got good frame: type=Data seq=1 ack=1 payload=3 Tick 196. Proc 0 got good frame: type=Data seq=0 ack=1 payload=4 Tick 198. Proc 1 got good frame: type=Data seq=0 ack=1 payload=4 Tick 200. Proc 1 got

26、good frame: Tick 201. Proc 0 got good frame: type=Data seq=0 ack=0 payload=4 type=Data seq=0 ack=0 payload=4 Tick 203. Proc 1 got good frame: type=Data seq=1 ack=0 payload=5 Tick 206. Proc 0 got good frame: type=Data seq=1 ack=0 payload=5 Tick 207. Proc 0 got good frame: type=Data seq=1 ack=1 payloa

27、d=5 Tick 213. Proc 1 got good frame: type=Data seq=1 ack=1 payload=5 Tick 214. Proc 1 got good frame: type=Data seq=0 ack=1 payload=6 Tick 216. Proc 0 got good frame: type=Data seq=0 ack=1 payload=6 Tick 217. Proc 0 got bad frame: type=Data seq=0 ack=0 payload=6 Tick 218. Proc 1 got bad frame: type=

28、Data seq=0 ack=0 payload=6 Tick 220. Proc 1 got good frame: type=Data seq=0 ack=0 payload=6 Tick 223. Proc 0 got good frame: type=Data seq=0 ack=0 payload=6 Tick 322. Proc 1 got good frame: type=Data seq=1 ack=0 payload=7 Tick 321. Proc 0 got good frame: type=Data seq=1 ack=0 payload=7 Tick 324. Pro

29、c 0 got good frame: Tick 326. Proc 1 got good frame: type=Data seq=1 ack=1 payload=7 type=Data seq=1 ack=1 payload=7 Tick 327. Proc 1 got bad frame: type=Data seq=0 ack=1 payload=8 Tick 333. Proc 0 got bad frame: type=Data seq=0 ack=1 payload=8 Tick 337. Proc 1 got bad frame: type=Data seq=0 ack=1 p

30、ayload=8 Tick 336. Proc 0 got bad frame: type=Data seq=0 ack=1 payload=8 Tick 338. Proc 0 got good frame: type=Data seq=0 ack=1 payload=8 Tick 346. Proc 1 got good frame: type=Data seq=0 ack=1 payload=8 Tick 374. Proc 1 got good frame: type=Data seq=0 ack=0 payload=8 Tick 376. Proc 0 got good frame:

31、 type=Data seq=0 ack=0 payload=8 Tick 377. Proc 0 got good frame: type=Data seq=1 ack=0 payload=9 Tick 381. Proc 1 got good frame: type=Data seq=1 ack=0 payload=9 Tick 425. Proc 1 got bad frame: Tick 426. Proc 0 got bad frame: type=Data seq=1 ack=1 payload=9 type=Data seq=1 ack=1 payload=9 Tick 427.

32、 Proc 1 got good frame: type=Data seq=1 ack=1 payload=9 Tick 433. Proc 0 got good frame: type=Data seq=1 ack=1 payload=9 Tick 435. Proc 0 got good frame: type=Data seq=0 ack=1 payload=10 Tick 439. Proc 1 got good frame: type=Data seq=0 ack=1 payload=10 Tick 440. Proc 1 got good frame: type=Data seq=

33、0 ack=0 payload=10 Tick 441. Proc 0 got good frame: type=Data seq=0 ack=0 payload=10 Tick 491. Proc 1 got good frame: type=Data seq=1 ack=0 payload=11 Tick 492. Proc 0 got good frame: type=Data seq=1 ack=0 payload=11 Process 0: Total data frames sent: 38 Data frames lost: 9 Data frames not lost: 29

34、Frames retransmitted: 8 Good ack frames recd: 0 Bad ack frames recd: 0 Good data frames recd: 23 Bad data frames recd: 6 Payloads accepted: 12 Total ack frames sent: 0 Ack frames lost: 0 Ack frames not lost: 0 Timeouts: 8 Ack timeouts: 0 Process 1: Total data frames sent: 38 Data frames lost: 9 Data

35、 frames not lost: 29 Frames retransmitted: 8 Good ack frames recd: 0 Bad ack frames recd: 0 Good data frames recd: 23 Bad data frames recd: 6 Payloads accepted: 12 Total ack frames sent: 0 Ack frames lost: 0 Ack frames not lost: 0 Timeouts: 8 Ack timeouts: 0 Efficiency (payloads accepted/data pkts s

36、ent) = 31% End of simulation. Time=500 从运行结果之中可以看出,有两个进程,分别指明了发送和接受的情况,丢包律、误码率等等都和事先设定好的参数一致。这个一位的滑动窗口协议与前几个协议也有不同之处,他是以滑动窗口的形式发送的帧,所以不会发生帧的重复等情况。4.运行protocol5 参数设定:./protocol5 500 50 20 10 3 1 protocol5是一个回退N帧协议。由于发送方在发出一帧以后必须等待前一帧的确认到来以后才能发送下一帧。允许发送方在阻塞之前发送多达W个帧,而不是一个帧。发送方可以连续发送帧。其中1000表示他将以50个tic

37、k的时间间隔运行1000个协议实体进程。20的丢包率,10的校验和错误率(的80通过),它会打印出每帧的行发送或接收。汇总数据也将被追加到totdata.txt。运行结果如下:Simulating Protocol 5 Events: 500 Parameters: 50 20 10 Tick 2. Proc 0 sent frame: type=Data seq=0 ack=7 payload=0 Tick 1. Proc 1 sent frame: type=Data seq=0 ack=7 payload=0 Tick 3. Proc 1 got good frame: type=Dat

38、a seq=0 ack=7 payload=0 Tick 4. Proc 1 sent frame that got lost: type=Data seq=1 ack=0 payload=1 Tick 5. Proc 1 sent frame that got lost: type=Data seq=2 ack=0 payload=2 Tick 7. Proc 0 sent frame: type=Data seq=1 ack=7 payload=1 Tick 6. Proc 1 sent frame that got lost: type=Data seq=3 ack=0 payload=

39、3 Tick 9. Proc 1 got good frame: Tick 8. Proc 0 got good frame: type=Data seq=1 ack=7 payload=1 type=Data seq=0 ack=7 payload=0 Tick 10. Proc 1 sent frame that got lost: type=Data seq=4 ack=1 payload=4 Tick 11. Proc 0 sent frame that got lost: type=Data seq=2 ack=0 payload=2 Tick 12. Proc 1 sent fra

40、me: type=Data seq=5 ack=1 payload=5 Tick 13. Proc 0 sent frame that got lost: type=Data seq=3 ack=0 payload=3 Tick 14. Proc 1 sent frame: type=Data seq=6 ack=1 payload=6 Tick 16. Proc 0 got good frame: type=Data seq=5 ack=1 payload=5 Tick 17. Proc 0 got bad frame: type=Data seq=6 ack=1 payload=6 Tic

41、k 18. Proc 0 sent frame: type=Data seq=4 ack=0 payload=4 Tick 19. Proc 0 sent frame: type=Data seq=5 ack=0 payload=5 Tick 20. Proc 0 sent frame: type=Data seq=6 ack=0 payload=6 Tick 23. Proc 1 got good frame: type=Data seq=4 ack=0 payload=4 Tick 22. Proc 0 sent frame that got lost: type=Data seq=7 ack=0 payload=7 Tick 24. Proc 1 got good frame: Tick 25. Proc 0 sent frame: type=Data seq=5 ack=0 payload=5 type=Data seq=0 ack=0 payload=8 Tick 28. Proc 1 got good frame: type=Data seq=6 ack=0 payload=6 Tick 29. Proc 1 got good frame: type=Data seq=0 ack=0 payload=

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1