HungLT
unread,Feb 26, 2012, 10:55:58 PM2/26/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to omnetpp
Hi all, I want to count lost packets in Ethernet LAN. In my channel
BER = 10^-5, size of data = 10 Mb. In OMNET I got this result:
sendBytes = 10,485,760.00 , lost packets = 1263. This result doesn't
match with my result, which was calculated by formula. I see in
INETMANET, tcp' frame is 512 bytes, so number of packets is
10,485,760.00/512 = 20,480.00 packets. In channel tcp's packet is 602
bytes = 4816 bits , ACK's length is 72 bytes = 576 bits. If BER =
10^-5, then probability of getting bit error with tcp's packet = 1 -
(1- BER)^4816 = 0.047019 , probability of getting bit error with
ACK's packet = 1 - (1- BER)^576 = 0.005743 . Here suppose number of
tcp's packet = number of ACK's packet = 20,480.00, so number of lost
packets must be : 047019 * 20,480.00+ 005743*20,480.00 = 1,080.57 ,
not 1263. What's wrong with my results ?
Here is my .NED file:
package myswitchlan;
import inet.networklayer.autorouting.ipv4.FlatNetworkConfigurator;
import ned.DatarateChannel;
import inet.nodes.inet.StandardHost;
import inet.nodes.inet.Router;
import inet.nodes.ethernet.EtherSwitch;
network MySwitchLAN
{
parameters:
double ber1;
@display("bgb=565,314");
types:
channel ethernet_line extends DatarateChannel
{
// delay = 50 ns;
datarate = 10 Mbps;
}
channel fiber_line extends DatarateChannel
{
datarate = 512 Mbps;
}
submodules:
Switch: EtherSwitch {
@display("p=190,152");
}
Router: Router {
@display("p=348,153");
}
Internet: Router {
@display("p=494,153;i=misc/cloud");
}
Configurator: FlatNetworkConfigurator {
@display("p=494,274");
}
Client_1: StandardHost {
@display("p=64,40");
}
Client_2: StandardHost {
@display("p=64,153");
}
Client_3: StandardHost {
@display("p=64,271");
}
Server: StandardHost {
@display("p=494,40;i=device/server");
}
connections:
Client_1.ethg++ <--> ethernet_line { ber=ber1; @display("ls=,
1,s"); } <--> Switch.ethg++;
Client_2.ethg++ <--> ethernet_line { @display("ls=,1,s"); } <--
> Switch.ethg++;
Client_3.ethg++ <--> ethernet_line { @display("ls=,1"); } <-->
Switch.ethg++;
Switch.ethg++ <--> ethernet_line { @display("ls=,1"); } <-->
Router.ethg++;
Router.pppg++ <--> fiber_line { @display("ls=,4"); } <-->
Internet.pppg++;
Internet.pppg++ <--> fiber_line { @display("ls=,4"); } <-->
Server.pppg++;
}
And here's my .ini file:
simtime-scale = -12
#**.module-eventlog-recording = false
**.scalar-recording = false
**.vector-recording = false
[Config MySwitchLAN]
network = MySwitchLAN
#tkenv-plugin-path = ../../../etc/plugins
description = "BER = 0"
**.Client_1.**.scalar-recording = true
**.Client_1.**.vector-recording = true
#record-eventlog = true
#**.vector-recording = true
#**.scalar-recording = true
output-vector-file = ${resultdir}/${configname}-${runnumber}.vec
output-scalar-file = ${resultdir}/${configname}-${runnumber}.sca
eventlog-file = ${resultdir}/${configname}-${runnumber}.elog
#**.channel.throughput.result-recording-modes = all
# config TCP app of Client_1
**.Client_1.numTcpApps = 1
**.Client_1.tcpApp[*].typename = "TCPSessionApp"
**.Client_1.tcpApp[*].connectAddress = "Server"
**.Client_1.tcpApp[*].localPort = -1
**.Client_1.tcpApp[*].connectPort = 1000
**.Client_1.tcpApp[*].sendBytes = 10 MiB
# config TCP app of Server
**.Server.numTcpApps = 1
**.Server.tcpApp[*].typename = "TCPSinkApp"
# config NIC
**.eth[*].mac.duplexMode = true
# config channel
#**.channel.ber = ${10e-5, 10e-6, 10e-7, 10e-8, 10e-9}
**.ber1 = ${10e-5, 10e-6, 10e-7, 10e-8, 10e-9, 0}
#**.channel.packets.result-recording-modes = all
#**.channel.packetBytes.result-recording-modes = all
#**.channel.packetsDiscarded.result-recording-modes = all