summaryrefslogtreecommitdiff
path: root/3446/CH6/EX6.10/Ex6_10.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3446/CH6/EX6.10/Ex6_10.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3446/CH6/EX6.10/Ex6_10.sce')
-rw-r--r--3446/CH6/EX6.10/Ex6_10.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/3446/CH6/EX6.10/Ex6_10.sce b/3446/CH6/EX6.10/Ex6_10.sce
new file mode 100644
index 000000000..6b504fa37
--- /dev/null
+++ b/3446/CH6/EX6.10/Ex6_10.sce
@@ -0,0 +1,28 @@
+// Exa 6.10
+// To calculate the data link protocol efficiency with
+//(1) Stop and Wait protocol — full duplex,
+//(2) SRP with window size W=8, and
+//(3) Go-Back-N protocol with window size W=8.
+
+clc;
+clear all;
+
+Tprop=4; //maximum propogation delay in sec
+R=10; // data rate in Mbps
+PackLen=400; //data packet length in bits
+ACK=20; //length of ACK packet in bits
+Tproc=1; //processing time(sec)
+p=0.01;//probability that a data packet or its ACK can be corrupted during transmission
+
+//solution
+Tp=PackLen/R; //packet transmission time in microsec
+Ta=ACK/R; // transmission time for an ACK in microsec
+T=Tp+2*Tprop+2*Tproc+Ta;// total time for transmission time
+// Stop and wait ARQ
+Eff0=(1-p)*Tp/((1-p)*T+p*Tp);
+//SRP with window size W=8
+W=8;
+Eff1=(2+p*(W-1))/(2+p*(3*W-1));
+//Go-Back-N protocol with window size W=8
+Eff2=1/(1+W*(p/(1-p)));
+printf('The data link protocol efficiency with Stop and Wait protocol, SRP and GBN are \n %.3f, %.3f abd %.3f respectively\n',Eff0,Eff1,Eff2);