Model Question Paper Computer Networks PCCST501 KTU 2024 Scheme and Answer Key


 PART-A

1.An application on a host generates 1460 bytes of data. The transport layer uses UDP with an 8-byte header, the network layer adds a 20-byte IP header, and the data link layer adds an Ethernet header and trailer totalling 18 bytes. Calculate the size of the frame transmitted over the network and  the percentage of the frame that is actual application data (overhead efficiency).

Given:

  • Application data = 1460 bytes

  • UDP header = 8 bytes

  • IP header = 20 bytes

  • Ethernet header and trailer = 18 bytes

Step 1: Calculate the total frame size

\[ \begin{aligned} \text{Frame size} &= \text{Application data}+\text{UDP header}\\ &\quad+\text{IP header}+\text{Ethernet overhead}\\ &=1460+8+20+18\\ &=\boxed{1506\text{ bytes}} \end{aligned} \]

Step 2: Calculate the percentage of actual application data

\[ \begin{aligned} \text{Efficiency} &= \frac{\text{Application data}}{\text{Total frame size}}\times100\\ &=\frac{1460}{1506}\times100\\ &=\boxed{96.95\%} \end{aligned} \]

Final Answer

  • Size of transmitted frame: 1506 bytes

  • Application data efficiency: 96.95%

  • Protocol overhead: \(1506-1460=46\) bytes, or approximately 3.05%.


2.Differentiate between the client-server paradigm and the peer-to-peer (P2P)  paradigm. Give one example of each.

Client–Server Paradigm

Peer-to-Peer (P2P) Paradigm

1. A central server provides services or resources to clients.

1. Each peer can act as both a client and a server.

2. The server centrally manages resources and responds to client requests.

2. Resources are shared directly among peers.

3. If the central server fails, its services may become unavailable.

3. Failure of one peer usually does not stop the entire network.

Example: Web browsing using a web server.

Example: BitTorrent file sharing.

Key difference: Client–server follows a centralized approach, whereas P2P follows a distributed approach.



3.Explain the working of the Stop-and-Wait protocol. Describe the sender's  handling of a lost packet and of a lost acknowledgement.

Stop-and-Wait is a flow and error control protocol in which the sender transmits one frame at a time and waits for an acknowledgement (ACK) from the receiver before sending the next frame.

Working:

  1. The sender transmits a frame and starts a timer.

  2. The receiver receives the frame and sends an ACK.

  3. After receiving the ACK, the sender transmits the next frame.

Handling losses:

  • Lost packet/frame: If the frame is lost, the receiver sends no ACK. When the timer expires, the sender retransmits the frame.

  • Lost acknowledgement (ACK): If the frame reaches the receiver but its ACK is lost, the sender times out and retransmits the frame. The receiver uses sequence numbers to identify and discard the duplicate frame, then sends the ACK again.

Thus, Stop-and-Wait ensures reliable delivery by using acknowledgements, timers, retransmissions, and sequence numbers.


4.An organization is given the address 192.168.10.75/26 for one of its hosts.

Find (a) the subnet mask
        (b) the network address and the broadcast address of the subnet
        (c) the range of usable host addresses and the number of usable hosts.


Given

IP address: 192.168.10.75/26

The prefix /26 means 26 bits are used for the network portion and the remaining \(32-26=6\) bits are used for hosts.

(a) Find the subnet mask

The first 26 bits are set to 1.

\[ 11111111.11111111.11111111.11000000 \]

Converting to decimal:

Subnet mask = 255.255.255.192

(b) Find the network address and broadcast address

Step 1: Calculate the block size

\[ \text{Block size}=256-192=64 \]

The subnet ranges in the last octet are:

  • 0–63

  • 64–127

  • 128–191

  • 192–255

Since the host IP ends in .75, it belongs to the subnet range 64–127.

  • Network address: 192.168.10.64

  • Broadcast address: 192.168.10.127

(c) Usable host range and number of hosts

Number of host bits:

\[ 32-26=6 \]

Total addresses:

\[ 2^6=64 \]

Usable host addresses:

\[ 2^6-2=64-2=62 \]

We subtract two addresses because the network address and broadcast address cannot be assigned to ordinary hosts.

  • First usable host: 192.168.10.65

  • Last usable host: 192.168.10.126

  • Number of usable hosts: 62

Final Answer

Requirement

Answer

(a) Subnet mask

    255.255.255.192

(b) Network address

    192.168.10.64

(b) Broadcast address

    192.168.10.127

(c) Usable host range

    192.168.10.65 – 192.168.10.126

(c) Number of usable hosts

        62

5.Define framing. Explain the use of byte stuffing and bit stuffing in making a frame's boundaries clear if the data itself contains the flag pattern.

Framing: Framing is a data-link layer function that divides a continuous stream of bits into manageable units called frames, marking the beginning and end of each frame.

1. Byte Stuffing:

  • Special flag bytes are used to mark frame boundaries.

  • If the flag byte occurs in the data, an escape byte is inserted before it.

  • The receiver removes the escape byte to recover the original data.

2. Bit Stuffing:

  • A special bit pattern, usually 01111110, is used as the frame flag.

  • Whenever five consecutive 1s occur in the data, the sender inserts a 0 bit.

  • The receiver removes the inserted 0 bits to recover the original data.

Purpose: Both techniques prevent data from being mistaken for frame boundary flags.

6.Rank 1-persistent, non-persistent and p-persistent CSMA in terms of
(a) collision probability and (b) channel idle time, and justify the ranking.

CSMA Protocol

    Collision Probability

    Channel Idle Time

1-persistent CSMA

    High

    Low

p-persistent CSMA

    Medium

    Medium

Non-persistent CSMA

    Low

    High

Justification:

  • 1-persistent CSMA: A station transmits immediately when the channel becomes idle. Multiple waiting stations may transmit simultaneously, increasing collisions. Channel idle time is low.

  • Non-persistent CSMA: A station waits for a random time if the channel is busy before sensing again. This reduces collisions but increases channel idle time.

  • p-persistent CSMA: A station transmits with probability \(p\) when the channel is idle and defers with probability \(1-p\). It provides a compromise between collision probability and channel utilization.

Note: The ranking is qualitative; actual performance depends on traffic load, propagation delay, and the choice of \(p\).

7.Draw the NRZ-L, NRZ-I and Manchester waveforms for the bit sequence

0 1 0 0 1 1.

1. NRZ-L waveform


2. NRZ-I waveform

A transition occurs at the beginning of every bit 1; bit 0 causes no transition.

3. Manchester waveform


Every bit has a transition in the middle:

  • 0 = high to low

  • 1 = low to high

Quick exam tip

Encoding

Main rule

NRZ-L

        Bit value determines the voltage level.

NRZ-I

    1 causes a transition; 0 causes no transition.

Manchester

        There is always a transition in the middle of each bit.

8.Explain the roles of SNMP, SMI and MIB in network management.

1. SNMP (Simple Network Management Protocol): Defines the format of messages exchanged between the manager and agent. It is used to read and modify the values of management objects.

2. SMI (Structure of Management Information): Defines the rules for naming management objects, specifying their data types, ranges, and encoding.

3. MIB (Management Information Base): Defines the collection of management objects for a device, including their names, data types, and relationships.

In short: SMI defines the rules, MIB defines the objects, and SNMP reads or modifies their values.


 PART-B

9a.Explain the layered architecture of the TCP/IP protocol suite. State the function of each layer and the name of the data unit handled at each layer.

TCP/IP Protocol Suite – Layered Architecture (5 Marks)

The TCP/IP protocol suite is a network communication model consisting of four layers. Each layer performs specific functions and provides services to the layer above it.

Figure: TCP/IP Layered Architecture



Functions and Data Units

Layer

Main function

Data unit (PDU)

1. Application

Provides network services to user applications, such as web browsing, file transfer and e-mail.

Data / Message

2. Transport

Provides end-to-end process communication, segmentation, flow control and error recovery (TCP). UDP provides connectionless delivery.

Segment (TCP) / Datagram (UDP)

3. Internet

Handles logical addressing and routing of packets from source to destination across networks.

Packet / IP Datagram

4. Network Access

Handles framing, physical addressing and transmission of data over the network medium.

Frame

Note: At the receiving end, data moves upward through the layers, and each layer processes its  corresponding protocol information. This process is called decapsulation.


