Name:qiantongzhou
Id:40081938
Assignment 4

1) TCP Slow Start helps manage congestion by gradually increasing the congestion window, but it can be inefficient in high-bandwidth, long-latency networks. Explain why this happens. Additionally, for this question you will need to do a little research about an alternative protocol, QUIC, which is a modern transport-layer protocol developed by Google and later standardized by the IETF. You need to explain how QUIC improve on TCP’s congestion control, and what advantages does it offer in overcoming Slow Start’s limitations? Your answer does not need to be exhaustive, or very accurate, but should provide a reasonable comparison of the two protocols on that regard.

TCP Slow Start is used to prevent network overload, but in high speed, long distance networks, it can be too slow because it starts with a small data window and only increases a little with each RTT. This delay means it takes a long time to use the full network capacity.

In comparison, QUIC is a modern transport-layer protocol created by Google to fixes many of these issues. It runs its congestion control outside the operating system, so it can be updated more easily and adjusted for faster performance. Unlike TCP, it sends multiple streams without one being blocked by another if a packet is lost. QUIC can reach full speed faster and works better on fast but faraway networks.

2) NAT routers allow multiple devices on a local network to share a single public IP address, helping to conserve IPv4 addresses. However, NAT can introduce challenges for certain applications, such as peer-to-peer communication and VoIP. What are the main issues caused by NAT in such scenarios.

NAT lets many devices share one public IP, which saves address space, but it causes problems for apps like p2p and VoIP that need direct connections.
That’s because NAT blocks incoming traffic unless it knows where to send it, which makes it hard for outside devices to reach someone inside the network. It also breaks the original idea of the internet where any two devices could talk directly. Some apps put IP addresses inside the message itself, and NAT can’t change those, leading to connection issues. In busy networks, there might not be enough ports for everyone to connect out.
3) Both CSMA and Slotted ALOHA are medium access control (MAC) protocols used for managing channel access in network communication. While Slotted ALOHA improves upon pure ALOHA by reducing collisions, CSMA introduces carrier sensing to further enhance efficiency. How do these protocols differ in terms of throughput, collision probability, and delay? Under what conditions would Slotted ALOHA be preferred over CSMA, if any?

Slotted ALOHA and CSMA are both ways to control when devices send data over a shared channel, but they work differently.

Slotted ALOHA sends only at fixed time slots to reduce collisions, but it still has a decent chance of two devices colliding if they pick the same slot.
CSMA is smarter, it listens first and only sends if the channel is free, which makes it more efficient and gives higher throughput with fewer collisions, especially when traffic is busy.
CSMA also usually has lower delay since it doesn’t wait for a time slot. However, Slotted ALOHA might be better for systems like satellite communication where delays are big and sensing the channel doesn’t help much. It’s also easier to implement, so it’s sometimes chosen for simpler setups even if it’s not the most efficient.

4) Token Ring LANs have the clear advantage of avoiding collisions, which is surely not the case for networks, i.e. Ethernet, that use buses as the main segment to connect the different devices. In spite of that, Ethernet LANs are capable today of providing a superior performance in comparison to Token Ring LANs. Explain how the Ethernet was able to achieve that regardless of the collision issues. In particular, your answer should consider: 1) the disadvantages of Token Rings, and 2) Switched Ethernet.

Token Ring networks avoid collisions by using a token that lets only one device send data at a time, but this also slows things down if the token is delayed or the device holding it has nothing to send, everyone else has to wait. It's also more complex to manage and more likely to break if any part of the ring fails.

In contrast, modern Ethernet uses switches connect each device directly, so there's no need to share the same path, and no collisions happen because each connection is its own separate link. This setup, called Switched Ethernet is faster, cheaper, easier to expand, and works with newer and older devices. Thanks to these improvements, Ethernet has become much better than Token Ring, even though Token Ring was designed to avoid collisions in the first place.

5) CRC is widely used for error detection in data transmission, but it does not provide error correction. Why is CRC preferred over other error-detection methods like checksums or parity bits in high-reliability systems? Additionally, how could one modify CRC or combine it with other techniques to enable error correction?

CRC is better than simple methods like parity bits or checksums because it’s much better at catching errors, especially when many bits get messed up together which is called burst errors. It uses math with polynomials that can spot even tricky patterns of errors, and it does this with very little extra data and fast processing.

CRC can’t fix errors by itself, it’s often used with other tools that can, like Forward Error Correction which adds extra data so the receiver can fix certain errors without asking for a resend.

In some systems, both CRC and FEC are used together, so small errors can be corrected right away, and bigger ones can be retried. This combo makes communication more reliable and efficient, especially in things like WiFi and video streaming.

6) Consider the router and the three attached subnets in Fig. 1 (A, B, and C). The number of hosts is also shown below. The subnets share the 23 high-order bits of the address space: 192.168.198.0/23.

a. Assign subnet addresses to each of the subnets (A, B, and C) so that the amount of address space assigned is minimal, and at the same time leaving the largest possible contiguous address space available for assignment if a new subnet were to be added. Then answer the questions below.

We start by giving the biggest subnet (A) the first chunk of addresses, then fit the smaller ones after it. This helps use space wisely and leaves room for new subnets later.
Subnet A (needs 76 hosts): Give it 192.168.198.0/25 → gives 128 addresses (126 usable)
Subnet B (needs 25 hosts): Give it 192.168.198.128/27 → gives 32 addresses (30 usable)
Subnet C (needs 23 hosts): Give it 192.168.198.160/27 → also gives 32 addresses
Now addresses from 192.168.198.192 onward and all of 192.168.199.0/24 are free for future use.

b. What is the subnet address of subnet A?

192.168.198.0/25

c. What are the first and last addresses of subnet A?

First: 192.168.198.1
Last: 192.168.198.126

d. What is the broadcast address of subnet A?

192.168.198.127

7) Consider the network in Fig 2.

4a. Show the forwarding table in router A, such that all traffic destined to host H3 is forwarded through interface 3.

Destination IP Subnet Mask Next Hop Outgoing Interface
H3's IP (e.g., 10.0.0.3) 255.255.255.255 3
All Other Destinations 0.0.0.0 Some Router (Default Interface)
the table send any traffic going to H3 out interface 3. It works with standard IP routing. It only considers the destination address.

4b. Can you write down a forwarding table in router A, such that all traffic from H1 destined to host H3 is forwarded through interface 3, while all traffic from H2 destined to host H3 is forwarded through interface 4?

No, not with standard IP forwarding. Regular routing tables only look at the destination address, not where the packet came from.

To achieve this H1 → H3 interface 3, H2 → H3 interface 4, we would need: Policy-Based Routing : Allows rules based on both source and destination IPs Source Routing: Sender includes the path in the packet. Access Control Lists: Used with route-maps or filters to forward differently based on source.

So, we can forward all traffic to H3 through one interface part a, but splitting it based on who sent it part b needs advanced routing features beyond the standard table.

8) Consider the network shown in Fig 3. Using Dijkstra’s algorithm, and showing your work using a table similar to the one covered in the class, do the following: a. Compute the shortest path from t to all network nodes. b. Compute the shortest path from u to all network nodes. c. Compute the shortest path from v to all network nodes. d. Compute the shortest path from w to all network nodes. e. Compute the shortest path from y to all network nodes. f. Compute the shortest path from z to all network nodes.

a. Compute the shortest path from t to all network nodes.

Step N' (visited) d(t), p(t) d(u), p(u) d(v), p(v) d(w), p(w) d(y), p(y) d(z), p(z)
0 {t} 0, – 2, t 4, t ∞, – 7, t ∞, –
1 {t, u} 0, – 2, t 4, t 5, u 7, t ∞, –
2 {t, u, v} 0, – 2, t 4, t 5, u 7, t 15, v
3 {t, u, v, w} 0, – 2, t 4, t 5, u 7, t 15, v
4 {t, u, v, w, y} 0, – 2, t 4, t 5, u 7, t 15, v
5 {t, u, v, w, y, z} 0, – 2, t 4, t 5, u 7, t 15, v

b. Compute the shortest path from u to all network nodes.

Step N' (visited) d(t), p(t) d(u), p(u) d(v), p(v) d(w), p(w) d(y), p(y) d(z), p(z)
0 {u} 2, u 0, – 3, u 3, u ∞, – ∞, –
1 {u, t} 2, u 0, – 3, u 3, u 9, t ∞, –
2 {u, t, v} 2, u 0, – 3, u 3, u 9, t 14, v
3 {u, t, v, w} 2, u 0, – 3, u 3, u 9, t 14, v
4 {u, t, v, w, y} 2, u 0, – 3, u 3, u 9, t 14, v
5 {u, t, v, w, y, z} 2, u 0, – 3, u 3, u 9, t 14, v

c. Compute the shortest path from v to all network nodes.

Step N' (visited) d(t), p(t) d(u), p(u) d(v), p(v) d(w), p(w) d(y), p(y) d(z), p(z)
0 {v} 4, v 3, v 0, – 8, v ∞, – 11, v
1 {v, u} 4, v 3, v 0, – 6, u ∞, – 11, v
2 {v, u, t} 4, v 3, v 0, – 6, u 11, t 11, v
3 {v, u, t, w} 4, v 3, v 0, – 6, u 11, t 11, v
4 {v, u, t, w, y} 4, v 3, v 0, – 6, u 11, t 11, v
5 {v, u, t, w, y, z} 4, v 3, v 0, – 6, u 11, t 11, v

d. Compute the shortest path from w to all network nodes.

Step N' (visited) d(t), p(t) d(u), p(u) d(v), p(v) d(w), p(w) d(y), p(y) d(z), p(z)
0 {w} ∞, – 3, w 8, w 0, – ∞, – ∞, –
1 {w, u} 5, u 3, w 6, u 0, – ∞, – ∞, –
2 {w, u, t} 5, u 3, w 6, u 0, – 12, t ∞, –
3 {w, u, t, v} 5, u 3, w 6, u 0, – 12, t 17, v
4 {w, u, t, v, y} 5, u 3, w 6, u 0, – 12, t 17, v
5 {w, u, t, v, y, z} 5, u 3, w 6, u 0, – 12, t 17, v

e. Compute the shortest path from y to all network nodes.

Step N' (visited) d(t), p(t) d(u), p(u) d(v), p(v) d(w), p(w) d(y), p(y) d(z), p(z)
0 {y} 7, y ∞, – ∞, – ∞, – 0, – ∞, –
1 {y, t} 7, y 9, t 11, t ∞, – 0, – ∞, –
2 {y, t, u} 7, y 9, t 11, t 12, u 0, – ∞, –
3 {y, t, u, v} 7, y 9, t 11, t 12, u 0, – 22, v
4 {y, t, u, v, w} 7, y 9, t 11, t 12, u 0, – 22, v
5 {y, t, u, v, w, z} 7, y 9, t 11, t 12, u 0, – 22, v

f. Compute the shortest path from z to all network nodes.

Step N' (visited) d(t), p(t) d(u), p(u) d(v), p(v) d(w), p(w) d(y), p(y) d(z), p(z)
0 {z} ∞, – ∞, – 11, z ∞, – ∞, – 0, –
1 {z, v} 15, v 14, v 11, z 19, v ∞, – 0, –
2 {z, v, u} 15, v 14, v 11, z 17, u ∞, – 0, –
3 {z, v, u, t} 15, v 14, v 11, z 17, u 22, t 0, –
4 {z, v, u, t, w} 15, v 14, v 11, z 17, u 22, t 0, –
5 {z, v, u, t, w, y} 15, v 14, v 11, z 17, u 22, t 0, –

9) Consider an Ethernet LAN consisting of N nodes interconnected with a switch. Suppose the switch’s forwarding table is initially empty. Suppose node A wants to TCP three-way handshake with node B, where both nodes are on the LAN. Assuming this is the only traffic on the network, and there are no packet errors or loss, how many frames will be transmitted in the process of establishing the TCP connection? Assume node A knows the IP address of node B, and ARP tables have all the necessary mappings.

When a node A wants to start a TCP connection with node B on an Ethernet LAN using a switch that initially has an empty forwarding table, a total of N+4 Ethernet frames will be sent during the TCP three-way handshake.

Reason: The first SYN packet from A is flooded by the switch to all other N−1 ports since the switch doesn’t yet know where B is, plus the original ingress frame from A , totaling N. Then B responds with a SYN+ACK, which goes to the switch and then directly to A 2 frames. Finally, A sends an ACK back to B, again through the switch as a unicast 2 more frames.

So in total, it's N (for the first SYN) + 2 (SYN+ACK) + 2 (ACK) = N+4 frames.

10) For the network shown in Fig.4 give global distance–vector tables when a. Each node knows only the distances to its immediate neighbors. b. Each node has reported the information it had in the preceding step to its immediate neighbors. c. Step (b) happens a second time.

a. Each node knows only the distances to its immediate neighbors.

Noded(·,A)d(·,B)d(·,C) d(·,D)d(·,E)d(·,F)
A038
B02
C3016
D802
E2120
F60

b. Each node has reported the information it had in the preceding step to its immediate neighbors.

Noded(·,A)d(·,B)d(·,C) d(·,D)d(·,E)d(·,F)
A03849
B0342
C330316
D84302
E421207
F9670

c. Step (b) happens a second time.

Noded(·,A)d(·,B)d(·,C) d(·,D)d(·,E)d(·,F)
A063649
B603429
C330316
D643029
E421207
F996970