summaryrefslogtreecommitdiff
path: root/assignments/3/README.md
blob: 369036e16415873a409cdd50ebd3b34fc05bd140 (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
---
title: "COMP-347: Computer Networks"
author: "Munir Khan (ID: 3431709)"
date: "September 2025"
subtitle: "Assignment 3"
institute: "Athabasca University"
geometry: margin=1in
fontsize: 11pt
linestretch: 1.0
---

# Part 1: Short Answer Questions (30%)

## 1.1 Anchor MSC in GSM Networks (5%)

> (5%) What is the role of the anchor MSC in GSM networks?

The anchor MSC is the original mobile switching center that first handles
your call. When you're on a call and move around, your phone may connect
to different cell towers managed by different MSCs. However, the anchor
MSC, the first one that set up your call, stays in charge throughout.

Even though you're passing through different areas with different
local switching centers, the anchor MSC keeps managing your billing and
maintains your connection to the regular phone network. This ensures
your call doesn't drop as you move between coverage areas.

## 1.2 LTE Network Characteristics (5%)

> (5%) What are the main characteristics of LTE radio access networks? How does LTE network differ from previous generations of cellular networks?

LTE's main features:

- Uses OFDMA technology instead of the older CDMA approach
- Flexible bandwidth options from 1.4 to 20 MHz depending on what the carrier has available
- Simpler network structure: cell towers handle more tasks directly rather than relying on separate controller equipment
- Built for speed with 1 millisecond response times and smart antenna systems that send multiple data streams simultaneously
- Everything runs on IP, just like your home internet

Key differences from 2G/3G:

- All-internet based: even phone calls use VoIP technology instead of traditional circuit-switched voice connections
- Flatter network: eliminated the Radio Network Controller layer, making the system simpler and faster
- Better at handling data: designed from the ground up for mobile internet rather than voice calls
- Lower delays and smoother handoffs when moving between towers

## 1.3 CSMA/CD Protocol (5%)

> (5%) What does CSMA/CD stand for? How does the protocol work? Explain why RTT on an Ethernet LAN is an important parameter for the CSMA/CD protocol to work properly.

CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection.

How it works:

1. Before sending data, a computer listens to check if anyone else is transmitting
2. If the line is clear, it starts sending
3. While sending, it keeps listening for collisions
4. If a collision occurs, it stops immediately, sends a brief "jam" signal to alert others, then waits a random amount of time before trying again

Why RTT matters:

The protocol needs enough time to detect collisions before finishing
transmission. Ethernet's "slot time" is designed to be longer than
the worst-case round-trip time on the network. This ensures that if two
devices start transmitting at opposite ends of the network, the first one
will hear about the collision before it finishes sending its minimum-sized
packet. Without this timing guarantee, collisions could go undetected,
causing data corruption.

## 1.4 CSMA/CA Protocol (5%)

> (5%) What does CSMA/CA stand for? How does the protocol work? How can collisions be avoided in the protocol?

CSMA/CA stands for Carrier Sense Multiple Access with Collision Avoidance.

How it works:

1. A device listens to check if the channel is clear
2. If clear, it waits a short period plus a random time slot
3. When the countdown reaches zero, it transmits
4. The receiver sends back an acknowledgment
5. If no acknowledgment arrives, the device waits longer and tries again

How collisions are avoided:

- Random waiting times prevent devices from transmitting simultaneously
- Acknowledgments get priority timing to reduce interference
- Optional RTS/CTS handshake: the sender can request permission (RTS) before transmitting, and the receiver grants it (CTS). This tells nearby devices to wait, solving the "hidden node" problem where two devices can't hear each other but both reach the same receiver.

## 1.5 Data Link Layer Error Detection/Correction (5%)

> (5%) What techniques can be used for error-detection and error-correction, respectively, on the data link layer?

Error detection (finding corrupted data):

- Parity bits: add extra bits to check if data changed
- Checksums: mathematical summaries that verify data integrity
- CRC (Cyclic Redundancy Check): uses polynomial division to detect errors

Error correction (fixing corrupted data):

- Forward Error Correction (FEC): adds redundant information so the receiver can reconstruct damaged data without retransmission
- ARQ (Automatic Repeat Request): the receiver asks for retransmission of corrupted packets. Three approaches:
  - Stop-and-Wait: send one packet, wait for confirmation
  - Go-Back-N: if one packet fails, resend it and all following packets
  - Selective Repeat: only resend the specific failed packets

## 1.6 Wi-Fi Network Standards (5%)

> (5%) What wireless (Wi-Fi) network standards are used in today's industries? What are the characteristics of the link specified in each standard?

Wi-Fi 4 (802.11n):

- Operates on 2.4 GHz and 5 GHz bands
- Multiple antennas (MIMO) send data simultaneously
- Speeds up to 600 Mbps

Wi-Fi 5 (802.11ac):

- 5 GHz only
- Wider channels for more data at once
- Multiple devices can receive simultaneously (MU-MIMO)
- Speeds over 1 Gbps

Wi-Fi 6/6E (802.11ax):

- Works on 2.4, 5, and 6 GHz bands
- Divides channels into smaller pieces (OFDMA) for better efficiency with many devices
- Improved performance in crowded areas like offices and apartments
- Speeds several Gbps
- Introduced Target Wake Time (TWT) for IoT battery efficiency.

Wi-Fi 7 (802.11be, emerging):

- Even wider channels (320 MHz)
- Connects to multiple bands simultaneously
- Target speeds of tens of Gbps
- Best for ultra-high-bandwidth applications

# Part 2: Long Answer Questions (70%)

## 2.1 Code Division Multiple Access (CDMA) (15%)

> (15%) Begin with reading about the simple CDMA protocol... choose one CDMA scheme and explain how it works. Describe the advantages that CDMA has over other coding schemes, such as TDM and FDM. Include in your answer the titles and sources of the articles/documents you consulted.

In DS-CDMA, each user has a unique code that changes much faster than
their data transmission rate. When sending data, each bit is multiplied
by this code, spreading it across many "chips". All users transmit
simultaneously on the same frequency, but receivers can extract their
intended signal by multiplying the received signal by the sender's code.

Unlike TDM (which divides time) and FDM (which divides frequency),
CDMA divides the codespace. This provides several advantages:

- gracefully handles varying numbers of users without hard capacity limits
- resists interference
- requires less timing coordination
- allows adjacent cells to reuse the same frequencies

Reference: Kurose, J. F., & Ross, K. W. (2020). Computer Networking: A Top-Down Approach (8th ed.). Section 7.2.1, pp. 563-566.

## 2.2 Two-Dimensional Checksum (15%)

> (15%) Suppose host A has payload 1011 0110 1010 1011 to send to
host B, and A wants to use a two-dimensional checksum for host B
to detect and correct any 1-bit error that may occur during the
transmission. Furthermore, host A wants to minimize the length of
the checksum to conserve bandwidth of the communication channel. What
would the value of the checksum field be if an even parity scheme is
used? Show all your work and prove why the checksum you have worked out
is the shortest. Prove that any 1-bit error can be detected and corrected.

1. Arrange the 16 bits as a 4x4 matrix:

| Bit | Bit | Bit | Bit |
| --  | --  | --  | --  |
| 1   | 0   | 1   | 1   |
| 0   | 1   | 1   | 0   |
| 1   | 0   | 1   | 0   |
| 1   | 0   | 1   | 1   |

2. Add even-parity row bits:

| Bit | Bit | Bit | Bit | Row Parity |
| --  | --  | --  | --  | --         |
| 1   | 0   | 1   | 1   | **1**      |
| 0   | 1   | 1   | 0   | **0**      |
| 1   | 0   | 1   | 0   | **0**      |
| 1   | 0   | 1   | 1   | **1**      |

3. Add even-parity column bits:

| Bit        | Bit   | Bit   | Bit   | Row Parity |
| --         | --    | --    | --    | --         |
| 1          | 0     | 1     | 1     | 1          |
| 0          | 1     | 1     | 0     | 0          |
| 1          | 0     | 1     | 0     | 0          |
| 1          | 0     | 1     | 1     | 1          |
| Col Parity | **1** | **1** | **0** | **0**      |

4. Add even-parity corner parity

| Bit        | Bit | Bit | Bit | Row Parity |
| --         | --  | --  | --  | --         |
| 1          | 0   | 1   | 1   | 1          |
| 0          | 1   | 1   | 0   | 0          |
| 1          | 0   | 1   | 0   | 0          |
| 1          | 0   | 1   | 1   | 1          |
| Col Parity | 1   | 1   | 0   | **0**      |

5. Combine the row parity with the column parity with the corner partity

  (4 row bits + 4 column bits + 1 corner bit = 9 bits total)

  Checksum: 1001 1100 0 (9 bits total)

## 2.3 CSMA/CD Ethernet Analysis (20%)

> (20%) Assume a 1 Gbps Ethernet has two nodes, A and B, connected by
a 180 m cable with three repeaters in between, and they each have one
frame of 1,024 bits to send to each other. Further assume that the
signal propagation speed across the cable is 2*10^8 m/sec; CSMA/CD
uses back-off intervals of multiples of 512 bits; and each repeater
will insert a store-and-forward delay equivalent to 20-bit transmission
time. At time t = 0, both A and B attempt to transmit. After the first
collision, A draws K = 0 and B draws K = 1 in the exponential backoff
protocol after sending the 48 bits jam signal. In your calculations for
a and b, you must include all the delays that occur according to CSMA/CD,
and you must show the details of your work.

Context:

- Distance: 180 m
- Frame: 1,024 bits
- Propagation Speed: 2 * 10^8 m/sec
- Backoff intervals: multiple of 512 bits
- Store and forward delay: 20-bit transmission time

> a) What is the one-way propagation delay (including all repeater delays) between A and B in seconds? At what time is A's packet completely delivered at B?

