summaryrefslogtreecommitdiff
path: root/assignments/1/README.md
blob: 0ee9636d69dfdf814b53b4ddb8898b6d8afac169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
---
title: "COMP-347: Computer Networks"
author: "munir khan - 3431709"
date: "September 2025"
subtitle: "Assignment 1"
institute: "Athabasca University"
geometry: margin=1in
fontsize: 11pt
linestretch: 1.0
---

# Part 1: Short Answer Questions (30%)
## 1.1 Traceroute Analysis (5%)

> (5%) Run Traceroute, TRACERT (on Windows), or another similar utility between a source and a destination in the country in which you reside. Do this at three different times of the day. Summarize your findings at each of the times with respect to the following, and explain your findings:
>
> - average and standard deviation of the round-trip delays
> - number of routers in the path
>
> If you are not familiar with the utility, read the Microsoft article, "How to Use TRACERT".

Destination: www.athabascau.ca (Athabasca University website)
Location: Calgary, Alberta, Canada
Tool: traceroute (default ICMP/UDP probes)

I ran traceroute at three different times of day and include the full outputs below. The destination did not reply to probes; many intermediate routers also filtered probes. In such cases, I use the last responding hop as the end-to-end RTT proxy and clearly state this in the summary.

Summary (using hop 7 as last responding hop):

| Run | Visible hops (last responding hop index) | RTT used (ms) |
| --- | ---------------------------------------- | ------------- |
| 1   | 7                                        | 18.50         |
| 2   | 7                                        | 18.92         |
| 3   | 7                                        | 18.88         |

- Average RTT across runs: (18.50 + 18.92 + 18.88) / 3 = 18.77 ms
- Standard deviation (sample): ~0.23 ms
- Number of routers observed in the path: at least 7 (later hops did not reply due to filtering)
- Note: These RTTs are for the last responding hop (Telus backbone node). The destination and later hops likely rate-limit or drop probes; this is common.

Full traceroute outputs

Run 1

```
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
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  154.11.15.107 (154.11.15.107)  19.010 ms QUBCPQBIDR03.bb.telus.com (154.11.15.105)  18.257 ms  18.230 ms
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
```

Run 2

```
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
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  QUBCPQBIDR03.bb.telus.com (154.11.15.105)  18.821 ms  18.985 ms  18.966 ms
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
```

