亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nsscript2.html

?? NS的教程
?? HTML
字號:
<HTML>

<HEAD>
 <TITLE>Marc Greis' Tutorial for the UCB/LBNL/VINT Network Simulator "ns"</title>
</HEAD>

<BODY BGCOLOR="#ffffff" TEXT="#000000">

<H1 ALIGN=CENTER>V. Making it more interesting</H1>

<P>
[<A HREF="nsscript1.html">Previous section</A>]
[<A HREF="nsscript3.html">Next section</A>]
[<A HREF="nsindex.html">Back to the index</A>]
</P>

<P>
In this section we are going to define a topology with four nodes in which
one node acts as router that forwards the data that two nodes are sending to
the fourth node. I will explain find a way to distinguish the data flows 
from the two nodes from each other, and I will show how a queue can be monitored
to see how full it is, and how many packets are being discarded.
</P>

<HR>

<A NAME="first">
<P>
<STRONG>V.1. The topology</STRONG><BR>
As always, the first step is to define the topology. You should create a
file 'example2.tcl', using the <A HREF="examples/template.tcl">code</A> 
from <A HREF="nsscript1.html#first">section
IV.1</A> as a template. As I said before, this code will always be similar. You
will always have to create a simulator object, you will always have to start
the simulation with the same command, and if you want to run nam automatically,
you will always have to open a trace file, initialize it, and define a procedure
which closes it and starts nam.
</P>
<P>
Now insert the following lines into the code to create four nodes.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
</PRE></CODE></TD></TABLE>
</P>
<P>
The following piece of Tcl code creates three duplex links between the nodes.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$ns duplex-link $n0 $n2 1Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 10ms DropTail
$ns duplex-link $n3 $n2 1Mb 10ms DropTail
</PRE></CODE></TD></TABLE>
</P>
<P>
You can save and start the script now. You might notice that the topology
looks a bit awkward in nam. You can hit the 're-layout' button to make it
look better, but it would be nice to have some more control over the layout.
Add the next three lines to your Tcl script and start it again.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$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 
</PRE></CODE></TD></TABLE>
You will probably understand what this code does when you look at the topology
in the nam window now. It should look like the picture below.
</P>
<P>
<IMG SRC="images/namss4.gif" WIDTH=300 HEIGHT=199 ALT="Nam snap shot">

</P>
<P>
Note that the autolayout related parts of nam are gone,
since now you have taken the layout into your own hands. The options for the
orientation of a link are right, left, up, down and combinations of these
orientations. You can experiment with these settings later, but for now 
please leave the topology the way it is.
</P>

<HR>
<A NAME="second">
<P>
<STRONG>V.2. The events</STRONG><BR>
Now we create two UDP agents with CBR traffic sources and attach them to the
nodes n0 and n1. Then we create a Null agent and attach it to node n3.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

#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 Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0

#Create a UDP agent and attach it to node 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-agent $udp1

set null0 [new Agent/Null] 
$ns attach-agent $n3 $null0 
</PRE></CODE></TD></TABLE>
</P>

<P>
The two CBR agents have to be connected to the Null agent.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$ns connect $udp0 $null0 
$ns connect $udp1 $null0
</PRE></CODE></TD></TABLE>
</P>
<P>
We want the first CBR agent to start sending at 0.5 seconds and
to stop at 4.5 seconds while the second CBR agent starts at 1.0
seconds and stops at 4.0 seconds.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$ns at 0.5 "$cbr0 start" 
$ns at 1.0 "$cbr1 start"
$ns at 4.0 "$cbr1 stop"
$ns at 4.5 "$cbr0 stop"

</PRE></CODE></TD></TABLE>
</P>

When you start the script now with 'ns example2.tcl', you will
notice that there is more traffic on the links from n0 to n2 and
n1 to n2 than the link from n2 to n3 can carry. A simple calculation
confirms this: We are sending 200 packets per second on each of the
first two links and the packet size is 500 bytes. This results
in a bandwidth of 0.8 megabits per second for the links from n0 to n2
and from n1 to n2. That's a total bandwidth of 1.6Mb/s, but the
link between n2 and n3 only has a capacity of 1Mb/s, so obviously
some packets are being discarded. But which ones? Both flows are
black, so the only way to find out what is happening to the packets
is to monitor them in nam by clicking on them. In the next two
sections I'm going to show you how to distinguish between different
flows and how to see what is actually going on in the queue
at the link from n2 to n3.
</P>

<HR>

<A NAME="third">
<P>
<STRONG>V.3. Marking flows</STRONG><BR>
Add the following two lines to your CBR agent definitions.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$udp0 set class_ 1
$udp1 set class_ 2

