Network Simulator (ns-2)

Trang cá nhân : or: Why Network simulation: protocol validation, controlled experimental conditions, low cost in $, time, collaboration, complexity Why NS? Provides: protocols: TCP, UDP, HTTP, etc., Traffic Models: Web Traffic, CBR,, Topology Generation tools, Visualization tools, large validation package (people believe it works). | NS tutorial Network Simulator Network Simulator ns-2 tutorial Why Network simulation protocol validation controlled experimental conditions low cost in time collaboration complexity Why NS Provides protocols TCP UDP HTTP etc. Traffic Models Web Traffic CBR Topology Generation tools Visualization tools large validation package people believe it works NS Structure C event scheduler protocols most TCL scripts protocols mostly extensions to C core TCL objects expose an interface to C objects shadow objects system configuration defaults etc. 1 minute TCL tutorial set a 1 set b expr a 2 proc list total list set tmp 0 foreach l list incr tmp l return tmp set c list total 1 2 3 4 5 puts a a b b c c 1 minute oTCL tutorial Class car car instproc init args self instvar wheels set wheels 4 Class vw -superclass car vw instproc init args self instvar wheels vendor set vendor vw eval self next args set a new car puts A a car with a set wheels wheels set b new vw puts B a b set vendor with b set wheels wheels ns 1 Creating Topology We first create a Simulator object which we use to generate nodes and links. This code will generate a topology 2 nodes 1 link but won t generate any traffic. Note we can schedule any arbitrary tcl code to be run with a ns at . command. Here we schedule the end of the simulation at 5 seconds. Create simulation object set ns new Simulator Ask ns for nodes set nO ns node set nl ns node Create a duplex link b w nO nl ns duplex-link n0 nl 1Mb 10ms DropTail Schedule End ns at exit 0 Run Simulation ns run ns 2 Attaching Agents Agents implement differenct connections between nodes. These connections are of some protocol type TCP UDP etc. Here we show a simple UDP example since a UDP sink would do nothing we use the null sink. Create a UDP agent set udpl new Agent UDP Create a Null agent set sinkl new Agent Null Attach agent udpl to node nO ns attach-agent n0 udpl Attach agent sinkl to node nl ns attach-agent nl sinkl Connect the agents ns .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
13    146    1    26-06-2024
387    173    4    26-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.