日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

NS2网络模拟(3)-吞吐率

發布時間:2025/7/25 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 NS2网络模拟(3)-吞吐率 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1: #NS2_有線部分\Throughput.awk 2: 3: BEGIN { 4: #Initialize the variable 5: init = 0; 6: i = 0; 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r: Receive 14: #d: Drop 15: #e: Error 16: #+: Enqueue 17: #-: Dequeue 18: #double Time 19: #int (Link-layer) Source Node 20: #int (Link-layer) Destination Node 21: #string Packet Name 22: #int Packet Size 23: #string Flags 24: #int Flow ID 25: #int (Network-layer) Source Address 26: #int Source Port 27: #int (Network-layer) Destination Address 28: #int Destination Port 29: #int Sequence Number 30: #int Unique Packet ID 31: 32: #Evaluate the fields to new viariables 33: EVENT = $1; 34: TIME = $2; 35: SRCNODE = $3 36: DSTNODE = $4; 37: PKTNAME = $5; 38: PKTSIZE = $6; 39: FLAGS = $7; 40: FLOWID = $8; 41: SRCADDPORT = $9; 42: DSTADDPORT = $10; 43: SEQNO = $11; 44: PKTID = $12; 45: 46: #Count up the packets send to DstNode 47: if (EVENT == "-" && SRCNODE == 0 && DSTNODE == 1) 48: { 49: ByteSum[i + 1] = ByteSum[i] + PKTSIZE; 50: 51: # if (init == 0) { 52: # StartTime = Time; 53: # init = 1; 54: # } 55: 56: EndTime[i] = TIME; 57: i = i + 1; 58: } 59: } 60: 61: END { 62: printf("%.2f\t%.2f\n", EndTime[0], 0); 63: 64: #Calcute the throughput 65: for (j = 1; j < i; j ++) 66: { 67: Throught = (ByteSum[j] / (EndTime[j] - EndTime[0])) * 8 / 1000; 68: printf("%.2f\t%.2f\n", EndTime[j], Throught); 69: } 70: 71: printf("%.2f\t%.2f\n", EndTime[i - 1], 0); 72: } 73:

轉載于:https://www.cnblogs.com/txw1958/archive/2011/10/13/2210121.html

總結

以上是生活随笔為你收集整理的NS2网络模拟(3)-吞吐率的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。