COMPUTER NETWORK
Q1. State and explain design issues of OSI model CHP 1
The OSI (Open Systems Interconnection) Model is a reference model for how data should flow in a
network from one device to another. While designing it, some general issues were considered at
every layer of the model. These are called design issues.
1. Reliability
• The system should make sure that the message sent is the same as the message received.
• Example: If you send "HELLO", the receiver should not get "HELO".
2. Multiplexing and Demultiplexing
• Multiple applications should share the same communication channel.
• Multiplexing: Combining multiple signals into one channel.
• Demultiplexing: Separating them back at the receiver.
3. Transparency
• The communication should appear seamless to the user or application.
• Types:
o Access Transparency: User doesn’t need to know how the network works.
o Location Transparency: Sender/receiver can be anywhere, but still communicate.
o Error Transparency: Errors should be hidden by the network.
4. Addressing
• Each device/process in the network must have a unique identity.
• Levels of addressing:
o Physical (MAC address)
o Logical (IP address)
o Port/Service (like HTTP port 80, FTP port 21)
5. Error Control
• Detecting and correcting errors during transmission.
• Techniques used: Checksum, CRC, Acknowledgment, Retransmission.
6. Flow Control
• Prevents sender from overwhelming the receiver with too much data.
• Techniques used: Stop-and-wait, Sliding window.
7. Sequencing (Ordering of Messages)
• Data should be delivered in the same order it was sent.
• Why: Network can reorder packets due to different paths.
Q2. Compare the performance characteristics of coaxial, twisted pair and fiber optic transmission
media. CHP 2
Feature Twisted Pair Coaxial Cable Fiber Optic
Bandwidth Up to 10 Gbps (Cat 7) Few hundred Mbps Tbps (very high)
Tens of km (40+ km without
Distance ~100 m (without repeater) Few km (1–5 km typical)
repeater)
Noise Low (affected by EMI, Medium (shield reduces
Very High (immune to EMI)
Resistance crosstalk) noise)
Installation
Very low (cheapest) Moderate High (expensive & delicate)
Cost
Difficult (fragile, needs
Maintenance Easy Moderate
expertise)
Low (can be tapped
Security Medium High (hard to tap unnoticed)
easily)
Cable TV, legacy Internet backbone, long-
Use Cases LAN, telephony
Ethernet distance
Q3. List the types of Error Detection and Correction techniques with the help of example CHP 3
Error Detection and Correction Techniques
When data is transmitted over a network, it may get corrupted due to noise or interference.
• Error Detection → Identifies if there is an error.
• Error Correction → Identifies where the error is and fixes it.
1. Error Detection Techniques
(a) Parity Bit
• Idea: Add an extra bit i.e parity to make the total number of 1’s either even (even parity) or odd
(odd parity).
• Example:
Data = 1010001 → Number of 1s = 3 (odd).
For even parity, add 1 → 10100011.
If receiver counts an odd number of 1s, error is detected.
• Limitation: Can detect single-bit errors, but not multiple-bit errors.
(b) Checksum
• Idea: Break data into blocks, sum them up, and send the sum (checksum) along with data.
• Example:
Data blocks: 1001, 1101
Sum = 10110
Send checksum = 0110.
Receiver adds blocks + checksum; if result = all 1’s → no error.
(c) Cyclic Redundancy Check (CRC)
• Idea: Treat data as a binary number and divide by a fixed polynomial. Append the remainder to
data. Receiver divides again to check.
• Example:
Data = 1011, Generator = 1101.
Remainder = 011.
Transmitted = 1011011.
If remainder at receiver ≠ 0 → error detected.
• Very powerful, detects burst errors.
(d) Hamming Code (used also for correction)
• Idea: Adds redundant bits at positions that are powers of 2 (1,2,4,8…) to detect and correct
single-bit errors.
• Example:
Data = 1011 → Add parity bits → Transmit 1011011.
Receiver uses parity checks to find the exact bit position in error.
2. Error Correction Techniques
(a) Automatic Repeat Request (ARQ)
• If error detected → receiver asks sender to retransmit.
• Types:
o Stop-and-Wait ARQ
o Go-Back-N ARQ
o Selective Repeat ARQ
(b) Forward Error Correction (FEC)
• In this, we add enough redundancy so receiver can correct errors without retransmission.
• Techniques:
o Hamming Code → Corrects single-bit errors.
o Reed-Solomon Code → Used in CDs, DVDs, satellite links.
o Convolutional Codes → Used in wireless/mobile communication.
Q4. Explain ISO-OSI reference model with diagram. CHP 1
International Organization for Standardization – Open Systems Interconnection.
It is a conceptual model that standardizes how data moves from one computer to another across a
network. It has 7 layers, and each layer has a specific function.
Layer 1: Physical Layer
It is responsible for the actual physical connection between the devices and communicates in the
form of bits. While receiving data, this layer will get the signal received and convert it into 0s and 1s
and send them to the Data Link layer, which will put the frame back together. Common physical layer
devices are Hub, Repeater, Modem, and Cables.
Layer 2: Data Link Layer (DLL)
The data link layer is responsible for the node-to-node delivery of the message. The main function of
this layer is to make sure data transfer is error-free from one node to another, over the physical layer
using its MAC address. Packet in the Data Link layer is referred to as Frame. Switches and Bridges are
common Data Link Layer devices.
The Data Link Layer is divided into two sublayers:
• Logical Link Control (LLC)
• Media Access Control (MAC)
Layer 3: Network Layer
The network layer works for the transmission of data from one host to the other located in different
networks. It also takes care of packet routing i.e. selection of the shortest path to transmit the packet,
from the number of routes available. The sender and receiver's IP address are placed in the header by
the network layer. Segment in the Network layer is referred to as Packet. Network layer is implemented
by networking devices such as routers and switches.
Layer 4: Transport Layer
The transport layer provides services to the application layer and takes services from the network
layer. The data in the transport layer is referred to as Segments. It is responsible for the end-to-end
delivery of the complete message. The transport layer also provides the acknowledgment of the
successful data transmission and re-transmits the data if an error is found. Protocols used in
Transport Layer are TCP, UDP NetBIOS, PPTP.
Layer 5: Session Layer
Session Layer in the OSI Model is responsible for the establishment of connections, management of
connections, terminations of sessions between two devices. It also provides authentication and
security. Protocols used in the Session Layer are NetBIOS, PPTP.
Layer 6: Presentation Layer
The presentation layer is also called the Translation layer. The data from the application layer is
extracted here and manipulated as per the required format to transmit over the network. Protocols
used in the Presentation Layer are TLS/[Link], MPEG, GIF, are formats used for encoding data.
Layer 7: Application Layer
At the very top , we find the Application layer which is implemented by the network applications.
These applications produce the data to be transferred over the network. This layer also serves as a
window for the application services to access the network and for displaying the received information
to the user. Protocols used in the Application layer are SMTP, FTP, DNS, etc.
Q5. List advantages of fiber optics as a communication medium CHP 1
High Bandwidth
• Much higher than copper cables (twisted pair/coaxial).
Long Distance Transmission
• Can transmit data for tens of kilometers without repeaters.
Immunity to Electromagnetic Interference (EMI)
• Uses light signals, not electricity → not affected by electrical noise.
• Suitable for industrial and high-voltage environments.
High Security
Provides better protection against hacking/eavesdropping.
Lightweight and Thin
• Much lighter and smaller in diameter than copper cables.
• Easy to install in bulk without taking much space.
High Reliability and Durability
• Resistant to environmental factors like temperature changes and moisture.
• Less prone to corrosion compared to copper.
Support for Higher Transmission Speeds
• Can easily handle gigabit and terabit networks.
• Backbone of the Internet, used in undersea cables and ISPs.
Safety
• Safe to use in explosive environments (like oil refineries).
Q6. What are sockets and its different types? CHP 1
• A socket is an endpoint for communication between two machines (processes) over a network.
• It allows a program (client/server) to send and receive data using standard protocols (TCP/IP).
• It is identified by a combination of: IP address + Port number
Types of Sockets
1. Stream Socket (TCP Socket)
• Uses TCP (Transmission Control Protocol).
• Connection-oriented → sender and receiver establish a connection before data transfer.
• Provides reliable, ordered, error-checked delivery.
• Example: Web browsing (HTTP/HTTPS), Email (SMTP), File Transfer (FTP).
2. Datagram Socket (UDP Socket)
• Uses UDP (User Datagram Protocol).
• Connectionless → no setup needed before sending data.
• Faster but unreliable (no guarantee of delivery or order).
• Example: Video streaming, Online gaming, VoIP calls.
3. Raw Socket
• Provides direct access to lower-level protocols like IP or ICMP.
• Used mainly by network administrators or tools (like ping, traceroute).
• Allows sending/receiving packets without TCP/UDP formatting.
• Example: Custom routing software, network testing tools.
4. Sequenced Packet Socket (less common)
• Provides sequenced, reliable delivery of packets (like stream sockets but message-oriented).
• Example: Some specialized OSI protocols.
Q7 Create 7-bit hamming code for the message bit 1110 with even parity. SOLVE CHP 2
Q8 What are three reasons for using layered protocols? What is two possible disadvantages of using layered
protocols? CHP 1
Reasons for Using Layered Protocols (Advantages)
1. Simplifies Design
o Big problem is divided into small tasks → each layer has a clear function.
2. Flexibility & Modularity
o One layer can be changed/updated without affecting others.
o Example: We can change Wi-Fi to Ethernet (Physical Layer) without touching applications.
3. Interoperability & Standardization
o Makes it possible for systems from different vendors to communicate (common standards).
Disadvantages of Layered Protocols
1. Overhead (Extra Work)
o Each layer adds its own header → increases data size and processing.
2. Slower Performance
o Passing data through many layers can make communication slower.
3. Not Always Optimal
o Strict layering may cause duplication of functions (e.g., error handling at multiple layers).
Q9 List two ways in which the OSI reference model and the TCP/IP reference model are the same. Now list
two ways in which they differ. CHP 1
Similarities between OSI & TCP/IP Models
1. Layered Architecture
o Both are layered models → each layer has a specific function.
2. Protocol Independence
o Both the models separate services, interfaces, and protocols, so the functions are
independent of implementation.
3. End-to-End Communication
o Both support communication between two devices across a network (sender → receiver).
Differences between OSI & TCP/IP Models
1. Number of Layers
o OSI: 7 layers (Application, Presentation, Session, Transport, Network, Data Link, Physical).
o TCP/IP: 4 layers (Application, Transport, Internet, Network Access).
2. Development Approach
o OSI: Developed first as a theoretical reference model → protocols came later.
o TCP/IP: Developed first with working protocols (TCP, IP) → model came later.
3. Application Layer Handling
o OSI: Has 3 separate layers (Application, Presentation, Session).
o TCP/IP: Combines them into one Application layer.
Q10 4-bit data bits with binary value 1010 is to be encoded using even parity Hamming code. What is the
binary value after encoding? CHP 2 SOLVE
Q11. Define guided transmission media? Illustrate with diagram the details for coaxial cable? State
any 5 comparative characteristics of coaxial cable with fiber optics and twisted pair cables. CHP 1
Guided Transmission Media
• Guided media are those communication channels where data signals are guided along a physical
path.
• Examples: Twisted Pair, Coaxial Cable, Fiber Optic Cable.
• Opposite: Unguided media (wireless) where signals travel freely (radio, microwave, satellite).
Coaxial Cable
A coaxial cable is a type of guided transmission medium that transmits electrical signals with high shielding
against interference.
1. Inner Conductor
o Solid or stranded copper wire.
o Carries the actual electrical signal (data).
2. Dielectric Insulator
o Surrounds the inner conductor.
o Maintains constant spacing between core and shield → ensures proper impedance (usually
50Ω or 75Ω).
3. Outer Conductor / Shield
o Made of braided copper or aluminum foil.
o Acts as a ground and protects signals from external electromagnetic interference (EMI).
4. Protective Jacket
o Outer plastic layer for mechanical protection.
Working Principle OPTIONAL
• Signal flows through the inner conductor, and the shield provides a reference ground.
• Because of this coaxial geometry (conductor + shield), signals are well confined inside → less
leakage and less noise pickup.
• This makes it more efficient than twisted pair, though not as advanced as fiber optics.
Advantages OPTIONAL
• Better shielding → less noise than twisted pair.
• Supports higher bandwidth and longer distances than twisted pair.
Disadvantages OPTIONAL
• Bulkier and more expensive than twisted pair.
• Difficult to install compared to twisted pair.
Comparative Characteristics
Characteristic Coaxial Cable Twisted Pair Fiber Optics
Bandwidth / Data Medium (up to few 100 Low (up to 100 Mbps – 1
Very High (Tbps possible)
Rate Mbps) Gbps for Cat 5e/6)
Poor (unless shielded – Excellent (immune to
Noise Immunity Good (shielded)
STP) EMI)
Cost Moderate Cheapest Expensive
Distance / Signal Medium (up to few km Very Long (tens of km
Short (100 m typical)
Attenuation with amplifiers) without repeaters)
Installation & Fragile, needs special
Rigid, harder to install Easy, flexible
Flexibility handling
Q12 Explain the concept of sliding protocol? Explain the selective repeat protocol and Go back N
with example? Compare the performance of Selective repeat & G0-back-N protocol CHP 3
• In networking, the sender and receiver use buffers (windows) to keep track of which frames are sent
and acknowledged.
• Instead of sending one frame at a time (like Stop-and-Wait), the sender can send multiple frames
before waiting for ACKs.
• This increases efficiency and throughput.
Two main sliding window protocols:
1. Go-Back-N ARQ
2. Selective Repeat ARQ
SELECTIVE REPEAT PROTOCOL
• In Selective Repeat, only the erroneous or lost frame is retransmitted, not the whole block.
• The receiver stores (buffers) out-of-order frames until the missing frame arrives.
GO BACK N protocol
It is a sliding window protocol used for reliable data transfer.
• The sender can send multiple frames (up to N frames = window size) before needing an
acknowledgment (ACK).
• The receiver, however, can only accept frames in order (no out-of-order storage).
• If an error or lost frame occurs → the receiver discards that frame and all following frames, asking
the sender to “go back” and retransmit from the erroneous one.
Here NAK means Negative Acknowledgment which is sent by the receiver when a frame is lost or
corrupted.
Feature Go-Back-N ARQ Selective Repeat ARQ
If 1 frame is lost, all frames after it must
Error Handling Only the lost/erroneous frame is retransmitted.
be retransmitted.
Receiver Receiver keeps only 1 frame at a time (no Receiver buffers multiple out-of-order frames
Buffering out-of-order acceptance). until missing frame arrives.
Wastes bandwidth in case of errors (many More efficient, saves bandwidth by
Efficiency
frames resent). retransmitting only lost frames.
More complex (needs extra buffering, frame
Complexity Simple to implement.
reordering).
Best Use Case Good for channels with low error rate. Better for channels with higher error rate.
Q13 Difference between connection oriented and connectionless communication CHP 1
Q14 What is Channel Allocation Problem? CHP 3
When many users (computers, phones, devices) want to communicate over a shared communication
medium (like a network channel, Wi-Fi, or satellite link), we need a way to divide and manage the channel
fairly and efficiently. This is called the Channel Allocation Problem.
• If two users send at the same time, signals collide → data is lost.
• If one user occupies the channel too long, others must wait → unfair.
• The channel may be wasted if not used properly.
So, we need proper allocation methods.
Two Types of Channel Allocation
1. Static Channel Allocation
o Channel is divided in advance (like slicing).
o Example:
▪ FDMA (Frequency Division Multiple Access): Each user gets a fixed frequency
band.
• TDMA (Time Division Multiple Access): Each user gets a fixed time slot.
o Simple, no collisions.
o Wastes bandwidth if some users are idle.
2. Dynamic Channel Allocation optional
o Channel is allocated on demand.
o Example: ALOHA, CSMA/CD (Ethernet), CSMA/CA (Wi-Fi).
o More efficient use of bandwidth.
o Collisions can occur → need retransmission.
OPTIONAL
Q15 Explain twisted pair and fiber optics
1. Twisted Pair Cable
• Structure:
o Consists of two insulated copper wires twisted around each other.
o Twisting reduces electromagnetic interference (EMI) and crosstalk from nearby pairs.
• Types:
1. Unshielded Twisted Pair (UTP) → widely used in LAN, telephone lines.
2. Shielded Twisted Pair (STP) → extra metallic shielding for protection.
• Characteristics:
o Distance: Reliable up to ~100 meters (for Ethernet).
o Cost: Cheap, easy to install.
o Use: LAN, telephony, DSL.
Example in use: Your home Ethernet cable (Cat5e, Cat6) = twisted pair.
2. Fiber Optic Cable
• Structure:
o A glass or plastic core that carries light.
o Surrounded by cladding (reflects light back inside using total internal reflection).
o Protected by buffer coating and outer jacket.
• Working Principle:
o Transmits data as light pulses generated by LED or laser.
o Light is guided inside the core due to total internal reflection.
• Types:
1. Single-mode fiber (small core, long distance, up to 100 km, used in WAN/backbone).
2. Multi-mode fiber (larger core, shorter distance, used in LAN, data centers).
• Characteristics:
o Cost: More expensive to install, but cheaper per bit over long distance.
o Use: Internet backbone, long-distance communication, high-speed networks.
Example in use: Internet undersea cables = fiber optics.
Q16 Explain networking devices
1. Hub
• Layer: Physical layer device.
• Function: Just a multiport repeater.
• It receives a signal from one port and broadcasts it to all other ports, without any intelligence.
• Disadvantage: Causes collisions, no traffic management.
• Use: Rarely used today (replaced by switches).
Example: Old LAN networks used hubs to connect computers.
2. Switch
• Layer: Data Link layer (Layer 2).
• Function: More intelligent than a hub.
• Uses MAC address table to forward frames only to the destination port, not to all.
• Reduces collisions, increases efficiency.
• Types:
o Managed switch (configurable)
o Unmanaged switch (plug-and-play)
Example: Modern Ethernet LAN uses switches.
3. Router
• Layer: Network Layer (Layer 3).
• Function: Connects different networks (LAN to WAN, LAN to Internet).
• Uses IP addresses to forward packets.
• Can perform routing algorithms, NAT, DHCP, firewall functions.
Example: The Wi-Fi router in your home connects your LAN to the Internet.
4. Repeater
• Layer: Physical Layer.
• Function: Used to regenerate/amplify signals over long distances to prevent signal loss.
• Does not filter or manage traffic, only extends the signal range.
Example: Fiber optic repeaters are used in undersea cables.
5. Modem (MOdulator-DEModulator)
• Function: Converts digital signals (from computer) into analog signals (for telephone lines) and vice
versa.
• Used to connect computers to the Internet over telephone lines (DSL, dial-up).
Example: Your home DSL/cable Internet connection uses a modem.
6. Gateway
• Layer: Works on all 7 OSI layers, depending on implementation.
• Function: Acts as a translator between two networks that use different protocols (e.g., IP ↔ X.25,
IPv4 ↔ IPv6).
• Can perform protocol conversion, data translation, encryption, etc.
Q17 Explain different network topology
1. Bus Topology
• Structure: All devices are connected to a single central cable (called backbone).
• Data travels along the cable, and all devices receive it, but only the intended device accepts it.
• Advantages: Easy to install, cheap.
• Disadvantages: If backbone fails, whole network fails; collisions happen.
• Example: Early Ethernet networks.
2. Star Topology
• Structure: All devices are connected to a central hub/switch.
• Data goes from one device → hub → destination device.
• Advantages: Easy to manage, failure of one device doesn’t affect others.
• Disadvantages: If central hub fails, whole network fails.
• Example: Most modern LANs use star topology.
3. Ring Topology
• Structure: Devices are connected in a circular loop. Each device has two neighbors.
• Data travels in one direction (unidirectional ring) or both directions (dual ring).
• Advantages: Easy fault isolation, predictable data path.
• Disadvantages: Failure of one device can break the loop (unless dual ring).
• Example: Token Ring networks (older).
4. Mesh Topology
• Structure: Each device is connected to every other device (full mesh) or some devices (partial
mesh).
• Advantages: Very reliable (multiple paths for data), no single point of failure.
• Disadvantages: Very expensive, complex cabling.
• Example: WANs, backbone networks, Internet backbone routers.
5. Tree (or Hierarchical) Topology
• Structure: Combination of star + bus. Groups of star topologies connected to a main backbone.
• Advantages: Scalable, easy fault isolation.
• Disadvantages: Backbone failure affects whole system.
• Example: Corporate networks with departments connected to central backbone.
6. Hybrid Topology
• Structure: Combination of two or more topologies (e.g., star + ring, star + mesh).
• Advantages: Flexible, can be designed as per requirements.
• Disadvantages: Expensive, complex design.
• Example: Large organizations and data centers.
Q18. Explain TCP/IP model
TCP/IP Reference Model
• TCP/IP = Transmission Control Protocol / Internet Protocol
• It is the most widely used networking model (basis of the Internet).
• Developed by DARPA (Defense Advanced Research Projects Agency) in the 1970s.
• It defines how data should be packaged, addressed, transmitted, routed, and received across
networks.
Layers of TCP/IP Model (4 Layers)
1. Application Layer
• Provides network services to the user.
• Protocols: HTTP, FTP, SMTP, DNS, Telnet, SSH, SNMP, POP3
• Example:
o When you browse a website, HTTP/HTTPS runs in this layer.
o When you send email, SMTP/POP3 is used here.
2. Transport Layer
• Ensures reliable (or unreliable) delivery of data between applications.
• Protocols:
o TCP (Transmission Control Protocol) → reliable, connection-oriented (acknowledgements,
retransmission).
o UDP (User Datagram Protocol) → fast, connectionless, no guarantee of delivery.
• Example:
o Video streaming uses UDP (speed > reliability).
o File transfer uses TCP (accuracy > speed).
3. Internet Layer
• Responsible for addressing, routing, and delivering packets across networks.
• Protocols:
o IP (Internet Protocol) – addressing & routing.
o ICMP (Internet Control Message Protocol) – error reporting (e.g., ping).
o ARP (Address Resolution Protocol) – maps IP ↔ MAC.
• Example:
o If your computer sends a packet to [Link], the IP address of Google’s server is used
here.
4. Network Access (or Link) Layer
• Deals with physical transmission of data over the network (hardware-level).
• Includes protocols like Ethernet, Wi-Fi, PPP, Frame Relay.
• Example:
o Your computer uses Ethernet cable or Wi-Fi to physically send the bits.
Q19. What are protocol hierarchies
• A protocol hierarchy means organizing communication functions into layers, where each layer has
specific responsibilities.
• Each layer uses the services of the layer below and provides services to the layer above.
• The set of rules (protocols) at each layer defines how communication happens.
Example: OSI Model Protocol Hierarchy
Imagine you send a message "Hello" from one computer to another:
1. Application Layer – Creates the message (HTTP, SMTP, etc.).
2. Presentation Layer – Translates/encodes message (ASCII, encryption).
3. Session Layer – Maintains connection (dialog control).
4. Transport Layer – Ensures reliability (TCP/UDP, error correction).
5. Network Layer – Adds logical addressing & routing (IP).
6. Data Link Layer – Adds physical (MAC) address, error detection (Ethernet/Wi-Fi).
7. Physical Layer – Sends raw bits over cable or wireless.
Q20 What are elementary data link protocols
These are the basic (elementary) protocols used in the data link layer to handle error-free and orderly
delivery of frames between two directly connected nodes.
They help solve problems like:
• Lost frames
• Damaged frames
• Duplicate frames
• Flow control (sender too fast, receiver too slow)
1 Stop-and-Wait Protocol
• Sender sends one frame → waits for acknowledgment (ACK).
• Receiver processes the frame and sends back an ACK.
• Only then the sender transmits the next frame.
• Ensures order but low efficiency (because sender is idle while waiting).
• Problem if ACK or frame is lost.
2 Sliding Window Protocols
Sender can send multiple frames at once (instead of waiting after each one).
Receiver acknowledges received frames.
Types:
1. Go-Back-N ARQ
o Sender can send N frames before needing an ACK.
o If a frame is lost, all subsequent frames are retransmitted (“go back” to that frame).
o More efficient than Stop-and-Wait but still wasteful.
2. Selective Repeat ARQ
o Sender retransmits only the erroneous/lost frame, not the whole batch.
o Receiver must buffer out-of-order frames.
o Most efficient but more complex.