9b.Trace the journey of a message from an application on host A to the application on host B, showing encapsulation at the sender and decapsulation at the receiver. Draw a neat diagram showing the logical connection between peer layers.

Journey of a Message in the TCP/IP Protocol Suite (5 Marks)

When an application on Host A sends a message to an application on Host B, the message passes through the TCP/IP layers. The sender performs encapsulation, and the receiver performs decapsulation.

1. Neat Diagram



2. Encapsulation at Host A

  1. Application layer: Creates the message containing the data to be sent.

  2. Transport layer: Adds a TCP or UDP header, forming a segment or datagram.

  3. Internet layer: Adds an IP header containing source and destination IP addresses, forming an IP packet.

  4. Network access layer: Adds a frame header and trailer, forming a frame that is transmitted over the network.

3. Decapsulation at Host B

  1. The network access layer receives the frame and removes its header and trailer.

  2. The Internet layer processes the IP header and passes the packet upward.

  3. The transport layer processes its header, identifies the destination application and reassembles data when required.

  4. The application layer receives the original message.

4. Logical Connection Between Peer Layers

Corresponding layers on Host A and Host B are called peer layers. They logically communicate using the same protocol, although the data physically travels through the network between the hosts.

Key point: Encapsulation adds protocol headers (and a frame trailer where applicable) at the sender; decapsulation removes and processes them at the receiver.




10a.With a neat diagram, explain the architecture of electronic mail. Describe the roles of the user agent, message transfer agent and message access agent. Explain the use of SMTP, POP3 and IMAP in the delivery of a mail message.

Electronic Mail Architecture (6 Marks)

Electronic mail (e-mail) allows users to exchange messages over the Internet using different mail protocols and components.

1. Architecture of Electronic Mail



2. Roles of the components

1. User Agent (UA): Provides the interface to compose, send, receive, and read e-mails. Examples include Gmail and Outlook.

2. Message Transfer Agent (MTA): Transfers e-mail messages from the sender's mail server to the recipient's mail server.

3. Message Access Agent (MAA): Allows the recipient to access and retrieve e-mails stored on the mail server.

3. E-mail protocols

Protocol

Purpose

SMTP (Simple Mail Transfer Protocol)

Sends e-mail from the sender to the mail server and transfers it between mail servers.

POP3 (Post Office Protocol version 3)

Retrieves e-mails from the mail server to the recipient's device, often for local storage.

IMAP (Internet Message Access Protocol)

Accesses and manages e-mails on the server, keeping messages and folders synchronized across devices.

Conclusion: SMTP is used for sending and transferring e-mails, whereas POP3 and IMAP are used by recipients to access their e-mails.


10b.Describe the roles of the control connection and the data connection in FTP file transfer.

Control Connection and Data Connection in FTP (3 Marks)

FTP (File Transfer Protocol) uses two separate TCP connections:

1. Control Connection: Established between the client and server using TCP port 21. It carries commands and responses, such as login credentials, file requests, and directory listings.

2. Data Connection: Used to transfer the actual files and directory listing data between the client and server. In traditional active FTP, the server uses TCP port 20 for the data connection; in passive FTP, a server-selected port is used.

Key difference: The control connection manages the FTP session, whereas the data connection carries the actual data being transferred.


11.aExplain the establishment of a TCP connection using the three-way handshake. Justify the statement that a SYN segment consumes one sequence number.

TCP Three-Way Handshake (3 Marks)

The three-way handshake is the process used by TCP to establish a reliable connection between a client and a server before data transmission.


TCP 3-way Handshake Process

Step 1 (SYN): In the first step, the client wants to establish a connection with a server, so it sends a segment with SYN(Synchronize Sequence Number) which informs the server that the client is likely to start communication and with what sequence number it starts segments with

Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits set. Acknowledgement(ACK) signifies the response of the segment it received and SYN signifies with what sequence number it is likely to start the segments with

Step 3 (ACK): In the final part client acknowledges the response of the server and they both establish a reliable connection with which they will start the actual data transfer.




Why does a SYN segment consume one sequence number?

A SYN flag indicates the beginning of a connection and occupies one sequence number, even if the segment carries no application data.

