diff options
Diffstat (limited to '3446/CH6/EX6.10/Ex6_10.sce')
-rw-r--r-- | 3446/CH6/EX6.10/Ex6_10.sce | 28 |
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);
|