summaryrefslogtreecommitdiff
path: root/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-09-07 17:46:06 +0530
committerThomas Stephen Lee2015-09-07 17:46:06 +0530
commit78784b374b2d1a9be66eb4ad41470409e2bd4dfa (patch)
tree7b0144248a9d5c9b6c66065697177ee04a30f93e /Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb
parent41f1f72e9502f5c3de6ca16b303803dfcf1df594 (diff)
downloadPython-Textbook-Companions-78784b374b2d1a9be66eb4ad41470409e2bd4dfa.tar.gz
Python-Textbook-Companions-78784b374b2d1a9be66eb4ad41470409e2bd4dfa.tar.bz2
Python-Textbook-Companions-78784b374b2d1a9be66eb4ad41470409e2bd4dfa.zip
add/update books
Diffstat (limited to 'Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb')
-rwxr-xr-xWireless_Communications_and_Networking_by_V._Garg/ch14.ipynb106
1 files changed, 106 insertions, 0 deletions
diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb
new file mode 100755
index 00000000..58285a29
--- /dev/null
+++ b/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb
@@ -0,0 +1,106 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3bb6fed41815ab02f5db449f0fb6dc3bca89d7411c6822dfe382fccc1777b7c3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14: Mobile Network and Transport Layer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.1, Page 452"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "O=800*1000; #Object size(Bytes)\n",
+ "S=536.*8; #max Segment Size(in bits)\n",
+ "RTT=0.1; #Round trip-time in sec\n",
+ "R=1.*10**6; #Transmission rate of the link from the server to the client in bps\n",
+ "\n",
+ "#Calculations\n",
+ "Lmin=2*RTT+(O/R); #latency(msec)\n",
+ "# For minimum latency (S/R) +RTT -(W*S/R) = 0;Therefore\n",
+ "W=1+(RTT)/(S/R);\n",
+ "\n",
+ "#Results\n",
+ "print 'The minimum possible latency is %d sec'%Lmin;\n",
+ "print 'The minimum window size is %.1f segments'%W;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum possible latency is 1 sec\n",
+ "The minimum window size is 24.3 segments\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.2, Page 452"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "RTT=0.1; #Round trip-time in sec\n",
+ "MSS=536.*8; #Maximum segment size in bits\n",
+ "p=0.01;# packet loss probability for the path\n",
+ "RTO=5*RTT; #Retransmission time out(from eqn 14.2 on page 450)\n",
+ "\n",
+ "#Calculations\n",
+ "R=0.93*MSS/(RTT*math.sqrt(p));\n",
+ "RR=MSS/(RTT*math.sqrt(1.33*p)+RTO*p*(1+32*p**2)*min(1,3*math.sqrt(0.75*p)));\n",
+ "\n",
+ "#Results\n",
+ "print 'The upper bound of the throughput is %.4f Mbps'%(R*10**-6);\n",
+ "print 'The throughput with retransmission due to errors is %.4f Mbps'%(RR*10**-6);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The upper bound of the throughput is 0.3988 Mbps\n",
+ "The throughput with retransmission due to errors is 0.3341 Mbps\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file