- time = distance / speed (distance: 180 m, speed: 10^8 m/sec)
- Cable propagation: 180 m / (2 * 10^8 m/sec) = 0.0000009 seconds
- Three repeaters: 3 × (20 bits / 10^9 bps) = 0.00000006 seconds
- Total one-way delay: 0.00000096 seconds

> b) Now suppose that only A has a packet to send and that the repeaters are replaced with switches. Suppose that each switch has an 8-bit processing delay in addition to a store-and-forward delay. At what time, in seconds, is A's packet delivered at B?

## 2.4 802.11 RTS/CTS Transmission (10%)

> (10%) Suppose an 802.11 station is configured to always reserve the
channel with RTS/CTS. At t = 0 it wants to transmit 1024 bytes. All
other stations are idle. At what time will the station complete the
transmission? At what time can the station receive the acknowledgement?

Frame sizes from 802.11b (11 Mbps) standard:

- RTS frame: 20 bytes = 160 bits
- CTS frame: 14 bytes = 112 bits
- ACK frame: 14 bytes = 112 bits
- DATA frame: 1024 bytes = 8192 bits
- SIFS: 0.00001 seconds
- DIFS: 0.00005 seconds

Timeline: Assuming 802.11b

1. DIFS wait: 0.00005
1. RTS transmission: 160 bits / (11 * 10^6 bps) = 0.0000145 seconds
1. SIFS: 0.00001 seconds
1. CTS transmission: 112 bits / (11 * 10^6 bps) = 0.0000102 seconds
1. SIFS: 0.00001 seconds
1. DATA transmission: 8464 bits / (11 * 10^6 bps) = 0.0007695 seconds
1. SIFS: 0.00001 seconds
1. ACK transmission: 112 bits / (11 * 10^6 bps) = 0.0000102 seconds
1. Transmission complete at:
  - 0.00005 + 0.0000145 + 0.00001 + 0.0000102 + 0.00001 + 0.0007695
  - = 0.0008642 seconds
1. ACK received at:
  - 0.0008642 + 0.00001 + 0.0000102 = 0.0008844 seconds

| Step | Component             | 802.11b (11 Mbps) | 802.11g (54 Mbps) | 802.11n (150 Mbps) | 802.11ac (867 Mbps) |
| --   | --                    | --                | --                | --                 | --                  |
| 1    | DIFS                  | 0.00005 s         | 0.00005 s         | 0.00005 s          | 0.000034 s          |
| 2    | RTS (160 bits)        | 0.0000145 s       | 0.000003 s        | 0.0000011 s        | 0.00000018 s        |
| 3    | SIFS                  | 0.00001 s         | 0.00001 s         | 0.00001 s          | 0.000016 s          |
| 4    | CTS (112 bits)        | 0.0000102 s       | 0.0000021 s       | 0.0000007 s        | 0.00000013 s        |
| 5    | SIFS                  | 0.00001 s         | 0.00001 s         | 0.00001 s          | 0.000016 s          |
| 6    | DATA (8192 bits)      | 0.000745 s        | 0.0001517 s       | 0.0000546 s        | 0.0000094 s         |
| 7    | SIFS                  | 0.00001 s         | 0.00001 s         | 0.00001 s          | 0.000016 s          |
| 8    | ACK (112 bits)        | 0.0000102 s       | 0.0000021 s       | 0.0000007 s        | 0.00000013 s        |
|      | Transmission Complete | 0.0008499 s       | 0.0002289 s       | 0.0001271 s        | 0.00007596 s        |
|      | ACK Received          | 0.0008701 s       | 0.0002411 s       | 0.0001385 s        | 0.00009225 s        |

