Hi,everyone:
I write a script 5.tcl (use ns2 emulation function),get this error
below:
TapAgent(_o105): linked sock 5 as READABLE
TapAgent(_o108): linked sock 7 as READABLE
TapAgent(_o111): linked sock 9 as READABLE
TapAgent(_o114): linked sock 11 as READABLE
*pcap/live object (_o118) couldn't open packet source lnc4: (no devices
found) /dev/bpf4: No such file or directory*
(_o118 cmd line 1)
invoked from within
"_o118 cmd open readonly lnc4"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o118" line 2)
(SplitObject unknown line 2)
invoked from within
"$bpf5 open readonly lnc4"
invoked from within
"set dev5 [$bpf5 open readonly lnc4]"
(file "5.tcl" line 73)
=================================
*Here is 5.tcl*
# Testing passing real world traffic through the
# 1 -->0-->9-->8
# 2 -->0-->9-->8
# 3 -->0-->9-->8
# 4 -->0-->9-->8
# 5 -->0-->9-->8
#
#
set ns [new Simulator]
$ns use-scheduler RealTime
set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf
# Create the nodes needed to the transducer
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set n0 [$ns node]
set n9 [$ns node]
set n8 [$ns node]
# Setup connections between the nodes
$ns simplex-link $n1 $n0 10Mb 5ms DropTail
$ns simplex-link $n2 $n0 10Mb 5ms DropTail
$ns simplex-link $n3 $n0 10Mb 5ms DropTail
$ns simplex-link $n4 $n0 10Mb 5ms DropTail
$ns simplex-link $n5 $n0 10Mb 5ms DropTail
$ns simplex-link $n0 $n9 10Mb 5ms DropTail
$ns simplex-link $n9 $n8 10Mb 5ms DropTail
# Configure entry node 1
set tap1 [new Agent/Tap]; # Create the TCPTap Agent
set bpf1 [new Network/Pcap/Live]; # Create the bpf
set dev1 [$bpf1 open readonly lnc0]
$bpf1 filter "src 192.168.152.1 and src port 5001 and dst 192.168.184.1 "
$tap1 network $bpf1; # Connect bpf to TCPTap Agent
$ns attach-agent $n1 $tap1; # Attach TCPTap Agent to the node
# Configure entry node 2
set tap2 [new Agent/Tap]; # Create the TCPTap Agent
set bpf2 [new Network/Pcap/Live]; # Create the bpf
set dev2 [$bpf2 open readonly lnc1]
$bpf2 filter "src 192.168.152.1 and src port 5002 and dst 192.168.184.1 "
$tap2 network $bpf2; # Connect bpf to TCPTap Agent
$ns attach-agent $n2 $tap2; # Attach TCPTap Agent to the node
# Configure entry node 3
set tap3 [new Agent/Tap]; # Create the TCPTap Agent
set bpf3 [new Network/Pcap/Live]; # Create the bpf
set dev3 [$bpf3 open readonly lnc2]
$bpf3 filter "src 192.168.152.1 and src port 5003 and dst 192.168.184.1 "
$tap3 network $bpf3; # Connect bpf to TCPTap Agent
$ns attach-agent $n3 $tap3; # Attach TCPTap Agent to the node
# Configure entry node 4
set tap4 [new Agent/Tap]; # Create the TCPTap Agent
set bpf4 [new Network/Pcap/Live]; # Create the bpf# Configure entry node
set dev4 [$bpf4 open readonly lnc3]
$bpf4 filter "src 192.168.152.1 and src port 5004 and dst 192.168.184.1 "
$tap4 network $bpf4; # Connect bpf to TCPTap Agent
$ns attach-agent $n4 $tap4; # Attach TCPTap Agent to the node
# Configure entry node 5
set tap5 [new Agent/Tap]; # Create the TCPTap Agent
set bpf5 [new Network/Pcap/Live]; # Create the bpf
set dev5 [$bpf5 open readonly lnc4]
$bpf5 filter "src 192.168.152.1 and src port 5005 and dst 192.168.184.1 "
$tap5 network $bpf5; # Connect bpf to TCPTap Agent
$ns attach-agent $n5 $tap5; # Attach TCPTap Agent to the node
# Configure the exit node
set tap8 [new Agent/Tap]; # Create a TCPTap Agent
set ipnet8 [new Network/IP]; # Create a Network agent
$ipnet8 open writeonly
$tap8 network $ipnet8; # Connect network agent to tap agent
$ns attach-agent $n8 $tap8; # Attach agent to the node.
# Connect the agents.
$ns simplex-connect $tap1 $tap8
$ns simplex-connect $tap2 $tap8
$ns simplex-connect $tap3 $tap8
$ns simplex-connect $tap4 $tap8
$ns simplex-connect $tap5 $tap8
$ns at 600.0 "finish"
proc finish {} {
global ns f nf
$ns flush-trace
close $f
close $nf
exit 0
}
$ns run
===============
*when i comment "entry node 5" , it is OK , Why?*
# Configure entry node 5
# set tap5 [new Agent/Tap]; # Create the TCPTap Agent
# set bpf5 [new Network/Pcap/Live]; # Create the bpf
# set dev5 [$bpf5 open readonly lnc4]
# $bpf5 filter "src 192.168.152.1 and src port 5005 and dst 192.168.184.1 "
# $tap5 network $bpf5; # Connect bpf to TCPTap Agent
# $ns attach-agent $n5 $tap5; # Attach TCPTap Agent to the node
========================================
My ip setting:
lnc0 : flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.224.129 netmask 0xffffff00 broadcast 192.168.224.255
inet6 fe80::20c:29ff:fee6:6007%lnc0 prefixlen 64 scopeid 0x1
ether 00:0c:29:e6:60:07
lnc1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.56.129 netmask 0xffffff00 broadcast 192.168.56.255
inet6 fe80::20c:29ff:fee6:6011%lnc1 prefixlen 64 scopeid 0x2
ether 00:0c:29:e6:60:11
lnc2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.152.128 netmask 0xffffff00 broadcast 192.168.152.255
inet6 fe80::20c:29ff:fee6:601b%lnc2 prefixlen 64 scopeid 0x3
ether 00:0c:29:e6:60:1b
lnc3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.184.129 netmask 0xffffff00 broadcast 192.168.184.255
inet6 fe80::20c:29ff:fee6:6025%lnc3 prefixlen 64 scopeid 0x4
ether 00:0c:29:e6:60:25
lnc4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.11.129 netmask 0xffffff00 broadcast 192.168.11.255
inet6 fe80::20c:29ff:fee6:602f%lnc4 prefixlen 64 scopeid 0x5
ether 00:0c:29:e6:60:2f
lnc5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.33.129 netmask 0xffffff00 broadcast 192.168.33.255
inet6 fe80::20c:29ff:fee6:6039%lnc5 prefixlen 64 scopeid 0x6
ether 00:0c:29:e6:60:39