ﺩﺍﻧﺸﻜﺪﻩ ﻣﻬﻨﺪﺳﻲ ﻛﺎﻣﭙﻴﻮﺗﺮ ﻭ ﻓﻨﺎﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﺩﺍﻧﺸﮕﺎﻩ ﺻﻨﻌﺘﻲ ﺍﻣﻴﺮﻛﺒﻴﺮ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2 ﻣﻬﺪﯼ ﺁﺫﺭﻣﯽ ۸۳۲۳۱۱۰۲
ﺍﺳﻔﻨﺪ ۱۳۸۳
ﻓﻬﺮﺳﺖ ﻣﻄﺎﻟﺐ
.١ﻣﻘﺪﻣﻪ ١‐١..................................................................................................................................
.٢ﺁﺷﻨﺎﻳﻲ ﻣﻘﺪﻣﺎﺗﻲ ﺑﺎ ٢‐٢..............................................................................NS-2 ١‐٢ﺑﺨﺶ : ١ﻃﺮﻳﻘﻪ downloadﻛﺮﺩﻥ ﻭ ﻧﺼﺐ ٣‐٢ ...................................................... ns
Download ١‐١‐٢ﻛﺮﺩﻥ ٣‐٢ ............................................................................... ns ٢‐١‐٢ﻧﺼﺐ ٣‐٢ ................................................................................................................. ns ٢‐٢ﺑﺨﺶ : ٢ﺷﺮﻭﻉ ﻛﺎﺭ ﺑﺎ ٥‐٢ .......................................................................................... ns
١‐٢‐٢ﺍﺟﺮﺍﻱ ٥‐٢ ............................................................................................................... ns ٢‐٢‐٢ﻣﻌﻤﺎﺭﻱ ٥‐٢ ............................................................................................................ ns ٣‐٢‐٢ﺯﺑﺎﻥ ﻛﺎﺭﺑﺮﻱ ٧‐٢ ............................................................................................... OTcl ٣‐٢ﺑﺨﺶ : ٣ﻧﺮﻡ ﺍﻓﺰﺍﺭ ١٠‐٢ .........................................................................................Nam
١‐٣‐٢ﭘﻴﻜﺮﺑﻨﺪﻱ namﺑﺮﺍﻱ ﻧﻤﺎﻳﺶ ﺗﻮﭘﻮﻟﻮﮊﻱ ١٠‐٢..................................................... ٢‐٣‐٢ﻭﺍﺳﻂ ﻛﺎﺭﺑﺮﻱ ١١‐٢..................................................................................................... ٤‐٢ﺑﺨﺶ : ٤ﻣﺜﺎﻟﻬﺎﻱ ﻋﻤﻠﻲ ١٢‐٢ ........................................................................................
١‐٤‐٢ﻓﺮﻣﺎﻧﻬﺎﻱ ﺍﻭﻟﻴﻪ ١٢‐٢........................................................................................... ns-2 ٢‐٤‐٢ﻣﺪﻝ ﻛﺮﺩﻥ ﻳﻚ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺳﺎﺩﻩ :ﺩﻭ ﮔﺮﻩ ﺑﺎ ﻳﻚ ﻟﻴﻨﻚ ١٣‐٢........................... ٣‐٤‐٢ﻣﺸﺨﺺ ﻛﺮﺩﻥ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﻭ ﻣﻮﻧﻴﺘﻮﺭ ﻛﺮﺩﻥ ﻟﻴﻨﻚ ﻫﺎ ١٥‐٢.................... ٤‐٤‐٢ﺗﻌﺮﻳﻒ ﺗﻮﭘﻮﻟﻮﮊﻱ ١٥‐٢................................................................................................ ٥‐٤‐٢ﺗﻌﺮﻳﻒ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ ﻭ ﮔﻴﺮﻧﺪﻩ ﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ١٦‐٢ ................................................ ٦‐٤‐٢ﻣﺸﺨﺺ ﻛﺮﺩﻥ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ١٨‐٢.................................................................. ٧‐٤‐٢ﻣﻮﻧﻴﺘﻮﺭ ﻛﺮﺩﻥ ﻳﻚ ﻟﻴﻨﻚ ١٩‐٢................................................................................. ٨‐٤‐٢ﺍﻳﺠﺎﺩ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ﺗﻌﺪﺍﺩ ﮔﺮﻩ ﻫﺎﻱ ﺑﺎﻻ ﻭ ﻣﺪﻝ ﻛﺮﺩﻥ ﺧﺮﺍﺑﻲ ﻟﻴﻨﻚ ﻫﺎ ٢٠‐٢..... i
١‐٨‐٤‐٢ﺍﻳﺠﺎﺩ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ﺗﻌﺪﺍﺩ ﮔﺮﻩ ﻫﺎﻱ ﺑﺎﻻ ٢٠‐٢ ........................................................................ ٢‐٨‐٤‐٢ﻣﺪﻝ ﻛﺮﺩﻥ ﺧﺮﺍﺑﻲ ﻟﻴﻨﻚ ﻫﺎ ٢١‐٢ .........................................................................................
٩‐٤‐٢ﺍﻳﺠﺎﺩ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ ﺑﺮﺍﻱ ﺑﺮﻧﺎﻣﺔ ٢٣‐٢.......................................................XGraph ١‐٩‐٤‐٢ﺗﻮﭘﻮﻟﻮﮊﻱ ﻭ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ ٢٣‐٢ ............................................................................................. ٢‐٩‐٤‐٢ﺛﺒﺖ ﺩﺍﺩﻩ ﻫﺎ ﺩﺭ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ ٢٦‐٢...................................................................................... ٣‐٩‐٤‐٢ﺍﺟﺮﺍﻱ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ٢٧‐٢ ........................................................................................................ Trace .٣ﻭ Monitoringﺩﺭ ٣٠‐٣......................................................................................NS-2 ١‐٣ﺭﻭﺷﻬﺎﻱ ﺟﻤﻊﺁﻭﺭﻱ ﺩﺍﺩﻩ ﺩﺭ ٣٠‐٣............................................................................. NS ٢‐٣ﺍﺷﻴﺎﺀ ٣١‐٣........................................................................................................... Trace
١‐٢‐٣ﻣﻌﻤﺎﺭﻱ ﺳﺮﺁﻳﻨﺪ ﺑﺴﺘﻪﻫﺎ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ٣١‐٣......................................... trace ٢‐٢‐٣ﻣﻌﻤﺎﺭﻱ ﻟﻴﻨﻜﻬﺎ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ٣١‐٣...................................................... Trace ٣‐٢‐٣ﻓﺮﻣﺖ ﻓﺎﻳﻞ ٣٣‐٣................................................................................................ trace ٤‐٢‐٣ﺗﻮﺍﺑﻊ ﻛﻤﻜﻲ ﺑﺮﺍﻱ ﺩﺳﺘﺮﺳﻲ ﺑﻪ ﺍﺷﻴﺎﺀ ٣٣‐٣................................................tracing ٥‐٢‐٣ﻭﺍﺳﻄﻬﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﺷﻴﺎﺀ ٣٤‐٣.................................. trace ١‐٥‐٢‐٣ﻭﺍﺳﻄﻬﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﻓﻌﺎﻝ ﻧﻤﻮﺩﻥ traceﺩﺭ ﻟﻴﻨﻜﻬﺎ ٣٤‐٣ .................................. ٢‐٥‐٢‐٣ﻓﺮﻣﺎﻧﻬﺎﻱ traceﻣﺮﺑﻮﻁ ﺑﻪ ﺻﻔﻬﺎ٣٥‐٣ ................................................................................... ٣‐٣ﺍﺷﻴﺎﺀ ٣٥‐٣.............................................................................................. Monitoring
٣٥‐٣.............................................................................................. Queue Monitoring ١‐٣‐٣ ٢‐٣‐٣ﺷﺊ ٣٧‐٣..................................................................................... QueueMonitor/ED ٣٧‐٣........................................................................................... PerFlow Monitoring ٣‐٣‐٣ ١‐٣‐٣‐٣ﺷﺊ ٣٧‐٣ ......................................................................... QueueMonitor/ED/FlowMon ٢‐٣‐٣‐٣ﺷﺊ ٣٨‐٣ ................................................................... QUEUEMONITOR/ED/FLOW ٣‐٣‐٣‐٣ﻓﺮﻣﺖ ٣٨‐٣ ....................................................................................................Flow Monitor ii
٤‐٣‐٣ﻭﺍﺳﻄﻬﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ٣٩‐٣..................................................... Monitoring ١‐٤‐٣‐٣ﻓﺮﻣﺎﻧﻬﺎﻱ ﻓﻌﺎﻝ ﻧﻤﻮﺩﻥ Monitoringﺭﻭﻱ ﻟﻴﻨﻜﻬﺎ٣٩‐٣ ...................................................... ٢‐٤‐٣‐٣ﻓﺮﻣﺎﻧﻬﺎﻱ ﺷﺊ ٣٩‐٣ .................................................................................. QueueMonitor ٣‐٤‐٣‐٣ﻓﺮﻣﺎﻧﻬﺎﻱ ﺷﺊ ٤٠‐٣ ..................................................................................... Flow Monitor ٤١‐٣ .................................................................................................... Loss Monitor ٤‐٣ ۵‐۳ﻣﺜﺎﻟﻬﺎﻳﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ Traceﻭ Monitoringﺩﺭ ٤١‐٣ .............................. NS-2
٤١‐٣..................................................................................................................... trace ١‐٥‐٣ all‐trace ١‐١‐٥‐٣ﻭ ٤١‐٣ .............................................................................................numtrace-all ٤٢‐٣ .................................................................................................................. Trace-queue ٢‐١‐٥‐٣
٤٢‐٣.......................................................................................................... Monitoring ٢‐٥‐٣ ٤٣‐٣ .......................................................................................................Queue Monitoring ١‐٢‐٥‐٣ ٤٥‐٣ ........................................................................................................ Monitor per Flow ٢‐٢‐٥‐٣
٤٦‐٣ ...................................................................................................... Loss Monitor ٣‐٥‐٣ .٤ﺷﺒﻴﻪﺳﺎﺯ MPLSﺩﺭ ٤٨‐٤.............................................................................................NS-2 ١‐٤ﻗﺎﺑﻠﻴﺘﻬﺎﻱ ٤٨‐٤ ............................................... MPLS Network Simulator-V2
MNS-v2 ١‐١‐٤ﺍﻋﻤﺎﻝ ﺗﻮﺯﻳﻊ ﺑﺮﭼﺴﺐ ﻛﻪ ﺷﺎﻣﻞ ﺍﺟﺰﺍﺀ ﺯﻳﺮ ﺍﺳﺖ ﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ: ٤٨‐٤ MNS-V2 ٢‐١‐٤ﺍﺯ ﺭﻭﺷﻬﺎﻱ ﺯﻳﺮ ﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ LSPﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ٤٩‐٤.................... : ۳‐۱‐۴ﻗﺎﺑﻠﻴﺖ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٤٩‐٤................................................................................... ٢‐٤ﻣﻌﻤﺎﺭﻱ ٥٠‐٤ ...............................................................Mpls Network Simulator
١‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ٥٠‐٤.................................................... ٢‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ٥٢‐٤......................................................... ٣‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺗﺮﺍﻓﻴﻚ ﺑﻲﺩﺭﻧﮓ ٥٣‐٤............................................ iii
٤‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺭﺯﺭﻭ ﻣﻨﺎﺑﻊ ٥٤‐٤....................................................................... ٥‐٢‐٤ﺳﻄﻮﺡ ﺳﺮﻭﻳﺲ ﺩﺭ ٥٥‐٤................................................................................. MNS ٦‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٥٦‐٤ ............................................................ ٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺷﺒﻴﻪﺳﺎﺯ ٦١‐٤ ................................... MNS
١‐٣‐٤ﻓﺮﻣﺎﻧﻬﺎﻱ ﻭﺍﺳﻂ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺩﺭ ٦١‐٤ ........................................ NS-2 ٢‐٣‐٤ﻭﺍﺳﻂﻫﺎ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ٦٢‐٤ ................................................................ ٣‐٣‐٤ﻭﺍﺳﻄﻬﺎ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻛﻼﺱﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ٦٣‐٤ ................................................. ٤‐٣‐٤ﻭﺍﺳﻂﻫﺎ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮ ﻣﻘﻴﺪ )) CR-LSPﻭ ٦٥‐٤ ........................... CR-LDP ٥‐٣‐٤ﻭﺍﺳﻄﻬﺎ ﺑﺮﺍﻱ ﻓﺮﺍﺧﻮﺍﻧﻲ ﺭﻭﺍﻟﻬﺎ ٦٦‐٤ .......................................................................... ۶‐۳‐۴ﻭﺍﺳﻄﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﻘﻴﺪ ٦٦‐٤ ............................................................................... ٧‐٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٦٧‐٤ ............................................................................. ٨‐٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ traceﻛﺮﺩﻥ ٦٨‐٤ ..................................................... ٩‐٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺩﺭ ٦٩‐٤ ................................... namulator ٤‐٤ﻣﺜﺎﻟﻬﺎﻱ ﺍﺯ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺩﺭ ﺷﺒﻴﻪﺳﺎﺯ ٦٩‐٤........................................................ :
١‐٤‐٤ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ٧٤‐٤....................................................... ٢‐٤‐٤ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ٧٦‐٤ ............................................... ١‐٢‐٤‐٤ﻣﺴﻴﺮﻫﺎﻱ ٧٦‐٤........................................................................................................ CR-LSP ٢‐٢‐٤‐٤
CR-LSPﺑﺎ ﺧﺼﻮﺻﻴﺖ ﺑﻪ ﺯﻭﺭ ﮔﺮﻓﺘﻦ ﻣﻨﺎﺑﻊ ٨٠‐٤ ............................................................
٨١‐٤ .........................................................................................Constraint Based Routing ٣‐٢‐٤‐٤
٣‐٤‐٤ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٨٢‐٤....................................................... ۱‐۳‐۴‐۴ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺭﻭﺵ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٨٤‐٤ ........................... Hashkin ۲‐۳‐۴‐۴ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﺭﻭﺵ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٨٥‐٤ ................................................ Makam ۳‐۳‐۴‐۴ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٨٥‐٤ ........................................ Simple-Dynamic iv
٤‐٣‐٤‐٤ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٨٥‐٤ ........................................ shortest-dynamic ۵‐۳‐۴‐۴ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ٨٥‐٤ .................................................................... L3 .٥ﻣﻜﺎﻧﻴﺰﻡ Diffrentiated Serviceﺩﺭ ٨٧‐٥............................................................NS-2 ۱‐۵ﻣﺎﺟﻮﻝ DiffServﺩﺭ ٨٦‐٥ ................................................................................. NS-2 ۲‐۵ﻣﻌﻤﺎﺭﻱ ﻣﺎﺟﻮﻝ ٨٦‐٥ .....................................................................................DiffServ
۱‐۲‐۵ﻣﻌﻤﺎﺭﻱ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ﻭ ﻣﺮﻛﺰﻱ ٨٧‐٥...................................................................... ۲‐۲‐۵ﺳﻴﺎﺳﺖﻫﺎ ٨٨‐٥........................................................................................................... ۳‐۲‐۵ﺍﻧﻮﺍﻉ policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ ﻣﺎﺟﻮﻝ ٨٩‐٥........................................ DiffServ ۴‐۲‐۵ﺳﺎﺧﺘﺎﺭ Policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ٩٠‐٥..................................................................... ۳‐۵ﭘﻴﻜﺮﺑﻨﺪﻱ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﺎﺟﻮﻝ ٩١‐٥ .............................................................. DiffServ
۱‐۳‐۵ﭘﻴﻜﺮﺑﻨﺪﻱ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺻﻒ ٩١‐٥............................................................................. ١‐١‐٣‐٥ﭘﻴﻜﺮﺑﻨﺪﻱ ﺷﻤﺎﻱ ﺯﻣﺎﻥﺑﻨﺪﻱ ﺑﻴﻦ ﺻﻒﻫﺎﻱ ﻓﻴﺰﻳﻜﻲ ٩٣‐٥ ...............................................
٢‐٣‐٥ﭘﻴﻜﺮﺑﻨﺪﻱ ٩٤‐٥............................................................................................... Policy ٤‐٥ﻭﺍﺳﻂﻫﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻣﺎﺟﻮﻝ ٩٥‐٥ ................................ Diffserv
v
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
.١
١‐٢
ﻣﻘﺪﻣﻪ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﭘﻴﭽﻴﺪﮔﻲ ﺷﺒﻜﻪ ،ﺷﺒﻴﻪﺳﺎﺯﻱ ﻧﻘﺶ ﺑﺴﻴﺎﺭ ﻣﻬﻤﻲ ﻫﻢ ﺩﺭ ﺗﻌﻴﻴﻦ ﺧﺼﻮﺻﻴﺎﺕ ﺭﻓﺘﺎﺭ ﻓﻌﻠـﻲ
ﺷﺒﻜﻪ ،ﻭ ﻫـﻢ ﺩﺭ ﺗﻌﻴـﻴﻦ ﺍﺛـﺮﺍﺕ ﺍﺣﺘﻤـﺎﻟﻲ ﻧﺎﺷـﻲ ﺍﺯ ﺗﻐﻴﻴـﺮﺍﺕ ﭘﻴـﺸﻨﻬﺎﺩ ﺷـﺪﻩ ﺭﻭﻱ ﻋﻤﻠﻜـﺮﺩ ﺷـﺒﻜﻪ ﺩﺍﺭﺩ. ﺷﺒﻴﻪﺳﺎﺯﻫﺎﻱ ﺯﻳﺎﺩﻱ ﺑﺮﺍﻱ ﺍﻳﻦ ﺍﻣﺮ ﻭﺟﻮﺩ ﺩﺍﺭﺩ.ﺍﺯ ﻣﺰﺍﻳﺎﯼ ﺍﻳﻦ ﺷﺒﻴﻪ ﺳﺎﺯ ﺍﻳﻦ ﺍﺳﺖ ﮐﻪ: ﺍﻟﻒ‐ ﻣﻮﺭﺩ ﺗﺎﻳﻴﺪ ﻣﺠﺎﻣﻊ ﻋﻠﻤﻲ ﻣﻲﺑﺎﺷﺪ. ﺏ‐ ﺑﻪ ﺻﻮﺭﺕ ﺭﺍﻳﮕﺎﻥ ﺩﺭ ﺩﺳﺘﺮﺱ ﺍﺳﺖ. ﺝ‐ ﮐﺪ ﺁﻥ ﻧﻴﺰ ﺩﺭ ﺩﺳﺘﺮﺱ ﺍﺳﺖ ﻭ ﻣﻲﺗﻮﺍﻥ ﺑﻪ ﺍﻳﻦ ﺷﺒﻴﻪﺳﺎﺯ ﮐﺪﻫﺎﻳﻲ ﺍﺿﺎﻓﻪ ﻳﺎ ﮐﻢ ﻧﻤﻮﺩ. ﺩ‐ ﺍﻛﺜﺮ ﭘﺮﻭﺗﻜﻠﻬﺎﻱ ﺷﺒﻜﻪ ﺩﺭ ﺁﻥ ﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ.
ﺩﺭ ﻓﺼﻞ ﺍﻭﻝ ﺍﻳﻦ ﮔﺰﺍﺭﺵ ﭼﮕﻮﻧﮕﻲ ﻧـﺼﺐ ﻭ ﺭﺍﻩﺍﻧـﺪﺍﺯﻱ NS-2ﻭ ﻧﺤـﻮﻩ ﺷـﺮﻭﻉ ﻛـﺎﺭ ﺑـﺎ ﺁﻥ ﺗـﺸﺮﻳﺢ ﻣﻲﺷﻮﺩ ،ﺩﺭ ﻓﺼﻞ ﺩﻭﻡ ﻧﺤﻮﻩ ﺍﺳـﺘﻔﺎﺩﻩ ﺍﺯ ﻗﺎﺑﻠﻴـﺖ Monitoringﻭ traceﺩﺭ NS-2ﺷـﺮﺡ ﺩﺍﺩﻩ ﻣـﻲﺷـﻮﺩ ،ﺩﺭ ﻓﺼﻞ ﺳﻮﻡ ﭼﮕﻮﻧﮕﻲ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺩﺭ NS-2ﺗﺸﺮﻳﺢ ﻣﻲﺷﻮﺩ ﻭ ﺩﺭ ﻓﺼﻞ ﭼﻬﺎﺭﻡ ﺑﻪ ﺷﺮﺡ ﻧﺤﻮﻩ ﺍﺳـﺘﻔﺎﺩﻩ ﺍﺯ ﻣﺎﺟﻮﻝ DiffServﺩﺭ NS-2ﭘﺮﺩﺍﺧﺘﻪ ﺧﻮﺍﻫﺪ ﺷﺪ.
.٢
ﺁﺷﻨﺎﻳﻲ ﻣﻘﺪﻣﺎﺗﻲ ﺑﺎ NS-2 ﺩﺭ ﺍﻳﻦ ﮔﺰﺍﺭﺵ ﺑﻪ ﺗﻮﺿﻴﺢ ﭼﮕﻮﻧﮕﻲ ﻧﺼﺐ ﻭ ﺭﺍﻩﺍﻧﺪﺍﺯﻱ nsﻭ ﻧﺤﻮﺓ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺁﻥ ﭘﺮﺩﺍﺧﺘﻪ ﻣﻲﺷﻮﺩ.
nsﻳﻚ ﺷﺒﻴﻪﺳﺎﺯ ﺷﻲﮔﺮﺍ ﻭ discrete event drivenﺍﺳﺖ ﻛﻪ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺯﺑﺎﻧﻬﺎﻱ C++ﻭ OTclﺩﺭ ﺩﺍﻧﺸﮕﺎﻩ ﺑﺮﻛﻠﻲ ﻃﺮﺍﺣﻲ ﻭ ﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ .ﺍﺯ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﻋﻤﻮﻣﺎ ﺑﻪ ﻣﻨﻈﻮﺭ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺷﺒﻜﻪﻫﺎﻱ ﻛﺎﻣﭙﻴﻮﺗﺮﻱ ﻣﺤﻠﻲ ﻭ ﺷﺒﻜﻪﻫﺎﻱ ﮔﺴﺘﺮﺩﻩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ns .ﻣﻲﺗﻮﺍﻧﺪ ﺷﺒﻜﻪﻫﺎﻱ IPﮔﻮﻧﺎﮔﻮﻧﻲ ﺭﺍ ﺷﺒﻴﻪ- ﺳﺎﺯﻱ ﻧﻤﺎﻳﺪ .ﭘﺮﻭﺗﻜﻠﻬﺎﻱ ﺷﺒﻜﻪ ﻣﺎﻧﻨﺪ TCPﻭ ،UDPﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ ﻫﻤﭽﻮﻥ CBR ،Web ،Telnet ،FTPﻭ ،VBRﻣﻜﺎﻧﻴﺰﻣﻬﺎﻱ ﻣﺪﻳﺮﻳﺖ ﺻﻔﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺏ ﻣﺜﻞ RED ،DropTailﻭ ،CBQﺍﻟﮕﻮﺭﻳﺘﻤﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺜﻞ Dijkstraﻭ ...ﺩﺭ nsﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩﺍﻧﺪ .ﻫﻤﭽﻨﻴﻦ multicastingﻭ ﺑﺮﺧﻲ ﺍﺯ ﭘﺮﻭﺗﻜﻠﻬﺎﻱ ﻻﻳﺔ MAC
ﺑﺮﺍﻱ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺷﺒﻜﻪﻫﺎﻱ ﻣﺤﻠﻲ ﺩﺭ nsﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩﺍﻧﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢‐ ٢
ﻫﺮ ﭼﻨﺪ ﭘﺲ ﺍﺯ ﺁﺷﻨﺎﻳﻲ ﺑﺎ ﻧﺤﻮﺓ ﻋﻤﻠﻜﺮﺩ ﺷﺒﻴﻪﺳﺎﺯ ،ﻛﺎﺭ ﺑﺎ nsﺑﺴﻴﺎﺭ ﺳﺎﺩﻩ ﻣﻲﮔﺮﺩﺩ ﺑﺎ ﺍﻳﻦ ﺣﺎﻝ ﺑﺮﺍﻱ ﻛﺎﺭﺑﺮﺍﻧﻲ ﻛﻪ ﺑﺎﺭ ﺍﻭﻝ ﺑﺎ nsﺭﻭﺑﺮﻭ ﻣﻲﺷﻮﻧﺪ ﻛﺎﺭﻛﺮﺩﻥ ﺑﺎ ﺁﻥ ﺑﺴﻴﺎﺭ ﻣﺸﻜﻞ ﻣﻲﺑﺎﺷﺪ ﭼﺮﺍ ﻛﻪ ﺭﺍﻫﻨﻤﺎﻫﺎﻱ ﺧﻮﺑﻲ ﺑﺮﺍﻱ ﺍﻳﻨﮕﻮﻧﻪ ﻛﺎﺭﺑﺮﺍﻥ ﻭﺟﻮﺩ ﻧﺪﺍﺭﺩ .ﺍﻛﺜﺮ ﺭﺍﻫﻨﻤﺎﻫﺎﻳﻲ ﻛﻪ ﺑﺮﺍﻱ nsﻧﻮﺷﺘﻪ ﺷﺪﻩﺍﻧﺪ ﺑﻪ ﺗﻮﺿﻴﺢ ﻋﻤﻴﻖ ﺷﺒﻴﻪﺳﺎﺯ ﻣﻲﭘﺮﺩﺍﺯﻧﺪ ﻭ ﻛﺎﺭﺑﺮﺍﻥ ﺗﺎﺯﻩﻛﺎﺭ ﻧﻤﻲﺗﻮﺍﻧﻨﺪ ﺍﺯ ﺍﻳﻦ ﺭﺍﻫﻨﻤﺎﻫﺎ ﺑﻬﺮﻩ ﺑﺒﺮﻧﺪ. ﻫﺪﻑ ﺍﺯ ﺍﻳﻦ ﻓﺼﻞ ،ﺁﺷﻨﺎ ﻧﻤﻮﺩﻥ ﻛﺎﺭﺑﺮﺍﻥ ﺗﺎﺯﻩﻛﺎﺭ ﺑﺎ ﻧﺤﻮﺓ downloadﻛﺮﺩﻥ ،ﻧﺼﺐ ﻭ ﻛﺎﺭ ﺑﺎ ﺷﺒﻴﻪﺳﺎﺯ ﻣﻲﺑﺎﺷﺪ .ﺁﺷﻨﺎ ﻧﻤﻮﺩﻥ ﻛﺎﺭﺑﺮﺍﻥ ﺑﺎ ﺍﻳﺪﻩﻫﺎﻱ ﺍﺻﻠﻲ ﺍﻳﻨﻜﻪ ﺷﺒﻴﻪﺳﺎﺯ ﭼﮕﻮﻧﻪ ﻛﺎﺭ ﻣﻲﻛﻨﺪ ،ﭼﮕﻮﻧﻪ ﻣﻲﺗﻮﺍﻥ ﺷﺒﻜﻪﻫﺎ ﺭﺍ ﺑﺮﺍﻱ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺁﻣﺎﺩﻩ ﻛﺮﺩ ،ﺩﺭ ﻛﺠﺎ ﺑﺎﻳﺴﺘﻲ ﺍﻃﻼﻋﺎﺕ ﺑﻴﺸﺘﺮﻱ ﺭﺍ ﺭﺍﺟﻊ ﺑﻪ ﻗﻄﻌﺎﺕ ﺷﺒﻜﻪ ﺩﺭ ﻛﺪﻫﺎﻱ ﺷﺒﻴﻪﺳﺎﺯ ﺟﺴﺘﺠﻮ ﻛﺮﺩ ﻭ ...ﺍﺯ ﻭﻳﮋﮔﻴﻬﺎﻱ ﺍﻳﻦ ﮔﺰﺍﺭﺵ ﻣﻲﺑﺎﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١-٢
٣‐٢
ﺑﺨﺶ : ١ﻃﺮﻳﻘﻪ downloadآﺮدن و ﻧﺼﺐ ns
ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺑﻪ ﺗﻮﺿﻴﺢ ﻧﺤﻮﺓ downloadﻛﺮﺩﻥ ﻭ ﻧﺼﺐ nsﻣﻲﭘﺮﺩﺍﺯﻳﻢ .ﺍﺑﺘﺪﺍ ﻃﺮﻳﻘﺔ downloadﻛﺮﺩﻥ nsﺗﻮﺿﻴﺢ ﺩﺍﺩﻩ ﺧﻮﺍﻫﺪ ﺷﺪ ﻭ ﺳﭙﺲ ﭼﮕﻮﻧﮕﻲ ﻧﺼﺐ ﺁﻥ ﺍﺭﺍﺋﻪ ﻣﻲﮔﺮﺩﺩ.
Download ١‐١‐٢ﻛﺮﺩﻥ ns ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺭﺍ ﺑﻪ ﺩﻭ ﺻﻮﺭﺕ ﻣﻲﺗﻮﺍﻥ ﻧﺼﺐ ﻛﺮﺩ .ﺭﻭﺵ ﺍﻭﻝ ﻧﺼﺐ ﺑﺴﺘﻪﻫﺎﻱ ﻧﺮﻡﺍﻓﺰﺍﺭﻱ ﻣﺨﺘﻠﻒ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﺩﺭ ) nsﻣﺜﻞ OTcl ، Tcl/Tkﻭ (...ﺑﻪ ﺻﻮﺭﺕ ﺟﺪﺍﮔﺎﻧﻪ ﻣﻲﺑﺎﺷﺪ .ﺩﺭ ﺭﻭﺵ ﺩﻭﻡ ﺍﺯ ﺑﺴﺘﺔ ﻧﺮﻡﺍﻓﺰﺍﺭﻱ all-in-oneﻛﻪ ﺷﺎﻣﻞ ﻛﻠﻴﺔ ﺑﺴﺘﻪﻫﺎﻱ ﻧﺮﻡﺍﻓﺰﺍﺭﻱ ﻻﺯﻡ ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ nsﻣﻲﺑﺎﺷﺪ ،ﺑﺮﺍﻱ ﻧﺼﺐ nsﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ- ﺷﻮﺩ .ﺍﮔﺮ ﺷﻤﺎ ﺍﺯ ﺁﻥ ﺩﺳﺘﻪ ﺍﻓﺮﺍﺩﻱ ﻫﺴﺘﻴﺪ ﻛﻪ ﻣﻲﺧﻮﺍﻫﻴﺪ ﺑﻪ ﺗﺎﺯﮔﻲ ﻛﺎﺭ ﺑﺎ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺭﺍ ﺷﺮﻭﻉ ﻛﻨﻴﺪ ﻭ ﺁﺷﻨﺎﻳﻲ ﻗﺒﻠﻲ ﺑﺎ ﻧﺤﻮﺓ ﻛﺎﺭﻛﺮﺩ ﺁﻥ ﻧﺪﺍﺭﻳﺪ ،ﭘﻴﺸﻨﻬﺎﺩ ﻣﻲﺷﻮﺩ ﺑﺮﺍﻱ ﺷﺮﻭﻉ ﻛﺎﺭ ﺍﺯ ﺭﻭﺵ ﺩﻭﻡ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ .ﺗﻨﻬﺎ ﻋﻴﺒﻲ ﻛﻪ ﻣﻤﻜﻦ ﺍﺳﺖ ﺭﻭﺵ ﺩﻭﻡ ﺩﺍﺷﺘﻪ ﺑﺎﺷﺪ ﺍﻳﻦ ﺍﺳﺖ ﻛﻪ ﺑﺮﺧﻲ ﺍﺯ ﻗﺴﻤﺘﻬﺎﻱ ﺑﺴﺘﺔ all-in-oneﻛﻪ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻲﺑﺎﺷﻨﺪ ﺑﺨﺸﻲ ﺍﺯ ﻓﻀﺎﻱ ﺩﻳﺴﻜﺘﺎﻥ ﺭﺍ ﺍﺷﻐﺎﻝ ﺧﻮﺍﻫﻨﺪ ﻛﺮﺩ .ﻧﻜﺘﻪﺍﻱ ﻛﻪ ﺑﺎﻳﺪ ﺑﻪ ﺁﻥ ﺗﻮﺟﻪ ﻛﻨﻴﺪ ﺍﻳﻦ ﺍﺳﺖ ﻛﻪ ﺑﺴﺘﻪ ﻧﺮﻡﺍﻓﺰﺍﺭﻱ all-in-oneﻓﻘﻂ ﺩﺭ ﺳﻴﺴﺘﻤﻬﺎﻱ ﻣﺒﻨﻲ ﺑﺮ ﻳﻮﻧﻴﻜﺲ ﻛﺎﺭ ﻣﻲﻛﻨﺪ .ﺑﺴﺘﻪ ﻧﺮﻡﺍﻓﺰﺍﺭﻱ all-in-oneﺭﺍ ﻣﻲﺗﻮﺍﻧﻴﺪ ﺍﺯ ﺁﺩﺭﺱ ﺍﻳﻨﺘﺮﻧﺘﻲ ﺯﻳﺮ downloadﻛﻨﻴﺪ : . http://www.isi.edu/nsnam/dist/ns-allinone-2.27.tar.gz ﺁﺧﺮﻳﻦ ﻧﺴﺨﺔ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺭﺍ ﻣﻲﺗﻮﺍﻧﻴﺪ ﺍﺯ ﺁﺩﺭﺱ ﺍﻳﻨﺘﺮﻧﺘﻲ
http://www.isi.edu/nsnam/dist/
ﻭ ﻳﺎ ﺁﺩﺭﺱ
download ftp://ftp.isi.edu/nsnamﻛﻨﻴﺪ. ﻧﻜﺘﻪ :ﺍﮔﺮ ﺍﺯ ﺳﻴﺴﺘﻢﻋﺎﻣﻞ ﻭﻳﻨﺪﻭﺯ ٢٠٠٠/٩٨/٩٥ﻭ ﻳﺎ NTﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻴﺪ ،ﻣﻲﺗﻮﺍﻧﻴﺪ ﺍﺯ ﺁﺩﺭﺱ ﺯﻳﺮ ﻓﺎﻳﻞ ﻗﺎﺑﻞ ﻧﺼﺐ nsﺭﺍ downloadﻛﻨﻴﺪ . http://www.isi.edu/nsnam/dist/binary :
٢‐١‐٢ﻧﺼﺐ
ns
ﻫﻤﺎﻧﮕﻮﻧﻪ ﻛﻪ ﻗﺒﻼ ﮔﻔﺘﻪ ﺷﺪ ﺑﺮﺍﻱ ﻧﺼﺐ ﻭ ﺭﺍﻩﺍﻧﺪﺍﺯﻱ nsﺩﻭ ﺭﻭﺵ ﻭﺟﻮﺩ ﺩﺍﺭﺩ .ﺑﻪ ﺩﻟﻴﻞ ﭘﻴﭽﻴﺪﮔﻲ ﺭﻭﺵ ﺍﻭﻝ ﺑﺮﺍﻱ ﻛﺎﺭﺑﺮﺍﻥ ﺗﺎﺯﻩﻛﺎﺭ ،ﺩﺭ ﺍﻳﻨﺠﺎ ﻓﻘﻂ ﺑﻪ ﺗﻮﺿﻴﺢ ﺭﻭﺵ ﺩﻭﻡ ﻣﻲﭘﺮﺩﺍﺯﻳﻢ. ns-allinoneﻳﻚ ﺑﺴﺘﺔ ﻧﺮﻡﺍﻓﺰﺍﺭﻳﺴﺖ ﻛﻪ ﺷﺎﻣﻞ ﻗﻄﻌﺎﺕ ﻻﺯﻡ ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ nsﻭ ﺑﺮﺧﻲ ﻗﻄﻌﺎﺕ ﺍﺧﺘﻴﺎﺭﻱ ﻣﻲ- ﺑﺎﺷﺪ .ﺑﺴﺘﻪ ﺷﺎﻣﻞ ﻳﻚ ﺍﺳﻜﺮﻳﭙﺖ " "installﻣﻲﺑﺎﺷﺪ ﻛﻪ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ،ﻛﺎﻣﭙﺎﻳﻞ ﻭ ﻧﺼﺐ ﺧﻮﺩﻛﺎﺭ ﻗﻄﻌﺎﺕ ﺫﻛﺮ ﺷﺪﻩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤‐٢
ﭘﺲ ﺍﺯ ﺁﻧﻜﻪ ﻓﺎﻳﻞ ns-allinone-2.27.tar.gzﺭﺍ downloadﻛﺮﺩﻳﺪ ،ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﺁﻧﺮﺍ ﺍﺯ ﺣﺎﻟﺖ ﻓﺸﺮﺩﻩ ﺷﺪﻩ ﺧﺎﺭﺝ ﻛﻨﻴﺪ .ﺍﮔﺮ ﺩﺭ ﻣﺤﻴﻂ ﮔﺮﺍﻓﻴﻜﻲ ﻫﺴﺘﻴﺪ ،ﺑﺮ ﺭﻭﻱ ﻓﺎﻳﻞ ﻛﻠﻴﻚ ﺭﺍﺳﺖ ﻧﻤﺎﻳﻴﺪ ﻭ ﺍﺯ ﻣﻨﻮﻱ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﮔﺰﻳﻨﺔ " "Extracte hereﺭﺍ ﺍﻧﺘﺨﺎﺏ ﻧﻤﺎﻳﻴﺪ .ﺑﺮﺍﻱ ﺷﻤﺎ ﺩﺍﻳﺮﻛﺘﻮﺭﻳﻲ ﺑﺎ ﻫﻤﺎﻥ ﻧﺎﻡ ﻓﺎﻳﻞ ﺍﻳﺠﺎﺩ ﺧﻮﺍﻫﺪ ﺷﺪ ﻛﻪ ﺣﺎﻭﻱ ﻣﺤﺘﻮﻳﺎﺕ ﻓﺎﻳﻞ ﻣﻲﺑﺎﺷﺪ .ﺍﮔﺮ ﺩﺭ ﺩﺍﺧﻞ ﻣﺤﻴﻂ ﻣﺘﻨﻲ ﻫﺴﺘﻴﺪ ﻣﻲﺗﻮﺍﻧﻴﺪ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺑﺮﻧﺎﻣﻪ tar
ﻓﺎﻳﻞ ﺭﺍ ﺍﺯ ﺣﺎﻟﺖ ﻓﺸﺮﺩﻩ ﺧﺎﺭﺝ ﻭ ﻳﺎ ﺑﻪ ﺍﺻﻄﻼﺡ untarﻧﻤﺎﻳﻴﺪ .ﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻳﻦ ﻛﺎﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺭﺍ ﺩﺭ ﺷﻞ ﺍﺟﺮﺍ ﻛﻨﻴﺪ : tar -xzvf ns-allinone-2.27.tar.gz
ﭘﺲ ﺍﺯ ﺍﺟﺮﺍﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺩﺍﻳﺮﻛﺘﻮﺭﻳﻲ ﺑﻪ ﻧﺎﻡ ns-allinone-2.27.tarﺑﺮﺍﻱ ﺷﻤﺎ ﺍﻳﺠﺎﺩ ﺧﻮﺍﻫﺪ ﺷﺪ ﻛﻪ ﺣﺎﻭﻱ ﻣﺤﺘﻮﻳﺎﺕ ﻓﺎﻳﻞ ﻓﺸﺮﺩﻩ ﺷﺪﻩ ﻣﻲﺑﺎﺷﺪ .ﺣﺎﻝ ﺑﺮﺍﻱ ﻧﺼﺐ ﺑﺎﻳﺴﺘﻲ ﺍﺳﻜﺮﻳﭙﺖ installﺭﺍ ﺍﺟﺮﺍ ﻧﻤﺎﻳﻴﺪ .ﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻳﻦ ﻛﺎﺭ ﻣﺴﻴﺮ ﺩﺍﻳﺮﻛﺘﻮﺭﻱ ﺧﻮﺩ ﺭﺍ ﺑﻪ ﺩﺍﻳﺮﻛﺘﻮﺭﻱ ns-allinone-2.27ﺗﻐﻴﻴﺮ ﺩﻫﻴﺪ : # cd ns-allinone-2.27
ﺩﺳﺘﻮﺭ ./installﺭﺍ ﺑﻪ ﻣﻨﻈﻮﺭ ﻧﺼﺐ ﺧﻮﺩﻛﺎﺭ nsﺍﺟﺮﺍ ﻧﻤﺎﻳﻴﺪ .ﭘﺲ ﺍﺯ ﺍﺗﻤﺎﻡ ﻛﺎﺭ ﺍﺳﻜﺮﻳﭙﺖ ،installﺑﺎﻳﺴﺘﻲ ﻣﺴﻴﺮﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺤﻞ ﻧﺼﺐ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺭﺍ ،ﺑﻪ ﻣﻨﻈﻮﺭ ﺩﺳﺘﺮﺳﻲ ﻣﺴﺘﻘﻴﻢ ﺑﻪ ﺁﻥ ،ﺩﺭ ﻓﺎﻳﻞ ﭘﺮﻭﻓﺎﻳﻞ ﺷﻠﻲ ﻛﻪ ﺍﺯ ﺁﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻴﺪ ،ﻣﺜﻼ ،bashﻗﺮﺍﺭ ﺩﻫﻴﺪ .ﻓﺮﺽ ﻣﺎ ﺑﺮ ﺍﻳﻦ ﺍﺳﺖ ﻛﻪ ﺍﺯ ﺷﻞ ﭘﻴﺶﻓﺮﺽ ﻳﻌﻨﻲ bash
ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻧﻤﺎﻳﻴﺪ .ﺑﺮﺍﻱ ﺗﻨﻈﻴﻢﻛﺮﺩﻥ ﻣﺴﻴﺮﻫﺎ ﺩﺭ ﻓﺎﻳﻞ ﭘﺮﻭﻓﺎﻳﻞ ﺷﻞ ،bashﻓﺎﻳﻞ .bashrcﺭﺍ ﻭﻳﺮﺍﻳﺶ ﻧﻤﺎﻳﻴﺪ ﻭ ﻣﺴﻴﺮﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺤﻞ ﻧﺼﺐ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺭﺍ ﺑﻪ ﺁﻥ ﺍﺿﺎﻓﻪ ﻛﻨﻴﺪ .ﺗﻐﻴﻴﺮﺍﺕ ﺍﻋﻤﺎﻝ ﺷﺪﻩ ﺭﺍ ﺫﺧﻴﺮﻩ ﻧﻤﺎﻳﻴﺪ ﻭ ﻳﻚ ﺷﻞ ﺟﺪﻳﺪ ﺑﺎﺯ ﻛﻨﻴﺪ ns .ﻗﺎﺑﻞ ﺍﺟﺮﺍ ﺷﺪﻥ ﺧﻮﺍﻫﺪ ﺑﻮﺩ .ﺍﮔﺮ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﻣﺴﻴﺮ ﻧﺼﺐ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺩﺭ root/ns-allinone-2.27ﺑﺎﺷﺪ ،ﺷﻤﺎ ﺑﺎﻳﺴﺘﻲ ﻋﺒﺎﺭﺕ ﺯﻳﺮ ﺭﺍ ﺩﺭ ﻓﺎﻳﻞ bashrcﺍﺿﺎﻓﻪ ﻧﻤﺎﻳﻴﺪ : … export PATH=$PATH:/root/ns-allinone-2.27/bin: … =export TCL_LIBRARY
ﻧﻜﺘﻪ :ﭘﺲ ﺍﺯ ﺍﺟﺮﺍﻱ ﺩﺳﺘﻮﺭ ./installﻭ ﻛﺎﻣﻞ ﺷﺪﻥ ﻣﺮﺍﺣﻞ ﻧﺼﺐ ،ﺩﺭ ﺍﻧﺘﻬﺎ ﭘﻴﻐﺎﻣﻬﺎﻳﻲ ﺑﻪ ﻣﻨﻈﻮﺭ ﺗﻨﻈﻴﻢ ﺑﺮﺧﻲ ﺍﺯ ﻣﺴﻴﺮﻫﺎﻱ ﻻﺯﻡ ﺑﺮﺍﻱ ﻋﻤﻠﻜﺮﺩ ﺻﺤﻴﺢ nsﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ .ﭘﻴﻐﺎﻣﻬﺎﻱ ﺩﺍﺩﻩ ﺷﺪﻩ ﺭﺍ ﺑﻪ ﺩﻗﺖ ﺑﺨﻮﺍﻧﻴﺪ ﻭ ﻣﺴﻴﺮﻫﺎﻱ ﮔﻔﺘﻪ ﺷﺪﻩ ﺭﺍ ﻫﻤﺎﻧﻨﺪ ﺁﻧﭽﻪ ﻛﻪ ﺑﺮﺍﻱ PATHﺍﻋﻤﺎﻝ ﺷﺪ ،ﺗﻨﻈﻴﻢ ﻛﻨﻴﺪ.ﺿﻤﻨﺎ ﺑﺠﺎﯼ ...ﺩﺭ ﺩﻭ ﺩﺳﺘﻮﺭ ﺑﺎﻻ ﺍﺯ ﻣﺴﻴﺮ ﻫﺎﯼ ﺩﺍﺩﻩ ﺷﺪﻩ ﺩﺭ ﺍﻧﺘﻬﺎﯼ ﻧﺼﺐ ﺍﺳﺘﻔﺎﺩﻩ ﮐﻨﻴﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢-٢
٥‐٢
ﺑﺨﺶ : ٢ﺷﺮوع آﺎر ﺑﺎ ns
ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺍﺑﺘﺪﺍ ﺑﻪ ﺗﻮﺿﻴﺤﻲ ﻛﻮﺗﺎﻩ ﺭﺍﺟﻊ ﺑﻪ ﻧﺤﻮﺓ ﺍﺟﺮﺍﻱ ﻓﺎﻳﻠﻬﺎﻱ ﺍﺳﻜﺮﻳﭙﺖ ﺩﺭ nsﻭ ﻣﻌﻤﺎﺭﻱ ﻛﻠﻲ ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺧﻮﺍﻫﻴﻢ ﭘﺮﺩﺍﺧﺖ .ﺳﭙﺲ ﺯﺑﺎﻥ OTclﺑﻪ ﺻﻮﺭﺕ ﻣﺨﺘﺼﺮ ﻣﻌﺮﻓﻲ ﺧﻮﺍﻫﺪ ﺷﺪ ﻭ ﻣﺜﺎﻟﻬﺎﻳﻲ ﺩﺭ ﺍﻳﻦ ﺯﻣﻴﻨﻪ ﺍﺭﺍﺋﻪ ﻣﻲﮔﺮﺩﺩ.
١‐٢‐٢ﺍﺟﺮﺍﻱ
ns
ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ nsﺑﻪ ﺩﻭ ﺻﻮﺭﺕ ﻣﻲﺗﻮﺍﻥ ﻋﻤﻞ ﻛﺮﺩ : .١ﺍﮔﺮ ﻣﺴﻴﺮ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺤﻞ ﻧﺼﺐ nsﺭﺍ ﺩﺭ PATHﺳﺖ ﻛﺮﺩﻩ ﺑﺎﺷﻴﺪ ،ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ nsﻛﺎﻓﻴﺴﺖ ﻛﻪ ﻧﺎﻡ nsﺭﺍ ﺗﺎﻳﭗ ﻧﻤﺎﻳﻴﺪ. .٢ﺍﮔﺮ ﻣﺴﻴﺮ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺤﻞ ﻧﺼﺐ nsﺭﺍ ﺩﺭ PATHﺳﺖ ﻧﻜﺮﺩﻩ ﺑﺎﺷﻴﺪ ،ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ nsﺑﺎﻳﺴﺘﻲ ﺍﺑﺘﺪﺍ ﺑﻪ ﺩﺍﻳﺮﻛﺘﻮﺭﻱ binﺩﺭ ﺩﺍﺧﻞ ﺩﺍﻳﺮﻛﺘﻮﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺤﻞ ﻧﺼﺐ nsﺗﻐﻴﻴﺮ ﻣﺴﻴﺮ ﺩﻫﻴﺪ ﻭ ﺳﭙﺲ ﺩﺭ ﺁﻧﺠﺎ nsﺭﺍ ﺍﺟﺮﺍ ﻧﻤﺎﻳﻴﺪ. ﻧﺮﻡﺍﻓﺰﺍﺭ nsﺭﺍ ﻣﻲﺗﻮﺍﻥ ﻫﻢ ﺑﻪ ﺻﻮﺭﺕ ﺑﺪﻭﻥ ﺁﺭﮔﻮﻣﺎﻥ ﻭ ﻫﻢ ﺑﺎ ﺁﺭﮔﻮﻣﺎﻥ ﺍﺟﺮﺍ ﻛﺮﺩ .ﺁﺭﮔﻮﻣﺎﻧﻲ ﻛﻪ ﻧﺮﻡ- ﺍﻓﺰﺍﺭ nsﻣﻲﮔﻴﺮﺩ ﻳﻚ ﻓﺎﻳﻞ ﺍﺯ ﻧﻮﻉ " "tclscriptﻣﻲﺑﺎﺷﺪ .ﺩﺭ ﺍﻳﻦ ﻓﺎﻳﻞ ﺳﻨﺎﺭﻳﻮﻱ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻛﻪ ﺷﺎﻣﻞ ﺗﻮﭘﻮﻟﻮﮊﻱ ﻭ ﺭﻭﻳﺪﺍﺩﻫﺎ ﻣﻲﺑﺎﺷﺪ ،ﺗﻌﺮﻳﻒ ﻣﻲﺷﻮﺩ. ﺑﺮﺍﻱ ﺷﺮﻭﻉ ﻛﺎﺭ ﺑﺎ nsﻛﺎﻓﻴﺴﺖ ﺁﻧﭽﻪ ﺭﺍ ﻛﻪ ﻣﻮﺭﺩ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺍﺳﺖ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻳﻚ ﻭﻳﺮﺍﻳﺸﮕﺮ ﻣﺜﻞ emacsﺩﺭ ﻳﻚ ﻓﺎﻳﻞ ﺑﺎ ﭘﺴﻮﻧﺪ tclﺫﺧﻴﺮﻩ ﻛﻨﻴﺪ ﻭ ﺳﭙﺲ ﺁﻥ ﻓﺎﻳﻞ ﺭﺍ ﺑﻪ ﻋﻨﻮﺍﻥ ﺁﺭﮔﻮﻣﺎﻥ ﺑﻪ nsﭘﺎﺱ ﻛﻨﻴﺪ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻧﻤﻮﻧﻪ ﺍﮔﺮ ﺍﺳﻢ ﻓﺎﻳﻞ test.tclﺑﺎﺷﺪ ،ﺑﺮﺍﻱ ﺍﺟﺮﺍﻱ ﺁﻥ ﻋﺒﺎﺭﺕ ﺯﻳﺮ ﺭﺍﺗﺎﻳﭗ ﻛﻨﻴﺪ : # ns test.tcl
ﻧﻜﺘﻪ :ﻣﻲﺗﻮﺍﻥ ﺧﺮﻭﺟﻲ ﺍﻳﻦ ﺑﺮﻧﺎﻣﻪ ﺭﺍ ﺑﻪ ﺑﺮﻧﺎﻣﺔ (Network Animator) namﺩﺍﺩ ﺗﺎ ﻧﺘﺎﻳﺞ ﺭﺍ ﺑﻪ ﺻﻮﺭﺕ ﺗﺼﻮﻳﺮﻱ ﻧﻤﺎﻳﺶ ﺩﻫﺪ .ﺑﺮﻧﺎﻣﺔ namﻣﺮﺍﺣﻞ ﻣﺨﺘﻠﻒ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺭﺍ ﺩﺭ ﻓﻮﺍﺻﻞ ﺯﻣﺎﻧﻲ ﻣﺨﺘﻠﻒ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ.
٢‐٢‐٢ﻣﻌﻤﺎﺭﻱ
ns
ﻫﻤﺎﻧﮕﻮﻧﻪ ﻛﻪ ﺩﺭ ﺷﻜﻞ ١ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ns ،ﻳﻚ ﻣﻔﺴﺮ ﺍﺳﻜﺮﻳﭙﺖ OTclﻣﻲﺑﺎﺷﺪ ﻛﻪ ﺩﺍﺭﺍﻱ ﻳﻚ ﺯﻣﺎﻥﺑﻨﺪ ﺭﻭﻳﺪﺍﺩ ،ﻛﺘﺎﺑﺨﺎﻧﻪﻫﺎﻱ ﺍﺷﻴﺎ ﻗﻄﻌﺎﺕ ﺷﺒﻜﻪ ﻭ ﻛﺘﺎﺑﺨﺎﻧﻪﻫﺎﻱ ﻣﺎﺟﻮﻝ ﺍﻳﺠﺎﺩ ﺷﺒﻜﻪ )ﻟﻮﻟﻪﻛﺸﻲ( ﻣﻲﺑﺎﺷﺪ. ﺑﻪ ﺑﻴﺎﻥ ﺩﻳﮕﺮ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ nsﺍﺯ ﺯﺑﺎﻥ ﺍﺳﻜﺮﻳﭙﺘﻲ otclﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﻳﺠﺎﺩ ﻭ ﺍﺟﺮﺍﻱ ﻳﻚ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦‐٢
ﺷﺒﻜﻪ ﻛﺎﺭﺑﺮ ﺑﺎﻳﺴﺘﻲ ﻳﻚ ﺍﺳﻜﺮﻳﭙﺖ otclﺑﻨﻮﻳﺴﺪ ﻛﻪ ﻳﻚ ﺯﻣﺎﻥﺑﻨﺪ ﺭﻭﻳﺪﺍﺩ ﺭﺍ ﻣﻘﺪﺍﺭﺩﻫﻲ ﺍﻭﻟﻴﻪ ﻛﻨﺪ ﻭ ﺳﭙﺲ ﺁﻧﺮﺍ ﻓﻌﺎﻝ ﻧﻤﺎﻳﺪ ،ﺗﻮﭘﻮﻟﻮﮊﻱ ﺷﺒﻜﻪ ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﺷﻴﺎ ﺷﺒﻜﻪ ﻭ ﺗﻮﺍﺑﻊ ﻟﻮﻟﻪﻛﺸﻲ ﻛﻪ ﺩﺭ ﻛﺘﺎﺑﺨﺎﻧﻪ ﻭﺟﻮﺩ ﺩﺍﺭﻧﺪ ﺍﻳﺠﺎﺩ ﻧﻤﺎﻳﺪ ﻭ ﺑﺎﻻﺧﺮﻩ ﺍﻳﻨﻜﻪ ﺍﺯ ﻃﺮﻳﻖ ﺯﻣﺎﻥﺑﻨﺪ ﺭﻭﻳﺪﺍﺩ ﺑﻪ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ ﺑﮕﻮﻳﺪ ﻛﻪ ﭼﻪ ﺯﻣﺎﻧﻲ ﺍﻧﺘﻘﺎﻝ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺷﺮﻭﻉ ﻛﻨﻨﺪ ﻭ ﭼﻪ ﺯﻣﺎﻧﻲ ﺑﻪ ﺁﻥ ﺧﺎﺗﻤﻪ ﺩﻫﻨﺪ .ﻭﺍﮊﻩ "ﻟﻮﻟﻪﻛﺸﻲ" ﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ ﺷﺒﻜﻪ ﺑﻪ ﻛﺎﺭ ﻣﻲﺭﻭﺩ ﭼﺮﺍﻛﻪ ﺍﻳﺠﺎﺩ ﻳﻚ ﺷﺒﻜﻪ ،ﻟﻮﻟﻪﻛﺸﻲ ﻣﺴﻴﺮﻫﺎﻱ ﺩﺍﺩﻩﺍﻱ ﻣﺨﺘﻠﻒ ﺑﻴﻦ ﺍﺷﻴﺎ ﺷﺒﻜﻪ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻣﻘﺪﺍﺭﺩﻫﻲ ﺍﺷﺎﺭﻩﮔﺮ " "neighborﻳﻚ ﺷﻲ ﺑﻪ ﺁﺩﺭﺱ ﻳﻚ ﺷﻲ ﻣﻨﺎﺳﺐ ﻣﻲﺑﺎﺷﺪ.
ﺷﻜﻞ : ١ﺷﻤﺎﻱ ﻛﻠﻲ nsﺍﺯ ﺩﻳﺪ ﻛﺎﺭﺑﺮ
ﻭﻗﺘﻲ ﻛﻪ ﻛﺎﺭﺑﺮ ﺑﺨﻮﺍﻫﺪ ﻳﻚ ﺷﻲ ﺷﺒﻜﻪﺍﻱ ﺟﺪﻳﺪ ﺍﻳﺠﺎﺩ ﻛﻨﺪ ﺍﺯ ﺩﻭ ﻃﺮﻳﻖ ﻣﻲﺗﻮﺍﻧﺪ ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺍﻧﺠﺎﻡ ﺩﻫﺪ : .١ﻧﻮﺷﺘﻦ ﻳﻚ ﺷﻲ ﺟﺪﻳﺪ .٢ﺍﻳﺠﺎﺩ ﻳﻚ ﺷﻲ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻛﺘﺎﺑﺨﺎﻧﺔ ﺍﺷﻴﺎ ﻭ ﻟﻮﻟﻪﻛﺸﻲ ﻣﺴﻴﺮ ﺩﺍﺩﻩ ﺍﺯ ﻃﺮﻳﻖ ﺷﻲ ﺍﻳﻦ ﻛﺎﺭ ﻣﻤﻜﻦ ﺍﺳﺖ ﭘﻴﭽﻴﺪﻩ ﺑﻪ ﻧﻈﺮ ﺁﻳﺪ ﺍﻣﺎ ﻟﻮﻟﻪﻛﺸﻲ ﻣﺎﺟﻮﻟﻬﺎﻱ otclﻋﻤﻼ ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺑﺴﻴﺎﺭ ﺳﺎﺩﻩ ﻣﻲﻧﻤﺎﻳﺪ ﻭ ﻗﺪﺭﺕ nsﻫﻢ ﺍﺯ ﻫﻤﻴﻦ ﺧﺎﺻﻴﺖ ﻟﻮﻟﻪﻛﺸﻲ ﻣﻲﺁﻳﺪ. ﻳﻜﻲ ﺩﻳﮕﺮ ﺍﺯ ﻗﻄﻌﺎﺕ ﺍﺻﻠﻲ ،nsﺩﺭ ﻛﻨﺎﺭ ﺍﺷﻴﺎ ﺷﺒﻜﻪ ،ﺯﻣﺎﻥﺑﻨﺪ ﺭﻭﻳﺪﺍﺩ ﻣﻲﺑﺎﺷﺪ .ﻳﻚ ﺭﻭﻳﺪﺍﺩ ﺩﺭ ns
ﺗﻮﺳﻂ ﻳﻚ ﺷﻨﺎﺳﺔ ) (IDﺑﺴﺘﻪ ،ﻛﻪ ﺩﺭ ﻃﻮﻝ ﻣﺪﺕ ﺯﻣﺎﻥﺑﻨﺪﻱ ﺷﺪﻩ ﺑﺮﺍﻱ ﺑﺴﺘﻪ ﻳﻜﺘﺎ ﻣﻲﺑﺎﺷﺪ ،ﻭ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﺷﻲﺍﻱ ﻛﻪ ﺭﻭﻳﺪﺍﺩ ﺭﺍ ﭘﺮﺩﺍﺯﺵ ﻣﻲﻛﻨﺪ ،ﻣﺸﺨﺺ ﻣﻲﺷﻮﺩ. ﺩﺭ nsﺯﻣﺎﻥﺑﻨﺪ ﺭﻭﻳﺪﺍﺩ ﺯﻣﺎﻥ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺭﺍ ﺩﻧﺒﺎﻝ ﻣﻲﻛﻨﺪ ﻭ ﻛﻠﻴﺔ ﺭﻭﻳﺪﺍﺩﻫﺎﻳﻲ ﺭﺍ ﻛﻪ ﺩﺭ ﺻﻒ ﺭﻭﻳﺪﺍﺩ ﻗﺮﺍﺭ ﺩﺍﺭﻧﺪ ﻭ ﺑﺮﺍﻱ ﺯﻣﺎﻥ ﺟﺎﺭﻱ ﺯﻣﺎﻥﺑﻨﺪﻱ ﺷﺪﻩﺍﻧﺪ ،ﺍﺯ ﻃﺮﻳﻖ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻗﻄﻌﺎﺕ ﺷﺒﻜﻪﺍﻱ ﻣﻨﺎﺳﺐ ﻓﻌﺎﻝ ﻣﻲ- ﻧﻤﺎﻳﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧‐ ٢
ﻭﻗﺘﻲ ﻛﻪ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺑﻪ ﭘﺎﻳﺎﻥ ﻣﻲﺭﺳﺪ ns ،ﭼﻨﺪﻳﻦ ﻓﺎﻳﻞ ﻣﺘﻨﻲ ﺭﺍ ﻛﻪ ﺷﺎﻣﻞ ﺩﺍﺩﻩﻫﺎﻱ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻣﻲ- ﺑﺎﺷﻨﺪ ﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ )ﺍﻟﺒﺘﻪ ﺍﮔﺮ ﺍﻳﻦ ﻣﻮﺿﻮﻉ ﺩﺭ ﻓﺎﻳﻞ ﺍﺳﻜﺮﻳﭙﺖ .tclﺫﻛﺮ ﺷﺪﻩ ﺑﺎﺷﺪ( .ﺍﺯ ﺍﻳﻦ ﺩﺍﺩﻩﻫﺎ ﻣﻲﺗﻮﺍﻥ ﺑﺮﺍﻱ ﺗﺤﻠﻴﻞ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻭ ﻳﺎ ﺑﻪ ﻋﻨﻮﺍﻥ ﻭﺭﻭﺩﻱ ﺑﻪ ﺑﺮﻧﺎﻣﻪ namﺍﺳﺘﻔﺎﺩﻩ ﻛﺮﺩ nam .ﺩﺍﺭﺍﻱ ﻳﻚ ﺭﺍﺑﻂ ﮔﺮﺍﻓﻴﻜﻲ ﺧﻮﺏ ﺷﺒﻴﻪ ﺑﻪ ﺁﻧﭽﻪ ﻛﻪ ﺩﺭ ﻧﺮﻡﺍﻓﺰﺍﺭﻫﺎﻱ CD Playerﻭﺟﻮﺩ ﺩﺍﺭﺩ ،ﻣﻲﺑﺎﺷﺪ ﻭ ﻫﻤﭽﻨﻴﻦ ﺩﺍﺭﺍﻱ ﻛﻨﺘﺮﻝ ﻛﻨﻨﺪﺓ ﺳﺮﻋﺖ ﻧﻤﺎﻳﺶ ﺍﺳﺖ .ﻋﻼﻭﻩ ﺑﺮ ﺍﻳﻨﻬﺎ nam ،ﻗﺎﺑﻠﻴﺖ ﻧﻤﺎﻳﺶ ﮔﺮﺍﻓﻴﻜﻲ ﺍﻃﻼﻋﺎﺗﻲ ﻣﺜﻞ ﻣﻴﺰﺍﻥ ﺑﺎﺯﺩﻫﻲ ،ﺗﻌﺪﺍﺩ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﻫﺮ ﻟﻴﻨﻚ ﻭ ...ﺭﺍ ﺩﺍﺭﺍﺳﺖ.
٣‐٢‐٢ﺯﺑﺎﻥ ﻛﺎﺭﺑﺮﻱ
OTcl
ﻫﻤﺎﻧﮕﻮﻧﻪ ﻛﻪ ﻗﺒﻼ ﮔﻔﺘﻪ ﺷﺪ ns ،ﺍﺳﺎﺳﺎ ﻳﻚ ﻣﻔﺴﺮ otclﺍﺳﺖ ﻭ ﺑﻨﺎﺑﺮﺍﻳﻦ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ nsﺑﺴﻴﺎﺭ ﻣﻔﻴﺪ ﺧﻮﺍﻫﺪ ﺑﻮﺩ ﻛﻪ ﻧﺤﻮﺓ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﻪ ﺯﺑﺎﻥ otclﺭﺍ ﺑﺪﺍﻧﻴﻢ .ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﻳﻚ ﻣﺜﺎﻝ ﺍﺯ ﺍﺳﻜﺮﻳﭙﺖ tclﻭ ﻳﻚ ﻣﺜﺎﻝ ﺍﺯ ﺍﺳﻜﺮﻳﭙﺖ otclﺁﻭﺭﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﻣﺜﺎﻝ ١ﻳﻚ ﺍﺳﻜﺮﻳﭙﺖ tclﺍﺳﺖ ﻛﻪ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ ﭼﮕﻮﻧﻪ ﻣﻲﺗﻮﺍﻥ ﻳﻚ ﺭﻭﺍﻝ ﺍﻳﺠﺎﺩ ﻛﺮﺩ ﻭ ﺁﻧﺮﺍ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻧﻤﻮﺩ ،ﭼﮕﻮﻧﻪ ﻣﻲﺗﻮﺍﻥ ﻣﺘﻐﻴﺮﻫﺎ ﺭﺍ ﻣﻘﺪﺍﺭﺩﻫﻲ ﻛﺮﺩ ﻭ ﺑﺎﻻﺧﺮﻩ ﭼﮕﻮﻧﻪ ﻣﻲﺗﻮﺍﻥ ﺣﻠﻘﻪ ﺍﻳﺠﺎﺩ ﻛﺮﺩ.
ﻣﺜﺎﻝ : ١ﺍﻳﺠﺎﺩ ﻭ ﻓﺮﺍﺧﻮﺍﻧﻲ ﺭﻭﺍﻝ ﺩﺭ tcl
ﺩﺭ tclﺍﺯ ﻛﻠﻤﺔ ﻛﻠﻴﺪﻱ procﺑﺮﺍﻱ ﺗﻌﺮﻳﻒ ﻳﻚ ﺭﻭﺍﻝ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﺑﻪ ﺩﻧﺒﺎﻝ ﻭﺍﮊﺓ procﺑﻪ ﺗﺮﺗﻴﺐ ﻧﺎﻡ ﺭﻭﺍﻝ ﻭ ﺳﭙﺲ ﺁﺭﮔﻮﻣﺎﻧﻬﺎﻱ ﺁﻥ ،ﻛﻪ ﺩﺭ ﺩﺍﺧﻞ ﮔﻴﻮﻣﻪ ﻗﺮﺍﺭ ﮔﺮﻓﺘﻪﺍﻧﺪ ،ﻣﻲﺁﻳﻨﺪ .ﺍﺯ ﻭﺍﮊﺓ ﻛﻠﻴﺪﻱ setﺑﺮﺍﻱ ﺗﺨﺼﻴﺺ ﻳﻚ ﻣﻘﺪﺍﺭ ﺑﻪ ﻳﻚ ﻣﺘﻐﻴﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﻋﺒﺎﺭﺕ ] [expr ...ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﻛﻪ ﻣﻔﺴﺮ ﻋﺒﺎﺭﺗﻲ ﺭﺍ ﻛﻪ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٨‐٢
ﺑﻌﺪ ﺍﺯ ﻭﺍﮊﺓ exprﺁﻣﺪﻩ ﺍﺳﺖ ،ﺍﺭﺯﻳﺎﺑﻲ ﻧﻤﺎﻳﺪ .ﺗﻮﺟﻪ ﻛﻨﻴﺪ ﻛﻪ ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻣﺤﺘﻮﻱ ﻳﻚ ﻣﺘﻐﻴﺮ ﺍﺯ ﻛﺎﺭﺍﻛﺘﺮ $ﺑﻪ ﻫﻤﺮﺍﻩ ﻧﺎﻡ ﻣﺘﻐﻴﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﻭﺍﮊﺓ ﻛﻠﻴﺪﻱ putsﺭﺷﺘﻪﺍﻱ ﺭﺍ ﻛﻪ ﻣﺎﺑﻴﻦ ﻛﺎﺭﺍﻛﺘﺮﻫﺎﻱ "" ﻗﺮﺍﺭ ﮔﺮﻓﺘﻪ ﺍﺳﺖ ،ﺩﺭ ﺧﺮﻭﺟﻲ ﭼﺎﭖ ﻣﻲﻛﻨﺪ .ﺩﺭ ﺯﻳﺮ ﻧﺘﻴﺠﺔ ﺣﺎﺻﻞ ﺍﺯ ﺍﺟﺮﺍﻱ ﻣﺜﺎﻝ ١ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ :
ﻣﺜﺎﻝ ﺑﻌﺪ ﻳﻚ ﻣﺜﺎﻝ ﺷﻲﮔﺮﺍ ﺑﻪ ﺯﺑﺎﻥ otclﻣﻲﺑﺎﺷﺪ .ﺍﻳﻦ ﻣﺜﺎﻝ ﺑﺴﻴﺎﺭ ﺳﺎﺩﻩ ﻣﻲﺑﺎﺷﺪ ﻭ ﺻﺮﻓﺎ ﻧﺸﺎﻥ ﺩﻫﻨﺪﺓ ﻧﺤﻮﺓ ﺍﻳﺠﺎﺩ ﻭ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻳﻚ ﺷﻲ ﺩﺭ otclﻣﻲﺑﺎﺷﺪ.
ﻣﺜﺎﻝ : ٢ﺍﻳﺠﺎﺩ ﺷﻲ ﻭ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﺭﺙﺑﺮﻱ ﺩﺭ otcl
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٩‐ ٢
ﺩﺭ ﻣﺜﺎﻝ ٢ﺩﻭ ﻛﻼﺱ ﺑﻪ ﻧﺎﻣﻬﺎﻱ momﻭ kidﺗﻌﺮﻳﻒ ﺷﺪﻩﺍﻧﺪ .ﻛﻼﺱ kidﺑﻪ ﻋﻨﻮﺍﻥ ﻓﺮﺯﻧﺪ ﻛﻼﺱ momﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺍﺳﺖ .ﻭﻟﻲ ﺗﺎﺑﻊ greetﺩﺭ ﻛﻼﺱ kidﺩﻭﺑﺎﺭﻩﻧﻮﻳﺴﻲ ﺷﺪﻩ ﺍﺳﺖ .ﺍﺯ ﻭﺍﮊﻩ ﻛﻠﻴﺪﻱ Class
ﺑﺮﺍﻱ ﺗﻌﺮﻳﻒ ﻭ ﺍﻳﺠﺎﺩ ﻛﻼﺱ ﻭ ﺍﺯ ﻭﺍﮊﻩ ﻛﻠﻴﺪﻱ instprocﺑﺮﺍﻱ ﺗﻌﺮﻳﻒ ﺗﻮﺍﺑﻊ ﻋﻀﻮ ﻳﻚ ﻛﻼﺱ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺑﺮﺍﻱ ﺍﺭﺙﺑﺮﻱ ﺍﺯ ﻭﺍﮊﺓ ﻛﻠﻴﺪﻱ -superclassﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﮔﺮﺩﺩ .ﺩﺭ ﺗﻌﺮﻳﻒ ﺗﺎﺑﻊ ،ﻭﺍﮊﺓ $selfﻫﻤﺎﻧﻨﺪ ﺍﺷﺎﺭﻩﮔﺮ thisﺩﺭ C++ﻋﻤﻞ ﻣﻲﻛﻨﺪ ﻭ instvarﺑﺮﺭﺳﻲ ﻣﻲﻛﻨﺪ ﻛﻪ ﺁﻳﺎ ﻧﺎﻡ ﻣﺘﻐﻴﺮﻱ ﻛﻪ ﺑﻌﺪ ﺍﺯ ﺁﻥ ﻣﻲﺁﻳﺪ ﺩﺭ ﺧﻮﺩ ﻛﻼﺱ ﻭ ﻳﺎ ﺩﺭ ﻛﻼﺱ ﭘﺪﺭ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺍﺳﺖ ﻳﺎ ﻧﻪ .ﺍﮔﺮ ﻣﺘﻐﻴﺮ ﺍﺯ ﻗﺒﻞ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺑﺎﺷﺪ ﺑﻪ ﺁﻥ ﺍﺭﺟﺎﻉ ﻣﻲﺷﻮﺩ ﻭﮔﺮﻧﻪ ﻳﻚ ﻣﺘﻐﻴﺮ ﺟﺪﻳﺪ ﺗﻌﺮﻳﻒ ﻣﻲﺷﻮﺩ .ﻭ ﺑﺎﻻﺧﺮﻩ ﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ ﻳﻚ ﻧﻤﻮﻧﻪ ﺍﺯ ﺷﻲ ﺍﺯ ﻭﺍﮊﺓ ،newﻫﻤﺎﻧﮕﻮﻧﻪ ﻛﻪ ﺩﺭ ﻣﺜﺎﻝ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ،ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﺧﺮﻭﺟﻲ ﺑﺮﻧﺎﻣﻪ ﺑﻪ ﺷﻜﻞ ﺯﻳﺮ ﻣﻲﺑﺎﺷﺪ :
ﺩﺭ ﺑﺨﺶ ﺑﻌﺪ ﺑﻪ ﺗﻮﺿﻴﺢ ﻧﺮﻡﺍﻓﺰﺍﺭ namﻛﻪ ﺑﺮﺍﻱ ﻧﻤﺎﻳﺶ ﮔﺮﺍﻓﻴﻜﻲ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺑﻪ ﻛﺎﺭ ﻣﻲﺭﻭﺩ ،ﻣﻲﭘﺮﺩﺍﺯﻳﻢ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣-٢
١٠‐٢
ﺑﺨﺶ : ٣ﻧﺮم اﻓﺰار Nam
namﺍﺑﺰﺍﺭﻱ ﺑﺮﺍﻱ ﻧﻤﺎﻳﺶ ﮔﺮﺍﻓﻴﻜﻲ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺷﺒﻜﻪ ﻣﻲﺑﺎﺷﺪ ﻭ ﻣﺤﻴﻄﻲ ﺩﺭ ﺍﺧﺘﻴﺎﺭ ﻣﻲﮔﺬﺍﺭﺩ ﻛﻪ ﺑﺘﻮﺍﻥ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺁﻥ ﺣﺮﻛﺖ ﻭﺍﻗﻌﻲ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺍﺩﻩﺍﻱ ﺭﺍ ﻣﺸﺎﻫﺪﻩ ﻛﺮﺩ. ﻗﺪﻡ ﺍﻭﻝ ﺩﺭ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺑﺮﻧﺎﻣﻪ namﺍﻳﺠﺎﺩ ﻓﺎﻳﻞ traceﻣﻲﺑﺎﺷﺪ .ﻓﺎﻳﻞ traceﺑﺎﻳﺪ ﺷﺎﻣﻞ ﺍﻃﻼﻋﺎﺕ ﺗﻮﭘﻮﻟﻮﮊﻱ ﮔﺮﻩﻫﺎ ،ﻟﻴﻨﻚﻫﺎ ﻭ traceﺑﺴﺘﻪﻫﺎ ﺑﺎﺷﺪ .ﻣﻌﻤﻮﻻ ﻓﺎﻳﻞ traceﺑﻮﺳﻴﻠﺔ nsﺍﻳﺠﺎﺩ ﻣﻲﺷﻮﺩ .ﺩﺭ ﻃﻮﻝ ﺷﺒﻴﻪﺳﺎﺯﻱ ، nsﻛﺎﺭﺑﺮﺍﻥ ﻣﻲﺗﻮﺍﻧﻨﺪ ﺷﻜﻞ ﺗﻮﭘﻮﻟﻮﮊﻱ ،ﺍﻃﻼﻋﺎﺕ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻭ traceﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻭﻗﺎﻳﻊ ﻣﻮﺟﻮﺩ ﺩﺭ ﻓﺎﻳﻞ traceﺩﺭ nsﺗﻮﻟﻴﺪ ﻧﻤﺎﻳﻨﺪ. ﭘﺲ ﺍﺯ ﺁﻧﻜﻪ ﻓﺎﻳﻞ traceﺍﻳﺠﺎﺩ ﺷﺪ ،ﺁﻣﺎﺩﺓ ﻧﻤﺎﻳﺶ ﺍﺯ ﻃﺮﻳﻖ namﻣﻲﺑﺎﺷﺪ .ﺑﻪ ﻣﺤﺾ ﺍﺟﺮﺍ nam ،ﻓﺎﻳﻞ ﺭﺍ ﻣﻲﺧﻮﺍﻧﺪ ،ﺗﻮﭘﻮﻟﻮﮊﻱ ﺭﺍ ﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ ،ﻣﺤﻴﻂ ﮔﺮﺍﻓﻴﻜﻲ ﺭﺍ ﺑﻪ ﻧﻤﺎﻳﺶ ﺩﺭ ﻣﻲﺁﻭﺭﺩ ،ﺍﮔﺮ ﻻﺯﻡ ﺑﺎﺷﺪ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ ﻭ ﺳﭙﺲ ﺗﺎ ﺭﺳﻴﺪﻥ ﺯﻣﺎﻥ ﺍﻭﻟﻴﻦ ﺑﺴﺘﻪ ﺩﺭ ﻓﺎﻳﻞ traceﻣﻨﺘﻈﺮ ﻣﻲﻣﺎﻧﺪ .ﺑﺮﺍﻱ ﺍﻋﻤﺎﻝ ﻛﻨﺘﺮﻝ ﺑﻴﺸﺘﺮ ﺑﺮ ﺭﻭﻱ ﺟﻨﺒﻪﻫﺎﻱ ﻣﺨﺘﻠﻒ ﻣﺘﺤﺮﻙﺳﺎﺯﻱ ،ﻣﻲﺗﻮﺍﻥ ﺍﺯ ﻭﺍﺳﻂ ﻛﺎﺭﺑﺮﻱ namﺍﺳﺘﻔﺎﺩﻩ ﻛﺮﺩ.
١‐٣‐٢ﭘﻴﻜﺮﺑﻨﺪﻱ namﺑﺮﺍﻱ ﻧﻤﺎﻳﺶ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺩﺭ ﻧﺮﻡﺍﻓﺰﺍﺭ namﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﻪ ﻭﺳﻴﻠﺔ ﮔﺮﻩﻫﺎ ﻭ ﻟﻴﻨﻚﻫﺎ ﻣﺸﺨﺺ ﻣﻲﺷﻮﺩ ﺍﻣﺎ ﺑﻪ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﻛﻪ ﻧﻤﺎﻳﺶ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﻪ ﺷﻜﻠﻲ ﻗﺎﺑﻞ ﺩﺭﻙ ﺑﺎﺷﺪ ،ﻣﻜﺎﻧﻴﺰﻡ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻻﺯﻡ ﻣﻲﺑﺎﺷﺪ .ﺩﺭ namﺩﻭ ﻣﻜﺎﻧﻴﺰﻡ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻭﺟﻮﺩ ﺩﺍﺭﺩ .ﺩﺭ ﺭﻭﺵ ﺍﻭﻝ ،ﺧﻮﺩ ﻛﺎﺭﺑﺮﺍﻥ ﺑﺎﻳﺴﺘﻲ ﺟﻬﺖ ﻳﺎﻟﻬﺎ ﺭﺍ ﻣﺸﺨﺺ ﻧﻤﺎﻳﻨﺪ .ﺟﻬﺖ ﻳﺎﻝ ،ﺯﺍﻭﻳﺔ ﺑﻴﻦ ﻳﺎﻝ ﻭ ﺧﻂ ﺍﻓﻖ ﻣﻲﺑﺎﺷﺪ ﻭ ﺩﺭ ﺑﺎﺯﺓ ] [0 , 2Piﻗﺮﺍﺭ ﺩﺍﺭﺩ .ﻣﻌﻤﻮﻻ ﺑﺪﻳﻦ ﮔﻮﻧﻪ ﻣﻲﺑﺎﺷﺪ ﻛﻪ ﺍﺑﺘﺪﺍ ﮔﺮﺓ ﻣﺮﺟﻊ ﺍﻧﺘﺨﺎﺏ ﻣﻲﺷﻮﺩ ﻭ ﺳﭙﺲ ﺩﻳﮕﺮ ﮔﺮﻩﻫﺎ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺟﻬﺖ ﻳﺎﻝ ﻭ ﻃﻮﻝ ﺁﻥ ،ﻛﻪ ﻣﺘﻨﺎﺳﺐ ﺑﺎ ﺗﺎﺧﻴﺮ ﺍﺳﺖ ،ﺩﺭ ﺟﺎﻳﺸﺎﻥ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ .ﺍﻳﻦ ﮔﻮﻧﻪ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺑﺮﺍﻱ ﺗﻮﻟﻴﺪ ﺗﻮﭘﻮﻟﻮﮊﻳﻬﺎﻱ ﺩﺳﺘﻲ ﻭ ﻛﻮﭼﻚ ﻣﻨﺎﺳﺐ ﻣﻲﺑﺎﺷﺪ ﻭﻟﻲ ﺑﺮﺍﻱ ﺗﻮﭘﻮﻟﻮﮊﻳﻬﺎﻱ ﺑﺰﺭﮒ ﺍﺻﻼ ﺭﻭﺵ ﻣﻨﺎﺳﺒﻲ ﻧﻤﻲﺑﺎﺷﺪ. ﺩﺭ ﺭﻭﺵ ﺩﻭﻡ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺑﻪ ﺻﻮﺭﺕ ﺧﻮﺩﻛﺎﺭ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ ﻭ ﻣﻌﻤﻮﻻ ﻫﻨﮕﺎﻣﻴﻜﻪ ﻣﺎ ﺑﺎ ﺗﻮﭘﻮﻟﻮﮊﻳﻬﺎﻱ ﺑﺰﺭﮒ ﺳﺮﻭﻛﺎﺭ ﺩﺍﺭﻳﻢ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ .ﺑﻪ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺍﻟﮕﻮﺭﻳﺘﻢ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺧﻮﺩﻛﺎﺭ ﮔﺮﺍﻑ ﺩﺭ namﭘﻴﺎﺩﻩ- ﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ .ﺍﻳﺪﺓ ﺍﺻﻠﻲ ﺍﻟﮕﻮﺭﻳﺘﻢ ﻣﺪﻟﺴﺎﺯﻱ ﮔﺮﺍﻓﻲ ﺍﺯ ﮔﺮﻩﻫﺎﻱ ﻣﺘﺼﻞ ﺷﺪﻩ ﺍﺯ ﻃﺮﻳﻖ ﻳﺎﻟﻬﺎ ﻣﻲﺑﺎﺷﺪ .ﮔﺮﻩ- ﻫﺎ ﻧﺴﺒﺖ ﺑﻪ ﻳﻜﺪﻳﮕﺮ ﺣﺎﻟﺖ ﺩﺍﻓﻌﻪ ﺩﺍﺭﻧﺪ ﺩﺭﺣﺎﻟﻴﻜﻪ ﻳﺎﻟﻬﺎ ﺁﻧﻬﺎ ﺭﺍ ﺑﻪ ﺳﻤﺖ ﻫﻢ ﻣﻲﻛﺸﻨﺪ .ﺍﻳﻦ ﺳﻴﺴﺘﻢ ﭘﺲ ﺍﺯ ﭼﻨﺪﻳﻦ ﻣﺮﺣﻠﻪ ﺗﻜﺮﺍﺭ ﻫﻤﮕﺮﺍ ﻣﻲﺷﻮﺩ .ﺷﺒﻴﻪﺳﺎﺯﻳﻬﺎ ﻧﺸﺎﻥ ﻣﻲﺩﻫﻨﺪ ﻛﻪ ﭘﺲ ﺍﺯ ١٠ﺗﺎ ١٠٠ﺗﻜﺮﺍﺭ ،ﺍﻏﻠﺐ ﮔﺮﺍﻓﻬﺎ ﺑﻪ ﺳﺎﺧﺘﺎﺭﻱ ﻗﺎﺑﻞ ﺩﺭﻙ ﻫﻤﮕﺮﺍ ﻣﻲﺷﻮﻧﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١١‐٢
ﺳﻪ ﭘﺎﺭﺍﻣﺘﺮ ﺩﺭ ﺗﻨﻈﻴﻢﻛﺮﺩﻥ ﭘﺮﻭﺳﺔ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺧﻮﺩﻛﺎﺭ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ ﻛﻪ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ : : Ca .١ﻧﻴﺮﻭﻱ ﺟﺎﺫﺑﺔ ﺩﺍﺋﻤﻲ ﻛﻪ ﻧﻴﺮﻭﻱ ﻳﺎﻟﻬﺎ ﺭﺍ ﻛﻨﺘﺮﻝ ﻣﻲﻛﻨﺪ ﻭ ﻣﻘﺪﺍﺭ ﭘﻴﺶﻓﺮﺽ ﺁﻥ ٠/١٥ﻣﻲﺑﺎﺷﺪ. : Cr .٢ﻧﻴﺮﻭﻱ ﺩﺍﻓﻌﺔ ﺩﺍﺋﻤﻲ ﻛﻪ ﻧﻴﺮﻭﻱ ﺩﺍﻓﻌﺔ ﺑﻴﻦ ﮔﺮﻩﻫﺎ ﺭﺍ ﻛﻨﺘﺮﻝ ﻣﻲﻛﻨﺪ ﻭ ﻣﻘﺪﺍﺭ ﻗﺮﺍﺭﺩﺍﺩﻱ ﺁﻥ ٠/١٥ ﻣﻲﺑﺎﺷﺪ. .٣ﺗﻌﺪﺍﺩ ﺗﻜﺮﺍﺭﻫﺎ :ﻣﻘﺪﺍﺭ ﭘﻴﺶﻓﺮﺽ ﺍﻳﻦ ﭘﺎﺭﺍﻣﺘﺮ ١٠ﻣﻲﺑﺎﺷﺪ. ﻧﻜﺘﻪ :ﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ ﺗﻮﭘﻮﻟﻮﮊﻳﻬﺎﻱ ﺑﺰﺭﮒ ،ﺑﺎﻳﺴﺘﻲ ﭘﺎﺭﺍﻣﺘﺮﻫﺎ ﺭﺍ ﺑﻪ ﺷﻜﻠﻲ ﺩﻗﻴﻖ ﺗﻨﻈﻴﻢ ﻛﺮﺩ.
٢‐٣‐٢ﻭﺍﺳﻂ ﻛﺎﺭﺑﺮﻱ ﻭﻗﺘﻲ ﻛﻪ ﺑﺮﻧﺎﻣﺔ namﺍﺟﺮﺍ ﻣﻲﺷﻮﺩ ،ﭘﻨﺠﺮﻩﺍﻱ ﺑﺎﺯ ﻣﻲﺷﻮﺩ ﻛﻪ ﺩﺍﺭﺍﻱ ﺑﺨﺸﻬﺎﻱ ﮔﻮﻧﺎﮔﻮﻧﻲ ﻣﻲﺑﺎﺷﺪ .ﺑﺎﻻﻱ ﭘﻨﺠﺮﻩ menubar ،ﻗﺮﺍﺭ ﺩﺍﺭﺩ ﻛﻪ ﺩﺍﺭﺍﻱ ﺳﻪ ﻓﻴﻠﺪ fileﻭ Viewﻭ helpﻣﻲﺑﺎﺷﺪ .ﻣﻨﻮﻱ fileﺩﺍﺭﺍﻱ ﺩﺍﺭﺍﻱ ﺁﻳﺘﻤﻬﺎﻱ ﻣﺨﺘﻠﻔﻲ ﺍﺯ ﺟﻤﻠﻪ Openﻭ Quitﻣﻲﺑﺎﺷﺪ .ﻣﻨﻮﻱ viewﺩﺍﺭﺍﻱ ﭼﻬﺎﺭ ﺁﻳﺘﻢ ﺯﻳﺮ ﻣﻲﺑﺎﺷﺪ : •
: new viewﺍﻳﻦ ﺁﻳﺘﻢ viewﺟﺪﻳﺪﻱ ﺑﺎ ﻫﻤﺎﻥ animationﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ .ﻛﺎﺭﺑﺮ ﻣﻲﺗﻮﺍﻧﺪ view
ﺟﺪﻳﺪ ﺭﺍ ﺑﺰﺭﮒ ﻭ ﻛﻮﭼﻚ ﻧﻤﺎﻳﺪ .ﻫﻤﭽﻨﻴﻦ ﻗﺎﺑﻠﻴﺖ ﺛﺒﺖ ﺁﻥ ﻧﻴﺰ ﻭﺟﻮﺩ ﺩﺍﺭﺩ. • : show monitors checkboxﺍﮔﺮ ﻋﻼﻣﺖ ﺧﻮﺭﺩﻩ ﺑﺎﺷﺪ monitor ،ﻫﺎ ﺩﺭ ﻧﻴﻤﺔ ﭘﺎﻳﻴﻦ ﭘﻨﺠﺮﻩ ﻧﻤﺎﻳﺶ ﺩﺍﺩﻩ ﻣﻲﺷﻮﻧﺪ. •
: show autolayout checkboxﺍﮔﺮ ﻋﻼﻣﺖ ﺧﻮﺭﺩﻩ ﺑﺎﺷﺪ ،ﺩﺭ ﻧﻴﻤﺔ ﭘﺎﻳﻴﻦ ﭘﻨﺠﺮﻩ ﻛﻪ ﺷﺎﻣﻞ box ﻫﺎﻱ ﻭﺭﻭﺩﻱ ﻭ ﻛﻠﻴﺪ ﺗﻨﻈﻴﻢ ﺧﻮﺩﻛﺎﺭ ﻃﺮﺡ ﻣﻲﺑﺎﺷﺪ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ .ﺗﻮﺟﻪ ﻛﻨﻴﺪ ﻛﻪ ﺍﮔﺮ ﻓﺎﻳﻞ trace
ﻣﺸﺨﺼﻪﻫﺎﻱ ﻃﺮﺡ ﺧﻮﺩﺵ ﺭﺍ ﺩﺍﺷﺘﻪ ﺑﺎﺷﺪ ﺍﻳﻦ boxﻧﻤﺎﻳﺶ ﺩﺍﺩﻩ ﻧﻤﻲﺷﻮﺩ ﺍﻣﺎ ﺍﮔﺮ ﻣﺸﺨﺼﺎﺕ ﻃﺮﺡ ﻛﺎﻣﻞ ﻧﺒﺎﺷﺪ ،ﺍﻳﻦ boxﺑﻪ ﻧﻤﺎﻳﺶ ﺩﺭ ﺧﻮﺍﻫﺪ ﺁﻣﺪ. • : show animation checkboxﺍﮔﺮ ﻋﻼﻣﺖ ﺧﻮﺭﺩﻩ ﺑﺎﺷﺪ listbox ،ﺍﻱ ﺩﺭ ﻧﻴﻤﺔ ﭘﺎﻳﻴﻨﻲ ﭘﻨﺠﺮﻩ ﻧﻤﺎﻳﺶ ﺩﺍﺩﻩ ﺧﻮﺍﻫﺪ ﺷﺪ. ﻣﻨﻮﻱ helpﺩﺭ ﺳﻤﺖ ﺭﺍﺳﺖ menubarﻗﺮﺍﺭ ﺩﺍﺭﺩ ﻭ ﺷﺎﻣﻞ ﺩﻭ ﺁﻳﺘﻢ ﻣﻲﺑﺎﺷﺪ .ﺑﺎ ﺍﻧﺘﺨﺎﺏ ﺁﻳﺘﻢ ، help ﭘﻨﺠﺮﺓ ﺟﺪﻳﺪﻱ ﻛﻪ ﺣﺎﻭﻱ ﺍﻃﻼﻋﺎﺗﻲ ﺩﺭ ﻣﻮﺭﺩ ﻧﺤﻮﺓ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ namﻣﻲﺑﺎﺷﺪ ﻧﻤﺎﻳﺶ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺑﺎ ﺍﻧﺘﺨﺎﺏ ﺁﻳﺘﻢ aboutﭘﻨﺠﺮﺓ ﺟﺪﻳﺪﻱ ﻛﻪ ﺷﺎﻣﻞ ﺗﺎﺭﻳﺨﭽﻪ ﻭ ﻣﻮﻗﻌﻴﺖ namﻣﻲﺑﺎﺷﺪ ﺑﻪ ﻧﻤﺎﻳﺶ ﺩﺭﺧﻮﺍﻫﺪ ﺁﻣﺪ. ﺩﺭ ﺑﺨﺶ ﺑﻌﺪ ﺑﻪ ﺗﻮﺿﻴﺢ ﻧﺤﻮﺓ ﺍﻧﺠﺎﻡ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺍﺯ ﻃﺮﻳﻖ ﻣﺜﺎﻟﻬﺎﻱ ﻋﻤﻠﻲ ﺧﻮﺍﻫﻴﻢ ﭘﺮﺩﺍﺧﺖ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤-٢
١٢‐٢
ﺑﺨﺶ : ٤ﻣﺜﺎﻟﻬﺎي ﻋﻤﻠﻲ
ﺩﺭ nsﺑﺮﺍﻱ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺷﺒﻜﻪﻫﺎ ﺍﺯ ﺯﺑﺎﻥ Tcl Scriptﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ Tcl Script .ﻳﻚ ﺯﺑﺎﻥ ﺍﺳﻜﺮﻳﭙﺘﻲ ﺍﺳﺖ ﻛﻪ ﺍﺯ ﺁﻥ ﺑﺮﺍﻱ ﻣﻌﺮﻓﻲ ﮔﺮﻩ ﻫﺎﻱ ﺷﺒﻜﻪ ،ﻟﻴﻨﻚ ﻫﺎﻱ ﺑﻴﻦ ﮔﺮﻩ ﻫﺎ ،ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻟﻴﻨﻚ ﻫﺎ ﻭ ﺳﺎﻳﺮ ﻣﺸﺨﺼﺎﺕ ﺷﺒﻜﻪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ. ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺷﺒﻴﻪ ﺳﺎﺯ ،ﺩﺭ ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺷﺒﻜﻪ ﺩﻟﺨﻮﺍﻩ ﺧﻮﺩ ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ Tcl Scriptﺩﺭ ﻳﻚ ﻓﺎﻳﻞ ﻣﻌﺮﻓﻲ ﻛﺮﺩﻩ ﻭ ﺩﺭ ﺍﻧﺘﻬﺎ ﻓﺎﻳﻞ ﺭﺍ ﺑﺎ ﭘﺴﻮﻧﺪ .tclﺫﺧﻴﺮﻩ ﻛﻨﻴﺪ .ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺑﺎ ﻭﻳﺮﺍﻳﺸﮕﺮﻫﺎﻱ ﻣﻮﺟﻮﺩ ﺩﺭ ﻟﻴﻨﻮﻛﺲ ﻣﺜﻞ emacsﺍﻧﺠﺎﻡ ﺩﻫﻴﺪ .ﺩﺭ ﺍﻧﺘﻬﺎ ﺑﺎ ﺍﺟﺮﺍﻱ ﺩﺳﺘﻮﺭ ns filename.tclﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺭﺍ ﺍﻧﺠﺎﻡ ﺩﻫﻴﺪ. ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ،ﺩﺭ ﺍﺑﺘﺪﺍ ﺑﺎ ﺍﺻﻮﻝ Tcl Scriptﺁﺷﻨﺎ ﺧﻮﺍﻫﻴﺪ ﺷﺪ .ﺳﭙﺲ ﺑﺎ ﺍﺭﺍﻳﻪ ﻣﺜﺎﻟﻬﺎﻳﻲ ،ﻗﺎﺑﻠﻴﺖ ﻫﺎﻱ ﺁﻥ ﻋﻨﻮﺍﻥ ﺧﻮﺍﻫﺪ ﺷﺪ.
١‐٤‐٢ﻓﺮﻣﺎﻧﻬﺎﻱ ﺍﻭﻟﻴﻪ ns-2 ﺩﺳﺘﻮﺭﺍﺗﻲ ﻛﻪ ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﻣﻲ ﺁﻳﺪ ،ﺑﺎﻳﺪ ﺗﻮﺳﻂ ﻳﻚ ﻭﻳﺮﺍﻳﺸﮕﺮ ﺩﺭ ﻳﻚ ﻓﺎﻳﻞ ﻭﺍﺭﺩ ﺷﺪﻩ ﻭ ﺩﺭ ﺍﻧﺘﻬﺎ ﺑﺎ ﭘﺴﻮﻧﺪ tclﺫﺧﻴﺮﻩ ﮔﺮﺩﺩ.
ﺑﺮﺍﻱ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ،ﺩﺭ ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﻳﻚ ﻧﻤﻮﻧﻪ ﺍﺯ ﺷﺊ Simulatorﺍﻳﺠﺎﺩ ﮔﺮﺩﺩ .ﺍﻳﻦ ﻛﺎﺭ ﺑﺎ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﻧﺠﺎﻡ ﻣﻲ ﮔﻴﺮﺩ : ]set ns [new Simulator
ﺑﺮﺍﻱ ﺫﺧﻴﺮﻩ ﺍﻃﻼﻋﺎﺕ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ nam traceﺑﺎﻳﺪ ﻓﺎﻳﻠﻲ ﺑﺎﺯ ﺷﻮﺩ .ﺑﺮﺍﻱ ﺍﻳﻦ ﻛﺎﺭ ﺍﺯ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﻛﻨﻴﻢ : ]set nf [open out.nam w
ﺍﻳﻦ ﺩﺳﺘﻮﺭ ،ﻓﺎﻳﻞ out.namﺭﺍ ﺑﺮﺍﻱ ﻧﻮﺷﺘﻦ ﺑﺎﺯ ﻣﻲ ﻛﻨﺪ ﻭ handler ، nfﺁﻥ ﻣﻲ ﺑﺎﺷﺪ .ﻳﻌﻨﻲ ﺑﺮﺍﻱ ﺍﺷﺎﺭﻩ ﺑﻪ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ ﺍﺯ nfﺍﺳﺘﻔﺎﺩﻩ ﺧﻮﺍﻫﺪ ﺷﺪ. ﺑﺮﺍﻱ ﺍﻳﻨﻜﻪ ﺗﻤﺎﻡ ﺧﺮﻭﺟﻲ ﻫﺎﻱ ﻣﺮﺗﺒﻂ ﺑﺎ namﺑﻪ ﻓﺎﻳﻞ nfﻣﻨﺘﻘﻞ ﺷﻮﻧﺪ ﺍﺯ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ : $ns namtrace-all $nf
ﺩﺭ ﺧﺎﺗﻤﻪ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺍﺯ ﺗﺎﺑﻊ finishﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ .ﻛﻪ ﻓﺎﻳﻞ ﻫﺎﻱ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺭﺍ ﺑﺴﺘﻪ ،ﺑﺎﻓﺮﻫﺎ ﺭﺍ ﺁﺯﺍﺩ ﻛﺮﺩﻩ ﻭ ﺳﺎﻳﺮ ﻛﺎﺭﻫﺎﻱ ﻻﺯﻡ ﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲ ﺩﻫﺪ. {}{ proc finish
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١٣‐٢ global nf ns $ns flush-trace close $nf exec nam out.nam exit 0 }
ﺩﺭ ﺍﻳﻦ ﺗﺎﺑﻊ ،ﭘﺲ ﺍﺯ ﺧﺎﺗﻤﻪ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﻭ ﺑﺴﺘﻦ ﻓﺎﻳﻞ ، out.namﺑﺮﻧﺎﻣﻪ namﺑﺎ ﻭﺭﻭﺩﻱ out.namﺻﺪﺍ ﺯﺩﻩ ﻣﻲ ﺷﻮﺩ. ﺑﺮﺍﻱ ﺧﺎﺗﻤﻪ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺑﺎﻳﺪ ﺗﺎﺑﻊ finishﺻﺪﺍ ﺷﻮﺩ : ”$ns at 5.0 “finish
ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺑﻪ ﺷﺒﻴﻪ ﺳﺎﺯ ﻣﻲ ﮔﻮﻳﺪ ٥ﺛﺎﻧﻴﻪ ﭘﺲ ﺍﺯ ﺷﺮﻭﻉ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺗﺎﺑﻊ finishﺭﺍ ﺍﺟﺮﺍ ﻛﻨﺪ. ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﻳﺪﻩ ﻣﻲ ﺷﻮﺩ ﺑﺮﺍﻱ ﺯﻣﺎﻥ ﺑﻨﺪﻱ ﺭﻭﻳﺪﺍﺩﻫﺎ ﺍﺯ ﻛﻠﻤﻪ ﻛﻠﻴﺪﻱ atﻣﻲ ﺗﻮﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻛﺮﺩ. ﺩﺭ ﺍﻧﺘﻬﺎ ﺑﺮﺍﻱ ﺷﺮﻭﻉ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺍﺯ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ : $ns run
٢‐٤‐٢ﻣﺪﻝ ﻛﺮﺩﻥ ﻳﻚ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺳﺎﺩﻩ :ﺩﻭ ﮔﺮﻩ ﺑﺎ ﻳﻚ ﻟﻴﻨﻚ ﺑﺮﺍﻱ ﺷﺮﻭﻉ ،ﺍﺯ ﻳﻚ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺳﺎﺩﻩ ﻛﻪ ﺩﺭ ﺁﻥ ﺩﻭ ﮔﺮﻩ ﺑﺎ ﻳﻚ ﻟﻴﻨﻚ ﺑﻪ ﻫﻢ ﻣﺘﺼﻞ ﺷﺪﻩ ﺍﻧﺪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﻛﻨﻴﻢ. ﻛﺪ ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﺑﺎﻳﺪ ﻗﺒﻞ ﺍﺯ $ns runﻳﺎ ﺣﺘﻲ ﺑﻬﺘﺮ ﺍﺳﺖ ﻗﺒﻞ ﺍﺯ ” $ns at 5.0 “finshﺍﺿﺎﻓﻪ ﺷﻮﻧﺪ. ﺩﺭ ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﮔﺮﻩ ﻫﺎ ﺭﺍ ﺗﻌﺮﻳﻒ ﻛﺮﺩ : ]set n0 [$ns node ]set n1 [$ns node
ﺍﻳﻦ ﺩﻭ ﺩﺳﺘﻮﺭ ،ﮔﺮﻩ ﻫﺎ ﺭﺍ ﺍﻳﺠﺎﺩ ﻛﺮﺩﻩ ﻭ ﺁﻧﻬﺎ ﺭﺍ ﺑﻪ n0ﻭ n1ﻧﺴﺒﺖ ﻣﻲ ﺩﻫﺪ. ﺑﺮﺍﻱ ﺗﻌﺮﻳﻒ ﻟﻴﻨﻚ ﺑﻴﻦ ﺩﻭ ﮔﺮﻩ ﺍﺯ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ : $ns duplex-link $n0 $n1 1mb 10ms DropTail ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻳﻚ ﻟﻴﻨﻚ ﺑﻴﻦ ﺩﻭ ﮔﺮﻩ n0ﻭ n1ﺍﻳﺠﺎﺩ ﻣﻲ ﻛﻨﺪ ﻛﻪ ﺍﺯ ﻧﻮﻉ ﺩﻭ ﻃﺮﻓﻪ ﺍﺳﺖ .ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ 1 mbit/s
ﻭ ﺗﺎﺧﻴﺮ 10 msﺩﺍﺷﺘﻪ ﻭ ﺩﺍﺭﺍﻱ ﺻﻔﻲ ﺍﺯ ﻧﻮﻉ DropTailﺍﺳﺖ .ﺩﺭ ﺻﻒ ، DropTailﺩﺭ ﺻﻮﺭﺕ ﺍﺭﺳﺎﻝ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١٤‐٢
ﺗﺮﺍﻓﻴﻚ ﺑﻴﺶ ﺍﺯ ﻇﺮﻓﻴﺖ ﺧﻂ ،ﺑﺴﺘﻪﻫﺎ ﺍﺯ ﺍﻧﺘﻬﺎﻱ ﺻﻒ ﺣﺬﻑ ﺧﻮﺍﻫﻨﺪ ﺷﺪ .ﺑﺎ ﺍﻧﻮﺍﻉ ﺩﻳﮕﺮ ﺻﻒ ﺑﻌﺪﺍ ﺁﺷﻨﺎ ﺧﻮﺍﻫﻴﻢ ﺷﺪ. ﺣﺎﻝ ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﺭﺍ ﺫﺧﻴﺮﻩ ﻛﺮﺩﻩ ﻭ ﺑﺮﻧﺎﻣﻪ ﺭﺍ ﺍﺟﺮﺍ ﻛﻨﻴﺪ .ﺧﺮﻭﺟﻲ ﺑﺼﻮﺭﺕ ﺯﻳﺮ ﻣﺸﺎﻫﺪﻩ ﻣﻲ ﺷﻮﺩ :
ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﻣﻲﺧﻮﺍﻫﻴﻢ ﺗﺮﺍﻓﻴﻜﻲ ﺭﺍ ﺍﺯ n0ﺑﻪ n1ﺍﺭﺳﺎﻝ ﻛﻨﻴﻢ. ﺩﺭ nsﺑﺮﺍﻱ ﺍﺭﺳﺎﻝ ﻭ ﺩﺭﻳﺎﻓﺖ ﺩﺍﺩﻩ ﻫﺎ ﺍﺯ ﻋﺎﻣﻠﻬﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ .ﺑﺮﺍﻱ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ (Traffic
) Sourceﻭ ﻣﻘﺼﺪ ﺗﺮﺍﻓﻴﻚ ) (Traffic Sinkﻋﺎﻣﻠﻬﺎﻱ ﺟﺪﺍﮔﺎﻧﻪﺍﻱ ﺗﻌﺮﻳﻒ ﻣﻲ ﺷﻮﺩ. #Create a UDP agent and attach it to node n0 ]set udp0 [new Agent/UDP $ns attach-agent $n0 $udp0 #Create a CBR traffic source and attach it to udp0 ]set cbr0 [new Aplication/Traffic/CBR $cbr0 set packetsize_500 $cbr0 set interval_0.005 $cbr0 attach-agent $udp0
ﺳﻪ ﺧﻂ ﺍﻭﻝ ﺳﺒﺐ ﺍﻳﺠﺎﺩ ﻳﻚ UDP agentﻭ ﻧﺴﺒﺖ ﺩﺍﺩﻥ ﺁﻥ ﺑﻪ n0ﻣﻲ ﺷﻮﺩ .ﺧﻄﻮﻁ ﺑﻌﺪ ﻳﻚ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ CBRﺍﻳﺠﺎﺩ ﻛﺮﺩﻩ ﻭ ﺑﻪ udp0ﻧﺴﺒﺖ ﻣﻲ ﺩﻫﺪ .ﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪ ﻫﺎ ٥٠٠ﺑﺎﻳﺖ ﺑﻮﺩﻩ ﻭ ﻫﺮ ٠/٠٠٥ﺛﺎﻧﻴﻪ ﻳﻚ ﺑﺴﺘﻪ ﺍﺭﺳﺎﻝ ﻣﻲ ﺷﻮﺩ. ﺩﻭ ﺩﺳﺘﻮﺭ ﺑﻌﺪ ﻳﻚ ﻋﺎﻣﻞ nullﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﮔﻴﺮﻧﺪﺓ ﺗﺮﺍﻓﻴﻚ ﻋﻤﻞ ﻣﻲ ﻛﻨﺪ ،ﺍﻳﺠﺎﺩ ﻛﺮﺩﻩ ﻭ ﺁﻧﺮﺍ ﺑﻪ n1ﻧﺴﺒﺖ ﻣﻲ ﺩﻫﻨﺪ. ]set null0 [new Agent/Null $ns attach-agent $n1 $null0
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١٥‐٢
ﺣﺎﻝ ﺩﻭ ﻋﺎﻣﻞ ﺑﻪ ﻫﻢ ﻣﺘﺼﻞ ﻣﻲ ﺷﻮﻧﺪ ﺗﺎ ﺗﺮﺍﻓﻴﻚ ﺍﺭﺳﺎﻟﻲ ﺗﻮﺳﻂ n0ﺩﺭ n1ﺩﺭﻳﺎﻓﺖ ﺷﻮﺩ : $ns connect $udp0 $null0
ﺷﺎﻳﺪ ﺍﻳﻦ ﺳﺌﻮﺍﻝ ﻣﻄﺮﺡ ﺷﻮﺩ ﻛﻪ ﺗﺮﺍﻓﻴﻚ ﭼﻪ ﺯﻣﺎﻧﻲ ﺷﺮﻭﻉ ﺑﻪ ﺍﺭﺳﺎﻝ ﺷﺪﻩ ﻭ ﭼﻪ ﺯﻣﺎﻧﻲ ﻣﺘﻮﻗﻒ ﺷﻮﺩ ؟ ﭘﺎﺳﺦ ﺍﻳﻦ ﺳﺌﻮﺍﻝ ﺩﺭ ﺯﻳﺮ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﺑﺮﺍﻱ ﻛﻨﺘﺮﻝ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﺩﺳﺘﻮﺭﺍﺕ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﻛﻨﻴﻢ )ﻗﺒﻞ ﺍﺯ : ( $ns at 5.0 finish "$ns at 0.5 "$cbr0 start "$ns at 4.5 "$cbr0 stop ﺣﺎﻝ ﻣﻲ ﺗﻮﺍﻧﻴﻢ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺭﺍ ﺍﻧﺠﺎﻡ ﺩﻫﻴﻢ .ﻭﻗﺘﻲ ﺩﺭ ﭘﻨﺠﺮﺓ ﺑﺎﺯ ﺷﺪﻩ ﺗﻮﺳﻂ namﺑﺮ ﺭﻭﻱ ﺩﻛﻤﺔ play
ﻛﻠﻴﻚ ﻛﻨﻴﻢ ﻣﺸﺎﻫﺪﻩ ﻣﻲ ﺷﻮﺩ ﺩﺭ ﺛﺎﻧﻴﻪ ٠/٥ﮔﺮﻩ n0ﺷﺮﻭﻉ ﺑﻪ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﺑﺮﺍﻱ ﮔﺮﻩ n1ﻣﻲ ﻛﻨﺪ .ﻭ ﺩﺭ ﺛﺎﻧﻴﻪ ٤/٥ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﻣﻮﻗﻒ ﻣﻲ ﺷﻮﺩ .ﺷﻜﻞ ﺯﻳﺮ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﮔﺮﻩ n0ﺑﻪ ﮔﺮﻩ n1ﺭﺍ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ.
ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺑﺎ ﻛﻠﻴﻚ ﺭﻭﻱ ﻟﻴﻨﻚ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﻳﺪ .ﻫﻤﻴﻦ ﻃﻮﺭ ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺍﻧﺪﺍﺯﺓ ﺑﺴﺘﻪ ﻫﺎ ﻭ ﺯﻣﺎﻥ ﺑﻴﻦ ﺍﺭﺳﺎﻝ ﺑﺴﺘﻪ ﻫﺎ ) (Interval Timeﺭﺍ ﺗﻐﻴﻴﺮ ﺩﺍﺩﻩ ﻭ ﺣﺎﺻﻞ ﺗﻐﻴﻴﺮﺍﺕ ﺭﺍ ﻣﺸﺎﻫﺪﻩ ﻛﻨﻴﺪ.
٣‐٤‐٢ﻣﺸﺨﺺ ﻛﺮﺩﻥ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﻭ ﻣﻮﻧﻴﺘﻮﺭ ﻛﺮﺩﻥ ﻟﻴﻨﻚ ﻫﺎ ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺍﺯ ﻳﻚ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ٤ﮔﺮﻩ ﺍﺳﺘﻔﺎﺩﻩ ﺧﻮﺍﻫﻴﻢ ﻛﺮﺩ .ﺩﻭ ﮔﺮﻩ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﻋﻤﻞ ﻣﻲ ﻛﻨﻨﺪ .ﻳﻚ ﮔﺮﻩ ﺩﺭﻳﺎﻓﺖ ﻛﻨﻨﺪﻩ ﺗﺮﺍﻓﻴﻚ ﻣﻲ ﺑﺎﺷﺪ .ﻭ ﻳﻚ ﮔﺮﻩ ﻓﻘﻂ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺑﻪ ﻣﻘﺼﺪ ﻣﻲ ﻓﺮﺳﺘﺪ. ﺑﺮﺍﻱ ﻣﺸﺨﺺ ﻛﺮﺩﻥ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﻭ ﻣﻮﻧﻴﺘﻮﺭ ﻛﺮﺩﻥ ﺻﻒ ﻣﺮﺑﻮﻁ ﺑﻪ ﻟﻴﻨﻚ ﺭﻭﺷﻬﺎﻳﻲ ﺍﺭﺍﻳﻪ ﺧﻮﺍﻫﺪ ﺷﺪ.
٤‐٤‐٢ﺗﻌﺮﻳﻒ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺣﺎﻝ ﺑﺮﺍﻱ ﺗﻌﺮﻳﻒ ﮔﺮﻩ ﻫﺎ ﺧﻄﻮﻁ ﺯﻳﺮ ﺭﺍ ﺍﺿﺎﻓﻪ ﻛﻨﻴﺪ :
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١٦‐٢ ]set n0 [$ns node ]set n1 [$ns node ]set n2 [$ns node ]set n3 [$ns node
ﺑﺮﺍﻱ ﺗﻌﺮﻳﻒ ﻟﻴﻨﻚ ﺑﻴﻦ ﮔﺮﻩ ﻫﺎ ﻛﺪﻫﺎﻱ ﺯﻳﺮ ﺭﺍ ﺑﻴﻔﺰﺍﻳﻴﺪ : $ns duplex-link $n0 $n2 1mb 10ms DropTail $ns duplex-link $n1 $n2 1mb 10ms DropTail $ns duplex-link $n3 $n2 1mb 10ms DropTail ﺍﻛﻨﻮﻥ ﻓﺎﻳﻞ ﺭﺍ ﺫﺧﻴﺮﻩ ﻭ ﺍﺟﺮﺍ ﻛﻨﻴﺪ .ﺍﻟﺒﺘﻪ ﻣﻤﻜﻦ ﺍﺳﺖ ﺷﻜﻞ ﺁﻥ ﺩﻟﺨﻮﺍﻩ ﻧﺒﺎﺷﺪ .ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺩﻛﻤﻪ re-layout
ﺭﺍ ﺑﺰﻧﻴﺪ ﺗﺎ ﺷﻜﻞ ﺁﻥ ﺑﻬﺘﺮ ﺷﻮﺩ .ﺍﻣﺎ ﺑﻬﺘﺮ ﺍﺳﺖ ﻛﻨﺘﺮﻝ ﺑﻴﺸﺘﺮﻱ ﺭﻭﻱ ﺁﻥ ﺩﺍﺷﺘﻪ ﺑﺎﺷﻴﺪ .ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺍﺯ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﺴﺘﻘﻴﻢ ﻫﺎ ﻣﻲ ﺗﻮﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻛﺮﺩ : $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right
ﺑﺎ ﺍﻓﺰﻭﺩﻥ ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﻫﺎ ﺷﻜﻞ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺩﺭ namﺑﺼﻮﺭﺕ ﺯﻳﺮ ﺧﻮﺍﻫﺪ ﺷﺪ :
ﺩﺭ ﺩﺳﺘﻮﺭﻫﺎﻱ ﺑﺎﻻﺟﻬﺖ ﻟﻴﻨﻚ ﻫﺎ ﺭﺍ ﺑﺎ right,left,up,downﻭﻳﺎ ﺗﺮﻛﻴﺒﻲ ﺍﺯ ﺍﻳﻨﻬﺎ ﻣﻲ ﺗﻮﺍﻥ ﻣﺸﺨﺺ ﻛﺮﺩ.
٥‐٤‐٢ﺗﻌﺮﻳﻒ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ ﻭ ﮔﻴﺮﻧﺪﻩ ﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ﮔﺮﻩ ﻫﺎﻱ n0ﻭ n1ﺭﺍ ﺑﻌﻨﻮﺍﻥ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ CBRﻭ ﮔﺮﻩ n3ﺭﺍ ﺑﻌﻨﻮﺍﻥ ﮔﻴﺮﻧﺪﻩ ﺗﺮﺍﻓﻴﻚ ﺗﻌﺮﻳﻒ ﻣﻲ ﻛﻨﻴﻢ. ﮔﺮﻩ n2ﺗﻨﻬﺎ ﻛﺎﺭ forwardingﺭﺍ ﺑﺮﺍﻱ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺍﻧﺠﺎﻡ ﻣﻲ ﺩﻫﺪ. #create a UDP agent and attach it to node n0
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
١٧‐٢ set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 #create a CBR traffic source and attach it to udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetsize_500 $cbr0 set interval _0.005 $cbr0 attach-gent $udp0 #create a UDP agent and attach it to noder n1 set udp1 [new Agent/UDP] $ns attach-agent $n1 $udp1 #create a CBR traffic source and attach it to udp1 set cbr1 [new Application/Traffic/CBR] $cbr1 set packetsize_500 $cbr1 set interval _0.005 $cbr1 attach-gent $udp1 #create a null aget for traffic sink n3 set null0 [new Agent/Null] $ns attach-agent $n3 $null0
: ﺣﺎﻝ ﺑﺎﻳﺪ ﺍﺗﺼﺎﻝ ﻋﺎﻣﻞﻫﺎ ﺑﺮﻗﺮﺍﺭ ﮔﺮﺩﺩ $ns connect $udp0 $null0 $ns connect $udp1 $null0
ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﺭﺍ٤ ﺷﺮﻭﻉ ﺑﻪ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﻛﺮﺩﻩ ﻭ ﺩﺭ ﺛﺎﻧﻴﻪ٠/٥ ﺩﺭ ﺛﺎﻧﻴﻪcbr0 ﻣﻲ ﺧﻮﺍﻫﻴﻢ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ٤/٥ ﺷﺮﻭﻉ ﺑﻪ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﻛﺮﺩﻩ ﻭ ﺩﺭ ﺛﺎﻧﻴﻪ١ ﺩﺭ ﺛﺎﻧﻴﻪcbr1 ﻣﺘﻮﻗﻒ ﻛﻨﺪ ﻭ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ : ﺑﻨﺎﺑﺮﺍﻳﻦ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﻋﻤﻞ ﻣﻲﻛﻨﻴﻢ.ﺭﺍ ﻣﺘﻮﻗﻒ ﻛﻨﺪ $ns at 0.5 $cbr0 start $ns at 1.0 $cbr1 start $ns at 4.0 $cbr0 stop $ns at 4.5 $cbr1 stop
ﻭn2 ﺑﻴﺶ ﺍﺯ ﻇﺮﻓﻴﺖ ﺧﻂ ﺑﻴﻦ، ﻣﺘﻮﺟﻪ ﻣﻲ ﺷﻮﻳﺪ ﻛﻪ ﻣﺠﻤﻮﻉ ﺩﻭ ﺟﺮﻳﺎﻥ ﺗﺮﺍﻓﻴﻚ، ﺑﺎ ﺍﺟﺮﺍﻱ ﺍﻳﻦ ﺍﺳﻜﺮﻳﭙﺖ . ﻳﻚ ﻣﺤﺎﺳﺒﻪ ﺳﺎﺩﻩ ﺍﻳﻦ ﻣﻄﻠﺐ ﺭﺍ ﺗﺎﻳﻴﺪ ﻣﻲ ﻛﻨﺪ. ﺑﻮﺩﻩ ﻭ ﺳﺒﺐ ﺣﺬﻑ ﺷﺪﻥ ﺑﺮﺧﻲ ﺍﺯ ﺑﺴﺘﻪ ﻫﺎ ﻣﻲ ﺷﻮﺩn3
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١٨‐٢
ﺍﻧﺪﺍﺯﻩ ﻫﺮ ﺑﺴﺘﻪ ٥٠٠ﺑﺎﻳﺖ ﺑﻮﺩﻩ ﻭ ﺩﺭ ﻫﺮ ﺛﺎﻧﻴﻪ ٢٠٠ﺑﺴﺘﻪ ﺍﺭﺳﺎﻝ ﻣﻲ ﺷﻮﺩ .ﭘﺲ ﻫﺮ ﺟﺮﻳﺎﻥ ﺗﺮﺍﻓﻴﻚ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ٠/٨ﻣﮕﺎﺑﻴﺖ ﺩﺭ ﺛﺎﻧﻴﻪ ﻧﻴﺎﺯ ﺩﺍﺭﺩ .ﻭ ﺧﻂ ١ﻣﮕﺎﺑﻴﺖ ﺩﺭ ﺛﺎﻧﻴﻪ ﺑﻴﻦ n2ﻭ n3ﺟﻮﺍﺑﮕﻮﻱ ﺗﺮﺍﻓﻴﻚ ١/٦ﻣﮕﺎﺑﻴﺖ ﺩﺭ ﺛﺎﻧﻴﺔ ﺍﺭﺳﺎﻟﻲ ﺑﺮﺍﻱ ﺁﻥ ﻧﻴﺴﺖ. ﭘﺲ ﺑﺨﺸﻲ ﺍﺯ ﺑﺴﺘﻪﻫﺎ ﺣﺬﻑ ﻣﻲ ﺷﻮﻧﺪ .ﺍﻣﺎ ﻛﺪﺍﻡ ﺑﺴﺘﻪ ﻫﺎ ؟ ﭼﻮﻥ ﺭﻧﮓ ﺗﻤﺎﻡ ﺑﺴﺘﻪ ﻫﺎ ﻣﺸﻜﻲ ﺍﺳﺖ ﺗﻤﺎﻳﺰ ﺑﻴﻦ ﺁﻧﻬﺎ ﺍﻣﻜﺎﻥﭘﺬﻳﺮ ﻧﻤﻲﺑﺎﺷﺪ .ﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ ﺗﻤﺎﻳﺰ ﺑﻴﻦ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺩﺭ ، namﺍﺯ ﺩﺳﺘﻮﺭﺍﺕ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺧﺎﺻﻲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ .ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﺩﺭ ﺑﺨﺶ ﺑﻌﺪ ﺗﻮﺿﻴﺢ ﺩﺍﺩﻩ ﺷﺪﻩﺍﻧﺪ.
٦‐٤‐٢ﻣﺸﺨﺺ ﻛﺮﺩﻥ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺩﻭ ﺧﻂ ﺯﻳﺮ ﺭﺍ ﺑﻪ ﺍﺳﻜﺮﻳﭙﺖ ﺧﻮﺩ ﺍﺿﺎﻓﻪ ﻛﻨﻴﺪ : $udp0 set class_ 1 $udp1 set class_ 2
ﭘﺎﺭﺍﻣﺘﺮ ﺍﻧﺘﻬﺎﻳﻲ ﺷﻤﺎﺭﻩ ﻣﺸﺨﺼﻪ ﺟﺮﻳﺎﻥ ) (Flow IDﻣﻲ ﺑﺎﺷﺪ. ﺩﻭ ﺧﻂ ﺯﻳﺮ ﺭﺍ ﭘﺲ ﺍﺯ ﺩﺳﺘﻮﺭ ﺍﻳﺠﺎﺩ simulator objectﻗﺮﺍﺭ ﺩﻫﻴﺪ : $ns color 1 blue $ns color 2 red ﺍﮔﺮ ﺍﺳﻜﺮﻳﭙﺖ ﺭﺍ ﺩﻭﺑﺎﺭﻩ ﺍﺟﺮﺍ ﻛﻨﻴﺪ ،ﻣﺘﻮﺟﻪ ﻣﻲ ﺷﻮﻳﺪ ﻛﻪ ﺟﺮﻳﺎﻥ ﺗﺮﺍﻓﻴﻚ n0ﺁﺑﻲ ﺭﻧﮓ ﻭ ﺟﺮﻳﺎﻥ ﺗﺮﺍﻓﻴﻚ n1
ﻗﺮﻣﺰ ﺭﻧﮓ ﻣﻲ ﺑﺎﺷﺪ .ﺍﮔﺮ ﻟﻴﻨﻚ ﺑﻴﻦ ﮔﺮﻩ ﻫﺎﻱ n2ﻭ n3ﺭﺍ ﻣﺸﺎﻫﺪﻩ ﻛﻨﻴﺪ ﺧﻮﺍﻫﻴﺪ ﺩﻳﺪ ﻛﻪ ﺑﻌﺪ ﺍﺯ ﻣﺪﺗﻲ ﻧﺤﻮﺓ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﺯﻳﺎﺩ ﻋﺎﺩﻻﻧﻪ ﻧﻴﺴﺖ )ﺣﺪﺍﻗﻞ ﺭﻭﻱ ﺳﻴﺴﺘﻢ ﻣﺎ ﺍﻳﻨﮕﻮﻧﻪ ﺍﺳﺖ(.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١٩‐٢
٧‐٤‐٢ﻣﻮﻧﻴﺘﻮﺭ ﻛﺮﺩﻥ ﻳﻚ ﻟﻴﻨﻚ ﺑﺮﺍﻱ ﻣﻮﻧﻴﺘﻮﺭ ﻛﺮﺩﻥ ﺻﻒ ﻣﺮﺑﻮﻁ ﺑﻪ ﻟﻴﻨﻚ ﺑﻴﻦ n2ﻭ n3ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺭﺍ ﺑﻪ ﺍﺳﻜﺮﻳﭙﺖ ﺧﻮﺩ ﺑﻴﻔﺰﺍﻳﻴﺪ : $ns duplex-link-op $n2 $n3 queuePos 0.5
nsﺭﺍ ﺩﻭﺑﺎﺭﻩ ﺍﺟﺮﺍ ﻛﻨﻴﺪ .ﭘﺲ ﺍﺯ ﭼﻨﺪ ﻟﺤﻈﻪ ﺗﺼﻮﻳﺮﻱ ﻣﺸﺎﺑﻪ ﺗﺼﻮﻳﺮ ﺯﻳﺮ ﻣﺸﺎﻫﺪﻩ ﺧﻮﺍﻫﻴﺪ ﻛﺮﺩ :
ﺍﻛﻨﻮﻥ ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﻗﺮﺍﺭ ﮔﺮﻓﺘﻦ ﺑﺴﺘﻪ ﻫﺎ ﺭﺍ ﺩﺭ ﺻﻒ ﺑﺒﻴﻨﻴﺪ ﻭ ﺑﺴﺘﻪ ﻫﺎﻳﻲ ﻛﻪ ﺣﺬﻑ ﻣﻲ ﺷﻮﻧﺪ ﺭﺍ ﻣﺸﺎﻫﺪﻩ ﻛﻨﻴﺪ. ﻫﻤﺎﻧﮕﻮﻧﻪ ﻛﻪ ﻗﺒﻼ ﮔﻔﺘﻴﻢ ﻧﺤﻮﺓ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﻋﺎﺩﻻﻧﻪ ﻧﻴﺴﺖ. ﭼﻮﻥ ﺻﻒ ﺍﺯ ﻧﻮﻉ DropTailﺍﺳﺖ ﺑﻨﺎﺑﺮﺍﻳﻦ ﻧﻤﻲ ﺗﻮﺍﻥ ﺍﻧﺘﻈﺎﺭ ﺩﺍﺷﺖ ﻛﻪ ﻋﺪﺍﻟﺖ ﺭﺍ ﺩﺭ ﺣﺬﻑ ﺑﺴﺘﻪ ﻫﺎ ﺭﻋﺎﻳﺖ ﻛﻨﺪ .ﺑﺮﺍﻱ ﺍﻳﻨﻜﻪ ﺑﺎ ﻫﺮ ﺩﻭ ﻧﻮﻉ ﺑﺴﺘﻪ ﺑﻪ ﺻﻮﺭﺗﻲ ﻳﻜﺴﺎﻥ ﺑﺮﺧﻮﺭﺩ ﺷﻮﺩ ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺍﺯ ﺻﻒ SFQ
) (Stochastic Fair Queuingﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ. ﺑﻪ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺗﻌﺮﻳﻒ ﻟﻴﻨﻚ ﺑﻴﻦ n2ﻭ n3ﺭﺍ ﺑﻪ ﺍﻳﻦ ﺻﻮﺭﺕ ﺗﻐﻴﻴﺮ ﺩﻫﻴﺪ : $ns duplex-link $n3 $n2 1Mb 10ms SFQ
ﺻﻒ ﺑﻨﺪﻱ ﺑﺎﻳﺪ ﺍﻛﻨﻮﻥ ﻋﺎﺩﻻﻧﻪ ﺑﺎﺷﺪ .ﺑﺴﺘﻪ ﻫﺎﻱ ﺁﺑﻲ ﻭ ﻗﺮﻣﺰ ﺑﻪ ﻳﻚ ﻣﻴﺰﺍﻥ ﺣﺬﻑ ﻣﻲﺷﻮﻧﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٠‐٢
٨‐٤‐٢ﺍﻳﺠﺎﺩ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ﺗﻌﺪﺍﺩ ﮔﺮﻩ ﻫﺎﻱ ﺑﺎﻻ ﻭ ﻣﺪﻝ ﻛﺮﺩﻥ ﺧﺮﺍﺑﻲ ﻟﻴﻨﻚ ﻫﺎ ﺍﻳﺠﺎﺩ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ﺗﻌﺪﺍﺩ ﮔﺮﻩ ﻫﺎﻱ ﺯﻳﺎﺩ ﻣﻲﺗﻮﺍﻧﺪ ﻛﺎﺭﻱ ﺳﻨﮕﻴﻦ ﺑﺎﺷﺪ .ﺑﺮﺍﻱ ﺭﺍﺣﺖ ﻛﺮﺩﻥ ﺍﻳﻦ ﻛﺎﺭ ،ﺩﺭ ns
ﺍﺯ ﻣﻜﺎﻧﻴﺰﻣﻬﺎﻱ ﺧﺎﺻﻲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﺷﻮﺩ .ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺑﺎ ﺍﺭﺍﻳﻪ ﻳﻚ ﻣﺜﺎﻝ ،ﺍﻳﻦ ﻗﺎﺑﻠﻴﺖ ﺗﺸﺮﻳﺢ ﻣﻲ ﮔﺮﺩﺩ .ﺩﺭ ﺍﺩﺍﻣﻪ ﺑﻪ ﻣﺪﻝ ﻛﺮﺩﻥ ﺧﺮﺍﺑﻲ ﻟﻴﻨﻚ ﻫﺎ ﭘﺮﺩﺍﺧﺘﻪ ﻣﻲ ﺷﻮﺩ.
١‐٨‐٤‐٢
ﺍﻳﺠﺎﺩ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ﺗﻌﺪﺍﺩ ﮔﺮﻩ ﻫﺎﻱ ﺑﺎﻻ
ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﻣﻲ ﺧﻮﺍﻫﻴﻢ ﻳﻚ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺑﺎ ٧ﮔﺮﻩ ﺍﻳﺠﺎﺩ ﻛﻨﻴﻢ .ﺑﺮﺍﻱ ﭘﺮﻫﻴﺰ ﺍﺯ ﻧﻮﺷﺘﻦ ﻛﺪﻫﺎﻱ ﺷﺒﻴﻪ ﺑﻪ ﻫﻢ ،ﺍﺯ ﺣﻠﻘﺔ forﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﻛﻨﻴﻢ : { }for {set i 0} {$i < 7} {incr i ]set n($i) [$ns node }
ﺍﻳﻦ ﻛﺪ ٧ﮔﺮﻩ ﺍﻳﺠﺎﺩ ﻛﺮﺩﻩ ﻭ ﺩﺭ ﻳﻚ ﺁﺭﺍﻳﻪ ﺑﻪ ﻧﺎﻡ )( nﺫﺧﻴﺮﻩ ﻣﻲ ﻛﻨﺪ. ﺣﺎﻝ ﻣﻲ ﺧﻮﺍﻫﻴﻢ ﺍﻳﻦ ﮔﺮﻩ ﻫﺎ ﺭﺍ ﺑﺼﻮﺭﺕ ﺩﺍﻳﺮﻭﻱ ﺑﻪ ﻫﻢ ﻣﺘﺼﻞ ﻛﻨﻴﻢ .ﻛﺪ ﺯﻳﺮ ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ. { }for {set i 0} {$i < 7} {incr i $ns duplex-link $n($i) $n([expr ($i+1)%7]) 1Mb 10ms DropTail }
ﺍﻳﻦ ﻛﺪ ،ﻫﺮ ﮔﺮﻩ ﺭﺍ ﺑﻪ ﮔﺮﻩ ﺑﻌﺪﻱ ﻣﺘﺼﻞ ﻣﻲ ﻛﻨﺪ )ﺑﻪ ﺍﺳﺘﺜﻨﺎﺀ ﮔﺮﻩ ﺁﺧﺮ ﻛﻪ ﺑﻪ ﮔﺮﻩ ﺍﻭﻝ ﻣﺘﺼﻞ ﻣﻲ ﺷﻮﺩ(. ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺍﺯ ١%ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. ﺍﻛﻨﻮﻥ ﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺍﺳﻜﺮﻳﭙﺖ ﺭﺍ ﺍﺟﺮﺍ ﻛﻨﻴﺪ .ﺩﺭ namﻣﻤﻜﻦ ﺍﺳﺖ ﺷﻜﻞ ﺩﺍﺩﻩ ﺷﺪﻩ ﻋﺠﻴﺐ ﺑﺎﺷﺪ .ﺑﺎ ﺯﺩﻥ ﺩﻛﻤﻪ re-layoutﻣﻲ ﺗﻮﺍﻧﻴﺪ ﺷﻜﻞ ﺯﻳﺮ ﺭﺍ ﺑﺒﻴﻨﻴﺪ :
ﻋﻼﻣﺖ ﺑﺎﻗﻴﻤﺎﻧﺪﻩ
1
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٢١‐٢
ﻣﺪﻝ ﻛﺮﺩﻥ ﺧﺮﺍﺑﻲ ﻟﻴﻨﻚ ﻫﺎ٢‐٨‐٤‐٢ : ﺍﻳﺠﺎﺩ ﻣﻲ ﻛﻨﻴﻢn3 ﺑﻪ ﮔﺮﻩn0 ﻛﺪﻱ ﺑﺮﺍﻱ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﮔﺮﻩ،ﻗﺒﻞ ﺍﺯ ﻣﺪﻝ ﻛﺮﺩﻥ ﺧﺮﺍﺑﻲ #Create a UDP agent and attach it to node n(0) set udp0 [new Agent/UDP] $ns attach-agent $n(0) $udp0 # Create a CBR traffic source and attach it to udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetSize_ 500 $cbr0 set interval_ 0.005 $cbr0 attach-agent $udp0 set null0 [new Agent/Null] $ns attach-agent $n(3) $null0 $ns connect $udp0 $null0 $ns at 0.5 "$cbr0 start" $ns at 4.5 "$cbr0 stop"
ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺁﺭﺍﻳﻪ ﮔﺮﻩﻫﺎ، ﺗﻨﻬﺎ ﻣﻮﺭﺩ ﺟﺪﻳﺪﻱ ﻛﻪ ﺩﺭ ﺁﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ.ﺍﻳﻦ ﻛﺪ ﺑﺎﻳﺪ ﺑﺮﺍﻱ ﺷﻤﺎ ﻗﺎﺑﻞ ﻓﻬﻢ ﺑﺎﺷﺪ .ﻣﻲ ﺑﺎﺷﺪ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٢‐٢
ﺍﮔﺮ ﺍﻳﻦ ﺍﺳﻜﺮﻳﭙﺖ ﺭﺍ ﺍﺟﺮﺍ ﻛﻨﻴﺪ ،ﺧﻮﺍﻫﻴﺪ ﺩﻳﺪ ﻛﻪ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﻃﺮﻳﻖ ﮔﺮﻩﻫﺎﻱ ) n(1ﻭ ) n(2ﻣﻨﺘﻘﻞ ﺧﻮﺍﻫﺪ ﺷﺪ. ﺣﺎﻝ ﻣﻲ ﺧﻮﺍﻫﻴﻢ ﻟﻴﻨﻚ ﺑﻴﻦ ) n(1ﻭ ) n(2ﺑﺮﺍﻱ ﻣﺪﺕ ١ﺛﺎﻧﻴﻪ ﻗﻄﻊ ﺑﺸﻮﺩ .ﺑﺮﺍﻱ ﻣﺪﻝ ﻛﺮﺩﻥ ﺍﻳﻦ ﻣﺴﺎﻟﻪ ﺩﺳﺘﻮﺭﺍﺕ ﺯﻳﺮ ﺭﺍ ﺍﺿﺎﻓﻪ ﻣﻲ ﻛﻨﻴﻢ : )$ns rtmodel-at 1.0 down $n(1) $n(2 )$ns rtmodel-at 2.0 up $n(1) $n(2
ﻓﻬﻤﻴﺪﻥ ﺍﻳﻦ ﺩﻭ ﺧﻂ ﺧﻴﻠﻲ ﺳﺨﺖ ﻧﻴﺴﺖ .ﺍﻛﻨﻮﻥ ﻣﺠﺪﺩﺍ ﺍﺳﻜﺮﻳﭙﺖ ﺭﺍ ﺍﺟﺮﺍ ﻛﻨﻴﺪ .ﺧﻮﺍﻫﻴﺪ ﺩﻳﺪ ﻛﻪ ﺩﺭ ﺑﻴﻦ ﺛﺎﻧﻴﻪ ﻫﺎﻱ ١ﻭ ، ٢ﻟﻴﻨﻚ ﺑﻴﻦ ﮔﺮﻩ ) n(1ﻭ ) n(2ﻗﻄﻊ ﺷﺪﻩ ﻭ ﺍﺭﺗﺒﺎﻁ ﺩﻭ ﮔﺮﻩ ﻗﻄﻊ ﻣﻲ ﺷﻮﺩ .ﺑﺎ ﺍﻳﻦ ﺣﺎﻝ ﺍﻣﻜﺎﻥ ﺍﺭﺗﺒﺎﻁ ﺑﻴﻦ ﺁﻥ ﺩﻭ ﻫﻨﻮﺯ ﻭﺟﻮﺩ ﺩﺍﺭﺩ.
ﺑﺮﺍﻱ ﺣﻞ ﻣﺴﺎﻟﻪ ﺫﻛﺮ ﺷﺪﻩ ﺑﺎﻳﺪ ﺍﺯ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺩﻳﻨﺎﻣﻴﻚ ﺍﺳﺘﻔﺎﺩﻩ ﻛﺮﺩ .ﺑﺪﻳﻦ ﻣﻨﻈﻮﺭ ﺧﻂ ﺯﻳﺮ ﺭﺍ ﺑﻪ ﺍﺳﻜﺮﻳﭙﺖ ﺧﻮﺩ ،ﭘﺲ ﺍﺯ ﺍﻳﺠﺎﺩ ﺷﻲﺀ ﺷﺒﻴﻪ ﺳﺎﺯ ،ﺑﻴﻔﺰﺍﻳﻴﺪ : $ns rtproto DV
ﺑﺎ ﺍﺟﺮﺍﻱ ﺩﻭﺑﺎﺭﻩ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ،ﺩﺭ ﺍﻭﻝ ﻣﻲ ﺑﻴﻨﻴﺪ ﻛﻪ ﺗﻌﺪﺍﺩﻱ ﺑﺴﺘﻪ ﻛﻮﭼﻚ ﻣﻨﺘﻘﻞ ﻣﻲ ﺷﻮﻧﺪ .ﺍﻳﻦ ﺑﺴﺘﻪ ﻫﺎ ﺑﺮﺍﻱ ﺗﺒﺎﺩﻝ ﺍﻃﻼﻋﺎﺕ ﺩﺭ ﻣﻮﺭﺩ ﻭﺿﻌﻴﺖ ﻣﺴﻴﺮﻫﺎ ﺑﻴﻦ ﮔﺮﻩ ﻫﺎ ﻣﻨﺘﻘﻞ ﻣﻲ ﺷﻮﻧﺪ .ﻭﻗﺘﻲ ﺩﺭ ﺛﺎﻧﻴﻪ ١ﻟﻴﻨﻚ ﻣﻮﺭﺩ ﻧﻈﺮ ﺧﺮﺍﺏ ﻣﻲ ﺷﻮﺩ ،ﻣﺴﻴﺮ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﺗﻐﻴﻴﺮ ﻛﺮﺩﻩ ﻭ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﻃﺮﻳﻖ ﮔﺮﻩ ﻫﺎﻱ ) n(5) ، n(4ﻭ )n(6
ﺍﺭﺳﺎﻝ ﺧﻮﺍﻫﺪ ﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٣‐٢
٩‐٤‐٢ﺍﻳﺠﺎﺩ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ ﺑﺮﺍﻱ ﺑﺮﻧﺎﻣﺔ XGraph ﻳﻚ ﻗﺴﻤﺖ ﺍﺯ ﺑﺴﺘﺔ ﻧﺮﻡﺍﻓﺰﺍﺭﻱ ns-allinoneﺑﺮﻧﺎﻣﺔ Xgraphﻣﻲﺑﺎﺷﺪ ﻛﻪ ﻣﻲﺗﻮﺍﻧﺪ ﻧﻤﺎﻳﺶ ﮔﺮﺍﻓﻴﻜﻲ ﺍﺯ ﻧﺘﺎﻳﺞ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺭﺍ ﻧﺸﺎﻥ ﺑﺪﻫﺪ .ﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﻧﺸﺎﻥ ﻣﻲﺩﻫﻴﻢ ﻛﻪ ﭼﮕﻮﻧﻪ ﺩﺭﻭﻥ ﺍﺳﻜﺮﻳﭙﺖ tclﻳﻚ ﻓﺎﻳﻞ ﺗﻮﻟﻴﺪ ﻛﻨﻴﻢ ﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﻭﺭﻭﺩﻱ ﺑﺮﺍﻱ ﺑﺮﻧﺎﻣﺔ Xgraphﺑﻪ ﻛﺎﺭ ﺭﻭﺩ .ﻫﻤﭽﻨﻴﻦ ﻧﺸﺎﻥ ﺧﻮﺍﻫﻴﻢ ﺩﺍﺩ ﻛﻪ ﭼﮕﻮﻧﻪ ﺍﺯ ﺗﻮﻟﻴﺪ ﻛﻨﻨﺪﺓ ﺗﺮﺍﻓﻴﻚ) (Traffic Generatorﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﺪ.
١‐٩‐٤‐٢ﺗﻮﭘﻮﻟﻮﮊﻱ ﻭ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻚ ﺩﺭ ﻭﻫﻠﻪ ﺍﻭﻝ ﻗﺼﺪ ﺩﺍﺭﻳﻢ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺯﻳﺮ ﺭﺍ ﺍﻳﺠﺎﺩ ﻛﻨﻴﻢ.
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٢٤‐٢
.ﺍﺑﺘﺪﺍ ﮔﺮﻩﻫﺎ ﻭ ﻟﻴﻨﻚﻫﺎﻱ ﺑﻴﻦ ﺁﻧﻬﺎ ﺭﺍ ﺗﻌﺮﻳﻒ ﻣﻲ ﻛﻨﻴﻢ : ﺗﻌﺮﻳﻒ ﮔﺮﻩﻫﺎ set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node]
: ﺗﻌﺮﻳﻒ ﻟﻴﻨﻜﻬﺎ $ns duplex-link $n0 $n3 1Mb 100ms DropTail $ns duplex-link $n1 $n3 1Mb 100ms DropTail $ns duplex-link $n2 $n3 1Mb 100ms DropTail $ns duplex-link $n3 $n3 1Mb 100ms DropTail
ﻣﺎ ﻳﻚ ﺗﺎﺑﻊ ﺑﻪ ﻧﺎﻡ. ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﺗﺨﺼﻴﺺ ﺑﺪﻫﻴﻢn2 ﻭn1،n0 ﺣﺎﻝ ﻣﻲﺧﻮﺍﻫﻴﻢ ﺑﻪ ﮔﺮﻩﻫﺎﻱ . ﻣﻲ ﻧﻮﻳﺴﻴﻢ ﻛﻪ ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺳﺎﺩﻩ ﻣﻲ ﻛﻨﺪtraffic‐expoo‐attach proc attach-expoo-traffic { node sink size burst idle rate } { set ns [Simulator instance] set source [new Agent/UDP] $ns attach-agent $node $source set traffic [new Application/Traffic/Exponential] $traffic set packet-size $size $traffic set burst-time $burst $traffic set idle-time $idle $traffic set rate $rate
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٥‐٢ $traffic attach-agent $source $ns connect $source $sink return $traffic }
ﺍﻳﻦ ﺗﺎﺑﻊ ٦ﺁﺭﮔﻮﻣﺎﻥ ﻣﻲ ﮔﻴﺮﺩ .ﺁﺭﮔﻮﻣﺎﻥ ﺍﻭﻝ ﻳﻚ ﮔﺮﻩ ،ﺁﺭﮔﻮﻣﺎﻥ ﺩﻭﻡ ﻳﻚ ،sinkﺁﺭﮔﻮﻣﺎﻥ ﺳﻮﻡ ﺍﻧﺪﺍﺯﺓ ﺑﺴﺘﻪ ﺑﺮﺍﻱ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ،ﺁﺭﮔﻮﻣﺎﻥ ﭼﻬﺎﺭﻡ ﻣﺪﺕﺯﻣﺎﻥ ،brustﺁﺭﮔﻮﻣﺎﻥ ﭘﻨﺠﻢ ﻣﺪﺕﺯﻣﺎﻥ ﺑﻴﻜﺎﺭﻱ)ﺑﺮﺍﻱ ﺗﻮﺻﻴﻒ ﺗﻮﺯﻳﻊ ﻧﻤﺎﻳﻲ( ﻭ ﺑﺎﻻﺧﺮﻩ ﺁﺭﮔﻮﻣﺎﻥ ﺷﺸﻢ ﻧﺮﺥ ﺣﺪﺍﻛﺜﺮ) (peak rateﻣﻲﺑﺎﺷﺪ .ﺍﻳﻦ ﺗﺎﺑﻊ ﺩﺭ ﭘﺎﻳﺎﻥ ﻳﻚ handle
ﺑﺮﺍﻱ ﺷﻲ ﺗﺮﺍﻓﻴﻚ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ. ﺍﺑﺘﺪﺍ ﺭﻭﺍﻝ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ ﻭ ﺁﻧﺮﺍ ﺑﻪ ﮔﺮﻩ ﻧﺴﺒﺖ ﻣﻲ ﺩﻫﺪ .ﺳﭙﺲ ﻳﻚ ﺷﻲ ﺑﻪ ﻧﺎﻡ trafficﻣﻲﺳﺎﺯﺩ ،ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻥ ﺭﺍ ﺗﻨﻈﻴﻢ ﻣﻲﻛﻨﺪ ﻭ ﻗﺒﻞ ﺍﺯ ﺁﻧﻜﻪ sourceﻭ sinkﺑﻪ ﻫﻢ ﻣﺘﺼﻞ ﺷﻮﻧﺪ ﺁﻧﺮﺍ ﺑﻪ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﻧﺴﺒﺖ ﻣﻲ ﺩﻫﺪ .ﺍﻳﻦ ﺭﻭﺍﻝ ﻣﺜﺎﻝ ﺧﻮﺑﻲ ﺍﺳﺖ ﻛﻪ ﻧﺸﺎﻥ ﻣﻲ ﺩﻫﺪ ﻛﻪ ﭼﮕﻮﻧﻪ ﻛﺎﺭﻫﺎﻱ ﺗﻜﺮﺍﺭﻱ ﻣﺜﻞ ﻧﺴﺒﺖ ﺩﺍﺩﻥ ﻳﻚ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﺑﻪ ﭼﻨﺪﻳﻦ ﮔﺮﻩ ﺭﺍ ﻣﻲﺗﻮﺍﻥ ﺑﻪ ﺻﻮﺭﺕ ﺭﺍﺣﺘﺘﺮﻱ ﺍﻧﺠﺎﻡ ﺩﺍﺩ .ﺣﺎﻝ ﻣﺎ ﺍﺯ ﺍﻳﻦ ﺭﻭﺍﻝ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲ ﻛﻨﻴﻢ ﺗﺎ ﻣﻨﺎﺑﻊ ﺗﺮﺍﻓﻴﻜﻲ ﺑﺎ ﻧﺮﺥﻫﺎﻱ ﺣﺪﺍﻛﺜﺮ ﻣﺘﻔﺎﻭﺕ ﺭﺍ ﺑﻪ ﮔﺮﻫﻬﺎﻱ n1،n0ﻭ n2ﻧﺴﺒﺖ ﺩﻫﻴﻢ ﻭ ﺁﻧﻬﺎ ﺭﺍ ﺑﻪ ﮔﺮﻩ n4ﻣﺘﺼﻞ ﻛﻨﻴﻢ. ]set sink0 [new Agent/LossMonitor ]set sink1 [new Agent/LossMonitor ]set sink2 [new Agent/LossMonitor $ns attach-agent $n4 $sink0 $ns attach-agent $n4 $sink1 $ns attach-agent $n4 $sink2 ]set source0 [attach-expoo-traffic $n0 $sink0 200 2s 1s 100k ]set source1 [attach-expoo-traffic $n1 $sink1 200 2s 1s 200k ]set source2 [attach-expoo-traffic $n2 $sink2 200 2s 1s 300k
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٦‐٢
ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﻣﺎ ﺍﺯ ﺍﺷﻴﺎ Agent/LossMonitorﺑﻪ ﻋﻨﻮﺍﻥ Sinkﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺍﺳﺘﻔﺎﺩﻩ ﻛﺮﺩﻩﺍﻳﻢ .ﺍﻳﻦ ﺍﺷﻴﺎ ﺍﻳﻦ ﻗﺎﺑﻠﻴﺖ ﺭﺍ ﺩﺍﺭﻧﺪ ﻛﻪ ﺑﺘﻮﺍﻧﻨﺪ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ﺭﺍ ﻧﮕﻪﺩﺍﺭﻱ ﻛﻨﻨﺪ .ﺍﻳﻦ ﻛﻤﻴﺖ ﺩﺭ ﻣﺤﺎﺳﺒﺔ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ .ﺩﺭ ﻓﺼﻞ ﺑﻌﺪ ﺍﻳﻦ ﺷﺊ ﺑﻪ ﺗﻔﺼﻴﻞ ﺗﺸﺮﻳﺢ ﺧﻮﺍﻫﺪ ﺷﺪ.
٢‐٩‐٤‐٢
ﺛﺒﺖ ﺩﺍﺩﻩ ﻫﺎ ﺩﺭ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ
ﺣﺎﻝ ﺳﻪ ﻓﺎﻳﻞ ﺑﺎﺯ ﻣﻲ ﻛﻨﻴﻢ ﻛﻪ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺗﺒﻂ ﺑﻪ Sinkﻫﺎ ﺭﺍ ﺩﺭ ﺁﻥ ﺫﺧﻴﺮﻩ ﻛﻨﻴﻢ ﻭ ﺳﭙﺲ ﺍﺯ ﺍﻳﻦ ﻓﺎﻳﻠﻬﺎ ﺑﻪ ﻋﻨﻮﺍﻥ ﻭﺭﻭﺩﻱ ﺑﺮﺍﻱ ﺑﺮﻧﺎﻣﺔ Xgraphﺍﺳﺘﻔﺎﺩﻩ ﺧﻮﺍﻫﻴﻢ ﻛﺮﺩ .ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﺭﺍ ﺩﺭ ﺍﺑﺘﺪﺍﻱ ﺍﺳﻜﺮﻳﭙﺖ ﻗﺮﺍﺭ ﺩﻫﻴﺪ. ]set f0 [open out0.tr w ]set f1 [open out1.tr w ]set f2 [open out2.tr w
ﺍﻳﻦ ﻓﺎﻳﻠﻬﺎ ﺑﺎﻳﺪ ﺩﺭ ﻳﻚ ﻧﻘﻄﻪ ﺑﺴﺘﻪ ﺷﻮﻧﺪ .ﻣﺎ ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺩﺭ ﺭﻭﺍﻝ finishﺍ ﻧﺠﺎﻡ ﻣﻲﺩﻫﻴﻢ. { }{ proc finish global f0 f1 f2 #Close the output files close $f0 close $f1 close $f2 #Call xgraph to display the results & exec xgraph out0.tr out1.tr out2.tr -geometry 800x400 exit 0 }
ﺩﺭ ﺍﻳﻦ ﺗﺎﺑﻊ ﻧﻪ ﺗﻨﻬﺎ ﻓﺎﻳﻠﻬﺎﻱ f1،f0ﻭ f2ﺭﺍ ﻣﻲﺑﻨﺪﻳﻢ ﺑﻠﻜﻪ ﺑﺮﻧﺎﻣﺔ Xgraphﺭﺍ ﺑﺎ ﺳﻪ ﻓﺎﻳﻞ ﻭﺭﻭﺩﻱ ، out1.tr out2.trﻭ out3.trﻭ ﺑﺎ ﺩﻗﺖ ﻧﻤﺎﻳﺶ ٨٠٠*٤٠٠ﺍﺟﺮﺍ ﻣﻲﻛﻨﻴﻢ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٧‐٢
ﺩﺭ ﺍﻳﻨﺠﺎ ﻣﺎ ﺗﺎﺑﻌﻲ ﻣﻲ ﻧﻮﻳﺴﻴﻢ ﻛﻪ ﺑﻪ ﻃﻮﺭ ﻭﺍﻗﻌﻲ ﺩﺍﺩﻩ ﻫﺎ ﺭﺍ ﺑﺮﺭﻭﻱ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ ﺑﻨﻮﻳﺴﺪ. { }{ proc record global sink0 sink1 sink2 f0 f1 f2 ]set ns [Simulator instance set time 0.5 ]_set bw0 [$sink0 set bytes ]_set bw1 [$sink1 set bytes ]_set bw2 [$sink2 set bytes ]set now [$ns now "]puts $f0 "$now [expr $bw0/$time*8/1000000 "]puts $f1 "$now [expr $bw1/$time*8/1000000 "]puts $f2 "$now [expr $bw2/$time*8/1000000 $sink0 set bytes_ 0 $sink1 set bytes_ 0 $sink2 set bytes_ 0 "$ns at [expr $now+$time] "record }
ﺍﻳﻦ ﺭﻭﺍﻝ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺘﻲ ﺍﺯ Traffic Sinkﺭﺍ ﺩﺭﻳﺎﻓﺖ ﻣﻲﻛﻨﺪ .ﺳﭙﺲ ﭘﻬﻨﺎﻱﺑﺎﻧﺪ ﺭﺍ ﻣﺤﺎﺳﺒﻪ ﻣﻲﻛﻨﺪ ﻭ ﺁﻥ ﺭﺍ ﺑﺎ ﺯﻣﺎﻥ ﺍﻧﺘﻘﺎﻝ ﻗﺒﻞ ﺍﺯ ﺍﻳﻦ ﻛﻪ ﻣﻘﺪﺍﺭ _ byteﺭﺍ ﺑﻪ ﺻﻔﺮ ﻣﻘﺪﺍﺭﺩﻫﻲ ﻛﻨﺪ ﺩﺭ ﺳﻪ ﻓﺎﻳﻞ ﺧﺮﻭﺟﻲ ﻣﻲ ﻧﻮﻳﺴﺪ ﻭ ﺩﺭ ﺍﻧﺘﻬﺎ ﻫﻢ ﺧﻮﺩﺵ ﺭﺍ ﺩﻭﺑﺎﺭﻩ ﺯﻣﺎﻧﺒﻨﺪﻱ ﻣﻲ ﻧﻤﺎﻳﺪ.
٣‐٩‐٤‐٢ﺍﺟﺮﺍﻱ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺣﺎﻝ ﻣﻲﺗﻮﺍﻧﻴﻢ ﺭﻭﻳﺪﺍﺩﻫﺎﻱ ﻣﻮﺟﻮﺩ ﺩﺭ ﺑﺮﻧﺎﻣﻪ ﺭﺍ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﺯﻣﺎﻥ ﺑﻨﺪﻱ ﻛﻨﻴﻢ :
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٨‐٢ "$ns at 0.0 "record "$ns at 10.0 "$source0 start "$ns at 10.0 "$source1 start "$ns at 10.0 "$source2 start "$ns at 50.0 "$source0 stop "$ns at 50.0 "$source1 stop "$ns at 50.0 "$source2 stop "$ns at 60.0 "finish $ns run
ﻧﺨﺴﺖ ﺗﺎﺑﻊ recordﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲ ﺷﻮﺩ .ﺗﺎﺑﻊ recordﺧﻮﺩ ﺭﺍ ﻫﺮ ٠/٥ﺛﺎﻧﻴﻪ ﺑﻪ ﻃﻮﺭ ﻣﺘﻨﺎﻭﺏ ﺯﻣﺎﻧﺒﻨﺪﻱ ﻣﻲ ﻛﻨﺪ. ﺳﭙﺲ ﺳﻪ ﻣﻨﺒﻊ ﺗﺮﺍﻓﻴﻚ ﺩﺭ ﺛﺎﻧﻴﻪ ﺩﻫﻢ ﺷﺮﻭﻉ ﺑﻪ ﺍﺭﺳﺎﻝ ﺗﺮﺍﻓﻴﻚ ﻛﺮﺩﻩ ﻭ ﺩﺭ ﺛﺎﻧﻴﻪ ﭘﻨﺠﺎﻫﻢ ﺍﺭﺳﺎﻝ ﺭﺍ ﻣﺘﻮﻗﻒ ﻣﻲﻛﻨﻨﺪ .ﺩﺭ ﺛﺎﻧﻴﻪ ﺷﺼﺖ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺗﺎﺑﻊ finishﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ .ﺗﺎﺑﻊ finishﺗﻤﺎﻡ ﻓﺎﻳﻠﻬﺎ ﺭﺍ ﻣﻲﺑﻨﺪﺩ ﻭ ﺑﺮﻧﺎﻣﺔ Xgraphﺭﺍ ﺍﺟﺮﺍ ﻣﻲ ﻧﻤﺎﻳﺪ. ﻫﻨﮕﺎﻣﻲ ﻛﻪ ﺷﻤﺎ ﺑﺮﻧﺎﻣﻪ ﺭﺍ ﺍﺟﺮﺍ ﻣﻲ ﻛﻨﻴﺪ،ﭘﻨﺠﺮﻩ Xgraphﺭﺍ ﻣﺎﻧﻨﺪ ﺷﻜﻞ ﺯﻳﺮ ﻣﻲ ﺑﻴﻨﻴﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢٩‐٢
ﻫﻤﺎﻧﮕﻮﻧﻪ ﻛﻪ ﺩﺭ ﺷﻜﻞ ﻣﺸﺎﻫﺪﻩ ﻣﻲﺷﻮﺩ ﺣﺪﺍﻛﺜﺮ burstﻫﺎ ﺑﺮﺍﻱ ﺟﺮﻳﺎﻥ ﺍﻭﻝ ﺩﺭ ،٠/١ Mbit/sﺑﺮﺍﻱ ﺟﺮﻳﺎﻥ ﺩﻭﻡ ﺩﺭ ٠/٢ Mbit/sﻭ ﺑﺮﺍﻱ ﺟﺮﻳﺎﻥ ﺳﻮﻡ ﺩﺭ ٠/٣ Mbit/sﻗﺮﺍﺭ ﺩﺍﺭﻧﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
.٣
٣٠‐٣
Traceو Monitoringدر NS-2 ﺍﺯ ﻣﻬﻤﺘﺮﻳﻦ ﻗﺎﺑﻠﻴﺘﻬﺎﻳﻲ ﻛﻪ ﻳﻚ ﺷﺒﻴﻪﺳﺎﺯ ﺑﺎﻳﺪ ﺩﺍﺷﺘﻪ ﺑﺎﺷﺪ ﺟﻤﻊﺁﻭﺭﻱ ﺩﺍﺩﻩﻫﺎﻱ ﺧﺮﻭﺟﻲ ﺑﻪ ﻣﻨﻈﻮﺭ
ﭘﺮﺩﺍﺯﺵ ﺷﺒﻜﻪ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺷﺪﻩ ﻣﻲﺑﺎﺷﺪ.ﺭﻭﺷﻬﺎﻱ ﻣﺨﺘﻠﻔﻲ ﺑﺮﺍﻱ ﺟﻤﻊ ﺁﻭﺭﻱ ﺧﺮﻭﺟﻴﻬﺎ ﻳﺎ traceﻛﺮﺩﻥ ﺩﺭ ﺷﺒﻴﻪ ﺳﺎﺯ NS-2ﻣﻮﺟﻮﺩ ﻣﻲﺑﺎﺷﺪ .ﻣﻲﺗﻮﺍﻥ ﺩﺍﺩﻩﻫﺎﻱ traceﺭﺍ ﺩﺭ ﺣﻴﻦ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﻧﻤﺎﻳﺶ ﺩﺍﺩ .ﻭ ﻳﺎ ﺍﻳﻨﻜﻪ ﺩﺍﺩﻩﻫﺎ ﺭﺍ ﺩﺭ ﻓﺎﻳﻠﻲ ﺫﺧﻴﺮﻩ ﻧﻤﻮﺩ ﺗﺎ ﺑﻌﺪ ﺍﺯ ﭘﺎﻳﺎﻥ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﻣﻮﺭﺩ ﭘﺮﺩﺍﺯﺵ ﻗﺮﺍﺭ ﺑﮕﻴﺮﻧﺪ )ﺍﻳﻦ ﺭﻭﺵ ﺍﺳﺘﻔﺎﺩﻩ ﺑﻴﺸﺘﺮﻱ ﺩﺍﺭﺩ(. ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺑﻪ ﭼﮕﻮﻧﮕﻲ ﭘﺸﺘﻴﺒﺎﻧﻲ NS-2ﺍﺯ ﺍﻧﺠﺎﻡ ﺍﻋﻤﺎﻝ Traceﻣﻲﭘﺮﺩﺍﺯﻳﻢ.
١‐٣
ﺭﻭﺷﻬﺎﻱ ﺟﻤﻊﺁﻭﺭﻱ ﺩﺍﺩﻩ ﺩﺭ NS
Nsﺑﻪ ﺩﻭ ﺭﻭﺵ tracingﺭﺍ ﭘﺸﺘﻴﺒﺎﻥ ﻣﻲﻛﻨﺪ: – ١ﺑﻮﺳﻴﻠﻪ ﺍﺷﻴﺎﺀ :traceﺗﻮﺳﻂ ﺍﻳﻦ ﺍﺷﻴﺎﺀ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻫﺮ ﺑﺴﺘﻪ ﺑﻪ ﺻﻮﺭﺕ ﺍﻧﻔﺮﺍﺩﻱ )ﻭﺍﺭﺩ ﺷﺪﻥ ﺑﻪ ﺻﻒ ،ﺭﺳﻴﺪﻥ ﺑﺴﺘﻪ ﻫﺎ ،ﺧﺎﺭﺝ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ،ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﻟﻴﻨﻚ ﻳﺎ ﺻﻒ(ﺭﺍ ﻣﻲﺗﻮﺍﻥ ﺟﻤﻊﺁﻭﺭﻱ ﻧﻤﻮﺩ ..ﺍﺷﻴﺎﺀ traceﻣﺎﻧﻨﺪ ﮔﺮﻩﻫﺎ ﺩﺭ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﺷﻮﻧﺪ .ﺍﺷﻴﺎﺀ traceﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: :Trace/Hopﺍﻳﻦ ﺷﺊ Hopﻫﺎ ﺭﺍ traceﻣﻲﻛﻨﺪ. :Trace/Enqueﺍﻳﻦ ﺷﺊ ﻭﺭﻭﺩ ﺑﺴﺘﻪﻫﺎ )ﻣﻌﻤﻮﻻ ﺑﻪ ﺻﻒ( ﺭﺍ traceﻣﻲﻛﻨﺪ. :Trace/Dequeﺍﻳﻦ ﺷﺊ ﺧﺮﻭﺝ ﺑﺴﺘﻪﻫﺎ )ﻣﻌﻤﻮﻻ ﺍﺯ ﺻﻒ( ﺭﺍ traceﻣﻲﻛﻨﺪ. :Trace/Dropﺍﻳﻦ ﺷﺊ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﺭﺍ traceﻣﻲﻛﻨﺪ. :Trace/Recvﺍﻳﻦ ﺷﺊ ﺩﺭﻳﺎﻓﺖ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﮔﺮﻩ ﺑﻌﺪﻱ ﺭﺍ traceﻣﻲﻛﻨﺪ. :SnoopQueue/Inﺍﻳﻦ ﺷﺊ ﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪ ﻭ ﺯﻣﺎﻥ ﻭﺭﻭﺩ ﺭﺍ ﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ :SnoopQueue/Outﺍﻳﻦ ﺷﺊ ﺯﻣﺎﻥ ﺧﺮﻭﺝ ﺑﺴﺘﻪ ﻭ ﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪ ﺭﺍ ﻳﺎﺩﺩﺷﺖ ﻣﻲﻛﻨﺪ. :SnoopQueue/Dropﺍﻳﻦ ﺷﺊ ﺯﻣﺎﻥ ﺣﺬﻑ ﺑﺴﺘﻪ ﻭ ﺍﻧﺪﺍﺯﻩ ﺍﻥ ﺭﺍ ﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ. :SnoopQueue/EDropﺍﻳﻦ ﺷﺊ ﺩﺭ ﺯﻣﺎﻥ ﺣﺬﻑ ﺑﺴﺘﻪ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ REDﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪ ﺣﺬﻑ ﺷﺪﻩ ﻭ ﺯﻣﺎﻥ ﺣﺬﻑ ﺭﺍ ﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣١‐٣
– ٢ﺑﻮﺳﻴﻠﻪ ﺍﺷﻴﺎﺀ :Monitoringﺍﻳﻦ ﺍﺷﻴﺎﺀ ﻛﻤﻴﺘﻬﺎﻱ ﻣﺨﺘﻠﻔﻲ ﻣﺎﻧﻨﺪ ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎ ،ﺑﻴﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺘﻲ ﻳﺎ ﻓﺮﺳﺘﺎﺩﻩ ﺷﺪﻩ ﻭ ﻏﻴﺮﻩ ﺭﺍ ﻳﺎﺩﺩﺍﺷﺖ ﻣﻲﻛﻨﻨﺪ .ﻣﺎﻧﺘﻴﻮﺭﻫﺎ ﻣﻲﺗﻮﺍﻧﻨﺪ ﻫﻢ ﺭﻭﻱ ﺑﺴﺘﻪﻫﺎ ﻭ ﻫﻢ ﺭﻭﻱ ﻓﻠﻮﻫﺎ ﻋﻤﻞ ﺷﻤﺎﺭﺵ ﺭﺍ ﺍﻧﺠﺎﻡ ﺩﻫﻨﺪ .ﺍﺷﻴﺎﺀ Monitoringﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: :QueueMonitorﺍﻳﻦ ﺷﺊ ﻧﻤﻮﻧﻪﻫﺎﻱ ﺑﺪﺳﺖﺁﻣﺪﻩ ﺗﻮﺳﻂ Snooperﻫﺎ) ﻛﻪ ﺩﺭ ﻗﺴﻤﺖ ﺍﺷﻴﺎﺀ traceﺑﻪ ﺁﻧﻬﺎ ﺍﺷﺎﺭﻩ ﺷﺪ( ﺭﺍ ﺩﺭﻳﺎﻓﺖ ﻭ ﮔﺮﻭﻩﺑﻨﺪﻱ ﻣﻲﻛﻨﻨﺪ. :QueueMonitor/EDﺍﻳﻦ ﺷﺊ ﻋﻼﻭﻩ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ ﺷﺊ QueueMonitorﻗﺎﺑﻠﻴﺖ ﺗﺸﺨﻴﺺ ﺣﺬﻑ ﺑﺴﺘﻪ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ Redﺭﺍ ﻧﻴﺰ ﺩﺍﺭﺩ. :QueueMonitor/ED/Flowmonﺍﻳﻦ ﺷﺊ ﻋﻼﻭﻩ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ ﺷﺊ QueueMonitor/EDﻣﻲﺗﻮﺍﻧﺪ ﺍﻃﻼﻋﺎﺕ ﺭﺍ ﺑﺮ ﺍﺳﺎﺱ ﻫﺮ ﺟﺮﻳﺎﻥ ،ﺑﻪ ﻃﻮﺭ ﺟﺪﺍﮔﺎﻧﻪ ﮔﺮﻭﻩﺑﻨﺪﻱ ﻛﻨﺪ. :QueueMonitor/ED/Flowﺍﻳﻦ ﺷﺊ ﻣﺤﺘﻮﻱ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺟﺮﻳﺎﻥﻫﺎ ﺍﺳﺖ ﻭ ﺗﻮﺳﻂ ﺷﺊ QueueMonitor/ED/Flowmonﻣﺪﻳﺮﻳﺖ ﻣﻲﺷﻮﺩ.
٢‐٣
ﺍﺷﻴﺎﺀ Trace
١‐٢‐٣ﻣﻌﻤﺎﺭﻱ ﺳﺮﺁﻳﻨﺪ ﺑﺴﺘﻪﻫﺎ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ trace ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ traceﻳﻚ ﺳﺮﺁﻳﻨﺪ ﻣﺸﺘﺮﻙ ﺩﺭ ﻫﺮ ﺑﺴﺘﻪ ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﻛﻪ ﺧﺼﻮﺻﻴﺎﺕ ﺯﻳﺮ ﺭﺍ ﺩﺍﺭﺍﺳﺖ . – ١ﻳﻚ ﻣﺸﺨﺼﻪ ﻳﻜﺘﺎ ﺑﻪ ﺑﺴﺘﻪ ﻣﻲﺩﻫﺪ. – ٢ﻧﻮﻉ ﺑﺴﺘﻪ ﺭﺍ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ؛ ﺍﻳﻦ ﺧﺼﻮﺻﻴﺖ ﺗﻮﺳﻂ ﻋﺎﻣﻞﻫﺎﻳﻲ ١ﻛﻪ ﺑﺴﺘﻪ ﺭﺍ ﺗﻮﻟﻴﺪ ﻣﻲﻛﻨﻨﺪ ﺗﻌﻴﻴﻦ ﻣﻲﺷﻮﺩ. – ٣ﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪ ﺭﺍ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ .ﺍﻳﻦ ﻛﻤﻴﺖ ﺑﺮﺍﻱ ﺗﻌﻴﻴﻦ ﺯﻣﺎﻥ ﺍﻧﺘﻘﺎﻝ ﺑﺴﺘﻪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺍﺳﺖ. – ٤ﺑﺮﭼﺴﺐ ﻭﺍﺳﻂ :ﺑﺮﺍﻱ ﻣﺤﺎﺳﺒﻪ ﺗﻮﺯﻳﻊ ﺩﺭﺧﺘﻲ Multicastﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ.
٢‐٢‐٣ﻣﻌﻤﺎﺭﻱ ﻟﻴﻨﻜﻬﺎ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ Trace ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﻧﺠﺎﻡ Traceﺍﺷﺎﺭﻩﮔﺮﻫﺎﻳﻲ ﺩﺭ ﻟﻴﻨﻜﻬﺎ ﺗﻌﺮﻳﻒ ﺷﺪﻩﺍﻧﺪ .ﻟﻴﻨﻚ ﺍﺯ ﺗﻌﺪﺍﺩﻱ Connetorﺗﺸﻜﻴﻞ ﺷـﺪﻩ ﺍﺳﺖ .ﭘﻨﺞ ﻣﺘﻐﻴﺮ ﺭﻭﺑﺮﻭ ﻟﻴﻨﻚ ﺭﺍ ﺗﻌﺮﻳﻒ ﻣﻲﻛﻨﻨﺪ Ttl ،Link ،Queue ،Head :ﻭ .DropHead
Agents
1
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٢‐٣
ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﻧﺠﺎﻡ traceﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ traceﺭﻭﻱ ﻟﻴﻨﻜﻬﺎ ﻓﻌﺎﻝ ﺷﻮﺩ .ﻛﻼﺱ ﺍﺻﻠﻲ ﻟﻴﻨـﻚ Simple-Link
ﻣــﻲﺑﺎﺷــﺪ .ﺍﻳــﻦ ﻛــﻼﺱ ﺩﺍﺭﺍﻱ ﺩﻭ ﺭﻭﺍﻝ traceﻭ init-monitorﺍﺳــﺖ ﻛــﻪ ﺩﺭ ﺯﻣــﺎﻥ ﻓﻌــﺎﻝ ﺷــﺪﻥ Traceﻭ Monitoringﺍﺯ ﺁﻧﻬﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ. ﺭﻭﺍﻝ traceﺍﺷﻴﺎﺀ traceﺍﺯ ﻧﻮﻉ Dequeue ، Enqueue ،Dropﻭ Recieveﻣﻲﺳﺎﺯﺩ ﻭ ﺧﺮﻭﺟﻲ ﺁﻧﻬﺎ ﺭﺍ ﺑﻪ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻣﻲﻓﺮﺳﺘﺪ .ﻧﻮﻉ Enqueueﺗﻨﻬﺎ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻭﺍﺭﺩ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺫﺧﻴﺮ ﻣﻲﻛﻨﺪ Dequeue ،ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺧﺎﺭﺝ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﻧﮕﻬﺪﺍﺭﻱ ﻣﻲﻛﻨﺪ Drop ،ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ .ﻭ Recieveﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﺭﻳﺎﻓﺖ ﺑﺴﺘﻪﻫﺎ ﺗﻮﺳﻂ ﮔﺮﻩ ﺑﻌﺪﻱ ﺭﺍ ﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ. ﻫﻤﭽﻨﻴﻦ ﺭﻭﺍﻝ Traceﻓﺮﺽ ﻣﻲﻛﻨﺪ ﻳﻚ ﺻﻒ ﺑﻪ ﺍﻳﻦ ﻟﻴﻨﻚ ﻣﺮﺑﻮﻁ ﺷﺪﻩ ﺍﺳﺖ ﺑﻌﺪ ﺍﺯ ﺍﻳﺠﺎﺩ ﺍﺷﻴﺎﺀ traceﮔﻔﺘﻪ ﺷﺪﻩ ،ﺷﻲ Enqueueﺭﺍ ﻗﺒﻞ ﺍﺯ ﺷﻲ queueﺩﺭ ﻟﻴﻨﻚ ﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ ﻭ ﺷﻲ Dequeueﺭﺍ ﭘﺲ ﺍﺯ queueﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ ﻭ ﺷﻲ Dropﺭﺍ ﺑﻴﻦ ﺻﻒ ﻭ drop targetﻣﺮﺑﻮﻁ ﺑﻪ ﻟﻴﻨﻚ ﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ.ﺷﻜﻞ ١‐١ ﺍﻳﻦ ﻣﺴﺌﻠﻪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ.
ﺷﻜﻞ ١‐١
ﻣﻌﻤﺎﺭﻱ ﻟﻴﻨﻚ
ﻋﻨﺎﺻﺮ ﺯﻳﺮ ﺩﺭ ﻟﻴﻨﻚ ﺑﺮﺍﻱ ﺍﻋﻤﺎﻝ traceﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ: _ Enqtﺑﻪ ﻋﻨﺼﺮﻱ ﻛﻪ ﺑﺴﺘﻪﻫﺎﻱ ﻭﺭﻭﺩﻱ ﺑﻪ ﺻﻒ ﺭﺍ traceﻣﻲﻛﻨﺪ ،ﺍﺷﺎﺭﻩ ﻣﻲﻛﻨﺪ. _ :Deptﺑﻪ ﻋﻨﺼﺮﻱ ﻛﻪ ﺑﺴﺘﻪﻫﺎﻱ ﺧﺮﻭﺟﻲ ﺍﺯ ﺻﻒ ﺭﺍ traceﻣﻲﻛﻨﺪ ،ﺍﺷﺎﺭﻩ ﻣﻲﻛﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٣‐٣
_ :Drptﺍﺷﺎﺭﻩ ﻣﻲﻛﻨﺪ ﺑﻪ ﻋﻨﺼﺮﻱ ﻛﻪ ﺑﺴﺘﻪﻫﺎﻱ ﮔﻢ ﺷﺪﻩ ﺭﺍ traceﻣﻲﻛﻨﺪ. _Rcvtﺍﺷﺎﺭﻩ ﻣﻲﻛﻨﺪ ﺑﻪ ﻋﻨﺼﺮﻱ ﻛﻪ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ﺗﻮﺳﻂ ﮔﺮﺓ ﺑﻌﺪﻱ ﺭﺍ traceﻣﻲﻛﻨﺪ. ﺍﮔﺮ ﻛﺎﺭﺑﺮ tracingﺭﺍ ﭼﻨﺪ ﺑﺎﺭ ﺭﻭﻱ ﻟﻴﻨﻚ ﻓﻌﺎﻝ ﻛﻨﺪ .ﺍﻳﻦ ﻣﺘﻐﻴﺮﻫﺎ ﺑﻪ ﺁﺧﺮﻳﻦ ﻋﻨﺼﺮ ﺍﺷﺎﺭﻩ ﻣﻲﻛﻨﻨﺪ.
٣‐٢‐٣ﻓﺮﻣﺖ ﻓﺎﻳﻞ trace ﺩﻭ ﺟﺪﻭﻝ ﺯﻳﺮ ﻓﺮﻣﺖ ﻓﺎﻳﻞ traceﻛﻪ ﺑﻮﺳﻴﻠﻪ ﺩﺳﺘﻮﺭ trace-allﺍﻳﺠﺎﺩ ﻣﻲﺷﻮﺩ ،ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﻨﺪ. 7) Pkt-Size
5) Pkt-Type
6) flag
ﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪ ﺭﺍ ﺷﺎﻣﻞ ٤ﻓﻴﻠﺪ ﻧﻮﻉ ﺑﺴﺘﻪ ﺭﺍ ﻧﺸﺎﻥ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ
ﺍﺳﺖ.
ﻣﻲﺩﻫﺪ
ECN :E
4) Node2
3) Node1
1) Type
2) time
ﺍﻳﻦ ﺩﻭ ﻓﻴﻠﺪ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﻨﺪ ﺯﻣﺎﻥ ﻭﻗﻮﻉ ﺍﻳﻦ ﻓﻴﻠﺪ ﻧﻮﻉ ﺍﺗﻔﺎﻕ ﺭﺍ ﻧﺸﺎﻥ ﺑﻴﻦ ﭼﻪ ﮔﺮﻩﻫﺎﻳﻲ ﺍﻳﻦ ﺍﺗﻔﺎﻕ
ﺍﺗﻔﺎﻕ
ﺍﻓﺘﺎﺩﻩ ﺍﺳﺖ.
ﺛﺎﻧﻴﻪ(
)ﺑﻪ ﻣﻲﺩﻫﺪ. -: Dequeue +: Enqueue
:CE
d: Drop
12) Uniqe-id
ﻣﺸﺨﺼﻪ ﻳﻜﺘﺎﻱ ﺑﺴﺘﻪ
11) SeqNO
10) Dst
ﺷﻤﺎﺭﻩ ﺗﺮﺗﻴﺐ ﻣﺮﺑﻮﻁ ﺑﻪ ﺑﺴﺘﻪ
ﻣﻘﺼﺪ ﺑﺴﺘﻪ
r: recieve
9) Src
8)Flow-Id
ﻣﺒﺪﺍ ﺑﺴﺘﻪ
ﻣﺸﺨﺼﻪ ﻓﻠﻮ) .ﺩﺭ (IPV6
٤‐٢‐٣ﺗﻮﺍﺑﻊ ﻛﻤﻜﻲ ﺑﺮﺍﻱ ﺩﺳﺘﺮﺳﻲ ﺑﻪ ﺍﺷﻴﺎﺀ tracing ﺍﺷﻴﺎﺀ traceﻛﻪ ﺩﺭ ﺑﺎﻻ ﺑﻪ ﺁﻧﻬﺎ ﺍﺷﺎﺭﻩ ﺷﺪ ﺭﺍ ﻣﻲﺗﻮﺍﻥ ﺑﺪﻭﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺩﺳﺘﻮﺭﻫﺎﻱ ﻭﺍﺳﻂ ﻭ ﺑﺎ ﺑﻜﺎﺭﺑﺮﺩﻥ ﺗﻮﺍﺑﻊ ﻛﻤﻜﻲ ﺯﻳﺮ ﺑﻜﺎﺭ ﺑﺮﺩ.
١
}{ flush – trace
ﺍﻳﻦ ﺗﺎﺑﻊ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻫﻤﻪ ﺍﺷﻴﺎﺀ traceﺭﺍ ﺍﺯ ﺑﺎﻓﺮ ﻭﺍﺭﺩ ﻓﺎﻳﻞ ﻣﻲﻛﻨﺪ. } Create – trace {type file src dst
ﻳﻚ ﺷﻲ traceﺍﺯ ﻧﻮﻉ ) (typeﺑﻴﻦ srcﻭ dstﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ ﻭ ﻳﻚ ﺩﺳﺘﮕﻴﺮﻩ ﺑﻪ ﺍﻳﻦ ﺷﻲ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪtype .
ﻣﻲﺗﻮﺍﻧﺪ ﻣﻘﺎﺩﻳﺮ Drop ،Dequeue ،Enqueueﻭ Recvﺭﺍ ﺩﺍﺭﺍ ﺑﺎﺷﺪ ﻛﻪ ﺗﻮﺳﻂ ﺭﻭﺍﻝ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٤‐٣
}trace – callback {ns command
ﺯﻣﺎﻧﻴﻜﻪ ﻟﻴﻨﻜﻲ ﻗﺮﺍﺭ ﺍﺳﺖ traceﺷﻮﺩ ﺩﺳﺘﻮﺭ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺍﺭﺯﻳﺎﺑﻲ
ﻣﻲﺷﻮﺩ. } Drop-trace {n1 n2 traceobject
ﺷﻲ traceﻛﻪ ﻗﺒﻼ ﺗﻮﺳﻂ ﺗﺎﺑﻊ create-traceﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺍﺳﺖ ﻣﻘﺼﺪ ﺑﺴﺘﻪﻫﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺑﻴﻦ ﮔﺮﻩ n1ﻭ n2ﻣﻲﺷﻮﺩ.
٥‐٢‐٣ﻭﺍﺳﻄﻬﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﺷﻴﺎﺀ trace ﺍﻳﻦ ﺩﺳﺘﻮﺭﻫﺎ ﺭﺍ ﻣﻲﺗﻮﺍﻥ ﺩﺭ ﺍﺳﻜﺮﻳﭙﺖﻫﺎﻱ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﻜﺎﺭ ﺑﺮﺩ.
١‐٥‐٢‐٣
ﻭﺍﺳﻄﻬﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﻓﻌﺎﻝ ﻧﻤﻮﺩﻥ traceﺩﺭ ﻟﻴﻨﻜﻬﺎ > $Simple-link trace <ns>
ﺍﻳﻦ ﺩﺳﺘﻮﺭﺷﻲ traceﺭﺍ ﺑﺮﺍﻱ ﺍﻳﻦ ﻟﻴﻨﻚ ﻣﻲﺳﺎﺯﺩ )ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ( ﻭ ﺍﺗـﺼﺎﻝ ﺭﺍ ﺑـﻪ ﺭﻭﺯ ﺩﺭ ﻣـﻲﺁﻭﺭﺩ .ﺧﺮﻭﺟـﻲ traceﻣﺮﺑﻮﻁ ﺑﻪ ﺍﻳﻦ ﻟﻴﻨﻚ ﺩﺭ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ .ﺍﮔـﺮ opﻣﻘـﺪﺍﺭ namﺭﺍ ﺑﮕﻴـﺮﺩ ﻳـﻚ ﻓﺎﻳـﻞ traceﺍﺯ ﻧﻮﻉ namﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯﻓﺎﻳﻞ namﻣﻲﺗﻮﺍﻥ ﺍﺗﻔﺎﻗﺎﺕ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺷﺪﻩ ﺩﺭ ﻟﻴﻨﻚ ﺭﺍ ﺑﻪ ﺻﻮﺭﺕ ﮔﺮﺍﻓﻴﻜﻲ ﺩﺭ nam animatorﻧﺸﺎﻥ ﺩﺍﺩ. > $simple-link nam – trace <ns>
ﺍﻳﻦ ﺩﺳﺘﻮﺭ nam tracingﺭﺍ ﺩﺭ ﻟﻴﻨﻚ ﺭﺍﻩ ﺍﻧﺪﺍﺯﻱ ﻣﻲﻛﻨﺪ .ﻭ ﺧﺮﻭﺟﻲ ﺁﻥ ﺩﺭ ﻓﺎﻳﻞ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ. > $simple-link trace – dyndmic <ns>
tracingﺭﺍ ﻣﺨﺼﻮﺹ ﺍﺗﻔﺎﻗﺎﺕ ﺩﻳﻨﺎﻣﻴﻜﻲ ﻟﻴﻨﻚ )ﺧﺮﺍﺏ ﺷﺪﻥ ﻟﻴﻨﻚ( ﺭﺍﻩ ﺍﻧﺪﺍﺯﻱ ﻣﻲﻛﻨﺪ ﻭ ﻧﻴﺰ ﺑﺎ ﺗﻌﻴﻴﻦ ﻣﻘﺪﺍﺭ namﺑﺮﺍﻱ“ ”opﺍﻳﻦ ﻧﻮﻉ traceﺭﺍ ﺭﺍﻩ ﺍﻧﺪﺍﺯﻱ ﻣﻲﻛﻨﺪ .ﻓﺮﻣﺖ traceﻣﺮﺑﻮﻁ ﺑﻪ ﺍﺗﻔﺎﻗﺎﺕ ﺩﻳﻨﺎﻣﻜﻲ ﺑﻪ ﺷﺮﺡ ﺯﻳـﺮ ﺍﺳﺖ: >
><src
><state
>
ﻣﻘﺼﺪ
ﻣﺒﺪﺍ
ﻭﺿﻌﻴﺖ ﻟﻴﻨﻚ:
ﺯﻣﺎﻥ ﺍﺗﻔﺎﻕ
:Upﺳﺎﻟﻢ
1ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﻳﻦ ﺗﻮﺍﺑﻊ ﺑﺮﺍﻱ ﺍﻓﺮﺍﺩ ﻣﺒﺘﺪﻱ ﺗﻮﺻﻴﻪ ﻧﻤﻲﺷﻮﺩ.
>
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٥‐٣ :Downﺧﺮﺍﺏ
٢‐٥‐٢‐٣ﻓﺮﻣﺎﻧﻬﺎﻱ traceﻣﺮﺑﻮﻁ ﺑﻪ ﺻﻔﻬﺎ > $ns trace-all
ﺍﻳﻦ ﺩﺳﺘﻮﺭ traceﺭﺍ ﺭﻭﻱ ﻫﻤﻪ ﻟﻴﻨﻜﻬﺎ ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ ﻭ ﺧﺮﻭﺟﻲ ﺁﻥ ﺩﺭ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ. > $ns namtrace-all
traceﺍﺯ ﻧﻮﻉ namﺭﺍ ﺭﻭﻱ ﻫﻤﻪ ﻟﻴﻨﻜﻬﺎ ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ ﻭ ﺧﺮﻭﺟﻲ ﺁﻥ ﺩﺭ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻧﻮﺳﺘﻪ ﻣﻲﺷﻮﺩ. > $ ns trace – queue
ﺍﻳﻦ ﻓﺮﻣﺎﻥ ﻳﻚ ﺷﺊ traceﺑﻪ ﻣﻨﻈﻮﺭ logﮔﺮﻓﺘﻦ ﺍﺯ ﺍﺗﻔﺎﻗﺎﺕ ﺻﻒ ﺑﻴﻦ n1ﻭ n2ﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ > $ns namtrace – queue
ﺍﻳﻦ ﻓﺮﻣﺎﻥ ﻣﺎﻧﻨﺪ ﻓﺮﻣﺎﻥ ﻗﺒﻞ ﺍﺳﺖ ﺑﻪ ﺟﺰ ﺍﻳﻨﻜﻪ nam tracingﺭﺍ ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ.
٣-٣
اﺷﻴﺎء Monitoring
ﻣﺎﻧﺘﻴﻮﺭﻫﺎ ﻣﺠﻤﻮﻋﻪ ﺩﻳﮕﺮﻱ ﺍﺯ ﺍﺷﻴﺎﺀ ﻫﺴﺘﻨﺪ ﻛﻪ ﺑﻪ ﻣﻨﻈﻮﺭ ﺟﻤﻊﺁﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﺍﺯ ﺧﺮﻭﺟﻲ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ ﺍﻳﻦ ﺍﺷﻴﺎﺀ ﻧﻴﺰ ﺑﻌﺪ ﺍﺯ ﺍﻳﺠﺎﺩ ﺑﻪ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺷﺒﻜﻪ ﺍﺿﺎﻓﻪ ﻣﻲﺷﻮﻧﺪ .ﺍﻳﻦ ﺍﺷﻴﺎﺀ ﻗﺎﺑﻠﻴﺖ ﺭﺩﮔﻴﺮﻱ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ،ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ،ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﻓﺮﺳﺘﺎﺩﻩ ﺷﺪﻩ ﻭ ﺑﺮﺣﺴﺐ ﻧﻴﺎﺯ ﻣﻴﺎﻧﮕﻴﻦ ﺍﻳﻦ ﭘﺎﺭﺍﻣﺘﺮﻫﺎ ﺭﺍ ﺩﺍﺭﻧﺪ .ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﮔﻔﺘﻪ ﺷﺪ Monitorig،ﻣﻤﻜﻦ ﺍﺳﺖ ﺭﻭﻱ ﺗﻤﺎﻡ ﺑﺴﺘﻪﻫﺎ ﺍﻋﻤﺎﻝ ﺷﻮﺩ ﻳﺎ ﺭﻭﻱ ﻓﻠﻮﻫﺎﻱ ﺧﺎﺹ. ﻋﻼﻭﻩ ﺑﺮ ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎ ﻭ ﻳﺎ ﺑﺎﻳﺘﻬﺎ ﻳﻚ ﻣﺎﻧﻴﺘﻮﺭ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺷﻲ Integratorﻣﻲﺗﻮﺍﻧﺪ ﺩﺭ ﻳﻚ ﻓﺎﺻـﻠﻪ ﺯﻣـﺎﻧﻲ ] [t0,t1ﺍﻃﻼﻋﺎﺕ ﻭ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺭﺍ ﻣﺤﺎﺳﺒﻪ ﻛﻨﺪ.
Queue Monitoring ١‐٣‐٣ ﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻋﻤﺎﻝ Monitoringﻛﻼﺱ ) Simple-Linkﻛﻼﺱ ﺍﺻﻠﻲ ﻟﻴﻨﻚ( ﺭﻭﺍﻟﻲ ﺑﻪ ﻧﺎﻡ Init-
monitorﺩﺍﺭﺩ .ﺍﻳﻦ ﺭﻭﺍﻝ ﻣﺎﻧﻴﺘﻮﺭﻳﻨﮓ ﺻﻒ ﺭﺍ ﺭﻭﻱ ﻟﻴﻨﻚ ﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٦‐٣
Queue Monitoringﺍﺯ ﺍﺷﻴﺎﺀ Snoopﻭ monitorﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ snoop queue .ﻣﺎﻧﻨﺪ ﺍﺷﻴﺎﺀ trace
ﺑﻪ ﻳﻚ ﺻﻒ ﻣﺘﺼﻞ ﻣﻲﺷﻮﺩ ﻭ ﻭﺭﻭﺩ ﻭ ﺧﺮﻭﺝ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﻣﺎﻧﺘﻴﻮﺭ ﻣﻲ ﻛﻨﺪ ﻭ ﺑﻪ Queue Monitorﮔﺰﺍﺭﺵ ﻣﻲﺩﻫﺪ Queue Monitor .ﺍﻃﻼﻋﺎﺕ ﺭﺍ ﺩﺭ ﻣﺘﻐﻴﺮﻫﺎﻳﻲ ﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ .ﺍﻳﻦ ﺍﻃﻼﻋﺎﺕ ﺩﺭ ﻫﺮ ﺯﻣﺎﻥ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻗﺎﺑﻞ ﺩﺳﺘﺮﺳﻲ ﻫﺴﺘﻨﺪ ﻭ ﺍﺯ ﺁﻧﻬﺎ ﻣﻲﺗﻮﺍﻥ ﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺧﺮﻭﺟﻲ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ. ﻣﺘﻐﻴﺮﻫﺎﻳﻲ ﻛﻪ Queue Momitorﺁﻧﻬﺎ ﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﺍﮔﺮ ﺑﺎ Pﺷﺮﻭﻉ ﺷﻮﻧﺪ ﻣﺮﺑﻮﻁ ﻫﺴﺘﻨﺪ ﺑﻪ ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎ ﻭ ﺍﮔﺮ ﺑﺎ bﺷﺮﻭﻉ ﺷﻮﻧﺪ ﻣﺮﺑﻮﻁ ﺑﻪ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎ ﻫﺴﺘﻨﺪ. ﻣﻤﻜﻦ ﺍﺳﺖ ﭼﻨﺪ snoop Queueﺑﻪ ﻳﻚ Queue monitorﺍﺷﺎﺭﻩ ﺩﺍﺷﺘﻪ ﺑﺎﺷﻨﺪ.ﻣﺘﻐﻴﺮﻫﺎﻳﻲ ﻛﻪ ﺗﻮﺳﻂ ﺷﺊ queue Monitorﻣﻘﺪﺍﺭ ﺩﻫﻲ ﻭ ﺑﺮﮔﺮﺩﺍﻧﺪﻩ ﻣﻲﺷﻮﻧﺪ ﺑﻪ ﺷﺮﺡ ﺯﻳﺮ ﻫﺴﺘﻨﺪ: :Sizeﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻪ ﺑﺎﻳﺖ _ :Pktsﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻪ ﺑﺴﺘﻪ _ :parrivalﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺘﻲ ﺻﻒ _ :barrivalﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺘﻲ ﺻﻒ _ :pdepartureﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺧﺎﺭﺝ ﺷﺪﻩ ﺍﺯ ﺻﻒ _ :bdepartureﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺧﺎﺭﺝ ﺷﺪﻩ ﺍﺯ ﺻﻒ _ :pdropsﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺍﺯ ﺻﻒ _ :bdropsﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺍﺯ ﺻﻒ _ :bytesIntﺗﻮﺳﻂ ﺍﻳﻦ ﺷﺊ ﺍﻧﺘﮕﺮﺍﻝ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻪ ﺑﺎﻳﺖ ﻣﺤﺎﺳﺒﻪ ﻣﻲﺷﻮﺩ. _ : PktsIntﺗﻮﺳﻂ ﺍﻳﻦ ﺷﺊ ﺍﻧﺘﮕﺮﺍﻝ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻪ ﺑﺴﺘﻪ ﻣﺤﺎﺳﺒﻪ ﻣﻲﺷﻮﺩ. ﻣﻘﺪﺍﺭ ﺑﺮﮔﺮﺩﺍﻧﺪﻩ ﺷﺪﻩ ﺗﻮﺳﻂ ﺍﻳﻦ ﻣﺘﻐﻴﺮﻫﺎ ﺍﺯ ﺯﻣﺎﻥ ﻓﻌﺎﻝ ﺷﺪﻥ Monitoringﺩﺭ ﺻﻒ ﺗﺎ ﺯﻣﺎﻥ ﻓﺮﺍﺧﻮﺍﻧﻲ ﺍﻳﻦ ﻣﺘﻐﻴﺮﻫﺎ ﻣﻲﺑﺎﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٧‐٣
٢‐٣‐٣ﺷﺊ QueueMonitor/ED ﺍﻳﻦ ﺷﺊ ﻣﺎﻧﻨﺪ QueueMonitorﺍﺳﺖ ﺑﻪ ﺟﺰ ﺍﻳﻨﻜﻪ ﻗﺎﺩﺭ ﺍﺳﺖ ﺑﻴﻦ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺑﻪ ﺧﺎﻃﺮ ﭘﺮ ﺷﺪﻥ ﺑﺎﻓﺮ ﻭ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ Redﺗﻤﺎﻳﺰ ﻗﺎﺋﻞ ﺷﻮﺩ .ﻣﺘﻐﻴﺮﻫﺎﻱ ﺍﺧﺘﺼﺎﺻﻲ ﺍﻳﻦ ﺷﺊ ﻋﺒﺎﺭﺗﺴﺖ ﺍﺯ: _ :Epdropsﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ RED _ :Ebdropsﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ RED
PerFlow Monitoring ٣‐٣‐٣ ﻛﻼﺳﻬﺎﻱ ﺧﺎﺹ ﺑﺮﺍﻱ ﺟﻤﻊ ﺁﻭﺭﻱ ﺩﺍﺩﻩﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻓﻠﻮﻫﺎ ﭘﻴﺎﺩﻩ ﺳﺎﺯﻱ ﺷـﺪﻩﺍﻧـﺪ ﺍﻳـﻦ ﻛﻼﺳـﻬﺎ ﺍﺑﺘـﺪﺍ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﻨﺪ ﻛﻪ ﺑﺴﺘﻪ ﻣﺘﻌﻠﻖ ﺑﻪ ﭼﻪ ﺟﺮﻳﺎﻧﻲ ﺍﺳﺖ ﻭ ﺑﻌﺪ ﺍﺯ ﺁﻥ ﺑﺴﺘﻪ ﺑﻪ ﺷﺊ ﻣﺎﻧﻴﺘﻮﺭ ﻛﻨﻨﺪﻩ ﺟﺮﻳﺎﻧﻬـﺎ ﺍﺭﺳـﺎﻝ ﻣﻲﺷﻮﺩ ﻛﻪ ﺍﻃﻼﻋﺎﺕ ﺭﺍ ﺑﺮﺣﺴﺐ ﻓﻠﻮ ﺟﻤﻊ ﺁﻭﺭﻱ ﻣﻲﻛﻨﺪ.
١‐٣‐٣‐٣
ﺷﺊ QueueMonitor/ED/FlowMon
ﺍﻳﻦ ﺷﺊ ﺑﻪ ﻣﻨﻈﻮﺭ ﺟﻤﻊﺁﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﺑﺮ ﺣﺴﺐ ﺟﺮﻳﺎﻥﻫﺎ ﺑﻪ ﺟﺎﻱ ﺷﺊ QueueMonitorﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ .ﻭ ﻋﻼﻭﻩ ﺑﺮ ﺟﻤﻊﺁﻭﺭﻱ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﺩﺭ ﺷﺊ QueueMonitor
ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻓﻠﻮﻫﺎ ﺭﺍ ﻧﻴﺰ ﺟﻤﻊﺁﻭﺭﻱ ﻣﻲﻧﻤﺎﻳﺪ. ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺷﺊ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: _ :enable_inﺑﻪ ﺻﻮﺭﺕ ﭘﻴﺶﻓﺮﺽ ﻣﻘﺪﺍﺭ trueﺩﺍﺭﺩ ﻭ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ ﻛﻪ ﻣﺘﻐﻴﺮﻫﺎﻱ ﺣﺎﻟﺖ ﻣﺮﺑﻮﻁ ﺑﻪ ﺟﺮﻳﺎﻥ ﺩﺭﻳﺎﻓﺘﻲ،ﺑﺎﻳﺪ ﺗﻮﺳﻂ Flow Monitorﻧﮕﻬﺪﺍﺭﻱ ﺷﻮﺩ .ﻭ ﺍﮔﺮ ﺍﻳﻦ ﻣﺘﻐﻴﺮ ﻣﻘﺪﺍﺭ Falseﺑﮕﻴﺮﺩ ﺗﻨﻬﺎ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﺭﻳﺎﻓﺖ ﻛﻞ ﺑﺴﺘﻪﻫﺎ ﻧﮕﻬﺪﺍﺭﻱ ﺧﻮﺍﻫﺪ ﺷﺪ. _ :enable_outﺑﻪ ﺻﻮﺭﺕ ﭘﻴﺶﻓﺮﺽ ﻣﻘﺪﺍﺭ trueﺩﺍﺭﺩ ﻭ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ ﻛﻪ ﺁﻳﺎ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺟﺮﻳﺎﻥ ﺧﺮﻭﺟﻲ ﺍﺯ ﺑﺎﻳﺪ ﺗﻮﺳﻂ Flow Monitorﻧﮕﻬﺪﺍﺭﻱ ﺷﻮﻧﺪ ﻳﺎ ﺧﻴﺮ .ﺍﮔﺮ ﻣﻘﺪﺍﺭ falseﺑﮕﻴﺮﺩ ﺗﻨﻬﺎ ﺗﻌﺪﺍﺩ ﻛﻞ ﺑﺴﺘﻪﻫﺎﻱ ﺧﺎﺭﺝ ﺷﺪﻩ ﺍﺯ ﺻﻒ ﻧﮕﻬﺪﺍﺭﻱ ﺧﻮﺍﻫﺪ ﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣٨‐٣
_ :enable_dropﭘﻴﺶﻓﺮﺽ ﻣﻘﺪﺍﺭ trueﺩﺍﺭﺩ ﻭ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ ﻛﻪ ﺁﻳﺎ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﻭﺭﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺑﺮ ﺣﺴﺐ ﻫﺮ ﺟﺮﻳﺎﻥ ﺑﺎﻳﺪ ﻧﮕﻪ ﺩﺍﺷﺘﻪ ﺷﻮﺩ ﻳﺎ ﺧﻴﺮ .ﺍﮔﺮ ﻣﻘﺪﺍﺭ falseﺑﮕﻴﺮﺩ ﺗﻨﻬﺎ ﺗﻌﺪﺍﺩ ﻛﻞ ﺑﺴﺘﻪﻫﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﻧﮕﻬﺪﺍﺭﻱ ﺧﻮﺍﻫﺪ ﺷﺪ. :enable_edropsﭘﻴﺶﻓﺮﺽ ﻣﻘﺪﺍﺭ trueﺩﺍﺭﺩ ﻭ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ ﻛﻪ ﺁﻳﺎ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﻭﺭﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ REDﺑﺮ ﺣﺴﺐ ﻫﺮ ﺟﺮﻳﺎﻥ ﺑﺎﻳﺪ ﻧﮕﻪﺩﺍﺷﺘﻪ ﺷﻮﺩ ﻳﺎ ﺧﻴﺮ .ﺍﮔﺮ ﻣﻘﺪﺍﺭ falseﺑﮕﻴﺮﺩ ﺗﻨﻬﺎ ﺗﻌﺪﺍﺩ ﻛﻞ ﺑﺴﺘﻪﻫﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺗﻮﺳﻂ ﺍﻟﮕﻮﺭﻳﺘﻢ REDﻧﮕﻬﺪﺍﺭﻱ ﺧﻮﺍﻫﺪ ﺷﺪ. ٢‐٣‐٣‐٣ﺷﺊ QUEUEMONITOR/ED/FLOW ﺍﻳﻦ ﺷﺊ ﺷﺎﻣﻞ ﺷﻤﺎﺭﻧﺪﻩﻫﺎﻱ ﺑﺮ ﺣﺴﺐ ﻓﻠﻮ ﻭ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﺍﺳﺖ ﻛﻪ ﺗﻮﺳﻂ ﺷﺊ QUEUEMONITOR/ED/FLOWmonﻣﺪﻳﺮﻳﺖ ﻣﻲﺷﻮﺩ .ﺍﻳﻦ ﺷﺊ ﺩﺭ ﺯﻣﺎﻥ ﺍﻳﺠﺎﺩ ﺷﺊ Flowmon
ﺗﻮﺳﻂ ﺭﻭﺍﻝ oTcl callbackﺍﻳﺠﺎﺩ ﻣﻲﺷﻮﺩ ﻭ ﺑﺮﺍﻱ ﻧﮕﺎﺷﺖ ﺑﺴﺘﻪﻫﺎ ﺑﻪ ﻓﻠﻮﻫﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﺗﻮﺟﻪ ﺷﻮﺩ ﻛﻪ classifierﻣﺴﺌﻮﻝ ﻧﮕﺎﺷﺖ ﺑﺴﺘﻪﻫﺎ ﺑﻪ ﻓﻠﻮﻫﺎ ﺑﻪ ﺭﻭﺵ ﺍﺧﺘﻴﺎﺭﻱ)ﻛﻪ ﺗﻮﺳﻂ ﻛﺎﺭﺑﺮ ﺗﻌﻴﻴﻦ ﻣﻲﺷﻮﺩ( ﺍﺳﺖ. ﻣﺘﻐﻴﺮﻫﺎﻱ ﺣﺎﻟﺖ ﺍﻳﻦ ﺷﺊ ﻋﺒﺎﺗﻨﺪ ﺍﺯ: :Srcﺁﺩﺭﺱ ﻣﺒﺪﺍ ﺟﺮﻳﺎﻥ :Dstﺁﺩﺭﺱ ﻣﻘﺼﺪ ﺟﺮﻳﺎﻥ :Flowidﻣﺸﺨﺼﻪ ﺟﺮﻳﺎﻥ ٣‐٣‐٣‐٣ﻓﺮﻣﺖ Flow Monitor ﻓﺮﻣﺖ ﻓﺎﻳﻠﻲ ﻛﻪ ﺗﻮﺳﻂ Flow Monitoringﺍﻳﺠﺎﺩ ﻣﻲﺷﻮﺩ ﺩﺭ ﺩﻭ ﺟﺪﻭﻝ ﺯﻳﺮ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ. _parrival
Dst
src
ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎ ﻱ
ﻣﻘﺼﺪ
ﻣﺒﺪﺍ
ﺩﺭﻳﺎﻓﺘﻲ ﻣﺮﺑﻮﻁ ﺑﻪ
flowid
ﻣﺸﺨﺼﻪ ﻓﻠﻮ
pkt-type
ﻧﻮﻉ ﺑﺴﺘﻪ
Flowid
time
0
ﺭﺩﻩ ﺑﺴﺘﻪ ﺭﺍ
ﻣﺸﺨﺼﻪ
ﺯﻣﺎﻥ ﻓﺮﺍﺧﻮﺍﻧﻲ
ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ.
ﻓﻠﻮ
FlowMonit or
ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ
ﻓﻌﻼ ﺗﻨﻬﺎ ﻣﻘﺪﺍﺭ
flowid
0ﺩﺍﺭﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2 Bdrops
pdrops
Tbdrops
Tpdrops
ﺗﻌﺪﺍﺩ ﻛﻞ ﺗﻌﺪﺍﺩ
ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺗﻌﺪﺍﺩ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺑﺴﺘﻪﻫﺎﻱ ﺷﺪﻩ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﻭﺭ
٣٩‐٣
ﺑﻪ ﺑﺴﺘﻪﻫﺎﻱ
ﺍﻧﺪﺍﺧﺘﻪ ﺑﻪ
ﺑﺎﻳﺘﻬﺎﻱ
ﺩﻭﺭ ﺩﺭﻳﺎﻓﺘﻲ
Tparrival
ﻛﻞ ﺗﻌﺪﺍﺩ
ebdrops
ﻛﻞ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺗﻌﺪﺍﺩ
ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎ ﻱ
ﺑﺴﺘﻪﻫﺎﻱ
ﺑﻪ
ﺩﺭﻳﺎﻓﺘﻲ
ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺩﻭﺭ
ﺍﻧﺪﺍﺧﺘﻪ ﺑﻪ ﻓﻠﻮ ﺑﺎ
ﺗﻮﺳﻂ
ﺷﺪﻩ
ﺗﻮﺳﻂ ﻣﺸﺨﺼﻪ
RED
RED
ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ ﺷﺪﻩ ﻣﺮﺑﻮﻁ ﺑﻪ ﺍﻧﺪﺍﺧﺘﻪ Flowid
epdrops
Barrival
ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ ﺷﺪﻩ
ﺩﻭﺭ ﺑﺴﺘﻪﻫﺎﻱ
ﺑﻪ ﺩﺭﻳﺎﻓﺘﻲ ﻣﺮﺑﻮﻁ
flowid
Flowid
٤‐٣‐٣ﻭﺍﺳﻄﻬﺎﻱ ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ Monitoring ١‐٤‐٣‐٣
ﻓﺮﻣﺎﻧﻬﺎﻱ ﻓﻌﺎﻝ ﻧﻤﻮﺩﻥ Monitoringﺭﻭﻱ ﻟﻴﻨﻜﻬﺎ >$ simple-link init – monitor <ns> <sample Interval
ﻳﻚ ﺷﻲ ﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ ﻛﻪ ﻣﺎ ﺭﺍ ﻗﺎﺩﺭ ﻣﻲﻛﻨﺪ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺍﻳﻦ ﻟﻴﻨﻚ ﺭﺍ ﻣﺎﻧﻴﺘﻮﺭ ﻛﻨﻴﻢ ﻭ ﺍﺳﻢ ﺷﻴﺌﻲ ﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﻛﻪ ﺑﺮﺍﻱ ﺗﻌﻴﻴﻦ ﺍﻧﺪﺍﺯﻩ ﻣﺘﻮﺳﻂ ﺻﻒ ﻻﺯﻡ ﻣﻲﺷﻮﺩ. >$ simple-link attach – monitors
ﺍﻳﻦ ﺷﺒﻴﻪ ﺩﺳﺘﻮﺭ init–monitorﺍﺳﺖ ﺑﻪ ﻋﻼﻭﻩ ﺍﻳﻨﻜﻪ ﻣﻮﺍﺭﺩ ﺍﺧﺘﺼﺎﺻﻲ ﺑﻴﺸﺘﺮﻱ ﺭﺍ ﺩﺭ ﺍﺧﺘﻴﺎﺭ ﻣﺎ ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ.. >$ns monitor – queve
ﺍﻳﻦ ﻓﺮﻣﺎﻥ ﺷﻴﺌﻲ ﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ ﻛﻪ ﺑﻪ ﻣﺎ ﺍﺟﺎﺯﻩ ﻣﻲﺩﻫﺪ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻴﻦ ﮔﺮﻩ n1ﻭ n2ﻣﺎﻧﻴﺘﻮﺭ ﺷﻮﺩ .ﻭ ﻳﻚ ﺩﺳﺘﮕﻴﺮﻩ ﺑﻪ ﺷﻴﺌﻲ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﻛﻪ ﻣﻴﺎﻧﮕﻴﻦ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺗﻮﺳﻂ ﺁﻥ ﺗﻌﻴﻴﻦ ﻣﻲﺷﻮﺩ.
٢‐٤‐٣‐٣
ﻓﺮﻣﺎﻧﻬﺎﻱ ﺷﺊ QueueMonitor
ﭘﺲ ﺍﺯ ﺍﻳﻨﻜﻪ Monitoringﺩﺭ ﻳﻚ ﺻﻒ ﻓﻌﺎﻝ ﺷﺪ ﺑﻮﺳﻴﻠﻪ ﻓﺮﻣﺎﻧﻬﺎﻱ ﺯﻳﺮ ﻣﻲﺗﻮﺍﻥ ﺷﺊ QueueMonitor
ﻣﺮﺑﻮﻃﻪ ﺭﺍ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻧﻤﻮﺩ. $queuemonitor
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤٠‐٣
ﻫﻤﻪ ﺷﻤﺎﺭﻧﺪﻩﻫﺎﻱ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﺷﺊ )queuemonitorﺑﻪ ﻋﺒﺎﺭﺕ ﺩﻳﮕﺮ deparure ،arrivalﻭ (dropsﺭﺍ ﻣﻘﺪﺍﺭ ﺻﻔﺮ ﻣﻲﺩﻫﺪ .ﻭ ﻧﻴﺰ integratorﻭ delay samplerﺭﺍ ﺍﮔﺮ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺑﺎﺷﻨﺪ ﺩﻭﺑﺎﺭﻩ ﺭﺍﻩﺍﻧﺪﺍﺯﻱ ﻣﻲ ﻛﻨﺪ. >_ $queuemonitor set-delay-samples <delaySamp
ﺷﺊ _ delaysampﺭﺍ ﺑﻪ ﻣﻨﻈﻮﺭ ﻳﺎﺩﺍﺷﺖ ﻛﺮﺩﻥ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﺩﺭﺑﺎﺭﻩ ﺗﺎﺧﻴﺮ ﺻﻒ ﺭﺍﻩﺍﻧﺪﺍﺯﻱ ﻣﻲﻛﻨﺪ .ﻗﺒﻼ ﺑﺎﻳﺪ _ delaySampﺍﻳﺠﺎﺩ ﺷﻮﺩ. $queuemonitor get-bytes-integrator
ﺷﺊ Integratorﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﻛﻪ ﺍﻳﻦ ﺷﺊ ﻣﻲﺗﻮﺍﻧﺪ ﺑﺮﺍﻱ ﻣﺤﺎﺳﺒﻪ ﺍﻧﺘﮕﺮﺍﻝ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻪ ﺑﺎﻳﺖ ﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﺩ. $queuemonitor get-pkts-integrator
ﺷﺊ Integratorﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﻛﻪ ﺍﻳﻦ ﺷﺊ ﻣﻲﺗﻮﺍﻧﺪ ﺑﺮﺍﻱ ﻣﺤﺎﺳﺒﻪ ﺍﻧﺘﮕﺮﺍﻝ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﺑﻪ ﺑﺴﺘﻪ ﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﺩ. $queuemonitor get-delay-samples
ﺷﺊ _ delaySampﺭﺍ ﺑﻪ ﻣﻨﻈﻮﺭ ﻳﺎﺩﺩﺍﺷﺖ ﻛﺮﺩﻥ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ ٣‐٤‐٣‐٣ﻓﺮﻣﺎﻧﻬﺎﻱ ﺷﺊ Flow Monitor >$fmon classifier
ﺍﻳﻦ ﻓﺮﻣﺎﻥ ﻳﻚ classiffierﺑﻪ ﺷﺊ FlowMonitorﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ ﻛﻪ ﺑﺮﺍﻱ ﻧﮕﺎﺷﺖ ﺑﺴﺘﻪﻫﺎ ﺑﻪ ﻓﻠﻮﻫﺎ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ. $fmon dump
ﺷﻤﺎﺭﻧﺪﻩﻫﺎ ﻭ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﺭﺍ ﺩﺭ ﺧﺮﻭﺟﻲ ﻣﻲﻧﻮﻳﺴﺪ. $fmon flows
ﻳﻚ ﺭﺷﺘﻪ ﺣﺮﻓﻲ ﻛﻪ ﺷﺎﻣﻞ ﺍﺳﻢ ﺍﺷﻴﺎﺀ ﺟﺮﺍﻧﻬﺎﻳﻲ ﻛﻪ ﺗﻮﺳﻂ ﺍﻳﻦ Flow Monitorﺷﻨﺎﺧﺘﻪ ﻣﻲﺷﻮﻧﺪ ﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ .ﻫﻤﻪ ﺍﻳﻦ ﺍﺷﻴﺎﺀ ﺍﺯ ﻧﻮﻉ QueueMonitor/ED/Flowﻫﺴﺘﻨﺪ. >$fmon attach
ﻳﻚ ﻛﺎﻧﺎﻝ ﺧﺮﻭﺟﻲ ﺭﺍ ﺑﻪ Flow Monitorﭘﻴﻮﺳﺖ ﻣﻲﻛﻨﺪ .ﭘﺲ ﺍﺯ ﻓﺮﻣﺎﻥ dumpﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﺍﻳﻦ ﺷﺊ ﺩﺍﺧﻞ ﺍﻳﻦ ﺧﺮﻭﺟﻲ ﻧﻮﺷﺘﻪ ﺧﻮﺍﻫﺪ ﺷﺪ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺧﺮﻭﺟﻲ ﻣﻲﺗﻮﺍﻧﺪ ﻳﻚ ﻓﺎﻳﻞ ﺑﺎﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤-٣
٤١‐٣
Loss Monitor
Loss Moniterﺍﺯ ﻛﻼﺱ agentﻣﺸﺘﻖ ﺷﺪﻩ ﺍﺳﺖ ﻭ ﺗﺮﺍﻓﻴﻚ sinkﺭﺍ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﻣﻲﻛﻨﺪ ﻭ ﻋﻼﻭﻩ ﺑﺮ ﺁﻥ ﻣﻲﺗﻮﺍﻧﺪ ﮔﻢ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﭼﻚ ﻛﻨﺪ ﻭ ﻫﻤﭽﻨﻴﻦ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﺍﺩﻩﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ﺭﺍ ﻧﮕﻬﺪﺍﺭﻱ ﻣﻲﻛﻨﺪ ﻛﻪ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ :ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﻳﺎ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ،ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﮔﻢ ﺷﺪﻩ، ﻣﺘﻐﻴﺮﻫﺎﻱ ﺍﻳﻦ ﺷﺊ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: _ :nlostﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﮔﻢ ﺷﺪﻩ _ :nPktsﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ _ :bytesﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ _ : lastPktTimeﺯﻣﺎﻥ ﺁﺧﺮﻳﻦ ﺑﺴﺘﻪ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ Seqno :Expectedﻣﻮﺭﺩ ﺍﻧﺘﻈﺎﺭ ﺑﺴﺘﻪ ﺑﻌﺪﻱ ﺍﺯ ﺍﻳﻦ agentﻧﻴﺰ ﻣﻲﺗﻮﺍﻥ ﺑﻪ ﻣﻨﻈﻮﺭ ﺟﻤﻊﺁﻭﺭﻱ ﺩﺍﺩﻩ ﺩﺭ ﺷﺒﻴﻪﺳﺎﺯ nsﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ.
٥-٣
ﻣﺜﺎﻟﻬﺎﻳﻲ ﺑﺮاي اﺳﺘﻔﺎدﻩ از Traceو Monitoringدر NS-2
ﻓﺮﺽ ﻛﻨﻴﺪ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺯﻳﺮ ﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺍﺳﺖ ،ﻭ ﺗﺮﺍﻓﻴﻜﻲ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ TCPﺍﺯ ﮔﺮﻩ n0ﺑﻪ ﮔﺮﻩ n3ﻭ ﻧﻴﺰ ﺗﺮﺍﻓﻴﻚ ﺩﻳﮕﺮﻱ ﺍﺯ ﮔﺮﻩ n1ﺑﻪ ﮔﺮﻩ n3ﺩﺭ ﺣﺎﻝ ﺍﺭﺳﺎﻝ ﻣﻲﺑﺎﺷﺪ .ﻣﻲﺧﻮﺍﻫﻴﻢ ﺗﺮﺍﻓﻴﻚ ﺑﻴﻦ ﺩﻭ ﮔﺮﻩ n2ﻭ n3
ﺭﺍ traceﻛﻨﻴﻢ. n1 n3
n2
n0
trace ١‐٥‐٣ trace-all ۱‐۱‐۵‐۳ﻭ numtrace-all #ﺩﺭ ﺩﺳﺘﻮﺭﺍﺕ ﺯﻳﺮ ﺩﻭ ﻓﺎﻳﻞ ﺑﻪ ﻣﻨﻈﻮﺭ ﻧﻮﺷﺘﻦ ﺩﺭ ﺁﻥ )ﺑﺮﺍﻱ ﺍﻳﻨﻜﺎﺭ ﺑﺎ ﺧﺼﻮﺻﻴﺖ wﻓﺎﻳﻞ ﺑﺎﺯ ﻣﻲﺷﻮﺩ( ﺑﺎﺯ ﻣﻲﺷﻮﻧﺪ ﻭ ﺍﺷﺎﺭﻩﮔﺮﻱ ﺑﻪ ﺁﻧﻬﺎ ﻧﺴﺒﺖ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤٢‐٣ ]set tf [open out.tr w ]set nf [open out.nam w
#ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ traceﺭﺍﻩﻧﺪﺍﺯﻱ ﻣﻲﺷﻮﺩ ﻭ ﺧﺮﻭﺟﻲ ﺁﻥ ﻛﻪ ﺷﺎﻣﻞ ﺗﻤﺎﻡ ﺭﻭﻳﺪﺍﺩﻫﺎ ﺩﺭ ﻫﻤﻪ ﻟﻴﻨﻜﻬﺎ ﺍﺳﺖ ﺩﺭ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺑﻪ ﻓﺮﻣﺖ ﮔﻔﺘﻪ ﺷﺪﻩ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ. $ns trace-all $tf
#ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ namtraceﺭﻩﺍﻧﺪﺍﺯﻱ ﻣﻲﺷﻮﺩ ﻭ ﺧﺮﻭﺟﻲ ﺁﻥ ﺩﺭ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ. $ns namtrace-all $nf
#ﺩﺭ ﺍﻳﻦ ﺭﻭﺍﻝ ﺍﺑﺘﺪﺍ ﺑﻮﺳﻴﻠﻪ ﻓﺮﻣﺎﻥ flush-traceﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ traceﻫﺎ ﺩﺍﺧﻞ ﻓﺎﻳﻠﻬﺎ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ ﻭ ﺳﭙﺲ ﻓﺎﻳﻠﻬﺎ ﺑﺴﺘﻪ ﻣﻲﺷﻮﻧﺪ .ﻭ ﺩﺭ ﻧﻬﺎﻳﺖ ﺑﺮﻧﺎﻣﻪ namﺑﺎ ﻭﺭﻭﺩﻱ ﻓﺎﻳﻞ out.namﺍﺟﺮﺍ ﻣﻲﺷﻮﺩ. { }{ proc finish global ns nf tf $ns flush-trace close $nf close $tf &exec nam out.nam exit 0 }
٢‐١‐٥‐٣
Trace-queue
Trace-allﺗﻤﺎﻡ ﺭﻭﻳﺪﺍﺩﻫﺎ ﺩﺭ ﻫﻤﻪ ﻟﻴﻨﻜﻬﺎ ﺭﺍ ﻣﺎﻧﻴﺘﻮﺭ ﻣﻲﻛﻨﺪ ﺍﮔﺮ ﺑﺨﻮﺍﻫﻴﻢ ﺗﻨﻬﺎ ﺭﻭﻳﺪﺍﺩﻫﺎﻱ ﻳﻚ ﻟﻴﻨﻚ ﻣﺜﻼ ﻟﻴﻨﻚ ﺑﻴﻦ دو ﮔﺮﻩ n1ﻭ n2ﺭﺍ ﻣﺎﻧﻴﺘﻮﺭ ﻛﻨﻴﻢ ﻣﻲ ﺗﻮﺍﻥ ﺑﺠﺎﻱ ﺩﺳﺘﻮﺭ trace-allﺍﺯ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﻢ $ns trace-queue n2 n3 $tf
Monitoring ٢‐٥‐٣ ﺍﮔﺮ ﻧﺨﻮﺍﻫﻴﻢ ﻫﻤﻪ ﺍﺗﻔﺎﻗﺎﺕ ﺭﺍ ﻣﺎﻧﻴﺘﻮﺭ ﻛﻨﻴﻢ ﺍﺯ Monitoringﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻴﻢ .ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﻗﺒﻼ ﺍﺷﺎﺭﻩ ﺷﺪﻩ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ Monitoringﻣﻲﺗﻮﺍﻥ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺑﺴﺘﻪﻫﺎ) ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎ ﮔﻢ ﺷﺪﻩ ،ﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻱ ﺧﺎﺭﺝ ﺷﺪﻩ ﺍﺯ ﺻﻒ ﻭ (..ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﺩ ﻛﻪ ﺍﺯ ﺍﻳﻦ ﺍﻃﻼﻋﺎﺕ ﻣﻲﺗﻮﺍﻥ ﺑﺮﺍﻱ ﻣﻨﻈﻮﺭﻫﺎﻱ ﺧﺎﺹ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ: ﻧﺮﺥ ﮔﻢ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﻣﻘﻴﺎﺳﻬﺎﻱ ﺯﻣﺎﻧﻲ ﻣﺘﻔﺎﻭﺕ ﻧﺮﺥ ﮔﺬﺭﺩﻫﻲ ﺩﺭ ﻣﻘﻴﺎﺳﻬﺎﻱ ﺯﻣﺎﻧﻲ ﻣﺨﺘﻠﻒ ﺗﻌﺪﺍﺩ ﻭﺭﻭﺩ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﻣﻘﻴﺎﺳﻬﺎﻱ ﺯﻣﺎﻧﻲ ﻣﺨﺘﻠﻒ
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٤٣‐٣
... ﻭ ﻏﻴﺮﻩ Queue Monitoring
١‐٢‐٥‐٣
n3 ﻭn2 ﺭﻭﻱ ﻟﻴﻨﻚ ﺑﻴﻦmonitoring ﺑﻪ ﻋﻨﻮﺍﻥ ﻧﻤﻮﻧﻪ ﺩﺭ ﻛﺪ ﺯﻳﺮ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻓﻌﺎﻝ ﻧﻤﻮﺩﻥ
.ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻟﻴﻨﻚ ﻭ ﻧﺮﺥ ﮔﻢ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﭘﺮﻳﻮﺩﻫﺎﻱ ﻣﻨﺎﺳﺐ ﺍﻧﺪﺍﺯﻩ ﮔﺮﻓﺘﻪ ﻣﻲﺷﻮﺩ set aggr_thr_file [open thr_.dat w] set aggr_drops_file [open drops_genC4mt.dat w] set ft “”
. ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ ﻭ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﺍﻳﻦ ﺷﻲ ﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪn2-n3 ﺭﺍ ﺭﻭﻱ ﻟﻴﻨﻚmonitor-queeu ﺍﻳﻦ ﺩﺳﺘﻮﺭ# set mon_ref [$ns monitor-queue $n2 $n3 $ft] $mon_ref set-delay-samples [new Samples] set link_ref [$ns link $n1 $n2] set throughput_samples_($link_ref) [new Samples] set drops_samples_($link_ref) [new Samples]
$throughput_samples_($link_ref) reset $drops_samples_($link_ref) reset $ns at 0.0 "record" proc record {} { global n1 n2 aggr_thr_file aggr_drops_file global ns t_u_time_ sent_bytes_ throughput_samples_ drops_samples_ global dropped_bytes_ #get an instance of the simulator set ns [Simulator instance] #set time after which this proc should be called again set time 0.1 #byts no go through the queue
ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻳﻚ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﻟﻴﻨﻚ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ# set nbr [$ns link $n1 $n2]
. ﻟﻴﻨﻚ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪqMonitor ﺍ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﺷﻲ# set qmon [$nbr set qMonitor_]
ﺍﻧﺘﺴﺎﺏtransf_byte ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺧﺎﺭﺝ ﺷﺪﻩ ﺍﺯ ﺍﻳﻦ ﻟﻴﻨﻚ ﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﻭ ﺑﻪ ﻣﺘﻐﻴﺮ# .ﻣﻲﻛﻨﺪ
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٤٤‐٣ set transf_bytes [$qmon set bdepartures_]
new_drops ﺩﺳﺘﻮﺭ ﺯﻳﺮﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩ ﺍﺯ ﺍﻳﻦ ﻟﻴﻨﻚ ﺭﺍ ﺑﺮ ﻣﻲﮔﺮﺩﺍﻧﺪ ﻭ ﺑﻪ ﻣﺘﻐﻴﺮ#
.ﺍﻧﺘﺴﺎﺏ ﻣﻲﻛﻨﺪ set new_drops [$qmon set bdrops_] set simtime [$ns now]
reset ﻣﻘﺪﺍﺭﻱ ﻧﺪﺍﺭﺩ ﻭ ﻣﺘﻐﻴﺮﻫﺎt_u_time ﺑﺮﺍﻱ ﺍﻭﻟﻴﻦ ﺑﺎﺭ ﻛﻪ ﻭﺍﺭﺩ ﮔﺰﺍﺭﻩ ﺷﺮﻃﻲ ﺯﻳﺮ ﻣﻲﺷﻮﺩ ﻣﺘﻐﻴﺮ#
.ﻣﻲﺷﻮﻧﺪ if { ![info exists t_u_time_($nbr)]} { set p_simtime 0.0 set used_bw 0.0 set drop_rate 0.0 set sent_bytes_($nbr) $transf_bytes set dropped_bytes_($nbr) $new_drops set t_u_time_($nbr) $simtime } else {
ﻛﻪ ﺯﻣﺎﻥ ﻧﻤﻮﻧﻪﮔﻴﺮﻱ ﻗﺒﻠﻲ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ؛ ﻣﻘﺪﺍﺭﺩﻫﻲ ﻣﻲﺷﻮﺩp_simtime ﺩﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻣﺘﻐﻴﺮ# set p_simtime [set t_u_time_($nbr)]
. ﺫﺧﻴﺮﻩ ﻣﻲﮔﺮﺩﺩt_u_time ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺯﻣﺎﻥ ﺣﺎﺿﺮ ﺩﺭ ﻣﺘﻐﻴﺮ# set t_u_time_($nbr) $simtime
.ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺑﻴﻦ ﺩﻭ ﻧﻤﻮﻧﻪﮔﻴﺮﻱ ﻣﺤﺎﺳﺒﻪ ﻱﮔﺮﺩﺩ# set used_bw [expr (($transf_bytes-$sent_bytes_($nbr))*8)/($simtime-$p_simtime)] set sent_bytes_($nbr) $transf_bytes
.ﺩﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻧﺮﺥ ﮔﻢ ﺷﺪﻥ ﺑﺴﺘﻪﻫﺎ ﺑﻴﻦ ﺩﻭ ﻧﻤﻮﻧﻪﮔﻴﺮﻱ ﻣﺤﺎﺳﺒﻪ ﻣﻲﮔﺮﺩﺩ# Set drop_rate [expr (($new_drops-$dropped_bytes_($nbr))*8)/($simtime-$p_simtime)] set dropped_bytes_($nbr) $new_drops set t_u_time_($nbr) $simtime }
. ﺩﺭ ﺁﺭﺍﻳﻪﻫﺎﻱ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺫﺧﻴﺮﻩ ﻣﻲﺷﻮﻧﺪdrop_rate ﻭused_bw ﺩﺭ ﺍﻳﻦ ﺩﻭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ# $throughput_samples_($nbr) newpoint $used_bw $drops_samples_($nbr) newpoint $drop_rate
. ﺩﺭ ﻓﺎﻳﻞ ﺫﺧﻴﺮﻩ ﻣﻲﺷﻮﻧﺪdrop_rate وused_bw ﺩﺭ ﺩﻭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ# puts $aggr_thr_file "$used_bw" puts $aggr_drops_file "$simtime $drop_rate" set now [$ns now]
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤٥‐٣
#ﻭ ﺩﺭ ﻧﻬﺎﻳﺖ ﺩﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺭﻭﺍﻝ ﺑﺎﻻ ﺑﺮﺍﻱ ﺟﻤﻊﺁﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﺩﺭ ﻓﺎﺻﻠﻪ ﺯﻣﺎﻧﻲ ﺑﻌﺪﻱ ﺩﻭﺑﺎﺭﻩ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ. ”$ns at [expr $now+$time] "recoord
٢‐٢‐٥‐٣
Monitor per Flow
ﻣﻲﺗﻮﺍﻥ ﺍﻃﻼﻋﺎﺕ ﺭﺍ ﺑﺮ ﺣﺴﺐ ﻓﻠﻮﻫﺎ ﺑﺪﺳﺖ ﺁﻭﺭﺩ .ﻛﺪ ﺯﻳﺮ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻓﻠﻮﻫﺎ ﺭﺍ ﺩﺭ ﻓﺎﻳﻠﻲ ﻣﻲﻧﻮﻳﺴﺪ ]set flow_stat [open flow_mon.stat w
#ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻳﻚ ﺷﺊ monitor-per-flowﻣﻲﺳﺎﺯﺩ. ]set flowmon1 [$ns makeflowmon Fid
#ﺩﺳﺘﻮﺭ ﺯﻳﺮ flowmon1ﺭﺍ ﺑﻪ ﻟﻴﻨﻚ ﺑﻴﻦ n2-n3ﭘﻴﻮﺳﺖ ﻣﻲﻛﻨﺪ.ﺑﻪ ﺍﻳﻦ ﺗﺮﺗﻴﺐ flowmon1ﺩﺍﺩﻩﻫﺎﻱ ﺍﻳﻦ ﻟﻴﻨﻚ ﺭﺍ ﺑﺮ ﺣﺴﺐ ﻧﻮﻉ ﻓﻠﻮ ﺟﻤﻊﺁﻭﺭﻱ ﻣﻲﻛﻨﺪ. ]$ns attach-fmon [$ns link $n2 $n3] $flowmon1 0
#ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺷﺊ flowmon1ﺭﺍﺑﻪ ﻓﺎﻳﻞ ﻣﺘﺼﻞ ﻣﻲﻛﻨﺪ ﺑﻪ ﺍﻳﻦ ﺻﻮﺭﺕ ﺧﺮﻭﺟﻲ ﺍﻳﻦ ﺷﺊ ﺑﻪ ﻓﺮﻣﺘﻲ ﻛﻪ ﻗﺒﻼ ﮔﻔﺘﻪ ﺷﺪ ﺩﺭ ﺍﻳﻦ ﻓﺎﻳﻞ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ. $flowmon_10 attach $flow_stat
#ﺑﺎ ﺍﺟﺮﺍﻱ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺩﺭ ﺯﻣﺎﻥ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺧﺮﻭﺟﻲ ﺷﺊ flowmon1ﺑﻪ ﺩﺍﺧﻞ ﻓﺎﻳﻞ ﻧﻮﺷﺘﻪ ﻣﻲﺷﻮﺩ .ﺍﮔﺮ ﺑﺨﻮﺍﻫﻴﻢ ﺩﺭ ﭘﺮﻳﻮﺩﻫﺎﻱ ﺯﻣﺎﻧﻲ ﺧﺎﺹ ﺍﺯ flowmon1ﺍﻃﻼﻋﺎﺕ ﺑﮕﻴﺮﻳﻢ ﻣﻲﺗﻮﺍﻧﻴﻢ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺭﺍ ﺩﺭ ﭘﺮﻳﻮﺩﻫﺎﻱ ﺯﻣﺎﻧﻲ ﻣﻮﺭﺩ ﻧﻈﺮ ﺗﻜﺮﺍﺭ ﻛﻨﻴﻢ. ”$ns at $finish-time "$flowmon_10 dump ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ Flow Monitoringﺑﺮﺍﻱ ﺟﻤﻊﺁﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻓﻠﻮ: ﻫﻤﭽﻨﻴﻦ ﻣﻲﺗﻮﺍﻥ ﺍﺯ ﻣﻘﺎﺩﻳﺮ ﻣﺘﻐﻴﺮﻫﺎﻱ Flow Monitorﺑﻪ ﻃﻮﺭ ﻣﺴﺘﻘﻴﻢ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ .ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﻓﻠﻮ ﺗﻌﻴﻴﻦ ﺷﻮﺩ ﻭ ﺳﭙﺲ ﺍﺯ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ : ﺩﺭ ﺍﻳﻦ ﺣﻠﻘﻪ ﺑﻪ ﺍﺯﺍﻱ ﻫﺮ ﻓﻠﻮ ﻣﺘﻐﻴﺮﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺁﻥ ﺫﺧﻴﺮﻩ ﻣﻲﺷﻮﻧﺪ ﻭ ﻣﻲﺗﻮﺍﻥ ﺍﺯ ﺁﻧﻬﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ. { ]foreach f [$fmon flows ]_set flow_arrs [$f set barrivals ]_set flow_deps [$f set bdepartures ]_set flow_drops [$f set bdrops
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤٦‐٣ }
ﻫﻤﭽﻨﻴﻴﻦ ﻣﻲﺗﻮﺍﻥ ﻓﻠﻮ ﻣﻮﺭﺩ ﻧﻈﺮ ﺭﺍ ﺗﻮﺳﻂ classifierﺟﺴﺘﺠﻮ ﻧﻤﻮﺩ ﻭ ﺳﭙﺲ ﺍﺯ ﺍﻃﻼﻋﺎﺕ ﺁﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ: ]set fclassifier [$fmon classifier ]set flow1 [$fclassifier lookup auto 0 0 1 ]_set flow_arrs [$flow1 set barrivals
Loss Monitor ٣‐٥‐٣ ﺍﮔﺮ agentﮔﻴﺮﻧﺪﻩ ﺍﺯ ﻧﻮﻉ LossMonitorﺗﻌﺮﻳﻒ ﺷﻮﺩ ﻣﻲﺗﻮﺍﻥ ﺍﺯ ﺍﻃﻼﻋﺎﺕ ﺁﻣﺎﺭﻱ ﻛﻪ ﺍﻳﻦ ﺷﺊ ﺟﻤﻊﺁﻭﺭﻱ ﻣﻲﻛﻨﺪ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﻓﺮﺽ ﻛﻨﻴﺪ ﮔﻴﺮﻧﺪﻩﺍﻱ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﺗﻌﺮﻳﻒ ﻣﻲﺷﻮﺩ: ]$ns set sink0 [new agent/LossMonitor
ﺩﺭ ﺍﻳﻦ ﺻﻮﺭﺕ ﺭﻭﺍﻝ ﺯﻳﺮ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ﺗﻮﺳﻂ ﮔﻴﺮﻧﺪﻩ ﺭﺍ ﺩﺭ ﺩﻭﺭﻩ ﺗﻨﺎﻭﺏ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺍﻧﺪﺍﺯﻩ ﻣﻲﮔﻴﺮﺩ. { }{ proc record global sink0 f1 #Get an instance of the simulator ]set ns [Simulator instance #Set the time after which the procedure should be called again set time 0.5
#ﺩﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻣﺘﻐﻴﺮ bw0ﻣﻘﺪﺍﺭﻱ ﺑﺮﺍﺑﺮ ﺑﺎ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ﺗﻮﺳﻂ ﮔﻴﺮﻧﺪﻩ sink0ﻣﻲﮔﻴﺮﺩ. ]_set bw0 [$sink0 set bytes #Get the current time ]set now [$ns now
#ﺩﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺭﺍ ﺑﻪ ﺻﻮﺭﺕ Mbsﻣﺤﺎﺳﺒﻪ ﻣﻲﻛﻨﺪ ﻭ ﺩﺭ ﻓﺎﻳﻞ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻣﻲﻧﻮﻳﺴﺪ. "]puts $f0 "$now [expr $bw0/$time*8/1000000
#ﺩﺭ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻣﺘﻐﻴﺮ _ byteﻛﻪ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺘﻲ ﮔﻴﺮﻧﺪﻩ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ ﺭﺍ ﺻﻔﺮ ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ .ﺗﺎ ﺩﺭ ﺯﻣﺎﻥ ﻧﻤﻮﻧﻪﮔﻴﺮﻱ ﺑﻌﺪﻱ ﺍﻳﻦ ﻣﺘﻐﻴﺮ ﺗﻌﺪﺍﺩ ﺑﺎﻳﺘﻬﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ ﺍﺯ ﺯﻣﺎﻥ ﻓﻌﻠﻲ ﺗﺎ ﺯﻣﺎﻥ ﻧﻤﻮﻧﻪﮔﻴﺮﻱ ﺑﻌﺪﻱ ﺭﺍ ﻧﺸﺎﻥ ﺩﻫﺪ. $sink0 set bytes_ 0 #Re-schedule the procedure
#ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﺑﻌﺪ ﺍﺯ ﻣﺪﺕ ﺯﻣﺎﻥ “ ”timeﺩﻭﺑﺎﺭﻩ ﺍﻳﻦ ﺭﻭﺍﻝ ﺑﺮﺍﻱ ﻧﻤﻮﻧﻪﮔﻴﺮﻱ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ. "$ns at [expr $now+$time] "record
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤٧‐٣ }
ﻣﺘﻐﻴﺮﻫﺎﻱ
ﺩﻳﮕﺮ
LossMonitor
ﺭﺍ
ﻧﻴﺰ
ﺑﻪ
ﻫﻤﻴﻦ
ﺗﺮﺗﻴﺐ
ﻣﻲﺗﻮﺍﻥ
ﺍﺳﺘﻔﺎﺩﻩ
ﻧﻤﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
.۴
٤٨‐٤
ﺷﺒﻴﻪﺳﺎز MPLS Network Simulator-V2.0 ﻫﺪﻑ ﺍﺯ ﺍﻳﻦ ﻓﺼﻞ ﺗﺸﺮﻳﺢ ﻧﺤﻮﻩ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺷﺒﻴﻪﺳﺎﺯ MPLSﺩﺭ NS-2ﺍﺳﺖ .ﻣﺎﺟﻮﻝ MNS-V2ﺍﻛﺜﺮ
ﻗﺎﺑﻠﻴﺘﻬﺎﻱ ﭘﺮﻭﺗﻜﻞ MPLSﺭﺍ ﺩﺍﺭﺍﺳﺖ ﻭ ﺑﻪ ﻭﺳﻴﻠﻪ ﺁﻥ ﻣﻲﺗﻮﺍﻥ ﺑﻪ ﺭﺍﺣﺘﻲ ﺷﺒﻜﻪ MPLSﺭﺍ ﺩﺭ ﻣﺤﻴﻂ NS-2
ﺷﺒﻴﻪﺳﺎﺯﻱ ﻧﻤﻮﺩ .ﺩﺭ ﺣﺎﻝ ﺣﺎﺿﺮ ﺩﺭ ﻣﺪﻝ MNS-V1 ns-2.1b9aﻧﺼﺐ ﺍﺳﺖ ﻭ MNS-V2ﻛﻪ ﻧﺴﺨﻪ ﺟﺪﻳﺪﺗﺮ ﺷﺒﻴﻪﺳﺎﺯ MPLSﺍﺳﺖ ﺩﺭ ﺁﺧﺮﻳﻦ ﻧﺴﺨﻪ nsﻳﻌﻨﻲ ns-2.1b9aﻧﺼﺐ ﻧﻴﺴﺖ ﻭ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺁﻥ ﺑﺎﻳﺪ ﺁﻥ ﺭﺍ ﻧﺼﺐ ﻧﻤﻮﺩ. ﺩﺭ ﺍﻳﻦ ﺭﺍﻫﻨﻤﺎ ﺍﺑﺘﺪﺍ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ MNS-V2ﺭﺍ ﺑﻪ ﻃﻮﺭ ﺧﻼﺻﻪ ﻣﺮﻭﺭ ﻣﻲﻛﻨﻴﻢ ﻭ ﺳﭙﺲ ﻣﻌﻤﺎﺭﻱ ﺁﻥ ﺭﺍ ﺗﺸﺮﻳﺢ ﻣﻲﻛﻨﻴﻢ ﻭ ﺩﺭ ﻧﻬﺎﻳﺖ ﺭﻭﺵ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﻳﻦ ﺷﺒﻴﻪﺳﺎﺯ ﺭﺍ ﺑﺎ ﻣﺜﺎﻟﻬﺎﻳﻲ ﺗﻮﺿﻴﺢ ﻣﻲﺩﻫﻴﻢ.
١-٤
ﻗﺎﺑﻠﻴﺘﻬﺎي MPLS Network Simulator-V2
MNS-v2 ١‐١‐٤ﺍﻋﻤﺎﻝ ﺗﻮﺯﻳﻊ ﺑﺮﭼﺴﺐ ﻛﻪ ﺷﺎﻣﻞ ﺍﺟﺰﺍﺀ ﺯﻳﺮ ﺍﺳﺖ ﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ: ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ MPLS :ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻗﺎﺑﻠﻴﺖ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﻫﺪﺍﻳﺖ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺗﺴﺮﻳﻊ ﻣﻲﺑﺨﺸﺪ .ﺍﻳﻦ ﻗﺎﺑﻠﻴﺖ ﻛﻪ ﺍﺯ ﺑﺎﺭﺯﺗﺮﻳﻦ ﻭﻳﮋﮔﻲﻫﺎﻱ MPLSﺍﺳﺖ ﻭ ﺷﺎﻣﻞ ﺍﻋﻤﺎﻟﻲ ﻧﻈﻴﺮ ﺗﺨﺼﻴﺺ ﺑﺮﭼﺴﺐ ﺑﻪ ﺑﺴﺘﻪﻫﺎ ،ﺑﺮﺩﺍﺷﺘﻦ ﺑﺮﭼﺴﺐﻫﺎ ،ﺗﻌﻮﻳﺾ ﺑﺮﭼﺴﺐﻫﺎ ﻣﻲﺑﺎﺷﺪ ،ﺩﺭ ﺷﺒﻴﻪﺳﺎﺯ MPLSﻧﻴﺰ ﻣﻮﺟﻮﺩ ﺍﺳﺖ. MPLS :LDP .١ﺗﻮﺳﻂ ﭘﺮﻭﺗﻜﻞ LDPﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ .ﺍﻳﻦ ﭘﺮﻭﺗﻜﻞ ﺑﺎ ﺍﺭﺳﺎﻝ ﭘﻴﻐﺎﻣﻬﺎﻱ Mapping ،Withdraw ،Releaseﻭ Requestﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺍﻧﺘﺴﺎﺏ ﺑﺮﭼﺴﺐﻫﺎ ﺭﺍ ﺑﻴﻦ LSRﻫﺎ ﺭﺩ ﻭ ﺑﺪﻝ ﻣﻲﻛﻨﺪ MNS-V2 .ﺍﺯ ﺍﻳﻦ ﭘﺮﻭﺗﻜﻞ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ ﻭ ﻗﺎﺑﻠﻴﺖ ﭘﺮﺩﺍﺯﺵ ﭘﻴﻐﺎﻣﻬﺎﻱ ﺁﻥ ﺭﺍ ﺩﺍﺭﺍﺳﺖ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٤٩‐٤
MPLS :CR-LDP .٢ﺗﻮﺳﻂ ﭘﺮﻭﺗﻜﻞ CR-LDPﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ﻭ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺒﺘﻨﻲ ﺑﺮ ﻣﺤﺪﻭﺩﻳﺖ ﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ .ﺍﻳﻦ ﭘﺮﻭﺗﻜﻞ ﻫﻤﻪ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ LDPﺭﺍ ﺩﺍﺭﺍﺳﺖ ﻭ ﻋﻼﻭﻩ ﺑﺮ ﺁﻥ ﻗﺎﺑﻠﻴﺖ ﺭﺯﺭﻭ ﻣﻨﺎﺑﻊ ﺭﺍ ﻧﻴﺰ ﺩﺍﺭﺍﺳﺖ MNS-2 .ﺍﺯ ﺍﻳﻦ ﭘﺮﻭﺗﻜﻞ ﻧﻴﺰ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ.
MNS-V2 ٢‐١‐٤ﺍﺯ ﺭﻭﺷﻬﺎﻱ ﺯﻳﺮ ﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ LSPﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ: .١ﺭﻭﺷﻬﺎﻱ Control-Drivenﻭ Dtat-Drivenﺑﺮﺍﻱ ﺍﻳﺠﺎﺩ .LSP .٢ﺷﻤﺎﻱ ﺗﻮﺯﻳﻊ ﺍﻃﻼﻋﺎﺕ ﺑﻪ ﺭﻭﺵ UpStreamﺑﺮﺍﻱ Control-Drivenﻭ ﻫﺮ ﺩﻭ ﺷﻤﺎﻱ UpStreaﻭ DownStreamﺑﺮﺍﻱ Control-Driven
.٣ﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ﺑﺮ ﺍﺳﺎﺱ ﻣﺴﻴﺮ ﺍﺯ ﻗﺒﻞ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺗﻮﺳﻂ ﻛﺎﺭﺑﺮ .ﺍﻳﻦ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺗﻮﺳﻂ ﭘﺮﻭﺗﻜﻞ CR-LDPﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ. .٤ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺒﺘﻨﻲ ﺑﺮ ﻣﺤﺪﻭﺩﻳﺖ .ﺍﻳﻦ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻳﻲ ﻧﻈﻴﺮ ﻣﻴﺰﺍﻥ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ،ﺍﻧﺪﺍﺯﻩ ﺑﺎﻓﺮ ﻭ ..ﻛﻪ ﻗﺒﻼ ﺗﻌﺮﻳﻒ ﺷﺪﻩﺍﻧﺪ ،ﺗﻮﺳﻂ ﭘﺮﻭﺗﻜﻞ CR-LDPﺍﻳﺠﺎﺩ ﻣﻲﺷﻮﺩ. .٥ﺍﻭﻟﻮﻳﺖ ﺩﺍﺩﻥ ﺑﻪ ﻛﻼﺳﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺩﺭ ﮔﺮﻓﺘﻦ ﻣﻨﺎﺑﻊ MNS :ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻭﻳﮋﮔﻲ ﺍﻭﻟﻮﻳﺖ ﺍﻳﺠﺎﺩ ١ﻣﺴﻴﺮ ﻭ ﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺍﺭﻱ 2ﻫﺮ ﻣﺴﻴﺮ ﻣﺒﺘﻨﻲ ﺑﺮ ﻣﺤﺪﻭﺩﻳﺖ ،ﺍﻳﻦ ﺍﻣﻜﺎﻥ ﺭﺍ ﺩﺍﺭﺩ ﻛﻪ ﻣﻨﺎﺑﻌﻲ ﺭﺍ ﺍﺯ ﻳﻚ ﻣﺴﻴﺮ ﻣﻮﺟﻮﺩ ﺑﮕﻴﺮﺩ ﻭ ﺑﻪ ﻣﺴﻴﺮ ﺩﻳﮕﺮﻱ ﺩﻫﺪ. .٦ﺟﻤﻊ ﻛﺮﺩﻥ ﺟﺮﻳﺎﻧﻬﺎﻱ 3ﺗﺮﺍﻓﻴﻚ ﺑﻪ ﻳﻚ ﺟﺮﻳﺎﻥ ﺑﺰﺭﮔﺘﺮ
۳‐۱‐۴ﻗﺎﺑﻠﻴﺖ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ Mnsﺍﻧﻮﺍﻉ ﻣﺨﺘﻠﻒ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ )ﺑﻪ ﻋﺒﺎﺭﺕ ﺩﻳﮕﺮ Hashkin ،Shortest-dynamic ،Simple-Dynamic
ﻭ ( Makamﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ.
1
Setup Priority Holding Priority 3 Flow 2
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢-٤
٥٠‐٤
ﻣﻌﻤﺎري Mpls Network Simulator
NS-2ﺑﺮﺍﻱ ﺷﺒﻴﻪﺳﺎﺯﻱ ﺍﺟﺰﺍﺋﻲ ﻧﻈﻴﺮ ﺭﻭﺗﺮﻫﺎ ﻭ ﺳﺮﻭﺭﻫﺎ ﻭ ..ﺍﺯ ﻣﻔﻬﻮﻣﻲ ﺑﻪ ﻧﺎﻡ ﮔﺮﻩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ ﺍﺯ ﺁﻧﺠﺎﻳﻲ ﻛﻪ MPLSﺩﺭ ﺭﻭﺗﺮﻫﺎ ﻓﻌﺎﻝ ﻣﻲﺷﻮﺩ ،ﺩﺭ NSﻧﻴﺰ MPLSﻣﻲﺗﻮﺍﻧﺪ ﺩﺭ ﮔﺮﻫﻲ ﻓﻌﺎﻝ ﺷﻮﺩ؛ ﺩﺭ ﺍﻳﻦ ﺻﻮﺭﺕ ﺑﻪ ﺁﻥ ﮔﺮﻩ ﻣﺎﺟﻮﻟﻬﺎﻳﻲ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ MPLSﺍﺿﺎﻓﻪ ﻣﻲﺷﻮﺩ .ﮔﺮﻩ NS-2ﺷﺎﻣﻞ Agentﻫﺎ ﻭ Classifierﻫﺎ ﻣﻲﺑﺎﺷﺪAgent .ﻫﺎ ﺑﺮﺍﻱ ﺩﺭﻳﺎﻓﺖ ﻭ ﺍﺭﺳﺎﻝ ﭘﺮﻭﺗﻜﻞﻫﺎ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺍﮔﺮ ﮔﺮﻫﻲ ﺑﺨﻮﺍﻫﺪ ﺑﺎ ﭘﺮﻭﺗﻜﻞ TCPﺑﺴﺘﻪﻫﺎﻳﻲ ﺭﺍ ﺍﺭﺳﺎﻝ ﻛﻨﺪ ﺑﺎﻳﺪ Agentﻓﺮﺳﺘﻨﺪﻩ TCPﺩﺭ ﺁﻥ ﻓﻌﺎﻝ ﺷﻮﺩClassifier .ﻫﺎ ﻣﺴﺌﻮﻝ ﺩﺳﺘﻪﺑﻨﺪﻱ ﻛﺮﺩﻥ ﺑﺴﺘﻪﻫﺎ ﻫﺴﺘﻨﺪ .ﺍﮔﺮ MPLSﺩﺭ ﮔﺮﻫﻲ ﻓﻌﺎﻝ ﺷﻮﺩ ﺷﺊ ) MPLS Classifierﻣﺴﺌﻮﻝ ﻛﻼﺳﻪﺑﻨﺪﻱ ﻛﺮﺩﻥ ﺑﺴﺘﻪﻫﺎﻱ (MPLSﻭ ) LDP Agentﻣﺴﺌﻮﻝ ﺍﺭﺳﺎﻝ ﻭ ﺩﺭﻳﺎﻓﺖ ﭘﻴﻐﺎﻡﻫﺎﻱ (LDPﺩﺭ ﮔﺮﻩ ﻗﺮﺍﺭ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ. ﻣﺎﺟﻮﻝ MNSﺩﺍﺭﺍﻱ ﺳﺎﺧﺘﺎﺭﻫﺎﻳﻲ ﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ ﮔﻔﺘﻪ ﺷﺪﻩ ﻣﻲﺑﺎﺷﺪ ﺩﺭ ﺍﻳﻦ ﺑﺨﺶ ﺍﻳﻦ ﺳﺎﺧﺘﺎﺭﻫﺎ ﺭﺍ ﺷﺮﺡ ﻣﻲﺩﻫﻴﻢ.
١‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﮔﺮﻩ MPLSﺩﺭ MNS-V2ﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺩﺍﺭﺍﻱ ﻣﺪﻝ ﻣﻔﻬﻮﻣﻲ ﺑﻪ ﺻﻮﺭﺗﻲ ﻛﻪ ﺩﺭ ﺷﻜﻞ ‐۱ ۲ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ﻣﻲﺑﺎﺷﺪ .ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﺭ ﺷﻜﻞ ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ MNSﺍﺯﻣﺎﺟﻮﻝﻫﺎﻱ ﺯﻳﺮ ﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ: Resource Manager ،Admission Control ،Service Classifier ،MPLS-Classifier ،CR-LDP
ﻭ . Packet Schedulerﺩﺭ ﺍﺩﺍﻣﻪ ﻛﺎﺭﻫﺎﻳﻲ ﻛﻪ ﺍﻳﻦ ﻣﺎﺟﻮﻝﻫﺎ ،ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﻨﺪ ﺭﺍ ﺷﺮﺡ ﻣﻲﺩﻫﻴﻢ: •
:CR-LDﺍﻳﻦ ﻣﺎﺟﻮﻝ ﭘﻴﻐﺎﻡﻫﺎﻱ LDPﻭ CR-LDPﺭﺍ ﭘﺮﺩﺍﺯﺵ
ﻣﻲﻛﻨﺪ. •
:MPLS Classifierﺍﻳﻦ ﻣﺎﺟﻮﻝ ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ
)ﺗﺨﺼﻴﺺ ﺑﺮﭼﺴﺐ ،ﺑﺮﺩﺍﺷﺘﻦ ﺑﺮﭼﺴﺐ ﻭ ﺗﻌﻮﻳﺾ ﺑﺮﭼﺴﺐ( ﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
ﺷﻜﻞ ٢‐١ •
٥١‐٤
ﻣﺪﻝ ﻣﻔﻬﻮﻣﻲ ﮔﺮﻩ MPLSﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ
:Service Classifierﺳﺮﻭﻳﺴﻲ ﻛﻪ ﺑﺎﻳﺪ ﺑﻪ ﺑﺴﺘﻪ ﺍﻋﻤﺎﻝ ﺷﻮﺩ ﺭﺍ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻓﻴﻠﺪ TOS
ﺑﺴﺘﻪ ﻭ ﺑﺮﭼﺴﺐ MPLSﻣﺸﺨﺺ ﻣﻴـﻜﻨﺪ؛ ﻭ ﺁﻥ ﺭﺍ ﺑﻪ ﺑﺴﺘﻪ ﺍﻋﻤﺎﻝ ﻣﻲﻛﻨﺪ. • :Admission Cotrolﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﭘﺎﺭﺍﻣﺘﺮ ﺗﺮﺍﻓﻴﻚ CR-LDPﺑﺮﺭﺳﻲ ﻣﻲﻛﻨﺪ ﺁﻳﺎ ﻧﻮﺩ ،MPLSﻣﻨﺎﺑﻊ ﻛﺎﻓﻲ ﺑﺮﺍﻱ ﺳﺮﻭﻳﺲ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺭﺍ ﺩﺍﺭﺩ ﻳﺎ ﺧﻴﺮ. • :Resource Managerﺩﺭﺧﻮﺍﺳﺘﻬﺎﻱ ﻣﻨﺎﺑﻊ ﺭﺍ ﻣﺪﻳﺮﻳﺖ ﻣﻲﻛﻨﺪ. • :Packet Schedulerﺻﻒ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺳﺮﻭﻳﺲ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺁﻧﻬﺎ ﻣﺪﻳﺮﻳﺖ ﻣﻴـﻜﻨﺪ. ﻧﺤﻮﻩ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺗﻮﺳﻂ ﺍﻳﻦ ﻣﺎﺟﻮﻟﻬﺎ ﺑﻪ ﺍﻳﻦ ﺻﻮﺭﺕ ﺍﺳﺖ ﻛﻪ ﺍﺑﺘﺪﺍ ﺗﻮﺳﻂ ﭘﻴﻐﺎﻣﻬﺎﻱ CR-LDP ﭘﻴﻐﺎﻡ ﺭﺯﺭﻭ ﻣﻨﺎﺑﻊ ﺑﻪ ﮔﺮﻩ ﻣﻲﺁﻳﺪ ﺩﺭ ﺍﻳﻦ ﺻﻮﺭﺕ ﻣﺎﺟﻮﻝ Admssion Controlﻭ Resource Manager
ﺑﺮﺭﺳﻲ ﻣﻲﻛﻨﻨﺪ ﺍﮔﺮ ﻣﻨﺒﻊ ﻛﺎﻓﻲ ﺩﺭ ﺩﺳﺘﺮﺱ ﺍﺳﺖ ﺁﻥ ﺭﺍ ﺭﺯﺭﻭ ﻣﻲﻛﻨﻨﺪ ﻭ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ﻭ ﺳﺮﻭﻳﺲ ﺭﺍ ﺩﺭ ﺟﺪﻭﻟﻲ ﺑﻨﺎﻡ ERBﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﻨﺪ .ﺯﻣﺎﻧﻴﻜﻪ ﺑﺴﺘﻪﺍﻱ ﻣﺘﻌﻠﻖ ﺑﻪ ﺁﻥ ﻣﺴﻴﺮ ﺑﻪ ﮔﺮﻩ ﻭﺍﺭﺩ ﺷﺪ ﺗﻮﺳﻂ Service Classifierﺗﻌﻴﻴﻦ ﻣﻲﺷﻮﺩ ﻛﻪ ﭼﻪ ﺳﺮﻭﻳﺴﻲ ﺑﺎﻳﺪ ﺑﻪ ﺁﻥ ﺍﺭﺍﺋﻪ ﺷﻮﺩ ﻭ ﺳﭙﺲ ﺑﺴﺘﻪ ﺑﻪ Packet Scheduler
ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﺗﺎ ﺳﺮﻭﻳﺲ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺑﻪ ﺁﻥ ﺍﺭﺍﺋﻪ ﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٥٢‐٤
٢‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﮔﺮﻩ MPLSﺩﺍﺭﺍﻱ ﻣﻌﻤﺎﺭﻱ ﺷﻜﻞ ۲‐۱ﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﺍﺳﺖ .ﺯﻣﺎﻧﻲ ﻛﻪ ﺑﺴﺘﻪﺍﻱ ﺑﻪ ﮔﺮﻩ MPLSﻭﺍﺭﺩ ﻣﻲﺷﻮﺩ ﻛﺎﺭﻫﺎﻱ ﺯﻳﺮ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ:
ﺷﻜﻞ ٣‐١
ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ
MPLS Classifier .١ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ ﺁﻳﺎ ﺑﺴﺘﻪ ﺩﺍﺭﺍﻱ ﺑﺮﭼﺴﺐ MPLSﻫﺴﺖ ﻳﺎ ﺧﻴﺮ .ﺍﮔﺮ ﺑﺴﺘﻪ ﺩﺍﺭﺍﻱ ﺑﺮﭼﺴﺐ ﺑﺎﺷﺪ ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﺭﺍ ﺭﻭﻱ ﺁﻥ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ .ﻭﮔﺮﻧﻪ ﺑﺮﺭﺳﻲ ﻣﻲﻛﻨﺪ ﺍﮔﺮ ﺑﺴﺘﻪ ﻣﺮﺑﻮﻁ ﺑﻪ LSPﺧﺎﺻﻲ ﺍﺳﺖ ﺑﺎ ﺁﻥ ﻣﺎﻧﻨﺪ ﺑﺴﺘﻪ ﺑﺮﭼﺴﺐ ﺩﺍﺭ ﺭﻓﺘﺎﺭ ﻣﻲﻛﻨﺪ ﻭ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﺭﺍ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻣﺸﺨﺼﻪ LSPﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ؛ ﻭ ﺩﺭ ﻏﻴﺮ ﺍﻳﻦﺻﻮﺭﺕ ﺑﺴﺘﻪ ﺭﺍ ﺑﻪ Addr Classifierﻣﻲﺩﻫﺪ. Addr Classifier .٢ﺍﺯ ﭘﺮﻭﺗﻜﻞ ﻻﻳﻪ ۳ﺑﺮﺍﻱ ﻫﺪﺍﻳﺖ ﺑﺴﺘﻪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ. .٣ﺍﮔﺮ ﻣﻘﺼﺪ ﺑﺴﺘﻪ ﻫﻤﻴﻦ ﮔﺮﻩ ﺑﺎﺷﺪ ﺑﺴﺘﻪ ﺑﻪ Port Classifierﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﺗﺎ ﺑﺮ ﺣﺴﺐ ﭘﺮﻭﺗﻜﻞ ﻻﻳﻪ ۴ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺑﺎ ﺁﻥ ﺭﻓﺘﺎﺭ ﮔﺮﺩﺩ. MNSﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ﺍﺯ ﺩﻭ ﺟﺪﻭﻝ LIB١ﻭ PFT2ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﺍﻳﻦ ﺟﺪﺍﻭﻝ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﺗﻌﺮﻳﻒ ﺷﺪﻩﺍﻧﺪ:
Lable Information Base Partial Forwarding Table
1 2
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
•
٥٣‐٤
:LIBﺍﻳﻦ ﺟﺪﻭﻝ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ LSPﻫﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺍﻋﻤﺎﻝ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺴﺘﻪﻫﺎﻱ ﺑﺮﭼﺴﺐﺩﺍﺭ
ﺗﻮﺳﻂ ﺍﻳﻦ ﺟﺪﻭﻝ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ .ﻓﻴﻠﺪﻫﺎﻱ ﺍﻳﻦ ﺟﺪﻭﻝ ﺷﺎﻣﻞ ﺑﺮﭼﺴﺐ ﻭﺭﻭﺩﻱ ،ﭘﻮﺭﺕ ﻭﺭﻭﺩﻱ ،ﺑﺮﭼﺴﺐ ﺧﺮﻭﺟﻲ ﻭ ﭘﻮﺭﺕ ﺧﺮﻭﺟﻲ ﻣﻲﺑﺎﺷﺪ. •
:PFTﺍﻳﻦ ﺟﺪﻭﻝ ﺩﺭ LSRﻭﺭﻭﺩﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺗﻮﺳﻂ ﺁﻥ ﺑﺴﺘﻪﻫﺎﻱ IPﺑﻪ LSPﻫﺎ ﻧﮕﺎﺷﺖ
ﻣﻲﺷﻮﻧﺪ .ﻓﻴﻠﺪﻫﺎﻱ ﺍﻳﻦ ﺟﺪﻭﻝ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ LIBPtr ،FEC :ﻭ .FlowIdﺗﻮﺳﻂ ﻓﻴﻠﺪ FlowIdﻭ FEC
ﻣﺸﺨﺺ ﻣﻲﺷﻮﺩ ﺑﺴﺘﻪ ﺑﺎ ﻓﻴﻠﺪ FlowIdﺑﻪ ﭼﻪ FECﺑﺎﻳﺪ ﻧﮕﺎﺷﺖ ﺷﻮﺩ ﻭ ﺩﺭ ﻭﺍﻗﻊ LSPﻛﻪ ﺑﺴﺘﻪ ﺑﻪ ﺁﻥ ﻣﺘﻌﻠﻖ ﺍﺳﺖ ﺗﻌﻴﻴﻦ ﻣﻲﮔﺮﺩﺩ ﻭ ﺗﻮﺳﻂ ﻓﻴﻠﺪ LIBPtrﺗﻌﻴﻴﻦ ﻣﻲﺷﻮﺩ ﻛﻪ ﻣﺸﺨﺼﺎﺕ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺍﻳﻦ LSPﺩﺭ ﻛﺪﺍﻡ ﺭﻛﻮﺭﺩ ﺟﺪﻭﻝ LIBﻣﻮﺟﻮﺩ ﺍﺳﺖ.
٣‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺗﺮﺍﻓﻴﻚ ﺑﻲﺩﺭﻧﮓ MNSﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺗﺮﺍﻓﻴﻚ ﺑﻼﺩﺭﻧﮓ ﺍﺯ ﻣﺎﺟﻮﻝ Service Classifierﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﺍﻳﻦ ﻣﺎﺟﻮﻝ ﺳﺮﻭﻳﺲﻫﺎﻳﻲ ﻛﻪ ﺑﺎﻳﺪ ﺑﻪ ﺑﺴﺘﻪ ﺍﻋﻤﺎﻝ ﺷﻮﺩ ﺭﺍ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ ﻭ ﺳﭙﺲ ﺑﺴﺘﻪ ﺑﻪ ﻣﺎﺟﻮﻝ
Packet
Schedulerﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﺗﺎ ﺳﺮﻭﻳﺲ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺑﻪ ﺁﻥ ﺍﻋﻤﺎﻝ ﺷﻮﺩ .ﻣﻜﺎﻧﻴﺰﻡ CBQﻛﻪ ﺩﺭ NS-2ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﺑﺮﺍﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﻭ ﺳﺮﻭﻳﺲ ﺩﺍﺩﻥ ﺑﺴﺘﻪﻫﺎ ﺍﻧﺘﺨﺎﺏ ﺷﺪﻩ ﺍﺳﺖ .ﺩﺭ ﺩﻧﻴﺎﻱ ﻭﺍﻗﻌﻲ Packet Schedulerﺩﺭ ﺭﻭﺗﺮﻫﺎ ﺍﺟﺮﺍ ﻣﻲﺷﻮﺩ ﻭﻟﻲ ﺩﺭ MNSﺍﻳﻦ ﻋﻤﻞ ﺭﻭﻱ ﻟﻴﻨﻜﻬﺎ ﭘﻴﺎﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ. ﻣﺎﺟﻮﻝ Service Classifierﺑﺮﺍﻱ ﺗﻌﻴﻴﻦ ﺳﺮﻭﻳﺲﻫﺎ ﺍﺯ ﺟﺪﻭﻟﻲ ﺑﻨﺎﻡ ١ERBﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﺍﻳﻦ ﺟﺪﻭﻝ ﺷﺎﻣﻞ ﺍﻃﻼﻋﺎﺗﻲ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ﺻﺮﻳﺢ) (LSPIdﻭ ﻣﺸﺨﺼﻪ ﺳﺮﻭﻳﺲ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺴﻴﺮ)(ServiceId ﻣﻲﺑﺎﺷﺪ.
Explicit Route Information Base
1
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
ﺷﻜﻞ ۴‐۱
٥٤‐٤
ﺭﻭﻧﺪ ﭘﺮﺩﺍﺯﺵ MNSﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺗﺮﺍﻓﻴﻚ ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ
ﺷﻜﻞ ۴‐۱ﺭﻭﻧﺪ ﭘﺮﺩﺍﺯﺵ ﺗﺮﺍﻓﻴﻚ ﺩﺭ MNSﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ .ﺯﻣﺎﻧﻴﻜﻪ ﺑﺴﺘﻪﺍﻱ ﺑﻪ ﮔﺮﻩ MPLSﻭﺍﺭﺩ ﻣﻲﺷﻮﺩ ﺍﺑﺘﺪﺍ ﺑﻪ ﻗﺴﻤﺖ MPLS Classifierﻣﻲﺭﻭﺩ ﻭ ﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﺑﺮﺟﺴﺐ ﺧﺮﻭﺟﻲ ﻭ ﭘﻮﺭﺗﻲ ﻛﻪ ﺍﺯ ﺁﻥ ﺑﺎﻳﺪ ﺧﺎﺭﺝ ﺷﻮﺩ ﻣﺸﺨﺺ ﻣﻲﮔﺮﺩﺩ .ﺳﭙﺲ ﻣﺎﺟﻮﻝ Service Classifierﺳﺮﻭﻳﺲ ﺑﺴﺘﻪ ﺭﺍ ﺍﺯ ﻃﺮﻳﻖ ﺟﺪﻭﻝ ERBﻣﻌﻴﻦ ﻣﻲﻛﻨﺪ .ﺳﭙﺲ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻨﻜﻪ ﺑﺴﺘﻪ ﺑﻪ ﻛﺪﺍﻡ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﻣﺘﻌﻠﻖ ﺍﺳﺖ ﺑﻪ ﻳﻚ ﺻﻒ ﻣﻨﺎﺳﺐ ﺩﺭ ﺑﺎﻓﺮ CBQﻭﺍﺭﺩ ﻣﻲﺷﻮﺩ .ﻭ ﺩﺭ ﻧﻬﺎﻳﺖ ﺍﺯ ﻃﺮﻳﻖ CBQﺑﻪ ﺁﻥ ﺳﺮﻭﻳﺲ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ.
٤‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﺭﺯﺭﻭ ﻣﻨﺎﺑﻊ ﺷﻜﻞ ۵‐۱ﺭﻭﻧﺪ ﺍﻧﺠﺎﻡ ﺭﺯﺭﻭ ﻣﻨﺎﺑﻊ ﺭﺍ ﺩﺭ MNSﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ .ﺯﻣﺎﻧﻴﻜﻪ ﻣﺎﺟﻮﻝ CR-LDPﭘﻴﻐﺎﻡ ﺩﺭﺧﻮﺍﺳﺖ "CR-LDPﺭﺍ ﺩﺭﻳﺎﻓﺖ ﻣﻲﻛﻨﺪ ﻣﺎﺟﻮﻝ Admission Controlﺭﺍ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﻛﻨﺪ .ﻣﺎﺟﻮﻝ ﺑﺮﺭﺳﻲ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٥٥‐٤
ﺷﻜﻞ ۵‐۱
ﺭﻭﻧﺪ ﺭﺯﺭﻭ ﻣﻨﺎﺑﻊ ﺩﺭ MNS
ﻣﻲﻛﻨﺪ ﻛﻪ ﺁﻳﺎ ﮔﺮﻩ ،ﻣﻨﺎﺑﻊ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺭﺍ ﺩﺭ ﺩﺳﺘﺮﺱ ﺩﺍﺭﺩ ﻳﺎ ﺧﻴﺮ .ﺍﮔﺮ ﻣﻨﺎﺑﻊ ﻛﺎﻓﻲ ﺩﺭ ﺩﺳﺘﺮﺱ ﺑﻮﺩﻧﺪ. ﻣﻨﺎﺑﻊ ﺩﺭﺧﻮﺍﺳﺘﻲ ﺭﺍ ﺭﺯﺭﻭ ﻣﻲﻛﻨﺪ ،ﺟﺪﻭﻝ ﻣﺮﺑﻮﻁ ﺑﻪ ﺍﻃﻼﻋﺎﺕ ﻣﻨﺎﺑﻊ ﺭﺍ ﺑﻪ ﺭﻭﺯ ﺩﺭ ﻣﻲﺁﻭﺭﺩ ﻭ ﭘﻴﻐﺎﻡ CR-LDP
ﺭﺍ ﺑﻪ ﮔﺮﻩ ﺑﻌﺪﻱ ﺍﺭﺳﺎﻝ ﻣﻲﻛﻨﺪ. ﺯﻣﺎﻧﻴﻜﻪ ﻣﺎﺟﻮﻝ CR-LDPﭘﻴﻐﺎﻡ " "CR-LDP Mappingﺭﺍ ﺩﺭﻳﺎﻓﺖ ﻣﻲﻛﻨﺪ ،ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺑﺮﭼﺴﺐ ﻭ ﭘﻮﺭﺕ ﺭﺍ ﺩﺭ ﺟﺪﻭﻝ LIBﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ ﻭ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺭﺍ ﺩﺭ ﺟﺪﻭﻝ ERBﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ .ﺳﭙﺲ ﻣﺎﺟﻮﻝ Resource Managerﺭﺍ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﻛﻨﺪ ﺗﺎ ﺻﻔﻲ ﺑﺮﺍﻱ ﺳﺮﻭﻳﺲ ﺩﺍﺩﻥ ﺑﻪ ﻣﺴﻴﺮ ﺩﺭﺧﻮﺍﺳﺖ ﺷﺪﻩ ﺍﻳﺠﺎﺩ ﻛﻨﺪ ﻭ ﭘﺲ ﺍﺯ ﺍﻧﺠﺎﻡ ﺍﻳﻨﻜﺎﺭ ﻣﺸﺨﺼﻪ ﺳﺮﻭﻳﺲ ﺍﻳﺠﺎﺩ ﺷﺪﻩ ﺭﺍ ﺩﺭ ﺟﺪﻭﻝ ERBﺫﺧﻴﺮﻩ ﻣﻲﻛﻨﺪ .ﻭ ﺩﺭ ﻧﻬﺎﻳﺖ ﭘﻴﻐﺎﻡ “ ”CR-LDPﺑﻪ ﮔﺮﺓ ﻗﺒﻠﻲ ﻓﺮﺳﺘﺎﺩﻩ ﻣﻲﺷﻮﺩ.
٥‐٢‐٤ﺳﻄﻮﺡ ﺳﺮﻭﻳﺲ ﺩﺭ MNS MNSﭼﻬﺎﺭ ﺳﺮﻭﻳﺲ HBT3 ،ST2 ،١RTﻭ SBT4ﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ .ﺍﻭﻟﻮﻳﺖ ﺍﻳﻦ ﺳﺮﻭﻳﺲﻫﺎ ﺍﺯ ﺭﺍﺳﺖ ﺑﻪ ﭼﭗ ﺍﺳﺖ .ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻨﻜﻪ MNSﺍﺯ ﻣﻜﺎﻧﻴﺰﻡ ﺻﻒ CBQﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ ،ﺍﺯ ﺳﻪ ﺳﻄﺢ ﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﺳﺮﻭﻳﺲ ﺑﻪ ﺍﻳﻦ ﻛﻼﺳﻬﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﺷﻜﻞ ۶‐۱ﺍﻳﻦ ﻣﺴﺌﻠﻪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ. 1
Real Traffic Signaling Traffic 3 High Best Effort Traffic 4 Simple Best Effort Traffic 2
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٥٦‐٤
ﺷﻜﻞ ٦‐١
ﻧﻤﺎﻳﺶ ﺳﻄﻮﺡ ﻛﻼﺱ ﺩﺭ MNS
ﻣﻲﺗﻮﺍﻥ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ CBQﻧﻈﻴﺮ ﻧﺮﺥ ﺗﺮﺍﻓﻴﻚ ،ﺍﻧﺪﺍﺯﻩ ﺑﺎﻓﺮ ﻭ ...ﺭﺍ ﺑﺮﺍﻱ ﻫﺮ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻧﻤﻮﺩ. ﻛﻼﺳﻬﺎﻱ HBT ،STﻭ SBTﺑﻪ ﻃﻮﺭ ﺍﻳﺴﺘﺎ ﺩﺭ ﺯﻣﺎﻥ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﺤﻴﻂ ﺷﺒﻴﻪ ﺳﺎﺯﻱ ﺍﻳﺠﺎﺩ ﻣﻲﺷﻮﻧﺪ .ﻭﻟﻲ ﺻﻔﻬﺎﻱ RTﺑﻪ ﻃﻮﺭ ﭘﻮﻳﺎ ﻭ ﺑﺎ ﺁﻣﺪﻥ ﭘﻴﻐﺎﻣـﻬﺎﻱ CR-LDPﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﻧﺪ. ﺩﺭ CBQﻣﻲﺗﻮﺍﻥ ﻣﺸﺨﺺ ﻧﻤﻮﺩ ﻛﻪ ﺑﻪ ﻫﺮ ﻛﺪﺍﻡ ﺍﺯ ﻛﻼﺳﻬﺎ ﭼﻪ ﺩﺭﺻﺪﻱ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺑﺎﻳﺪ ﺍﺧﺘﺼﺎﺹ ﺩﺍﺩﻩ ﺷﻮﺩ .ﻭ ﺳﭙﺲ ﺩﺭ ﻫﺮ ﻛﻼﺱ ﻣﻲﺗﻮﺍﻥ ﺑﻪ ﺗﺮﺍﻓﻴﻚﻫﺎ ﺍﻭﻟﻮﻳﺖ ﺩﺍﺩ .ﻛﻪ ﺩﺭ ﺍﻳﻦ ﻣﻮﺭﺩ ﺩﺭ ﻛﻼﺱ ، BTﺗﺮﺍﻓﻴﻚ HBTﻧﺴﺒﺖ ﺑﻪ SBTﺍﻭﻟﻮﻳﺖ ﺩﺍﺭﺩ .ﻳﻌﻨﻲ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺑﺮﺍﻱ ﻛﻼﺱ BTﺍﺑﺘﺪﺍ ﺑﻪ ﺗﺮﺍﻓﻴﻚ HBTﺳﺮﻭﻳﺲ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺍﺯ ﺑﻘﻴﻪ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺑﻪ SBTﺳﺮﻭﻳﺲ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ. ﺑﺮﺍﻱ ﺳﺮﻭﻳﺲﺩﻫﻲ ﺑﻪ ﺟﺮﻳﺎﻧﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﻣﺨﺘﻠﻒ ﺩﺭ ﻛﻼﺱ RTﺩﻭ ﭘﺎﺭﺍﻣﺘﺮ ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﻛﻪ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﻳﻦ ﺩﻭ ﭘﺎﺭﺍﻣﺘﺮﻣﻲﺗﻮﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺭﺍ ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻚﻫﺎﻱ ﺍﻳﻦ ﻛﻼﺱ ﻣﺪﻳﺮﻳﺖ ﻧﻤﻮﺩ .ﺍﻳﻦ ﺩﻭ ﭘﺎﺭﺍﻣﺘﺮ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ "ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ" ﻭ "ﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺍﺭﻱ" .ﺍﮔﺮ ﻣﻘﺪﺍﺭ ﭘﺎﺭﺍﻣﺘﺮ ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ﺗﺮﺍﻓﻴﻜﻲ ﺍﺯ ﺗﺮﺍﻓﻴﻚ ﻣﻮﺟﻮﺩ ﻛﻤﺘﺮ ﺑﺎﺷﺪ )ﺑﻪ ﻋﺒﺎﺭﺕ ﺩﻳﮕﺮ ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ﺁﻥ ﺑﻴﺸﺘﺮ ﺑﺎﺷﺪ( ﻭ ﺑﺨﻮﺍﻫﺪ ﺳﺮﻭﻳﺲ ﺑﮕﻴﺮﺩ ﺳﺮﻭﻳﺲ ﺍﺯ ﻗﺒﻠﻲ ﮔﺮﻓﺘﻪ ﺷﺪﻩ ﻭ ﺑﻪ ﺗﺮﺍﻓﻴﻚ ﺟﺪﻳﺪ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ.
٦‐٢‐٤ﻣﻌﻤﺎﺭﻱ MNSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ MPLSﺑﺎﺯﻳﺎﺑﻲ ﻭ ﻣﺤﺎﻓﻈﺖ ﺍﺯ ﻣﺴﻴﺮ ﺭﺍ ﺑﺮﺍﻱ ﻧﻴﻞ ﺑﻪ ﺍﻫﺪﺍﻑ ﺯﻳﺮ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ: •
ﺑﻪ ﻣﻨﻈﻮﺭ ﻓﺮﺍﻫﻢ ﻛﺮﺩﻥ ﻳﻚ ﺳﺮﻭﻳﺲ ﻣﻄﻤﺌﻦ ﺑﺮﺍﻱ ﺣﻤﻞ ﺗﺮﺍﻓﻴﻚ ﺭﻭﻱ ﺷﺒﻜﻪ
MPLS
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2 •
٥٧‐٤
ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﻧﺠﺎﻡ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺩﺭ LSPﻛﻪ ﺧﺮﺍﺑﻲ ﺩﺭ ﺁﻥ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﺍﺳﺖ.
ﺩ ﺭﺍﻳﻦ ﻗﺴﻤﺖ ﻗﺎﺑﻠﻴﺖ MNSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺗﺸﺮﻳﺢ ﻣﻲﺷﻮﺩ: ﺩﺭ ﺑﺎﺯﻳﺎﺑﻲ ﻭ ﻣﺤﺎﻓﻈﺖ ﻣﺴﻴﺮ ﺑﻪ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﻛﻪ ﺑﺎﻳﺪ ﺍﺯ ﺁﻥ ﻣﺤﺎﻓﻈﺖ ﺷﻮﺩ ﺍﺻﻄﻼﺣﺎ path
)Working(primary
ﮔﻔﺘﻪ ﻣﻲﺷﻮﺩ ﻭ ﺑﻪ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻛﻪ ﺑﺮﺍﻱ ﻣﺤﺎﻓﻈﺖ ﺍﺯ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ
Backup(alternative) Pathﮔﻔﺘﻪ ﻣﻲﺷﻮﺩ. MNSﺍﺯ ﺩﻭ ﺗﻜﻨﻴﻚ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﺤﺎﻓﻈﺖ ١ﺍﺯ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ:
:Dynamic Protection ﺑﺎ ﺍﻳﻦ ﺭﻭﺵ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻳﻚ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ،ﺑﻌﺪ ﺍﺯ ﺍﻳﻨﻜﻪ ﺧﺮﺍﺑﻲ ﺩﺭ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩ ،ﺳﺎﺧﺘﻪ
ﻣﻲﺷﻮﺩ
:Pre-negotiated
ﺩﺭ ﺍﻳﻦ ﺭﻭﺵ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﭘﻴﺸﺎﭘﻴﺶ ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﻫﻤﭽﻨﻴﻦ ﺗﻌﻤﻴﺮ ٢ﻣﺴﻴﺮ ﺧﺮﺍﺏ ﺷﺪﻩ ﺑﻪ ﺩﻭ ﺭﻭﺵ ﺍﻣﻜﺎﻥﭘﺬﻳﺮ ﺍﺳﺖ:
:Global repair
ﺩﺭ ﺍﻳﻦ ﺭﻭﺵ ﺍﺻﻼﺡ ﺑﻴﻦ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ)ﺑﻪ ﻋﺒﺎﺭﺕ ﺩﻳﮕﺮ ﺭﻭﺗﺮ Ingressﻭ (Egress
:Local repair
ﺩﺭ ﺍﻳﻦ ﺭﻭﺵ ﺗﻌﻤﻴﺮ ﻣﺴﻴﺮ ﺑﻴﻦ ﺩﻭ ﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺁﻧﻬﺎ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﺍﺳﺖ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ. ﭼﻨﺪﻳﻦ ﺭﻭﺵ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﻛﻪ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ ،Shortest-Dynamic ،Simple-Dynamic : Makam، Hashkinﻭ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻻﻳﻪ . ٣ﺟﺪﻭﻝ ﺯﻳﺮ ﺭﻭﺷﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﻭ ﺗﻜﻨﻴﻜﻬﺎﻳﻲ ﻛﻪ ﺑﺮﺍﻱ ﻧﻮﻉ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻭ ﺗﻌﻤﻴﺮ ﻣﺴﻴﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻨﺪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ) .ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ Shortest-dynmic , L3ﺍﺯ ﻧﻈﺮ ﺗﻜﻨﻴﻚ ﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﺎﻧﻨﺪ ﺭﻭﺵ Simple-dynamicﻋﻤﻞ ﻣﻲﻛﻨﻨﺪ( Protection configuration Repair Activation
1 2
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٥٨‐٤
ﺷﻜﻞ ۷‐۱ﻣﻌﻤﺎﺭﻱ ﮔﺮﻩ MPLSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ
ﺷﻜﻞ ۷‐۱
ﻣﻌﻤﺎﺭﻱ ﮔﺮﻩ MPLSﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺑﺎﺯﻳﺎﺑﻲ ﻣﺴﻴﺮ
ﻣﺎﺟﻮﻝ Link-Failure-Detectorﻭﺿﻌﻴﺖ ﻟﻴﻨﻜﻬﺎ ﺭﺍ ﻣﺎﻧﻴﺘﻮﺭ ﻣﻲﻛﻨﺪ ﻭ ﺩﺭ ﺻﻮﺭﺕ ﻣﺸﺎﻫﺪﺓ ﺧﺮﺍﺑﻲ ﻳﺎ ﺑﺮﻃﺮﻑ ﺷﺪﻥ ﺧﺮﺍﺑﻲ ﺁﻥ ﺭﺍ ﺑﻪ MPLS Classifierﻭ Reroute Action Triggerﺍﻃﻼﻉ ﻣﻲﺩﻫﺪ. Reroute Action Triggerﺩﺭ ﺭﻭﺷﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺩﻳﻨﺎﻣﻴﻚ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺭﻭﺵ ﻛﺎﺭ ﺁﻥ ﺑﻪ ﺍﻳﻦ ﺻﻮﺭﺕ ﺍﺳﺖ ﻛﻪ ﺍﮔﺮ ﻭﺿﻌﻴﺖ ﻳﻚ ﻟﻴﻨﻚ ﺍﺯ ﺣﺎﻟﺖ ﺳﺎﻟﻢ ﺑﻪ ﺧﺮﺍﺑﻲ ﺗﻐﻴﻴﺮ ﻛﻨﺪ ﻳﻚ ﻣﺴﻴﺮ ﺟﺪﻳﺪ ﭘﺸﺘﻴﺒﺎﻥ ﻣﻲﺳﺎﺯﺩ ﻭ ﺍﮔﺮ ﻭﺿﻌﻴﺖ ﺧﺮﺍﺑﻲ ﻳﻚ ﻟﻴﻨﻚ ﺑﺮﻃﺮﻑ ﺷﻮﺩ ،ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺭﺍ ﺣﺬﻑ ﻣﻲﻧﻤﺎﻳﺪ. ﺩﺭ ﺯﻳﺮ ﺍﻟﮕﻮﻫﺎﻱ ﺭﻭﺷﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺗﺸﺮﻳﺢ ﻣﻲﺷﻮﻧﺪ.
ﺭﻭﺵ Hashkins
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٥٩‐٤
ﺍﻟﮕﻮﻱ ﺍﻳﻦ ﺭﻭﺵ ﺩﺭﺷﻜﻞ ۸‐۱ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ:
ﺭﺍﻩ ﺍﻧﺪﺍﺯﻱ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺩﺭ ﺭﻭﺗﺮ :PIL
ﻣﺰﺍﻳﺎ:
‐۱ﻳﻚ LSPﺑﻴﻦ ﺭﻭﺗﺮ PILﻭ PMLﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ‐۲ﻳﻚ LSPﺑﻴﻦ ﺭﻭﺗﺮ PMLﻭ PILﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ )ﺑﺪﻭﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻫﻴﭻ ﻣﺴﻴﺮ ﺍﺻﻠﻲ( ‐۳ﺩﻭ LSPﺑﻪ ﻫﻢ ﻟﻴﻨﻚ ﻣﻲﺷﻮﻧﺪ .ﻭ ﺗﻤﺎﻡ ﮔﺮﻩ ﻫﺎ ﺩﺭ ﻃﻮﻝ
ﻣﺴﻴﺮﻳﺎﺑﻲ ﺭﺍ ﺑﻪ ﻃﻮﺭ ﺳﺮﻳﻊ ﺍﻧﺠﺎﻡ ﻣﻲ ﺩﻫﺪ.
ﻣﻌﺎﻳﺐ :
ﺑﻌﺪ ﺍﺯ ﺍﻳﻨﻜﻪ ﻣﺸﻜﻞ ﺧﺮﺍﺑﻲ ﺑﺮﻃﺮﻑ ﺷﺪ ﻭ ﺑﺴﺘﻪ ﻫﺎ ﺧﻮﺍﺳﺘﻨﺪ ﺍﺯ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺑﻪ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺳﻮﺋﻴﭻ
ﻣﺴﻴﺮ PML → PILﺑﻪ ﻣﺴﻴﺮ PIL → PML
ﻛﻨﻨﺪ ﻣﺴﺌﻠﻪ ﺩﻭﺑﺎﺭﻩ ﻣﺮﺗﺐ ﻛﺮﺩﻥ ﺑﺴﺘﻪﻫﺎﺑﻮﺟﻮﺩﻣﻲﺁﻳﺪ
ﻣﺘﺼﻞ ﻣﻲﺷﻮﻧﺪ
ﺷﻜﻞ ۸‐۱
ﺍﻟﮕﻮﻱ Hashkin
ﺍﻟﮕﻮﻱ Makam
ﺩﺭ ۰ﺍﻟﮕﻮﻱ Mackamﻧﺸﺎﻥ ﺩﺍﺩ ﺷﺪﻩ ﺍﺳﺖ.
ﻣﺰﺍﻳﺎ :ﺍﻏﻠﺐ ﻣﺴﺌﻠﻪ ﺩﻭﺑﺎﺭﻩ ﻣﺮﺗﺐ ﻛﺮﺩﻥ ﺑﺴﺘﻪ ﻫﺎ
•
ﺍﺗﻔﺎﻕ ﻧﻤﻲﺍﻓﺘﺪ.
‐۱ﻳﻚ LSPﺑﻴﻦ ﮔﺮﻩ PILﻭ PMLﺳﺎﺧﺘﻪﻣﻲﺷﻮﺩ.
ﻣﻌﺎﻳﺐ :ﺩﺭ ﺯﻣﺎﻥ ﺍﺭﺳﺎﻝ ﭘﻴﻐﺎﻡ Notificationﺑﻪ
‐۲ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ Notification Messageﺑﻪ PIL
PILﺗﻌﺪﺍﺩﻱ ﺑﺴﺘﻪ ﮔﻢ ﻣﻲﺷﻮﺩ.
ﺧﺒﺮ ﺑﺎﺯﻳﺎﺑﻲ ﻭ ﺧﺮﺍﺑﻲ ﻣﺴﻴﺮ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ
ﺭﺍﻩﺍﻧﺪﺍﺯﻱ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٠‐٤
ﺷﻜﻞ ۹‐۱
ﺍﻟﮕﻮﻱ Makam
ﺭﻭﺵ Simple-Dynamic
ﺍﻟﮕﻮﻱ ﺍﻳﻦ ﺭﻭﺵ ﺩﺭ ﺷﻜﻞ ۱۰‐۱ﺁﻣﺪﻩ ﺍﺳﺖ.
ﻣﺰﺍﻳﺎ :ﺑﻬﺮﻩﻭﺭﻱ ﻣﻨﺎﺑﻊ
ﺭﺍﻩﺍﻧﺪﺍﺯﻱ LSPﭘﺸﺘﻴﺒﺎﻥ
ﻣﻌﺎﻳﺐ :ﺯﻣﺎﻥ ﺭﺍﻩﺍﻧﺪﺍﺯﻱ LSPﺑﺴﻴﺎﺭ ﻃﻮﻻﻧﻲ
ﺑﻌﺪ ﺍﺯ ﺍﻳﻨﻜﻪ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩ ﻳﻚ ﻣﺴﻴﺮ ﺑﻴﻦ ﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺍﻥ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﺍﺳﺖ ﻭ PML
ﺍﺳﺖ.
ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﺷﻜﻞ ۱۰‐۱ﺍﻟﮕﻮﻱ ﺭﻭﺵ Simple-dynamic
ﺭﻭﺵ Shortest-dynamicﻭ L3ﻣﺎﻧﻨﺪ ﺭﻭﺵ Simple-dynamicﺍﺳﺖ ﺑﻪ ﺟﺰ ﺍﻳﻨﻜﻪ ﺩﺭ ﺭﻭﺵ Shortest-dynamicﻳﻚ ﻣﺴﻴﺮ ﺑﻴﻦ ﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺁﻥ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﻭ ﮔﺮﻩ ﺑﻌﺪﻱ ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ)ﺩﺭ ﺻﻮﺭﺗﻴﻜﻪ ﻟﻴﻨﻚ ﺩﻳﮕﺮﻱ ﺑﻴﻦ ﺁﻧﻬﺎ ﺑﺮﻗﺮﺍﺭ ﻧﺒﺎﺷﺪ( ﻭ ﺩﺭ ﺻﻮﺭﺕ ﺑﺮﻭﺯ ﺧﺮﺍﺑﻲ ﺍﺯ ﺟﺪﻭﻝ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻻﻳﻪ ٣ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮ ﺟﺪﻳﺪﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣-٤
٦١‐٤
واﺳﻂهﺎي ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﺲ ﺑﺮاي اﺳﺘﻔﺎدﻩ از ﺷﺒﻴﻪﺳﺎز MNS
ﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﺍﺑﺘﺪﺍ ﻭﺍﺳﻄﻬﺎﻱ ﻣﻮﺟﻮﺩ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺩﺭ ﺍﺳﻜﺮﻳﭙﺖ TCLﺑﻴﺎﻥ ﻣﻲﺷﻮﻧﺪ ﻭ ﺳﭙﺲ ﺑﺎ ﻣﺜﺎﻟﻬﺎﻳﻲ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ ﻣﺨﺘﻠﻒ MNSﺷﺮﺡ ﺩﺍﺩﻩ ﻣﻲﺷﻮﻧﺪ.
١‐٣‐٤ﻓﺮﻣﺎﻧﻬﺎﻱ ﻭﺍﺳﻂ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺩﺭ NS-2 $ns mpls-node
•
ﻳﻚ ﮔﺮﻩ ﺟﺪﻳﺪ MPLSﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﺪ ﻭ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﺁﻥ ﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ: ]set Lsr1 [$ns mpls-node $ns configure-ldp-on-all-mpls-nodes
•
ldp agentﺭﺍ ﺭﻭﻱ ﻫﻤﻪ ﮔﺮﻫﻬﺎﻱ MPLSﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﺪ.
ﻧﻜﺘﻪ :ﺩﺭ ﺑﻌﻀﻲ ﺍﺯ ﺩﺳﺘﻮﺭﺍﺕ ﻧﻴﺎﺯ ﺍﺳﺖ ﺭﻭﻱ ﻣﺎﺟﻮﻝ MPLSﮔﺮﻩ ﻛﺎﺭﺍﻫﺎﻳﻲ ﺻﻮﺭﺕ ﮔﻴﺮﺩ .ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﻧﻴﺎﺯ ﺍﺳﺖ ﺍﺑﺘﺪﺍ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﻣﺎﺟﻮﻝ MPLSﮔﺮﻩ ﺑﺪﺳﺖ ﺁﻳﺪ .ﺑﻮﺳﻴﻠﻪ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻣﻲﺗﻮﺍﻥ ﺍﺷﺎﺭﻩﮔﺮ ﺑﻪ ﻣﺎﺟﻮﻝ MPLSﮔﺮﻩ LSR1ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﺩ: ]”Set MPLSnode [$lsr1 get-module “MPLS
ﺑﻨﺎﺑﺮﺍﻳﻦ ﺩﺭ ﺑﻘﻴﻪ ﺩﺳﺘﻮﺭﺍﺕ ﻣﻨﻈﻮﺭ ﺍﺯ ﮔﺮﻩ MPLSnodeﻣﺎﺟﻮﻝ MPLSﻳﻚ ﮔﺮﻩ ﺍﺯ ﻧﻮﻉ MPLSﺍﺳﺖ.
$MPLSnode enable-control-driven
•
ﮔﺮﻩ MPLSﺑﻪ ﺭﻭﺵ control-drivenﺑﺮﭼﺴﺐﻫﺎ ﺭﺍ ﺗﻮﺯﻳﻊ ﻣﻲﻛﻨﺪ. $MPLSnode enable-data-driven
•
ﮔﺮﻩ MPLSﺑﻪ ﺭﻭﺵ data-drivenﺑﺮﭼﺴﺐﻫﺎ ﺭﺍ ﺗﻮﺯﻳﻊ ﻣﻲﻛﻨﺪ. $MPLSnode enable-on-demand
•
ﮔﺮﻩ MPLSﺩﺭ ﻣﺪ on-demandﻗﺮﺍﺭ ﻣﻲﻛﻴﺮﺩ. $MPLSnode enable-ordered-control
•
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٢‐٤
ﮔﺮﻩ MPLSﺩﺭ ﻣﺪ ordered-controlﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ. $ns enable-control-driven
•
ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﺑﻪ ﺭﻭﺵ control-drivenﺑﺮﭼﺴﺐﻫﺎ ﺭﺍ ﺗﻮﺯﻳﻊ ﻣﻲﻛﻨﻨﺪ. $ns enable-data-driven
•
ﺗﻤﺎ ﮔﺮﻩﻫﺎﻱ MPLSﺑﻪ ﺭﻭﺵ data-drivenﺑﺮﭼﺴﺐﻫﺎ ﺭﺍ ﺗﻮﺯﻳﻊ ﻣﻲﻛﻨﻨﺪ. $ns enable-on-demand
•
ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﺩﺭ ﻣﺪ on-demandﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ. $ns enable-ordered-control
•
ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﺩﺭ ﻣﺪ ordered-controlﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﺩ. $MPLSnode send-ldp-release-msg $fec
•
ﭘﻴﻐﺎﻡ " "ldp-releaseﺑﺎ fecﺩﺍﺩﻩ ﺷﺪﻩ ﺑﻪ ﮔﺮﻩﻫﺎﻱ DownStreamﺍﺭﺳﺎﻝ ﻣﻲﮔﺮﺩﺩ ﺗﺎ ﻣﺴﻴﺮ LSPﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺑﺎ $fec ،FECﺭﺍ ﺣﺬﻑ ﻛﻨﻨﺪ. $MPLSnode send-ldp-withdraw-msg $fec
•
ﭘﻴﻐﺎﻡ " "ldp-withdrawﺑﺎ fecﺩﺍﺩﻩ ﺷﺪﻩ ﺑﻪ ﮔﺮﻩﻫﺎﻱ UpStreamﺍﺭﺳﺎﻝ ﻣﻲﮔﺮﺩﺩ ﺗﺎ ﻣﺴﻴﺮ LSPﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺑﺎ $fec ،FECﺭﺍ ﺣﺬﻑ ﻛﻨﻨﺪ. $MPLSnode aggregate-flows $fec1 $fec2
•
ﻓﻠﻮ ﺑﺎ $fec1 ،FECﺭﺍ ﺩﺭ ﻓﻠﻮ ﺑﺰﺭﮔﺘﺮ ﺑﺎ $fec2 ،FECﻣﺠﺘﻤﻊ ﻣﻲﻛﻨﺪ .ﺩﺭ ﻭﺍﻗﻊ ﻓﻠﻮﻫﺎﻱ $fec1ﻭ $fec2ﺭﺍ ﺗﺮﻛﻴﺐ ﻣﻲﻛﻨﺪ ﺑﺎ $fec2 : FEC
٢‐٣‐٤ﻭﺍﺳﻂﻫﺎ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮ ﺻﺮﻳﺢ $MPLSnode setup-erlsp $fec $er $lspid
•
ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ $erﺑﺎ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ $lspidﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﻛﻪ ﻣﻘﺪﺍﺭ FECﺍﻳﻦ ﻣﺴﻴﺮ $fecﻣﻲﺑﺎﺷﺪ. ﺑﻮﺳﻴﻠﻪ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻳﻚ ﭘﻴﻐﺎﻡ CR-LDP Requestﺍﺯ ﮔﺮﻩ $MPLSnodeﺑﻪ ﮔﺮﻩﻫﺎﻱ ﺩﺭ ﻃﻮﻝ ﻣﺴﻴﺮ $er
ﺑﺮﺍﻱ ﻓﻠﻮﻫﺎﻱ $fecﻓﺮﺳﺘﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ:
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٣‐٤ $LSR1 setup-erlsp 7 5_4_8_6_7 3000
ﺑﺎ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ) (۷ ،۶ ،۸ ،۴ ،۵ ،LSR1ﺍﺯ ﮔﺮﻩ $LSR1ﺑﻪ ﮔﺮﻩ ﺑﺎ ﻣﺸﺨﺼﻪ ۷ﻭ ﺑﺎ FEC
۷ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﻣﺴﻴﺮ ﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺩﺍﺭﺍﻱ ﻣﺸﺨﺼﻪ ۳۰۰۰ﺧﻮﺍﻫﺪ ﺑﻮﺩ. $LSR2 setup-erlsp 9 2-L3000-8 4000
ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺍﺯ ﮔﺮﻩ $LSR2ﺑﻪ ﮔﺮﻩ ۸ﺑﺎ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ۴۰۰۰ﻭ ۹ FECﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺩﺭ ﻗﺴﻤﺖ ﻣﺴﻴﺮ ﺻﺮﻳﺢ L3000ﺑﻜﺎﺭ ﺑﺮﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ﻛﻪ ﻣﻨﻈﻮﺭ ﺍﺯ ﺁﻥ ﻣﺴﻴﺮﻱ ﺍﺯ ﭘﻴﺶ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺑﺎ ﻣﺸﺨﺼﻪ ٣٠٠٠ﺍﺳﺖ .ﺑﻨﺎﺑﺮﺍﻳﻦ ﺗﻮﺳﻂ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻣﻲﺗﻮﺍﻥ ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﻛﻪ ﺧﻮﺩ ﺷﺎﻣﻞ ﻳﻚ ﻣﺴﻴﺮ ﺍﺯ
ﭘﻴﺶ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺍﺳﺖ ،ﺳﺎﺧﺖ. $MPLSnode bind-flow-erlsp $fec $flowid $lspid
•
ﻓﻠﻮﻫﺎﻱ ﺑﺎ ﻣﺸﺨﺼﻪ $flowidﻭ $fec FECﺭﺍ ﺑﻪ ﻣﺴﻴﺮ ﺍﺯ ﭘﻴﺶ ﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺑﺎ ﻣﺸﺨﺼﻪ $lspidﻣﻲﭼﺴﺒﺎﻧﺪ. ﺑﻌﺪ ﺍﺯ ﺍﺟﺮﺍﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺍﻳﻦ ﻓﻠﻮﻫﺎ ﺍﺯ ﺍﻳﻦ ﻣﺴﻴﺮ ﺍﻧﺘﻘﺎﻝ ﻣﻲﻳﺎﺑﻨﺪ.
٣‐٣‐٤ﻭﺍﺳﻄﻬﺎ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻛﻼﺱﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻨﻜﻪ MNS2ﺑﺮﺍﻱ ﺳﺮﻭﻳﺲﺩﻫﻲ ﺑﻪ ﺍﻧﻮﺍﻉ ﻛﻼﺳﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﺻﻒ CBQﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ ﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﻧﺤﻮﻩ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺻﻒ CBQﻭ ﺍﻧﻮﺍﻉ ﻛﻼﺳﻬﺎ ﺁﻭﺭﺩﻩ ﻣﻲﺷﻮﻧﺪ. $ns cfg-cbq-for-SBTS $qlim $cbq_qtype $okborrow $bw $maxidle $extradelay
•
ﺑﻮﺳﻴﻠﻪ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺻﻒ CBQﺩﺭ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ SBTSﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ .ﻭ ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﺷﻮﺩ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: :$qlimﺍﻧﺪﺍﺯﻩ ﺻﻔﻲ ﻛﻪ ﺑﻪ ﺍﻳﻦ ﻛﻼﺱ ﺍﺧﺘﺼﺎﺹ ﻣﻲﺩﻫﺪ)ﺑﺮ ﺣﺴﺐ ﺑﺴﺘﻪ(. :$cbq_qtypeﻧﻮﻉ ﺻﻔﻲ ﻛﻪ ﺑﺮﺍﻱ ﺳﺮﻭﻳﺲ ﺩﻫﻲ ﺑﻪ ﺍﻳﻦ ﻛﻼﺱ ﺍﺯ ﺁﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﺑﻪﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ .DropTail :$okborrowﻳﻚ ﭘﺎﺭﺍﻣﺘﺮ ﺑﻮﻟﻲ ﻛﻪ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ ﺁﻳﺎ ﻛﻼﺱ ﺍﺟﺎﺯﻩ ﺩﺍﺭﺩ ﺍﺯ ﭘﺪﺭ ﺧﻮﺩ ﻣﻨﺒﻊ ﻗﺮﺽ ﺑﮕﻴﺮﺩ ﻳﺎ ﺧﻴﺮ. :$bwﺩﺭﺻﺪﻱ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻛﻪ CBQﺑﺎﻳﺪ ﺑﺮﺍﻱ ﺍﻳﻦ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﺍﺧﺘﺼﺎﺹ ﺩﻫﺪ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٤‐٤
:$maxidleﻣﺎﻛﺰﻳﻤﻢ ﻣﻘﺪﺍﺭ ﺯﻣﺎﻧﻲ ﻛﻪ ﻛﻼﺱ ﻧﻴﺎﺯ ﺩﺍﺭﺩ ﺗﺎ ﺑﺴﺘﻪﻫﺎﻳﺶ ﺭﺍ ﺩﺭ ﺻﻒ ﻗﺮﺍﺭ ﺩﻫﺪ .ﺑﺴﺘﻪﻫﺎ ﻗﺒﻞ ﺍﺯ ﺍﺗﻤﺎﻡ ﺍﻳﻦ ﺯﻣﺎﻥ ﺑﻪ ﺟﻠﻮ ﺍﻧﺘﻘﺎﻝ ﻧﻤﻲﻳﺎﺑﻨﺪ. :$extradelayﺗﺎﺧﻴﺮ ﻛﻼﺱ ﺑﺎ ﺍﻳﻦ ﺯﻣﺎﻥ ﺟﻤﻊ ﻣﻲﺷﻮﺩ. $maxidle
$bw
$okborrow
$cbq_qtype
$qlim
$ns cfg-cbq-for-HBTS $extradelay
•
ﺻﻒ CBQﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ HBTSﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﺷﻮﺩ. $ns cfg-cbq-for-STS $qlim $cbq_qtype $okborrow $bw $maxidle $extradelay
•
ﺻﻒ CBQﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ STSﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﺷﻮﺩ. $ns cfg-cbq-for-RTS $qlim $cbq_qtype $okborrow $bw $maxidle $extradelay
•
ﺻﻒ CBQﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ RTSﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﺷﻮﺩ. ]$ns bind-flowid-to-SBTS $id1 [$id2
•
ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ $id1ﻳﺎ ﻓﻠﻮﻫﺎﻳﻲ ﻛﻪ ﻣﺸﺨﺼﻪ ﺁﻧﻬﺎ ﺑﻴﻦ $id1ﻭ $id2ﺍﺳﺖ ﺑﻪ ﺻﻮﺭﺕ ﺳﺮﻭﻳﺲ SBTSﺳﺮﻭﻳﺲﺩﻫﻲ ﺷﻮﻧﺪ. ]$ns bind-flowid-to-HBTS $id1 [$id2
•
ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ $id1ﻳﺎ ﻓﻠﻮﻫﺎﻳﻲ ﻛﻪ ﻣﺸﺨﺼﻪ ﺁﻧﻬﺎ ﺑﻴﻦ $id1ﻭ $id2ﺍﺳﺖ ﺑﻪ ﺻﻮﺭﺕ ﺳﺮﻭﻳﺲ HBTSﺳﺮﻭﻳﺲﺩﻫﻲ ﺷﻮﻧﺪ. ]$ns bind-flowid-to-STS $id1 [$id2
•
ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ $id1ﻳﺎ ﻓﻠﻮﻫﺎﻳﻲ ﻛﻪ ﻣﺸﺨﺼﻪ ﺁﻧﻬﺎ ﺑﻴﻦ $id1ﻭ $id2ﺍﺳﺖ ﺑﻪ ﺻﻮﺭﺕ ﺳﺮﻭﻳﺲ SBTSﺳﺮﻭﻳﺲﺩﻫﻲ ﺷﻮﻧﺪ. $ns bind-ldp-to-SBTS
•
$ns bind-ldp-to-HBTS
•
$ns bind-ldp-to-STS
•
ﺍﻳﻦ ﺳﻪ ﺩﺳﺘﻮﺭ ﻣﺸﺨﺺ ﻣﻲﻛﻨﻨﺪ ﻛﻪ ﭘﻴﻐﺎﻡﻫﺎﻱ ldpﺑﻪ ﭼﻪ ﺻﻮﺭﺕ ﺳﺮﻭﻳﺲﺩﻫﻲ ﺷﻮﻧﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٥‐٤
٤‐٣‐٤ﻭﺍﺳﻂﻫﺎ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮ ﻣﻘﻴﺪ ) (CR-LSPﻭ CR-LDP $MPLSnode setup-crlsp $fec $er $lspid $TRate $BSize $PSize $SPrio $Hprio
•
ﺑﻮﺳﻴﻠﻪ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻳﻚ ﻣﺴﻴﺮ CR-LSPﺑﺎ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ،$erﻭ $fec FECﻭ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ $lspidﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: FEC :$fecﻣﺴﻴﺮ :$erﻣﺴﻴﺮ ﺻﺮﻳﺢ :$lspidﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ :$TRateﻧﺮﺥ ﺗﺮﺍﻓﻴﻜﻲ ﻛﻪ ﻗﺮﺍﺭ ﺍﺳﺖ ﺍﺯ ﺍﻳﻦ ﻣﺴﻴﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﺪ. :$Bsizeﺍﻧﺪﺍﺯﻩ ﺑﺎﻓﺮ :$Psizeﺍﻧﺪﺍﺯﻩ ﺑﺴﺘﻪﻫﺎ :$Sprioﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ﺍﻳﻦ ﻣﺴﻴﺮ ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻚ ﻣﺸﺨﺺ ﺷﺪﻩ :$Hprioﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺍﺭﻱ ﺍﻳﻦ ﻣﺴﻴﺮ ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻚ ﻣﺸﺨﺺ ﺷﺪﻩ $MPLSnode send-crldp-release-msg $lspid
•
ﺗﻮﺳﻂ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﭘﻴﻐﺎﻡ CR-LDP Releaseﺑﻪ ﻣﻨﻈﻮﺭ ﺣﺬﻑ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﻳﺎ ﻣﺴﻴﺮ ﻣﻘﻴﺪ ﺑﺎ ﻣﺸﺨﺼﻪ $lspidﺍﺯ ﮔﺮﻩ $MPLSnodeﺑﻪ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ DownStreamﻛﻪ ﺩﺭ ﻃﻮﻝ ﻣﺴﻴﺮ ﻣﺸﺨﺺ ﺷﺪﻩ ﻭﺟﻮﺩ ﺩﺍﺭﻧﺪ ﻓﺮﺳﺘﺎﺩﻩ ﻣﻲﺷﻮﺩ. $MPLSnode send-crldp-withdraw-msg $lspid
•
ﺗﻮﺳﻂ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﭘﻴﻐﺎﻡ CR-LDP WithDrawﺑﻪ ﻣﻨﻈﻮﺭ ﺣﺬﻑ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﻳﺎ ﻣﺴﻴﺮ ﻣﻘﻴﺪ ﺑﺎ ﻣﺸﺨﺼﻪ $lspidﺍﺯ ﮔﺮﻩ $MPLSnodeﺑﻪ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ UpStreamﻛﻪ ﺩﺭ ﻃﻮﻝ ﻣﺴﻴﺮ ﻣﺸﺨﺺ ﺷﺪﻩ ﻭﺟﻮﺩ ﺩﺍﺭﻧﺪ ﻓﺮﺳﺘﺎﺩﻩ ﻣﻲﺷﻮﺩ. $MPLSnode send-crldp-notification-msg $status $lspid $tr
•
ﺗﻮﺳﻂ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﭘﻴﻐﺎﻡ CR-LDP Notificationﺑﻪ ﮔﺮﻩﻫﺎﻱ UpStreamﮔﺮﻩ $MPLSnodeﻓﺮﺳﺘﺎﺩﻩ ﻣﻲﺷﻮﺩ ﺗﺎ ﺍﻃﻼﻋﺎﺗﻲ ﺭﺍﺟﻊ ﺑﻪ ﺁﻧﻬﺎ ﺑﺪﻫﺪ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ:
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٦‐٤
:$statusﺍﻃﻼﻋﺎﺕ ﻭﺿﻌﻴﺖ ﻛﻪ ﺩﺭ CR-LDPﺍﺳﺘﺎﻧﺪﺍﺭﺩ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺍﺳﺖ. :$lspidﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ :$trﺍﻃﻼﻋﺎﺗﻲ ﺩﺭ ﻣﻮﺭﺩ ﺗﺮﺍﻓﻴﻚ $MPLSnode set-flow-prio $fec $flowid $priority
•
ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﻓﻠﻮ ﺑﺎ ﻣﺸﺨﺼﻪ $flowidﻭ $fec:FECﺍﻭﻟﻮﻳﺖ $priorityﺭﺍ ﺑﮕﻴﺮﺩ .ﻣﻘﺪﺍﺭ $priority
ﻣﻲﺗﻮﺍﻧﺪ ﺻﻔﺮ ﻳﺎ ﻳﻚ ﺑﺎﺷﺪ ﻛﻪ ﺍﻭﻟﻮﻳﺖ ﻳﻚ ﺑﻴﺸﺘﺮ ﺍﺯ ﺻﻔﺮ ﺍﺳﺖ.
٥‐٣‐٤ﻭﺍﺳﻄﻬﺎ ﺑﺮﺍﻱ ﻓﺮﺍﺧﻮﺍﻧﻲ ﺭﻭﺍﻟﻬﺎ ﺳﻪ ﺭﻭﺍﻝ ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﻛﻪ ﺑﺎ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻥ ﻭﺍﻗﻌﻪﺍﻱ ﺑﻪ ﻃﻮﺭ ﺧﻮﺩﻛﺎﺭ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﻧﺪ .ﺍﻳﻦ ﺭﻭﺍﻟﻬﺎ ﺑﻪ ﻣﻨﻈﻮﺭ ﺍﻃﻼﻉ ﺩﺍﺩﻥ ﻛﺎﺭﺑﺮ ﺍﺯ ﻭﻗﻮﻉ ﺁﻥ ﺍﺗﻔﺎﻕ ﺧﺎﺹ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﻧﺪ ﻭ ﻛﺎﺭﺑﺮ ﻣﻲﺗﻮﺍﻧﺪ ﺍﻳﻦ ﺭﻭﺍﻟﻬﺎ ﺭﺍ ﺑﺎﺯﻧﻮﻳﺴﻲ ﻧﻤﺎﻳﺪ ﺗﺎ ﺩﺭ ﺯﻣﺎﻥ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻥ ﻭﺍﻗﻌﻪ ﺧﺎﺹ ،ﻛﺎﺭ ﺩﻟﺨﻮﺍﻫﺶ ﺍﻧﺠﺎﻡ ﺷﻮﺩ. }proc notify-erlsp-setup {node lspid
•
ﺍﻳﻦ ﺭﻭﺍﻝ ﺯﻣﺎﻧﻴﻜﻪ ﭘﻴﻐﺎﻡ CR-LDP Mappingﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﺎ ﻣﺸﺨﺼﻪ lspidﺑﻪ ﮔﺮﻩ node
ﺭﺳﻴﺪ ﻓﺮﺍﺧﻮﻧﻲ ﻣﻲﺷﻮﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺯﻣﺎﻧﻴﻜﻪ ﻣﺴﻴﺮ ﺳﺎﺧﺘﻪ ﺷﺪ ﭘﻴﻐﺎﻡ CR-LDP Mappingﺑﻪ ﮔﺮﻩ ﺍﺑﺘﺪﺍﻳﻲ ﻣﻲﺭﺳﺪ ﻭ ﺩﺭ ﺁﻥ ﺯﻣﺎﻥ ﺍﻳﻦ ﺭﻭﺍﻝ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ ﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﻣﻲﺗﻮﺍﻥ ﺩﺭ ﺍﻳﻦ ﺭﻭﺍﻝ ﻓﻠﻮ ﺧﺎﺻﻲ ﺭﺍ ﺑﻪ ﺍﻳﻦ ﻣﺴﻴﺮ ﻣﺮﺗﺒﻂ ﻧﻤﻮﺩ. }proc notify-erlsp-fail {node status lspid tr
•
ﺍﻳﻦ ﺭﻭﺍﻝ ﺯﻣﺎﻧﻲ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ ﻛﻪ ﭘﻴﻐﺎﻡ CR-LDP Notificationﺑﺎ ﻣﺸﺨﺼﺎﺕ lspid ،statusﻭ trﺑﻪ ﮔﺮﻩ nodeﻣﻲﺭﺳﺪ. }proc notify-erlsp-release {node lspid
•
ﺍﻳﻦ ﺭﻭﺍﻝ ﺯﻣﺎﻧﻲ ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ ﻛﻪ ﮔﺮﻩ nodeﭘﻴﻐﺎﻡ CR-LDP Release/Withdrawﺑﺎ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ lspidﺭﺍ ﺩﺭﻳﺎﻓﺖ ﻛﻨﺪ.
۶‐۳‐۴ﻭﺍﺳﻄﻬﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﻘﻴﺪ $ns collect-resource-info $itime
•
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٧‐٤
ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﻨﺎﺑﻊ ﺭﺍ ﺑﻪ ﻃﻮﺭ ﻣﺘﻨﺎﻭﺏ ﺩﺭ ﻫﺮ $timeﺛﺎﻧﻴﻪ ﺍﺯ ﻫﻤﻪ ﮔﺮﻩﻫﺎﻱ MPLSﺟﻤﻊﺁﻭﺯﻱ ﻣﻲﻛﻨﺪ. $MPLSnode constraint-based-routing $dstid $bw
•
ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﻣﻘﻴﺪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ ﺍﮔﺮ ﭼﻨﻴﻦ ﻣﺴﻴﺮﻱ ﭘﻴﺪﺍ ﺷﺪ ﻣﺴﻴﺮ ﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ ﻭﮔﺮﻧﻪ ﻣﻘﺪﺍﺭ -1ﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: :$bwﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮ :$dstidﻣﺸﺨﺼﺔ LSRﻣﻘﺼﺪ ﺑﻨﺎﺑﺮﺍﻳﻦ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻳﻚ CR-LSPﻣﺴﻴﺮ ﻣﻘﻴﺪ ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﺗﻮﺳﻂ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻣﺴﻴﺮ ﺩﺍﺭﺍﻱ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻈﺮ ﺭﺍ ﺑﺪﺳﺖ ﺁﻭﺭﺩ ﻭ ﺳﭙﺲ ﺑﻮﺳﻴﻠﻪ setup-crlspﻣﺴﻴﺮ ﺭﺍ ﺳﺎﺧﺖ.
٧‐٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ $ns enable-reroute $option
•
ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺍﻣﻜﺎﻥ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺭﺍ ﺭﻭﻱ ﻫﻤﻪ ﮔﺮﻩﻫﺎﻱ MPLSﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ MNS .ﭼﻨﺪ ﻧﻮﻉ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ ﻛﻪ ﺗﻮﺳﻂ ﮔﺰﻳﻨﻪ $optionﻣﻲﺗﻮﺍﻥ ﻧﻮﻉ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺭﺍ ﺍﻧﺘﺨﺎﺏ ﻛﺮﺩ. ﻣﻘﺎﺩﻳﺮﻱ ﻛﻪ $optionﻣﻲﺗﻮﺍﻧﺪ ﺑﮕﻴﺮﺩ ﺑﻪ ﺷﺮﺡ ﺯﻳﺮ ﻫﺴﺘﻨﺪ: • : dropﺍﮔﺮ ﺍﻳﻦ ﮔﺰﻳﻨﻪ ﺍﻧﺘﺨﺎﺏ ﺷﻮﺩ ﻫﻴﭻ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺟﺪﻳﺪﻱ ﺳﺎﺧﺘﻪ ﻧﻤﻲﺷﻮﺩ. • :L3ﺍﮔﺮ ﺍﻳﻦ ﮔﺰﻳﻨﻪ ﺍﻧﺘﺨﺎﺏ ﺷﻮﺩ ﺑﻌﺪ ﺍﺯ ﺍﻳﻨﻜﻪ ﻳﻚ ﻟﻴﻨﻚ ﺧﺮﺍﺏ ﺷﺪ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺟﺪﻭﻝ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻻﻳﻪ ٣ﻳﻚ ﻣﺴﻴﺮ ﺩﻳﮕﺮ ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. •
:notify-prenegotiatedﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺁﻥ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﻳﻚ ﭘﻴﻐﺎﻡ Notification
LDPﺑﻪ ﮔﺮﻩﻫﺎﻱ UpStreamﺧﻮﺩ ﻣﻲﻓﺮﺳﺘﺪ. • :simple-dynamicﻳﻚ ﻣﺴﻴﺮ ﺟﺪﻳﺪﻱ ﺑﻴﻦ ﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺁﻥ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﻭ ﻣﻘﺼﺪ ﻣﻲﺳﺎﺯﺩ. •
:shortest-dynamicﻳﻚ ﻣﺴﻴﺮ ﺟﺪﻳﺪ ﺑﻴﻦ ﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺁﻥ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﻭ ﮔﺮﻩ ﺑﻌﺪﻱ ﻣﻲﺳﺎﺯﺩ .ﺍﻟﺒﺘﻪ ﺍﮔﺮ ﭼﻨﻴﻦ ﻣﺴﻴﺮﻱ ﻣﻮﺟﻮﺩ ﺑﺎﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٨‐٤ $ns set-protection-lsp $stime $itime $lspid
•
ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺑﺮﺍﻱ ﭼﻚ ﻛﺮﺩﻥ ﺍﻳﻨﻜﻪ ﺧﺮﺍﺑﻲ ﺭﻭﻱ ﻣﺴﻴﺮﻱ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻩ ﻳﺎ ﺧﻴﺮ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: :$stimeﺯﻣﺎﻥ ﺷﺮﻭﻉ ﺑﺮﺍﻱ ﭼﻚ ﻛﺮﺩﻥ :$itimeﻓﺎﺻﻠﻪ ﺯﻣﺎﻧﻲ ﺑﻴﻦ ﻫﺮ ﺑﺎﺭ ﭼﻚ ﻛﺮﺩﻥ :$lspidﻣﺸﺨﺼﻪ ﻣﺴﻴﺮﻱ ﻛﻪ ﺁﻥ ﺭﺍ ﻣﻲﺧﻮﺍﻫﺪ ﭼﻚ ﻛﻨﺪ. $MPLSnode reroute-lsp-binding $w_lspid a_lspid
•
ﺗﻮﺳﻂ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻣﻲﺗﻮﺍﻥ ﻳﻚ ﻣﺴﻴﺮ ﺭﺍ ﺑﺎ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﻣﺮﺗﺒﻂ ﻛﺮﺩ ﺩﺭ ﺍﻳﻦ ﺻﻮﺭﺕ ﺍﮔﺮ ﺩﺭ ﻣﺴﻴﺮﻱ ﻛﻪ ﺩﺭ ﺣﺎﻝ ﻛﺎﺭ ﻛﺮﺩﻥ ﺍﺳﺖ ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺑﻴﺎﻓﺘﺪ ﺍﺯ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺑﺠﺎﻱ ﺁﻥ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ:
:w_lspidﻣﺸﺨﺼﻪ ﻣﺴﻴﺮﻱ ﻛﻪ ﺩﺭ ﺣﺎﻝ ﻛﺎﺭ ﻛﺮﺩﻥ ﺍﺳﺖ. :a_lspidﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ $MPLSnode enable-reroute-egress-lsr
•
ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ $MPLSnodeﺑﻪ ﻋﻨﻮﺍﻥ lsrﭘﺸﺘﻴﺒﺎﻥ ﻋﻤﻞ ﻛﻨﺪ.
٨‐٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ traceﻛﺮﺩﻥ $MPLSnode trace-mpls
•
ﺑﺴﺘﻪﻫﺎﻱ MPLSﺩﺭ ﮔﺮﻩ $MPLSnodeﺭﺍ traceﻣﻲﻛﻨﺪ. $MPLSnode trace-ldp
•
ﺑﺴﺘﻪﻫﺎﻱ ldpﺩﺭ ﮔﺮﻩ $MPLSnodeﺭﺍ traceﻣﻲﻛﻨﺪ. $MPLSnode pft-dump
•
ﺟﺪﻭﻝ PFTﮔﺮﻩ $MPLSnodeﺭﺍ ﻧﻤﺎﻳﺶ ﻣﻲﺩﻫﺪ. $MPLSnode erb-dump
•
ﺟﺪﻭﻝ ERBﮔﺮﻩ $MPLSnodeﺭﺍ ﻧﻤﺎﻳﺶ ﻣﻲﺩﻫﺪ. $MPLSnode lib-dump
•
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٦٩‐٤
ﺟﺪﻭﻝ LIBﮔﺮﻩ $MPLSnodeﺭﺍ ﻧﻤﺎﻳﺶ ﻣﻲﺩﻫﺪ.
٩‐٣‐٤ﻭﺍﺳﻂﻫﺎﻱ ﺑﺮﻧﺎﻣﻪﻧﻮﻳﺴﻲ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩ ﺩﺭ namulator $ns ldp-request-color $color
•
$ns ldp-mapping-color $color
•
$ns ldp-withdraw-color $color
•
$ns ldp-release-color $color
•
$ns ldp-notification-color $color
•
ﺩﺳﺘﻮﺭﺍﺕ ﺑﺎﻻ ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﺩﺭ namulatorﺑﺴﺘﻪﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﭘﻴﻐﺎﻡﻫﺎﻱ ﻣﺨﺘﻠﻒ ldpﺑﻪ ﺭﻧﮕﻬﺎﻱ ﻣﺸﺨﺺ ﺷﺪﻩ ﺩﻳﺪﻩ ﺷﻮﻧﺪ .ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ $colorﺭﻧﮓ ﺭﺍ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ.
٤-٤
ﻣﺜﺎﻟﻬﺎي از اﺳﺘﻔﺎدﻩ از MPLSدر ﺷﺒﻴﻪﺳﺎز : ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﻫﺪﺍﻳﺖ ﺑﺴﺘﻪﻫﺎ
MPLSﻣﻲﺗﻮﺍﻧﺪ ﺑﻪ ﻣﻨﻈﻮﺭ ﻫﺪﺍﻳﺖ ﺑﺴﺘﻪﻫﺎ ﺑﻪ ﺟﻠﻮ ) (Forwardingﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﺩ .ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﻛﺎﻓﻲ ﺍﺳﺖ ﺩﺭ ﺷﺒﻴﻪﺳﺎﺯ ﮔﺮﻫﻬﺎﻱ ﺣﻮﺯﻩ MPLSﺑﻪ ﺻﻮﺭﺕ" "MPLSnodeﺗﻌﺮﻳﻒ ﺷﻮﻧﺪ ﻭ ldp- agentﺭﻭﻱ ﮔﺮﻩﻫﺎ ﻓﻌﺎﻝ ﺷﻮﺩ .ﻣﺜﺎﻝ ﺯﻳﺮ ﺍﻳﻦ ﻣﺴﺌﻠﻪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ:
ﺷﻜﻞ ١١‐١ﺗﻮﭘﻮﻟﻮﮊﻱ
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٧٠‐٤
set set
ns nf
[new Simulator] [open test-lsp.nam]
$ns
namtrace-all $nf
proc finish{} { global ns nf $ns flush-trace close $nf exec nam test-lsp.nam& exit 0 } #create topology set Node0 set LSR1 set LSR2 set LSR3 set LSR4 set LSR5 set Node6
[$ns [$ns [$ns [$ns [$ns [$ns [$ns
$ns $ns $ns $ns $ns $ns $ns
Node0 LSR1 LSR2 LSR1 LSR4 LSR5 LSR3
duplex-link duplex-link duplex-link duplex-link duplex-link duplex-link duplex-link
node] MPLSnode] C1 MPLSnode] MPLSnode] MPLSnode] MPLSnode] node] LSR1 LSR2 LSR3 LSR4 LSR5 LSR3 Node4
1M 1M 1M 1M 1M 1M 1M
10ms 10ms 10ms 10ms 10ms 10ms 10ms
DropTail DropTail DropTail DropTail DropTail DropTail DropTail
Part -1
#configure Ldp-agents $ns configure-ldp-on-all-mpls-nodes #configure Driven type $ns enable-control-driven #$ns enable-data-driven #$ns enable-on-demand #$ns enable-ordered
C2 C3 C4 C5 C6
# #create traffic generators #######################################Part-2 # set Src0 [new Application/Traffic/CBR[ $Src0 set packetSize_ 500 $Src0 set interval_ 0.010
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٧١‐٤
#create UDP agents and attach to src0 set Udp0 [new Agent/UDP[ $Src0 attach-agent $Udp0 #attach udp to node0 $ns attach-agent $Node0 $Udp0 #create agent reciever for udp packets and attach it to node reciever set Dst0 [new Agent/Null[ $ns attach-agent $Node4 $Dst0 #onnect sendr agent to reciever agent $ns connect $Udp0 $Dst0 $ns at 0.1 "$Src0 start" # # End Traffic Generator ####################################### # #get MPLS module of all MPLS nodes for {set i 0}{ $i<4 }{incr i} set MPLS-LSRi [$LSRi get-module }
MPLS]
#send to output all the tables of every MPLS node $ns at 5.0 “$MPLS-LSR1 dump-LIB”
$ns at 1.7 "$LSRmpls1 pft-dump" $ns at 1.7 "$LSRmpls1 erb-dump" $ns at 1.7 "$LSRmpls1 lib-dump" $ns at 1.7 "$LSRmpls2 pft-dump" $ns at 1.7 "$LSRmpls2 erb-dump" $ns at 1.7 "$LSRmpls2 lib-dump" $ns at 1.7 "$LSRmpls3 pft-dump" $ns at 1.7 "$LSRmpls3 erb-dump" $ns at 1.7 "$LSRmpls3 lib-dump"
Part-3
C7
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧٢‐٤
ﺩﺭ ﻛﺪ ﺩﺍﺩﻩ ﺷﺪﻩ: ﺩﺳﺘﻮﺭ C1ﻳﻚ ﮔﺮﻩ MPLSﺗﻌﺮﻳﻒ ﻣﻲﻛﻨﺪ ﺩﺳﺘﻮﺭﺍﺕ ﻗﺴﻤﺖ Part1ﻟﻴﻨﻜﻬﺎﻱ ﺑﻴﻦ ﮔﺮﻩﻫﺎ ﺭﺍ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﻨﺪ ﺩﺳﺘﻮﺭ ldp-agent ،C2ﺭﺍ ﺭﻭﻱ ﻫﻤﻪ ﮔﺮﻩﻫﺎﻱ MPLSﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ. ﺩﺳﺘﻮﺭ C3ﺭﻭﺵ ﺗﻮﺯﻳﻊ Control-drivenﺭﺍ ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ. ﺍﮔﺮ ﺑﺨﻮﺍﻫﻴﻢ ﺍﺯ ﺭﻭﺵ data-drivenﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻴﻢ ﺑﺎﻳﺪ ﺩﺳﺘﻮﺭ C3ﻏﻴﺮﻓﻌﺎﻝ ﻭ ﺩﺳﺘﻮﺭ C4ﺑﻪ ﻫﻤﺮﺍﻩ ﻳﻜﻲ ﺍﺯ ﺩﺳﺘﻮﺭﺍﺕ C5ﻳﺎ C6ﻓﻌﺎﻝ ﺷﻮﺩ. ﺩﺳﺘﻮﺭﺍﺕ ﻗﺴﻤﺖ Part-2ﺗﺮﺍﻓﻴﻜﻲ ﺑﻴﻦ ﮔﺮﻩ ﺻﻔﺮ ﻭ ﮔﺮﻩ ﭼﻬﺎﺭ ﺗﻮﻟﻴﺪ ﻣﻲﻛﻨﻨﺪ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﻧﻮﻉ CBR
ﺍﺳﺖ ﻭ ﺑﻮﺳﻴﻠﻪ ﭘﺮﻭﺗﻜﻞ UDPﺣﻤﻞ ﻣﻲﺷﻮﺩ. ﺩﺳﺘﻮﺭ C7ﻣﺎﺟﻮﻝ MPLSﺍﺯ ﮔﺮﻩ MPLSﺭﺍ ﻣﻲﮔﻴﺮﺩ .ﺩﺭ ﻭﺍﻗﻊ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺩﺳﺘﻮﺭﺍﺕ MNS
ﻧﻤﻲ ﺗﻮﺍﻥ ﺍﺯ ﮔﺮﻩ ﺍﺳﺘﻔﺎﺩﻩ ﻛﺮد ﺑﻠﻜﻪ ﺑﺎﻳﺪ ﺍﺯ ﻣﺎﺟﻮﻝ MPLSﺁﻥ ﮔﺮﻩ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ ﻛﻪ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻣﺎﺟﻮﻝ MPLSﮔﺮﻩ ﻣﻮﺭﺩ ﻧﻈﺮ ﺭﺍ ﺩﺭ ﺍﺧﺘﻴﺎﺭ ﻣﺎ ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ. ﺩﺳﺘﻮﺭﺍﺕ Part-3ﺟﺪﺍﻭﻝ ﻣﺮﺑﻮﻁ ﺑﻪ ﻫﺮ ﮔﺮﻩ ﺭﺍ ﭼﺎﭖ ﻣﻲﻛﻨﺪ ﺑﺮﺍﻱ ﻧﻤﻮﻧﻪ ﺟﺪﻭﻟﻬﺎﻱ ﮔﺮﻩ 2ﺭﺍ ﺩﺭ ﺣﺎﻟﺖ Control-drivenﺭﺍ ﺗﻮﺿﻴﺢ ﻣﻲﺩﻫﻴﻢ.
ﺟﺪﺍﻭﻝ ﻣﺮﺑﻮﻁ ﺑﻪ LSR1
‐۱ﺟﺪﻭﻝ
PFT
AlternativePath
SLIBptr
LIBptr
PRio
Fid
FEC
-1
-1
0
0
-1
2
-1
-1
1
0
-1
4
-1
-1
2
0
-1
3
-1
-1
3
0
-1
5
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
-1
٧٣‐٤ -1
0
4
6
-1
ﻫﻤﺎﻧﻄﻮﻛﻪ ﻗﺒﻼ ﺍﺷﺎﺭﻩ ﺷﺪ ﺩﺭ ﺟﺪﻭﻝ PFTﻣﺸﺨﺺ ﻣﻲﺷﻮﺩ ﻛﻪ ﭼﻪ ﻓﻠﻮﻳﻲ ﺑﺎﻳﺪ ﺑﻪ ﭼﻪ ﺑﺮﭼﺴﺒﻲ ﻧﮕﺎﺷﺖ ﺷﻮﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺩﺭ ﺟﺪﻭﻝ PFTﺑﺎﻻ ﻛﻪ ﻣﺮﺑﻮﻁ ﺑﻪ ﮔﺮﻩ LSR1ﺍﺳﺖ ﺁﻣﺪﻩ ﺍﺳﺖ ﻛﻪ ﻣﺸﺨﺼﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺭﺍﻩﮔﺰﻳﻨﻲ ﺑﺮﭼﺴﺐ ،ﻓﻠﻮﻫﺎﻱ ﺑﻪ ﻣﻘﺼﺪ 3ﺩﺭ ﺭﺩﻳﻒ ﺷﻤﺎﺭﻩ 1ﺟﺪﻭﻝ LIBﻗﺮﺍﺭ ﺩﺍﺭﻧﺪ. ‐۲ﺟﺪﻭﻝ ERB
ﺍﺯ ﺁﻧﺠﺎﻳﻴﻜﻪ ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﺗﻨﻬﺎ ﺍﻧﺘﻘﺎﻝ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺑﺎ ﺭﻭﺵ MPLSﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ ﻭ ﻫﻴﭻ ﺳﺮﻭﻳﺴﻲ ﺍﺭﺍﺋﻪ ﻧﺸﺪﻩ ﺍﺳﺖ ﺟﺪﻭﻝ ERBﮔﺮﻩﻫﺎﻱ MPLSﺧﺎﻟﻲ ﺍﺳﺖ. ‐۳ﺟﺪﻭﻝ
LIB
?Linkerror
LIBptr
oLabel
oIface
ILable
iIFace
#
-1
-1
0
2
1
-1
0
-1
-1
0
4
2
-1
1
-1
-1
2
2
3
-1
2
-1
-1
2
4
4
-1
3
-1
-1
4
2
5
-1
4
ﺍﺯ ﻃﺮﻳﻖ ﺟﺪﻭﻝ LIBﻣﺸﺨﺺ ﻣﻲﺷﻮﺩ ﺍﮔﺮ ﺑﺴﺘﻪﺍﻱ ﺑﺎ ﺑﺮﭼﺴﺐ ﻭﺭﻭﺩﻱ ilableﻭ ﺍﺯ ﭘﻮﺭﺕ iIFace
ﺑﻴﺎﻳﺪ ﺑﺎﻳﺪ ﺑﺎ ﭼﻪ ﺑﺮﭼﺴﺒﻲ oLabelﻭ ﺍﺯ ﻛﺪﺍﻡ ﭘﻮﺭﺕ ﺧﺮﻭﺟﻲ oIfaceﺧﺎﺭﺝ ﺷﻮﺩ .ﺍﮔﺮ ﺑﺴﺘﻪﺍﻱ ﺑﺎ ﺑﺮﭼﺴﺐ ﺻﻔﺮ ﺗﻮﺳﻂ LSRﺩﺭﻳﺎﻓﺖ ﺷﻮﺩ ﺑﻪ ﺍﻳﻦ ﻣﻌﻨﺎﺳﺖ ﻛﻪ ﻳﺎ LSRﻓﻌﻠﻲ ﻣﻘﺼﺪ ﺍﺳﺖ ﻭ ﻳﺎ Egress
.Router ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﮔﺮﻩ LSR1ﺑﻪ ﮔﺮﻩﻫﺎﻱ LSR3 ،LSR2ﻭ Node0ﻣﺴﺘﻘﻴﻤﺎ ﻣﺘﺼﻞ ﺍﺳﺖ ﺑﻨﺎﺑﺮﺍﻳﻦ ﺑﺮﭼﺴﺐ ﺧﺮﻭﺟﻲ ﺑﺴﺘﻪﻫﺎﻳﻲ ﻛﻪ ﻣﻲﺧﻮﺍﻫﺪ ﺑﻪ ﺍﻳﻦ ﮔﺮﻩﻫﺎ ﺍﺭﺳﺎﻝ ﻛﻨﺪ ﺭﺍ ﺻﻔﺮ ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ .ﻛﻪ ﺍﻳﻦ ﻣﺴﺌﻠﻪ ﺩﺭ ﺟﺪﻭﻝ LIBﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ .ﻫﻤﺎﻧﻄﻮﺭﻳﻜﻪ ﺩﺭ ﺟﺪﻭﻝ ﻫﻢ ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ ﺑﺴﺘﻪﻫﺎﻳﻲ ﻛﻪ ﺑﻪ ﻣﻘﺼﺪ ﮔﺮﻩ LSR5 ،LSR3ﻭ Node6ﺑﻪ LSR1ﻣﺘﺼﻞ ﻧﻴﺴﺘﻨﺪ ﮔﺮﻩ ﺑﻌﺪﻱ ﻣﻘﺼﺪ ﺍﻳﻦ ﺑﺴﺘﻪﻫﺎ ﻧﻴﺴﺖ ﻭ ﺑﺮﭼﺴﺐ ﺧﺮﻭﺟﻲ ﺁﻧﻬﺎ ﻋﺪﺩﻱ ﻏﻴﺮ ﺻﻔﺮ ﻗﺮﺍﺭ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧٤‐٤
١‐٤‐٤ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ﺷﺒﻴﻪﺳﺎﺯ MPLSﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﺮﻭﺗﻜﻞ cr-ldpﺍﻧﺠﺎﻡ ﻣﻲ ﺩﻫﺪ .ﺑﺮﺍﻱ ﺍﻳﻨﻜﻪ ﺍﺯ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﺩ ﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﻣﺴﻴﺮﻱ ﻛﻪ ﺗﻮﺳﻂ ﭘﺮﻭﺗﻜﻞ ldpﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺍﺳﺖ ﺣﺬﻑ ﺷﻮﺩ ﻭ ﺳﭙﺲ ﻣﺴﻴﺮ ﺗﻮﺳﻂ ﻣﺴﻴﺮﻳﺎﺑﻲ ﺻﺮﻳﺢ ﺳﺎﺧﺘﻪ ﺷﻮﺩ .ﺍﻳﻦ ﻛﺎﺭ ﺗﻮﺳﻂ ﺩﺳﺘﻮﺭ ldp-releaseﻳﺎ )ldp-withdraw ﺑﺴﺘﻪ ﺑﻪ ﺍﻳﻨﻜﻪ ﺍﺯ ﭼﻪ ﻧﻮﻉ ﺭﻭﺵ ﺗﻮﺯﻳﻊ ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ﻣﺘﻔﺎﻭﺕ ﺍﺳﺖ( ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ. ﺭﻭﺍﻝ } proc notify-erlsp-setup {node lspidﺯﻣﺎﻧﻴﻜﻪ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﺎ ﻣﺸﺨﺼﻪ lspidﺳﺎﺧﺘﻪ ﺷﺪ، ﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ؛ ﻛﻪ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺩﺭ ﺍﻳﻦ ﺯﻣﺎﻥ ﻣﻲ ﺗﻮﺍﻥ ﻓﻠﻮﻳﻲ ﺭﺍ ﺑﻪ ﺍﻳﻦ ﻣﺴﻴﺮ ﻣﺘﺼﻞ ﻛﺮﺩ. ﺍﮔﺮ ﺩﺭ ﻛﺪ ﻗﺒﻠﻲ ﻛﺪ ﺯﻳﺮ ﺍﺿﺎﻓﻪ ﺷﻮﺩ ﺍﺯ ﺯﻣﺎﻥ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺑﺴﺘﻪﻫﺎ ﺍﺯ ﻣﺴﻴﺮ ﺑﺎ ﻣﺸﺨﺼﻪ ٣٠٠٠ﺍﻧﺘﻘﺎﻝ ﻣﻲﻳﺎﺑﻨﺪ
C8
""$LSRmpls3 send-ldp-withdraw-msg 3
$ns at 0.7
C9
""$LSRmpls1 setup-erlsp 3 4_5_3 3000
$ns at 0.7
"$LSRmpls1 bind-flow-erlsp 4 -1
$ns at 0.9
C10
"3000
ﺩﺳﺘﻮﺭ C8ﺩﺭ ﺍﻳﻦ ﻛﺪ ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﮔﺮﻩ LSR3ﭘﻴﻐﺎﻡ ldp-withdrawﺭﺍ ﺑﻪ ﻫﻤﻪ ﮔﺮﻩﻫﺎﻱ UpStreamﺧﻮﺩ ﺑﻪ ﻣﻨﻈﻮﺭ ﺣﺬﻑ ﻣﺴﻴﺮ ﺑﻪ ﻣﻘﺼﺪ ۳ﺍﺭﺳﺎﻝ ﻛﻨﺪ. ﺩﺳﺘﻮﺭ C9ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﺎ ﻣﺸﺨﺼﻪ ۳۰۰۰ﺍﺯ ﮔﺮﻩ LSR1ﺑﻪ ﻣﻘﺼﺪ ﮔﺮﻩ ۳ﻭ ﺑﺎ ﻣﺴﻴﺮ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺳﺎﺧﺘﻪ ﺷﻮﺩ. ﺩﺳﺘﻮﺭ C10ﻓﻠﻮﻫﺎﻱ ﺑﺎ ) FECﺩﺭ ﺍﻳﻨﺠﺎ ﻫﻤﺎﻥ ﻣﻘﺼﺪ ﺍﺳﺖ( ﻭ ﺑﺎ ﻣﺸﺨﺼﻪ ﻓﻠﻮ –)۱ﻳﻌﻨﻲ ﺑﺴﺘﻪﻫﺎ Flow-idﻧﺪﺍﺭﻧﺪ(ﺭﺍ ﺑﻪ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﺎ ﻣﺸﺨﺼﻪ ۳۰۰۰ﻣﺘﺼﻞ ﻣﻲ ﻛﻨﺪ. ﺑﺮﺍﻱ ﺍﺯ ﺑﻴﻦ ﺭﻓﺘﻦ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﻣﻲﺗﻮﺍﻥ ﺍﺯ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﺩ "3000
$ns at 1.1 "$LSRmpls1 send-crldp-release-msg
ﺑﺎ ﺍﺿﺎﻓﻪ ﺷﺪﻥ ﺩﺳﺘﻮﺭ C9 ،C8ﻭ C10ﺟﺪﺍﻭﻝ ﮔﺮﻩ ۱ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﻣﻲ ﺷﻮﻧﺪ.
NS-2 ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ
٧٥‐٤
PFT ‐ ﺟﺪﻭﻝ۱ FEC
Fid
Prio
LIBptr
SLIBptr
AlternativePath
2
-1
0
0
-1
-1
4
-1
0
1
-1
-1
5
-1
0
3
-1
-1
6
-1
0
2
-1
-1 ERB ‐ ﺟﺪﻭﻝ۲
FEC
LspId
LIBptr
SLIBptr
QoSid
3
300
2
-1
-1
aPATHptr iLable iIFace -1
-1
-1
FailNext *
ﻭ ﻣﺸﺨﺼﺎﺕ. ﻣﻨﺘﻘﻞ ﺷﻮﻧﺪ3000 ﺑﺎﻳﺪ ﺍﺯ ﻣﺴﻴﺮ ﺑﻪ ﻣﺸﺨﺼﻪ3 ﺍﻳﻦ ﺟﺪﻭﻝ ﻣﻲﮔﻮﻳﺪ ﺑﺴﺘﻪﻫﺎﻱ ﺑﻪ ﻣﻘﺼﺪ . ﻗﺮﺍﺭ ﺩﺍﺭﺩLIB ﺟﺪﻭﻝ۲ ﻣﺮﺑﻮﻁ ﺑﻪ ﺍﻳﻦ ﻣﺴﻴﺮ ﺩﺭ ﺭﺩﻳﻒ ﺷﻤﺎﺭﻩ LIB ‐ ﺟﺪﻭﻝ۳
#
iIFace
iLable
oIface
oLabel
LIBptr
Linkerror?
0
-1
1
2
0
-1
-1
1
-1
2
4
0
-1
-1
2
-1
-1
4
7
-1
-1
3
-1
4
4
2
-1
-1
4
-1
5
2
4
-1
-1
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧٦‐٤
٢‐٤‐٤ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ١‐٢‐٤‐٤ﻣﺴﻴﺮﻫﺎﻱ CR-LSP ﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﻧﺤﻮﻩ ﺍﺭﺍﺋﻪ ﺳﺮﻭﻳﺲ ﺑﻪ ﻛﻼﺳﻬﺎﻱ ﻣﺨﺘﻠﻒ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺑﺎ ﻣﺜﺎﻟﻲ ﺗﺸﺮﻳﺢ ﻣﻲﻛﻨﻴﻢ.١ MPLS Domain
ﺷﻜﻞ ١٢‐١
ﺗﻮﭘﻮﻟﻮﮊﻱ ﺷﻜﻞ ۱۲‐۱ﺭﺍ ﺩﺭ ﻧﻈﺮ ﺑﮕﻴﺮﻳﺪ ﮔﺮﻩ Node0ﻣﻲﺧﻮﺍﻫﺪ ﺗﺮﺍﻓﻴﻜﻬﺎﻳﻲ ﺑﺎ ﺳﺮﻭﻳﺴﻬﺎﻱ ﻣﺘﻤﺎﻳﺰ ﺑﻪ ﮔﺮﻩ Node4ﺍﺭﺳﺎﻝ ﻛﻨﺪ .ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﺭ ﺷﻜﻞ ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ ﺗﺮﺍﻓﻴﻜﻬﺎﻳﻲ ﺑﺎ ﺳﺮﻭﻳﺴﻬﺎﻱ RT ،HBT ،SBTﻗﺮﺍﺭ ﺍﺳﺖ ﻣﻨﺘﻘﻞ ﺷﻮﻧﺪ .ﻧﻮﻉ ﺗﺮﺍﻓﻴﻚ ﺑﺮﺍﻱ ﻫﻤﻪ ﺳﺮﻭﻳﺴﻬﺎ CBRﻭ ﻧﺮﺥ ﺁﻧﻬﺎ 250Kbsﺍﺳﺖ .ﺑﻪ ﺟﺰ RT1ﻛﻪ ﻧﺮﺥ ﺁﻥ 350Kbsﻭ RT2ﻛﻪ ﻧﺮﺥ ﺁﻥ 420Kbsﺍﺳﺖ .ﺑﻨﺎﺑﺮﺍﻳﻦ ﻣﺠﻤﻮﻉ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﭼﻬﺎﺭ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺩﺭ ﺩﺳﺘﺮﺱ ﺑﻴﻦ ﮔﺮﻩ LSR1ﻭ LSR2ﺑﻴﺸﺘﺮ ﺍﺳﺖ.
ﻗﺴﻤﺘﻬﺎﻱ ﻣﺨﺘﻠﻒ ﺑﺮﻧﺎﻣﻪ:
‐۱ﻟﻴﻨﻜﻬﺎﻱ ﺑﻴﻦ ﮔﺮﻩ ﻫﺎ 10ms DropTail 10ms CBQ 10ms CBQ 10ms DropTail
$LSR1 2Mb $LSR2 1Mb $LSR3 1Mb $Node4 1Mb
$ns duplex-link $Node0 $ns duplex-link $LSR1 $ns duplex-link $LSR2 $ns duplex-link $LSR3
ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﺭ ﻛﺪ ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ ﻟﻴﻨﻚ ﺑﻴﻦ ﮔﺮﻩﻫﺎﻱ MPLSﺑﺎﻳﺪ ﺍﺯ ﻧﻮﻉ ﺻﻒ CBQﺗﻌﺮﻳﻒ ﺷﻮﺩ. ‐۲ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺻﻒ CBQﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﺍﻧﻮﺍﻉ ﻛﻼﺳﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ {#configure-cbq-for-SBTS {qlim cbq_qtype okborrow bw maxidle extradelay $ns cfg-cbq-for-SBTS 10 DropTail 1 0.1 auto 0 C1 $ns cfg-cbq-for-HBTS 10 DropTail 1 0.05 auto 0 $ns cfg-cbq-for-RTS 10 DropTail 0 0.8 auto 0 1آﺪ آﺎﻣﻞ اﻳﻦ ﻣﺜﺎل دردارآﺘﻮري mnsﻣﻮﺟﻮد اﺳﺖ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧٧‐٤ 0.05 auto
0
1
10 DropTail
$ns cfg-cbq-for-STS
$ns bind-flowid-to-SBTS 100 C2 $ns bind-flowid-to-SBTS 200 $ns bind-flowid-to-SBTS 300 $ns bind-flowid-to-SBTS 400 $ns bind-ldp-to-STS
ﺩﺳﺘﻮﺭ C1ﺭﻭﻱ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﺳﺮﻭﻳﺲ SBTSﺭﺍ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﺪ .ﺩﺭ ﺍﻳﻦ ﺻﻮﺭﺕ ﺗﺮﺍﻓﻴﻚﻫﺎﻳﻲ ﻛﻪ ﻗﺮﺍﺭ ﺍﺳﺖ ﺑﻪ ﺁﻧﻬﺎ ﺳﺮﻭﻳﺲ SBTSﺩﺍﺩﻩ ﺷﻮﺩ ﻭﺍﺭﺩ ﺻﻒ ﺍﺯ ﻧﻮﻉ DropTail ﻣﻲﺷﻮﻧﺪ ﻛﻪ ﻃﻮﻝ ﺻﻒ 10ﺑﺴﺘﻪ ﺍﺳﺖ ﻭ 0.1ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺭﺍ ﻣﻲﺗﻮﺍﻧﻨﺪ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻨﺪ ﻭ ﺩﺭ ﺻﻮﺭﺗﻲ ﻛﻪ ﭘﺪﺭ ﺁﻥ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺍﺿﺎﻓﻲ ﺩﺍﺷﺘﻪ ﺑﺎﺷﺪ ﻣﻲﺗﻮﺍﻧﻨﺪ ﺍﺯ ﺁﻥ ﻧﻴﺰ ﺍﺳﺘﻔﺎﺩﻩ ﻛﻨﻨﺪ. ﺩﺳﺘﻮﺭﻫﺎﻱ ﺑﻌﺪﻱ ﺑﻪ ﻫﻤﻴﻦ ﺗﺮﺗﻴﺐ ﺳﺮﻭﻳﺴﻬﺎﻱ RTS ،HBTSﻭ STSﺭﺍ ﺭﻭﻱ ﻫﻤﻪ ﮔﺮﻩﻫﺎﻱ MPLSﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﻨﺪ. ﺗﻮﺳﻂ ﺩﺳﺘﻮﺭ C2ﺑﻪ ﻓﻠﻮﻫﺎﻱ ﺑﺎ ﻣﺸﺨﺼﻪ 100ﺩﺭ ﮔﺮﻩﻫﺎﻱ MPLSﺳﺮﻭﻳﺲ SBTSﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ .ﻭ ﺑﻪ ﻫﻤﻴﻦ ﺗﺮﺗﻴﺐ ﺩﺭ ﺩﺳﺘﻮﺭﻫﺎﻱ ﺑﻌﺪﻱ ﺑﻪ ﻓﻠﻮﻫﺎﻱ ﺑﺎ ﻣﺴﺨﺼﻪ 300 ،200ﻭ 400 ﺳﺮﻭﻳﺴﻬﺎﻱ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ. -٣ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﺳﺎﺧﺘﻦ ﻣﺴﻴﺮﻫﺎﻱ cr-lsp
C1
"$ns at 0.1 "$LSRmpls1 setup-erlsp 3 1_2_3 1000 "$ns at 0.1 "$LSRmpls1 setup-erlsp 3 1_2_3 1100
### {#RtModule/MPLS instproc setup-crlsp {fec er lspid TRate BSize PSize SPrio HPrio # "$ns at 0.1 "$LSRmpls1 setup-crlsp 3 1_2_3 1200 350K 400B 200B 7 3 C2 "$ns at 1.0 "$SBT start "$ns at 1.0 "$HBT start "$ns at 1.0 "$RT1 start {#RtModule/MPLS instproc setup-crlsp {fec er lspid TRate BSize PSize SPrio HPrio # $ns at 10.0 "$LSRmpls1 setup-crlsp 3 1_2_3 1300 450K 400B 200B 7 3" C3
ﺩﺭ ﺩﺳﺘﻮﺭ C1ﻭ ﺩﺳﺘﻮﺭ ﺑﻌﺪ ﺍﺯ ﺁﻥ ﺩﻭ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﺎ ﻣﺸﺨﺼﻪﻫﺎﻱ 1000ﻭ 1100ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C2ﻭ C3ﺩﻭ cr-lspﺑﺎ ﻣﺸﺨﺼﻪﻫﺎﻱ 1200ﻭ 1300ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ .ﻛﻪ ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ﻭ ﻧﮕﻬﺪﺍﺭﻱ ﺍﻳﻦ ﺩﻭ ﻣﺴﻴﺮ ﻳﻜﺴﺎﻥ ﺍﺳﺖ ﻭ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮ ﺑﺎ ﻣﺸﺨﺼﻪ 1200ﺑﺮﺍﺑﺮ 350ﻛﻴﻠﻮ ﺑﺎﻳﺖ ﻭ ﺑﺮﺍﻱ ﻣﺴﻴﺮ ﺑﺎ ﻣﺸﺨﺼﻪ 1300ﺑﺮﺍﺑﺮ 450ﻛﻴﻠﻮ ﺑﺎﻳﺖ ﻣﻲﺑﺎﺷﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧٨‐٤
‐۴ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﺍﺗﺼﺎﻝ ﻓﻠﻮﻫﺎ ﺑﻪ ﻣﺴﻴﺮﻫﺎ ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﮔﻔﺘﻪ ﺷﺪ ﺯﻣﺎﻧﻴﻜﻪ ﭘﻴﻐﺎﻡ CR-LDP Mappingﻣﺮﺑﻮﻁ ﺑﻪ ﻣﺴﻴﺮﻱ ﺑﺎ ﻣﺸﺨﺼﻪ lspidﺑﻪ ﮔﺮﻫﻲ ﺑﺎ ﻣﺸﺨﺼﻪ nodeﺑﺮﺳﺪ ﺭﻭﺍﻝ } notify-erlsp-setup{node lspidﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ .ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻨﻜﻪ ﻣﺴﻴﺮ er-lspﻭ cr-lspﺗﻮﺳﻂ ﭘﺮﻭﺗﻜﻞ CR-LDPﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ ﻭ ﻫﻤﭽﻨﻴﻦ ﺑﺎ ﺩﺭ ﻧﻈﺮ ﮔﺮﻓﺘﻦ ﺍﻳﻨﻜﻪ؛ ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﻣﺴﻴﺮﻫﺎ ﺍﺯ ﮔﺮﻩ LSR1ﺷﺮﻭﻉ ﻣﻲﺷﻮﻧﺪ ،ﻣﻲﺗﻮﺍﻥ ﺍﻳﻦ ﺭﻭﺍﻝ ﺭﺍ ﺑﻪ ﮔﻮﻧﻪﺍﻱ ﺑﺎﺯﻧﻮﻳﺴﻲ ﻧﻤﻮﺩ ﻛﻪ ﺍﺯ ﺯﻣﺎﻥ ﺳﺎﺧﺘﻪ ﺷﺪﻥ ﺍﻳﻦ ﻣﺴﻴﺮﻫﺎ ﺍﻃﻼﻉ ﭘﻴﺪﺍ ﻛﺮﺩ ﻭ ﺳﭙﺲ ﺩﺭ ﺍﻳﻦ ﺯﻣﺎﻥ ﻣﻲﺗﻮﺍﻥ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺟﺮﺑﺎﻥ ﺧﺎﺻﻲ ﺭﺍ ﺑﻪ ﺍﻳﻦ ﻣﺴﻴﺮﻫﺎ ﻣﺘﺼﻞ ﻧﻤﻮﺩ .ﺩﺭ ﻛﺪ ﺯﻳﺮ ﺍﻳﻦ ﺭﻭﺍﻝ ﺑﺎﺯﻧﻮﻳﺴﻲ ﺷﺪﻩ ﺍﺳﺖ.
{ }proc notify-erlsp-setup {node lspid [set ns [Simulator instance "puts "[$ns now] nodeid=[$node id] : lspid=$lspid "[set module [$node get-module "MPLS { }if {[$node id] == 1 { switch $lspid {
1000
$module bind-flow-erlsp 4 100 $lspid } {1100 $module bind-flow-erlsp 4 200 $lspid 4 200 1
$module set-flow-prio } {1200
$module bind-flow-erlsp 4 300 $lspid } {1300 $module bind-flow-erlsp 4 400 $lspid } { default "puts "error
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٧٩‐٤ exit 1 } } } }
ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻛﺪ ﺑﺎﻻ ﺩﺭ ﺍﻳﻦ ﺭﻭﺍﻝ ﺑﺮﺭﺳﻲ ﻣﻲﺷﻮﺩ ﻛﻪ ﺍﮔﺮ ﻣﺸﺨﺼﻪ ﮔﺮﻩ ﺑﺮﺍﺑﺮ ﮔﺮﻩ LSR1ﺑﺎﺷﺪ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ﺟﺮﻳﺎﻥ ﺧﺎﺻﻲ ﺑﻪ ﺁﻥ ﻣﺘﺼﻞ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﻓﻠﻮ 300ﻭ 400ﻛﻪ ﻗﺮﺍﺭ ﺍﺳﺖ ﺑﻪ ﺻﻮﺭﺕ RTSﺳﺮﻭﻳﺲ ﺩﻫﻲ ﺷﻮﻧﺪ ﺑﻪ ﻣﺴﻴﺮﻫﺎﻱ cr-lspﻣﺘﺼﻞ ﻣﻲﺷﻮﻧﺪ ﻭ ﺍﺯ ﺍﻳﻦ ﻃﺮﻳﻖ ﻣﻨﺘﻘﻞ ﻣﻲﺷﻮﻧﺪ. ﻓﻠﻮﻫﺎﻱ 100ﻭ 200ﺑﻪ ﻣﺴﻴﺮﻫﺎﻱ er-lspﻣﺘﺼﻞ ﻣﻲﺷﻮﻧﺪ. ‐۵ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺑﺮﺍﻱ ﻫﺮ ﺗﺮﺍﻓﻴﻚ ﺷﻜﻞ ۱۳‐۱ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺭﺍ ﺑﺮﺍﻱ ﻫﺮ ﺳﺮﻭﻳﺲ ﺩﺭ ﻃﻮﻝ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺍﺳﺖ .ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﺭ ﺷﻜﻞ ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ RT1ﻭ RT2ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺧﻮﺩ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻨﺪ ﻭ HBTﻭ SBTﺍﺯ ﻣﺎﺑﻘﻲ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻧﻤﺎﻳﻨﺪ .ﺑﻴﻦ ﺯﻣﺎﻥ ﺻﻔﺮ ﺗﺎ ١٠ﺛﺎﻧﻴﻪ ﻭ ٣٠ﺗﺎ ٤٠ﻛﻪ ﻫﻨﻮﺯ ﺗﺮﺍﻓﻴﻚ RT2ﺷﺮﻭﻉ ﻧﺸﺪﻩ ﻳﺎ ﻣﺘﻮﻗﻒ ﺷﺪﻩ ﺍﺳﺖ HBTﻭ SBTﺗﻤﺎﻡ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺧﻮﺩ ﺭﺍ ﺑﺪﺳﺖ ﻣﻲﺁﻭﺭﺩ.
ﺷﻜﻞ ١٣‐١ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺗﻮﺳﻂ ﺗﺮﺍﻓﻴﻜﻬﺎ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
۲‐۲‐۴‐۴
٨٠‐٤
CR-LSPﺑﺎ ﺧﺼﻮﺻﻴﺖ ﺑﻪ ﺯﻭﺭ ﮔﺮﻓﺘﻦ ﻣﻨﺎﺑﻊ
ﺩﺭ ﻣﺜﺎﻝ ﻗﺒﻞ ﺍﻭﻟﻮﻳﺖ RT1ﻭ RT2ﻳﻜﺴﺎﻥ ﺑﻮﺩ ﺣﺎﻝ ﺍﮔﺮ ﻧﺮﺥ ﺗﺮﺍﻓﻴﻚ RT1ﺭﺍ ﺑﻪ 600Kﻭ ﻧﺮﺥ ﺗﺮﺍﻓﻴﻚ RT2ﺭﺍ ﺑﻪ 700Kﺗﻐﻴﻴﺮ ﺩﻫﻴﻢ ﻭ ﻧﻴﺰ ﻣﺴﻴﺮﻫﺎﻱ CR-LSPﺭﺍ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﺗﻐﻴﻴﺮ ﺩﻫﻴﻢ:
#MplsNode instproc setup-crlsp {fec er lspid TRate BSize PSize SPrio HPrio "$ns at 0.1 "$LSRmpls1 setup-crlsp 3 1_2_3 1200 600K 400B 200B 7 4 "$ns at 10.0 "$LSRmpls1 setup-crlsp 3 1_2_3 1300 700K 400B 200B 3 2
ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﺭ ﻛﺪ ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ RT1ﺩﺍﺭﺍﻱ ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ۷ﻭ ﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺍﺭﻱ ۴و RT2ﺩﺍﺭﺍﻱ ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ۳ﻭ ﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺭﻱ ۲ﺍﺳﺖ ﺑﻨﺎﺑﺮﺍﻳﻦ ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ RT2ﻛﻤﺘﺮ ﺍﺯ ﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺍﺭﻱ RT1
ﺍﺳﺖ)ﻳﻌﻨﻲ ﻧﺼﺐ RT2ﻧﺴﺒﺖ ﺑﻪ ﻧﮕﻬﺪﺍﺭﻱ RT1ﺩﺍﺭﺍﻱ ﺍﻭﻟﻮﻳﺖ ﺑﻴﺸﺘﺮﻱ ﺍﺳﺖ( ﺑﻨﺎﺑﺮﺍﻳﻦ RT2ﺩﺭ ﺯﻣﺎﻥ ﻧﺼﺐ ﺩﺭ ﺻﻮﺭﺕ ﻟﺰﻭﻡ )ﻳﻌﻨﻲ ﺍﮔﺮ ﻣﻨﺎﺑﻊ ﻛﺎﻓﻲ ﺩﺭ ﺩﺳﺘﺮﺱ ﻧﺒﺎﺷﺪ( ﻣﻲﺗﻮﺍﻧﺪ ﻣﻨﺎﺑﻊ ﺭﺍ ﺍﺯ RT1ﺑﮕﻴﺮﺩ .ﺩﺭ ﺯﻳﺮ ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺑﺮﺍﻱ ﺍﻳﻦ ﻗﺴﻤﺖ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ.
ﺷﻜﻞ ۱۴‐۱ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺗﻮﺳﻂ ﺗﺮﺍﻓﻴﻜﻬﺎ
ﻫﻤﺎﻧﻄﻮﺭ ﻛﻪ ﺩﺭ ﺷﻜﻞ ۱۴‐۱ﺩﻳﺪﻩ ﻣﻲﺷﻮﺩ ﺩﺭ ﺯﻣﺎﻥ ۱۱ﺛﺎﻧﻴﻪ ﻛﻪ RT2ﻣﻲﺧﻮﺍﻫﺪ ﻧﺼﺐ ﺷﻮﺩ ﺍﺯ ﺁﻧﺠﺎﻳﻲ ﻛﻪ ﻣﻨﺎﺑﻊ ﻛﺎﻓﻲ ﺩﺭ ﺩﺳﺘﺮﺱ ﻧﻴﺴﺖ ﻣﻨﺎﺑﻊ ﺭﺍ ﺍﺯ RT1ﻣﻲﮔﻴﺮﺩ ﻭ ﺍﺯ ﺍﻳﻦ ﺯﻣﺎﻥ ﺑﻪ ﺑﻌﺪ ﺑﻪ ﺻﻮﺭﺕ Best Effort
ﺳﺮﻭﻳﺲﺩﻫﻲ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٣‐٢‐٤‐٤
٨١‐٤
Constraint Based Routing
ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ cr-lspﻣﻲﺗﻮﺍﻥ ﺗﺎ ﺟﺎﻳﻴﻜﻪ ﻣﻤﻜﻦ ﺍﺳﺖ ﺑﻪ ﺗﺮﺍﻓﻴﻚ RTﺳﺮﻭﻳﺲ ﺩﺍﺩ ﻭﻟﻲ ﺗﻀﻤﻴﻨﻲ ﻭﺟﻮﺩ ﻧﺪﺍﺭﺩ ﻛﻪ ﺣﺘﻤﺎ ﺳﺮﻭﻳﺲ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺩﺍﺩﻩ ﺷﻮﺩ ﻳﺎ ﺧﻴﺮ .ﻳﻚ ﺭﺍﻩ ﻣﻄﻤﺌﻦ ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ Constraint Based Routingﺍﺳﺖ .ﺩﺭ ﺍﻳﻨﺠﺎ ﺑﺮﺭﺳﻲ ﻣﻲﺷﻮﺩﺁﻳﺎ ﻣﺴﻴﺮ ﻱ ﺑﺎ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﻭﺟﻮﺩ ﺩﺍﺭﺩ ﻳﺎ ﺧﻴﺮ ﺩﺭ ﺻﻮﺭﺗﻴﻜﻪ ﭼﻨﻴﻦ ﻣﺴﻴﺮﻱ ﻭﺟﻮﺩ ﺩﺍﺷﺖ ﺗﻮﺳﻂ cr-lspﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﭼﻨﻴﻦ ﻛﺎﺭﻱ ﺑﺎﻳﺪ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﻗﺎﺑﻠﻴﺖ ﺟﻤﻊﺁﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﻣﻨﺎﺑﻊ ﺭﺍ ﺩﺍﺷﺘﻪ ﺑﺎﺷﻨﺪ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺩﺭ ﻛﺪ ﺑﺎﻻ ﻣﻲﺗﻮﺍﻥ ﻣﺴﻴﺮ RT2ﺭﺍ ﺑﻪ ﺍﻳﻦ ﺻﻮﺭﺕ ﺗﻌﻴﻴﻦ ﻧﻤﻮﺩ ﺑﺮﺍﻱ ﺍﻳﻦ ﻣﻨﻈﻮﺭ ﻛﺪﻫﺎﻱ ﺯﻳﺮ ﺭﺍ ﺟﺎﻳﮕﺰﻳﻦ ﺩﺳﺘﻮﺭ setup cr-lspﺑﺮﺍﻱ ﻣﺴﻴﺮ ﺑﺎ ﻣﺸﺨﺼﻪ 1300ﻣﻲﻛﻨﻴﻢ.
C1
$ns collect-resource-info 4
set er [$sLSRmodule constraint-based-routing 3 700k] C2 { }if {$er != -1 puts "--> The result of constraint-based routing for lspid 1300 : Explicit "Route=$er C3
$sLSRmodule setup-crlsp 3 1300 $700k 400B 200B 7 3 } { else
puts "--> The result of constraint-based routing for lspid 1300 : "Explicit Route= No path }
ﺩﺭ ﺩﺳﺘﻮﺭ C1ﻗﺎﺑﻠﻴﺖ ﺟﻤﻊﺁﻭﺭﻱ ﺍﻃﻼﻋﺎﺕ ﻣﻨﺎﺑﻊ ﺩﺭ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ MPLSﻓﻌﺎﻝ ﻣﻲﺷﻮﺩ ﻭ ﮔﺮﻫـﻬﺎ ﻫﺮ ﺛﺎﻧﻴﻪ ﺍﻃﻼﻋﺎﺕ ﺭﺍﺟﻊ ﺑﻪ ﻣﻨﺎﺑﻊ ﺭﺍ ﺟﻤﻊﺁﻭﺭﻱ ﻣﻲﻛﻨﻨﺪ. ﺩﺭ ﺩﺳﺘﻮﺭ C2ﭘﻴﻐﺎﻣﻲ ﻣﺒﻨﻲ ﺑﺮ ﺗﻘﺎﺿﺎﻱ ﻣﺴﻴﺮﻱ ﺑﺎ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ 700kﻭ ﺑﻪ ﻣﻘﺼﺪ ﮔﺮﻩ ۳ﺍﺭﺳﺎﻝ ﻣﻲﺷﻮﺩ .ﺍﮔﺮ ﭼﻨﻴﻦ ﻣﺴﻴﺮﻱ ﻭﺟﻮﺩ ﺩﺍﺷﺖ ﻣﺴﻴﺮ ﺑﺮﮔﺮﺩﺍﻧﺪﻩ ﻣﻲﺷﻮﺩ ﻭ ﺩﺭ ﻏﻴﺮ ﺍﻳﻦ ﺻﻮﺭﺕ ﻋﺪﺩ -
1ﺑﺮﮔﺮﺩﺍﻧﺪﻩ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٨٢‐٤
ﺩﺭ ﺩﺳﺘﻮﺭ C3ﺩﺭ ﺻﻮﺭﺕ ﻭﺟﻮﺩ ﻣﺴﻴﺮ ،ﺁﻥ ﻣﺴﻴﺮ ﺍﺯ ﻃﺮﻳﻖ ﻓﺮﻣﺎﻥ setup-crlspﺑﺎ ﻣﺸﺨﺼﻪ 1300ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﺍﺯ ﺁﻧﺠﺎﻳﻴﻜﻪ ﺗﻨﻬﺎ ﻣﺴﻴﺮ ﻣﻮﺟﻮﺩ ﺩﺍﺭﺍﻱ 700kﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺩﺭ ﺩﺳﺘﺮﺱ ﻧﻴﺴﺖ ﻓﺮﻣﺎﻥ Costraint-based-routingﭼﻴﻨﻦ ﻣﺴﻴﺮﻱ ﭘﻴﺪﺍ ﻧﻤﻲﻛﻨﺪ.
٣‐٤‐٤ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ MPLSﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﺑﺎ ﻣﺜﺎﻟﻲ ﭼﮕﻮﻧﮕﻲ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺗﻜﻨﻴﻚ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ mnsﺗﺸﺮﻳﺢ ﻣﻲﺷﻮﺩ .ﻓﺮﺽ ﻛﻨﻴﺪ ﺗﻮﭘﻮﻟﻮﮊﻱ ﺷﻜﻞ ١٥‐١ﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺍﺳﺖ ﻭ ﻗﺮﺍﺭ ﺍﺳﺖ ﺗﺮﺍﻓﻴﻜﻲ ﺍﺯ Node0ﺑﻪ Node19ﺍﺭﺳﺎﻝ ﺷﻮﺩ.
ﺷﻜﻞ ١٥‐١
ﻛﺪ ﺯﻳﺮ ﻳﻚ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺑﻪ ﻃﻮﺭ ﺻﺮﻳﺢ ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻜﻲ ﻛﻪ ﻗﺮﺍﺭ ﺍﺳﺖ ﺍﺯ ﮔﺮﻩ ﺻﻔﺮ ﺑﻪ ﮔﺮﻩ ٩ﺭﺳﺎﻝ ﺷﻮﺩ ﺭﺍ ﻣﻲﺳﺎﺯﺩ ﻭ ﺩﺳﺘﻮﺭﺍﺕ ﺍﻭﻟﻴﻪ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺭﺍ ﻓﻌﺎﻝ ﻣﻲﻛﻨﺪ ﺑﺮﺍﻱ ﭘﺸﺘﻴﺒﺎﻧﻲ ﺍﺯ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺩﺭ MNSﺍﺑﺘﺪﺍ ﺑﺎﻳﺪ ﮔﺮﻩﻫﺎﻱ MPLSﺭﺍ ﻃﻮﺭﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻧﻤﻮﺩ ﺗﺎ ﺍﺯ ﺍﺗﻔﺎﻕ ﺍﻓﺘﺎﺩﻥ ﺧﺮﺍﺑﻲ ﺩﺭ ﻣﻨﺎﺑﻊ ﺍﻃﻼﻉ ﭘﻴﺪﺍ ﻛﻨﻨﺪ .ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﺩﺳﺘﻮﺭ C1ﺍﻳﻦ ﻛﺎﺭ ﺭﺍ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ .ﺩﺳﺘﻮﺭ C1ﺗﻤﺎﻡ ﮔﺮﻩ ﻫﺎﻱ MPLSﺭﺍ ﻃﻮﺭﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﺪ ﻛﻪ ﺍﺯ ﺯﻣﺎﻥ ١,٩ﺛﺎﻧﻴﻪ ﺗﺎ ﺯﻣﺎﻥ ١٠٠٠ﺛﺎﻧﻴﻪ ﻫﺮ ۰,۰۱ﺛﺎﻧﻴﻪ ﻭﺿﻌﻴﺖ ﻟﻴﻨﻜﻬﺎ ﺭﺍ ﺍﺯ ﻧﻈﺮ ﺧﺮﺍﺑﻲ ﺑﺮﺭﺳﻲ ﻣﻲﻛﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٨٣‐٤
ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺗﻜﻨﻴﻚ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ Mackamﻭ Hashkinﻧﻴﺎﺯ ﺍﺳﺖ ﮔﺮﻩ PML
)ﺑﻪ ﻋﺒﺎﺭﺕ ﺩﻳﮕﺮ ﮔﺮﻫﻲ ﻛﻪ ﺩﺭ ﺻﻮﺭﺕ ﺧﺮﺍﺏ ﺷﺪﻥ ﻳﻚ ﻟﻴﻨﻚ ،ﺑﻴﻦ ﮔﺮﻩ ﻣﺒﺪﺍ ﻭ ﺍﻳﻦ ﮔﺮﻩ ﻣﺴﻴﺮ ﺟﺪﻳﺪ ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ( ﻣﺸﺨﺺ ﺷﻮﺩ .ﺩﺳﺘﻮﺭ LSR ،C2ﺷﻤﺎﺭﻩ ٩ﺭﺍ ﺑﻪ ﻋﻨﻮﺍﻥ PMLﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﺪ.
ﺩﺳﺘﻮﺭ ﻗﺴﻤﺖ Part1ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﻴﻦ ﮔﺮﻩ ١ﻭ ﮔﺮﻩ ۱۰ﻣﻲﺳﺎﺯﺩ ﻛﻪ ﻣﺸﺨﺼﻪ ﺍﻳﻦ ﻣﺴﻴﺮ ﺑﺮﺍﺑﺮ ﺑﺎ ۱۰۰۰ﺍﺳﺖ .ﻭ ﺍﺯ ﺍﻳﻦ ﻣﺴﻴﺮ ﻣﻲﺗﻮﺍﻥ ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻜﻬﺎﻳﻲ ﻛﻪ ﺍﺯ ﮔﺮﻩ ١ﻣﻲ ﺧﻮﺍﻫﻨﺪ ﺑﻪ ﮔﺮﻩ ۱۰ ﺑﺮﻭﺩ ﻣﻲﺗﻮﺍﻧﺪ ﺍﺳﺘﻔﺎﺩﻩ ﻧﻤﻮﺩ. ﺩﺳﺘﻮﺭ ﻗﺴﻤﺖ Part2ﻳﻚ ﻣﺴﻴﺮ ﻣﻘﻴﺪ ﻛﻪ ﺻﺮﺍﺣﺘﺎ ﺍﻋﻼﻡ ﺷﺪﻩ ﺍﺳﺖ ﺭﺍ ﺑﺎ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ، ۱۰۰۰ ﺍﻧﺪﺍﺯﻩ ﺑﺎﻓﺮ ،500kﺍﻧﺪﺍﺯﻩ ﺑﺎﻓﺮ 400ﺑﺎﻳﺖ ﺑﺮﺍﻱ ﺑﺴﺘﻪ ﻫﺎﻱ ﺑﻪ ﺍﻧﺪﺍﺯﻩ 200ﺑﺎﻳﺖ ﺭﺯﺭﻭ ﻣﻲﻛﻨﺪ .ﺍﻭﻟﻮﻳﺖ ﻧﺼﺐ ﺍﻳﻦ ﻣﺴﻴﺮ ﺑﺮﺍﺑﺮ ٧ﻭ ﺍﻭﻟﻮﻳﺖ ﻧﮕﻬﺪﺍﺭﻱ ﺍﻳﻦ ﻣﺴﻴﺮ ﺑﺮﺍﺑﺮ ۵ﻣﻲﺑﺎﺷﺪ. ﺩﺳﺘﻮﺭ C3ﻣﺴﻴﺮ ﺳﺎﺧﺘﻪ ﺷﺪﻩ ﺑﺎ ﻣﺸﺨﺼﻪ ١٠٠٠ﺭﺍ ﺩﺭ ﺯﻣﺎﻥ ٠,٤ﺛﺎﻧﻴﻪ ﺑﻪ ﻓﻠﻮﻫﺎﻱ ﺑﻪ ﻣﻘﺼﺪ ۱۹ﻭ ﻣﺸﺨﺼﻪ ﻓﻠﻮ ١٠٠ﻣﺘﺼﻞ ﻣﻲﻛﻨﺪ .ﺍﺯ ﺍﻳﻦ ﺯﻣﺎﻥ ﺑﻪ ﺑﻌﺪ ﺍﻳﻦ ﻓﻠﻮﻫﺎ ﺍﺯ ﻣﺴﻴﺮ ١٠٠٠ﺍﻧﺘﻘﺎﻝ ﻣﻲﻳﺎﺑﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
١‐٣‐٤‐٤
٨٤‐٤
ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺭﻭﺵ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ Hashkin
ﺍﺑﺘﺪﺍ ﺩﺭ ﺩﺳﺘﻮﺭ C1ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ ﺍﺯ ﻧﻮﻉ Dropﻓﻌﺎﻝ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C2ﻳﻚ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺍﺯ (PIL)LSR1ﺑﻪ PML)LSR9ﻛﻪ ﺩﺭ ﻛﺪ LSR9 ۱ﺑﻌﻨﻮﺍﻥ PMLﭘﻴﻜﺮﺑﻨﺪﻱ ﺷﺪﻩ ﺑﻮﺩ( ﺑﺎ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ٢٠٠٠ﻭ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C3ﻳﻚ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺍﺯ (PML)LSR9ﺑﻪ (PIL)LSR1ﺑﺎ ﻣﺸﺨﺼﻪ ﻣﺴﻴﺮ ٢٠٠۵ﻭ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﻛﻪ ﺑﻪ ﻣﺴﻴﺮ 2000 PIL → PMLﻣﺘﺼﻞ ﺷﺪﻩ ﺍﺳﺖ ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C4ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺑﺎ ﻣﺸﺨﺼﻪ ١٠٠٠ﺑﻪ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ) ( PIL → PMLﻣﺘﺼﻞ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C5ﻣﺴﻴﺮ ﺍﺻﻠﻲ ١٠٠٠ﺩﺭ ﻃﻮﻝ ﺗﻤﺎﻡ ﮔﺮﻩﻫﺎﻱ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ) ( PIL → PMLﺑﻪ ﻣﺴﻴﺮ ( PML → PIL )۲۰۰۵ﻣﺘﺼﻞ ﻣﻲﺷﻮﺩ.
ﺩﺭ ﺍﻳﻦ ﺻﻮﺭﺕ ﺍﮔﺮ ﺑﻴﻦ ﻫﺮ ﺩﻭ ﮔﺮﻩ ﻣﺸﺨﺺ ﺷﺪﻩ ﺩﺭ ﻣﺴﻴﺮ ١٠٠٠ﺧﺮﺍﺑﻲ ﺍﺗﻔﺎﻕ ﺑﻴﺎﻓﺘﺪ .ﺑﺴﺘﻪ ﻫﺎ ﺍﺯ ﻫﻤﺎﻥ ﮔﺮﻩ ﺑﻪ ﺳﻤﺖ LSR1ﺑﺮﻣﻲﮔﺮﺩﻧﺪ ﻭ ﺳﭙﺲ ﺍﺯ ﻣﺴﻴﺮ ٢٠٠٠ﺑﻪ ﮔﺮﻩ LSR9ﺍﻧﺘﻘﺎﻝ ﻣﻲﻳﺎﺑﻨﺪ .ﺩﺭ ﺻﻮﺭﺕ ﺑﺮ ﻃﺮﻑ ﺷﺪﻥ ﺧﺮﺍﺑﻲ ﺑﺴﺘﻪﻫﺎ ﻣﺠﺪﺩﺍ ﺍﺯ ﻣﺴﻴﺮ ١٠٠٠ﺍﻧﺘﻘﺎﻝ ﻣﻲﻳﺎﺑﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٢‐٣‐٤‐٤
٨٥‐٤
ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﺭﻭﺵ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ Makam C1
ﺩﺭ ﺩﺳﺘﻮﺭ C1ﺭﻭﺵ ﻣﺴﻴﺮﻳﺎﺑﻲ notify-prenegotiatedﻓﻌﺎﻝ ﻣﻲﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C2ﻳﻚ ﻣﺴﻴﺮ ﺻﺮﻳﺢ ﺑﻴﻦ PILﺑﻪ PMLﺑﺎ ﻣﺸﺨﺼﻪ ۲۰۰۰ﺳﺎﺧﺘﻪ ﻣﻲﺷﻮﺩ ﻛﻪ ﺍﺯ ﺍﻳﻦ ﻣﺴﻴﺮ ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﻗﺮﺍﺭ ﺍﺳﺖ ﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﺩ. ﺩﺭ ﺩﺳﺘﻮﺭ C3ﻣﺴﻴﺮ ۲۰۰۰ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ،ﻗﺮﺍﺭ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ. ﻣﺠﻤﻮﻋﻪ ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﺑﺎﻋﺚ ﻣﻲﺷﻮﺩ ﺯﻣﺎﻧﻲ ﻛﻪ ﺧﺮﺍﺑﻲ ﺩﺭ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺍﺗﻔﺎﻕ ﺑﻴﺎﻓﺘﺪ ﭘﻴﻐﺎﻡ Notificationﺑﻪ ﺭﻭﺗﺮ PILﺩﺍﺩﻩ ﺷﻮﺩ ﻭ ﭘﺲ ﺍﺯ ﺁﻥ ﻣﺴﻴﺮ ﭘﺸﺘﻴﺒﺎﻥ ﺟﺎﻳﮕﺰﻳﻦ ﻣﺴﻴﺮ ﺍﺻﻠﻲ ﺧﻮﺍﻫﺪ ﺷﺪ. ۳‐۳‐۴‐۴ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ Simple-Dynamic
٤‐٣‐٤‐٤
ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ shortest-dynamic shortest-dynamic
٥‐٣‐٤‐٤
enable-reroute
$ns
ﻛﺪ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻣﺴﻴﺮﻳﺎﺑﻲ ﻣﺠﺪﺩ L3
L3
enable-reroute
$ns
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
.٥
٨٦‐٥
ﻣﻜﺎﻧﻴﺰم Diffrentiated Serviceدر NS-2 ﺩﺭ ﺍﻳﻦ ﻓﺼﻞ ﻣﺎﺟﻮﻝ DiffServﺩﺭ ﺷﺒﻴﻪﺳﺎﺯ NS-2ﺑﺮﺭﺳﻲ ﻣﻲﺷﻮﺩ DiffServ.ﺍﺯ ﻣﻜﺎﻧﻴﺰﻡﻫﺎﻱ
ﭘﻴﺸﻨﻬﺎﺩﻱ ﺗﻮﺳﻂ IETFﺑﺮﺍﻱ ﺍﺭﺍﺋﻪ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺩﺭ ﺷﺒﻜﻪ IPﻣﻲﺑﺎﺷﺪ ﻭ ﺭﺍﻩ ﺣﻠﻲ ﺩﺭ ﻻﻳﻪ ۳ﻣﻲﺑﺎﺷﺪ. DiffServﺍﻣﻜﺎﻥ ﺍﺭﺍﺋﻪ ﺳﻄﻮﺡ ﻣﺨﺘﻠﻒ ﺳﺮﻭﻳﺲﺩﻫﻲ ﺭﺍ ﻣﻴﺴﺮ ﻣﻲﺳﺎﺯﺩ ﻭ ﺑﻨﺎﺑﺮﺍﻳﻦ ﻛﻴﻔﻴﺖ ﺳﺮﻭﻳﺲ ﺭﺍ ﺩﺭ ﻳﻚ ﻣﺤﻴﻂ ﺑﻲﺍﺗﺼﺎﻝ ﺍﺭﺍﺋﻪ ﻣﻲﺩﻫﺪ .ﺑﻌﺒﺎﺭﺗﻲ ﺩﻳﮕﺮ DiffServﻧﮕﺎﺷﺖ ﻛﻼﺱﻫﺎﻱ ﻣﺨﺘﻠﻒ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺑﻪ ﻓﻴﻠﺪ DSCPﺑﺴﺘﻪ IPﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ .ﻭ ﺭﻭﺗﺮﻫﺎ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻣﻘﺪﺍﺭ ﺍﻳﻦ ﻓﻴﻠﺪ ﺭﻓﺘﺎﺭﻫﺎﻱ ﺍﺯ ﭘﻴﺶ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺭﺍ ﺑﺎ ﻛﻼﺳﻬﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﻨﺪ.
۱‐۵
ﻣﺎﺟﻮﻝ DiffServﺩﺭ NS-2
DiffServﺑﻪ ﺩﻭ ﺭﻭﺵ ﺩﺭ NS-2ﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ: • ﺗﻮﺳﻂ ﺷﺮﻛﺖ Nortelﻛﻪ ﺩﺭ NS-2-1b9aﻧﺼﺐ ﺷﺪﻩ ﺍﺳﺖ. ﺗﻮﺳﻂ Sean Murphyﻛﻪ ﺗﺎ ﺑﻪﺣﺎﻝ ﺗﻨﻬﺎ ﺩﺭ Ns-2-1b6aﻧﺼﺐ ﺷﺪﻩ ﺍﺳﺖ. DiffServﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺗﻮﺳﻂ Sean Morphyﺑﺎ MPLSﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺗﻮﺳﻂ Gaeil Ahnﻣﺠﺘﻤﻊ ﺷﺪﻩ ﺍﺳﺖ ١ﻭ ﺑﻮﺳﻴﻠﻪ ﺍﻳﻦ ﺩﻭ ﻣﻲﺗﻮﺍﻥ MPLSﺭﺍ ﺑﺎ DiffServﺑﺎ ﻫﻢ ﺑﻜﺎﺭﺑﺮﺩ .ﻭﻟﻲ DiffServﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺗﻮﺳﻂ ﺷﺮﻛﺖ Nortelﻫﻨﻮﺯ ﺑﺎ ﻫﻴﭻ ﭘﻴﺎﺩﻩﺳﺎﺯﻱ MPLSﻣﺠﺘﻤﻊ ﻧﺸﺪﻩ ﺍﺳﺖ. ﺩﺭ ﺍﻳﻦ ﮔﺰﺍﺭﺵ ﻣﺎﺟﻮﻝ DiffServﻛﻪ ﺗﻮﺳﻂ ﺷﺮﻛﺖ Nortelﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ؛ ﺭﺍ ﺷﺮﺡ ﻣﻲﺩﻫﻴﻢ.
٢-۵
ﻣﻌﻤﺎري ﻣﺎﺟﻮل DiffServ
ﺍﻳﻦ ﻣﺎﺟﻮﻝ ﺳﻪ ﺟﺰﺀ ﺍﺻﻠﻲ ﺩﺍﺭﺩ: • :Policingﺳﻴﺎﺳﺖﻫﺎﻳﻲ ﺍﺳﺖ ﻛﻪ ﺑﺎﻳﺪ ﺗﻮﺳﻂ ﻣﺪﻳﺮ ﺷﺒﻜﻪ ﺗﻌﺮﻳﻒ ﺷﻮﺩ ﻭ ﻣﺸﺨﺺ ﻣﻲﻛﻨﺪ ﻛﻪ ﻳﻚ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﭼﻪ ﺳﻄﻮﺡ ﺳﺮﻭﻳﺴﻲ ﺭﺍ ﺑﺎﻳﺪ ﺍﺯﺷﺒﻜﻪ ﺩﺭﻳﺎﻓﺖ ﻛﻨﺪ.
1ﺍﻳﻦ ﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﻛﺎﻣﻞ ﻧﻴﺴﺖ
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٨٧‐٥
• :Edge Routerﺭﻭﺗﺮ ﻟﺒﻪ ﺩﺭ ﺣﻮﺯﻩ DiffServﺍﺳﺖ ﻛﻪ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻭﺭﻭﺩ ﺑﺴﺘﻪ ﻳﺎ ﺧﺮﻭﺝ ﺑﺴﺘﻪ ﺑﻪ ﺣﻮﺯﻩ ،DiffServﺑﺴﺘﻪﻫﺎﻱ IPﺭﺍ ﺑﻮﺳﻴﻠﻪ ﻳﻚ ﻛﺪ ﻛﻪ ﺑﺎ ﺳﻴﺎﺳﺖ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ Policing
ﻣﻄﺎﺑﻘﺖ ﺩﺍﺭﺩ ﻋﻼﻣﺖﮔﺬﺍﺭﻱ ﻣﻲﻛﻨﺪ ﻭ ﻳﺎ ﻋﻼﻣﺖ ﺭﺍ ﺍﺯ ﺭﻭﻱ ﺑﺴﺘﻪﻫﺎ ﺑﺮﻣﻲﺩﺍﺭﺩ. • : Core Routerﺭﻭﺗﺮﻫﺎﻱ ﻫﺴﺘﻪ ﺩﺭ ﺣﻮﺯﻩ DiffServﻫﺴﺘﻨﺪ ﻛﻪ ﻧﺤﻮﻩ ﺭﻓﺘﺎﺭ ﺑﺎ ﺳﻄﻮﺡ ﻣﺨﺘﻠﻒ ﻛﻼﺳﻬﺎﻱ ﺳﺮﻭﻳﺲ ﺩﺭ ﺁﻧﻬﺎ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺍﺳﺖ ﻭ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻛﺪ ﺑﺴﺘﻪ ﺳﺮﻭﻳﺲ ﻣﻨﺎﺳﺐ ﺭﺍ ﺑﻪ ﺁﻥ ﻣﻲﺩﻫﻨﺪ. ﺍﻳﻦ ﻋﻤﻠﻴﺎﺗﻬﺎ ﺩﺭ ﺩﻧﻴﺎﻱ ﻭﺍﻗﻌﻲ ﺭﻭﻱ ﺭﻭﺗﺮﻫﺎ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﻧﺪ ﻭﻟﻲ ﺩﺭ ﺍﻳﻦ ﻣﺎﺟﻮﻝ DiffServﻋﻤﻠﻴﺎﺕ ﻣﺮﺑﻮﻁ ﺑﻪ ﺭﻭﺗﺮ ﻟﺒﻪ ﻭ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺭﻭﻱ ﻟﻴﻨﻜﻬﺎ ﻭ ﺍﺯ ﻃﺮﻳﻖ ﺻﻒ ﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩ ﺍﺳﺖ. ﺩﺭ ﻛﻞ ﻣﺎﺟﻮﻝ DiffServﭼﻨﺪ ﻛﻼﺱ ﺍﺻﻠﻲ ﺩﺍﺭﺩ .ﻛﻼﺱ ﺍﺻﻠﻲ ﺁﻥ ﻛﻼﺱ dsRedQueueﻣﻲﺑﺎﺷﺪ)ﺩﺭ ﻓﺎﻳﻞ (dsRedﻛﻪ ﻛﻼﺱ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ) (EdgeQueueﻭ ﻛﻼﺱ ﺭﻭﺗﺮﻫﺎﻱ ﻣﺮﻛﺰﻱ) (CoreQueueﺍﺯ ﺁﻥ ﻣﺸﺘﻖ ﺷﺪﻩﺍﻧﺪ .ﺍﺯ ﺁﻧﺠﺎﻳﻴﻜﻪ ﺩﺭ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ﺑﺎﻳﺪ ﺳﻴﺎﺳﺘﻬﺎ ﻗﺮﺍﺭ ﺩﺍﺩﻩ ﺷﻮﻧﺪ ﺗﺎ ﺑﺮ ﺍﺳﺎﺱ ﺁﻥ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﻋﻼﻣﺖﮔﺬﺍﺭﻱ ﻧﻤﺎﻳﻨﺪ ﻛﻼﺱ ﻟﺒﻪ ﻳﻚ ﻣﺘﻐﻴﺮ ﺍﺯ ﻛﻼﺱ PolicyClassifierﺩﺍﺭﺩ ﻛﻪ ﺍﻳﻦ ﻛﻼﺱ ﺷﺎﻣﻞ ﺳﻴﺎﺳﺖﻫﺎ ﻣﻲﺑﺎﺷﺪ.
۱‐۲‐۵ﻣﻌﻤﺎﺭﻱ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ﻭ ﻣﺮﻛﺰﻱ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ﻭ ﻣﺮﻛﺰﻱ ﺑﺮﺍﻱ ﺗﻤﺎﻳﺰ ﻗﺮﺍﺭ ﺩﺍﺩﻥ ﺑﻴﻦ ﺗﺮﺍﻓﻴﻜـﻬﺎﻱ ﻣﺨﺘﻠﻒ ﻭ ﺭﺩﻩﺑﻨﺪﻱ ﻛﻼﺳﻬﺎ ﺍﺯ ﺻﻔﻬﺎﻱ ﻣﺠﺎﺯﻱ ﻭ ﻓﻴﺰﻳﻜﻲ ﻛﻪ ﺩﺭ ﻛﻼﺱ dsRedQueueﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩﺍﻧﺪ ،ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻨﺪ .ﺗﻮﺳﻂ ﺍﻳﻦ ﻗﺎﺑﻠﻴﺖ ﻣﻲﺗﻮﺍﻥ ﻫﺮ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺑﻪ ﻳﻚ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ﻧﺴﺒﺖ ﺩﺍﺩ ﻭ ﻧﺤﻮﻩ ﺳﺮﻭﻳﺲﺩﻫﻲ ﺑﻪ ﺗﺮﺍﻓﻴﻜﻬﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻳﻚ ﻛﻼﺱ ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺻﻔﻬﺎﻱ ﻣﺠﺎﺯﻱ ﺍﻧﺠﺎﻡ ﺩﺍﺩ .ﺩﺭ ﻛﻞ ﻛﻼﺱ dsRedQueueﻗﺎﺑﻠﻴﺘﻬﺎﻱ ﺯﻳﺮ ﺭﺍ ﺑﻪ ﺭﻭﺗﺮﻫﺎﻱ ﻟﺒﻪ ﻭ ﻣﺮﻛﺰﻱ ﻣﻲﺩﻫﺪ: •
ﺍﻳﺠﺎﺩ ﭼﻨﺪﻳﻦ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ﺩﺭ ﻳﻚ ﻟﻴﻨﻚ
• ﺍﻳﺠﺎﺩ ﺟﻨﺪﻳﻦ ﺻﻒ ﻣﺠﺎﺯﻱ ﺩﺭ ﻳﻚ ﺻﻒ ﻓﻴﺰﻳﻜﻲ • ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺟﺪﻭﻟﻲ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ ﻫﺮ ﺑﺴﺘﻪ ﻣﺘﻌﻠﻖ ﺑﻪ ﻛﺪﺍﻡ ﺻﻒ ﻣﺠﺎﺯﻱ ﻭ ﻓﻴﺰﻳﻜﻲ ﺍﺳﺖ .ﻭ ﺑﺮ ﺍﺳﺎﺱ ﺁﻥ ﺑﺴﺘﻪ ﺭﺍ ﻭﺍﺭﺩ ﺻﻒ ﻣﻨﺎﺳﺐ ﻣﻲﻧﻤﺎﻳﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٨٨‐٥
• ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﻛﺪ ﺑﺴﺘﻪ ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﺑﺴﺘﻪ ﺭﺍ ﺗﻌﻴﻴﻦ ﻣﻴـﻜﻨﺪ ﻭ ﺑﺮ ﻃﺒﻖ ﺁﻥ ﺑﺴﺘﻪ ﺭﺍ ﺳﺮﻭﻳﺲ ﻣﻲﺩﻫﺪ. ﻛﻼﺱ dsRedQueueﺩﺍﺭﺍﻱ ﭼﻬﺎﺭ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ﻭ ﺳﻪ ﺻﻒ ﻣﺠﺎﺯﻱ ﻣﻲﺑﺎﺷﺪ .ﺑﺎ ﺗﻌﺮﻳﻒ ﺻﻔﻬﺎﻱ ﻣﺠﺎﺯﻱ ﻭ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺁﻥ ﻗﺎﺩﺭ ﺧﻮﺍﻫﻴﻢ ﺑﻮﺩ ﺩﺭ ﻫﺮ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﻣﻜﺎﻧﻴﺰﻡ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﻭ ...ﺭﺍ ﺑﻪ ﻃﻮﺭ ﻣﺴﺘﻘﻞ ﺗﻌﺮﻳﻒ ﻛﻨﻴﻢ. ﻛﻼﺱ dsRedQueueﻳﻚ ﺟﺪﻭﻝ ﺑﻪﻧﺎﻡ Per Hop Beheaviorﺩﺍﺭﺩ ،ﺭﻭﺗﺮ ﻟﺒﻪ ﺑﺴﺘﻪ ﺭﺍ ﺑﺎ ﻛﺪﻱ ﻋﻼﻣﺖﮔﺬﺍﺭﻱ ﻣﻲﻛﻨﺪ ﻭ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻦ ﻛﺪ ﺑﻪ ﺑﺴﺘﻪ ﺳﺮﻭﻳﺲ ﻣﻲﺩﻫﺪ ﻭ ﻫﺮ ﺩﻭ ﻧﻮﻉ ﺭﻭﺗﺮ ﺗﻮﺳﻂ ﺟﺪﻭﻝ PHBﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﻨﺪ ﻛﻪ ﻫﺮ ﺑﺴﺘﻪ ﻣﺘﻌﻠﻖ ﺑﻪ ﻛﺪﺍﻡ ﺻﻒ ﻓﻴﺰﻛﻲ ﻭ ﻣﺠﺎﺯﻱ ﺍﺳﺖ .ﺍﻳﻦ ﺟﺪﻭﻝ ﺩﺍﺭﺍﻱ ﺳﻪ ﻓﻴﻠﺪ ﺍﺳﺖ: :codeptﻛﺪ ﻫﺮ ﺑﺴﺘﻪ ﻳﺎ ﻛﻼﺱ :Queueﺷﻤﺎﺭﻩ ﺻﻒ ﻓﻴﺰﻳﻜﻲ :Precdﺷﻤﺎﺭﻩ ﺻﻒ ﻣﺠﺎﺯﻱ
۲‐۲‐۵ﺳﻴﺎﺳﺖﻫﺎ ﻣﺎﺟﻮﻝ DiffServﻳﻚ ﻛﻼﺱ Policyﺩﺍﺭﺩ ﻛﻪ ﺍﻳﻦ ﻛﻼﺱ ﺑﻪ ﻫﻤﺮﺍﻩ ﺯﻳﺮﻛﻼﺳﻬﺎﻳﺶ ﺭﻭﺵ ﻋﻼﻣﺖﮔﺬﺍﺭﻱ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﻨﺪ .ﺩﺭ ﻭﺍﻗﻊ ﺳﻴﺎﺳﺘﻲ ﺑﻴﻦ ﮔﺮﻩ ﻣﺒﺪﺍ ﻭ ﻣﻘﺼﺪ ﺗﻌﺮﻳﻒ ﻣﻲﺷﻮﺩ ﻭ ﺳﭙﺲ ﺑﺮ ﺍﺳﺎﺱ ﺁﻥ ﺗﻤﺎﻡ ﺑﺴﺘﻪﻫﺎﻳﻲ ﻛﻪ ﻣﺘﻌﻠﻖ ﺑﻪ ﺍﻳﻦ ﺟﺮﻳﺎﻥ ﻫﺴﺘﻨﺪ ﺩﺍﺧﻞ ﻳﻚ ﺩﺳﺘﻪ ﺍﺯ ﻛﻼﺱﻫﺎ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ. ﺑﺮﺍﻱ ﺗﻌﻴﻴﻦ ﺳﻴﺎﺳﺘﻬﺎ ﺑﺮﺍﻱ ﻫﺮ ﺟﺮﻳﺎﻥ ﺗﺮﺍﻓﻴﻚ ﺍﺯ ﺳﻪ ﻣﺸﺨﺼﻪ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩmeter-type ،Policy-type :
ﻭ .initialcode-point ﺍﺑﺘﺪﺍ ﺑﻪ ﻫﺮ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﻳﻚ ﻛﺪ ﺍﻭﻟﻴﻪ ﺍﺧﺘﺼﺎﺹ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ .ﺗﻮﺳﻂ Policy-typeﺳﻴﺎﺳﺘﻲ ﻛﻪ ﺑﺎﻳﺪ ﺑﺮﺍﻱ ﺑﺴﺘﻪﻫﺎﻱ ﻫﺮ ﺟﺮﻳﺎﻥ ﺑﻪ ﻣﻨﻈﻮﺭ ﺗﻌﻴﻴﻦ ﺗﺨﻠﻒ ﺍﺯ ،ﺣﺪﻭﺩ ﺍﺯ ﭘﻴﺶ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ،ﺍﺟﺮﺍ ﻣﻲﺷﻮﺩ .ﻛﻪ ﺩﺭ ﺻﻮﺭﺕ ﺗﺨﻠﻒ ،ﺩﻳﮕﺮ ﺑﺴﺘﻪﻫﺎ )ﺑﺮﺣﺴﺐ ﺳﻴﺎﺳﺖ( ﺑﺎ ﻛﺪ ﺍﻭﻟﻴﻪ ﻋﻼﻣﺖﮔﺬﺍﺭﻱ ﻧﻤﻲﺷﻮﻧﺪ Meter-type .ﺭﻭﺵ ﻭ ﻧﻮﻉ ﺍﻧﺪﺍﺯﻩﮔﻴﺮﻱ ﺭﺍ ﺑﺮﺍﻱ Policyﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ Policer .ﺑﺮ ﺍﺳﺎﺱ meter-typeﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺑﻪ ﻣﻨﻈﻮﺭ ﺟﻠﻮﮔﻴﺮﻱ ﺍﺯ ﺗﺨﻠﻒ ﺍﻧﺪﺍﺯﻩﮔﻴﺮﻱ ﻣﻲﻛﻨﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٨٩‐٥
ﺯﻣﺎﻧﻴﻜﻪ ﺑﺴﺘﻪﺍﻱ ﺑﻪ ﺭﻭﺗﺮ ﻟﺒﻪ ﻣﻲﺭﺳﺪ ﺍﺑﺘﺪﺍ ﺗﻌﻴﻴﻦ ﻣﻲﺷﻮﺩ ﻛﻪ ﺑﺴﺘﻪ ﻣﺘﻌﻠﻖ ﺑﻪ ﻛﺪﺍﻡ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﺍﺳﺖ ﺳﭙﺲ meter-typeﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ policyﺗﻤﺎﻡ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﺁﻥ ﺟﺮﻳﺎﻥ ﺭﺍ ﺑﻪ ﺭﻭﺯ ﺩﺭ ﻣﻲﺁﻭﺭﺩ. ﺳﭙﺲ Policerﻓﺮﺍﺧﻮﺍﻧﻲ ﻣﻲﺷﻮﺩ ﺗﺎ ﺑﺮ ﺍﺳﺎﺱ policy-typeﻭ ﻛﺪ ﺍﻭﻟﻴﻪ ﺑﺴﺘﻪ ﻭ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻓﻠﻮ ﺗﻌﻴﻴﻦ ﻛﻨﺪ ﭼﮕﻮﻧﻪ ﺑﺎﻳﺪ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﻋﻼﻣﺖﮔﺬﺍﺭﻱ ﻛﻨﺪ .ﻭ ﺑﺎﻻﺧﺮﻩ ﺑﺮﺍﺳﺎﺱ ﻛﺪ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺑﺴﺘﻪ ﺑﻪ ﺩﺍﺧﻞ ﺻﻒ ﻣﻨﺎﺳﺒﻲ ﻣﻲﺭﻭﺩ.
٣‐٢‐٥ﺍﻧﻮﺍﻉ policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ ﻣﺎﺟﻮﻝ DiffServ ﺩﺭ ﺣﺎﻝ ﺣﺎﺿﺮ policy ۶ﺩﺭ ﻣﺎﺟﻮﻝ DiffServﺗﻌﺮﻳﻒ ﺷﺪﻩﺍﻧﺪ ﻛﻪ ﺍﻳﻦ Policyﻫﺎ ﺍﺯ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺯﻳﺮ ﺑﺮﺍﻱ ﺍﻧﺪﺍﺯﻩﮔﻴﺮﻱ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﻨﺪ: • :CIR١ﻧﺮﺥ ﺍﻃﻼﻋﺎﺕ )ﺑﺮ ﺣﺴﺐ ﺑﻴﺖ ﺑﺮ ﺛﺎﻧﻴﻪ( • :٢PIRﻧﺮﺥ ﺑﻴﺸﻴﻨﻪ ﺍﻃﻼﻋﺎﺕ )ﺑﺮ ﺣﺴﺐ ﺑﻴﺖ ﺑﺮ ﺛﺎﻧﻴﻪ( • : CBS3ﺍﻧﺪﺍﺯﻩ ﺑﺮﺳﺖ )ﺑﺮ ﺣﺴﺐ ﺑﺎﻳﺖ( • :EBS4ﻣﻘﺪﺍﺭ ﺯﻳﺎﺩﻱ ﺑﺮﺳﺖ )ﺑﺮ ﺣﺴﺐ ﺑﺎﻳﺖ( • :PBS5ﺍﻧﺪﺍﺯﻩ ﺑﻴﺸﻴﻨﻪ ﺑﺮﺳﺖ )ﺑﺮ ﺣﺴﺐ ﺑﺎﻳﺖ( • :C bucketﺍﻧﺪﺍﺯﻩ ﻓﻌﻠﻲ ﺳﻄﻞ • :E bucketﺍﻧﺪﺍﺯﻩ ﻓﻌﻠﻲ ﺯﻳﺎﺩﻱ ﺳﻄﻞ • :P bucketﺍﻧﺪﺍﺯﻩ ﻓﻌﻠﻲ ﺑﻴﺸﻴﻨﻪ ﺳﻄﻞ • ﻣﻴﺎﻧﮕﻴﻦ ﻧﺮﺥ ﺑﺴﺘﻪ ﺁﺧﺮ) • :TSW window lengthﻣﻴﺎﻧﮕﻴﻦ ﻧﺮﺥ ﺗﺮﺍﻓﻴﻚ ﺭﺍ ﺩﺭ ﻓﺎﺻﻠﻪ ﺯﻣﺎﻧﻲ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺍﻧﺪﺍﺯﻩ ﻣﻲﮔﻴﺮﺩ. Policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ ﻣﺎﺟﻮﻝ DiffServﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ:
)Time SlidingWindow With 2 Color Mapping(TSW2CMPolicer
Commited Information Rate
1
Peak Information rate Commited Burst Size Excess Burstt Size
2
Peak Burst Size
3 4
5
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٩٠‐٥
ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ) CIRﻧﺮﺥ ﺍﻃﻼﻋﺎﺕ ﺗﻌﻴﻴﻦ ﺷﺪﻩ( ﺑﺴﺘﻪﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ ﻳﻚ ﻛﻼﺱ ﺭﺍ ﺭﺩﻩﺑﻨﺪﻱ)ﺑﻪ ﻣﻨﻈﻮﺭ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ( ﻣﻲﻛﻨﺪ ﻭ ﺩﺍﺭﺍﻱ ﺩﻭ ﺳﻄﺢ ﺭﺩﻩﺑﻨﺪﻱ ﺍﺳﺖ .ﺍﮔﺮ CIRﺍﺯ ﺣﺪﻱ ﺍﺿﺎﻓﻪﺗﺮ ﺷﻮﺩ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﺭﺩﻩﭘﺎﻳﻴﻨﺘﺮ ﻗﺮﺍﺭ ﻣﻲﮔﻴﺮﻧﺪ ﻭ ﻛﺪ ﻣﺮﺑﻮﻁ ﺑﻪ ﺍﻳﻦ ﺭﺩﻩ ﺑﻪ ﺁﻧﻬﺎ ﻣﻨﺘﺴﺐ ﻣﻲﺷﻮﺩ.
)Time Sliding Window With (TSW#CMPolicer
ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺩﻭ ﭘﺎﺭﺍﻣﺘﺮ CIRﻭ PIRﺭﺩﻩﺑﻨﺪﻱ ﺑﺴﺘﻪﻫﺎ ﺭﺍ ﺑﻪ ﻣﻨﻈﻮﺭ ﭼﮕﻮﻧﮕﻲ ﺣﺬﻑ ﺁﻧﻬﺎ ﺍﻧﺠﺎﻡ ﻣﻲﺩﻫﺪ ﻭ ﺳﻪ ﺭﺩﻩ ﺑﺮﺍﻱ ﺍﻧﺠﺎﻡ ﺍﻳﻨﻜﺎﺭﺩﺍﺭﺩ :ﺯﻣﺎﻧﻴﻜﻪ CIRﺍﺯ ﺣﺪ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺍﺿﺎﻓﻪﺗﺮ ﻣﻲﺷﻮﺩ ﺍﺣﺘﻤﺎﻻ ﻛﺪ ﻣﺮﺑﻮﻁ ﺑﻪ ﺭﺩﻩ ﻣﻴﺎﻧﻲ ﺑﻪ ﺑﺴﺘﻪﻫﺎ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﻭ ﺯﻣﺎﻧﻴﻜﻪ PIRﺍﺯ ﺣﺪ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺍﺿﺎﻓﻪﺗﺮ ﻣﻲﺷﻮﺩ ﺍﺣﺘﻤﺎﻻ ﻛﺪ ﻣﺮﺑﻮﻁ ﺑﻪ ﺭﺩﻩ ﭘﺎﻳﻴﻨﻲ ﺑﻪ ﺑﺴﺘﻪﻫﺎ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ.
):Token Bucket(tokenBucketPolicer
ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺩﻭ ﭘﺎﺭﺍﻣﺘﺮ CIRﻭ CBSﺍﺯ ﺩﻭ ﺭﺩﻩ ﺑﺮﺍﻱ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ .ﻳﻚ ﺑﺴﺘﻪ ﺩﺭ ﺻﻮﺭﺗﻴﻜﻪ ﺑﺰﮔﺘﺮ ﺍﺯ ﺍﻧﺪﺍﺯﺓ ﺳﻄﻞ ﺑﺎﺷﺪ ،ﺑﺎ ﺭﺩﻩ ﭘﺎﻳﻴﻨﺘﺮ ﻛﺪ ﻣﻲﺷﻮﺩ.
):Single RateThree Color Marker(srTCMPolicer
ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ CBS ،CIRﻭ ،EBSاز ﺳﻪ ﺭﺩﻩ ﺑﺮﺍﻱ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ.
):Two Rate Three Color Marker(trTCMPolicer
ﺍﺯ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ PIR ،CBS ،CIRﻭ PBSﺑﺮﺍﻱ ﺗﻌﻴﻴﻦ ﺳﻪ ﺭﺩﻩ ﺑﻪ ﻣﻨﻈﻮﺭ ﺣﺬﻑ ﺑﺴﺘﻪﻫﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﻛﻨﺪ.
۴‐۲‐۵ﺳﺎﺧﺘﺎﺭ Policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﻫﻤﻪ Policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ ﺑﺎﻻ ﺑﻪ ﺻﻮﺭﺕ ﻳﻚ ﺯﻳﺮﻛﻼﺱ ﺍﺯ dsPolicyﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﺪﻩﺍﻧﺪ. ﻧﻜﺘﻪ :ﺑﺮﺍﻱ ﺍﻋﻤﺎﻝ Policyﻭ meterﺧﺎﺹ ﺍﺯ ﺗﻮﺍﺑﻊ applyMeterﻭ applyPolicerﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺍﺳﺖ ﻛﻪ ﺍﻳﻦ ﺗﻮﺍﺑﻊ ﻣﺠﺎﺯﻱ ﺑﻮﺩﻩ ﻭ ﺩﺭ ﻛﻼﺱ dsPolicyﺗﻌﺮﻳﻒ ﺷﺪﻩﺍﻧﺪ ﻭ Policyﻫﺎﻱ ﻛﺎﺭﺑﺮ ﻧﻴﺰ ﺑﻪ ﻫﻤﻴﻦ ﻃﺮﻳﻖ ﻣﻲﺗﻮﺍﻧﻨﺪ ﺩﺭ ﻣﺎﺟﻮﻝ ﭘﻴﺎﺩﻩﺳﺎﺯﻱ ﺷﻮﻧﺪ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٩١‐٥
Policyﻫﺎﻱ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ﺑﺮﺍﻱ ﻫﺮ ﻛﻼﺱ ﺗﺮﺍﻓﻴﻚ ﺩﺭ ﺟﺪﻭﻝ Policyﺩﺭ ﻛﻼﺱ PolicyClassifierﺫﺧﻴﺮﻩ ﻣﻲﺷﻮﻧﺪ .ﻓﻴﻠﺪﻫﺎﻱ ﺍﻳﻦ ﺟﺪﻭﻝ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: initial-codepoint ،meter-type ،policer-typeﻭ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ﻛﻪ ﺗﻮﺳﻂ Policerﺍﺯ ﺁﻧﻬﺎ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ. ﻛﻼﺱ PolicerClassifierﻫﻤﭽﻨﻴﻦ ﺷﺎﻣﻞ ﻳﻚ ﺟﺪﻭﻝ Policerﺍﺳﺖ ﻛﻪ ﺍﻳﻦ ﺟﺪﻭﻝ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻛﺪ ﺍﻭﻟﻴﻪ ﻭ ﻧﻮﻉ Policyﻣﻘﺎﺩﻳﺮ ﻛﺪﻫﺎﻱ ﺭﺩﻩﻫﺎﻱ ﭘﺎﻳﻴﻨﺘﺮ ﻳﻚ ﻛﻼﺱ ﺭﺍ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ.
٣-۵
ﭘﻴﻜﺮﺑﻨﺪي ﭘﺎراﻣﺘﺮهﺎي ﻣﺎﺟﻮل DiffServ
۱‐۳‐۵ﭘﻴﻜﺮﺑﻨﺪﻱ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺻﻒ ﻓﺮﻣﺎﻧﻬﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﻗﺴﻤﺖ ،ﻣﻲﺗﻮﺍﻧﻨﺪ ﺑﺮﺍﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻧﻤﻮﻧﻪﻫﺎﻳﻲ ﻛﻪ ﺍﺯ ﻛﻼﺳﻬﺎﻱ edgeQueueﻭ coreQueueﮔﺮﻓﺘﻪ ﺷﺪﻩﺍﻧﺪ ﺍﺳﺘﻔﺎﺩﻩ ﺷﻮﻧﺪ. ﭘﻴﻜﺮﺑﻨﺪﻱ ﺭﻭﺗﺮﻫﺎ ﺑﺎﻳﺪ ﺩﺭ ﺯﻣﺎﻥ ﺷﺒﻴﻪﺳﺎﺯﻱ ﻭ ﻗﺒﻞ ﺍﺯ ﺍﻳﻨﻜﻪ ﺑﺴﺘﻪﺍﻱ ﺍﻧﺘﻘﺎﻝ ﻳﺎﺑﺪ ﺍﻧﺠﺎﻡ ﺷﻮﺩ. ﺗﻌﺪﺍﺩ ﺻﻒﻫﺎﻱ ﻓﻴﺰﻳﻜﻲ ﻭ ﻣﺠﺎﺯﻱ ﻫﺮ ﻟﻴﻨﻚ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﺷﻮﻧﺪ: _$dsredq set numQueue
2
2
$dsredq setNumPrec
_ NumQueueﻣﺘﻐﻴﺮ ﻛﻼﺱ dsRedQueeuﻣﻲﺑﺎﺷﺪ ﻭ ﺗﻌﺪﺍﺩ ﺻﻔﻬﺎﻱ ﻓﻴﺰﻳﻜﻲ ﻛﻪ ﺩﺭ ﻳﻚ ﻟﻴﻨﻚ ﻧﮕﺎﺷﺖ ﻣﻲﺷﻮﻧﺪ ﺭﺍ ﻧﺸﺎﻥ ﻣﻲﺩﻫﺪ .ﻣﻘﺪﺍﺭ ﭘﻴﺶ ﻓﺮﺽ ﺁﻥ ۴ﺍﺳﺖ ﻭ ﺑﻪ ﺻﻮﺭﺕ ﺑﺎﻻ ﻣﻲﺗﻮﺍﻥ ﺁﻥ ﺭﺍ ﺗﻐﻴﻴﺮ ﺩﺍﺩ .ﻣﻘﺪﺍﺭ setNumQueeuﺗﻌﺪﺍﺩ ﺻﻔﻬﺎﻱ ﻣﺠﺎﺯﻱ ﺭﺍ ﺩﺍﺧﻞ ﻳﻚ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ﺗﻌﻴﻴﻦ ﻣﻲﻛﻨﺪ. ﺗﻌﺪﺍﺩ ﺻﻔﻬﺎﻱ ﻓﻴﺰﻳﻜﻲ ﻭ ﻣﺠﺎﺯﻱ ﺩﺍﺭﺍﻱ ﻣﺤﺪﻭﺩﻳﺖ ﻫﺴﺘﻨﺪ)ﺣﺪﺍﻛﺜﺮ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ۴ﻭ ﺣﺪﺍﻛﺜﺮ ﺗﻌﺪﺍﺩ ﺻﻒ ﻣﺠﺎﺯﻱ (۳ﻭﻟﻲ TCLﻣﻘﺪﺍﺭ ﺍﻳﻦﺩﻭ ﭘﺎﺭﺍﻣﺘﺮ ﺭﺍ ﺑﺮﺍﻱ ﺧﻄﺎ ﭼﻚ ﻧﻤﻲﻛﻨﺪ .ﻓﺮﺽ ﺑﺮ ﺍﻳﻦ ﺍﺳﺖ ﻛﻪ ﻛﺎﺭﺑﺮ ﺍﺯ ﺍﻳﻦ ﻣﺤﺪﻭﺩﻳﺖ ﺍﻃﻼﻉ ﺩﺍﺭﺩ. ﭘﻴﻜﺮﺑﻨﺪﻱ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ Redﺑﺮﺍﻱ ﻫﺮ ﺻﻒ ﻣﺠﺎﺯﻱ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﻣﻲﺑﺎﺷﺪ: $dsredq configQ 0 1 10 20 0.10
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٩٢‐٥
ﺍﻳﻦ ﻓﺮﻣﺎﻥ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ REDﺭﺍ ﺑﺮﺍﻱ ﻳﻚ ﺻﻒ ﻣﺠﺎﺯﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﻣﻲﻛﻨﺪ ﺩﺭ ﻣﺜﺎﻝ ﺑﺎﻻ ﺻﻒ ﻣﺠﺎﺯﻱ ﺷﻤﺎﺭﻩ ﻳﻚ ﻣﺮﺑﻮﻁ ﺑﻪ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ﺷﻤﺎﺭﻩ ﺻﻔﺮ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺷﺪﻩ ﺍﺳﺖ .ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: _ :threshﻛﻤﺘﺮﻳﻦ ﺣﺪ ﺁﺳﺘﺎﻧﻪ ﺑﺮﺍﻱ ﻣﻴﺎﻧﮕﻴﻦ ﺍﻧﺪﺍﺯﻩ ﺻﻒ)ﺑﺮ ﺣﺴﺐ ﺑﺴﺘﻪ( .ﺩﺭ ﻣﺜﺎﻝ ﺑﺎﻻ ﺍﻳﻦ ﻣﻘﺪﺍﺭ ۱۰ ﻣﻲﺑﺎﺷﺪ_ :maxthreshﺑﻴﺸﺘﺮﻳﻦ ﺣﺪ ﺁﺳﺘﺎﻧﻪ ﺑﺮﺍﻱ ﻣﻴﺎﻧﮕﻴﻦ ﺍﻧﺪﺍﺯﻩ ﺻﻒ)ﺑﺮﺣﺴﺐ ﺑﺴﺘﻪ( .ﺩﺭ ﻣﺜﺎﻝ ﺑﺎﻻ ﻣﻘﺪﺍﺭ ﺍﻳﻦ ﭘﺎﺭﺍﻣﺘﺮ ۲۰ﻣﻲﺑﺎﺷﺪ. $dsredq addPHBEntry $codepoint $phisicalq $virtualq
ﺍﻳﻦ ﻓﺮﻣﺎﻥ ﻳﻚ ﺭﻛﻮﺭﺩ ﺑﻪ ﺟﺪﻭﻝ PHBﺍﺿﺎﻓﻪ ﻣﻲﻛﻨﺪ .ﻛﻪ ﺗﻮﺳﻂ ﺍﻳﻦ ﺟﺪﻭﻝ ﻛﺪ $codepointﺑﻪ ﺻﻒ ﻣﺠﺎﺯﻱ $virtualqﺩﺭ ﺻﻒ ﻓﻴﺰﻳﻜﻲ $phisicalqﻧﮕﺎﺷﺖ ﻣﻲﺷﻮﺩ: $dsredq addPHBEntry 11 0 1
ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﻛﺪ ١١ﺑﻪ ﺻﻒ ﻣﺠﺎﺯﻱ ۱ﺩﺭ ﺻﻒ ﻓﻴﺰﻳﻜﻲ ٠ﻧﮕﺎﺷﺖ ﻣﻲﺷﻮﺩ. ﻧﻜﺘﻪ :ﺩﺭ nsﺑﺴﺘﻪﻫﺎ ﺑﻪ ﺻﻮﺭﺕ ﭘﻴﺶﻓﺮﺽ ﺩﺍﺭﺍﻱ ﻛﺪ ﺻﻔﺮ ﻫﺴﺘﻨﺪ .ﺑﻨﺎﺑﺮﺍﻳﻦ ﺑﺮﺍﻱ ﭘﺮﺩﺍﺯﺵ ﺗﺮﺍﻓﻴﻚ Best
Effortﺑﺎﻳﺪ ﺭﻛﻮﺭﺩﻱ ﺑﺮﺍﻱ ﻛﺪ ﺻﻔﺮ ﺩﺭ ﺟﺪﻭﻝ PHBﺍﺿﺎﻓﻪ ﺷﻮﺩ. $dsredq meanPktSize $Mpsize
ﺑﺮﺍﻱ ﻣﺤﺎﺳﺒﺔ ﻣﻴﺎﻧﮕﻴﻦ ﻃﻮﻝ ﺻﻒ ،REDﻣﻴﺎﻧﮕﻴﻦ ﺍﻧﺪﺍﺯﺓ ﺑﺴﺘﻪﻫﺎ ﻣﻮﺭﺩ ﻧﻴﺎﺯﺍﺳﺖ ﻛﻪ ﺗﻮﺳﻂ ﺩﺳﺘﻮﺭ ﺑﺎﻻ ﻣﻲﺗﻮﺍﻥ ﺍﻳﻦ ﭘﺎﺭﺍﻣﺘﺮ ﺭﺍ ﺗﻌﻴﻴﻦ ﻧﻤﻮﺩ. $dsredq setMREDMode $mred $phisicalq
ﻣﺘﻐﻴﺮ ﻣﺪ MREDﺑﺎﻳﺪ ﺑﻪ ﻣﻨﻈﻮﺭ ﻣﺤﺎﺳﺒﻪ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺷﻮﺩ .ﺗﻮﺳﻂ ﺩﺳﺘﻮﺭ ﺑﺎﻻ ﺍﻳﻨﻜﺎﺭ ﺭﺍ ﻣﻲﺗﻮﺍﻥ ﺍﻧﺠﺎﻡ ﺩﺍﺩ .ﻣﺎﺟﻮﻝ DiffServﻣﺪﻫﺎﻱ ﻣﺨﺘﻠﻔﻲ ﺭﺍ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ: ) :RIO-C(RIO Coupledﺍﺣﺘﻤﺎﻝ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ )ﺩﺭ out of profileﻳﻌﻨﻲ ﺯﻣﺎﻧﻲﻛﻪ ﻃﻮﻝ ﺻﻒ ﺍﺯ ﺣﺪ ﺑﻴﺸﺘﺮﻳﻦ ﺑﺰﺭﮔﺘﺮ ﻣﻲﺷﻮﺩ( ﺑﺮ ﺍﺳﺎﺱ ﻣﻴﺎﻧﮕﻴﻦ ﻭﺯﻧﻲ ﻃﻮﻝ ﻫﻤﻪ ﺻﻔﻬﺎﻱ ﻣﺠﺎﺯﻱ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ .ﺩﺭ ﺣﺎﻟﻴﻜﻪ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ )ﺩﺭ in-profileﻳﻌﻨﻲ ﺯﻣﺎﻧﻲﻛﻪ ﻃﻮﻝ ﺻﻒ ﺍﺯ ﺣﺪ ﻛﻤﺘﺮﻳﻦ ﺑﺰﺭﮔﺘﺮ ﻣﻲﺷﻮﺩ(
ﺗﻨﻬﺎ ﺑﺮ ﺍﺳﺎﺱ ﻣﻴﺎﻧﮕﻴﻦ ﻭﺯﻧﻲ ﻃﻮﻝ ﺻﻒ ﻣﺠﺎﺯﻱ ﺁﻥ ﺍﺳﺖ. ) : RIO-D(RIO De-coupledﺷﺒﻴﻪ RIO-Cﺍﺳﺖ .ﺑﻪ ﺟﺰ ﺍﻳﻨﻜﻪ ﺍﺣﺘﻤﺎﻝ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻦ ﺑﺴﺘﻪﻫﺎ ﺩﺭ ﺯﻣﺎﻧﻲﻛﻪ ﻃﻮﻝ ﺻﻒ ﺍﺯ ﺣﺪ ﺑﻴﺸﺘﺮﻳﻦ ﺑﺰﺭﮔﺘﺮ ﻣﻲﺷﻮﺩ ﺑﺮ ﺍﺳﺎﺱ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﻣﺠﺎﺯﻱ ﺍﺳﺖ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٩٣‐٥
• ) :WRED(Weighted REDﻫﻤﻪ ﺍﺣﺘﻤﺎﻻﺕ ﺑﺮ ﺍﺳﺎﺱ ﺍﻧﺪﺍﺯﻩ ﺗﻨﻬﺎ ﻳﻚ ﺻﻒ ﺍﺳﺖ. • :DROPﻣﺎﻧﻨﺪ ﺻﻒ DropTailﻋﻤﻞ ﻣﻲﻛﻨﺪ ﺑﻪ ﺍﻳﻦ ﺻﻮﺭﺕ ﻛﻪ ﺯﻣﺎﻧﻲ ﻛﻪ ﺍﻧﺪﺍﺯﻩ ﻃﻮﻝ ﺻﻒ ﺑﺮﺍﺑﺮ ﺁﺳﺘﺎﻧﻪ ﻛﻤﺘﺮﻳﻦ ﺷﺪ ﺑﺴﺘﻪﻫﺎ ﻣﺎﻧﻨﺪ ﻣﻜﺎﻧﻴﺰﻡ DropTailﺣﺬﻑ ﻣﻲﺷﻮﻧﺪ.
١‐١‐٣‐٥ﭘﻴﻜﺮﺑﻨﺪﻱ ﺷﻤﺎﻱ ﺯﻣﺎﻥﺑﻨﺪﻱ ﺑﻴﻦ ﺻﻒﻫﺎﻱ ﻓﻴﺰﻳﻜﻲ ﻣﺎﺟﻮﻝ Diffservﺷﻤﺎﻫﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﺯﻳﺮ ﺭﺍ ﺑﺮﺍﻱ ﺳﺮﻭﻳﺲ ﺩﺍﺩﻥ ﺑﻪ ﺻﻔﻬﺎﻱ ﻓﻴﺰﻳﻜﻲ ﭘﺸﺘﻴﺒﺎﻧﻲ ﻣﻲﻛﻨﺪ. •
)Weighted Round Robin(WRR
•
)Weighted Interleaved Round Robin(WIRR
•
)Round Robin(RR
•
)Priority(PRI
ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﭘﻴﺶﻓﺮﺽ RRﻣﻲﺑﺎﺷﺪ .ﺑﻮﺳﻴﻠﻪ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻣﻲﺗﻮﺍﻥ ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﺭﺍ ﺗﻐﻴﻴﺮ ﺩﺍﺩ. $dsredq setSchedularMode $shema
اﻳﻦ ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﺭﺍ ﺑﻪ $shemaﺗﻐﻴﻴﺮ ﻣﻲﺩﻫﺪ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ WRRﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﺗﻌﺮﻳﻒ ﻣﻲﺷﻮﺩ: $dsredq setSchedularMode WRR $dsredq addQueueWeights 1 5
ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﺩﺳﺘﻮﺭ ﺍﻭﻝ ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ﺭﺍ ﺑﻪ WRRﺗﻐﻴﻴﺮ ﻣﻲﺩﻫﺪ ﻭ ﺩﺳﺘﻮﺭ ﺩﻭﻡ ﻭﺯﻥ ﺻﻒ ﺍﻭﻝ ﺭﺍ ﺑﺮﺍﺑﺮ ٥ ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ. ﺩﺭ ﻣﻮﺭﺩ ﺷﻤﺎﻱ ﺯﻣﺎﻧﺒﻨﺪﻱ ،PRIﺍﻭﻟﻮﻳﺖ ﺻﻔﻬﺎ ﺑﻪ ﺗﺮﺗﻴﺐ ﺷﻤﺎﺭﺓ ﺻﻒ ﺍﺳﺖ .ﻭ ﺻﻒ ﺻﻔﺮ ﺩﺍﺭﺍﻱ ﺑﺎﻻﺗﺮﻳﻦ ﺍﻭﻟﻮﻳﺖ ﻣﻲﺑﺎﺷﺪ .ﻫﻤﭽﻨﻴﻦ ﻣﻲﺗﻮﺍﻥ ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺭﺍ ﺑﺮﺍﻱ ﻫﺮ ﺻﻒ ﺗﻮﺳﻂ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﻣﺤﺪﻭﺩ ﻛﺮﺩ: $dsredq addQueueRate $queue $bw ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺭﺍ ﺑﺮﺍﻱ ﺻﻒ $queueﺑﻪ $bwﻣﺤﺪﻭﺩ ﻣﻲﻛﻨﺪ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ: $dsredq setSchedularMode PRI $dsredq addQueueRate 0 5000000
ﺩﺭ ﺍﻳﻦ ﻣﺜﺎﻝ ﺍﺯ ﺯﻣﺎﻧﺒﻨﺪﻱ PRIﺑﺮﺍﻱ ﻧﺤﻮﻩ ﺳﺮﻭﻳﺲﺩﻫﻲ ﺑﻴﻦ ﺻﻔﻬﺎﻱ ﻓﻴﺰﻳﻜﻲ ﺍﺳﺘﻔﺎﺩﻩ ﻣﻲﺷﻮﺩ .ﻭ ﻣﻴﺰﺍﻥ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭘﻬﻨﺎﻱ ﺑﺎﻧﺪ ﺻﻒ ﺻﻔﺮ ﺑﻪ 5MBﻣﺤﺪﻭﺩ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
٩٤‐٥
٢‐٣‐٥ﭘﻴﻜﺮﺑﻨﺪﻱ Policy ﺑﻪ ﻣﻨﻈﻮﺭ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺳﻴﺎﺳﺖﻫﺎ ﺑﻴﻦ ﮔﺮﻩ ﻣﺒﺪﺍ ﻭ ﻣﻘﺼﺪ ﺑﺎﻳﺪ ﻣﺸﺨﺼﺎﺕ ﺗﺮﺍﻓﻴﻚ ﻭ ﻧﻮﻉ Policyﺩﺭ ﺟﺪﻭﻝ Policyﻗﺮﺍﺭ ﺩﺍﺩﻩ ﺷﻮﻧﺪ ﻛﻪ ﺍﻳﻦ ﻛﺎﺭ ﺩﺭ ﺭﻭﺗﺮ ﻟﺒﻪ ﺗﻮﺳﻂ ﻓﺮﻣﺎﻥ ﺯﻳﺮ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ: $q addPolicyEntry [$s id] [$d id] $Policy $parameters
ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﭘﻴﻜﺮﺑﻨﺪﻱ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: : $qﻣﺘﻐﻴﺮﻱ ﺍﺯ ﺟﻨﺲ EdgeQueue
:$sﮔﺮﻩ ﻣﺒﺪﺍ :$dﮔﺮﻩ ﻣﻘﺼﺪ :$policyﻧﻮﻉ ﺳﻴﺎﺳﺘﻲ ﻛﻪ ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻚ ﺑﻴﻦ ﻣﺒﺪﺍ ﻭ ﻣﻘﺼﺪ ﺑﺎﻳﺪ ﺑﻜﺎﺭ ﮔﺮﻓﺘﻪ ﺷﻮﺩ. $parametesﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻨﻜﻪ ﻫﺮ policyﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺗﺮﺍﻓﻴﻚ ﻣﺨﺼﻮﺹ ﺑﻪ ﺧﻮﺩ ﺭﺍ ﺩﺍﺭﺩ ﺑﻌﺪ ﺍﺯ ﺗﻌﻴﻴﻦ policyﺩﺭ ﺍﻳﻦ ﻗﺴﻤﺖ ﺑﺎﻳﺪ ﻣﻘﺎﺩﻳﺮ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﺮﺑﻮﻁ ﺑﻪ Policyﺁﻭﺭﺩﻩ ﺷﻮﺩ. Policyﻫﺎﻱ ﺗﻌﺮﻳﻒ ﺷﺪﻩ ﺩﺭ ﻣﺎﺟﻮﻝ DiffServﺑﻪ ﻫﻤﺮﺍﻩ ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﻣﻮﺭﺩ ﻧﻴﺎﺯ ﺑﺮﺍﻱ ﻫﺮ ﻛﺪﺍﻡ ﺩﺭ ﺯﻳﺮ ﺧﻼﺻﻪ ﺷﺪﻩﺍﻧﺪ:
PB
PIR CBS CBS EBS CBS PIR
CIR CIR CIR CIR CIR
Initial code point Initial code point Initial code point Initial code point Initial code point
• TSW2CM • TSW3CM • TokenBucket • srTCM • trTCM
ﺗﻮﺟﻪ ﺑﻪ ﺍﻳﻦ ﻧﻜﺘﻪ ﺿﺮﻭﺭﻱ ﺍﺳﺖ ﻛﻪ ﺑﻪ ﺍﺯﺍﻱ ﻫﺮ ﮔﺮﻩ ﻣﺒﺪﺍ ﻭ ﻣﻘﺼﺪ ﺗﻨﻬﺎ ﻳﻚ Policyﺭﺍ ﻣﻲﺗﻮﺍﻥ ﺑﻴﻦ ﺁﻧﻬﺎ ﻗﺮﺍﺭ ﺩﺍﺩ .ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ: $q addPolicyEntry [$s1 id] [$d1 id] TSW2CM 10 2000000
ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺳﻴﺎﺳﺖ TSW2CMﺑﺎ ﭘﺎﺭﺍﻣﺘﺮ CIR=10ﻭ PIR=2000000ﺑﺮﺍﻱ ﺗﺮﺍﻓﻴﻚ ﺑﻴﻦ ﻣﺒﺪﺍ s1ﻭ ﻣﻘﺼﺪ d1ﺩﺭ ﻧﻈﺮ ﮔﺮﻓﺘﻪ ﻣﻲﺷﻮﺩ. ﻫﻤﭽﻨﻴﻦ ﺑﻪ ﺍﺯﺍﻱ ﻫﺮ ﺟﻔﺖ ﻛﺪ ﺍﻭﻟﻴﻪ ﻭ ﻧﻮﻉ Policyﺑﺎﻳﺴﺘﻲ ﻳﻚ ﺭﻛﻮﺭﺩ ﺑﻪ ﺟﺪﻭﻝ Policerﺍﺿﺎﻓﻪ ﺷﻮﺩ ﺗﺎ ﺑﺘﻮﺍﻥ ﻧﮕﺎﺷﺘﻲ ﺍﺯ ﺍﻳﻦ ﺟﻔﺘﻬﺎ ﺑﻪ ﻛﺪﻫﺎﻱ ﺭﺩﺓ ﭘﺎﻳﻴﻨﺘﺮ policyﺑﺪﺳﺖ ﺁﻭﺭﺩ .ﺍﻳﻦ ﻛﺎﺭ ﺗﻮﺳﻂ ﺩﺳﺘﻮﺭ ﺯﻳﺮ ﺍﻧﺠﺎﻡ ﻣﻲﺷﻮﺩ.
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
$downgradedcode1
٩٥‐٥ $initcode
$dsredq addPolicerEntry $downgradedcode2
$policer-type
ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺑﺮﺍﻱ ﺳﻴﺎﺳﺖ $policer-typeﺑﺎ ﻛﺪ ﺍﻭﻟﻴﻪ $initcodeﻛﺪﻫﺎﻱ ﺭﺩﻩ ﭘﺎﻳﻴﻦ ﺭﺍ ﺑﻪ ﺗﺮﺗﻴﺐ $downgradedcode1ﻭ $downgraded-code2ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ ﺍﻟﺒﺘﻪ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺗﻌﺪﺍﺩ ﺭﺩﻩﺑﻨﺪﻱ ﺩﺭ ﻫﺮ Policyﻣﻤﻜﻦ ﺍﺳﺖ $downgraded-code2ﻧﻴﺎﺯﻱ ﻧﺒﺎﺷﺪ. ﺑﻪ ﻋﻨﻮﺍﻥ ﻣﺜﺎﻝ: $dsredq addPolicerEntry trTCM 10 11 12
ﺩﺳﺘﻮﺭ ﺑﺎﻻ ﺑﺮﺍﻱ ﺳﻴﺎﺳﺖ trTCMﺑﺎ ﻛﺪ ﺍﻭﻟﻴﻪ ،١٠ﻛﺪﻫﺎﻱ ﺭﺩﻩ ﭘﺎﻳﻴﻨﺘﺮ ﺭﺍ ﺑﻪ ﺗﺮﺗﻴﺐ ۱۱ﻭ ۱۲ﻗﺮﺍﺭ ﻣﻲﺩﻫﺪ.
٤-٥
واﺳﻂهﺎي ﺑﺮﻧﺎﻣﻪ ﻧﻮﻳﺴﻲ ﺑﺮاي اﺳﺘﻔﺎدﻩ از ﻣﺎﺟﻮل Diffserv $ns simplex-link $edge $core $bw $delay dsRED/edge
•
$ns simplex-link $edge $core $bw $delay dsRED/core
•
ﺩﻭ ﻓﺮﻣﺎﻥ ﺑﺎﻻ ﺻﻒ ﺑﻴﻦ ﺭﻭﺗﺮ ﻟﺒﻪ ﻭ ﻣﺮﻛﺰﻱ ﺭﺍ ﺍﻳﺠﺎﺩ ﻣﻲﻛﻨﻨﺪ .ﺗﻮﺟﻪ ﺷﻮﺩ ﻛﻪ ﺻﻒ ﺑﻴﻦ ﺭﻭﺗﺮ ﻟﺒﻪ ﺑﻪ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺑﺎ ﺻﻒ ﺑﻴﻦ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﻭ ﺭﻭﺗﺮ ﻟﺒﻪ ﺑﺎ ﻫﻢ ﻣﺘﻔﺎﻭﺕ ﺍﺳﺖ .ﺻﻒ ﺑﻴﻦ ﺭﻭﺗﺮ ﻟﺒﻪ ﺑﻪ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺑﺎﻳﺪ ﺑﻪ ﺻﻮﺭﺕ dsRed/edgeﺗﻌﺮﻳﻒ ﺷﻮﺩ ﻭ ﺻﻒ ﺑﻴﻦ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺑﻪ ﺭﻭﺗﺮ ﻟﺒﻪ ﻳﺎ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺑﻪ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺑﺎﻳﺪ ﺍﺯ ﻧﻮﻉ dsRED/coreﺗﻌﺮﻳﻒ ﺷﻮﻧﺪ. $dsredq printPolicyTable
•
$dsredq printPolicerTable
•
$dsredq printPHBtable
•
ﺗﻮﺳﻂ ﺳﻪ ﺩﺳﺘﻮﺭ ﺑﺎﻻ ﺑﻪ ﺗﺮﺗﻴﺐ ﺟﺪﻭﻝ policyﻭ ﺟﺪﻭﻝ Policerﻣﺮﺑﻮﻁ ﺑﻪ ﺭﻭﺗﺮ ﻟﺒﻪ ﻣﺸﺨﺺ ﺷﺪﻩ ﻭ ﺟﺪﻭﻝ PHBﻣﺮﺑﻮﻁ ﺑﻪ ﺭﻭﺗﺮ ﻟﺒﻪ ﻳﺎ ﺭﻭﺗﺮ ﻣﺮﻛﺰﻱ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ،ﭼﺎﭖ ﻣﻲﺷﻮﻧﺪ. $dsredq printState
•
ﭘﺎﺭﺍﻣﺘﺮﻫﺎﻱ ﺁﻣﺎﺭﻱ ﺗﺮﺍﻓﻴﻚ ﻣﺮﺑﻮﻁ ﺑﻪ ﺭﻭﺗﺮ ﻟﺒﻪ ﺗﻌﻴﻴﻦ ﺷﺪﻩ ،ﭼﺎﭖ ﻣﻲﺷﻮﺩ .ﻳﻚ ﺧﺮﻭﺟﻲ ﻧﻤﻮﻧﻪ ﺍﺯ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺑﻪ ﺻﻮﺭﺕ ﺯﻳﺮ ﺍﺳﺖ : Edrops 15 10
Ldrops 21 21
TxPkts 249090 98790
TotPkts 249126 98821
CP All 10
ﻣﺮﻭﺭﻱ ﺑﺮ ﻗﺎﺑﻠﻴﺘﻬﺎﻱ NS-2
5
٩٦‐٥ 150300
0
20
15035
ﻓﻴﻠﺪﻫﺎﻱ ﺍﻳﻦ ﺟﺪﻭﻝ ﻋﺒﺎﺭﺗﻨﺪ ﺍﺯ: :CPﻛﺪ :TotPktsﺗﻌﺪﺍﺩ ﻛﻞ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ :TxPktsﺗﻌﺪﺍﺩ ﻛﻞ ﺑﺴﺘﻪﻫﺎﻱ ﺩﺭﻳﺎﻓﺖ ﺷﺪﻩ :Ldropsﺗﻌﺪﺍﺩ ﺑﺴﺘﻪﻫﺎﻳﻲ ﻛﻪ ﺑﺎ ﺗﻮﺟﻪ ﺑﻪ ﺳﺮﺭﻳﺰ ﺷﺪﻥ ﻟﻴﻨﻚ ﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩﺍﻧﺪ. :Edropsﺑﺴﺘﻪﻫﺎﻳﻲ ﻛﻪ ﺩﺭ ﺻﻒ REDﺑﻪ ﺩﻭﺭ ﺍﻧﺪﺍﺧﺘﻪ ﺷﺪﻩﺍﻧﺪ. getAverage $queue
$dsredq
•
ﺩﺳﺘﻮﺭ ﺑﺎﻻ ﻣﻴﺎﻧﮕﻴﻦ ﻭﺯﻧﻲ ﺍﻧﺪﺍﺯﻩ ﺻﻒ ﻓﻴﺰﻳﻜﻲ $queueﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ. getCBucket
ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺍﻧﺪﺍﺯﻩ ﻓﻌﻠﻲ ﺳﻄﻞ Cﺭﺍ ﺑﺮﻣﻲﮔﺮﺩﺍﻧﺪ.
ﭘﺎﻳﺎن
$dsredq
•