For example, if the client sends a SYN with sequence number \(x=100\), the server acknowledges it with ACK = 101. This confirms receipt of the SYN and advances the expected sequence number by one.

Similarly, the server's SYN with sequence number \(y\) is acknowledged by the client with ACK = \(y+1\).

Conclusion: SYN consumes one sequence number because TCP must reliably acknowledge the connection-establishment control information.

11.b A company runs three services over the Internet: (i) an online fund-transfer application, (ii) a live video-conferencing application, and (iii) a DNS query from a host to its local DNS server. For each service, choose the suitable transport protocol (TCP or UDP) and justify your choice.

Suitable Transport Protocols (3 Marks)

Application

Protocol

Justification

(i) Online fund transfer

TCP

Provides reliable, connection-oriented delivery, ensuring data reaches the destination correctly and in order.

(ii) Live video conferencing

UDP

Offers low delay and avoids retransmission delays, making it suitable for real-time audio and video.

(iii) DNS query to local DNS server

UDP

Uses a lightweight request-response mechanism with low overhead. TCP may be used for large responses or other specific DNS operations.

Conclusion: TCP is preferred when reliable, ordered delivery is essential, while UDP is preferred when low latency and low overhead are important.


12a.All the routers in a network run a link state routing protocol and have flooded their link state packets, so every router holds the same link state database. The database corresponds to the network shown in the figure, with the numbers on the links denoting the link costs. Using Dijkstra's algorithm, find the least-cost path from router F to every other router, and write the routing table (destination, cost, next hop) of F.


Routing Table of Router F

Destination

Cost

Next Hop

A

7

E

B

4

E

C

4

C

D

7

E

E

3

E

F

0

—

G

4

G

Note: The next hop is the first router reached from F along the least-cost path.


12.b An IP datagram of total length 4000 bytes (including a 20-byte header) must pass through a link with an MTU of 1500 bytes. Find the number of fragments. For each fragment, give the total length, the fragment offset and the MF (more fragments) flag.

Solution: IP Datagram Fragmentation

Given:

  • Total datagram length = 4000 bytes

  • IP header = 20 bytes

  • MTU = 1500 bytes

Step 1: Calculate the maximum data per fragment

Each fragment must fit within the MTU.

\[ \begin{aligned} \text{Maximum data} &= 1500-20\\ &=1480\text{ bytes} \end{aligned} \]

The fragment data size (except for the last fragment) must be a multiple of 8 bytes because the fragment offset is measured in units of 8 bytes. Here, 1480 is divisible by 8.

Step 2: Calculate the original data size

\[ \begin{aligned} \text{Original data} &=4000-20\\ &=3980\text{ bytes} \end{aligned} \]

Divide the data into fragments:

  • Fragment 1: 1480 bytes

  • Fragment 2: 1480 bytes

  • Fragment 3: \(3980-1480-1480=1020\) bytes

Therefore, number of fragments = 3.

Step 3: Calculate total length, fragment offset and MF flag

Fragment offset is calculated using the number of data bytes preceding that fragment divided by 8.

Fragment

Data size (bytes)

Total length (header + data)

Fragment offset

MF flag

1

1480

1500

\(0/8=0\)

1

2

1480

1500

\(1480/8=185\)

1

3

1020

1040

\(2960/8=370\)

0

MF (More Fragments) flag:

  • MF = 1: More fragments follow.

  • MF = 0: This is the last fragment.

Final Answer

  • Number of fragments: 3

  • Fragment total lengths: 1500, 1500, 1040 bytes

  • Fragment offsets: 0, 185, 370

  • MF flags: 1, 1, 0


13a.A data unit 100100 is to be sent using CRC with the generator polynomial

$g(x) = x^3 + x^2 + 1.$
i) Find the CRC bits and the codeword to be transmitted.
ii) The codeword is received without any change during transmission.Show, by performing the check at the receiver, that the data is not corrupted.

Given:

  • Data unit: 100100

  • Generator polynomial: \(g(x)=x^3+x^2+1\)

  • Generator bit pattern: 1101

Since the generator has degree 3, append 3 zeros to the original data before calculating the CRC.

(i) Codeword generation at the sender

Step 1: Append zeros

\[ \begin{aligned}\text{Original data} &= 100100\\\text{Append 3 zeros} &= 100100000\end{aligned} \]

