June 21, 2024

Computer Networks MCQ Question and Answer

Share :

1.Consider two networks N1 and N2 in which Host A in N1 wants to communicate with Host X in N2 TCP/IP is a suite of communication protocols used to interconnect network devices on the internet or intranet. TCP defines how applications can create channels of communication across a network. It also manages how a message is assembled into smaller packets before they are then transmitted over the internet and reassembled in the right order at the destination address. IP defines how to address and route each packet to make sure it reaches the right destination. Each gateway computer on the network checks this IP address to determine where to forward the message. TCP/IP uses the client-server model of communication in which a user or machine (a client) is provided a service (like sending a webpage) by another computer (a server) in the network.
i) While connection establishment using TCP should the connection be a confirmed service or unconfirmed service? What type of data transfer in case of connection-oriented service? (2 Marks).

ii) Transport layer protocol, TCP uses network layer protocol IP always while sending data whereas UDP doesn’t. Justify your answer.

iii) Does it make sense for a network to provide a confirmed, connectionless packet transmission?

iv) Explain the notion of multiplexing can be applied at transport layer with neat diagram showing flow of PDUs in multiplexing scheme. Marks)

ANS:-

i) When establishing a connection using TCP (Transmission Control Protocol), the connection should be a confirmed service. TCP is a connection-oriented protocol, and it provides reliable and confirmed communication. During the connection establishment phase, a three-way handshake ensures that both ends of the connection agree to establish a reliable connection. In the case of a connection-oriented service, data transfer involves guaranteed delivery with error checking and retransmission of lost or corrupted packets.

ii) TCP always uses the network layer protocol IP (Internet Protocol) when sending data. This is because TCP and IP are designed to work together as part of the TCP/IP protocol suite. TCP provides the reliable, connection-oriented communication, while IP is responsible for addressing and routing packets. TCP relies on IP to deliver its segments to the destination. In contrast, UDP (User Datagram Protocol) is another transport layer protocol that doesn’t guarantee reliability and doesn’t necessarily use IP. UDP can operate over different network layer protocols, including IP, but it doesn’t establish a connection like TCP does.

iii) It doesn’t typically make sense for a network to provide a confirmed, connectionless packet transmission because the concepts of “confirmed” and “connectionless” are somewhat contradictory. Confirmed services, as seen in TCP, are associated with connection-oriented protocols where there is a handshake and a commitment to reliable data transfer. In connectionless services, such as UDP, there is no confirmation or acknowledgment of packet delivery. If a network provides a confirmed service, it usually implies a connection-oriented protocol like TCP.

iv) Multiplexing at the transport layer allows multiple applications or processes to share a single network connection. This is typically done using port numbers to differentiate between different communication endpoints on the same device. Here’s a simplified diagram to illustrate how multiplexing works:

Transport Layer
+———————–+
| Multiplexer |
|———————–|
| App 1 (Port A) | | |
|——————-| | | +————————+
| App 2 (Port B) |—| |–>| Network Layer (IP) |
|——————-| | | +————————+
| App 3 (Port C) | | |
+———————–+


For More Updates Join Our Channels :


2.


3.(A) If Data gram Packet of size 5925 bytes is to go through a network with MTU 1500, How many fragments will be there? and what will their fields

Length, Frag Flag and Offset have what values?

ANS:- To fragment a datagram packet of size 5925 bytes into smaller packets with an MTU (Maximum Transmission Unit) of 1500 bytes, you can use the following calculations:

Determine the number of fragments:
Number of fragments = (Total Datagram Size) / (MTU)
Number of fragments = 5925 bytes / 1500 bytes = 3.95
Since you cannot have a fraction of a fragment, you’ll need 4 fragments in total.

Calculate the fields for each fragment:
Length: Each fragment will have a maximum length of 1500 bytes, except for the last fragment, which may be smaller.
Frag Flag: The “More Fragments” flag will be set for all fragments except the last one.
Offset: The offset indicates the position of the fragment within the original datagram in 8-byte units. The first fragment has an offset of 0, the second 1, and so on.
Here’s how the fields would look for each fragment:

Fragment 1:

Length: 1500 bytes
Frag Flag: More Fragments set
Offset: 0
Fragment 2:

Length: 1500 bytes
Frag Flag: More Fragments set
Offset: 1 (1500 bytes * 1)
Fragment 3:

Length: 1500 bytes
Frag Flag: More Fragments set
Offset: 2 (1500 bytes * 2)
Fragment 4 (Last Fragment):

Length: 1425 bytes (5925 – 3 * 1500)
Frag Flag: More Fragments not set (indicating the last fragment)
Offset: 3 (1500 bytes * 3)

3.(B) Using Dijkstra’s algorithm find the shortest path from the source node A. 

ANS:- To find the shortest path from the source node A using Dijkstra’s algorithm, we need a network topology or graph representation with node weights (distances) between nodes. 


For More Updates Join Our Channels :


4.(A)

4.(B). Suppose you purchase a wireless router and connect it to your cable modem. Also suppose that you have 4 PCs at home that use 802.11 to wirelessly connect to your wireless router. Then how many IP addresses are assigned in this situation by ISP and How are IP addresses assigned to the five PCs?

ANS:- In this scenario, the number of IP addresses assigned and how they are assigned would typically work as follows:

IP Addresses Assigned by ISP:

Your ISP (Internet Service Provider) typically assigns you a single public IP address. This public IP address is assigned to your cable modem. This IP address is used to identify your home network on the internet.
IP Addresses Assigned to the PCs:

Your wireless router serves as a network address translation (NAT) device. It assigns private IP addresses to the devices connected to your local network. These private IP addresses are not routable on the public internet and are used for internal network communication.

The wireless router will typically have a built-in DHCP server that dynamically assigns private IP addresses to the devices connected to it. This assignment is usually done in a private address space such as 192.168.x.x or 10.x.x.x.

Each of your four PCs would receive a private IP address from the router. For example, if your router’s private IP range is 192.168.1.2 to 192.168.1.5, your PCs might be assigned IP addresses like:

PC1: 192.168.1.2
PC2: 192.168.1.3
PC3: 192.168.1.4
PC4: 192.168.1.5
These private IP addresses allow your PCs to communicate with each other within your home network and share the single public IP address provided by your ISP to access the internet.

So, in this situation, your ISP assigns one public IP address to your cable modem, and your wireless router assigns private IP addresses to your four PCs using NAT.


5.(A) Let the size of the congestion window of TCP connection be 64 KB when a timeout occurs. The round trip time of the connection is 80 msec and maximum segment size used is 4 KB. Assuming TCP enters the Slow start Phase, calculate the time taken by the TCP connection to get back to 64 KB congestion window.

ANS:-  To calculate the time taken by the TCP connection to reach a congestion window of 64 KB, assuming it starts from the Slow Start phase, we need to use the formula for TCP Slow Start:

Time (T) = (2 * Round Trip Time (RTT) * MSS) / Congestion Window (CWND)

Where:

RTT = 80 msec (0.08 seconds)
MSS (Maximum Segment Size) = 4 KB = 4 * 1024 bytes
CWND (Congestion Window Size) starts at 1 MSS (since it’s in Slow Start phase).
So,

T = (2 * 0.08 seconds * 4 * 1024 bytes) / (1 * 1024 bytes) = 6.4 seconds

It will take approximately 6.4 seconds for the TCP connection to reach a congestion window of 64 KB.

5.(B)A TCP session sends 10 packets per second over an Ethernet LAN. Each Ethernet packet has a payload of 1466 bytes. Assume that the Ethernet frame overhead is 18 bytes.

1) What is the throughput of the session?
2) What is the total bandwidth required?

ANS:- To calculate the throughput and total bandwidth required:

Throughput is the amount of data successfully delivered per unit of time. In this case, the payload size is 1466 bytes, and there are 10 packets sent per second.
Throughput = (Payload size per packet * Packets per second) / 8 bits per byte
Throughput = (1466 bytes * 10 packets per second) / 8 bits per byte ≈ 1832.5 bytes per second

To convert bytes per second to bits per second, multiply by 8:
Throughput ≈ 14660 bits per second

To calculate the total bandwidth required, you need to account for both the payload and Ethernet frame overhead.
Total Ethernet frame size = Payload size + Ethernet frame overhead
Total Ethernet frame size = 1466 bytes + 18 bytes = 1484 bytes

Now, calculate the total bandwidth required:

Total Bandwidth Required = (Total Ethernet frame size * Packets per second * 8 bits per byte) / 10^6 (to convert to Mbps)
Total Bandwidth Required = (1484 bytes * 10 packets per second * 8 bits per byte) / 10^6 ≈ 1.18752 Mbps

So, the throughput of the session is approximately 14660 bits per second, and the total bandwidth required is approximately 1.19 Mbps.


For More Updates Join Our Channels :