0% found this document useful (0 votes)
18 views

COMPUTER NETWORK

Uploaded by

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

COMPUTER NETWORK

Uploaded by

Abhishek Ranjan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 52

COMPUTER NETWORK

1. With a neat diagram, explain OSI reference model.


2. Explain different error detection and correction mechanisms used in data communication.
3. Explain a congestion control algorithm.
4. Describe the network topology and relative advantages and disadvantages of STAR, MESH, RING and BUS
topologies.
5. Briefly explain the various media access protocol.
6. Describe fragmentation. How does the network layer handle fragmentation and reassembly of data
packets during transmission?
7. What is Internet Protocol (IP)? State and describe various classes used for IP addressing.
8. Write short notes on a) UDP b) TCP c) SCTP
9. Describe the QoS and explain techniques to improve QoS.
10. Write short notes on ( i) Domain Name System ( ii) Hyper Text Transfer Protocol (iii) World Wide Web
(iv)TELNET (v) FTP
11. Explain Selective Reject and Go-Back-N-ARQ with reference to sliding window protocol.
12. What do you mean error handling at data link layer? Discuss hamming code with suitable example.
13. Discuss IPv4 packet format with suitable diagram the at network layer.
14. Differentiate between Open Loop and Closed Loop Congestion Control at transport layer
15. Explain various traffic shaping algorithms.
16. Explain the duties of each layer in TCP/IP model
17. Explain any two transport-layer protocol a. Stop-and-Wait b. Go-Back-N c. Selective-Repeat
18. Define multiplexing. Explain various types of multiplexing.
19. What do you mean by IP address? Explain IP addressing method.
20. What is significance of cryptography? Compare between public-key and private key cryptography.
ANSWERS

1. With a neat diagram, explain OSI reference model.

OSI Reference Model


The Open Systems Interconnection (OSI) model is a conceptual framework used to understand
and standardize network communication between systems. It divides the communication process
into seven layers. Each layer has its own specific functions and interacts with adjacent layers.

Explanation of Layers
1. Physical Layer
o Deals with physical connections (cables, switches, etc.).
o Transmits raw binary data (0s and 1s).
o Example: Ethernet cables, hubs.
2. Data Link Layer
o Ensures error-free data transfer between adjacent nodes.
o Divided into MAC (Media Access Control) and LLC (Logical Link Control)
sublayers.
o Example: Switches, Ethernet protocols.
3. Network Layer
o Handles routing and logical addressing (IP addresses).
o Determines the path data takes across the network.
o Example: Routers, IP protocol.
4. Transport Layer
o Ensures reliable data transfer and error recovery.
o Manages end-to-end communication between devices.
o Example: TCP (Transmission Control Protocol), UDP.
5. Session Layer
o Manages sessions or connections between applications.
o Keeps data from different sessions separate.
o Example: APIs, NetBIOS.
6. Presentation Layer
o Translates data between application and network formats.
o Handles encryption, compression, and data formatting.
o Example: SSL/TLS protocols.
7. Application Layer
o Provides services directly to end-users and applications.
o Examples: HTTP, FTP, DNS, email protocols (SMTP).

Key Points:
 The OSI model helps standardize communication.
 Each layer performs a specific task and communicates with adjacent layers.
 It provides a logical structure for understanding networking.

2. Explain different error detection and correction mechanisms used in data communication.

Error Detection and Correction Mechanisms in Data Communication


Errors can occur during data transmission due to noise, interference, or signal distortions. Error
detection and correction techniques ensure reliable data transfer.

1. Error Detection Mechanisms


These methods detect errors but do not correct them. The receiver requests retransmission of the
corrupted data.
a) Parity Check
 Adds an extra bit (parity bit) to the data for error detection.
 Types:
o Even Parity: The total number of 1s (including the parity bit) is even.
o Odd Parity: The total number of 1s (including the parity bit) is odd.
 Simple but can detect only single-bit errors.
Example:
Data: 1010
 With even parity, parity bit = 0 → 10100.
 With odd parity, parity bit = 1 → 10101.

b) Checksum
 Data is divided into segments, and the sum of all segments is calculated.
 The sum is then complemented (1's complement) and sent with the data.
 The receiver adds all segments, including the checksum, and checks for errors.
Example:
Segments: 1010, 1100
Sum: 1010 + 1100 = 10110
Checksum: Complement of 0110 → 1001

c) Cyclic Redundancy Check (CRC)


 A polynomial division method where data is divided by a fixed polynomial generator.
 The remainder (CRC bits) is appended to the data and sent.
 At the receiver side, the division is repeated to check for errors.
Key Features:
 Very effective in detecting burst errors.
 Commonly used in networks like Ethernet.

d) Hamming Code (for Detection and Correction)


 Adds redundant bits (parity bits) to the data at specific positions.
 Can detect and correct single-bit errors.
Example:
For data 1011, Hamming Code adds redundant bits: P1P2D1P4D2D3D4.

2. Error Correction Mechanisms


These methods not only detect errors but also correct them without retransmission.
a) Hamming Code
 A popular error correction method.
 Redundant bits are added in such a way that they can locate and correct single-bit errors.
 The redundant bits follow a specific pattern: positions 1, 2, 4, 8, etc.
Steps:
1. Add redundant bits.
2. Calculate parity bits based on specific positions.
3. Identify the bit position with the error and correct it.

b) Forward Error Correction (FEC)


 Redundant data is transmitted along with the original data to allow the receiver to correct errors
without retransmission.
 Commonly used in real-time systems (e.g., video streaming).
Examples:
 Reed-Solomon Codes: Used in CDs, DVDs.
 Convolutional Codes: Used in wireless communication.

c) Automatic Repeat Request (ARQ)


 Combines error detection with retransmission to correct errors.
 Types:
1. Stop-and-Wait ARQ: Receiver sends an acknowledgment (ACK) for each frame.
2. Go-Back-N ARQ: Sender retransmits all frames after an error.
3. Selective Repeat ARQ: Only the erroneous frame is retransmitted.

Summary of Methods
3. Explain a congestion control algorithm.

Congestion Control Algorithm in Computer Networks


Congestion occurs when the network is overloaded with too much data, leading to delays, packet loss,
and reduced performance. A congestion control algorithm is used to manage and prevent congestion,
ensuring smooth data flow.

TCP Congestion Control Algorithm


Transmission Control Protocol (TCP) uses an effective congestion control mechanism based on the
principles of AIMD (Additive Increase, Multiplicative Decrease). It dynamically adjusts the sender's
transmission rate based on network conditions.

Key Phases of TCP Congestion Control


1. Slow Start
2. Congestion Avoidance
3. Fast Retransmit and Fast Recovery

1. Slow Start Phase


 The sender starts with a small congestion window (cwnd) (usually 1 MSS - Maximum Segment
Size).
 The cwnd increases exponentially with each acknowledgment (ACK) received.
 This phase prevents the network from being overwhelmed.
Rule:
cwnd = cwnd + 1 MSS for each ACK received.
Exit Condition:
 If cwnd reaches the threshold (ssthresh).
 Packet loss occurs (timeout or duplicate ACKs).
2. Congestion Avoidance Phase
 After reaching the threshold (ssthresh), the increase in cwnd becomes linear instead of
exponential.
 This avoids rapid congestion buildup.
Rule:
cwnd = cwnd + (1 MSS / cwnd) for each ACK.
Exit Condition:
 Packet loss (timeout or duplicate ACKs).

3. Fast Retransmit and Fast Recovery


 If the sender receives three duplicate ACKs, it assumes that a packet is lost but the network is
still functional.
 The sender immediately retransmits the lost packet without waiting for a timeout (Fast
Retransmit).
 In Fast Recovery, the cwnd is reduced to half (Multiplicative Decrease) and increases linearly
afterward.
Steps:
1. Reduce ssthresh to half of the current cwnd.
2. Set cwnd = ssthresh + 3 MSS.
3. After retransmission, switch back to Congestion Avoidance.
Summary of AIMD (Additive Increase, Multiplicative Decrease):
 Additive Increase: Gradually increases cwnd to probe the network capacity (Congestion
Avoidance).
 Multiplicative Decrease: Reduces cwnd when congestion is detected to prevent network
overload.
Key Points of TCP Congestion Control
1. Slow Start: Exponential growth of cwnd.
2. Congestion Avoidance: Linear growth of cwnd.
3. Fast Retransmit and Fast Recovery: Immediate retransmission and controlled recovery.
Advantages
 Prevents congestion collapse.
 Dynamically adapts to changing network conditions.
 Ensures fairness among multiple users.
4. Describe the network topology and relative advantages and disadvantages of STAR, MESH, RING and BUS
topologies.

Network Topology
Network topology refers to the physical or logical arrangement of nodes (computers, devices, etc.) in a
network. It defines how devices are connected and communicate with one another.

Types of Network Topologies


1. Bus Topology
2. Star Topology
3. Ring Topology
4. Mesh Topology
5. Tree Topology
6. Hybrid Topology
7. Point to Point Topology

1. Bus Topology
 All devices are connected to a single central cable (backbone).
 Data travels in both directions on the shared bus.
Advantages:
 Simple and inexpensive to set up.
 Requires less cable compared to other topologies.
 Suitable for small networks.
Disadvantages:
 A single cable failure disrupts the entire network.
 Performance degrades with an increase in nodes.
 Difficult to troubleshoot.

2. Star Topology
 All devices are connected to a central hub or switch.
 Data passes through the central device to reach its destination.

Advantages:
 Easy to install, manage, and troubleshoot.
 Failure of one node does not affect others.
 Centralized control makes it efficient.
Disadvantages:
 If the central hub fails, the entire network fails.
 Requires more cables compared to bus topology.
 Expensive due to the central hub/switch.
3. Ring Topology
 Devices are connected in a closed loop, where data travels in one direction (unidirectional) or
both directions (bidirectional).

Advantages:
 Simple to install and manage.
 Data flows in an orderly manner, reducing collisions.
 Equal access for all devices.
Disadvantages:
 A single node failure can disrupt the entire network.
 Adding or removing devices requires reconfiguration.
 Troubleshooting is difficult.

4. Mesh Topology
 Every device is directly connected to every other device in the network.
 Can be fully connected (every device to every other) or partially connected.
Advantages:
 Highly reliable (redundant connections ensure no single point of failure).
 Data can take multiple paths to reach its destination.
 Suitable for critical networks like military and financial systems.
Disadvantages:
 Very expensive due to high cabling and setup costs.
 Complex installation and management.
 Scalability is challenging.

5. Tree Topology
 A combination of bus and star topologies. Devices are connected in a hierarchical structure
with a central hub acting as a root.
Advantages:
 Scalable and easy to expand.
 Hierarchical control makes management efficient.
 Faults in one branch do not affect others.
Disadvantages:
 Expensive due to extensive cabling and central hubs.
 If the root node fails, the entire network fails.
 Maintenance can be complex.

6. Hybrid Topology
 Combines two or more types of topologies (e.g., star-ring, star-bus, etc.).

Advantages:
 Highly flexible and scalable.
 Can be customized to suit specific needs.
 More reliable than individual topologies.
Disadvantages:
 Complex to design and manage.
 Expensive due to a mix of different components and connections.
7. Point to Point Topology
Point-to-point topology is a type of topology that works on the functionality of the sender and
receiver. It is the simplest communication between two nodes, in which one is the sender and the other
one is the receiver. Point-to-Point provides high bandwidth.

5. Briefly explain the various media access protocol.

Media Access Protocols


Media Access Protocols determine how devices share a communication medium efficiently to avoid
collisions in a network. These protocols are essential in networks where multiple devices access a shared
communication channel.

Types of Media Access Protocols


1. Random Access Protocols
2. Controlled Access Protocols
3. Channelization Protocols

1. Random Access Protocols


In Random Access, devices transmit data randomly. If a collision occurs, retransmission is performed
after a random delay.
 a) ALOHA:
o Pure ALOHA: Devices transmit data anytime. If a collision occurs, they wait and
retransmit.
o Slotted ALOHA: Time is divided into slots; devices transmit only at the start of a slot,
reducing collisions.
Advantage: Simple and easy to implement.
Disadvantage: High chances of collision in Pure ALOHA.
 b) Carrier Sense Multiple Access (CSMA):
Devices listen to the channel before transmitting.
o CSMA/CD (Collision Detection): Detects collisions and retransmits (used in Ethernet).
o CSMA/CA (Collision Avoidance): Avoids collisions by waiting before transmitting
(used in Wi-Fi).
Advantage: Reduces collisions compared to ALOHA.
Disadvantage: Still not completely collision-free.

2. Controlled Access Protocols


In these protocols, access to the medium is controlled to prevent collisions.
 a) Polling:
A master device polls each node to grant permission for data transmission.
 b) Token Passing:
A token circulates among devices, and only the device holding the token can transmit data.
Example: Token Ring Network.
Advantage: Collision-free communication.
Disadvantage: Delays can occur if a node fails or the token is lost.

3. Channelization Protocols
These protocols divide the channel into smaller, separate parts to allow simultaneous transmissions.
 a) Frequency Division Multiple Access (FDMA):
o The available bandwidth is divided into frequency bands, and each device gets a specific
frequency.
o Used in analog systems.
 b) Time Division Multiple Access (TDMA):
o Time is divided into slots, and each device transmits during its assigned time slot.
o Used in digital cellular networks.
 c) Code Division Multiple Access (CDMA):
o All devices transmit simultaneously using unique codes.
o Used in mobile communications (e.g., 3G networks).
Advantage: Efficient use of bandwidth.
Disadvantage: Complex to implement.

6. Describe fragmentation. How does the network layer handle fragmentation and reassembly of data
packets during transmission?