Divide 100100000 by 1101 using modulo-2 division (XOR).

Step 2: Perform modulo-2 division

In XOR subtraction, equal bits give 0 and different bits give 1.

1101)  100100000
           1101
------------
           01000
             1101
------------------
             01010
      1101
-------------------
               01110
                 1101
----------------------
                 001100
                     1101
-------------------------
                     0001

The final remainder is the last 3 bits:

\[ \boxed{\text{CRC bits}=001} \]

Step 3: Construct the transmitted codeword

Append the CRC bits to the original data, not to the data with appended zeros.

Original data : 100100
CRC bits      :       001
                ---------
Codeword      : 100100001
\[ \boxed{\text{Transmitted codeword}=100100001} \]

(ii) CRC verification at the receiver

The receiver divides the received codeword 100100001 by the same generator 1101.

1101)  100100001

           1101

-----------------

          01000

            1101

-------------------

            01010

      1101

----------------------

              01110

                1101

------------------------

                001101

                    1101

-------------------------

                   0000

The remainder is:

\[ \boxed{000} \]

Conclusion: Since the receiver obtains a zero remainder, the codeword passes the CRC check. No transmission error is detected.


13b.Justify the need for Mobile IP. Explain the roles of the home agent, the foreign agent, the home address and the care-of address.

Need for Mobile IP: Mobile IP allows a mobile device to move from one network to another while maintaining its permanent IP address and ongoing communication.

Roles of the components:

1. Home Agent (HA): A router in the mobile device's home network that tracks its current location and forwards packets to it.

2. Foreign Agent (FA): A router in the visited network that assists the mobile device in receiving packets (in traditional Mobile IPv4).

3. Home Address: The permanent IP address assigned to the mobile device in its home network.

4. Care-of Address (CoA): A temporary address that identifies the mobile device's current location in the visited network.

Working: The Home Agent tunnels packets to the Care-of Address, allowing the mobile device to receive data while moving between networks.

14.a Compare the four implementations of Standard Ethernet: 10Base5, 10Base2, 10Base-T and 10Base-F. Give the medium, the topology and the maximum segment length of each.

Comparison of Standard Ethernet Implementations (6 Marks)

Feature

10Base5

10Base2

10Base-T

10Base-F

Medium

Thick coaxial cable

Thin coaxial cable

Twisted-pair cable

Fiber-optic cable

Topology

Bus

Bus

Star

Star

Maximum segment length

500 m

185 m

100 m

2000 m (approximately)

Connector

Vampire tap

BNC

RJ-45

Fiber-optic connector

Installation

Difficult and less flexible

Easier than 10Base5

Easy to install and maintain

Requires specialized fiber equipment

Typical use

Older backbone networks

Small, older LANs

Office and building LANs

Longer-distance LAN links

Explanation of naming:

  • 10 indicates a data rate of 10 Mbps.

  • Base indicates baseband transmission.

  • 5 in 10Base5 indicates a maximum segment length of 500 m; 2 in 10Base2 refers approximately to 200 m, with the actual limit being 185 m.

  • T stands for twisted pair, and F stands for fiber.

Note: The maximum segment length for 10Base-F depends on the specific fiber variant; 2000 m is a commonly cited value.



14 b.Differentiate between a hub, a switch and a router with respect to the layer of operation of each.

Difference Between Hub, Switch and Router (3 marks)

Device

Layer of Operation

Function

Hub

Physical Layer (Layer 1)

Broadcasts incoming bits to all connected ports without examining destination addresses.

Switch

Data Link Layer (Layer 2)

Forwards frames to the appropriate port using MAC addresses.

Router

Network Layer (Layer 3)

Forwards packets between different networks using IP addresses.

Example: A hub connects devices by repeating signals, a switch connects computers within a LAN, and a router connects different networks, such as a college LAN to the Internet.

learn More 


15.a A digital bit stream 1 0 1 1 0 has to be sent over a bandpass channel using digital-to-analog conversion.
(i) Draw the modulated carrier waveforms for ASK, FSK and PSK for this bit stream, aligned with the data signal. Mark the bit intervals and label the parameter that changes in each.
(ii) Write the bandwidth formula for each technique.(6 marks)