</PRE></CODE></TD></TABLE>
The parameter 'fid_' stands for 'flow id'.
</P>
<P>
Now add the following piece of code to your Tcl script,
preferably at the beginning after the simulator object has
been created, since this is a part of the simulator setup.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$ns color 1 Blue
$ns color 2 Red

</PRE></CODE></TD></TABLE>
This code allows you to set different colors for each flow id.
</P>

<P>
<IMG SRC="images/namss5.gif" WIDTH=300 HEIGHT=199 ALT="Nam snap shot">
</P>

<P>
Now you can start the script again and one flow should be blue,
while the other one is red. Watch the link from node n2 to n3 for
a while, and you will notice that after some time the distribution
between blue and red packets isn't too fair anymore (at least
that's the way it is on my system). In the next section I'll
show you how you can look inside this link's queue to find out
what is going on there.
</P>

<HR>

<A NAME="fourth">
<P>
<STRONG>V.4. Monitoring a queue</STRONG><BR>

You only have to add the following line to your code to monitor the
queue for the link from n2 to n3.
<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$ns duplex-link-op $n2 $n3 queuePos 0.5
</PRE></CODE></TD></TABLE>
Start ns again and you will see a picture similar to the one below after
a few moments.
</P>
<P>
<IMG SRC="images/namss6.gif" WIDTH=300 HEIGHT=199 ALT="Nam snap shot">
</P>
You can see the packets in the queue now, and after a while you can even see
how the packets are being dropped, though (at least on my system, I guess
it might be different in later or earlier releases) only blue packets are
being dropped. But you can't really expect too much 'fairness' from a simple
DropTail queue. So let's try to improve the queueing by using a SFQ (stochastic
fair queueing) queue for the link from n2 to n3. Change the link definition
for the link between n2 and n3 to the following line.

<TABLE BGCOLOR="#eeeeee" CELLPADDING=5><TD><CODE><PRE>

$ns duplex-link $n3 $n2 1Mb 10ms SFQ     
</PRE></CODE></TD></TABLE>

The queueing should be 'fair' now. The same amount of blue and red packets
should be dropped.
</P>

<P>
<IMG SRC="images/namss7.gif" WIDTH=300 HEIGHT=199 ALT="Nam snap shot">
</P>

<P>
You can download the full example <A HREF="examples/example2.tcl">here</A>.
</P>

<HR>

<P>
[<A HREF="nsscript1.html">Previous section</A>]
[<A HREF="nsscript3.html">Next section</A>]
[<A HREF="nsindex.html">Back to the index</A>]
</P>

ns-users <BR>
<ADDRESS><A HREF="mailto:ns-users@isi.edu">ns-users@isi.edu</A></ADDRESS>

</BODY>

