Model Question Paper Computer Networks PCCST501 KTU 2024 Scheme and Answer Key
PART-A
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
Step 2: Calculate the percentage of actual application data
Final Answer
Size of transmitted frame: 1506 bytes
Application data efficiency: 96.95%
Protocol overhead: \(1506-1460=46\) bytes, or approximately 3.05%.
Key difference: Client–server follows a centralized approach, whereas P2P follows a distributed approach. |
|---|
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:
The sender transmits a frame and starts a timer.
The receiver receives the frame and sends an ACK.
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.
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.
Converting to decimal:
Subnet mask = 255.255.255.192
(b) Find the network address and broadcast address
Step 1: Calculate the block size
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.64Broadcast address:
192.168.10.127
(c) Usable host range and number of hosts
Number of host bits:
Total addresses:
Usable host addresses:
We subtract two addresses because the network address and broadcast address cannot be assigned to ordinary hosts.
First usable host:
192.168.10.65Last usable host:
192.168.10.126Number of usable hosts:
62
Final Answer
Requirement | Answer |
|---|---|
(a) Subnet mask |
|
(b) Network address |
|
(b) Broadcast address |
|
(c) Usable host range |
|
(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 a0bit.The receiver removes the inserted
0bits to recover the original data.
Purpose: Both techniques prevent data from being mistaken for frame boundary flags.
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 waveform2. NRZ-I waveform
A transition occurs at the beginning of every bit 1; bit 0 causes no transition.
3. Manchester waveformEvery bit has a transition in the middle:
0= high to low1= low to high
Quick exam tip
Encoding | Main rule |
|---|---|
NRZ-L | Bit value determines the voltage level. |
NRZ-I |
|
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.
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
Application layer: Creates the message containing the data to be sent.
Transport layer: Adds a TCP or UDP header, forming a segment or datagram.
Internet layer: Adds an IP header containing source and destination IP addresses, forming an IP packet.
Network access layer: Adds a frame header and trailer, forming a frame that is transmitted over the network.
3. Decapsulation at Host B
The network access layer receives the frame and removes its header and trailer.
The Internet layer processes the IP header and passes the packet upward.
The transport layer processes its header, identifies the destination application and reassembles data when required.
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.
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.
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.
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
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.
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.
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.
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.
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
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
Given:
Data unit:
100100Generator 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
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.
The final remainder is the last 3 bits:
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(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:
Conclusion: Since the receiver obtains a zero remainder, the codeword passes the CRC check. No transmission error is detected.
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.
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.
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
1uses a carrier of amplitude \(A\); bit0uses zero amplitude (on-off keying).FSK: Bit
1uses frequency \(f_1\); bit0uses a different frequency \(f_0\).PSK (BPSK): Bit
1uses phase \(0^\circ\); bit0uses 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.
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.
16.a
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 ::= 35Correction: The variable name should start with a lowercase letter.
herAge INTEGER ::= 35Error 3:
Incorrect:
classSize NumberOfStudents ::= 50Correction: The value 50 is outside the permitted range of 15 to 40.
For example, use:
classSize NumberOfStudents ::= 302. Define DayOfWeek, Weekend, and holiday
DayOfWeek ::= ENUMERATED {
sun, mon, tue, wed, thu, fri, sat
}
Weekend ::= DayOfWeek (sun | sat)
holiday Weekend ::= sunExplanation:
DayOfWeekdefines seven enumerated values, fromsuntosat.Weekendrestricts the allowed values tosunorsat.holidayis a variable of typeWeekend, assigned the valuesun.
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.











Comments
Post a Comment