Given bit stream: 1 0 1 1 0

Digital-to-analog conversion represents digital bits using a sinusoidal carrier signal.

For the waveforms below, assume these conventions:

  • ASK: Bit 1 uses a carrier of amplitude \(A\); bit 0 uses zero amplitude (on-off keying).

  • FSK: Bit 1 uses frequency \(f_1\); bit 0 uses a different frequency \(f_0\).

  • PSK (BPSK): Bit 1 uses phase \(0^\circ\); bit 0 uses phase \(180^\circ\).

The bit intervals are equal, and each waveform is aligned with the original data signal.



(ii) Bandwidth formulas

Using the common approximation, where \(S\) is the signal rate in baud and \(d\) is a factor related to modulation and filtering:

Technique

Bandwidth formula

ASK

    \(B_{\text{ASK}}=(1+d)S\)

FSK

    \(B_{\text{FSK}}=2(1+d)S\)

PSK

    \(B_{\text{PSK}}=(1+d)S\)

Here, \(d\) typically lies between 0 and 1. For binary ASK and PSK, the bandwidth is approximately the same for the same signal rate. Binary FSK generally requires more bandwidth because it uses two distinct carrier frequencies.

Remember for the exam: ASK changes amplitude, FSK changes frequency, and PSK changes phase.


15.b Explain radio waves, microwaves and infrared as unguided media, highlighting their directionality and typical applications.( 3 marks)

Unguided media transmit electromagnetic waves through free space without using physical cables.

1. Radio Waves: Generally omnidirectional, meaning they propagate in multiple directions. They are used in AM/FM radio broadcasting and television transmission.

2. Microwaves: Generally unidirectional, using focused signals between aligned antennas. They are used in cellular communication, satellite communication and wireless LANs.

3. Infrared: Used for short-range communication and cannot penetrate walls. They are used in TV remote controls and short-range indoor communication.

learn more from here

16.a

The following ASN.1 declarations contain errors. Identify each error and write the corrected declaration. Then define an enumerated type DayOfWeek (sun to sat), a subtype Weekend that allows only sun or sat, and a variable holiday of type Weekend with the value sun.

numberOfStudents ::= INTEGER (15..40)
HerAge INTEGER ::= 35
classSize NumberOfStudents ::= 50
(Assume that the corrected first declaration defines the type used in the third declaration.)
(6 marks)

1. Identify the errors and correct the declarations

Error 1: Incorrect:

numberOfStudents ::= INTEGER (15..40)

Correction: The type name should start with an uppercase letter.

NumberOfStudents ::= INTEGER (15..40)

Error 2:

Incorrect:

HerAge INTEGER ::= 35

Correction: The variable name should start with a lowercase letter.

herAge INTEGER ::= 35

Error 3:

Incorrect:

classSize NumberOfStudents ::= 50

Correction: The value 50 is outside the permitted range of 15 to 40.

For example, use:

classSize NumberOfStudents ::= 30

2. Define DayOfWeek, Weekend, and holiday

DayOfWeek ::= ENUMERATED {
    sun, mon, tue, wed, thu, fri, sat
}

Weekend ::= DayOfWeek (sun | sat)

holiday Weekend ::= sun

Explanation:

  • DayOfWeek defines seven enumerated values, from sun to sat.

  • Weekend restricts the allowed values to sun or sat.

  • holiday is a variable of type Weekend, assigned the value sun.

16.b Explain the working of FHSS and DSSS with suitable examples.

FHSS and DSSS (3 Marks)

1. Frequency Hopping Spread Spectrum (FHSS):

  • The carrier frequency changes rapidly among a set of frequencies according to a predetermined pseudorandom sequence shared by the sender and receiver.

  • Example: Bluetooth uses frequency hopping to reduce interference.

2. Direct Sequence Spread Spectrum (DSSS):

  • Each data bit is replaced by a sequence of smaller bits called chips, using a spreading code. This spreads the signal over a wider bandwidth.

  • Example: Traditional IEEE 802.11 Wi-Fi (using 2.4 GHz DSSS modes).

Key difference: FHSS spreads the signal by hopping between frequencies, whereas DSSS spreads it by encoding each data bit into multiple chips.

learn more abot FHSS and DSSS

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks