0% found this document useful (0 votes)
1 views14 pages

Module1_AnswerBank

The document provides an overview of various internetworking devices, including repeaters, hubs, bridges, switches, routers, and gateways, detailing their functions and layers in the OSI model. It compares circuit-switched and packet-switched networks, outlines the OSI model's seven layers and their functions, and discusses different types of switching methods. Additionally, it contrasts TCP/IP and OSI models, compares types of cables, explains guided and unguided transmission media, and defines Ethernet protocol and the differences between MAC and IP addresses.

Uploaded by

lomispamumbai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views14 pages

Module1_AnswerBank

The document provides an overview of various internetworking devices, including repeaters, hubs, bridges, switches, routers, and gateways, detailing their functions and layers in the OSI model. It compares circuit-switched and packet-switched networks, outlines the OSI model's seven layers and their functions, and discusses different types of switching methods. Additionally, it contrasts TCP/IP and OSI models, compares types of cables, explains guided and unguided transmission media, and defines Ethernet protocol and the differences between MAC and IP addresses.

Uploaded by

lomispamumbai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Q1. Internetworking devices. Repeater, Hub, Bridge, Switch, and Gateway.

Internetworking devices connect different networks or extend a single network. The main devices are:
•​ Repeater – works at Physical layer (Layer 1)
•​ Hub – works at Physical layer (Layer 1)
•​ Bridge – works at Data Link layer (Layer 2)
•​ Switch – works at Data Link layer (Layer 2)
•​ Router – works at Network layer (Layer 3)
•​ Gateway – works at all layers (Layer 4 to 7)
Repeater: It receives a weak signal and retransmits it at full strength. It just boosts the signal — it does NOT
filter or process data. Used to extend cable length.
Hub: A simple device that connects multiple computers in a LAN. When one computer sends data, the hub
sends it to ALL connected devices. It does not check who the data is for.
Bridge: Connects two separate LAN segments. It reads the MAC address of the frame and forwards it only to
the correct segment. This reduces traffic.
Switch: A smarter version of a hub. It sends data only to the specific device it is meant for (using MAC
address table). Reduces collisions and improves speed.
Gateway: Connects two completely different types of networks (e.g., a LAN to the internet). It converts
protocols so both networks can understand each other. It works at all layers.
Q2. Compare Circuit-Switched Networks and Packet-Switched Networks.
Point Circuit Switching Packet Switching
Path Fixed dedicated path for whole call No fixed path; each packet
chooses its own route
Resources Resources reserved before communication Resources shared dynamically
Delay No delay once connection is set up Variable delay (queuing)
Bandwidth Waste Yes, if no data is sent, bandwidth is wasted No waste; bandwidth used only
when needed
Reliability Very reliable for continuous data Packets may arrive out of order
Example Old telephone (PSTN) Internet, emails, web browsing
Setup Time Takes time to set up connection first No setup time needed
Q2.b. OSI model with the function of each layer.
OSI stands for Open System Interconnection. It is a reference model created by ISO (International Organization
for Standardization) that describes how data travels from one computer to another across a network. It has 7
layers. Each layer has a specific job.
LayerName Main Job / Function Example Protocols
Application Closest to user. Provides network services like email, web HTTP, FTP, SMTP, DNS
browsing, file transfer.
Presentation Converts data format. Handles encryption, compression, and SSL/TLS, JPEG, MPEG
translation.
Session Starts, manages, and ends communication sessions between NetBIOS, RPC
two computers.
Transport Breaks data into segments. Ensures reliable delivery with
TCP, UDP
error checking.
Network Decides best path for data (routing). Handles logical IP, ICMP, RIP, OSPF
addressing (IP address).
Data Link Handles physical addressing (MAC address). Error detection Ethernet, Wi-Fi (802.11),
in frames. ARP
Physical Transmits raw bits (0s and 1s) over physical media like cable, USB, Ethernet cable, Hubs
fiber, radio.
Layer 7 – Application Layer: This is the layer the user directly interacts with. It provides services like browsing
the web (HTTP), sending emails (SMTP), and transferring files (FTP). It does NOT refer to apps like Chrome — it
refers to the network interface those apps use.
Layer 6 – Presentation Layer: It acts like a translator. It converts data into a format that the application layer can
understand. It also handles encryption (to keep data secure) and compression (to reduce size). Example:
converting a file from EBCDIC to ASCII.
Layer 5 – Session Layer: Manages sessions (connections) between two computers. It starts a session, keeps it
alive during communication, and ends it when done. Example: logging into a remote server.
Layer 4 – Transport Layer: This layer ensures complete data transfer. It breaks large data into small segments,
numbers them, and reassembles them at the receiver. TCP provides reliable delivery (with acknowledgement);
UDP is faster but without guarantee.
Layer 3 – Network Layer: Responsible for routing — deciding the best path for data to travel from sender to
receiver. It uses logical addresses (IP addresses). Routers work at this layer.
Layer 2 – Data Link Layer: Converts data into frames and adds MAC (hardware) addresses. It detects errors in
transmission. Switches and bridges work at this layer.
Layer 1 – Physical Layer: The lowest layer. It transmits raw bits over physical media (cables, fiber optic, radio
waves). It deals with voltage levels, connector types, and cable specs. Hubs and repeaters work here.
Q3. Circuit, Message, Datagram Packet, and Virtual-Circuit Packet Switching.
Switching is the technique used to decide how data is transferred from one network node to another. There are 4
main types:
1. Circuit Switching
•​ A dedicated physical path is set up between sender and receiver BEFORE communication starts.
•​ The path stays open for the entire duration of the communication.
•​ Even if no data is being sent, the path (bandwidth) is reserved — causing waste.
•​ Best for: voice calls (telephone network / PSTN).
•​ Phases: Connection Setup → Data Transfer → Connection Teardown.
2. Message Switching
•​ There is NO dedicated path. Data is sent as a complete message.
•​ Each intermediate node (router) receives the entire message, stores it, then forwards it — called
store-and-forward.
•​ Good for non-urgent data. Creates delays for large messages.
•​ Not suitable for real-time communication.
•​ Example: Old telegraph systems, early email systems.
3. Datagram Packet Switching
•​ Message is broken into small packets. Each packet travels independently through the network.
•​ Each packet may take a different path to reach the destination.
•​ Packets may arrive OUT OF ORDER — they are re-ordered at the destination.
•​ No setup required. Faster and more flexible than circuit switching.
•​ Example: Internet (IP protocol).
4. Virtual-Circuit Packet Switching
•​ A logical (virtual) path is set up before sending data — like circuit switching.
•​ But data is still broken into packets — like datagram switching.
•​ All packets follow the SAME path and arrive IN ORDER.
•​ Path is called a 'virtual circuit' because it's logical, not physical.
•​ Example: ATM (Asynchronous Transfer Mode), MPLS networks.
Feature Circuit Message Datagram Virtual-Circuit
Dedicated Path? Yes No No Logical path (virtual)
Store & Forward? No Yes (whole msg) Yes (per packet) Yes (per packet)
Order of Arrival? In order In order Out of order In order
Bandwidth Waste? Yes No No No
Setup Required? Yes No No Yes (virtual)
Delay Low High Variable Low (after setup)
Best Used For Voice calls Non-urgent msgs Internet traffic Video, ATM networks
Q4. Compare TCP/IP Model and OSI Model.
TCP/IP is the practical model used in the real internet. OSI is the theoretical reference model. Both describe how
data travels through a network but differ in structure and purpose.
Point OSI Model TCP/IP Model
No. of Layers 7 layers 4 layers
Developed By ISO (International Standard Org) US DoD (Department of Defense)
Usage Theoretical / reference model Practical model, used in real internet
Protocol Dependency Protocol independent Protocol specific (TCP, IP, etc.)
Session & Presentation Separate layers (5 & 6) Merged into Application layer
Data Link & Physical Separate layers (1 & 2) Merged into Network Access layer
Reliability Can support both reliable & unreliable Reliability handled at Transport layer
(TCP)
Flexibility More flexible & general Less flexible but more practical
Communication Connection-oriented at all layers Both connection-oriented (TCP) &
connectionless (UDP)
Q5. Compare Twisted Pair Cable, Coaxial Cable, and Fiber Optic Cable.
The three main types of guided transmission media are Twisted Pair, Coaxial, and Fiber Optic cables. Here is a
comparison:
Feature Twisted Pair Coaxial Cable Fiber Optic
Structure Two insulated copper wires Central copper wire with Glass/plastic fiber carries light
twisted together metal shield signals
Speed Slow to Medium (up to 100 Mbps) Medium (up to 1 Gbps) Very High (up to 100 Gbps+)
Distance Short (up to 100 m) Medium (up to 500 m) Long (many km)
Cost Cheapest Moderate Most Expensive
Interference High (picks up noise easily) Low (shielded) Zero (uses light)
Use LAN, telephone lines Cable TV, internet Backbone networks, long
distance
Flexibility Very flexible, easy to install Less flexible Fragile, needs care
Q6 Explain Guided and Unguided Transmission Media and Draw Electromagnetic Spectrum
Transmission media is the path or channel through which data travels from the sender to the receiver. It is also
called a communication channel. There are two main types:
•​ Guided Media (Wired) — Data travels through a physical wire or cable.
•​ Unguided Media (Wireless) — Data travels through air or space using electromagnetic waves.
1. Guided (Wired) Transmission Media
In guided media, a physical cable guides the signal from one place to another. There are three types:
A. Twisted Pair Cable
It consists of two independently insulated copper wires twisted around each other in a spiral pattern.
The twisting of the wires is crucial because it significantly reduces electromagnetic interference (EMI) and
"crosstalk" (signal bleeding) from neighboring cables.
Two Types:
UTP (Unshielded Twisted Pair): No extra metal covering. Used in LAN (Ethernet) and telephone lines. Easy to
install, cheap.
STP (Shielded Twisted Pair): Has extra metal foil around it for more protection. Used where interference is high.
Advantages: Very cheap and easy to install.; Widely available everywhere.
Disadvantages:
•​ Gets affected by electrical noise and interference.
•​ Only works for short distances (up to 100 m for LAN).
B. Coaxial Cable
A coaxial cable has a central copper wire, surrounded by a layer of insulation, then a metal mesh (shield), and
finally an outer plastic cover. The shield protects signals from outside noise.
Advantages: Better shielding = less interference than twisted pair; Can carry signals over longer distances.
Disadvantages: More expensive than twisted pair.; Bulky and less flexible.
Uses: Cable TV (CATV), broadband internet, older Ethernet networks.
C. Fiber Optic Cable
Fiber optic cable uses light (not electricity) to carry data. It has a thin glass or plastic core that carries light signals.
The core is surrounded by cladding (a reflective layer) that bounces the light back inside. This is called Total
Internal Reflection.
Two Types:
Single Mode Fiber (SMF): Very thin core, carries one light beam, used for long distances (telephone networks,
ISPs).
Multi Mode Fiber (MMF): Thicker core, carries multiple light beams, used for shorter distances (inside buildings).
Advantages:
•​ Extremely fast — highest bandwidth of all cables.
•​ Not affected by electromagnetic interference at all.
•​ Works over very long distances without signal loss.
•​ Very secure — hard to tap into.
Disadvantages:
•​ Most expensive of the three.
•​ Fragile — glass breaks easily.
•​ Difficult to install and repair.
2. Unguided (Wireless) Transmission Media
In unguided media, signals travel through air or free space without any physical cable. They use electromagnetic
(EM) waves. The type of wave depends on the frequency used.
Electromagnetic Spectrum (Draw this in exam):
The electromagnetic spectrum arranges all EM waves by their frequency (Hz). Higher frequency = more data but
shorter range.
Frequency Range Wave Type Used For
3 KHz – 30 MHz Radio Waves (AM/FM) AM/FM Radio, walkie-talkies
30 MHz – 300 MHz VHF Radio FM Radio, TV broadcasting
300 MHz – 3 GHz Microwaves (lower) WiFi, Bluetooth, cellular (3G/4G)
3 GHz – 300 GHz Microwaves (upper) Satellite, radar, 5G
300 GHz – 400 THz Infrared TV remotes, short-range transfer
400 THz – 700 THz Visible Light Fiber optic, experimental
Types of Unguided Media:
A. Radio Waves
•​ Frequency range: 3 KHz to 300 MHz.
•​ Travel in all directions — called omnidirectional.
•​ Can pass through walls and buildings easily.
•​ Used in: AM/FM radio, TV broadcasting, walkie-talkies.
B. Microwaves
•​ Frequency range: 300 MHz to 300 GHz.
•​ Travel in straight lines (line of sight) — need clear path between sender and receiver.
•​ Used for: satellite communication, WiFi, mobile networks (4G/5G), radar.
•​ Two types: Terrestrial Microwave (between towers on ground) and Satellite Microwave (via satellites in
space).
C. Infrared Waves
•​ Frequency range: 300 GHz to 400 THz.
•​ Very short range — cannot pass through walls.
•​ Used for: TV remotes, some wireless keyboards, short-distance file transfer.
•​ Advantage: No interference with other devices. Disadvantage: Very limited range
Q7. Explain Ethernet Protocol.
Ethernet is the most widely used technology for connecting computers in a Local Area Network (LAN). It defines
how data is sent and received over a wired network using cables.
Key Points:
•​ Ethernet works on the Data Link Layer and Physical Layer of the OSI model.
•​ It uses a standard called IEEE 802.3.
•​ Data is sent in small packets called frames.
•​ Each device on an Ethernet network has a unique MAC address.
•​ It uses CSMA/CD (Carrier Sense Multiple Access with Collision Detection) to control data transfer.
Ethernet Frame Format:
An Ethernet frame contains: Preamble | Destination MAC | Source MAC | Type | Data | FCS (Frame Check
Sequence)
Types of Ethernet:
•​ Standard Ethernet — 10 Mbps
•​ Fast Ethernet — 100 Mbps
•​ Gigabit Ethernet — 1 Gbps
•​ 10 Gigabit Ethernet — 10 Gbps
Q8. What is the difference between MAC address and IP address?
MAC Address: A permanent hardware address given to a network device by the manufacturer. It is 48 bits long
and written in hexadecimal (e.g., AA:BB:CC:DD:EE:FF).
IP Address: A logical address assigned to a device to identify it on a network. It can change and is assigned by
the network (e.g., [Link]).
Feature MAC Address IP Address
Full Form Media Access Control Internet Protocol
Type Physical / Hardware Address Logical / Software Address
Length 48 bits (6 bytes) IPv4: 32 bits, IPv6: 128 bits
Assigned By Manufacturer (permanent) Network Admin or DHCP (can
change)
Layer Data Link Layer (Layer 2) Network Layer (Layer 3)
Scope Local Network only Global (used across internet)
Format Hexadecimal (AA:BB:CC:DD:EE:FF) Decimal ([Link]) or Hex (IPv6)
Can Change? No (fixed by hardware) Yes (dynamic via DHCP)
Q9. Sliding Protocol? Compare Go-Back-N and Selective Repeat.
Sliding Window Protocol is a method used in data communication to control the flow of data between a sender
and receiver. Instead of waiting for an acknowledgement (ACK) after every single frame, the sender can send
multiple frames at once — up to a set limit called the window size.
•​ It improves efficiency by keeping the communication channel busy.
•​ It avoids wasting time waiting for ACKs for every single packet.
•​ It handles errors by allowing retransmission of lost or damaged frames.
How it Works:
1. The sender has a window — it can send W frames without waiting for ACK.
2. When ACK for the first frame arrives, the window slides forward by one.
3. New frames can now be sent as the window moves ahead.
4. If a frame is lost or damaged, it is retransmitted.
Feature Go-Back-N (GBN) Selective Repeat (SR)
Window Size Up to 2^n - 1 Up to 2^(n-1)
On Error Retransmit error frame + ALL frames after it Retransmit only the error frame
Receiver Buffer No buffer needed (discards bad frames) Buffer required to store
out-of-order frames
Efficiency Lower (wastes bandwidth) Higher (less retransmission)
Complexity Simple More complex
Example Use Simple, low-error links High-speed, error-prone links
Q10. Explain Go-Back-N Protocol in detail.
Go-Back-N is a type of Sliding Window Protocol where the sender can send multiple frames without waiting for
ACKs. However, if one frame is lost or has an error, the sender must go back and retransmit that frame AND all
the frames that came after it.
•​ Sender window size = up to 2^n - 1 (where n = number of bits in sequence number).
•​ Receiver window size = 1 (it only accepts frames in order).
•​ If a frame is damaged, the receiver sends a Negative ACK (NAK).
•​ Sender retransmits the damaged frame and all subsequent frames.
Working Example: Suppose window size = 4 and frames 0,1,2,3 are sent.
If frame 1 is lost — sender must retransmit frame 1, 2, and 3 (go back to frame 1).
Even though frames 2 and 3 arrived correctly, they are discarded and resent.
Advantages: Simple to implement; Receiver does not need a large buffer.
Disadvantages:
•​ Wastes bandwidth — retransmits frames that were already received correctly.
•​ Less efficient when errors are frequent.
Q11. CSMA protocols. Explain how collisions are handled in CSMA/CA and CSMA/CD.
CSMA stands for Carrier Sense Multiple Access. It is a media access control protocol used in networks where
multiple devices share the same communication channel. Before sending data, a device first listens (senses) to
check if the channel is free or busy.
Types of CSMA:
1-Persistent CSMA — If the channel is busy, keep listening. As soon as it is free, send it immediately. High
chance of collision.
Non-Persistent CSMA — If busy, wait a random time and check again. Less collision but wastes the channel.
p-Persistent CSMA — If free, send with probability p or wait with probability (1-p).
CSMA/CD — Collision Detection (Used in Wired Ethernet):
CSMA/CD = Carrier Sense Multiple Access with Collision Detection
•​ The device listens to the channel before sending.
•​ If the channel is free, it sends the data.
•​ While sending, it also monitors the channel.
•​ If a collision is detected (two devices sent at the same time), both STOP sending.
•​ Both send a jam signal to inform all devices about the collision.
•​ Each device waits a random time (Binary Exponential Backoff) and tries again.
CSMA/CA — Collision Avoidance (Used in Wireless — WiFi):
CSMA/CA = Carrier Sense Multiple Access with Collision Avoidance
Why not CSMA/CD in wireless? Because detecting collisions is difficult in wireless networks — a device cannot
send and listen at the same time effectively.
•​ Device checks if the channel is free.
•​ If free, it waits for a short time called DIFS (Distributed Inter-Frame Space).
•​ Then it sends an RTS (Request to Send) message to the receiver.
•​ Receiver replies with CTS (Clear to Send) if channel is available.
•​ All other devices hear the CTS and stay silent (this avoids collision).
•​ Sender sends the data, receiver sends ACK after receiving.
Feature CSMA/CD CSMA/CA
Full Form Collision Detection Collision Avoidance
Used In Wired Networks (Ethernet) Wireless Networks (WiFi / 802.11)
Collision Handling Detect and retransmit Avoid before it happens
Method Listen while sending RTS/CTS handshake before sending
Efficiency Good for wired links Better for wireless (less collision)
Standard IEEE 802.3 IEEE 802.11
Q12. What is Controlled Media Access? Explain Reservation, Polling, and Token Passing.
What is Controlled Media Access?
Controlled Media Access (also called Controlled Access) is a method where access to the shared communication
channel is controlled or managed. Only one device is allowed to transmit at a time, and this is decided in an
organized way to avoid collisions.
There are three main techniques:
1. Reservation:
In this method, time is divided into slots. A device must first reserve a slot before it can send data. All devices
announce their need to transmit during a reservation period. Then data is sent in the reserved slots.
•​ No collisions because slots are pre-booked.
•​ Wastes time if a device reserves a slot but has no data.
2. Polling:
There is a Primary device (controller) and many Secondary devices. The primary device polls (asks) each
secondary device one by one: 'Do you have data to send?' If yes, the secondary sends. If no, the primary moves
to the next device.
•​ Works well in master-slave networks.
•​ No collision at all.
•​ Disadvantage — If primary fails, the whole network stops.
•​ Also wastes time polling idle devices.
3. Token Passing:
A special control message called a Token is passed around the network in a ring. Only the device that holds the
token is allowed to send data. After sending, it passes the token to the next device.
•​ Used in Token Ring networks (IEEE 802.4 / 802.5).
•​ Completely fair — every device gets an equal turn.
•​ No collisions because only one device sends at a time.
•​ Disadvantage — If a device fails and keeps the token, the whole network stops.
Feature Reservation Polling Token Passing
Control Method Time slot reservation Primary asks devices Token circulates
Collision None None None
Fairness Based on reservation Depends on polling Very fair (equal turns)
order
Failure Risk Low Primary device failure Token loss
Efficiency Good with heavy load Good for few devices Good for ring networks

Q13. Draw the UDP Header with its fields


UDP (User Datagram Protocol) is a simple, fast, connectionless protocol. Its header has only 4 fields, each of 16
bits (2 bytes). Total header size = 8 bytes.
UDP Header Diagram:
Source Port (16 bits) Destination Port (16 bits) Length (16 bits) Checksum (16 bits)
Explanation of each field:
•​ Source Port (16 bits): The port number of the sender.
•​ Destination Port (16 bits): The port number of the receiver.
•​ Length (16 bits): Total length of UDP header + data (minimum 8 bytes).
•​ Checksum (16 bits): Used for error checking. Optional in IPv4, mandatory in IPv6.
Q14. Explain in detail TCP Timers
TCP uses four main timers to manage reliable data transmission:
1. Retransmission Timer
This timer starts when a segment is sent. If acknowledgement (ACK) is not received before the timer expires, the
segment is resent. The timeout value is calculated using RTT (Round Trip Time).
2. Persistence Timer
When the receiver sends a window size = 0 (buffer full), the sender stops. The persistence timer sends probe
segments to check if the window has reopened. This prevents deadlock.
3. Keepalive Timer
If a TCP connection is idle for a long time, the keepalive timer sends a probe to check if the other side is still
active. If no response comes after several probes, the connection is closed.
4. Time-Wait Timer (2MSL Timer)
After a connection is closed, this timer waits for 2 x MSL (Maximum Segment Lifetime) before fully terminating.
This ensures all delayed packets from the old connection have disappeared from the network.
Q15. Compare Connection-Oriented vs Connectionless Protocols
Connection-oriented protocols (like TCP) establish a connection before sending data. Connectionless protocols
(like UDP) send data without any prior setup.
Feature Connection-Oriented (TCP) Connectionless (UDP)

Connection Setup Required (3-way handshake) Not required


Reliability Reliable (ACK, retransmission) Unreliable (no ACK)
Speed Slower due to overhead Faster, less overhead
Error Control Yes No (optional checksum)
Ordering Data arrives in order May arrive out of order
Use Case File transfer, web (HTTP) Video streaming, DNS, VoIP
Q16. Explain in detail TCP Header with Diagram
TCP (Transmission Control Protocol) is a connection-oriented, reliable protocol. The TCP header is 20-60 bytes
long. Below is the header structure:
Source Port (16 bits) Destination Port (16 bits)
Sequence Number (32 bits)
Acknowledgement Number (32 bits)
Data Offset (4b) Reserved (6b) Control Bits (6b) Window Size (16b)
Checksum (16 bits) Urgent Pointer (16 bits)
Options (variable) Padding
Explanation of each field:
•​ Source Port (16 bits): Port number of the sender application.
•​ Destination Port (16 bits): Port number of the receiving application.
•​ Sequence Number (32 bits): Identifies the position of the first byte of data in the current segment. Helps in
ordering.
•​ Acknowledgement Number (32 bits): Contains the sequence number of the next byte the receiver
expects. Used for ACK mechanism.
•​ Data Offset / HLEN (4 bits): Specifies the length of the TCP header (in 32-bit words). Minimum value = 5
(20 bytes).
•​ Reserved (6 bits): Set to zero. Reserved for future use.
•​ Control Bits / Flags (6 bits): Includes URG, ACK, PSH, RST, SYN, FIN flags that control the connection
state.
•​ URG: Urgent pointer is valid.
•​ ACK: Acknowledgement Number field is valid.
•​ PSH: Push data to application immediately without buffering.
•​ RST: Reset the connection (error/abort).
•​ SYN: Synchronize sequence numbers (used in 3-way handshake).
•​ FIN: No more data from sender (used in connection termination).
•​ Window Size (16 bits): Number of bytes the receiver can accept. Used for flow control.
•​ Checksum (16 bits): Error detection over header and data.
•​ Urgent Pointer (16 bits): Used when the URG flag is set. Points to urgent data.
•​ Options (variable): Optional fields like Maximum Segment Size (MSS), timestamps.
•​ Padding: Extra zeros added to make the header a multiple of 32 bits.
Q17. Leaky Bucket Algorithm
The Leaky Bucket Algorithm is a traffic shaping and congestion control mechanism used in computer networks. It
dictates how data is transmitted into the network to ensure a steady, predictable flow, regardless of how erratically
the data is generated by the host.
How it Works: Imagine a bucket with a hole at the bottom.
1.​ Inflow (Bursty Traffic): Water (data packets) is poured into the bucket at a varying, unpredictable rate.
2.​ Outflow (Constant Traffic): Water leaks out of the hole at the bottom at a strictly constant rate.
3.​ Overflow (Packet Drop): If water is poured in faster than it can leak out, the bucket fills up. Once the
bucket is full to its capacity, any additional water spills over and is lost (data packets are
dropped/discarded by the network).
Key Features:
●​ Traffic Shaping: Converts bursty, uneven traffic into a smooth, uniform stream of data.
●​ Constant Output Rate: The network only ever sees a fixed rate of traffic, making it easier to allocate
bandwidth and prevent congestion.
Used in: ATM networks, traffic policing, and QoS (Quality of Service) systems.
Q18. RPC (Remote Procedure Call)
Remote Procedure Call (RPC) is a powerful protocol used in distributed systems. It allows a computer program to
cause a procedure (subroutine) to execute in another address space (commonly on another computer on a
shared network) without the programmer having to explicitly code the details for this network interaction.
How it Works: RPC makes a remote network call look and act exactly like a local function call.
1.​ Client Stub: The client program calls a local "stub" procedure. This stub acts as a proxy for the remote
function.
2.​ Marshalling: The client stub packs the function parameters into a standard message format (a process
called marshalling) and makes a system call to send the message across the network.
3.​ Server Stub (Skeleton): The remote server receives the message, and its server stub "unmarshals" the
parameters.
4.​ Execution: The server stub calls the actual server function with those parameters. The result is then
marshalled and sent back to the client in the same way.
Advantages:
●​ Abstraction: Hides the complex underlying network code (like sockets and TCP connections) from the
developer.
●​ Process Orientation: Promotes a structured, modular approach to building distributed client-server
applications.
Q19. SNMP (Simple Network Management Protocol)
SNMP is an Application Layer protocol (Layer 7) used extensively for network management. It provides a
standardized way for network administrators to monitor, configure, and manage network devices such as routers,
switches, servers, and printers from a central location.
1.​ SNMP Manager: The centralized software system (often called a Network Management Station or NMS)
that monitors the network.
2.​ SNMP Agent: A software module residing on the managed devices (routers, switches). It collects local
device information and reports it back to the Manager.
3.​ MIB (Management Information Base): A hierarchical, structured database shared between the Agent
and Manager. It defines the specific parameters (like CPU usage, port status, temperature) that can be
monitored or controlled.
How it Works (Key Messages):
●​ GET: The Manager requests specific information from an Agent (e.g., "What is the status of Port 1?").
●​ SET: The Manager sends a command to change a configuration on the Agent (e.g., "Disable Port 1").
●​ TRAP: An unsolicited alert sent by the Agent to the Manager to report an important event or error (e.g.,
"A link just went down!").
Used in: Network monitoring tools like Nagios, PRTG, Zabbix, Cisco Network Management.
Q20. Run Length Encoding (RLE) with Example
Run Length Encoding (RLE) is a simple, lossless data compression algorithm. It works by reducing the physical
size of a repeating string of characters (called a "run") into a single character and a count of how many times it
repeats.
How it Works:
Instead of storing every single pixel or character, the algorithm looks for consecutive identical values. It replaces
these sequences with a two-byte code:
●​ The number of repetitions (the run length).
●​ The character or pixel value itself.
Example for an Exam:
•​ Original Uncompressed Data: AAAAABBBCCCCCDDAA (17 characters)
•​ RLE Compressed Data: 5A3B5C2D2A (10 characters)
•​ Result: The file size is significantly reduced without losing any actual information.
Best Use Case:
RLE is highly effective for data with many consecutive repeating values, such as simple graphic images (like
black-and-white line art, faxes, or cartoon animations with large flat background colors). It is ineffective for
complex data like photographs or text with no repeating letters, where it can actually increase the file size (e.g.,
ABC becomes 1A1B1C).
Q21. Image Compression Techniques: GIF vs. JPEG
Image compression reduces the file size of digital graphics, making them faster to transmit over networks and
cheaper to store. The two most common web image formats, GIF and JPEG, use completely different
compression techniques.
1. GIF (Graphics Interchange Format)
●​ Compression Type: Lossless compression using the LZW (Lempel-Ziv-Welch) algorithm. No image data is
permanently discarded.
●​ Color Depth: Limited to 8-bit color, meaning a GIF can only display a maximum of 256 colors.
●​ Best Suited For: Simple graphics, logos, icons, line art, and images with large areas of flat, solid color.
●​ Special Features: Supports transparent backgrounds and frame-by-frame animation.
2. JPEG (Joint Photographic Experts Group)
●​ Compression Type: Lossy compression using DCT (Discrete Cosine Transform). It permanently discards
visual information that the human eye cannot easily detect (like subtle color variations).
●​ Color Depth: Supports 24-bit color, allowing for over 16 million colors.
●​ Best Suited For: Complex, real-world photographs, medical imaging, and graphics with smooth gradients
and continuous tones.
●​ Special Features: Allows the user to adjust the compression ratio—trading off image quality for a smaller
file size. It does not support transparency or animation.
Q22.a. SMTP (Simple Mail Transfer Protocol)
SMTP is an Application Layer protocol used for sending electronic mail over the internet.
●​ It is a "push" protocol. It pushes the email from the sender's email client (like Outlook or Gmail) to the
outgoing mail server.
●​ It also handles the routing and transfer of the email between different mail servers across the internet until
it reaches the destination server.
●​ Important Note: SMTP is only used for sending. To retrieve or pull emails from a server, protocols like
POP3 or IMAP are used.
●​ Standard Ports: Operates primarily on TCP Port 25 (unencrypted) or Port 587 (encrypted).
Q22.b FTP (File Transfer Protocol)
FTP is a standard network protocol used to transfer computer files between a client and a server on a computer
network.
How it Works: FTP requires two separate TCP connections to operate:
1.​ Control Connection (Port 21): Used to send commands (like logging in, listing directories, or changing
folders) and receive replies.
2.​ Data Connection (Port 20): Used exclusively to transfer the actual file data.​
Security: Standard FTP is inherently insecure because it transmits usernames, passwords, and data in
plain text. It has largely been replaced by secure alternatives like SFTP (SSH File Transfer Protocol).
Q23. HTTP (Hypertext Transfer Protocol)
HTTP is the foundational Application Layer protocol for data communication on the World Wide Web. It enables
the fetching of resources, such as HTML documents.
●​ It follows a classic Client-Server model. A client (web browser) sends an HTTP Request to a web server,
and the server returns an HTTP Response containing the requested web page.
●​ Stateless Protocol: HTTP is inherently stateless, meaning each request is executed independently, and the
server retains no memory of past requests from the same client (this is why we need "Cookies" to stay
logged into websites).
●​ Standard Port: TCP Port 80 (or Port 443 for its secure version, HTTPS).
Q24. DNS (Domain Name System)
DNS is often called the "phonebook of the internet." It is an Application Layer protocol that translates
human-readable domain names into machine-readable IP addresses.
●​ Computers and routers use numbers (IP addresses like [Link]) to locate each other on a network.
Humans use names (like [[Link]]([Link]
●​ When you type a URL into a browser, a DNS resolver queries a hierarchy of DNS servers to find the exact IP
address associated with that name. Once found, your browser can establish a connection with the server.
●​ Standard Port: Operates on UDP Port 53 for fast query resolution.
Q25. Compare Lossy with Lossless Data Compression Technique.
Data compression reduces file size to save storage and speed up transmission.
Feature Lossless Lossy
Data Loss? No — exact original recovered Yes — some data removed
File Size Moderate reduction Very high reduction
Quality 100% original quality Reduced quality
Used For Text, ZIP, PNG, medical MP3, JPEG, MP4, video
Example Algo Huffman, LZW, RLE DCT, MPEG, Wavelet
Reversible? Yes — losslessly decoded No — lost data is gone
Lossless:
•​ Original data is perfectly reconstructed after decompression. No data is lost.
•​ Algorithm removes statistical redundancy only.
•​ Example formats: GIF, PNG, BMP, TIFF
•​ Use: Medical images, text documents, legal records where accuracy is critical.
•​ Methods: Run-Length Encoding (RLE), Huffman Coding, LZW compression.
Lossy Techniques:
•​ Some data is permanently removed to achieve higher compression ratios.
•​ Human perception is exploited (removes data the eye/ear cannot easily detect).
•​ Example formats: JPEG, MPEG, MP3
•​ Use: Photographs, video streaming, audio where slight quality loss is acceptable.
Q26. Explain in detail Network Address Translation (NAT).
NAT is a technique used in routers to allow multiple devices in a private network to share one public IP address
when accessing the internet.
Why NAT is Needed:
• IPv4 has only ~4.3 billion addresses — not enough for all devices.
• NAT allows many private IPs (192.168.x.x) to use one public IP.
How NAT Works:
• Internal devices use private IPs (e.g., [Link]).
• When sending data out, the router replaces the private IP with its public IP.
• It keeps a NAT Translation Table to track which internal device made which request.
• When a reply comes back, the router uses the table to forward it to the correct device.
Types of NAT:
• Static NAT: One-to-one mapping. One private IP → one public IP.
• Dynamic NAT: Many private IPs share a pool of public IPs.
• PAT (Port Address Translation) / NAT Overload: Many devices share ONE public IP using different port
numbers. Most common type.
Q27. Draw and explain the IPv4 Header format with a diagram.
The IPv4 header contains all the control information needed to route and deliver a packet from source to
destination. It is at least 20 bytes long.
Version IHL TOS Total Length Identification Flags
4 bits 4 bits 8 bits 16 bits 16 bits 3 bits
Fragment TTL Protocol Header Source IP Dest IP
Offset Checksum
13 bits 8 bits 8 bits 16 bits 32 bits 32 bits
• Version (4 bits): IP version number. For IPv4, value = 4.
• IHL — Internet Header Length (4 bits): Number of 32-bit words in header. Min = 5 (20 bytes).
• TOS — Type of Service (8 bits): Specifies priority/quality of service (delay, throughput, reliability).
• Total Length (16 bits): Total size of packet (header + data) in bytes. Max = 65,535 bytes.
• Identification (16 bits): Unique ID for a packet; used to reassemble fragmented packets.
• Flags (3 bits): Controls fragmentation. DF = Don't Fragment, MF = More Fragments.
• Fragment Offset (13 bits): Position of this fragment in the original packet.
• TTL: Time to Live (8 bits): Max number of hops (routers) before packet is discarded. Prevents infinite loops.
• Protocol (8 bits): Indicates upper-layer protocol. TCP = 6, UDP = 17, ICMP = 1.
• Header Checksum (16 bits): Error detection for the header only.
• Source IP Address (32 bits): Sender's IP address.
• Destination IP Address (32 bits): Receiver's IP address.
• Options (variable): Rarely used. Security, route recording, timestamps.
Q28. Explain in detail Classful and Classless IP addresses.
Classful IP Addressing:
In classful addressing, IP addresses are divided into fixed classes based on the value of the first octet. There is
no flexibility in network/host division.
C Range Networks Hosts/Net Default Mask Use
A 0-127.x.x.x 128 16,777,214 [Link] /8 Large ISPs
B 128-191.x.x.x 16,384 65,534 [Link] /16 Medium Org
C 192-223.x.x.x 2,097,152 254 [Link] /24 Small LAN
D 224-239.x.x.x — Multicast — Multicast
E 240-255.x.x.x — Reserved — Research
• Private IP ranges: Class A: 10.x.x.x | Class B: 172.16-31.x.x | Class C: 192.168.x.x
• Loopback: [Link] (used for testing — talks to itself).
Problems with Classful Addressing:
• Wasteful: Class A gives 16M hosts — no organization needs that many.
• IP address exhaustion — inefficient allocation.
Classless IP Addressing (CIDR):
CIDR — Classless Inter-Domain Routing — was introduced to solve the wastage problem. It removes fixed class
boundaries.
• Uses a prefix length (like /26) instead of default class masks.
• Format: IP_Address / Prefix_Length e.g., [Link]/26
• Prefix /26 means 26 bits are network, remaining 6 bits are host.
• Hosts per /26 subnet: 2^6 - 2 = 62 hosts.
• CIDR allows splitting a large block into subnets (subnetting) or combining small blocks (supernetting/route
aggregation).
Subnetting Example:
• IP: [Link]/24 — split into 4 subnets using /26.
• Subnet 1: [Link]/26 (hosts .1 to .62, broadcast .63)
• Subnet 2: [Link]/26 (hosts .65 to .126)
• Each subnet has 62 usable hosts.
Q29. Explain in detail Link State Routing.
Link State Routing is a dynamic routing algorithm where every router has complete knowledge of the entire
network topology. It uses Dijkstra's Shortest Path Algorithm to find the best routes.
Working of Link State Routing:
Step 1 Discover Neighbors: Each router finds its directly connected neighbors using HELLO packets.
Step 2 Measure Link Cost: Cost is measured (delay, bandwidth, congestion).
Step 3 Build LSP (Link State Packet): Router creates a packet with its ID, neighbors list, and link costs.
Step 4 Flood LSP: Every router broadcasts its LSP to all other routers (flooding).
Step 5 Build LSDB: Each router collects all LSPs → builds a Link State Database (full network map).
Step 6 Run Dijkstra: Each router runs Dijkstra's algorithm on LSDB to find the shortest path to every destination.
Step 7 Update Routing Table: Best paths go into the routing table.
Advantages:
• Faster convergence — each router has full topology.
• No routing loops — accurate path computation.
• Scales well in large networks.
Disadvantages:
• High memory and CPU usage — must store entire topology.
• Flooding causes high bandwidth usage when network changes.
Q30. Explain Distance Vector Routing with an example.
In Distance Vector Routing, each router only knows the cost to its direct neighbors. Routers share their routing
tables with neighbors periodically. Based on received tables, each router updates its own table using
Bellman-Ford Algorithm.
Working Steps:
• Step 1: Each router starts with only its directly connected routes.
• Step 2: Periodically sends its routing table to all neighbors.
• Step 3: On receiving a neighbor's table, updates own table if a shorter path is found.
• Step 4: This continues until no more updates happen (convergence).
Simple Example — 3 Routers: A – B – C
• A–B cost = 1, B–C cost = 2, A–C via B = 3.
• Initially: A knows only A→B (cost 1). B knows B→A (1) and B→C (2). C knows only C→B (2).
• After exchange: A learns A→C via B = 1+2 = 3. C learns C→A via B = 2+1 = 3.
Advantages:
• Simple to implement, low CPU usage.
• Good for small networks.
Disadvantages:
• Slow convergence — Count to Infinity problem.
• Routing loops can occur.
• Split Horizon and Poison Reverse are used to fix loop issues.
Q31. Difference between Static and Dynamic Routing.
Static Routing:
• Routes are manually entered by a network administrator.
• Does not change automatically when network topology changes.
• Suitable for small, stable networks.
• Advantages: Simple, secure, low overhead, predictable.
• Disadvantages: Not scalable, manual updates required when link fails.
Dynamic Routing:
• Routers automatically discover and update routes using routing protocols.
• Adapts automatically when network topology changes (link failure, new router).
• Suitable for large, changing networks.
• Advantages: Self-adaptive, scalable, fault-tolerant.
• Disadvantages: More CPU/memory usage, complex configuration.
Feature Static Routing Dynamic Routing
Configuration Manual Automatic (protocol)
Updates Admin changes manually Auto-updates on change
Scalability Poor (small networks) Good (large networks)
Overhead Low Higher (protocol traffic)
Fault Tolerance No auto failover Auto re-routes on failure
Example ip route command RIP, OSPF, EIGRP
Q32. What is Routing? Explain any Interior Routing Protocol (RIP / OSPF).
What is Routing?
Routing is the process of selecting the best path for data packets to travel from source to destination across a
network. It is performed by routers.
• Routers use Routing Tables to decide where to forward packets.
• Interior Gateway Protocols (IGP) are used within one organization (AS — Autonomous System).
• Exterior Gateway Protocols (EGP) like BGP are used between organizations.
RIP — Routing Information Protocol:
RIP is a classic, Distance-Vector Interior Gateway Protocol (IGP) used for routing data within small to
medium-sized networks (Autonomous Systems). It is one of the oldest routing protocols still in use today.
How it Works: Unlike OSPF, which looks at link speed, RIP relies solely on "hop count" as its routing metric. A
"hop" is a router that a packet must pass through. RIP routers periodically broadcast their entire routing table to
their directly connected neighbors (typically every 30 seconds) to keep network maps updated.
Key Features:
●​ Metric (Hop Count): RIP always chooses the path with the fewest number of routers (hops) between the
source and destination, completely ignoring bandwidth or link speed.
●​ Maximum Hop Limit: To prevent data packets from looping endlessly in the network, RIP has a strict
limit of 15 hops. If a destination is 16 hops away, RIP considers it "infinity" (unreachable).
●​ Versions:
○​ RIPv1: Legacy version; supports only classful routing (does not send subnet masks).
○​ RIPv2: Improved version; supports Variable Length Subnet Masking (VLSM/CIDR), multicast
updates, and security authentication.
Advantages: Simplicity; Low Overhead
Q33 VPN (Virtual Private Network)
A VPN is a technology that establishes a secure, encrypted connection (a "tunnel") over a less secure public
network, such as the Internet. It ensures that data transmitted between the user and the network remains private
and untampered.
How it Works: It relies on two main mechanisms: Tunneling (encapsulating the data packet inside another
packet for transit) and Encryption (scrambling the data so it is unreadable to anyone who intercepts it). Common
protocols include IPsec, OpenVPN, and L2TP.
Types of VPNs:
Remote-Access VPN: Connects individual users securely to a corporate network from outside (e.g., an employee
working from home).
Site-to-Site VPN: Connects entire networks to each other (e.g., a branch office connecting to the main
headquarters).
Advantages: Confidentiality & Data Integrity; Bypassing Geo-Restrictions; Secure Remote Work
Q34. Short Note: OSPF (Open Shortest Path First)
OSPF is a widely used Interior Gateway Protocol (IGP) designed to route Internet Protocol (IP) packets within a
single Autonomous System (AS). It is a Link-State routing protocol, meaning routers exchange information about
their link states to build a complete topological map of the network.
How it Works: OSPF routers send Link-State Advertisements (LSAs) to all other OSPF routers. Using this
gathered information, every router applies Dijkstra’s Shortest Path First (SPF) algorithm to calculate the most
efficient, loop-free path to every destination network.
Key Features:
●​ Hierarchical Design (Areas): OSPF divides a large network into smaller logical groupings called "Areas"
to reduce routing traffic and memory overhead. All areas must connect to Area 0 (The Backbone Area).
●​ Metric: Uses "Cost" as its routing metric, which is inversely proportional to the bandwidth of the link
(higher bandwidth = lower cost = preferred path).
Advantages: Fast Convergence; High Scalability; VLSM Support
Q35. Short Note: VLAN (Virtual Local Area Network)
A VLAN is a custom network created from one or more existing physical local area networks. It allows a group of
devices to communicate as if they were attached to the same broadcast domain, regardless of their actual
physical location.
How it Works: Instead of physically moving cables to group devices, network administrators use programmable
switches to logically group devices at Layer 2 (Data Link Layer) of the OSI model. Devices in different VLANs
cannot communicate with each other directly without a router (Inter-VLAN routing).
Key Features:
●​ Broadcast Control: Divides a single large physical network into multiple logical broadcast domains,
reducing unnecessary network traffic.
●​ Frame Tagging: Uses protocols like IEEE 802.1Q to insert a tag into Ethernet frames to identify which
VLAN the packet belongs to.
Advantages: Enhanced Security; Cost Effective; Simplified Management:

You might also like