Fragmentation in Networking
Fragmentation is the process of breaking a large data packet into smaller pieces to accommodate the
Maximum Transmission Unit (MTU) size of a network. Different networks may have different MTU
sizes, so a large packet that exceeds the MTU must be fragmented to travel across these networks.
The network layer in the OSI model handles fragmentation.

Why is Fragmentation Needed?


1. MTU Restriction: Each network has a maximum packet size (MTU) that it can transmit. For
example:
o Ethernet MTU = 1500 bytes
o Some networks may have lower MTUs.
2. Heterogeneous Networks: When a packet travels through networks with different MTU sizes, it
must be fragmented to fit the smallest MTU on the path.

How the Network Layer Handles Fragmentation


The IP protocol at the network layer (Layer 3) is responsible for fragmentation. It breaks a packet into
smaller fragments when it exceeds the MTU size.
Key Concepts:
 Original Packet: The large packet that needs to be fragmented.
 Fragments: The smaller pieces of the original packet.
 Header Fields: Each fragment contains an IP header with specific fields to aid reassembly.
Steps in Fragmentation:
1. Packet Division:
o The original packet is divided into smaller fragments, each of size less than or equal to
the MTU.
o Each fragment gets its own IP header.
2. Identification Field:
o All fragments of a packet carry the same Identification value in their IP headers.
o This helps the receiver identify and group fragments of the same packet.
3. Fragment Offset:
o A Fragment Offset field indicates the position of a fragment in the original packet.
o Offset is measured in 8-byte units.
4. More Fragments (MF) Flag:
o If the MF flag is 1, more fragments are coming.
o If the MF flag is 0, this is the last fragment.

Reassembly of Fragments
At the destination, the network layer reassembles the fragments back into the original packet.
1. The fragments are identified using the Identification field in the IP header.
2. Using the Fragment Offset, the receiver arranges the fragments in the correct order.
3. The packet is fully reassembled when:
o All fragments arrive, and
o The fragment with MF = 0 (last fragment) is received.
4. If any fragment is missing, the entire packet is discarded.

Fields in IP Header Used for Fragmentation


Field Purpose

Identification Identifies fragments of the same packet.

Fragment Offset Indicates the position of a fragment.

More Fragments (MF) Indicates if more fragments are expected.

Total Length Specifies the size of each fragment.


Example of Fragmentation
Suppose:
 MTU = 1500 bytes
 IP Header = 20 bytes
 Data = 4000 bytes
Step 1: Divide 4000 bytes of data into fragments:
 Maximum data per fragment = 1500 - 20 = 1480 bytes.
Step 2: Fragments:
 Fragment 1: 1480 bytes (offset = 0, MF = 1)
 Fragment 2: 1480 bytes (offset = 185, MF = 1) (185 = 1480 / 8)
 Fragment 3: 1040 bytes (offset = 370, MF = 0) (last fragment)

Advantages of Fragmentation
 Allows data to travel across networks with different MTUs.
 Ensures compatibility between heterogeneous networks.
Disadvantages of Fragmentation
 Reassembly requires extra processing at the destination.
 If a single fragment is lost, the entire packet must be retransmitted.
 Increases overhead due to additional headers.

Conclusion
The network layer handles fragmentation by dividing large packets into smaller fragments and
appending necessary information in the IP header. The receiver reassembles the fragments using the
Identification, Fragment Offset, and MF fields.
Let me know if you'd like further clarification or an example!

7. What is Internet Protocol (IP)? State and describe various classes used for IP addressing.
Internet Protocol (IP)
Internet Protocol (IP) is a fundamental protocol in the network layer of the OSI and TCP/IP models.
It is responsible for delivering data packets from the source to the destination across interconnected
networks. IP enables communication by assigning a unique identifier, called an IP address, to each
device on the network.
Key Features of IP
1. Connectionless Protocol: IP does not establish a dedicated connection before transmitting data.
2. Best-Effort Delivery: IP does not guarantee packet delivery, order, or error recovery.
3. Logical Addressing: Each device on the network has a unique IP address.
4. Routing: IP supports packet forwarding using routers to reach the destination.

IP Addressing
An IP address is a unique 32-bit number (IPv4) or 128-bit number (IPv6) assigned to each device on a
network.
 IPv4 addresses are divided into five classes (A, B, C, D, E).
 An IPv4 address is written in dotted-decimal format (e.g., 192.168.1.1).

IP Address Classes
IPv4 addresses are divided into 5 classes based on the first octet (the first 8 bits of the address). These
are Class A, B, C, D, and E.

1. Class A
 Range: 1.0.0.0 to 126.255.255.255
 First Octet: 1 - 126
 Network/Host Division:
o Network ID: First 8 bits.
o Host ID: Remaining 24 bits.
 Default Subnet Mask: 255.0.0.0
Purpose: Designed for very large networks, such as multinational companies or ISPs.
Example: 10.0.0.1

2. Class B
 Range: 128.0.0.0 to 191.255.255.255
 First Octet: 128 - 191
 Network/Host Division:
o Network ID: First 16 bits.
o Host ID: Remaining 16 bits.
 Default Subnet Mask: 255.255.0.0
Purpose: Suitable for medium-sized networks like universities or large businesses.
Example: 172.16.0.1

3. Class C
 Range: 192.0.0.0 to 223.255.255.255
 First Octet: 192 - 223
 Network/Host Division:
o Network ID: First 24 bits.
o Host ID: Remaining 8 bits.
 Default Subnet Mask: 255.255.255.0
Purpose: Ideal for small networks like private businesses or local area networks (LANs).
Example: 192.168.1.1

4. Class D
 Range: 224.0.0.0 to 239.255.255.255
 Purpose: Reserved for multicasting (sending data to multiple devices simultaneously).
 Class D addresses do not have a subnet mask.
Example: 224.0.0.1
5. Class E
 Range: 240.0.0.0 to 255.255.255.255
 Purpose: Reserved for experimental and research purposes.
 Not used for general communication.

Special IP Address Ranges


1. Private IP Addresses: Reserved for internal (LAN) use and cannot be routed on the Internet.
o Class A: 10.0.0.0 to 10.255.255.255
o Class B: 172.16.0.0 to 172.31.255.255
o Class C: 192.168.0.0 to 192.168.255.255
2. Loopback Address: 127.0.0.1 is used to test network software and connectivity.
8. Write short notes on a) UDP b) TCP c) SCTP
a) User Datagram Protocol (UDP)
 Definition: UDP is a connectionless, unreliable transport layer protocol that allows data to be
sent without establishing a connection between sender and receiver.
 Key Features:
o Lightweight and simple.
o Does not guarantee delivery, order, or error checking.
o No retransmission of lost packets.
 Use Cases:
o Applications requiring speed over reliability, e.g., video streaming, VoIP, DNS, and
online gaming.
 Header Size: 8 bytes.
 Fields in UDP Header: Source Port, Destination Port, Length, Checksum.

b) Transmission Control Protocol (TCP)


 Definition: TCP is a connection-oriented, reliable transport layer protocol that ensures data
delivery between sender and receiver.
 Key Features:
o Provides reliable communication using acknowledgments, error checking, and
retransmissions.
o Ensures data is delivered in order.
o Establishes a connection before data transmission using a three-way handshake.
 Use Cases:
o Applications requiring reliable and ordered communication, e.g., HTTP, FTP, SMTP,
and Telnet.
 Header Size: 20 bytes (minimum).
 Fields in TCP Header: Sequence Number, Acknowledgment Number, Source Port, Destination
Port, Flags (e.g., SYN, ACK).

c) Stream Control Transmission Protocol (SCTP)


 Definition: SCTP is a connection-oriented transport layer protocol that combines features of
TCP and UDP, offering reliable and message-oriented communication.
 Key Features:
o Supports multi-homing: A connection can use multiple IP addresses for fault tolerance.
o Ensures ordered delivery of data, like TCP.
o Provides message-oriented communication, like UDP.
o Handles out-of-order data delivery through stream management.
 Use Cases:
o Applications requiring reliable message delivery, e.g., signaling in telecommunications
(SS7), VoIP, and real-time applications.
 Header Size: 12 bytes (minimum).
 Fields in SCTP Header: Source Port, Destination Port, Verification Tag, Checksum, and
Chunks (control/data).

9. Describe the QoS and explain techniques to improve QoS.


Quality of Service (QoS)
Quality of Service (QoS) refers to the ability of a network to deliver predictable and measurable levels
of performance, ensuring that data is transmitted efficiently and reliably. It is particularly important for
applications requiring low latency, minimal packet loss, and guaranteed bandwidth, such as video
conferencing, VoIP, and streaming services.

Goals of QoS
1. Minimize Delay (Latency): Reduce the time taken for data packets to travel from source to
destination.
2. Minimize Jitter: Ensure consistent packet arrival time to prevent delays in real-time
applications.
3. Minimize Packet Loss: Reduce dropped packets to ensure reliable data transmission.
4. Maximize Bandwidth Utilization: Efficiently manage network resources to meet the needs of
different applications.
Techniques to Improve QoS
1. Classification and Marking
o Purpose: Classify data packets into categories based on their priority and mark them for
proper handling.
o How: Use packet headers (e.g., Type of Service (ToS) in IP) to mark priority levels.
o Example: Differentiating voice, video, and background traffic.
2. Scheduling Techniques
Scheduling determines the order in which packets are transmitted based on their priority.
o a) First Come First Serve (FCFS):
 Packets are transmitted in the order they arrive.
 Drawback: No priority handling.
o b) Priority Queuing (PQ):
 Packets are classified into priority levels. High-priority packets are transmitted
first.
 Use Case: Real-time traffic like VoIP and video conferencing.
o c) Weighted Fair Queuing (WFQ):
 Assigns weights to different queues based on priority and bandwidth needs.
 Ensures fair sharing of bandwidth.
3. Traffic Shaping and Policing
o Traffic Shaping:
 Controls outgoing traffic to smooth traffic flow and prevent bursts.
 Limits bandwidth usage to avoid congestion.
 Technique: Token Bucket Algorithm.
o Traffic Policing:
 Monitors incoming traffic and drops or marks packets that exceed the bandwidth
limit.
4. Resource Reservation
o Reserve resources (e.g., bandwidth) for specific applications to meet their QoS
requirements.
o Protocol: RSVP (Resource Reservation Protocol) allows reservation of network
resources.
5. Congestion Management
o Techniques to prevent or reduce network congestion:
 Buffer Management: Allocating buffer space for high-priority packets.
 RED (Random Early Detection): Drops packets probabilistically before
congestion occurs.
6. Compression
o Reduces the size of data packets to minimize bandwidth usage.
o Example: Using compression techniques for VoIP data to improve transmission
efficiency.
7. Link Efficiency Techniques
o Fragmentation and Interleaving: Break large packets into smaller fragments to prevent
delays in real-time traffic.
o Example: Used in networks carrying both voice and data traffic.

10. Write short notes on ( i) Domain Name System ( ii) Hyper Text Transfer Protocol (iii) World Wide Web
(iv)TELNET (v) FTP

(i) Domain Name System (DNS)


 Definition: DNS is a hierarchical and distributed naming system used to translate human-
readable domain names (e.g., www.example.com) into IP addresses (e.g., 192.168.1.1) that
computers use to identify each other.
 Purpose: Simplifies access to websites by allowing users to use names instead of numeric IP
addresses.
 Components:
o Domain Name: Example - www.google.com.
o DNS Server: Includes Root Servers, Top-Level Domain (TLD) Servers, and
Authoritative Name Servers.
 Working: When a domain name is entered, the DNS server looks it up, retrieves the IP address,
and sends it back to the client.
 Example: Resolving www.example.com to 93.184.216.34.

(ii) HyperText Transfer Protocol (HTTP)


 Definition: HTTP is an application layer protocol used for transferring hypertext documents
(web pages) over the internet. It follows the client-server model.
 Purpose: Enables communication between a web browser (client) and a web server to request
and transfer web resources.
 Key Features:
o Stateless: Each HTTP request is independent; the server does not retain information
about previous requests.
o Request Methods:
 GET: Retrieve data from the server.
 POST: Submit data to the server.
 PUT: Update data on the server.
 DELETE: Delete data on the server.
 Example: Accessing a webpage via http://www.example.com.

(iii) World Wide Web (WWW)


 Definition: The World Wide Web is a system of interlinked hypertext documents accessed via
the internet. It was invented by Tim Berners-Lee in 1989.
 Components:
1. Web Pages: Documents containing text, images, audio, video, and hyperlinks.
2. Web Browser: Software to access and display web pages (e.g., Chrome, Firefox).
3. Web Server: Hosts web pages and responds to client requests.
4. HTTP/HTTPS: Protocols for transferring web pages.
 Purpose: Enables users to access information, documents, and multimedia through hyperlinks.
 Working: Users access web pages using URLs (Uniform Resource Locators).

(iv) TELNET
 Definition: TELNET (TELecommunication NETwork) is an application layer protocol used
for remote access to another computer or server over a network.
 Purpose: Allows users to log in to a remote system and execute commands as if they were
physically present at the machine.
 Working: TELNET uses port 23 and establishes a text-based connection.
 Features:
o Provides a command-line interface.
o Unsecured protocol; data (including passwords) is transmitted in plain text.
 Use Case: Managing servers remotely before the advent of secure protocols like SSH.
 Example: Connecting to a server using the command telnet example.com.

(v) File Transfer Protocol (FTP)


 Definition: FTP is a standard protocol used for transferring files between a client and a server
over a network.
 Purpose: Uploading or downloading files between a local system and a remote server.
 Key Features:
o Works on port 21 for control commands.
o Uses port 20 for data transfer.
o Supports two modes:
 Active Mode: Server initiates the connection for data transfer.
 Passive Mode: Client initiates the connection for data transfer.
 Security: FTP transmits data in plain text; secure versions like SFTP (Secure FTP) are
preferred.
 Use Case: Website developers use FTP to upload web pages to web servers.
 Example: Accessing a file server with commands like ftp example.com.
11. Explain Selective Reject and Go-Back-N-ARQ with reference to sliding window protocol.
Selective Reject and Go-Back-N ARQ with Sliding Window Protocol
The Sliding Window Protocol is a method used for reliable data transmission in communication
systems. It allows the sender to send multiple packets before needing an acknowledgment for the first
one, while the receiver can only acknowledge the packets in a specific order.
Two major Automatic Repeat Request (ARQ) techniques used in the sliding window protocol are:
1. Go-Back-N ARQ
2. Selective Reject ARQ
These techniques help manage error correction and ensure reliable data transfer.

1. Go-Back-N ARQ
Go-Back-N ARQ is a stop-and-wait protocol variant in which the sender can send multiple frames (up
to a window size NNN) without waiting for an acknowledgment (ACK) for each one. However, if an
error is detected in any frame, the sender goes back and retransmits all frames from that point onward.
How Go-Back-N Works:
 Sender Side:
o The sender maintains a window of size NNN, where NNN is the maximum number of
unacknowledged packets it can send before waiting for ACKs.
o The sender keeps sending packets sequentially and waits for an acknowledgment.
o If the sender does not receive an acknowledgment for a specific frame within a timeout
period, it will retransmit all frames starting from the unacknowledged frame.
 Receiver Side:
o The receiver is simple and only expects the next frame in sequence. If a frame is received
out of order, it will discard it.
o The receiver sends an acknowledgment for the last correctly received frame.
Example:
 Assume the window size is 4 (i.e., N=4N = 4N=4).
 The sender sends frames 1, 2, 3, and 4.
 If the receiver successfully receives frames 1, 2, and 3 but there is an error in frame 4, the
receiver will discard frame 4 and acknowledge frame 3.
 The sender will go back and retransmit frames 4, 5, 6, and so on (not just the erroneous frame
4).
Advantages of Go-Back-N:
 Simpler to implement compared to other protocols.
 Effective when packet loss or errors are rare.
Disadvantages of Go-Back-N:
 Inefficient in networks with high packet loss or errors, as it retransmits all frames after an error,
even if many frames were transmitted successfully.

2. Selective Reject ARQ


Selective Reject ARQ (also known as Selective Repeat ARQ) is an improvement over Go-Back-N
ARQ. In this method, only the specific erroneous or missing frames are retransmitted, rather than all
frames after the error.
How Selective Reject Works:
 Sender Side:
o The sender sends multiple frames (up to window size NNN), just like in Go-Back-N.
o The sender waits for acknowledgments for the frames it has sent.
o If a frame is not acknowledged within the timeout period, only that specific frame is
retransmitted (not the entire sequence of frames).
 Receiver Side:
o The receiver can accept frames out of order if earlier frames have been successfully
received.
o The receiver stores the frames in a buffer and acknowledges the frames in sequence.
o If the receiver detects that a packet is missing, it requests the retransmission of only that
packet.
Example:
 Assume the window size is 4 (i.e., N=4N = 4N=4).
 The sender sends frames 1, 2, 3, and 4.
 The receiver successfully receives frames 1 and 3 but has an error in frame 2.
 The receiver acknowledges frame 1, then discards frame 2 (due to error), and acknowledges
frame 3.
 The sender retransmits only frame 2 (not frames 3 or 4).
Advantages of Selective Reject:
 More efficient than Go-Back-N, especially in environments with high packet loss or errors.
 Minimizes retransmissions by sending only the missing or erroneous frames.
Disadvantages of Selective Reject:
 Requires a more complex receiver since it needs to buffer out-of-order frames.
 Needs additional mechanisms to track missing packets and handle duplicate ACKs.

12. What do you mean error handling at data link layer? Discuss hamming code with suitable
example.

Error Handling at the Data Link Layer


The Data Link Layer (Layer 2 of the OSI model) is responsible for ensuring error-free data transfer
between two directly connected devices. It detects and sometimes corrects errors that can occur during
the transmission of data across physical channels, such as noise, signal degradation, or interference. The
error handling mechanisms at this layer ensure data integrity and reliable communication.
Error handling at the data link layer typically involves:
1. Error Detection: Identifying if errors have occurred during transmission.
o Parity Bits: A single bit added to the data to make the number of 1's either even (even
parity) or odd (odd parity).
o Checksums: A value computed from a data set that can be used to detect errors by
comparing it with a recalculated checksum at the receiver.
o Cyclic Redundancy Check (CRC): A more sophisticated method using polynomial
division to detect errors in transmitted data.
2. Error Correction: Correcting errors that are detected during transmission. This is done by
adding redundant bits to the transmitted data, which can be used to both detect and correct
errors.
Error correction techniques, like Hamming Code, add redundancy bits to the original data to enable
error correction at the receiver side.

Hamming Code:
The Hamming Code is an error-correcting code developed by Richard Hamming. It can detect and
correct single-bit errors in data transmission. Hamming Code adds parity bits to the original data in
such a way that errors can be identified and corrected by the receiver.
How Hamming Code Works:
 The number of parity bits required depends on the length of the data to be transmitted. The
relationship is given by:
2r≥m+r+12^r \geq m + r + 12r≥m+r+1
Where:
o rrr is the number of parity bits.
o mmm is the number of data bits.
 The parity bits are inserted at positions that are powers of 2 (1, 2, 4, 8, etc.). These bits help in
determining whether an error occurred in any of the data bits.
Steps for Encoding Using Hamming Code:
1. Determine the Number of Parity Bits:
Calculate the number of parity bits rrr needed for a given number of data bits mmm using the
formula.
2. Place Parity Bits in the Correct Positions:
The parity bits are placed in positions 1,2,4,8,…1, 2, 4, 8, \dots1,2,4,8,… (powers of 2). These
positions will be filled with 0 initially, and later, the values will be calculated.
3. Calculate the Parity Bits:
Each parity bit checks certain bits in the data and calculates its value to ensure the total number
of 1's in those bits is even (even parity). If the number of 1's is odd, the parity bit is set to 1 to
make it even. If the count is already even, the parity bit remains 0.
4. Send the Data:
The encoded data (data bits + parity bits) is transmitted to the receiver.

Example of Hamming Code (7,4):


Let's say we want to transmit the 4 data bits: 1011.
1. Determine the Number of Parity Bits:
For 4 data bits, we need 3 parity bits (since 23≥4+3+12^3 \geq 4 + 3 + 123≥4+3+1).
2. Position the Parity Bits:
The positions are powers of 2: 1,2,4,81, 2, 4, 81,2,4,8. So, the data will be placed as follows:

Where P1, P2, and P3 are the parity bits, and D1, D2, D3, and D4 are the data bits.

3. Calculate the Parity Bits:


1. P1 checks positions 1, 3, 5, and 7: P1, D1, D2, D4
1. Parity bit P1P1P1 checks the bits at positions 1, 3, 5, and 7 (i.e., P1,D1,D2,D4P1,
D1, D2, D4P1,D1,D2,D4) to ensure even parity.
2. P1P1P1 = 1⊕1⊕11 \oplus 1 \oplus 11⊕1⊕1 (where ⊕\oplus⊕ represents XOR
operation) = 1.
2. P2 checks positions 2, 3, 6, and 7: P2, D1, D3, D4
1. Parity bit P2P2P2 checks the bits at positions 2, 3, 6, and 7.
2. P2P2P2 = 1⊕0⊕11 \oplus 0 \oplus 11⊕0⊕1 = 0.
3. P3 checks positions 4, 5, 6, and 7: P3, D2, D3, D4
1. Parity bit P3P3P3 checks the bits at positions 4, 5, 6, and 7.
2. P3P3P3 = 0⊕1⊕10 \oplus 1 \oplus 10⊕1⊕1 = 0.
4. Final Code: The transmitted data with parity bits becomes:
1010011
(where P1 = 1, P2 = 0, and P3 = 0).

Error Detection and Correction at Receiver:


At the receiver, the same parity check is performed for each set of bits that a parity bit checks. If the
result of any parity check is 1, it indicates an error in that bit's position. The receiver then sends a
correction signal to flip the incorrect bit.
 If all parity checks return a result of 0, no errors occurred.
 If one parity check returns 1, the bit in that position is incorrect and is flipped to correct the
error.
For example, if the received code is 1 0 1 0 1 1 1:
 The receiver checks the parity bits and determines that the error is at position 6.
 The receiver then flips the bit at position 6 to correct the error.

Advantages of Hamming Code:


 Error Detection and Correction: It can detect and correct single-bit errors efficiently.
 Simple to Implement: The encoding and decoding process is simple and widely used in
communication systems.
Limitations of Hamming Code:
 It can only correct single-bit errors. It cannot correct multiple-bit errors.
 The overhead increases with the length of the data, as more parity bits are needed.

13. Discuss IPv4 packet format with suitable diagram the at network layer.
14. Differentiate between Open Loop and Closed Loop Congestion Control at transport layer
Open Loop vs. Closed Loop Congestion Control at the Transport Layer
Congestion control at the transport layer is essential to manage the flow of data across the network to
prevent network congestion, ensuring efficient data transfer between source and destination. The two
primary strategies for congestion control are Open Loop and Closed Loop mechanisms.
Here's a comparison between the two:

1. Open Loop Congestion Control


 Definition: In Open Loop congestion control, the sender takes action based on predefined
parameters without receiving feedback from the receiver or the network. The sender assumes
that congestion will not occur and continues transmitting data at a constant rate.
 Characteristics:
o No feedback: There is no real-time feedback from the network or receiver to adjust the
sending rate.
o Predefined sending rate: The sender uses a fixed or calculated sending rate based on the
network's expected capacity.
o Proactive: It uses a pre-determined method to control congestion (based on
assumptions about network state), like setting the window size based on static network
parameters.
o Limited response: There is no direct or adaptive response to congestion or packet loss
events.
 Example:
o TCP Tahoe (early versions) in some scenarios operates in open-loop mode, where it
doesn't adjust immediately to congestion signs but follows a set protocol for window size
and data flow control.
o Token Bucket Algorithm: The sender is allowed to send packets based on token
accumulation, without considering immediate feedback.
 Advantages:
o Simple to implement.
o Predictable behavior in stable networks.
 Disadvantages:
o Inefficient in highly variable or congested networks since no feedback adjusts the
sending rate dynamically.
o May lead to network congestion and packet loss if the network cannot handle the fixed
sending rate.
2. Closed Loop Congestion Control
 Definition: In Closed Loop congestion control, the sender dynamically adjusts its transmission
rate based on feedback received from the receiver or network (e.g., packet loss, delay, or
congestion notification).
 Characteristics:
o Feedback-based: The sender adjusts its transmission based on feedback mechanisms
such as acknowledgments, congestion signals, or explicit notifications from the receiver
or network.
o Adaptive: The sending rate is continuously adapted depending on network conditions.
For example, if congestion is detected (e.g., packet loss or high latency), the sender
reduces its sending rate.
o Responsive to network conditions: The sender can detect signs of congestion in real-
time and take corrective actions, such as reducing the rate or retransmitting lost packets.
o Real-time adjustments: The sender and receiver can communicate congestion
information, like Explicit Congestion Notification (ECN) or TCP congestion control
algorithms.
 Example:
o TCP Reno, TCP Congestion Control, TCP Vegas: These algorithms use feedback
from the receiver to detect congestion (e.g., through acknowledgment delays or packet
loss) and adjust the sending rate accordingly.
o Explicit Congestion Notification (ECN): A mechanism where routers signal congestion
to the sender, enabling it to adjust the transmission rate dynamically.
 Advantages:
o More efficient in handling varying network conditions.
o Helps in preventing network congestion and packet loss by adjusting transmission based
on real-time conditions.
o Can improve overall throughput by adapting to network congestion levels.
 Disadvantages:
o More complex to implement.
o Requires continuous monitoring and feedback from the receiver or network.
o May introduce delays due to the feedback loop.
15. Explain various traffic shaping algorithms
Traffic Shaping Algorithms
Traffic shaping refers to the technique used to control the flow of data into a network to ensure that
traffic meets the specified bandwidth and quality-of-service (QoS) requirements. It helps in controlling
congestion and optimizing the use of network resources by regulating the data transfer rate.
There are several traffic shaping algorithms that manage the traffic flow, each with different
characteristics and use cases. Below are the most common traffic shaping algorithms:
1. Token Bucket Algorithm
The Token Bucket algorithm is one of the most widely used traffic shaping mechanisms. It controls the
amount of data that can be sent over the network by placing limits on the rate of data transmission.
 How It Works:
o A bucket holds tokens, which are generated at a steady rate.
o To send a packet, the sender must "consume" tokens from the bucket. Each packet
requires a token to be sent.
o If the bucket is empty (i.e., there are no tokens), the packet must wait until tokens are
available.
o If the bucket is full, excess tokens are discarded, ensuring that the sender does not exceed
the predefined maximum burst rate.
 Characteristics:
o The token generation rate limits the long-term transmission rate (average rate).
o The bucket size determines the burst size, allowing for short bursts of data even if the
average rate is low.
o Provides flexibility in handling bursts while maintaining overall average traffic limits.
 Advantages:
o Allows for bursts of traffic without exceeding the average rate.
o Simple to implement.
 Disadvantages:
o Can cause delay if tokens are not available to send data.
 Example:
o A 1 Mbps link with a token generation rate of 100 tokens per second. If packets are 1 KB
each, the bucket allows bursts of up to 100 KB but averages the rate to 1 Mbps.

2. Leaky Bucket Algorithm


The Leaky Bucket algorithm is another traffic shaping mechanism that controls the data flow into the
network. It is similar to the token bucket but with a more rigid approach to handling bursty traffic.
 How It Works:
o The algorithm uses a "bucket" to store incoming packets.
o The bucket has a fixed capacity, and if the bucket fills up (i.e., the incoming rate exceeds
the bucket size), incoming packets are discarded (or dropped).
o The packet flow is controlled by a leak rate (the rate at which the bucket leaks packets)
that represents the maximum output rate.
o This ensures that packets leave the bucket at a constant rate, which smooths out traffic
bursts.
 Characteristics:
o The output rate is constant, determined by the leak rate.
o Excess packets are discarded when the bucket overflows.
o Unlike the token bucket, there is no burst capacity, and the algorithm does not allow
bursts beyond the configured output rate.
 Advantages:
o Provides a consistent output rate and eliminates traffic spikes.
o Ensures a smooth flow of data, avoiding congestion.
 Disadvantages:
o Does not allow for any traffic bursts; excess packets are dropped.
o If the burst rate exceeds the bucket size, significant packet loss may occur.
 Example:
o A network with a 1 Mbps link, where the bucket has a capacity of 1 MB, and packets are
sent at a constant rate of 256 KB per second. Any packets arriving faster than 256 KB/sec
will be discarded.

16. Explain the duties of each layer in TCP/IP model


The TCP/IP model is a conceptual framework used to describe the functions of a networking system. It
consists of four layers: Application, Transport, Internet, and Network Interface. Each layer has specific duties
and responsibilities to facilitate communication between devices on a network. Below is a detailed explanation
of the duties of each layer in the TCP/IP model:
1. Application Layer
 Role: The Application layer is the topmost layer in the TCP/IP model. It provides the interface
and services directly to the user and ensures that applications can access network services.
 Duties:
o User Interaction: Provides the interface for user applications, allowing users to interact
with the network through programs like web browsers, email clients, and file transfer
tools.
o Protocol Implementation: Implements various application protocols such as HTTP (for
web browsing), FTP (for file transfer), SMTP (for email), and DNS (for domain name
resolution).
o Data Formatting and Encoding: Formats data from applications into a form suitable for
transmission and may involve encryption, compression, or conversion to a different data
format.
o Session Management: In some cases, it is responsible for managing sessions between
user applications on different systems.
 Examples:
o HTTP (Hypertext Transfer Protocol) for web browsing.
o FTP (File Transfer Protocol) for file transfer.
o SMTP (Simple Mail Transfer Protocol) for email.
o DNS (Domain Name System) for name resolution.

2. Transport Layer
 Role: The Transport layer is responsible for providing end-to-end communication and ensuring
reliable data transfer between two hosts.
 Duties:
o Segmentation and Reassembly: It divides large application data into smaller chunks
(segments) for transmission and reassembles them at the receiving end.
o Reliability: Ensures reliable data delivery by detecting errors, retransmitting lost or
corrupted data, and managing data flow. This is typically handled by protocols like TCP
(Transmission Control Protocol).
o Flow Control: Manages the rate at which data is sent to avoid overwhelming the
receiving host (e.g., windowing in TCP).
o Error Detection and Correction: Uses checksums and acknowledgments to ensure that
data is received correctly.
o Multiplexing: Allows multiple applications to use the same network connection by using
port numbers to distinguish between different processes (e.g., ports 80 and 443 for web
traffic).
 Examples:
o TCP: A connection-oriented protocol that ensures reliable, in-order delivery of data.
o UDP (User Datagram Protocol): A connectionless protocol that provides faster, but less
reliable, communication.

3. Internet Layer
 Role: The Internet layer is responsible for routing data packets across different networks, from
the source to the destination, ensuring that they reach the correct destination regardless of the
underlying physical network infrastructure.
 Duties:
o Routing: Routes data packets across multiple networks by determining the best path for
delivery (using IP addresses).
o Addressing: Assigns unique logical addresses (IP addresses) to devices for identification
and communication.
o Packet Forwarding: Responsible for forwarding data packets to the correct destination
based on IP addresses.
o Fragmentation and Reassembly: In case data packets are too large for transmission
over certain network links, this layer divides them into smaller fragments and
reassembles them at the receiving end.
 Examples:
o IP (Internet Protocol) for addressing and routing data.
o ICMP (Internet Control Message Protocol) for diagnostic and error messages, like ping
and traceroute.
o ARP (Address Resolution Protocol) for mapping IP addresses to MAC addresses.

4. Network Interface Layer (Data Link Layer)


 Role: The Network Interface layer is responsible for the actual transmission of data over
physical media and handles the interaction between the device’s hardware and the network.
 Duties:
o Framing: This layer packages data into frames for transmission over the physical
medium.
o Media Access Control (MAC): Defines how devices access the physical transmission
medium (such as Ethernet, Wi-Fi, etc.).
o Error Detection: Detects transmission errors that may occur in the physical medium and
can request retransmission (e.g., using checksums).
o Addressing: Provides hardware addressing using MAC addresses, which uniquely
identify devices on a local network.
o Physical Transmission: It translates logical data into signals that are transmitted through
the physical medium (electrical signals, light pulses, radio waves, etc.).
 Examples:
o Ethernet (for wired local area networks).
o Wi-Fi (for wireless local area networks).
o PPP (Point-to-Point Protocol) for direct connections.

17. Explain any two transport-layer protocol a. Stop-and-Wait b. Go-Back-N c. Selective-Repeat


18. Define multiplexing. Explain various types of multiplexing.
19. What do you mean by IP address? Explain IP addressing method. GFG_link
IP Address
An IP address (Internet Protocol address) is a unique numerical identifier assigned to each device
connected to a computer network that uses the Internet Protocol (IP) for communication. It allows
devices to locate and communicate with each other over the network, ensuring that data packets reach
the correct destination.
IP addresses are essential for routing and identifying devices on the network, similar to how a street
address is used to identify a specific location.
IP Addressing Method
IP addresses are assigned and used in two primary versions: IPv4 and IPv6. Both versions use different
formats and structures for addressing, but they serve the same purpose of identifying devices on a
network.
1. IPv4 Addressing (Internet Protocol Version 4)
IPv4 is the most widely used version of IP addresses. It uses a 32-bit address to represent an IP
address, which provides a total of 4.3 billion unique addresses (2^32).
 Format: An IPv4 address is written in dotted decimal notation, consisting of four 8-bit octets
separated by periods (dots). Each octet is a number between 0 and 255.
Example: 192.168.1.1
This address consists of four parts:
o 192 (1st octet)
o 168 (2nd octet)
o 1 (3rd octet)
o 1 (4th octet)
 Subnet Mask: A subnet mask is used to specify which portion of the IP address represents the
network and which part represents the host. For example, a common subnet mask is
255.255.255.0, which means the first three octets (192.168.1) identify the network, and the last
octet (1) identifies the specific device (host) on that network.
IPv4 Address Types:
IPv4 addresses are classified into several types based on the purpose of the address:
 Unicast: Refers to communication between a single sender and a single receiver.
 Broadcast: Refers to communication sent to all devices on a network.
 Multicast: Refers to communication sent to a group of devices on a network.
2. IPv6 Addressing (Internet Protocol Version 6)
IPv6 was introduced to address the limitations of IPv4, especially the shortage of available addresses.
IPv6 uses a 128-bit address, providing an incredibly large number of unique addresses—about 340
undecillion (3.4 × 10^38) addresses.
 Format: An IPv6 address is written in colon-separated hexadecimal format (eight groups of
four hexadecimal digits).
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
IPv6 uses hexadecimal numbers (base-16) rather than decimal, and each group consists of four
hexadecimal digits, separated by colons.
 Compressed Format: Leading zeros in any of the eight groups can be omitted, and consecutive
groups of zeros can be replaced by ::. For example:
2001:0db8:85a3::8a2e:0370:7334 is a compressed version of the above address.
 IPv6 Address Types:
o Unicast: One-to-one communication.
o Multicast: One-to-many communication.
o Anycast: One-to-nearest (to the closest device among a group of devices).
IP Address
An IP address (Internet Protocol address) is a unique numerical identifier assigned to each device
connected to a computer network that uses the Internet Protocol (IP) for communication. It allows
devices to locate and communicate with each other over the network, ensuring that data packets reach
the correct destination.
IP addresses are essential for routing and identifying devices on the network, similar to how a street
address is used to identify a specific location.

IP Addressing Method
IP addresses are assigned and used in two primary versions: IPv4 and IPv6. Both versions use different
formats and structures for addressing, but they serve the same purpose of identifying devices on a
network.
1. IPv4 Addressing (Internet Protocol Version 4)
IPv4 is the most widely used version of IP addresses. It uses a 32-bit address to represent an IP
address, which provides a total of 4.3 billion unique addresses (2^32).
 Format: An IPv4 address is written in dotted decimal notation, consisting of four 8-bit octets
separated by periods (dots). Each octet is a number between 0 and 255.
Example: 192.168.1.1
This address consists of four parts:
o 192 (1st octet)
o 168 (2nd octet)
o 1 (3rd octet)
o 1 (4th octet)
 Subnet Mask: A subnet mask is used to specify which portion of the IP address represents the
network and which part represents the host. For example, a common subnet mask is
255.255.255.0, which means the first three octets (192.168.1) identify the network, and the last
octet (1) identifies the specific device (host) on that network.
IPv4 Address Types:
IPv4 addresses are classified into several types based on the purpose of the address:
 Unicast: Refers to communication between a single sender and a single receiver.
 Broadcast: Refers to communication sent to all devices on a network.
 Multicast: Refers to communication sent to a group of devices on a network.
2. IPv6 Addressing (Internet Protocol Version 6)
IPv6 was introduced to address the limitations of IPv4, especially the shortage of available addresses.
IPv6 uses a 128-bit address, providing an incredibly large number of unique addresses—about 340
undecillion (3.4 × 10^38) addresses.
 Format: An IPv6 address is written in colon-separated hexadecimal format (eight groups of
four hexadecimal digits).
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
IPv6 uses hexadecimal numbers (base-16) rather than decimal, and each group consists of four
hexadecimal digits, separated by colons.
 Compressed Format: Leading zeros in any of the eight groups can be omitted, and consecutive
groups of zeros can be replaced by ::. For example:
2001:0db8:85a3::8a2e:0370:7334 is a compressed version of the above address.
 IPv6 Address Types:
o Unicast: One-to-one communication.
o Multicast: One-to-many communication.
o Anycast: One-to-nearest (to the closest device among a group of devices).
Key Differences Between IPv4 and IPv6:
Feature IPv4 IPv6

Address Length 32 bits 128 bits

Dotted decimal (e.g.,


Address Format Hexadecimal with colons (e.g., 2001:0db8::1)
192.168.1.1)

Total Number of
4.3 billion (2^32) 340 undecillion (2^128)
Addresses

More complex due to larger address and


Header Complexity Simpler
fields

Basic support (IPSec is


Security Built-in security (IPSec mandatory)
optional)

Manual or dynamic (via Mainly dynamic, with auto-configuration


Address Allocation
DHCP) (SLAAC)

IP Addressing Methods
IP addresses are assigned using various methods, depending on how the network is configured and
managed:
1. Static IP Addressing
 Definition: A static IP address is manually configured for a device and does not change over
time.
 Use Case: Static IP addressing is useful for servers, printers, or other devices that need a fixed IP
to be easily reachable on the network.
Example: A server may be assigned the IP 192.168.1.100 to always be accessible by users.
2. Dynamic IP Addressing
 Definition: In dynamic IP addressing, IP addresses are assigned automatically by a Dynamic
Host Configuration Protocol (DHCP) server from a pool of available addresses. The address
may change over time.
 Use Case: Dynamic IP addressing is typically used for end-user devices like laptops,
smartphones, and workstations, as they don't need a fixed address.
Example: A device might be assigned an IP address from the range 192.168.1.1 to 192.168.1.50, and
the address can change each time the device connects to the network.
3. Public and Private IP Addresses
 Public IP Address: A public IP address is globally unique and is used to identify a device on the
public internet. It is assigned by an Internet Service Provider (ISP).
Example: 8.8.8.8 (Google's public DNS server).
 Private IP Address: Private IP addresses are used within local networks and are not routable on
the public internet. These addresses are reserved for private use, and organizations can use them
internally without concern for conflicts on the internet.
Private IPv4 Address Ranges:
o 10.0.0.0 to 10.255.255.255
o 172.16.0.0 to 172.31.255.255
o 192.168.0.0 to 192.168.255.255
Example: A device in a home network might have the private IP 192.168.0.10.

20. What is significance of cryptography? Compare between public-key and private key
cryptography.
Significance of Cryptography
Cryptography is a critical field in information security that involves techniques for securing
communication and data from unauthorized access or tampering. The main purposes of cryptography
are:
1. Confidentiality: Ensures that the data remains private and is only accessible to the intended
recipient.
2. Integrity: Ensures that the data has not been altered or corrupted during transmission.
3. Authentication: Verifies the identity of the sender and the receiver.
4. Non-repudiation: Ensures that neither party can deny the transmission of the message.
5. Access Control: Limits access to data or systems based on permissions.
Cryptography is widely used in various applications such as secure communication, online transactions,
digital signatures, and more.

Conclusion
 Public-Key Cryptography is more secure for key exchange and authentication, but it's slower.
It uses two keys: one public and one private.
 Private-Key Cryptography is faster and more efficient for encrypting data but requires secure
key distribution. It uses a single shared key for both encryption and decryption.
Both types of cryptography have their specific uses depending on the need for speed, security, and key
management.

You might also like