</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文在线一区二区| 欧美男同性恋视频网站| 久久se精品一区精品二区| 亚洲一区二区三区爽爽爽爽爽| 国产精品色噜噜| 中文字幕欧美一区| 亚洲视频在线观看一区| 日韩理论电影院| 一区二区三区在线视频免费| 亚洲一区精品在线| 欧美a级理论片| 国产在线精品一区二区夜色| 国产精品一区免费视频| www.成人在线| 欧美婷婷六月丁香综合色| 欧美日韩色一区| 精品国产污污免费网站入口 | 制服丝袜中文字幕一区| 日韩美女视频在线| 国产欧美视频一区二区| 亚洲精品少妇30p| 轻轻草成人在线| 国产成人啪午夜精品网站男同| 99久久婷婷国产综合精品 | 日韩一级片在线观看| 久久亚洲综合色| 亚洲精品欧美综合四区| 日韩精品久久理论片| 国产一区二区三区精品欧美日韩一区二区三区| 久久av老司机精品网站导航| www.日韩大片| 日韩写真欧美这视频| 国产精品护士白丝一区av| 亚洲h动漫在线| 国产成人久久精品77777最新版本| 91丨porny丨首页| 日韩三级精品电影久久久| 国产精品每日更新| 美女视频黄 久久| 一本一本久久a久久精品综合麻豆| 欧美一级片免费看| 亚洲日本成人在线观看| 经典一区二区三区| 欧美色图12p| 中文字幕一区在线观看| 久久国产精品一区二区| 91蜜桃视频在线| 欧美激情一区二区三区在线| 免费在线观看视频一区| 欧洲国内综合视频| 国产欧美综合色| 精久久久久久久久久久| 欧美日韩一区二区三区免费看| 欧美极品少妇xxxxⅹ高跟鞋 | 久久久影视传媒| 免费人成网站在线观看欧美高清| 99久久久久久| 国产欧美精品在线观看| 久久精品国产精品青草| 欧美日韩成人综合在线一区二区| 亚洲日穴在线视频| 成人精品高清在线| 久久久久99精品国产片| 精品一区二区三区不卡| 欧美一区日韩一区| 日韩国产精品91| 欧美色倩网站大全免费| 亚洲一区二区三区四区在线免费观看| 成人黄色网址在线观看| 久久精品亚洲麻豆av一区二区| 韩国欧美国产1区| 久久这里只有精品首页| 韩国中文字幕2020精品| 久久亚洲精品小早川怜子| 精品综合免费视频观看| 精品久久99ma| 国产自产2019最新不卡| 久久精品一区蜜桃臀影院| 风间由美中文字幕在线看视频国产欧美| 日韩欧美中文字幕一区| 日韩电影在线观看电影| 日韩三级精品电影久久久| 韩国女主播成人在线| 国产日韩av一区| 99精品黄色片免费大全| 亚洲综合一区二区| 欧美日韩精品一区二区三区| 日韩国产精品久久久久久亚洲| 日韩视频永久免费| 国产麻豆视频一区| 日韩理论在线观看| 这里只有精品免费| 国产一区二区三区黄视频 | 亚洲一区精品在线| 日韩欧美一级片| 国产精品一区二区在线播放| 中文字幕制服丝袜一区二区三区| 色婷婷久久久综合中文字幕| 亚洲一区在线视频| 精品欧美黑人一区二区三区| 大白屁股一区二区视频| 亚洲一二三四在线| 欧美精品一区二区三区蜜臀| 成人av免费网站| 亚洲成人av一区| 久久九九99视频| 欧美午夜电影一区| 久久电影网站中文字幕| 日本一区二区成人在线| 欧美调教femdomvk| 国产成人啪午夜精品网站男同| 亚洲另类春色校园小说| 日韩欧美国产一区二区三区| 99视频精品在线| 奇米影视一区二区三区小说| 国产精品视频yy9299一区| 欧美精品自拍偷拍| 99久久国产免费看| 精品亚洲免费视频| 性做久久久久久久免费看| 欧美韩国一区二区| 91精品啪在线观看国产60岁| 成人国产电影网| 免费成人在线播放| 香蕉久久一区二区不卡无毒影院| 国产精品视频免费看| 日韩女优视频免费观看| 欧美色中文字幕| 成人精品在线视频观看| 激情文学综合丁香| 日日摸夜夜添夜夜添国产精品| 亚洲欧洲一区二区三区| 国产网站一区二区| 日韩欧美色综合| 在线播放国产精品二区一二区四区| 懂色中文一区二区在线播放| 久久成人麻豆午夜电影| 日韩高清不卡一区二区| 亚洲国产va精品久久久不卡综合 | 色呦呦网站一区| 成人精品高清在线| 国产精品一二三在| 国产精品一二三在| 国产一区二区三区久久久| 久久99精品久久久| 免费在线观看精品| 美女www一区二区| 男人的天堂亚洲一区| 日韩二区三区四区| 青娱乐精品视频在线| 五月婷婷另类国产| 日本女优在线视频一区二区| 视频一区二区三区在线| 日韩经典一区二区| 喷白浆一区二区| 国产自产视频一区二区三区| 国产一区二区久久| 成人深夜视频在线观看| 成人app下载| 91成人在线观看喷潮| 欧美日韩在线一区二区| 欧美日韩精品欧美日韩精品一 | 麻豆免费看一区二区三区| 免费观看日韩电影| 国产美女在线精品| 成人国产亚洲欧美成人综合网| 94-欧美-setu| 欧美日韩日日夜夜| 欧美精品一区二区三区蜜桃| 国产日韩精品久久久| 一区二区三区在线播| 日韩成人一区二区三区在线观看| 久久99精品国产| 成人三级伦理片| 在线看国产一区二区| 日韩亚洲国产中文字幕欧美| 久久久久久一二三区| 亚洲人妖av一区二区| 午夜精品123| 高清不卡一二三区| 欧美性一二三区| 久久久五月婷婷| 亚洲一区二区精品久久av| 久久69国产一区二区蜜臀| av不卡在线播放| 精品蜜桃在线看| 亚洲精品乱码久久久久久黑人 | 青青草精品视频| 国产成人亚洲综合a∨猫咪| 在线观看视频91| 国产亚洲一二三区| 五月婷婷综合激情| 91啪亚洲精品| 亚洲精品一区二区精华| 亚洲影视在线观看| 国产成人免费9x9x人网站视频| 欧美乱妇20p| 亚洲色图欧美偷拍| 国产精品一区在线观看乱码| 欧美精品黑人性xxxx|