$n2 attach $ipnet2 8000
set ipnet3 [new Agent/OutThread]; # Create a Network agent
$ipnet3 open writeonly
$ns attach-agent $n3 $ipnet3; # Attach agent to the node.
$n2 attach $ipnet3 8000
set ipnet1 [new Agent/OutThread]; # Create a Network agent
$ipnet1 open writeonly
$ns attach-agent $n1 $ipnet1; # Attach agent to the node.
$n1 attach $ipnet1 8000
$ns at 432000.0 "finish"
proc finish {} {
exit 0
}
$ns run
b. 路由的添加
在FTP客户端所在的主机添加路由route add -host 10.88.88.98 gw 10.88.88.86
在FTP server所在的主机添加路由 route add -host 10.88.88.99 gw 10.88.88.86
c. 真实的网络拓扑环境在仿真器中的模拟
FTP客户端 真实IP 10.88.88.81 虚IP 10.88.88.99