Run 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
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  QUBCPQBIDR03.bb.telus.com (154.11.15.105)  18.500 ms  18.464 ms 154.11.15.107 (154.11.15.107)  19.680 ms
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
```

## 1.2 Internet Protocol Stack Layers (5%)

> (5%) What are the five layers in the Internet protocol stack? Develop a table to summarise what each layer does.

| Layer | Name        | What it does                                                      |
| ----- | ----------- | ---------------------------------------------------------------- |
| 5     | Application | App protocols and data (HTTP, SMTP, IMAP, DNS, etc.)            |
| 4     | Transport   | Process-to-process delivery (TCP reliable, UDP best-effort)      |
| 3     | Network     | Host-to-host routing and addressing (IP, ICMP)                   |
| 2     | Link        | Node-to-node delivery on a link (Ethernet, Wi-Fi)               |
| 1     | Physical    | Bits on the wire/air (signals over copper, fiber, radio)         |

## 1.3 Packet-Switched vs Circuit-Switched Networks (5%)

> (5%) What are packet-switched network and circuit-switched network, respectively? Develop a table to summarise their features, pros, and cons.

| Aspect              | Packet-Switched                     | Circuit-Switched                        |
| ------------------- | ----------------------------------- | --------------------------------------- |
| Connection Model    | Connectionless                      | Connection-oriented                     |
| Resource Allocation | Shared dynamically                  | Dedicated for session                   |
| Path Determination  | Per packet, can vary                | Fixed for entire session                |
| Bandwidth Usage     | Efficient, statistical multiplexing | Reserved even when idle                 |
| Setup Required      | None                                | Required before communication           |
| Transmission Mode   | Store-and-forward                   | Dedicated end-to-end circuit            |
| Reliability         | Best-effort delivery                | Guaranteed once connected               |
| Cost                | Lower, pay per usage                | Higher, pay for reserved capacity       |
| Scalability         | High                                | Limited by number of circuits           |
| Fault Tolerance     | Rerouting around failures           | Circuit failure breaks call             |
| Performance         | Variable delay and jitter possible  | Predictable, consistent latency         |
| Examples            | Internet, Ethernet                  | PSTN, leased lines                      |

## 1.4 Network Delays and Traffic Intensity (5%)

> (5%) What are processing delay, queuing delay, transmission delay, and propagation delay, respectively? Where does each delay occur? What is traffic intensity? Why should the traffic intensity be no greater than one (1) when designing a computer network?

- Processing delay: Time to examine header/make forwarding decision (at routers/switches)
- Queuing delay: Time waiting in the output queue (at routers/switches; depends on load)
- Transmission delay: Time to push all bits onto the link = L/R (at each sender on a link)
- Propagation delay: Time for signal to travel = distance/speed (on the medium)
- Traffic intensity: rho = L a / R. Design requires rho <= 1 (preferably well below) so queues do not grow without bound.

## 1.5 Web Caching and Conditional GET (5%)

> (5%) What is Web-caching? When may Web-caching be more useful in a university? What problem does the conditional GET in HTTP aim to solve?

- Web caching stores frequently requested objects close to users to reduce delay and external bandwidth.
- More useful at a university because many users request the same resources, raising cache hit rate and lowering Internet link load.
- Conditional GET (If-Modified-Since or If-None-Match) lets caches validate freshness without re-downloading unchanged objects (304 Not Modified vs 200 OK).

## 1.6 Email Protocol Analysis (5%)

> (5%) Suppose you have a Web-based email account, such as Gmail, and you have just sent a message to a friend, Alice, who accesses her mail from her mail server using IMAP. Assume that both you and Alice are using a smartphone to access emails via Wi-Fi at home. List all the network protocols that may be involved in sending and receiving the email. Discuss in detail how the message went from your smartphone to Alice's smartphone - that is, how the message went through all the network protocol layers on each of the network devices involved in the communication. Ignore everything between your ISP and Alice's ISP.

Scenario: You send via Gmail web interface; Alice reads with IMAP on her phone. Both on home Wi-Fi. Ignore transit between ISPs.

Protocols likely involved:
- Application: HTTPS (your browser to Gmail), SMTP (Gmail to Alice's server), IMAP (Alice's phone to her server), DNS
- Transport: TCP
- Network: IP; ICMP for diagnostics
- Link/Physical: Wi-Fi at each home; possibly Ethernet on LAN/backhaul

How the message flows:
- Your phone to Gmail: App -> HTTPS over TCP/443 -> IP -> Wi-Fi frames to your router -> ISP uplink
- Gmail to Alice's server: DNS lookup of MX, then SMTP over TCP to deliver message
- Alice's phone to her server: IMAP over TCP/993 via her Wi-Fi/router/ISP; server returns the new message; her app displays it

# Part 2: Long Answer Questions (70%)

I provide short, clear answers first, then 1-2 sentences of reasoning.

## 2.1 File Transfer Analysis (20%)

> (20%) Consider that you are submitting your assignment in a compressed file from your computer at home to the university server that is hosting your online course. Your large file is segmented into smaller packets before it is sent into the first link. 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?
> b) How many links can be identified using TRACERT or Traceroute between your computer and the university server? What are they?
> 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?

Given: File = 10 MB = 80,000,000 bits; packet = 10,000 bits with 100-bit header, so payload = 9,900 bits.
Measured in Calgary (Wi-Fi):
- Download: 374.18, 505.75, 481.44 Mb/s -> average ~453.79 Mb/s
- Upload:   496.73, 390.19, 402.87 Mb/s -> average ~429.93 Mb/s
Use average upload R_up ~ 430 Mb/s for this upload calculation.

a) Number of packets
- Answer: ceil(80,000,000 / 9,900) = 8,081 packets.

b) Links (via traceroute)
- Answer: In all three traces to www.athabascau.ca, the last responding hop was 7 (Telus backbone). Later hops filtered probes, so the total hop count to the destination could not be observed with ICMP/UDP traceroute.
- Identified hops from Run 1 (morning):
  - Hop 1: _gateway (192.168.0.1) - home router
  - Hop 2: 10.139.230.1 - ISP gateway (private address inside Telus network)
  - Hops 3-6: no reply (likely ICMP/UDP filtered)
  - Hop 7: QUBCPQBIDR03.bb.telus.com (154.11.15.105) and 154.11.15.107 - Telus backbone
  - Hops 8-30: no reply
  - Destination: www.athabascau.ca (3.175.64.80) - no reply

c) Speed for each identified link
- Answer (best estimate):
  - Home Wi-Fi/access uplink: measured average upload ~430 Mb/s (local bottleneck when sending)
  - ISP/regional/backbone: typically >= 1-10 Gb/s
- Reason: Per-link bandwidth cannot be inferred from traceroute RTT; we use measured access speeds and typical provider capacities.

d) Time when the last packet enters the first link
- Total bits across the first link (including headers): 8,081 x 10,000 = 80,810,000 bits
- Time = 80,810,000 / 430,000,000 ~ 0.188 s
- Answer: t0 + 0.188 s (approx)

e) Time when the last packet arrives at the server
- Add ~10-20 ms for propagation/processing (consistent with ~18.8 ms RTT to the last responding hop): 0.188 s + 0.010-0.020 s ~ 0.198-0.208 s
- Answer: about t0 + 0.20-0.21 s

Method note on traceroute filtering
- Many networks de-prioritize or block ICMP/UDP TTL-expired replies. This can hide intermediate and destination hops even when the path is fine. Using TCP to port 443 often elicits more replies, but the assignment requires traceroute; therefore I report the last responding hop and include the full outputs for verification.

## 2.2 Propagation Delay and Bandwidth-Delay Product (20%)

> (20%) Consider that you are submitting another assignment from your home computer to the university server, and you have worked out a list of network links between your computer and the university server.
>
> a) Based on your best estimate and calculation, what is the total distance your assignment data will travel to reach the university server?
> b) Suppose the propagation speed over all the links is the same 2*10^8 meters/sec. What is propagation delay T_prop from your computer to the university server?
> c) Further assume all the links have the same speed R bps. What is the bandwidth-delay product R*T_prop?
> 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?

Assume total fiber distance home -> campus ~ 1,800 km; propagation speed ~ 2 x 10^8 m/s.

a) Total distance
- Answer: 1.8 x 10^6 meters.

b) Propagation delay T_prop
- Answer: 1.8 x 10^6 / (2 x 10^8) = 9 x 10^-3 s = 9 ms (one way).

c) Bandwidth-delay product R x T_prop
- Using the measured average upload R ~ 430 Mb/s:
- R x T_prop = 430 x 10^6 x 9 x 10^-3 = 3,870,000 bits (~3.87 Mb)

d) Max bits in links at any time (continuous send)
- Answer: ~3.87 Mb (equal to the bandwidth-delay product).

e) What the product implies
- Answer: Minimum in-flight/window size of ~3.9 Mb to fully use the path at ~430 Mb/s across a 9 ms one-way path; sets buffer/window requirements.

## 2.3 Web Cache Implementation and Performance (20%)

> (20%) You have learned that a Web cache can be useful in some cases. In this problem, you will investigate how useful a Web cache can be at a home. First, you need to download Apache server and install and run it as a proxy server on a computer on your home network. Then, write a brief report on what you did to make it work and how you are using it on all your devices on your home network.
> Assume your family has six members. Each member likes to download short videos from the Internet to watch on their personal devices. All these devices are connected to the Internet through Wi-Fi. Further assume the average object size of each short video is 100 MB and the average request rate from all devices to servers on the Internet is three requests per minute. Five seconds is the average amount of time it takes for the router on the ISP side of your Internet link to forward an HTTP request to a server on the Internet and receive a response.
>
> a) What is the average time alpha for your home router to receive a video object from your ISP router?
> b) What is the traffic intensity mu on the Internet link to your home router if none of the requested videos is cached on the proxy server?
> c) If average access delay beta is defined as alpha/(mu-1), what is the average access delay your family members will experience when watching the short videos?
> 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?

Proxy setup summary (implemented and included):
- Start: bin/server (httpd -f etc/apache/apache.conf), Cache root: var/cache/apache2, Proxy port: 8081. Devices can be set to use http://<proxy-host>:8081.

Given for analysis: object size F = 100 MB = 800 Mb; aggregate request rate lambda = 3/min = 0.05/s; ISP router overhead = 5 s; measured average downlink R ~ 453.79 Mb/s.

Definitions:
- alpha = time to receive object over the access link (no queuing) = F / R.
- mu = traffic intensity on the link = lambda x alpha.
- beta = average access delay on the link = alpha / (1 - mu). (Using 1 - mu; mu - 1 would be negative for a stable system.)

Answers with measured average R:
- a) alpha = 800 / 453.79 ~ 1.763 s
- b) mu = 0.05 x 1.763 ~ 0.088
- c) beta = 1.763 / (1 - 0.088) ~ 1.763 / 0.912 ~ 1.932 s
- d) Total average response time with miss rate 0.5: 0.5 x (5 + 1.932) + 0.5 x (approx 0) ~ 3.466 s

## 2.4 File Distribution: Client-Server vs P2P (10%)

> (10%) You have learned that a file can be distributed to peers in either client-server mode or peer-to-peer (P2P) mode. Consider distributing a large file of F = 21 GB to N peers. The server has an upload rate of Us = 1 Gbps, and each peer has a download rate of Di = 20 Mbps and an upload rate of U. For N = 10, 100, and 1,000 and U = 300 Kbps, 7000 Kbps, and 2 Mbps, develop a table giving the minimum distribution time for each 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 = 168 x 10^9 bits; U_s = 1 x 10^9 bps; D_i = 20 x 10^6 bps; U in {0.3, 7, 2} x 10^6 bps; N in {10, 100, 1000}.
Formulas:
- Client-Server: T_cs = max(NF / U_s, F / D_min), with D_min = 20 Mb/s -> F / D_min = 8,400 s.
- P2P: T_p2p = max(F / U_s, F / D_min, N F / (U_s + N U)). F / U_s = 168 s.

Results (seconds):
- N = 10: T_cs = 8,400. T_p2p = 8,400 for all U (the 8,400 s download cap dominates).
- N = 100:
  - U = 0.3 Mb/s: T_cs = 16,800; T_p2p = 16,311
  - U = 7 Mb/s:   T_cs = 16,800; T_p2p = 9,882
  - U = 2 Mb/s:   T_cs = 16,800; T_p2p = 14,000
- N = 1,000:
  - U = 0.3 Mb/s: T_cs = 168,000; T_p2p = 129,231
  - U = 7 Mb/s:   T_cs = 168,000; T_p2p = 21,000
  - U = 2 Mb/s:   T_cs = 168,000; T_p2p = 56,000

Takeaways:
- Client-server grows linearly with N; the server is the bottleneck.
- P2P scales with total peer upload (N x U). With enough peer upload, P2P is much faster and often bounded by each peer’s 20 Mb/s download (8,400 s minimum).

# References

Kurose, J. F., and Ross, K. W. Computer Networking: A Top-Down Approach (8th ed.). Pearson.