📄 node426.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by: Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by: Nikos Drakos, CBLU, University of Leeds* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>32.5.2 Multihomed Example</TITLE><META NAME="description" CONTENT="32.5.2 Multihomed Example"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="previous" HREF="node425.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node425.html"><LINK REL="up" HREF="node424.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node424.html"><LINK REL="next" HREF="node427.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node427.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html7921" HREF="node427.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node427.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html7915" HREF="node424.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node424.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html7911" HREF="node425.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node425.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html7917" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html7919" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html7922" HREF="node427.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node427.html">33. Agent/SRM</A><B> Up:</B> <A NAME="tex2html7916" HREF="node424.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node424.html">32.5 Example Scripts</A><B> Previous:</B> <A NAME="tex2html7912" HREF="node425.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node425.html">32.5.1 Singled Homed Example</A>   <B> <A NAME="tex2html7918" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html7920" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION06352000000000000000"></A> <A NAME="sec:multihomedExample"></A><BR>32.5.2 Multihomed Example</H2><P><PRE> # This example demonstrates multihoming. Two SCTP endpoints, each # with 2 interfaces, are directly connected between each pair of # interfaces. In the middle of the association, a change primary # is done. Running nam helps to visualize the multihomed # architecture. # # host0_if0 O===========O host1_if0 # / \ # host0_core O O host1_core # \ / # host0_if1 O===========O host1_if1</PRE> <PRE> Trace set show\_sctphdr\_ 1 set ns [new Simulator] set nf [open sctp.nam w] \$ns namtrace-all \$nf set allchan [open all.tr w] \$ns trace-all \$allchan proc finish {} { exec nam sctp.nam & exit 0 } set host0\_core [\$ns node] set host0\_if0 [\$ns node] set host0\_if1 [\$ns node] \$host0\_core color Red \$host0\_if0 color Red \$host0\_if1 color Red \$ns multihome-add-interface \$host0\_core \$host0\_if0 \$ns multihome-add-interface \$host0\_core \$host0\_if1 set host1\_core [\$ns node] set host1\_if0 [\$ns node] set host1\_if1 [\$ns node] \$host1\_core color Blue \$host1\_if0 color Blue \$host1\_if1 color Blue \$ns multihome-add-interface \$host1\_core \$host1\_if0 \$ns multihome-add-interface \$host1\_core \$host1\_if1 \$ns duplex-link \$host0\_if0 \$host1\_if0 .5Mb 200ms DropTail \$ns duplex-link \$host0\_if1 \$host1\_if1 .5Mb 200ms DropTail set sctp0 [new Agent/SCTP] \$ns multihome-attach-agent \$host0\_core \$sctp0 set trace\_ch [open trace.sctp w] \$sctp0 set trace\_all\_ 1 # print all on a single trace event; \$sctp0 trace rto\_ \$sctp0 trace errorCount\_ \$sctp0 attach \$trace\_ch set sctp1 [new Agent/SCTP] \$ns multihome-attach-agent \$host1\_core \$sctp1 \$ns connect \$sctp0 \$sctp1 set ftp0 [new Application/FTP] \$ftp0 attach-agent \$sctp0 \$sctp0 set-primary-destination \$host1\_if0 # set primary before association starts; \$ns at 7.5 "\$sctp0 set-primary-destination \$host1\_if1" # change primary; \$ns at 7.5 "\$sctp0 print cwnd\_" # print all dests' cwnds at time 7.5; \$ns at 0.5 "\$ftp0 start" \$ns at 9.5 "\$ftp0 stop" \$ns at 10.0 "finish" \$ns run</PRE><P><BR><HR><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -