CNS Unit 1 Solution All PYQs
CNS Unit 1 Solution All PYQs
site
Q. Answer
1 Explain Switch and Router. [5 Marks]
The Switch
Primary Use Case: Connecting devices within a single LAN. For example, in an
office, all the computers, printers, and servers would be connected to one or more
switches.
The Router
Primary Use Case: Connecting a home or office LAN to the Internet. Your home
"Wi-Fi router" is actually a combination device: it's a router (to talk to the internet),
a switch (for the wired Ethernet ports), and a wireless access point (for Wi-Fi).
Network Architectures:
1. Client-Server Architecture:
This is a centralized model where one or more powerful computers, called servers,
provide services and resources to other computers, called clients. The
communication is a request-response cycle. It is highly scalable and secure but has
a single point of failure (the server).
Real-World Examples:
• Web Browsing: Your web browser (client) requests a webpage from a web
server.
• Email: Your email app (client) connects to a mail server to send and receive
emails.
• Online Banking: Your banking app (client) communicates with the bank's
secure server to manage your account.
This is a decentralized model where all computers (peers) are equal and share
resources directly with each other without a central server. Each peer acts as
both a client and a server. It is resilient and cost-effective but harder to manage
and secure.
• Each computer (peer) on the network maintains its own data and resources.
• When a peer needs a resource (e.g., a file), it connects directly to another
peer that has the resource.
• A peer can be requesting a file from one peer while simultaneously providing
a different file to another peer. This distributed workload is the key feature of
P2P.
Real-World Example:
1. 1. Bridge:
Function:
A bridge is used to connect two separate LAN segments, making them
appear as a single, larger LAN. It intelligently filters traffic based on MAC
addresses. When a data frame arrives, the bridge checks the destination
MAC address. If the destination is on the same segment, the bridge drops the
frame; if it's on the other segment, it forwards it. This reduces unnecessary
network traffic.
Use Case: Connecting two different departments' LANs within the same
building.
2. 2.Gateway:
OSI Layer: Can operate at any layer, but often at the Application Layer (Layer
7) or Network Layer (Layer 3).
Function:
A gateway is a device that connects two networks that use entirely different
protocols. It acts as a protocol translator. For example, it can connect a
Use Case: Connecting a corporate LAN to the public telephone network for VoIP
calls. Your home router also acts as a gateway to connect your LAN to your ISP's
network.
3.Access Point (AP)
Key Features:
• Enables wireless connectivity.
• Converts wireless signals to wired Ethernet signals.
• Can serve multiple wireless users at the same time.
•
Example: A Wi-Fi hotspot in a café or campus where users connect to the internet
wirelessly.
A Local Area Network (LAN) connects computers and devices within a limited
area, such as:
• A single room
• An office building
• A home
Technologies Used:
• Ethernet (Wired LAN): Uses switches and cables.
• Wi-Fi (Wireless LAN): Uses wireless routers or access points.
Applications:
• Sharing printers, files, and internet among office computers.
• Connecting student computers in a school lab.
• Multiplayer gaming or media streaming at home.
A Metropolitan Area Network (MAN) spans a larger area than a LAN, typically a
city or large campus. It connects multiple LANs together to form a wider
network.
Characteristics:
• Covers an area of 5 to 50 km.
• Often used to connect networks in different buildings, branches, or
institutions within the same city.
• Requires high-speed fiber optic or leased lines.
• Managed by a single ISP or network service provider.
Technologies Used:
• Fiber optic cables, DSL, leased lines, microwave links.
• Metro Ethernet, SONET, or WiMAX.
Applications:
• Cable TV network across a city.
• Government or municipal networks connecting departments.
• Universities with multiple campuses connected to a central server.
A Personal Area Network (PAN) is the smallest and most localized type of
network, created around a single person, usually within a range of 1 to 10 meters.
Characteristics:
• Connects personal electronic devices used by one person.
• Typically wireless, using Bluetooth, Infrared, or USB.
• Does not require central networking devices like switches or routers.
Technologies Used:
• Bluetooth (most common)
• Infrared (IR)
• ZigBee
• NFC (Near Field Communication)
Applications:
• Connecting a smartphone to wireless earphones or a smartwatch.
• Sending files between mobile phones using Bluetooth.
• Using a wireless keyboard/mouse with a laptop.
Here are the key design issues that must be addressed at most layers:
3. Flow Control: A fast sender can easily overwhelm a slow receiver with data,
causing data loss. Flow control is the mechanism that manages the rate of
data transmission to prevent this.
o Data Link Layer & Transport Layer: Both implement flow control
using techniques like the Sliding Window Protocol, which allows the
receiver to tell the sender how much data it is prepared to receive at
any given time.
Draw Manchester and differential Manchester code for the bit sequence:
6 0100110 [5 marks]
Rules:
Bus Topology
• Disadvantages:
o Single Point of Failure: If the main bus cable breaks, the entire
network fails.
o Difficult to Troubleshoot: Finding a fault on the bus can be very
difficult.
o Collisions: If two devices transmit at the same time, a collision occurs,
and the data is lost. Performance degrades quickly as more devices are
added.
Star Topology
Ring Topology
Mesh Topology
• Description: In a mesh topology, devices are interconnected with many
redundant connections. In a full mesh, every single device is connected
directly to every other device. In a partial mesh, some devices are connected
to all the others, but some are only connected to those with which they
exchange the most data.
• How it works: Data can be sent via multiple paths from a source to a
destination. This allows for dynamic routing to avoid broken links or
network congestion.
• Advantages:
o Extremely Fault-Tolerant and Reliable: If one link or node fails, the
network can reroute the traffic through another path. There is no single
point of failure.
o High Security and Privacy: Point-to-point links make it harder to
eavesdrop on traffic.
• Disadvantages:
o Very Expensive: The amount of cabling and the number of network
ports required are immense.
How it Works:
1. Channel Division: A wide frequency band is divided into many smaller,
discrete channels.
2. Hopping Sequence: The sender and receiver agree on a specific, pseudo-
random sequence of channels to hop between. This sequence is their shared
secret.
3. Transmission: The sender transmits a small chunk of data on one frequency
channel for a very short period of time (called the "dwell time").
4. Hopping: After the dwell time expires, both the sender and receiver
simultaneously hop to the next frequency in the sequence and repeat the
process.
Key Advantages:
• Interference Avoidance: If a particular frequency is jammed or noisy, the
system is only affected for the tiny fraction of a second it dwells on that
frequency before hopping to a clear one.
• Security: An eavesdropper who does not know the hopping sequence cannot
follow the signal. To them, the transmission looks like random, low-power
bursts of noise across the spectrum.
• Coexistence: Multiple FHSS systems can operate in the same area by simply
using different hopping patterns, which makes it unlikely they will interfere
with each other.
Primary Example: Bluetooth technology uses FHSS to allow devices like phones,
headphones, and keyboards to communicate reliably even in areas with a lot of Wi-
Fi and other 2.4 GHz radio noise.
Draw Manchester and differential Manchester code for the bit sequence:
10
01001011. [6 marks]
Rules (repeated for clarity):
• Manchester Code: 0 = High-to-Low mid-bit transition; 1 = Low-to-High
mid-bit transition.
• Differential Manchester Code: 0 = Transition at the start of the bit; 1 = No
transition at the start of the bit.
Drawing:
Here is the encoding for the bit sequence 01001011:
The TCP/IP Model, also known as the Internet Protocol Suite, is the practical, 4-
layer networking model that forms the foundation of the modern internet. It is more
concise than the theoretical OSI model and describes the set of communication
protocols used for network communication.
o This is the lowest layer, combining the functions of the OSI model's
Physical and Data Link layers.
o Function: It is responsible for the physical transmission of data over
the physical medium. It handles all the hardware details of interfacing
with the physical network, such as cabling, converting bits into
electrical signals, and MAC addressing on the local network.
o Protocols: Ethernet, Wi-Fi, PPP.
2. Internet Layer:
o This layer corresponds to the OSI model's Network Layer.
o Function: Its primary job is to move packets from a source host to a
destination host across one or more networks. It handles logical
addressing (IP addresses) and routing. It provides a "best-effort"
delivery service, meaning it doesn't guarantee that packets will arrive
in order or at all.
o Protocols: IP (Internet Protocol) is the core protocol. Others include
ICMP and ARP.
3. Transport Layer:
o This layer corresponds to the OSI model's Transport Layer.
o Function: It provides process-to-process communication between
applications on different hosts. It is responsible for end-to-end data
transfer, flow control, and error correction. It offers two main
protocols:
▪ TCP (Transmission Control Protocol): A reliable,
connection-oriented protocol. It guarantees that data arrives in
the correct order and without errors by using acknowledgments
and retransmissions. Used for web browsing (HTTP), email
(SMTP), and file transfers (FTP).
▪ UDP (User Datagram Protocol): An unreliable,
connectionless protocol. It is much faster than TCP because it
does not guarantee delivery. Used for applications where speed
is more important than perfect reliability, such as video
streaming, online gaming, and DNS.
4. Application Layer:
o This is the top layer, combining the functions of the OSI model's
Session, Presentation, and Application layers.
o Function: This layer contains the protocols that network applications
use to communicate. It is the layer the user interacts with.
• PDU: Frame.
Layer 3: Network Layer
• Function: Responsible for routing packets from a source host to a
destination host across multiple networks. It handles logical (IP) addressing,
path determination, and forwarding.
• PDU: Packet.
Layer 4: Transport Layer
• Function: Provides reliable, end-to-end communication between processes
on different hosts. It ensures that data is delivered completely, in order, and
without errors. It handles segmentation, flow control, and error correction.
• PDU: Segment (TCP) or Datagram (UDP).
Layer 5: Session Layer
• Function: Manages, maintains, and terminates communication "sessions"
(dialogues) between applications. It handles synchronization by placing
checkpoints in the data stream, allowing a session to resume from a
checkpoint if it fails.
• PDU: Data.
Layer 6: Presentation Layer
• Function: Acts as a data translator for the network. It ensures that data sent
from the application layer of one system can be read by the application layer
of another. It handles data formatting, character set translation (e.g., ASCII to
EBCDIC), data compression, and encryption/decryption.
• PDU: Data.
Layer 7: Application Layer
• Function: The topmost layer and the one closest to the end-user. It provides
the network services that user applications (like web browsers and email
clients) use to communicate.
• PDU: Data.
How it Works:
1. Chipping Code: A special high-rate bit sequence, known as a chipping
code or spreading code, is generated. This code is unique and is known to
both the sender and the receiver.
2. Spreading Process: To transmit a single data bit (a 1 or a 0), the sender
combines it with the entire chipping code. For example, to send a 1, the
sender might transmit the original chipping code. To send a 0, it might
transmit the inverted version of the code.
3. Transmission: Because the chipping code is much longer and faster than the
original data bit, this process dramatically increases the bandwidth of the
signal, spreading its energy across a wide frequency range. The resulting
signal is very low power and resembles background noise.
4. De-spreading Process: The receiver, which knows the exact same chipping
code, multiplies the incoming wideband signal with the code. This
mathematical operation has two effects:
o It collapses the intended signal back down to the original single data
bit.
o It takes any narrow-band interference that was received and spreads it
out over the wide band, rendering its power negligible and effectively
filtering it out.
Key Advantages:
• Excellent Interference Rejection: The de-spreading process is extremely
effective at removing narrow-band noise or jamming signals.
• Low Probability of Intercept: The transmitted signal is very weak and
looks like noise, making it hard for an unauthorized party to detect or
decode.
• Code Division Multiple Access (CDMA): Multiple users can transmit on
the same frequency band at the same time by simply using different,
orthogonal chipping codes. A receiver tuned to one code will only be able to
de-spread the signal from the sender using that specific code, ignoring all
others.
Primary Examples: Early Wi-Fi standards (802.11b) and the Global Positioning
System (GPS) rely on DSSS.