Computer Networks - 8
Computer Networks - 8
The TCP/IP Model is a 4-layer conceptual framework used to understand how data travels over
a network. It stands for Transmission Control Protocol/Internet Protocol.
4. Network Access Layer: Converts it into frames and bits for transmission.
At the receiver's end, each layer removes its corresponding header and passes the data up to
the next layer.
Only the receiver knowing the hopping pattern can correctly reassemble the message.
Advantages:
Robustness: Even if some frequencies are jammed, others still carry data.
Used In:
Bluetooth
Military communication
Cordless phones
2. Coaxial Cable:
1. Radio Waves:
o Long-distance, omnidirectional.
2. Microwaves:
o Line-of-sight communication.
3. Infrared:
IEEE 802.11 is a set of standards developed by the IEEE for wireless LAN (WLAN)
communication. It defines how wireless devices communicate over short distances using radio
waves.
Frequency
Standard Max Speed Range Notes
Band
802.11 2.4 GHz 2 Mbps ~20 meters First version, now obsolete
802.11a 5 GHz 54 Mbps ~35 meters Less interference, not widely adopted
~100
802.11g 2.4 GHz 54 Mbps Backward compatible with 802.11b
meters
Key Features:
5. What is Error Control? Explain any one error detection technique with example.
Error Control:
Error control refers to the process of detecting and correcting errors during data transmission
to ensure data integrity.
Error Detection
Error Correction
Parity bit is an extra bit added to data to make the number of 1s either even (even parity) or
odd (odd parity).
✅ Advantages:
❌ Limitations:
Can’t detect errors if two bits are flipped (even number of errors).
Use Case Used in dial-up, DSL, PPPoE Used in leased lines, WAN links
Flow Control:
Flow control is a technique used in data communication to control the rate of data
transmission between sender and receiver. It ensures that the sender does not overwhelm the
receiver with too much data at once.
Working:
1. Sender sends one frame and waits for an acknowledgment (ACK) from the receiver.
4. If ACK is not received within a time limit, the sender resends the frame.
Advantages:
Simple to implement.
Disadvantages:
8. Explain How Hamming Code Can Be Used to Detect and Correct the Error with Example.
Hamming Code:
A forward error correction method that not only detects but also corrects single-bit errors.
1. Determine parity bit positions: Positions that are powers of 2 (1, 2, 4...)
2. Insert parity bits in positions 1, 2, and 4.
Position 1 2 3 4 5 6 7
Bit P1 P2 1 P4 0 1 1
If a bit flips during transmission (e.g., position 5 changes from 0 to 1), the receiver recalculates
parity and finds the error position = 5, then corrects it.
Conclusion:
Slotted ALOHA has almost double the efficiency of Pure ALOHA due to time slot
synchronization, making it more suitable for high-load networks.
11. Explain in Detail CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
CSMA/CD is a network access method used in Ethernet networks to manage how devices share
the same communication channel. It helps prevent data collisions by sensing the channel before
transmission.
Working of CSMA/CD:
1. Carrier Sense: Before sending data, a device listens to the channel to check if it's busy or
idle.
3. Collision Detection:
o While transmitting, the device listens for collisions (interference caused by two
devices transmitting at the same time).
o The device waits for a random amount of time before attempting to retransmit
the data (using exponential backoff).
Efficiency:
Frequency
5 GHz 2.4 GHz 2.4 GHz 2.4 & 5 GHz
Band
MIMO (Multiple
Modulation OFDM DSSS OFDM Input, Multiple
Output)
Summary:
802.11a: Works on 5 GHz for less interference but offers lower range and compatibility.
802.11g: Also operates on 2.4 GHz, provides better speeds than 802.11b, and is
backward compatible.
802.11n: Uses MIMO technology, operates on dual bands (2.4/5 GHz), and offers much
higher data rates and improved range.
13. Identify and Define the Primary Network Layer Services Provided to Upper Layers in the
OSI Model
The Network Layer (Layer 3) of the OSI model is responsible for routing, forwarding, and
addressing data packets across networks. It provides several essential services to the upper
layers:
1. Routing:
o Determines the best path for data to travel from the source to the destination.
2. Logical Addressing:
3. Packet Forwarding:
o The Network Layer forwards data packets based on logical addresses (IP
addresses).
o If a data packet is too large for the next network's maximum transmission unit
(MTU), the Network Layer divides it into smaller fragments.
o Provides basic error checking for data transmission (e.g., ICMP for error reporting
in IP networks).
14. Explain the Different Switching Techniques Used in Data Communication Networks
In data communication networks, switching refers to how data is routed through a network
from source to destination. There are three main types of switching techniques:
1. Circuit Switching:
Advantages:
Disadvantages:
2. Packet Switching:
Definition: Data is divided into small packets, each of which is sent independently
through the network. Each packet may take a different route to reach the destination,
where they are reassembled.
Advantages:
Disadvantages:
3. Message Switching:
Definition: Entire messages are routed through the network from sender to receiver. The
message is stored at intermediate nodes before being forwarded.
Example: Traditional telegraphy systems.
Advantages:
Disadvantages:
Routing protocols are essential in networking to determine the best path for data transmission
across different networks. They are categorized into interior gateway protocols (IGP) and
exterior gateway protocols (EGP). Below are the most common routing protocols:
Function: RIP uses hop count as the metric to determine the best route. It has a
maximum hop count of 15.
Function: OSPF uses the Dijkstra algorithm to find the shortest path. It is more scalable
and faster compared to RIP.
Features: OSPF supports hierarchical routing, faster convergence, and a more efficient
use of network resources.
Function: EIGRP uses bandwidth, delay, load, and reliability metrics for route selection.
Features: Faster convergence, support for multiple network types, and minimal
overhead compared to RIP.
Function: BGP is the protocol used for routing between autonomous systems (AS). It is
the protocol of choice for the internet's backbone.
Features: BGP supports policy-based routing, scalability, and can handle large networks.
Function: IS-IS is primarily used in large enterprise networks and service providers.
16. Explain IPv4 Addressing Scheme Which Include Hierarchical Addressing, Subnetting, and
Allocation of Address Blocks
IPv4 addresses are 32-bit addresses, written in dotted decimal notation (e.g., 192.168.1.1). The
address is divided into two parts:
1. Hierarchical Addressing:
IPv4 addresses are organized into a hierarchical structure with the following divisions:
Network Address: The first part of the address that identifies the network. This is used
to route packets to the correct network.
Subnet Address: A further division of the network address, used for partitioning
networks into smaller subnetworks (subnets).
Host Address: The last part of the address, identifying the specific host or device within
the network.
2. Subnetting:
Subnetting is the process of dividing a network into smaller subnetworks (subnets).
It involves borrowing bits from the host portion of the IP address to create more subnet
addresses.
Subnet Mask: A 32-bit mask used to determine which part of the IP address is the
network portion and which part is the host portion (e.g., 255.255.255.0).
Example of Subnetting:
o Number of Subnets: You can borrow bits from the host portion to create subnets.
Class A (1.0.0.0 to 127.0.0.0): Designed for large networks (16 million hosts).
The Transport Layer (Layer 4) in the OSI model is responsible for end-to-end communication
between devices. It provides the following key services:
Reassembly: At the destination, the transport layer reassembles these segments into the
original message for the application.
2. End-to-End Communication:
The transport layer ensures reliable communication between source and destination
devices over a network. This includes data flow control, error correction, and
sequencing.
4. Flow Control:
The transport layer uses flow control mechanisms to manage the rate at which data is
sent. This ensures that the sender does not overwhelm the receiver.
TCP uses mechanisms like the sliding window to control data flow.
The transport layer adds error checking and correction, ensuring reliable data delivery.
TCP ensures data integrity through checksums, and errors result in retransmission.
6. Multiplexing:
The transport layer can provide different levels of service to different types of traffic
(e.g., voice, video, data), ensuring that time-sensitive data is prioritized.
UDP (User Datagram Protocol): A connectionless protocol that provides faster but less
reliable communication, suitable for applications like video streaming.
Real-Time Transport Protocol (RTP) is used for delivering audio and video over networks, such
as the internet, in real-time applications like VoIP (Voice over IP), video conferencing, and
streaming media. RTP provides end-to-end delivery services for real-time data, ensuring the
timely delivery of multimedia content.
1. Timestamping:
o RTP adds timestamps to the packets to synchronize the playback of media at the
receiver’s end. This helps maintain the order and timing of the multimedia
stream.
2. Sequence Numbers:
o Each RTP packet contains a sequence number, allowing the receiver to detect lost
packets and reorder them if necessary.
o RTP identifies the format of the transmitted data using a payload type field,
which informs the receiver how to interpret the data (e.g., audio, video).
5. Delivery Monitoring:
RTP Header:
The RTP header includes essential information for the transmission of real-time data:
Sequence Number: Used to detect packet loss and for packet reordering.
SSRC (Synchronization Source Identifier): Identifies the source of the media stream.
RTCP (RTP Control Protocol) works alongside RTP to provide feedback on the quality of
the transmission, such as packet loss, jitter, and delay.
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the two main
transport layer protocols. They have different characteristics and are used for different types of
communication.
Flow Control Yes, uses sliding window mechanism No flow control mechanism
Transmission Slower due to connection establishment and Faster (no connection setup,
Speed reliability mechanisms fewer overheads)
Feature TCP UDP
Summary:
TCP: Ensures reliable, in-order delivery of data with flow control, error checking, and
congestion control. It is used when reliability is critical (e.g., web browsing, file transfer).
UDP: Faster but less reliable. Suitable for applications where speed is important and
occasional data loss is acceptable (e.g., video streaming, real-time communications).
TCP Congestion Control is a mechanism used to prevent network congestion and ensure that
TCP connections adjust their data sending rate according to the available network capacity. It is
essential for maintaining network performance and avoiding packet loss.
1. Slow Start:
o The sender starts with a small congestion window (typically one Maximum
Segment Size or MSS).
2. Congestion Avoidance:
o Once the congestion window size reaches a threshold (called the ssthresh, or
slow-start threshold), the growth rate of the window slows down.
o Instead of exponential growth, the window increases linearly (one MSS per
round-trip time).
o If three duplicate ACKs are received (indicating packet loss), TCP triggers fast
retransmit to resend the lost segment.
o After retransmitting, the congestion window is reduced (usually halved) and
enters fast recovery, where the sender resumes transmission without waiting for
timeouts.
Congestion Window (cwnd): Controls the amount of data the sender can transmit
before waiting for an acknowledgment.
Slow-start Threshold (ssthresh): Determines the point at which TCP switches from slow
start to congestion avoidance mode.
MIME is an extension of the original SMTP (Simple Mail Transfer Protocol) that enables the
sending of multimedia content such as audio, video, images, and other non-text content over
email. MIME allows email to handle not just text but a variety of content types and formats.
Content-Type Header: Specifies the type of data being sent (e.g., text, image, audio).
Multipart Messages: Allows a single message to contain multiple types of content, such
as a combination of text and images.
Encoding: MIME uses encoding techniques (such as Base64) to convert binary data into
a text format, allowing it to be sent over email.
MIME Types:
POP3 is a mail retrieval protocol used by email clients to retrieve email from a remote server.
POP3 is typically used when users want to download emails from a server to their local
machine, accessing them offline.
Download and Delete: By default, POP3 downloads emails from the server and deletes
them from the server after download. This means that emails are stored on the client’s
machine, not the server.
Offline Access: Once emails are downloaded, they can be accessed without an internet
connection.
Simple Protocol: POP3 is relatively simple and does not provide advanced features like
synchronization across multiple devices.
POP3 downloads emails and deletes them from the server, while IMAP leaves emails on
the server and allows for synchronization across multiple devices.
IMAP is better for accessing emails from different locations or devices, while POP3 is
suited for offline access.
File Transfer Protocol (FTP) is a standard network protocol used for transferring files from one
host to another over a TCP/IP-based network such as the internet. FTP allows users to upload
and download files between computers, making it essential for sharing large files across the
network.
1. Client-Server Model:
o FTP operates on a client-server model, where the client sends requests to the
server to upload or download files.
o The client and server communicate over a control connection (for commands)
and a data connection (for transferring the files).
2. Connection Types:
o FTP uses two separate channels:
Control Connection: This is established using TCP port 21. It handles the
commands (such as login, change directory) and responses.
Data Connection: This is used to transfer the actual data (files). The port
can vary (typically 20 for active mode or dynamically assigned in passive
mode).
3. Modes of Operation:
o Active Mode: The server opens the data connection back to the client from its
port 20.
o Passive Mode: The client opens both the control and data connections, and the
server listens on a port provided by the client.
4. Authentication:
o FTP often requires a username and password to access the server. Anonymous
FTP can be used for public file sharing, where no credentials are needed.
o FTP defines a series of commands (e.g., LIST, GET, PUT) and responses (status
codes like 200 OK, 550 Permission denied) for file operations.
Security Concerns:
FTP sends data, including credentials, in clear text, which can be intercepted by
attackers. To mitigate this, FTPS (FTP Secure) and SFTP (SSH File Transfer Protocol) were
developed, which provide encryption for both control and data channels.
23. Explain SMTP and POP3
SMTP is a protocol used for sending email messages between email servers. It works by
transferring email from a sender's email client to an outgoing mail server and between mail
servers to deliver the message.
1. Client-Server Model:
o SMTP follows the client-server model, where the sender's email client acts as the
client, and the mail server acts as the server.
o The email client sends an email via the SMTP server to the destination's mail
server.
2. Transport Protocol:
o SMTP operates over TCP port 25, which is dedicated to mail transmission.
o When an email is sent, the client communicates with the SMTP server to transfer
the email to the recipient's mail server.
o The email is then stored in the recipient's mail server until the recipient retrieves
it using a different protocol, such as POP3 or IMAP.
4. Message Delivery:
o SMTP ensures that the email is sent to the correct server and provides feedback
in the form of status codes (e.g., 250 OK, 550 Error).
SMTP Commands:
SMTP is not designed for receiving email. It’s only used for sending emails.
POP3 is a protocol used by email clients to retrieve emails from a mail server. Unlike SMTP,
which handles sending mail, POP3 focuses on downloading messages from a server to a local
device, allowing offline access.
1. Email Retrieval:
o POP3 allows users to download their emails from the server and store them
locally on their computer. This makes it useful for people who need access to
their emails while offline.
2. Connectionless Protocol:
o POP3 operates in a connectionless manner. Once the client retrieves emails, they
are removed from the server (depending on the configuration). This means that
once emails are downloaded, they are not available on the server anymore
unless explicitly configured to keep copies on the server.
3. POP3 Commands:
4. Limitations of POP3:
DNS (Domain Name System) is a distributed database system that translates human-readable
domain names (e.g., www.example.com) into IP addresses (e.g., 192.0.2.1) that computers can
understand and use to locate each other on the internet.
1. Name Resolution:
2. Hierarchical Structure:
o DNS operates in a hierarchical structure. The domain name is broken down into
multiple levels:
Top-Level Domain (TLD): This is the highest level of the domain, like .com,
.org, .net.
o When a user types a domain name into a web browser, the browser performs a
DNS query to resolve the domain name to an IP address. This process follows
these steps:
1. Recursive Resolver: The query starts at the local DNS resolver, which is
usually provided by the ISP. If the resolver doesn't have the record in its
cache, it queries the root DNS server.
2. Root DNS Server: The root server directs the query to the TLD (Top-Level
Domain) server, based on the domain suffix (like .com).
3. TLD DNS Server: The TLD server directs the query to the authoritative
DNS server for the specific domain.
5. Final Resolution: The local resolver returns the IP address to the browser,
which can then use it to establish a connection to the target web server.
4. DNS Records:
DNS Caching:
DNS queries are often cached by clients, resolvers, and authoritative servers to reduce
the query time and avoid unnecessary repeated lookups.
DNS Security: