CN Endsem Answers
CN Endsem Answers
Ans) The Network Layer is the third layer in the OSI (Open Systems Interconnection) model,
responsible for the delivery of packets from the source host to the destination host across multiple
networks. It provides several essential services to ensure proper communication between devices in
a network. Below are the primary services provided by the Network Layer:
1. Routing
Routing refers to the process of determining the best path for data to travel from the source
to the destination. Routers operate at the Network Layer and use routing algorithms to
forward packets across different networks.
Routing protocols like RIP (Routing Information Protocol), OSPF (Open Shortest Path First),
and BGP (Border Gateway Protocol) are used to establish and maintain routing tables that
guide data packets along the best paths.
2. Logical Addressing
The most common logical address used is the IP address (Internet Protocol address), which
uniquely identifies devices on a network.
Logical addressing allows for devices to be identified and reachable across different
networks, even if they are not physically connected.
3. Packet Forwarding
Once the routing decision has been made, the Network Layer is responsible for packet
forwarding, which involves moving packets from one router or switch to the next based on
the routing table.
The packet is the basic unit of data that the Network Layer handles. It encapsulates the data
from upper layers and is forwarded along the appropriate path.
Sometimes, data packets may be too large to be transmitted over certain networks, so the
Network Layer breaks these large packets into smaller units, called fragments.
These fragments are then transmitted separately, and the Network Layer reassembles them
into the original packet at the destination.
The Network Layer provides basic error detection by including a checksum in each packet.
This checksum helps to identify whether any corruption has occurred during transmission.
While the primary responsibility for error recovery lies with lower layers (like the Data Link
Layer), the Network Layer still plays a role in detecting transmission errors and triggering
retransmission.
6. Congestion Control
The Network Layer can detect network congestion (when too much data is being sent,
leading to delays and packet loss) and may implement certain mechanisms to manage traffic
flow.
For example, it may use techniques to adjust the speed of packet transmission, prioritize
certain types of traffic, or prevent certain packets from being forwarded when congestion
occurs.
The Network Layer provides connectionless communication in the case of the IP protocol.
This means that packets are sent without establishing a formal connection between sender
and receiver.
Each packet is treated independently and routed to the destination independently of other
packets (no setup, maintenance, or teardown of a connection).
8. Inter-network Communication
This is crucial for the functionality of the internet, where data must travel across various
interconnected networks and devices with different hardware and protocols.
The Network Layer can offer services that help manage traffic and ensure certain levels of
performance for critical applications. For example, it can prioritize certain types of traffic,
such as voice or video, over less time-sensitive traffic like file transfers.
Quality of Service (QoS) mechanisms at the Network Layer help ensure that critical services
are given priority during times of congestion.
q) Explain error reporting messages, informational messages, neighbour discovery messages and
group membership messages related to ICMPv6.
Ans) ICMPv6 (Internet Control Message Protocol for IPv6) is used for error reporting, diagnostics,
neighbor discovery, and multicast management in IPv6 networks. Here's a summary of its key
message types:
Destination Unreachable: Indicates a packet can't reach its destination (e.g., network or host
unreachable).
Packet Too Big: Notifies the sender that a packet is too large for the network and needs to be
fragmented.
Time Exceeded: Signals that a packet's TTL expired (commonly used in tools like traceroute).
2. Informational Messages:
Echo Request / Echo Reply: Used in ping to check connectivity between nodes.
Router Solicitation (RS) / Router Advertisement (RA): Hosts send RS to request router info;
routers send RA to provide network settings.
Neighbor Solicitation (NS): Used by nodes to discover the link-layer address (MAC address)
of a neighbor.
Multicast Listener Discovery (MLD): Manages multicast group memberships (similar to IGMP
in IPv4).
Ans) ICMPv6 (Internet Control Message Protocol for IPv6) is a crucial protocol used in the IPv6
networking stack for error reporting, diagnostics, and network management. It is the IPv6 equivalent
of ICMP used in IPv4. ICMPv6 operates at the Network Layer and provides important services for
network communication and troubleshooting.
1. Error Reporting:
o ICMPv6 reports errors that occur during packet transmission. For example, if a router
cannot forward a packet to its destination, it sends an ICMPv6 Destination
Unreachable message.
2. Diagnostics:
o ICMPv6 helps with network diagnostics using tools like ping and traceroute. The
Echo Request and Echo Reply messages in ICMPv6 are used to test connectivity
between devices.
o NDP, which is part of ICMPv6, replaces ARP (Address Resolution Protocol) in IPv4. It
is used for:
o Router Solicitation (RS): A device can send an RS message to ask for router
information.
o ICMPv6 helps with Path Maximum Transmission Unit (PMTU) Discovery, which
determines the largest packet size that can be transmitted without fragmentation
across a network.
6. Time Exceeded:
o Similar to ICMP in IPv4, ICMPv6 sends a Time Exceeded message if a packet's time-
to-live (TTL) expires, indicating that it couldn’t reach its destination within the
allowed number of hops
q) What is the difference between classless addressing and classful addressing? Concepts related to
IPv4 addresses.
Classful addressing was the original method used for IPv4 address allocation and is based on fixed
address classes. In this system, the IP address space is divided into five predefined classes (A, B, C, D,
and E), each with a fixed subnet mask.
1. Fixed Classes:
o Class A: 0.0.0.0 to 127.255.255.255 (First bit is 0) - Used for large networks, allowing
up to 16 million hosts.
o Class B: 128.0.0.0 to 191.255.255.255 (First bits are 10) - Used for medium-sized
networks, allowing up to 65,000 hosts.
o Class C: 192.0.0.0 to 223.255.255.255 (First bits are 110) - Used for small networks,
allowing up to 254 hosts.
o Class D: 224.0.0.0 to 239.255.255.255 (First bits are 1110) - Reserved for multicast
addresses.
2. Subnet Masks:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
o Classful addressing does not allow flexibility in creating subnets of different sizes
within the same network class.
1. Flexible Subnetting:
o In CIDR, subnet masks are not fixed to specific address classes. Instead of using a
class-based mask, a network can use any subnet mask length (e.g., /24, /22, etc.),
allowing for more precise allocation of address space.
2. CIDR Notation:
o CIDR uses a notation like IP_address/Prefix_Length, where the prefix length specifies
how many bits are used for the network part of the address.
o For example: 192.168.1.0/24 means the first 24 bits are the network part, and the
remaining 8 bits can be used for host addresses.
o CIDR allows multiple smaller address blocks to be aggregated into a single, larger
address block. This reduces the size of routing tables and improves the efficiency of
routing.
Subnet Mask Fixed per class (Class A, B, C) Flexible, custom subnet lengths
Feature Classful Addressing Classless Addressing (CIDR)
IP Address
Wastes addresses (fixed sizes) More efficient with variable subnet sizes
Allocation
Ans) Circuit Switching and Packet Switching are two fundamental methods of data transmission in
communication networks. They differ in how data is transmitted between devices, and each has its
own advantages and disadvantages based on the type of communication.
Circuit Switching:
Circuit switching is a communication method in which a dedicated communication path (or circuit) is
established between the sender and receiver for the duration of the communication session.
1. Dedicated Path:
o A dedicated physical path or circuit is established between the sender and receiver
for the entire duration of the call or session. No other communication can use this
path during the session.
o The data flows continuously over the established circuit. The communication is
established in real-time, and the transmission rate is typically fixed and guaranteed.
3. Connection Establishment:
4. Reliable Transmission:
o Since the path is dedicated, there are no issues with routing, and the data arrives in
order without fragmentation. This ensures high reliability for real-time applications
like voice calls.
5. Examples:
o Traditional telephone networks (PSTN) and early mobile networks used circuit
switching.
Guaranteed Bandwidth: Since the path is dedicated, the transmission rate is consistent and
guaranteed, making it ideal for applications like voice and video calls that require constant,
predictable bandwidth.
Low Latency: Once the circuit is established, there is minimal delay as data is transmitted
continuously along the dedicated path.
No Data Loss: There is no packet loss because the circuit is reserved for a specific
communication.
Inefficient Use of Resources: The dedicated path remains reserved even during idle periods
(e.g., when one party is silent in a voice call). This leads to inefficient use of bandwidth.
Scalability Issues: If many users want to use the network simultaneously, it can lead to
congestion, as there are only a limited number of circuits.
Setup Time: Establishing the dedicated path requires some setup time before data
transmission can begin.
Packet Switching:
Packet switching is a method in which data is divided into small packets, and each packet is
transmitted independently across the network, potentially taking different routes to reach the
destination.
o Data is broken into small, manageable units called packets. Each packet can take a
different route through the network and may arrive out of order.
o Network resources (such as bandwidth) are shared by multiple users. Each packet
may travel along different paths based on the current network conditions (e.g.,
congestion, routing decisions).
3. No Dedicated Path:
o There is no dedicated circuit or path between sender and receiver. Each packet is
routed independently, with each intermediate device (router, switch) determining
the best path for the packet.
4. Connectionless:
o Packet switching does not require a prior connection setup. Data is sent as packets
with the necessary addressing information, and the network routes them
dynamically.
5. Examples:
o The Internet, email systems, web browsing, and other data-based communications
use packet switching.
Efficient Use of Resources: Network resources are dynamically shared among multiple users.
There is no need to reserve dedicated paths, leading to better utilization of bandwidth.
Scalability: The network can handle large volumes of traffic, as packets can be routed
independently and take various paths to avoid congestion.
Fault Tolerance: If a particular route fails, packets can be rerouted through alternative paths,
ensuring continuous data delivery.
Variable Latency: Since packets may take different routes and may experience delays in
intermediate routers, the latency can vary, making it unsuitable for real-time
communications like voice or video calls.
Packet Loss and Reordering: Packets can be lost, delayed, or arrive out of order. Therefore,
protocols like TCP/IP are used to handle reordering, error checking, and retransmission.
Overhead: Each packet must carry its own header information, which can add overhead to
the transmission process.
Dedicated vs Shared Dedicated path for the entire Shared network resources, no
Path communication session. dedicated path.
ans) datagram Switching and Virtual Circuit Switching are two types of packet-switched network
architectures used for routing data between devices. While both belong to the category of packet
switching, they differ in how they handle packet routing, connection establishment, and network
resources. Here's a detailed comparison:
Datagram Switching:
In Datagram Switching, each data packet (called a datagram) is treated independently. The network
does not establish a dedicated path between the sender and the receiver; instead, each packet is
routed individually, potentially taking different routes to reach the destination.
1. Connectionless Communication:
2. Independent Routing:
o Each packet can take a different route through the network depending on the
current network conditions (such as congestion, available paths, etc.). This means
that packets may not arrive in the same order they were sent.
3. No State Information:
o Routers do not store any information about the connection state (i.e., no record of
the paths or the status of any "virtual" circuit). This makes the network more flexible
but also less predictable.
4. Addressing:
o Each packet contains the full destination address, and routers use this address to
forward the packet. Routing decisions are made on the fly.
5. Example:
Scalability: The network can efficiently handle a large number of users and varying traffic
patterns.
Flexibility: Packets can be rerouted dynamically in case of congestion or failure, making the
network more resilient.
No Connection Setup: No need for a setup phase before communication; data can be sent
immediately.
Variable Latency: Because packets can take different routes, the delay between packets can
vary.
Packet Loss and Reordering: Packets can be lost or arrive out of order. Higher-level protocols
(like TCP) handle the reordering.
Overhead: Each packet carries its own full destination address, which can increase overhead.
In Virtual Circuit Switching, a logical path or "virtual circuit" is established between the sender and
receiver before any data is transmitted. Unlike in datagram switching, where each packet is routed
independently, virtual circuit switching ensures that all packets follow the same predetermined path
once the circuit is established.
1. Connection-Oriented Communication:
o A connection is established before data transmission begins. This means the network
reserves resources and sets up a logical path between the sender and receiver
(virtual circuit) for the entire session.
2. Predefined Path:
o All packets in a virtual circuit are routed along the same path, ensuring that they
arrive in the correct order. The path is established at the start and used throughout
the communication session.
3. State Information:
o Routers maintain state information about the virtual circuit (such as the path or the
session's current status), making it possible to track the session during the entire
communication.
4. Routing:
o Instead of using the destination address in each packet, virtual circuits use a virtual
circuit identifier (VCI), which routers use to forward packets along the established
path.
5. Example:
o ATM (Asynchronous Transfer Mode) and X.25 are examples of protocols that use
virtual circuit switching.
Guaranteed Order: Since all packets follow the same path, they arrive in the order they were
sent, avoiding issues like packet reordering.
Lower Overhead: Since only a virtual circuit identifier is required (rather than a full
destination address in each packet), this reduces the size of the header and improves
efficiency.
Predictable Latency: The fixed route means that the latency is more consistent across the
entire communication session.
Resource Reservation: Network resources are reserved for the duration of the virtual circuit,
which can lead to inefficiency if the circuit is underutilized.
Scalability Issues: As the number of virtual circuits increases, maintaining state information
for all active sessions in routers can become complex and resource-intensive.
Packets are routed independently and may All packets follow the same
Routing
take different paths. predefined path.
Packets are treated as independent units Packets are part of a logical flow,
Packet Handling
with their own routing decisions. following the virtual circuit.
Network Resources are used dynamically; no Resources are reserved for the
Resources dedicated path. duration of the virtual circuit.
Latency and Variable latency, and packets may arrive out Consistent latency, and packets
Packet Order of order. arrive in order.
Feature Datagram Switching Virtual Circuit Switching
Example
IP (Internet Protocol). ATM, X.25, Frame Relay.
Protocols
Highly scalable due to lack of connection Can be less scalable due to state
Scalability
setup. maintenance in routers.
Higher overhead due to full address in each Lower overhead due to virtual circuit
Overhead
packet. identifier instead of full address.
High, as packets can be rerouted if a path Lower, as the circuit must be re-
Fault Tolerance
fails. established if the path fails
Ans)
IPv4 (Internet Protocol version 4) and IPv6 (Internet Protocol version 6) are two versions of the
Internet Protocol, each with its own addressing format, features, and capabilities. IPv4 is the fourth
version of the Internet Protocol, widely used for most of the internet's existence, whereas IPv6 is the
newer version designed to overcome limitations of IPv4. Below is a detailed comparison between
IPv4 and IPv6 network addresses:
IPv4:
o Example: 192.168.1.1
IPv6:
o Format: Eight groups of four hexadecimal digits (16 bits each), separated by colons.
o Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
2. Address Space
IPv4:
o Exhaustion: IPv4 address space is nearly exhausted due to the rapid growth of
internet-connected devices.
IPv6:
3. Address Notation
IPv4:
o Notation: Dotted decimal format, consisting of four decimal numbers ranging from 0
to 255, each representing an 8-bit block (octet).
o Example: 192.168.1.1
IPv6:
o Notation: Hexadecimal notation, separated by colons. Leading zeros in each block
can be omitted, and one consecutive sequence of zero blocks can be represented
with :: (only once in an address).
o Example: 2001:0db8:85a3::8a2e:0370:7334
4. Configuration Methods
IPv4:
o DHCP (Dynamic Host Configuration Protocol): IPv4 networks commonly use DHCP to
automatically assign IP addresses to devices.
IPv6:
o DHCPv6: IPv6 also supports DHCPv6 for more complex address assignments and
configurations.
5. Header Format
IPv4:
o Header Fields: IPv4 has several fields, such as version, header length, type of service
(ToS), time-to-live (TTL), protocol, source address, and destination address.
o Complexity: IPv4 headers are relatively more complex with many fields that may not
be used in most cases.
IPv6:
o Header Fields: IPv6 has a simpler header with fewer fields. Key fields include
version, traffic class, flow label, payload length, next header, hop limit, source
address, and destination address.
o Efficiency: IPv6 headers are designed to be simpler and more efficient to process by
routers, with fewer options and flags.
IPv4:
o NAT Usage: Because of the limited address space, NAT is often used in IPv4 to allow
multiple devices within a private network to share a single public IPv4 address.
o Issues with NAT: While NAT helps conserve address space, it introduces complexity,
such as difficulties with peer-to-peer communications, security challenges, and
issues with end-to-end connectivity.
IPv6:
o No NAT Required: IPv6 provides a sufficiently large address space, which eliminates
the need for NAT. Every device can have a unique public IP address, simplifying peer-
to-peer communication and improving end-to-end connectivity.
o Simplified Communication: This reduces the complexity associated with NAT in IPv4
networks.
7. Security
IPv4:
o Security: IPv4 was initially designed without security in mind. Security features (e.g.,
IPsec) were added later as optional extensions.
o IPsec: While IPv4 supports IPsec (a set of protocols for securing IP communications),
it is not mandatory, and its implementation is optional.
IPv6:
o Security: IPv6 was designed with security in mind. IPsec is a mandatory part of the
IPv6 protocol suite, providing end-to-end security at the network layer.
o Built-in Security: This design helps ensure that IPv6 can offer more robust security
features as part of the protocol.
8. Broadcast Communication
IPv4:
IPv6:
IPv4:
IPv6:
IPv4:
o Legacy: IPv4 is the most widely deployed protocol, but its address space is limited,
and it is approaching exhaustion.
IPv6:
o Dual Stack: Devices can run both IPv4 and IPv6 simultaneously, making the transition
smoother.
Hexadecimal (e.g.,
Address Format Dotted decimal (e.g., 192.168.1.1)
2001:0db8:85a3::8a2e)
Transition IPv4 is the current standard Ongoing transition from IPv4 to IPv6
ans)
Routing protocols are essential components of computer networks that determine how data packets
are forwarded from source to destination across a network. They can be classified based on the type
of communication they support, such as Unicast Routing and Multicast Routing. Here’s a detailed
explanation of both types of routing protocols:
Unicast refers to one-to-one communication, where a data packet is sent from a single source to a
single destination.
Routing Table: Routers use routing tables to determine the best path for each packet.
Direct Route: Each packet has a unique destination address (IP address) in its header.
Common in most Internet traffic: Most web traffic, email, file transfers, etc., use unicast
communication.
1. Distance Vector Routing Protocols: These protocols use the concept of distance (usually
hops or cost) to determine the best route.
o Examples:
RIP (Routing Information Protocol): Uses hop count as its metric. It is
suitable for smaller networks.
2. Link-State Routing Protocols: These protocols create a complete map of the network by
exchanging link-state information among routers.
o Examples:
OSPF (Open Shortest Path First): Uses a link-state algorithm and is widely
used in large-scale networks. It is faster and more scalable than distance-
vector protocols.
Each router on the network exchanges routing information with its neighbors.
Routing protocols like RIP, OSPF, or IS-IS maintain routing tables that guide routers in
forwarding packets to their final destination based on their destination IP address.
Each data packet carries a destination IP address, and routers use this address to find the
appropriate path.
One-to-Many Communication: A single data stream is sent to a group of receivers who are
interested in receiving the data.
Group Addressing: Multicast uses special IP address ranges (in IPv4, these are addresses
from 224.0.0.0 to 233.255.255.255).
Efficient Use of Resources: Unlike unicast, where a separate copy of data is sent to each
receiver, multicast allows the data to be sent only once, and the network infrastructure
duplicates it where necessary.
Common in Video Streaming and Conferences: Applications like live video streaming, video
conferencing, or IPTV often rely on multicast.
Multicast routing protocols are designed to create and maintain multicast forwarding tables and
manage multicast group memberships.
o How it works: A host sends an IGMP message to join a multicast group. Routers then
use this information to manage the distribution of multicast traffic.
o Role: PIM is the most common multicast routing protocol. It works independently of
the underlying unicast routing protocol (hence the name "Protocol Independent").
o Modes of Operation:
o Role: DVMRP is one of the first multicast routing protocols based on the distance-
vector routing protocol. It uses a technique similar to RIP but is optimized for
multicast traffic.
o How it works: DVMRP builds a routing table to forward multicast packets efficiently
and manages tree-building (such as a source-based tree) for multicast traffic.
o Role: MOSPF extends the OSPF routing protocol to support multicast routing. It
enables routers running OSPF to build multicast forwarding tables.
o How it works: MOSPF integrates OSPF with multicast, allowing routers to exchange
multicast-specific routing information.
Multicast routing protocols manage multicast group memberships using protocols like IGMP
(for IPv4) and MLD (for IPv6).
Routers that support multicast routing forward packets to multicast group members, using
multicast routing tables that are built and updated by protocols like PIM.
A multicast group address is used to send packets to all group members, and the routers in
the network manage how the data is distributed without duplicating it unnecessarily.
Not efficient for large numbers of More efficient (single packet sent to multiple
Efficiency
receivers (duplicate packets sent) receivers)
Use Cases Web browsing, file transfers, email Video streaming, online gaming, IPTV