Introduction To NS-2: Part 5. Wireless Network
Introduction To NS-2: Part 5. Wireless Network
Outline
Wireless Network
Wi-Fi
Cellular Network
WiMax
...
Agent
AgentLayer
Layer
Transport
TransportLayer
Layer
Router
RouterLayer
Layer
Network
NetworkLayer
Layer
MAC
MACLayer
Layer
PHY
PHYLayer
Layer
udp
null
(500,900)
(350,500)
(500,500)
(500,100)
2
(650,500)
Result
1Event
2Time
3NodeID
4Layer
7PacketType
8Packetsize
14Sourceaddress
15Destinationaddress
s:send
r:receive
d:drop
f:forward
RTR:RouterTrace
AGT:AgentTrace
MAC:MACTrace
src_node:port
dest_node:port
Easier to understand
$ns use-newtrace
Event
s : send
r : receive
d : drop
f : forward
Time
-Ni : node id
-Ma : duration
AWK:
BEGIN{
receive=0;
send=0;
}
{
if(($1=="s")&&($3=="_0_")&&($4=="AGT"))
send++;
if(($1=="r")&&($3=="_2_")&&($4=="AGT"))
receive++;
}
END{
printf("Send: %d, Receive: %d, Loss: %d, Loss Ratio: %f%
%\n",send,receive,send-receive,(send-receive)/send*100);
}
Modification on OTcl
#========================================
# Parameters: Queue Length and Event Rate
#========================================
set Data_Rate [lindex $argv 0]
Result
Questions?
Thank you !