summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-09-29 19:53:55 -0600
committermo khan <mo@mokhan.ca>2025-09-29 19:53:55 -0600
commit57432cad1d88d85cbc497d05040abd4f8f2310cb (patch)
treeea38bee5d2a3d1ab0b2f2431fdd6e694851cc080
parent532586aa65cbd07ba30e767409a2fa99c6b9516f (diff)
fix numbers
-rw-r--r--assignments/1/README.md134
-rwxr-xr-xassignments/1/bin/trace2
-rw-r--r--assignments/1/trace-1.txt9
-rw-r--r--assignments/1/trace-2.txt9
-rw-r--r--assignments/1/trace-3.txt9
5 files changed, 118 insertions, 45 deletions
diff --git a/assignments/1/README.md b/assignments/1/README.md
index de8f378..77ebd00 100644
--- a/assignments/1/README.md
+++ b/assignments/1/README.md
@@ -19,18 +19,11 @@ linestretch: 1.0
>
> If you are not familiar with the utility, read the Microsoft article, "How to Use TRACERT".
-I ran traceroute at three different times of day and I included the full
-output below. The destination host didn't reply to my probes.
-I used the last responding hop as the end-to-end RTT and included that in my
-summary.
-
-Summary (using hop 7 as last responding hop):
-
| Run | Visible hops | RTT used (ms) |
| --- | ------------- | ------------- |
-| 1 | 7 | 18.50 |
-| 2 | 7 | 18.92 |
-| 3 | 7 | 18.88 |
+| 1 | 7 | ((19.010 + 18.257 + 18.230) / 3) = 18.50 |
+| 2 | 7 | ((18.821 + 18.985 + 18.966) / 3) = 18.92 |
+| 3 | 7 | ((18.500 + 18.464 + 19.680) / 3) = 18.88 |
- Average RTT across runs: (18.50 + 18.92 + 18.88) / 3 = 18.77 ms
- Standard deviation (sample): sqrt((0.0729 + 0.0225 + 0.0121) / 2) = ~0.23 ms
@@ -302,10 +295,9 @@ Reference: Kurose & Ross, 8th ed., Sec. 2.2 (HTTP/HTTPS basics), Sec. 2.3 (Elect
> Each packet is 10,000 bits long, including 100 bits of header.
> Assume the size of the assignment file is 10 MB.
-
> a) How many packets will the assignment file be segmented into?
-It will take 8080 packets to upload a 10 MB assignment file.
+It will take (8,080 + 1) packets to upload a 10 MB assignment file.
Each packet with 10,000 bits with 100 bits reserved for the header. This leaves
9,900 bits for the payload in each packet. A 10 MB file is equal to 80,000,000
@@ -316,7 +308,7 @@ divided by the payload size of each packet.
* Header: 100 bits
* Payload: 9,900 bits
* File: 10 MB = 80,000,000 bits
-* Total Packets: 80,000,000 / 9,900 = 8080
+* Total Packets: ceil(80,000,000 / 9,900) = ceil(8,080.808...) = 8,081
> b) How many links can be identified using TRACERT or Traceroute between your computer and the university server? What are they?
@@ -326,17 +318,23 @@ Later hops filtered probes, so the total hop count to the destination could not
| hop | address | description |
| --- | ------- | ----------- |
-| 1 | _gateway (192.168.0.1) | home router |
+| 1 | gateway (192.168.0.1) | home router |
| 2 | 10.139.230.1 | ISP gateway (private address inside Telus network) |
| 3 to 6 | | no reply (likely ICMP/UDP filtered) |
| 7 | QUBCPQBIDR03.bb.telus.com (154.11.15.105) and 154.11.15.107 | Telus backbone |
| 8 to 30 | | no reply |
> c) What is the speed for each identified link based on your best calculation? Show your work.
+
> d) Assume you start uploading the assignment at t0. At what time will the last packet be pushed into the first link?
-> e) At what time will the last packet arrive at the university server?
-Reference: Kurose & Ross, 8th ed., Ch. 1 (delays, throughput, store-and-forward; traceroute context).
+Total bits transmitted on the first link = 8,081 packets * 10,000 bits/packet = 80,810,000 bits.
+
+My home ISP speed is 960 Mbps up and down.
+
+- 80,810,000 / 960,000,000 ~ 0.084 seconds after t0.
+
+> e) At what time will the last packet arrive at the university server?
## 2.2 Propagation Delay and Bandwidth-Delay Product (20%)
@@ -350,6 +348,32 @@ of network links between your computer and the university server.
> d) Now suppose the assignment file is sent continuously as one big file. What is the maximum number of bits that will be in the links at any given time?
> e) Based on the results from c and d, what does the bandwidth-delay product imply?
+Assumptions based on 2.1’s traceroute:
+
+- One‑way propagation ≈ 20 ms (conservative; RTTs to late hops were ~18.5–19 ms, destination likely nearby beyond filtered hops).
+- Propagation speed s = 2×10^8 m/s.
+
+a) Total path distance (one‑way):
+
+- d = s × T_prop ≈ 2×10^8 × 0.020 = 4.0×10^6 m ≈ 4,000 km.
+
+b) Propagation delay T_prop (one‑way):
+
+- T_prop ≈ 0.020 s (from above). If using d explicitly: T_prop = d/s.
+
+c) Bandwidth‑delay product (BDP):
+
+- BDP = R × T_prop (bits).
+- Example with R = 20 Mbps: BDP = 20×10^6 × 0.020 = 400,000 bits ≈ 0.4 Mb ≈ 50 kB.
+
+d) Maximum in‑flight bits when sending a long file continuously equals the BDP:
+
+- N_in_flight_max = R × T_prop (same as c).
+
+e) Implication:
+
+- BDP is the “pipe size” in bits. To fully utilize a path of rate R and delay T_prop, the sender must be able to have roughly BDP bits outstanding (e.g., TCP window ≥ BDP). If the window is smaller than BDP, the path is underutilized; larger mainly increases in‑flight data without improving steady‑state throughput.
+
Reference: Kurose & Ross, 8th ed., Sec. 1.4 (propagation delay) and Ch. 3 (BDP intuition via TCP throughput/window sizing).
## 2.3 Web Cache Implementation and Performance (20%)
@@ -365,6 +389,42 @@ Reference: Kurose & Ross, 8th ed., Sec. 1.4 (propagation delay) and Ch. 3 (BDP i
> d) If the total average response time is defined as 5+beta, and the miss rate of your proxy server is 0.5, what will be the total average response time?
+Setup (what I did):
+
+- Installed Apache and enabled forward proxy and caching (mod_proxy, mod_proxy_http, mod_cache, mod_cache_disk). Configured listen on 3128, CacheEnable disk /, and LAN‑only access controls (Require ip 192.168.0.0/16, etc.).
+- Pointed device proxy settings to http://proxy-host:3128; verified cache hits via Apache logs.
+
+Given/derived parameters:
+
+- Average object size S = 100 MB = 800 Mb.
+- Aggregate request rate λ = 3 requests/min = 0.05 s^-1.
+- Let last‑mile download rate be R (bps). For numerics, use R = 50 Mbps (replace with your actual rate in the formulas below).
+
+a) Average transfer time α over the last‑mile link:
+
+- α = S / R = 800 Mb / R.
+- Numeric (R = 50 Mb/s): α = 800/50 = 16 s.
+
+b) Traffic intensity (utilization) μ on the Internet link:
+
+- μ = λ × α = λ × (S/R) = (0.05) × (800/R) = (40 Mb/s)/R.
+- Numeric (R = 50 Mb/s): μ = 40/50 = 0.8.
+
+c) Average access delay β. Using the standard M/M/1 form β = α/(1 − μ):
+
+- β = (S/R) / (1 − λS/R).
+- Numeric: β = 16 / (1 − 0.8) = 80 s.
+
+d) Total average response with miss rate m = 0.5:
+
+- Miss path time T_miss ≈ 5 + β (given 5 s Internet round component plus access delay).
+- Hit path time T_hit ≈ small (serve from LAN cache); take 0.01 s.
+- T_avg ≈ m·T_miss + (1 − m)·T_hit ≈ 0.5·(5 + 80) + 0.5·0.01 ≈ 42.5 s.
+
+Formulas to reuse with your actual R:
+
+- α = 800/R; μ = 40/R; β = α/(1 − μ); T_avg ≈ 0.5·(5 + β).
+
Reference: Kurose & Ross, 8th ed., Sec. 2.2 (Web caching), Sec. 1.4 (M/M/1 intuition for access delay).
## 2.4 File Distribution: Client-Server vs P2P (10%)
@@ -379,6 +439,48 @@ of the combination of N and U for both client-server distribution and
P2P distribution. Comment on the features of client-server distribution
and P2P distribution and the differences between the two.
+Given:
+
+- F = 21 GB = 168 Gb
+- Us = 1 Gbps; Di = 20 Mbps; U ∈ {0.3, 7, 2} Mbps; N ∈ {10, 100, 1000}
+
+Formulas (Kurose & Ross 8e Sec. 2.6):
+
+- Client–server: D_cs = max{ N·F/Us, F/Di }.
+- P2P: D_p2p = max{ F/Us, F/Di, N·F/(Us + N·U) }.
+
+Constants:
+
+- F/Di = 168/20 = 8,400 s = 140.0 min.
+- F/Us = 168/1 = 168 s = 2.8 min.
+
+Client–server D_cs (minutes):
+
+- N=10: max(1,680 s, 8,400 s) = 8,400 s = 140.0 min
+- N=100: max(16,800 s, 8,400 s) = 16,800 s = 280.0 min
+- N=1000: max(168,000 s, 8,400 s) = 168,000 s = 2,800.0 min
+
+P2P D_p2p (minutes), U in Mbps:
+
+- N=10:
+ - U=0.3: max(2.8, 140.0, 27.9) = 140.0
+ - U=7: max(2.8, 140.0, 26.2) = 140.0
+ - U=2: max(2.8, 140.0, 27.5) = 140.0
+- N=100:
+ - U=0.3: max(2.8, 140.0, 271.8) = 271.8
+ - U=7: max(2.8, 140.0, 164.7) = 164.7
+ - U=2: max(2.8, 140.0, 233.3) = 233.3
+- N=1000:
+ - U=0.3: max(2.8, 140.0, 2,153.8) = 2,153.8
+ - U=7: max(2.8, 140.0, 350.0) = 350.0
+ - U=2: max(2.8, 140.0, 933.3) = 933.3
+
+Comments:
+
+- Client–server grows linearly with N because the server must upload N copies (N·F/Us term dominates for moderate/large N).
+- P2P is self‑scalable: as N grows, aggregate peer upload N·U increases, reducing the N·F/(Us + N·U) term; for small N, peers’ download constraint F/Di dominates.
+- With higher peer upload (e.g., U=7 Mbps) and large N, P2P outperforms client–server by large factors while the server seeds only one copy (F/Us bound).
+
Reference: Kurose & Ross, 8th ed., Sec. 2.6 (P2P file distribution model and formulas).
# References
diff --git a/assignments/1/bin/trace b/assignments/1/bin/trace
index 152ae3f..7df4674 100755
--- a/assignments/1/bin/trace
+++ b/assignments/1/bin/trace
@@ -3,6 +3,4 @@ set -e
cd "$(dirname "$0")/.."
-curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
-
traceroute www.athabascau.ca
diff --git a/assignments/1/trace-1.txt b/assignments/1/trace-1.txt
index 0710861..4721df8 100644
--- a/assignments/1/trace-1.txt
+++ b/assignments/1/trace-1.txt
@@ -1,12 +1,3 @@
-Retrieving speedtest.net configuration...
-Testing from TELUS (108.173.195.49)...
-Retrieving speedtest.net server list...
-Selecting best server based on ping...
-Hosted by Shaw Communications (Calgary, AB) [5.10 km]: 14.384 ms
-Testing download speed................................................................................
-Download: 374.18 Mbit/s
-Testing upload speed......................................................................................................
-Upload: 496.73 Mbit/s
traceroute to www.athabascau.ca (3.175.64.80), 30 hops max, 60 byte packets
1 _gateway (192.168.0.1) 3.364 ms 3.332 ms 3.316 ms
2 10.139.230.1 (10.139.230.1) 4.615 ms 4.601 ms 4.588 ms
diff --git a/assignments/1/trace-2.txt b/assignments/1/trace-2.txt
index f9f066b..a387e83 100644
--- a/assignments/1/trace-2.txt
+++ b/assignments/1/trace-2.txt
@@ -1,12 +1,3 @@
-Retrieving speedtest.net configuration...
-Testing from TELUS (108.173.195.49)...
-Retrieving speedtest.net server list...
-Selecting best server based on ping...
-Hosted by TELUS Mobility (Calgary, AB) [5.29 km]: 14.111 ms
-Testing download speed................................................................................
-Download: 505.75 Mbit/s
-Testing upload speed......................................................................................................
-Upload: 390.19 Mbit/s
traceroute to www.athabascau.ca (3.175.64.80), 30 hops max, 60 byte packets
1 _gateway (192.168.0.1) 2.602 ms 2.580 ms 2.573 ms
2 10.139.230.1 (10.139.230.1) 6.959 ms 6.953 ms 6.947 ms
diff --git a/assignments/1/trace-3.txt b/assignments/1/trace-3.txt
index b78cd82..8cf2414 100644
--- a/assignments/1/trace-3.txt
+++ b/assignments/1/trace-3.txt
@@ -1,12 +1,3 @@
-Retrieving speedtest.net configuration...
-Testing from TELUS (108.173.195.49)...
-Retrieving speedtest.net server list...
-Selecting best server based on ping...
-Hosted by TELUS Mobility (Calgary, AB) [5.29 km]: 14.617 ms
-Testing download speed................................................................................
-Download: 481.44 Mbit/s
-Testing upload speed......................................................................................................
-Upload: 402.87 Mbit/s
traceroute to www.athabascau.ca (3.175.64.80), 30 hops max, 60 byte packets
1 _gateway (192.168.0.1) 2.449 ms 3.640 ms 3.633 ms
2 10.139.230.1 (10.139.230.1) 4.962 ms 4.955 ms 4.925 ms