## 2.5 Bluetooth Frame Format Analysis (10%)

> (10%) Conduct research about Bluetooth technology and describe and
comment on the format of the Bluetooth frame. Focus on its features and
limitations. Is there anything in the frame format that inherently limits
the number of active nodes in a network to eight active nodes? Explain.

```
+-------------------------------------------------------------------------+
|                         BLUETOOTH FRAME                                 |
+-----------------+-----------------+-------------------------------------+
|   ACCESS CODE   |     HEADER      |           PAYLOAD                   |
|     72 bits     |     54 bits     |        0-2745 bits                  |
+-----------------+-----------------+-------------------------------------+

ACCESS CODE (72 bits):

+------------+-------------+----------+
|  Preamble  |  Sync Word  | Trailer  |
|   4 bits   |   64 bits   |  4 bits  |
+------------+-------------+----------+

HEADER (54 bits):

+---------+------+------+------+------+-----+
| AM_ADDR | Type | Flow | ARQN | SEQN | HEC |
|  3 bits | 4 b  | 1 b  | 1 b  | 1 b  | 8 b |
+---------+------+------+------+------+-----+
    ^
    |--- This 3-bit field limits active peripherals to 7
```

| Field     | Size (bits) | Description           |
| --        | --          | --                    |
| `AM_ADDR` | 3           | Active Member Address |
| Type      | 4           | Packet type           |
| Flow      | 1           | Flow control          |
| ARQN      | 1           | Acknowledgment        |
| SEQN      | 1           | Sequence number       |
| HEC       | 8           | Header error check    |

Features:

- Frequency hopping spread spectrum (79 channels in most regions)
- Time division duplex for bidirectional communication
- Built-in error correction and retransmission
- Low power consumption modes

Limitations:

- Limited data rates (1-3 Mbps for Classic Bluetooth)
- Short range (typically 10-100 meters)
- Susceptible to interference in 2.4 GHz band
- Network topology restrictions

The frame format directly limits active nodes to 7 peripherals + 1 central device = 8 active devices.

The `AM_ADDR` field in the header is only 3 bits. With 3 bits, you
can represent 8 values (2^3 = 8), but one value (000) is reserved for
broadcast messages. This leaves only 7 unique addresses available for
active peripherals devices plus the central device.

# References

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