Nghiên cứu các thuật toán lập lịch tối ưu cho UGS trong WIMAX luận văn ths công nghệ thông tin 60 48 15 pdf

86 544 0
Nghiên cứu các thuật toán lập lịch tối ưu cho UGS trong WIMAX   luận văn ths  công nghệ thông tin  60 48 15 pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

ĐẠI HỌC QUỐC GIA HÀ NỘI TRƯỜNG ĐẠI HỌC CÔNG NGHỆ PHẠM VĂN THUẬN NGHIÊN CỨU CÁC THUẬT TOÁN LẬP LỊCH TỐI ƯU CHO UGS TRONG WIMAX LUẬN VĂN THẠC SỸ CÔNG NGHỆ THÔNG TIN Hà Nội – 2015 ĐẠI HỌC QUỐC GIA HÀ NỘI TRƯỜNG ĐẠI HỌC CÔNG NGHỆ PHẠM VĂN THUẬN NGHIÊN CỨU CÁC THUẬT TOÁN LẬP LỊCH TỐI ƯU CHO UGS TRONG WIMAX Ngành: Công nghệ thông tin Chuyên ngành: Truyền liệu Mạng máy tính Mã số: LUẬN VĂN THẠC SỸ CƠNG NGHỆ THƠNG TIN NGƯỜI HƯỚNG DẪN KHOA HỌC: TS DƯƠNG LÊ MINH Hà Nội – 2015 LỜI CẢM ƠN Trước hết, xin bày tỏ lòng biết ơn sâu sắc đến cha mẹ gia đình ni dưỡng, giáo dục tạo điều kiện tốt thực đề tài Tơi xin bày tỏ lịng biết ơn sâu sắc gửi lời cảm ơn đặc biệt tới Thầy TS Dương Lê Minh, người định hướng đề tài, cung cấp cho kiến thức, tài liệu tận tình hướng dẫn bảo tơi suốt q trình thực đề tài luận văn cao học này, từ ý tưởng đề cương nghiên cứu, phương pháp nghiên cứu, phương pháp giải vấn đề lần kiểm tra cuối để hồn thành luận văn Tơi xin bày tỏ lịng biết ơn chân thành tới Thầy, Cơ giáo mơn Truyền liệu Mạng máy tính, Khoa Cơng nghệ thơng tin, người mang trí tuệ, công sức truyền đạt giúp mở rộng kiến thức Cơng nghệ thơng tin nói chung Mạng máy tính nói riêng, kiến thức q báu có ích với tơi giai đoạn tương lai Tôi xin gửi lời cảm ơn chân thành tới Ban Giám hiệu Nhà trường, Phịng Đào tạo sau đại học, Đại học Cơng nghệ - Đại học Quốc gia Hà Nội tạo điều kiện tốt giúp tơi suốt q trình học tập Cuối xin gửi lời cảm ơn đến người thân, bạn bè, đồng nghiệp người động viên khuyến khích tơi suốt q trình học tập thực đề tài luận văn Hà Nội, ngày … tháng … năm 2015 Học viên Phạm Văn Thuận LỜI CAM ĐOAN Tôi xin cam đoan nội dung trình bày luận văn tơi tự nghiên cứu tìm hiểu dựa tài liệu tơi trình bày theo ý hiểu thân hướng dẫn trực tiếp Thầy TS Dương Lê Minh Các nội dung nghiên cứu, tìm hiểu kết thực nghiệm hồn tồn trung thực Luận văn chưa cơng bố cơng trình Trong q trình thực luận văn tơi tham khảo đến tài liệu số tác giả, ghi rõ tên tài liệu, nguồn gốc tài liệu, tên tác giả liệt kê mục “DANH MỤC TÀI LIỆU THAM KHẢO” cuối luận văn Học viên Phạm Văn Thuận MỤC LỤC MỤC LỤC DANH MỤC TỪ VIẾT TẮT…………………………………………………… DANH MỤC HÌNH VẼ DANH MỤC BẢNG 12 MỞ ĐẦU 13 CHƯƠNG I GIỚI THIỆU CHUNG VỀ WIMAX VÀ ỨNG DỤNG 15 1.1 Tổng quan 15 1.2 Các phiên WiMAX 17 1.3 Đặc điểm WiMAX cố định WiMAX di động 18 1.3.1 WiMAX cố định (Fixed WiMAX): 18 1.3.2 WiMAX di động (Mobile WiMAX) 19 1.4 Các ứng dụng WiMAX 21 1.4.1 Ứng dụng WiMAX cho mạng truy nhập 21 1.4.2 Ứng dụng WiMAX cho mạng đường trục 21 1.4.3 Ứng dụng WiMAX kết hợp Wi-Fi 22 1.5 So sánh công nghệ WiMAX công nghệ khác 23 1.5.1 WiMAX WiFi 23 1.5.2 WiMAX 3G 24 1.5.3 WiMAX LTE 25 CHƯƠNG II LỚP ĐIỀU KHIỂN TRUY NHẬP MAC TRONG WIMAX 26 2.1 Tổng quan 26 2.2 Lớp điều khiển truy cập môi trường MAC 26 2.3 Lớp hội tụ CS 28 2.3.1 Chức nhiệm vụ 28 2.3.2 Kết nối, định danh kết nối CID luồng dịch vụ SF 29 2.3.3 Phân loại 29 2.4 Lớp phần chung MAC CPS 30 2.4.1 Địa MAC kết nối 31 2.4.2 Định dạng MAC PDU 31 2.4.2.1 MAC PDU chung 31 2.4.2.2 Tiêu đề MAC PDU khơng có payload (PDU u cầu băng thông) 33 2.5 Lớp bảo mật PS 36 2.6 Quản lý chất lượng dịch vụ QoS: 36 2.7 Cấu trúc khung TDD chế độ PMP 36 CHƯƠNG III CƠ CHẾ LẬP LỊCH HỖTRỢ QoS TRONG WiMAX 39 3.1 Tổng quan 39 3.2 Hỗ trợ QoS chuẩn 802.16 39 3.3 Cơ chế yêu cầu cấp phát băng thông 40 3.4 Các thông số hỗ trợ QoS 41 3.4.1 Băng thông 41 3.4.2 Độ trễ Lacency (Delay) 41 3.4.3 Jitter 42 3.4.4 Tỷ số tin Packet loss 42 3.4.5 Thông lượng 42 3.5 Phân lớp QoS 42 3.5.1 Dịch vụ cấp phát không yêu cầu (UGS) 43 3.5.2 Dịch vụ thăm dò thời gian thực (rtPS) 44 3.5.3 Dịch vụ thăm dò phi thời gian thực (nrtPS) 44 3.5.4 Dịch vụ thăm dò thời gian thực mở rộng (ertPS) 44 3.5.5 Dịch vụ nỗ lực tối đa (BE) 44 3.6 Kiến trúc QoS giao thức MAC 802.16 45 3.7 Các thuật toán phổ biến cho lập lịch lớp MAC chuẩn 802.16 46 3.7.1 Thuật toán Round Robin (RR) 46 3.7.2 First-In-First-Out (FIFO) 48 3.7.3 Priority queue (PQ) 48 3.7.4 Hàng đợi cân có trọng số WFQ 49 3.7.5 Deficit Round Robin (DRR) 49 3.7.6 Hàng đợi xoay vòng theo trọng số WRR 54 CHƯƠNG IV MỘT SỐ KỸ THUẬT LẬP LỊCH ĐỀ XUẤT CHO WIMAX 56 4.1 Tổng quan: 56 4.2 Thuật toán lập lịch Round Robin 56 4.3 Cài đặt thử nghiệm mô 56 4.3.1 Cấu trúc trạm BS 58 4.3.2 Cấu trúc trạm MS 59 4.3.3 Bộ lập lịch UL/DL 60 4.4 Kịch mô 61 4.5 Kết luận 66 4.6 Thuật toán DRR 66 4.7 Kết luận đánh giá 69 KẾT LUẬN 71 DANH MỤC TÀI LIỆU THAM KHẢO 73 DANH MỤC CÁC TỪ VIẾT TẮT STT Ký hiệu Từ viết tắt 3G AC Third Generation Admission Control Advanced Encryption Standard Airlink Automatic Repeat reQuest Asynchronous Transfer Mode Backhaul Best Effort Base Station Broadband Wireless Access Bandwidth Request Constant Bit Rate Connection Identifier Cyclic Prefix Customer Premises Equipment Common Part Sublayer Convergence Sublayer Deficit Counter Downlink Deficit Round Robin Digital Subscriber Line Extensible Authentication Protocol AES Airlink ARQ ATM Backhaul BE BS 10 BWA 11 12 13 14 BWR CBR CID CP 15 CPE 16 17 18 19 20 21 CPS CS DC DL DRR DSL 22 EAP 23 ertPS Extended rtPS 24 25 26 FCFS FCH FDD First Come First Serve Frame Control Header Frequency Division Nghĩa Thế hệ thứ Kiểm sốt cho phép Chuẩn mã hóa tiên tiến Liên kết vô tuyến Yêu cầu truyền lại tự động (Cơ chế tự động phát lại) Phương thức truyền không đồng Kết nối đường trục Dịch vụ nỗ lực tối đa Trạm sở Truy cập không dây băng thông rộng Yêu cầu băng thông Tốc độ bit cố định Định danh kết nối Chuỗi bảo vệ Thiết bị đầu cuối thuê bao Lớp phần chung Lớp hội tụ Bộ đếm dư thừa Đường xuống Thuật toán lập lịch DRR Đường dây thuê bao số Giao thức chứng thực mở rộng Dịch vụ thăm dò thời gian thực mở rộng Đến trước phục vụ trước Tiêu đề điều khiển khung Song công phân chia theo tần số 27 FIFO 28 FSH 29 30 FTP Grant 31 HTTP 32 ICI 33 IEEE 34 IP 35 ISDN 36 ISI 37 38 39 LAN LOS LTE Duplexing First In First Out Fragmentation Subheader File Transfer Protocol Grant Hypertext Transfer Protocol Inter-Carrier Interference Institute of Electrical and Electronics Engineers Internet Protocol Integrated Services Digital Network Inter-Symbol Interference Local Area Network Line Of Sight Long Term Evolution 40 MAC Media Access Control 41 MIMO 42 MPDU 43 MPEG 44 45 MS NLOS 46 nrtPS 47 OFDM 48 OFDMA Multiple Input Multiple Output MAC Protocol Data Unit Motion Picture Experts Group Mobile Station Non Line of Sight Non-Real-Time Polling Services Orthogonal Frequency Division Multiplexing Orthogonal Frequency division Multiple Access Vào trước trước Tiêu đề phân mảnh Giao thức truyền tập tin Cấp phát Giao thức truyền siêu văn Nhiễu liên kênh Viện kỹ thuật điện điện tử Giao thức liên mạng Mạng số tích hợp đa dịch vụ Nhiễu xuyên ký hiệu Mạng vùng cục Tầm nhìn thẳng Tiến hóa dài hạn Lớp điều khiển truy nhập môi trường Nhiều đầu vào nhiều đầu Đơn vị liệu giao thức lớp MAC Nhóm chuyên gia ảnh động Trạm di động Khơng tầm nhìn thẳng Dịch vụ thăm dò phi thời gian thực Ghép kênh phân chia theo tần số trực giao Đa truy nhập phân chia theo tần số trực giao 49 73 74 Protocol Data Unit Packet Header PHS Suppression PHY Physical Privacy Key PKM Management PMP Point-to-Multipoint Polling Polling PQ Priority Queuing QoS Quality of Service Radio Frequency RFID Identification RR Round Robin Radio Resource RRM Management Real-Time Polling rtPS Services SAP Service Access Point SDU Service Data Unit SF Service Flows SFID Service Flow ID SOFDMA Scalable OFDMA SS Security Sublayer SS Subscriber Station SubCarriers SubCarriers SubChannels SubChannels Transport Control TCP Protocol Time Division TDD Duplexing Unsolicited Grant UGS Services UL Uplink UWB Ultra Wide band 75 VAD Voice with activity detection 76 VBR Variable Bit Rate 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 PDU Đơn vị liệu giao thức Chặn mào đầu tải tin Lớp vật lý Quản lý khóa riêng tư Điểm đến đa điểm Thăm dò Hàng đợi ưu tiên Chất lượng dịch vụ Nhận dạng tần số sóng vơ tuyến Xoay vịng Quản lý tài ngun vơ tuyến Dịch vụ thăm dò thời gian thực Điểm truy nhập dịch vụ Đơn vị liệu dịch vụ Luồng dịch vụ Định danh luồng dịch vụ OFDMA mở rộng Lớp bảo mật Trạm thuê bao Sóng mang Kênh Giao thức điều khiển truyền tải Ghép sông công theo tần số Dịch vụ cấp phát tự nguyện Đường lên Băng tần siêu rộng Thăm dị hoạt động tiếng nói (khử khoảng lặng) Tốc độ bit thay đổi 10 77 WEP 78 79 80 WFQ Wi-Fi WPA 81 WPA2 82 WRR Wired Equivalent Privacy Weighted Fair Queuing Wireless Fidelity WiFi Protected Access WiFi Protected Access Weighted Round Robin Bảo mật tương đương có dây Hàng đợi cân có trọng số Mạng khơng dây Wifi Chuẩn mã hóa WPA Chuẩn mã hóa WPA Hàng đợi xoay vịng theo trọng số 72 mà để mở cho nhà cung cấp thiết bị giải quyết, nhằm tạo cạnh tranh để có sản phẩm tốt cho thị trường Do lực thân hạn chế thời gian nghiên cứu có hạn, luận văn chắn khơng tránh khỏi thiếu sót Tơi mong nhận ý kiến đóng góp Thầy, Cơ bạn đồng nghiệp quan tâm cá nhân để nội dung luận văn hoàn thành đảm bảo chất lượng tốt 73 DANH MỤC TI LIU THAM KHO [1] Seok-Yee Tang, Peter Măuller, Hamid R Sharif, “WiMAX security and quality of service an end to end perspective”, A John Wiley and Sons, Ltd., Publication, 2010 [2] Ayman Khalil and Adlen Ksentini, “Classification of the Uplink Scheduling Algorithms in IEEE 802.16” [3] Vandana Singh Vinod Sharma, “Efficient and Fair Scheduling of Uplink and Downlink in IEEE 802.16 OFDMA Networks” [4] Sanida Omerovic, “WiMax Overview”, Faculty of Electrical Engineering, University of Ljubljana, Slovenia [5] Prepared by Senza Fili Consulting on behalf of the WIMAX Forum, “Fixed, nomadic, portable and mobile applications for 802.16-2004 and 802.16e WiMAX networks”, 2005 [6] G.S Paschos, I Papapanagiotou, C.G Argyropoulos and S.A Kotsopoulos, “A Heuristic Strategy for IEEE 802.16 WiMAX scheduler for Quality of Service” [7] Phạm Cơng Hùng, Nguyễn Hồng Hải, Tạ Vũ Hằng, Vũ Thị Minh Tú, Đỗ Trọng Tuấn, Vũ Đức Thọ, Nguyễn Văn Đức, “Giáo trình thơng tin di động”, Nhà Xuất Bản Khoa Học Kỹ Thuật, 2007 [8] Nongjun Li ,“Overview of WiMax Technical and Application Analysis”, TURKU UNIVERSITY OF APPLIED SCIENCES, 18/05/2011 [9] Senza Fili (2005), Fixed, nomadic, portable and mobile applications for 802.162004 and 802.16e WiMAX networks, WIMAX Forum [10] WiMAX Forum (2006), WiMAX Forum Mobile Certification Profile v1.0 [11] Vadaliya Savan Rameshbhai, Appana Manikanta Sitaram, “ OVERVIEW OF WiMAX TECHNOLOGY Broad Band Access to the Last Mile”, Nov-Dec 2012 [12] Ramjee Prasad, Fernando J Velez, “WiMAX Networks Techno-Economic Vision and Challenges”, 2010 [13] Professor Thong Nguyen, “802.16 MAC Layer Scheduling and its Effect on TCP performance”, University of Technology Sydney (UTS) AUSTRALIA [14] Tarik ANOUARI, Abdelkrim HAQIQ, “Performance Analysis of VoIP Traffic in WiMAX using various Service Classes”, Computer, Networks, Mobility and Modeling laboratory Department of Mathematics and Computer FST, Hassan 1st University, Settat, Morocco 74 [15] Ehsan Asadzadeh Aghdaee, “Quality of Service Support in IEEE 802.16 Broadband Wireless Access Networks”, Department of Electrical & Computer System Engineering Monash University, 2006 [16] ALI HEIDARI KHOEI, GHASEM MIRJALILY AND MEHDI AGHA SARRAM, “IMPROVING THE QUALITY OF SERVICES BY SCHEDULING ALGORITHMS IN WIMAX NETWORKS”, Faculty of Electrical and Computer Engineering, Yazd University, Yazd, Iran, 2014 [17] Chuck Semeria, “Supporting Differentiated Service Classes: Queue Scheduling Disciplines”, Juniper Networks, 2001 [18] M.Shreedhar, G.Varghese, “Efficient fair queueing using deficit round-robin”, IEEE/ACM Transactions on Networking, Vol.4, No.3, 375-385, 1996 [19] Ali Nawaz Naqvi, Ash Mohammad Abbas, Tofik Ali Chouhan, “Performance Evaluation of Fixed and Mobile WiMAX Networks for UDP Traffic”, International Journal of Advanced Research in Computer and Communication Engineering, October 2012 [20] Davide Astuti, “Packet Handling Seminar on Transport of Multimedia Streams in Wireless Internet”, Department of Computer Science University of Helsinki, Helsinki, Finland [21] AWG, WIMAX Forum, In Collaboration with NIST, WiMAX Forum System Level Simulator NS-2 MAC+PHY Add-On for WiMAX (IEEE 802.16), March 2009 [22] Rohit Talwalkar, “Analysis of Quality of Service (QoS) in WiMAX Networks”, Florida Atlantic University, 2008 [23] C Ravichandiran, Dr C Pethuru Raj, Dr V Vaidhyanathan, “Analysis, Modification, and Implementation(AMI) of Scheduling Algorithm for the IEEE 802.116e (Mobile WiMAX)”, International Journal of Computer Science and Information Security, 2010 [24] http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.31.tar.gz [25] https://github.com/barun-saha/ns2-wimax-bluetooth-wsn/blob/master/ns-2.34/ns2.31-WiMAX_AATG_R2.6.patch.3 [26] IEEE Standard for Local and metropolitan area networks - Part 16: Air Interface for Fixed Broadband Wireless Access Systems,IEEE STD 802.16-2004 75 PHỤ LỤC Kịch đầu vào cho ns-2 sử dụng phân tích cho dịch vụ BE UGS # Scenario: Communication between MN and Sink Node with MN attached to BS # Topology scenario: # # | -| # | MN0 | ; 1.0.1 # | -| # # (^) # | # | | # | Base Station | ; 1.0.0 # | | # | # | # | -| # | Sink node | ; 0.0.0 # | -| # #check input parameters if {$argc != 5} { puts "" puts "Wrong Number of Arguments! No arguments in this topology" puts "Syntax: ns test_arq_be_ugs.tcl dl/ul block_size window_size data_loss_rate arq_enable" puts "" exit (1) } # set global variables #set nb_mn [lindex $argv 0] set nb_mn set direction [lindex $argv 0] set ARQ_b_size [lindex $argv 1] set ARQ_window_size [lindex $argv 2] set ARQ_data_loss_rate [lindex $argv 3] set ARQ_Enable_flag [lindex $argv 4] ;# max number of mobile node 76 #set packet_size1500 ;# packet size in bytes at CBR applications #set packet_size 300 set output_dir set gap_size 0.05 ;#compute gap size between packets puts "gap size=$gap_size" set traffic_start 20 set traffic_stop 25 set simulation_stop 80 set diuc ;#modulation for MNs set arq_max_window_size $ARQ_window_size #define debug values Mac/802_16 set debug_ Mac/802_16 set rtg_ 20 Mac/802_16 set ttg_ 20 Mac/802_16 set frame_duration_ 0.005 Mac/802_16 set ITU_PDP_ Mac/802_16/BS set dlratio_ Mac/802_16/SS set dlratio_ Mac/802_16 set fbandwidth_ 10e+6 Mac/802_16 set disable_interference_ Mac/802_16 set arq_block_size_ $ARQ_b_size Mac/802_16 set arqfb_in_dl_data_ Mac/802_16 set arqfb_in_ul_data_ Mac/802_16 set data_loss_rate_ $ARQ_data_loss_rate Mac/802_16 set queue_length_ 10000 Phy/WirelessPhy/OFDMA set g_ 0.25 #define coverage area for base station Phy/WirelessPhy set Pt_ 0.2 Phy/WirelessPhy set RXThresh_ 1.90546e-16 Phy/WirelessPhy set CSThresh_ [expr 0.9*[Phy/WirelessPhy set RXThresh_]] Phy/WirelessPhy set OFDMA_ # Parameter for wireless nodes set opt(chan) Channel/WirelessChannel ;# channel type set opt(prop) Propagation/OFDMA ;# radio-propagation model set opt(netif) Phy/WirelessPhy/OFDMA ;# network interface type set opt(mac) Mac/802_16/BS ;# MAC type 77 set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type set opt(ll) LL ;# link layer type set opt(ant) Antenna/OmniAntenna ;# antenna model set opt(ifqlen) 50 ;# max packet in ifq set opt(adhocRouting) NOAH ;# routing protocol set opt(x) set opt(y) 1100 1100 ;# X dimension of the topography ;# Y dimension of the topography #defines function for flushing and closing files proc finish {} { global ns tf output_dir nb_mn $ns flush-trace close $tf exit } #create the simulator set ns [new Simulator] $ns use-newtrace #Open the NAM trace file set nf [open out.nam w] $ns namtrace-all $nf $defaultRNG seed #create the topography set topo [new Topography] $topo load_flatgrid $opt(x) $opt(y) #puts "Topology created" #open file for trace set tf [open $output_dir/traffic.res w] $ns trace-all $tf #puts "Output file configured" # set up for hierarchical routing (needed for routing over a basestation) #puts "start hierarchical addressing" $ns node-config -addressType hierarchical 78 AddrParams set domain_num_ ;# domain number lappend cluster_num 1 ;# cluster number for each domain AddrParams set cluster_num_ $cluster_num lappend eilastlevel [expr ($nb_mn+1)] ;# number of nodes for each cluster (1 for sink and one for mobile nodes + base station AddrParams set nodes_num_ $eilastlevel puts "Configuration of hierarchical addressing done" # Create God create-god [expr ($nb_mn + 2)] node) #puts "God node created" ;# nb_mn + (base station and sink #creates the sink node in first addressing space set sinkNode [$ns node 0.0.0] #provide some co-ord (fixed) to base station node $sinkNode set X_ 50.0 $sinkNode set Y_ 50.0 $sinkNode set Z_ 0.0 #puts "sink node created" #creates the Access Point (Base station) $ns node-config -adhocRouting $opt(adhocRouting) \ -llType $opt(ll) \ -macType Mac/802_16/BS \ -ifqType $opt(ifq) \ -ifqLen $opt(ifqlen) \ -antType $opt(ant) \ -propType $opt(prop) \ -phyType $opt(netif) \ -channel [new $opt(chan)] \ -topoInstance $topo \ -wiredRouting ON \ -agentTrace ON \ -routerTrace ON \ -macTrace ON \ -movementTrace OFF #puts "Configuration of base station" #setup channel model 79 set prop_inst [$ns set propInstance_] $prop_inst ITU_PDP PED_A puts "after set pPDP" set bstation [$ns node 1.0.0] $bstation random-motion #puts "Base-Station node created" #provide some co-ord (fixed) to base station node $bstation set X_ 550.0 $bstation set Y_ 550.0 $bstation set Z_ 0.0 [$bstation set mac_(0)] set-channel # creation of the mobile nodes $ns node-config -macType Mac/802_16/SS \ -wiredRouting OFF \ -macTrace ON ;# Mobile nodes cannot routing set wl_node_0 [$ns node 1.0.1] $wl_node_0 random-motion ;# disable random motion $wl_node_0 base-station [AddrParams addr2id [$bstation node-addr]] ;#attach mn to basestation #compute position of the node $wl_node_0 set X_ 500.0 $wl_node_0 set Y_ 550.0 $wl_node_0 set Z_ 0.0 $ns at "$wl_node_0 setdest 1060.0 550.0 1.0" puts "wireless node created " ;# debug info [$wl_node_0 set mac_(0)] set-channel [$wl_node_0 set mac_(0)] set-diuc $diuc [$wl_node_0 set mac_(0)] setflow UL 10000 UGS 700 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 [$wl_node_0 set mac_(0)] setflow DL 10000 UGS 700 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 #create source traffic #Create a UDP agent and attach it to node n0 set udp_0 [new Agent/UDP] #set packet_size 300 80 #$udp_($i) set packetSize_ 1500 $udp_0 set packetSize_ 60 $udp_0 set fid_ # -If if { $direction == "ul" } { $ns attach-agent $wl_node_0 $udp_0 } else { $ns attach-agent $sinkNode $udp_0 } # Create a CBR traffic source and attach it to udp0 set cbr_0 [new Application/Traffic/CBR] $cbr_0 set packetSize_ 60 $cbr_0 set interval_ $gap_size $cbr_0 attach-agent $udp_0 #create an sink into the sink node # Create the Null agent to sink traffic set null_0 [new Agent/Null] if { $direction == "ul" } { $ns attach-agent $sinkNode $null_0 } else { $ns attach-agent $wl_node_0 $null_0 } # Attach the agents $ns connect $udp_0 $null_0 #} set wl_node_1 [$ns node 1.0.2] $wl_node_1 random-motion ;# disable random motion $wl_node_1 base-station [AddrParams addr2id [$bstation node-addr]] ;#attach mn to basestation #compute position of the node $wl_node_1 set X_ 500.0+500.0 $wl_node_1 set Y_ 550.0 $wl_node_1 set Z_ 0.0 81 $ns at "$wl_node_1 setdest 1060.0 550.0 1.0" puts "wireless node created " ;# debug info [$wl_node_1 set mac_(0)] set-channel [$wl_node_1 set mac_(0)] set-diuc $diuc [$wl_node_1 set mac_(0)] setflow UL 10000 UGS 700 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 [$wl_node_0 set mac_(0)] setflow DL 10000 UGS 700 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 #create source traffic #Create a UDP agent and attach it to node n0 set udp_1 [new Agent/UDP] #set packet_size 300 #$udp_($i) set packetSize_ 1500 $udp_1 set packetSize_ 150 $udp_1 set fid_ # -If if { $direction == "ul" } { $ns attach-agent $wl_node_1 $udp_1 } else { $ns attach-agent $sinkNode $udp_1 } # Create a CBR traffic source and attach it to udp0 set cbr_1 [new Application/Traffic/CBR] $cbr_1 set packetSize_ 150 $cbr_1 set interval_ $gap_size $cbr_1 attach-agent $udp_1 #create an sink into the sink node # Create the Null agent to sink traffic set null_1 [new Agent/Null] if { $direction == "ul" } { $ns attach-agent $sinkNode $null_1 } else { 82 $ns attach-agent $wl_node_1 $null_1 } # Attach the agents $ns connect $udp_1 $null_1 #} set wl_node_2 [$ns node 1.0.3] $wl_node_2 random-motion ;# disable random motion $wl_node_2 base-station [AddrParams addr2id [$bstation node-addr]] ;#attach mn to basestation #compute position of the node $wl_node_2 set X_ 500.0+250.0 $wl_node_2 set Y_ 550.0 $wl_node_2 set Z_ 0.0 $ns at "$wl_node_2 setdest 1060.0 550.0 1.0" puts "wireless node created " ;# debug info [$wl_node_2 set mac_(0)] set-channel [$wl_node_2 set mac_(0)] set-diuc $diuc [$wl_node_2 set mac_(0)] setflow UL 10000 UGS 700 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 [$wl_node_0 set mac_(0)] setflow DL 10000 UGS 700 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 #create source traffic #Create a UDP agent and attach it to node n0 set udp_2 [new Agent/UDP] #set packet_size 300 #$udp_($i) set packetSize_ 1500 $udp_2 set packetSize_ 1500 $udp_2 set fid_ # -If if { $direction == "ul" } { $ns attach-agent $wl_node_2 $udp_2 } else { $ns attach-agent $sinkNode $udp_2 } 83 # Create a CBR traffic source and attach it to udp0 set cbr_2 [new Application/Traffic/CBR] $cbr_2 set packetSize_ 1500 $cbr_2 set interval_ $gap_size $cbr_2 attach-agent $udp_2 #create an sink into the sink node # Create the Null agent to sink traffic set null_2 [new Agent/Null] if { $direction == "ul" } { $ns attach-agent $sinkNode $null_2 } else { $ns attach-agent $wl_node_1 $null_2 } # Attach the agents $ns connect $udp_2 $null_2 #} set wl_node_3 [$ns node 1.0.4] $wl_node_3 random-motion ;# disable random motion $wl_node_3 base-station [AddrParams addr2id [$bstation node-addr]] ;#attach mn to basestation #compute position of the node $wl_node_3 set X_ 500.0+100.0 $wl_node_3 set Y_ 550.0 $wl_node_3 set Z_ 0.0 $ns at "$wl_node_3 setdest 1060.0 550.0 1.0" puts "wireless node created " ;# debug info [$wl_node_3 set mac_(0)] set-channel [$wl_node_3 set mac_(0)] set-diuc $diuc [$wl_node_3 set mac_(0)] setflow UL 10000 BE 275 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 [$wl_node_3 set mac_(0)] setflow DL 10000 BE 275 $ARQ_Enable_flag 0.05 $ARQ_window_size 0 0 0 0 0 84 #} #create source traffic #Create a UDP agent and attach it to node n0 set udp_3 [new Agent/UDP] #set packet_size 300 #$udp_($i) set packetSize_ 1500 $udp_3 set packetSize_ 1500 $udp_3 set fid_ # -If if { $direction == "ul" } { $ns attach-agent $wl_node_3 $udp_3 } else { $ns attach-agent $sinkNode $udp_3 } # Create a CBR traffic source and attach it to udp0 set cbr_3 [new Application/Traffic/CBR] $cbr_3 set packetSize_ 1500 $cbr_3 set interval_ $gap_size $cbr_3 attach-agent $udp_3 #create an sink into the sink node # Create the Null agent to sink traffic set null_3 [new Agent/Null] if { $direction == "ul" } { $ns attach-agent $sinkNode $null_3 } else { $ns attach-agent $wl_node_1 $null_3 } # Attach the agents $ns connect $udp_3 $null_3 #} # create the link between sink node and base station $ns duplex-link $sinkNode $bstation 100Mb 1ms DropTail 85 # Traffic scenario: if all the nodes start talking at the same # time, we may see packet loss due to bandwidth request collision set diff 0.02 #for {set i 0} {$i < $nb_mn} {incr i} { $ns at $traffic_start "$cbr_0 start" $ns at $traffic_stop "$cbr_0 stop" #} $ns at $traffic_start "$cbr_1 start" $ns at $traffic_stop "$cbr_1 stop" $ns at $traffic_start "$cbr_2 start" $ns at $traffic_stop "$cbr_2 stop" $ns at $traffic_start "$cbr_3 start" $ns at $traffic_stop "$cbr_3 stop" $ns at $simulation_stop "finish" #$ns at $simulation_stop "$ns halt" # Run the simulation puts "Running simulation for $nb_mn mobile nodes " $ns run puts "Simulation done." Sau kịch PERL sử dụng phân tích vết tập tin (trace file) để trích xuất thơng số QoS Tính thơng lượng: # Type: perl avg_throughput_during_sim_time.pl $infile=$ARGV[0]; $flow_id=$ARGV[1]; $tonode=$ARGV[2]; $start_time=0; $end_time=0; # -# -$sum=0; open (DATA,"

Ngày đăng: 19/12/2015, 02:47

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan