Solution-Final Version Exam Question Paper CN Fall-2024-1
Solution-Final Version Exam Question Paper CN Fall-2024-1
Islamabad Campus
Solution:
To calculate the amount of data that can fit in the "pipe" (also referred to as the bandwidth-delay
product), use the formula:
Data in transit=Bandwidth×RTT
Given Values:
Bandwidth = 155 Mbits/sec
=155×106 bits/sec
RTT = 120 ms=0.120 seconds
Step 1: Calculate data in transit (in bits):
Data in transit=155×106×0.120=18.6×106 bits
Step 2: Convert to bytes:
Data in transit=18.6×106 /8=2.325×106 bytes
Final Answer:
The amount of data that can fit in the pipe is 2,325,000 bytes.
b. In a connection, the value of cwnd is 3000 and the value of rwnd is 5000. The host has sent
2000 bytes, which have not been acknowledged. How many more bytes can be sent? (2
marks)
Given:
Congestion window size ( cwnd) = 3000 bytes
Receiver window size (rwnd) = 5000 bytes
Unacknowledged bytes = 2000 bytes
Final Answer:
The host can send 1000 more bytes.
c. Client uses UDP to send data to a server. The data length is 16 bytes. Calculate the efficiency of
this transmission at the UDP level (ratio of useful bytes to total bytes). (2 marks)
Given:
• Data length (payload) = 16 bytes
• UDP header size = 8 bytes
• Total size = Data length+UDP header size
• Total size=16+8=24 bytes
Efficiency Formula:
Efficiency=Useful data (payload) / Total size×100
Calculation:
Efficiency=(16/24) ×100=66.67%
Final Answer:
The efficiency of the UDP transmission is 66.67%.
d. In a TCP connection, the window size fluctuates between 60,000 bytes and 30,000 bytes. If the
average RTT is 30 ms, what is the throughput of the connection? (2 marks)
Solution:
Throughput = Average window size / RTT
Average window size = 60,000+30,000/2=45,000 bytes
RTT = 30 ms=0.030 seconds
Calculation:
Throughput=45,000 bytes / 0.030 seconds=1,500,000 bytes/sec
Final Answer:
Throughput=1.5MB/sec
e. A client residing on a host with IP address 122.45.12.7 sends a message to the corresponding
server residing on a host with IP address 200.112.45.90. If the well-known port is 161 and the
ephemeral port is 51000, what are the pair of socket addresses used in this communication?
(2 marks)
Answer:
f. What are the four aspects related to the reliable delivery of data? (2 marks)
The four aspects are:
1. Error Detection and Correction
2. Flow Control
3. Acknowledgment and Retransmission
4. Sequencing
g. An HTTP client opens a TCP connection using an initial sequence number (ISN) of 14,534 and
the ephemeral port number of 59,100. The server opens the connection with an ISN of 21,732.
Show the three TCP segments during the connection establishment if the client defines the
rwnd of 4000 and the server defines the rwnd of 5000. Ignore the calculation of the checksum
field. (3 marks)
a. Assume A wants to send a frame to C. If the frame size is 6000 bits, how long does it take to
deliver the entire frame at the switch B? (5 points)
b. How long does it take to deliver the entire frame from host A to host C? (5 marks)
c. Suppose A continuously sends frames to C (one after the other/back to back/without giving a
break). However, host B can store at most 10 packets. At what time will B start to drop packets?
What will be the packet dropping rate in terms of packets/sec? (5 marks)
Solution:
(a) Time to deliver the entire frame at switch B
To determine how long it takes for the frame to be delivered to switch B, we need to calculate the
transmission delay from A to B and add the propagation delay from A to B.
1. Transmission Delay (A to B):
Transmission Delay=Frame Size/Bandwidth from A to B
Transmission Delay=6000/107=0.0006 s=0.6 ms
C.
Final Answers
Final Answers:
(a): 1.6 ms
(b): 10.6 ms
(c):
o B starts to drop packets at 7.06 ms
o Packet dropping rate: 1416.67 packets/sec
b) A /23 network provides 232−23=29=512 total IP addresses. Subtracting 2 for the network
and broadcast addresses, we have 510 usable IPs.
c) We need to allocate IP addresses to each subnet while minimizing waste.
Subnet A: Requires 60 hosts. The nearest power of 2 is 26=64. Therefore, Subnet A requires a
/26 network.
Subnet B: Requires 115 hosts. The nearest power of 2 is 27=128. Therefore, Subnet B requires
a /25 network.
Subnet C: Requires 27 hosts. The nearest power of 2 is 25=32. Therefore, Subnet C requires a
/27 network.
Subnet A: 172.20.36.0/26 (64 addresses)
Subnet B: 172.20.36.64/25 (128 addresses)
Subnet C: 172.20.36.192/27 (32 addresses)
d) Subnet A: Broadcast address is 172.20.36.63
Subnet B: Broadcast address is 172.20.36.191
Consider a Weighted Fair Queuing (WFQ) packet scheduling mechanism with three classes of traffic
(1, 2, 3), with lower class numbers having higher priority. The scheduling weights are 0.5, 0.3, and 0.2
for classes 1, 2, and 3, respectively.
For the given times from t=1 to t=10:
Show the steps to determine which packet is selected for each time interval based on the WFQ
mechanism and specify the packet number on the departure line for each time interval or write 'n/a'
if no packet is sent.
Solution:
a. Consider the datagram at step 1, after it has been sent by the host but before it has reached
the router. What is the source and destination IP address for this datagram?
b. Now consider the datagram at step 2, after it has been transmitted by the router. What is the
source and destination IP address for this datagram?
c. At step 2, Will the source port have changed?
d. Now consider the datagram at step 3, just before it is received by the router. What is the source
and destination IP address for this datagram?
e. At step 4, after it has been transmitted by the router but before it has been received by the
host. What is the source and destination IP address for this datagram?
Solution:
a. The source address will be the local host's IP, which is 10.0.1.17and the destination address will
be the remote machine's IP, which is 128.119.161.188
b. The source address will be the router's public IP, which is 135.122.196.214 and destination
address will be remote machine’s IP 128.119.161.188
c. Yes, the NAT will change the source port.
d. The source address will be the remote machine's IP, which is 128.119.161.188 and the destination
address will be the router's public IP, which is 135.122.196.214
e. The source address will be the remote machine's IP, which is 128.119.161.188 and the destination
address will be the local host's IP, which is 10.0.1.17.
b. Consider a scenario where an AS wants to avoid routing traffic through a specific neighboring
AS due to security concerns. How can the AS enforce this policy using BGP attributes? (1 mark)
The AS can enforce this policy by configuring BGP import policies to reject route advertisements
containing the specific neighboring AS in the AS-PATH attribute, effectively avoiding routes through that
AS.
c. If an ICMP message with type 3 and code 1 is received at the source, what does it signify, and
how should the source respond? (1 mark)
An ICMP message with type 3, code 1 indicates that the destination host is unreachable.
d. Compute updated forwarding table of b by looking at its neighbors. Use Bellman ford equation
to do so. (3 marks)
e. In a Distance Vector routing scenario, what happens when a router detects an increase in a link
cost? Illustrate the "count-to-infinity" problem with an example. (1 mark)
When a link cost increases, routers update distances and propagate them. In the "count-to-infinity"
problem, routers repeatedly exchange increasing path costs, causing delays in convergence. Example:
A → B (1), B → C (1). If B→C breaks, A and B loop updates indefinitely.
g. Describe how a logically centralized control plane in SDN provides enhanced flexibility and
avoids misconfigurations compared to traditional per-router control. (2 marks)
A logically centralized SDN control plane provides a global network view, enabling optimized routing
and traffic engineering. It avoids misconfigurations by centralizing control logic, eliminating
inconsistencies from distributed configurations in traditional per-router control.
h. Explain the role of AS-PATH and NEXT-HOP attributes in BGP route advertisement and selection.
(2 marks)
The AS-PATH attribute lists ASs traversed by a route, helping prevent loops and influencing route
selection based on path length. The NEXT-HOP attribute identifies the next router for forwarding traffic,
ensuring accurate routing within and between ASs.
Q 7: [7 Marks]
Consider a network with three autonomous systems (AS1, AS2, AS3). Each AS uses OSPF for intra-
domain routing and BGP for inter-domain routing.
a. Draw a topology where AS1 is connected to both AS2 and AS3. Assume AS1 prefers routing
through AS2 unless AS2's path becomes unavailable. (3 marks)
b. Describe the updates and route advertisements exchanged using eBGP and iBGP when a link
in AS2 fails. (2 marks)
1. Before Failure:
o eBGP: AS2 advertises routes to AS1; AS3 advertises its routes to AS1. AS1 selects the
path via AS2 based on preferences.
o iBGP: Within AS1, R1 shares the preferred path (via AS2) with other AS1 routers.
2. After Failure in AS2:
o eBGP: AS2 stops advertising its routes. AS1 detects the failure and switches to the route
advertised by AS3.
o iBGP: R1 updates all other AS1 routers to use the backup path via AS3.
c. Analyze how SDN could simplify or optimize this process using its centralized control plane. (2
marks)
1. Global View:
SDN's centralized control plane provides a global view of network state, detecting AS2's
link failure instantly.
2. Dynamic Rerouting:
SDN dynamically updates routing tables in AS1 to use AS3 without relying on BGP's
convergence time.
3. Policy Optimization:
SDN can enforce routing preferences directly using traffic engineering policies, eliminating
dependency on distributed BGP updates.
Q 8: [10 Marks]
Consider the following network. With the indicated link costs, use Dijkstra's shortest-path algorithm
to compute the shortest path from A to all network nodes.
Consider the following network. With the indicated link costs, use Dijkstra's shortest-path algorithm
to compute the shortest path from A to all network nodes.
a. Show how the algorithm works, show all necessary steps in the form of table. [marks 5]
b. Draw the resulting shortest-path tree from A to all other nodes. [marks 3]
NOTE
Please note that you derive (b) and (c) from (a). If (a) is not correct then (b) and (c) will be
automatically considered incorrect.
Answer: Both are random access for shared channels, but pure ALOHA allows transmissions at any
point, leading to high collision probability and low efficiency (max 18.4%). Slotted ALOHA
synchronizes transmissions to fixed time slots, reducing collisions to a maximum of 36.8% by
limiting potential overlap. This improves channel utilization despite still being random in nature.
B. Explain how carrier sensing and collision detection in CSMA/CD enhances efficiency. [2 Marks]
Answer: Carrier sensing (CS) allows a node to listen before transmitting; if the channel is busy, it
waits. Collision Detection (CD) continuously monitors during transmission to detect overlapping
signals. If a collision occurs, both nodes stop, use backoff algorithms, and retransmit later. CS
prevents unnecessary transmissions on occupied channels, while CD stops collisions early instead
of wasting entire packets as in pure CSMA.
Answer: ARP maps IP addresses to MAC addresses. A query seeks the MAC for a specific IP, so
it's broadcast to reach all nodes on the subnet potentially holding that address. The response,
knowing the recipient's MAC from the query, is unicast to that specific node.
D. Describe how the token in a Token Ring network ensures fair access to the shared channel while
preventing collisions. [2 Marks]
Answer: In Token Ring, a single "token" circulates around the ring. A node can transmit only when
it possesses this token. This serialized access ensures that nodes take turns transmitting, effectively
preventing simultaneous transmissions (collisions). When a node transmits, it regenerates a new
token after sending its frame, passing it along to the next node in line for its turn.
E. Explain how "backoff" in the context of CSMA/CD helps mitigate network collisions. [2 Marks]
Answer: Backoff is an exponential algorithm used by Ethernet stations after detecting a collision. It
involves waiting for a random amount of time (increasing exponentially with each successive
collision) before attempting to retransmit data. This randomized delay spreads out transmissions,
reducing the likelihood of another simultaneous transmission and causing further collisions.
Q 10: [5 Marks]
Suppose that a packet’s payload consists of 10 eight-bit values (e.g., representing ten ASCII-encoded
characters) shown below. (Here, we have arranged the ten eight-bit values as five sixteen-bit values):
Figure 1:
01110101 00010100
00111110 11011000
00101000 00001110
01011000 00001010
11010110 00110100
Figure 2:
Both the payload and parity bits are shown. One of these bits is flipped.
00010101 10001010 0
00000000 11101101 0
00100100 00000000 0
11101110 00011101 0
01000110 01011011 0
00011001 00100001 0
Figure 3:
Both the payload and parity bits are shown; Either one or two of the bits have been flipped.
11011110 11111110 1
01101110 11001000 1
10110000 00101100 0
10001001 10000000 0
01011111 10000010 0
11010010 00011000 0
Using the above figures, answer the following questions:
a. For figure 1, compute the two-dimensional parity bits for the 16 columns. Combine the bits into
one string. [2 Marks].
1110110111111100
b. For figure 1, compute the two-dimensional parity bits for the 5 rows (starting from the top).
Combine the bits into one string. [2 Marks]
11110
c. For figure 1, compute the parity bit for the parity bit row from question 1. Assume that the result
should be even. [2 Marks]
0
d. For figure 2, indicate the row and column with the flipped bit (format as: x,y), assuming the top-left
bit is 0,0. [2 Marks]
0,5
e. For figure 3, is it possible to detect and correct the bit flips? Yes or No. [2 Marks]
Yes
Q 11: [5 Marks]
Suppose that the 4-bit generator (G) is 1001 and that r = 3. What are the CRC bits (R) associated with
the data payload D when D is:
a. 10011111 (2.5 marks)
110