Computer Networks CT 1 Solutions

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CT-1 Question Paper Solutions

Question: How many point-to-point WANs are needed to connect n LANs if each LAN should be able
to directly communicate with any other LAN?

Answer:

To connect n LANs where each LAN can communicate directly with any other LAN, you need a fully
meshed network topology. This means there's a direct point-to-point WAN connection between
every pair of LANs.

The number of point-to-point WANs required can be calculated using the following formula:

n * (n - 1) / 2

Where:

• n is the number of LANs

Example:

If you have 5 LANs (n = 5), you would need:

5 * (5 - 1) / 2 = 10 point-to-point WANs.

Why this formula?

• Each LAN needs to connect to (n - 1) other LANs.

• If we simply multiply n * (n - 1), we're double-counting the connections (since LAN A


connecting to LAN B is the same connection as LAN B connecting to LAN A).

• Dividing by 2 corrects for this double-counting.


Question: What is the size of an ARP packet when the protocol is IPv4 and the hardware is Ethernet?

Answer: The size of an ARP packet when the protocol is IPv4 and the hardware is Ethernet is 28
bytes.

Here's a breakdown of the fields in an ARP packet:

• Hardware Type: 2 bytes (Ethernet is 1)

• Protocol Type: 2 bytes (IPv4 is 0x0800)

• Hardware Address Length: 1 byte (6 bytes for Ethernet MAC addresses)

• Protocol Address Length: 1 byte (4 bytes for IPv4 addresses)

• Operation: 2 bytes (1 for request, 2 for reply)

• Sender Hardware Address: 6 bytes

• Sender Protocol Address: 4 bytes

• Target Hardware Address: 6 bytes

• Target Protocol Address: 4 bytes

However, it's important to note that when an ARP packet is transmitted over Ethernet, it's
encapsulated within an Ethernet frame. Due to the minimum Ethernet frame size requirement, the
ARP packet will be padded to 46 bytes, and with the Ethernet header and trailer, the total frame size
becomes 64 bytes.
Question: In a block code, a dataword is 20 bits and the corresponding codeword is 25 bits. What
are the values of k, r, and n according to the definitions in the text? How many redundant bits are
added to each dataword?

Answer: In block coding terminology:

• k represents the number of information bits (the size of the dataword).

• r represents the number of redundant bits (the number of error-correcting bits added).

• n represents the total number of bits in the codeword (the size of the codeword).

In this case:

• k = 20 (the dataword is 20 bits)

• n = 25 (the codeword is 25 bits)

To find r, we can use the relationship:

n=k+r

Therefore:

r = n - k = 25 - 20 = 5

So:

• r=5

Answer:

• k = 20

• r=5

• n = 25

5 redundant bits are added to each dataword.


Question: Protocol layering can be found in many aspects of our lives such as air travelling. Imagine
you take a round-trip to spend some time on vacation at a resort. You need to go through some
processes at your city airport before flying. You also need to go through some processes when you
arrive at the resort airport. Show the protocol layering for the round trip using some layers such as
baggage checking/claiming, boarding/unboarding, takeoff/landing.

Answer: Here's a representation of protocol layering in air travel, using your round-trip vacation as an
example:

Outbound Trip (City Airport to Resort Airport)

Layer Outbound Actions Description


Ticketing Purchase ticket, check-in online or Handles all aspects of the reservation and
at counter, obtain boarding pass confirms your right to travel.
Baggage Check in luggage at designated Deals with the transportation of your
counter belongings, separate from you.
Security Pass through security screening Ensures safety by screening passengers
(ID check, baggage scan) and their belongings for prohibited items.
Boarding Present boarding pass, board the Manages the process of getting passengers
plane onto the aircraft in an orderly manner.
Takeoff/Flight Aircraft takes off, flies to The core transportation layer, responsible
destination, lands for the actual movement from one location
to another.
Unboarding Disembark from the plane The process of leaving the aircraft upon
arrival.

Inbound Trip (Resort Airport to City Airport)

Layer Inbound Actions Description


Baggage Retrieve checked luggage from Collect your belongings upon
baggage claim arrival at your destination.
Transportation Arrange transportation (taxi, Focuses on your ground
shuttle, rental car) transportation options to get to
your final destination (hotel,
resort, etc.)

Key Points and Observations:

• Dependencies: Each layer depends on the successful completion of the layers below it. For
example, you can't board the plane (Boarding) without a boarding pass (Ticketing).

• Abstraction: Each layer hides the complexities of the layers below it. You don't need to know
how the plane flies (Takeoff/Flight) to check in your bags (Baggage).

• Modularity: This layered approach allows for easier management and modification of the
overall process. For instance, changes to security procedures (Security) don't affect how
baggage is handled (Baggage).
Question: What are the identical objects in the TCP/IP protocol suite?

Answer: In the TCP/IP protocol suite, the identical objects at each layer are messages or Protocol
Data Units (PDUs).

Here's how it works:

1. Application Layer: The message is the data generated by the application (e.g., email, web
page).

2. Transport Layer: The message is encapsulated into a segment (TCP) or datagram (UDP) by
adding transport layer headers.

3. Network Layer: The segment or datagram is encapsulated into a packet by adding a network
layer header (IP header).

4. Data Link Layer: The packet is encapsulated into a frame by adding a data link layer header
and trailer (e.g., Ethernet header and trailer).

5. Physical Layer: The frame is converted into bits and transmitted over the physical medium.

At each layer, the PDU from the upper layer is encapsulated into a new PDU with headers specific to
that layer. This process continues until the data reaches the physical layer, where it's transmitted
over the network. On the receiving end, the process is reversed, with each layer stripping off its
header and passing the PDU to the layer above.

While the term "message" is used generically, the specific names for PDUs vary across layers:

• Application: Data

• Transport: Segment (TCP) or Datagram (UDP)

• Network: Packet

• Data Link: Frame

• Physical: Bits

You might also like