0% found this document useful (0 votes)
18 views56 pages

Computer Networks

The document outlines practical exercises for creating network connections using various devices such as Peer-to-Peer networks, hubs, switches, routers, and repeaters. Each section includes theory, types, features, advantages, disadvantages, and applications of the respective networking device. Additionally, it provides a series of questions and answers to reinforce understanding of the concepts presented.

Uploaded by

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

Computer Networks

The document outlines practical exercises for creating network connections using various devices such as Peer-to-Peer networks, hubs, switches, routers, and repeaters. Each section includes theory, types, features, advantages, disadvantages, and applications of the respective networking device. Additionally, it provides a series of questions and answers to reinforce understanding of the concepts presented.

Uploaded by

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

Practical-01

Aim:- To create a Peer-to-Peer (P2P) connection using Local Area Network (LAN)

Theory:-

• A Peer-to-Peer (P2P) network is a decentralized system where all devices (peers) are
equally privileged.
• Peers share resources (files, printers, internet access) directly without any centralized
server.
• Each node in a P2P network acts as both a client and server.

Types of P2P Networks:

Type Description Examples

Unstructured Random connections; harder to search but easier to build. Napster, Gnutella

Structured Organized connections; easy search but complex setup. P-Grid, Kademlia

Hybrid Uses both central servers and P2P features for balance. Torrent trackers

Features of P2P Networks:


• Direct file sharing between devices
• Equal role of devices (no hierarchy)
• Ideal for small offices and residential setups
• No dependency on a central point of failure
Applications of P2P Networks:
• File Sharing (BitTorrent)
• Blockchain (Bitcoin, Ethereum)
• VOIP Services (Skype, Zoom)

2
• Collaborative Platforms (Git, P2P Cloud Storage)
Advantages:
• Simple setup and low cost
• No dedicated network administrator needed
• Scalable by simply adding new devices
• Reduced traffic bottlenecks compared to server-based networks

Disadvantages
• Difficult to secure data
• Locating resources can be hard
• Less performance reliability
• Maintenance becomes harder as the network grows
Questions & Answers:

S.
Question Answer
No.

A P2P network is a decentralized structure where each


What is a Peer-to-Peer (P2P)
1 device (peer) can share and access resources directly
network?
without a central server.

How is a P2P network In a P2P network, every device acts both as a server and
2 different from a Client-Server a client, while in Client-Server, specific servers serve
network? multiple client devices.

Give two real-life examples of BitTorrent for file sharing and Bitcoin for
3
P2P applications. cryptocurrency are examples of P2P applications.

What are the types of P2P The three types are: Unstructured, Structured, and
4
networks? Hybrid P2P networks.

What is the main disadvantage


It is difficult to find specific content because devices are
5 of an Unstructured P2P
randomly connected.
network?

Where are P2P networks Small offices, residential areas, and environments
6
mostly used? requiring easy and cost-effective sharing of resources.

Because there is no central authority managing devices,


Why is security a concern in
7 making it easier for viruses or unauthorized access to
P2P networks?
spread.

3
Practical-02
Aim:-To create a network connection using a Hub.

Theory
• A hub is a basic networking device that operates at the Physical Layer (Layer 1) of the
OSI model.
• It is used to connect multiple devices in a network (LAN) and broadcast the data it
receives to all connected ports.
• Hubs do not filter or intelligently route data; they simply repeat the signal across all
ports.
• Hubs are suitable for small networks where the traffic load is low.

Types of Network Hubs

Type Description

Active Hub Amplifies, regenerates, and retransmits network signals. Requires power.

Passive Hub Simply connects devices; does not amplify signals. No power supply needed.

Intelligent Functions like an active hub but also monitors network traffic using MIB
Hub (Management Information Base).

4
Features of a Hub
• Operates at the physical layer.
• Supports half-duplex communication.
• Works on shared bandwidth and uses broadcasting.
• Cannot identify the destination; broadcasts to all ports.
• Does not support VLAN (Virtual LAN) or spanning tree protocol.
• Unable to determine the best route for data transmission.
• Can detect collisions and send jamming signals.

Applications of Hubs
• Connecting computers in a small LAN.
• Extending network range in home or small offices.
• Used in network labs for training purposes.

Advantages of Hubs
• Low cost and easy to install.
• No software configuration required.
• Supports different types of network media.

Disadvantages of Hubs
• Broadcasts data to all ports, causing unnecessary traffic.
• Cannot filter data or find the shortest path.
• Poor performance under heavy traffic.
• No security features.

Questions and Answers


S.
Question Answer
No.

What is the main purpose of a A hub connects multiple devices and broadcasts
1
hub in a network? incoming data to all connected ports without filtering.

5
S.
Question Answer
No.

At which OSI layer does a hub Hubs work at the Physical Layer (Layer 1) of the OSI
2
operate? Model.

An Active Hub regenerates and amplifies signals,


How does an Active Hub
3 whereas a Passive Hub only connects devices without
differ from a Passive Hub?
signal boosting.

Why are hubs considered Because they broadcast data to all devices, causing high
4
inefficient for large networks? network traffic and collisions.

An Intelligent Hub can monitor and manage network


5 What is an Intelligent Hub? traffic using a built-in Management Information Base
(MIB).

State two advantages of using 1) Cost-effective and 2) Easy to set up without needing
6
a hub. technical expertise.

Mention one drawback of


Hubs cannot filter or secure data, making the network
7 using hubs in network
vulnerable to unauthorized access.
security.

6
Practical-03
Aim:-To create a network connection using a Switch.

Theory:-
• A switch is a networking device that operates at Layer 2 (Data Link Layer) of the OSI
model.
• Unlike hubs, switches intelligently forward data only to the device that needs it, using
MAC addresses.
• It uses packet switching to receive, process, and forward data to the destination device.
• Switches help reduce network traffic and improve performance by creating dedicated
communication links between devices.
Types of Switches:-

Type Description

Unmanaged
Plug-and-play; no configuration needed. Used in home networks.
Switch

Allows configuration, monitoring, and traffic management; used in large


Managed Switch
businesses.

LAN Switch Connects devices within a local network; also called Ethernet Switch.

Power over Ethernet switch; provides both power and data to devices over
PoE Switch
the same cable.

Features of Switches:-
• Operates mainly at the Data Link Layer (Layer 2).

7
• Uses MAC addresses to identify the destination device.
• Supports Unicast, Multicast, and Broadcast communication.
• Full duplex communication: devices can send and receive data simultaneously.
• Reduces network collisions.
• High port density (24/48 ports available).
• Capable of error checking before forwarding frames.
Applications of Switches:-
• Building Local Area Networks (LANs) in businesses and organizations.
• Used in Data Centers for high-speed network connectivity.
• Supporting VoIP phones, IP cameras, and wireless access points using PoE switches.
Advantages of Switches:-
• Reduces network traffic through efficient switching.
• Increases bandwidth availability for devices.
• Supports centralized management (in managed switches).
• Decreases frame collisions.
Disadvantages of Switches:-
• More expensive compared to hubs.
• Broadcast traffic can still create network congestion.
• Configuration (for managed switches) may require technical expertise.

Questions and Answers:-


S.
Question Answer
No.

A switch connects devices in a network and


1 What is a network switch used for? forwards data only to the intended recipient using
MAC addresses.

At which layer of the OSI model Switches primarily operate at the Data Link Layer
2
does a switch primarily operate? (Layer 2).

A switch forwards data to specific devices based on


How does a switch differ from a
3 MAC addresses, while a hub broadcasts data to all
hub?
devices.

8
S.
Question Answer
No.

It allows simultaneous sending and receiving of


What is the benefit of full-duplex
4 data, thus reducing collisions and increasing
communication in switches?
network efficiency.

A managed switch can be configured and monitored


What is a Managed Switch, and
5 for network optimization; it is used in large, complex
where is it used?
networks.

List two applications where PoE 1) IP Cameras and 2) VoIP Phones, where both
6
switches are used. power and data are transmitted over one cable.

Mention one disadvantage of Switches are expensive compared to hubs and


7
using switches in networks. require technical configuration for managed types.

9
Practical-04
Aim:-To create a connection using a Router to forward data packets between different
networks.

Theory:-
A Router is a network device that forwards data packets between computer networks. It
connects two or more networks, such as LANs or WANs, and routes packets toward their
destination IP address using routing tables and protocols.
Routers allow multiple devices to share a single Internet connection, manage traffic, and
enhance security.

How Does a Router Work?


• A router examines the destination IP address in a packet header.
• It refers to its routing table to find the best path for delivery.
• It uses static (manually set) or dynamic (auto-updating) routing tables.
• Routers are usually connected to a modem (DSL, fiber, cable) to access the Internet.
• They often contain multiple LAN ports to connect several devices simultaneously.

Types of Routers

Type Description

Broadband Router Connects to the internet and other computers or networks.

Wireless Router Broadcasts a Wi-Fi signal to create a wireless LAN.

Wired Router Connects devices via Ethernet cables; used in schools/offices.

10
Type Description

Edge Router Placed at the network edge, connects to ISP and external networks.

Core Router Distributes data within a large network backbone.

Virtual Router Software-based router running on a virtual machine.

Portable Router Lightweight mobile routers that create private Wi-Fi networks.

Functions of a Router
1. Forwarding – Forwards packets to the correct output port using the routing table.
2. Routing – Chooses the best path to reach a destination using algorithms.
3. NAT (Network Address Translation) – Maps private IPs to a public IP for Internet
access.
4. Security – Offers firewall and filtering to block unauthorized traffic.
5. QoS (Quality of Service) – Prioritizes specific traffic types (e.g., video, VoIP).
6. VPN Connectivity – Supports secure remote access via VPN.
7. Bandwidth Management – Controls traffic flow to prevent congestion.
8. Monitoring – Tracks traffic and offers diagnostics for fault resolution.
Architecture of a Router

11
Component Role

Input Port Receives and processes incoming packets.

Switching Fabric Internally connects input to output ports.

Output Port Queues and transmits packets to the next hop.

Routing Processor Executes routing algorithms, updates tables.

Switching Methods:
• Switching via Memory: CPU handles packet forwarding.
• Switching via Bus: Shared bus between input/output ports.
• Switching via Interconnection Network: High-speed matrix for fast internal routing.

Advantages of Routers
1. Multi-device Connectivity – Supports multiple devices sharing one Internet line.
2. Improved Security – Acts as a buffer between internal network and the Internet.
3. Efficient NAT – Allows multiple private IPs to access Internet through one public IP.
4. Dynamic Routing Support – Learns and adjusts paths automatically.
5. Traffic Filtering – Controls and blocks unwanted packets.

Disadvantages of Routers
1. Slower Processing – Routing decisions across multiple layers can cause delay.
2. Higher Cost – Advanced routers can be expensive.
3. Requires Configuration – Needs technical setup and management.
4. Interference – Quality may degrade due to signal issues or shared bands.
5. Bandwidth Overhead – Dynamic routing consumes bandwidth for route updates.

Applications of Routers
1. Connecting telecom hardware like BSC, MGW, SGSN for remote networking.
2. Used in both wired and wireless communications with STM interfaces.
3. ISPs use routers to transfer data (audio/video/email) across the Internet.
4. Routers enable access control, restricting or allowing certain users.
Questions and Answers

12
S.
Question Answer
No.

What is the primary function of A router forwards data packets between networks using
1
a router in a network? destination IP addresses to determine the best path.

Which address does a router use Routers use the destination IP address in the packet's
2
to forward packets? header to determine the path.

What happens if a router


It sends an ICMP "Source Quench" message to the
3 receives more data than it can
sender, asking to reduce the data rate.
handle?

How does a router handle ARP The router includes its own IP and MAC addresses in
4
queries? the ARP query; the target replies with its MAC address.

Static routing is manually configured, while dynamic


What is the difference between
5 routing uses protocols (RIP, OSPF, BGP) to auto-
static and dynamic routing?
update routes.

13
Practical-05
Aim:-To create a network connection using a Repeater device.

Theory:-
• A Repeater is a network device that operates at the Physical Layer (Layer 1) of the OSI
model.
• It receives weak or corrupted signals over a network, amplifies or regenerates them,
and then forwards the refreshed signals.
• The main purpose of a repeater is to extend the distance a signal can travel over a
network without losing quality.
How a Repeater Works:
• Receives incoming signal from a network cable.
• Regenerates or amplifies the signal strength.
• Transmits the improved signal towards the next segment of the network.

Types of Repeaters

Type Description

Analog Repeater Amplifies analog signals without modifying them.

Digital Repeater Regenerates digital signals precisely to their original form.

Wired Repeater Used in wired LANs to boost signals over cables.

Wireless Repeater Used in wireless networks to extend Wi-Fi coverage.

14
Type Description

Local Repeater Used in small networks with short distances.

Remote Repeater Used where network spans long distances (large LANs).

Features of Repeaters
• Works only at the physical layer.
• Does not modify the actual content of the data.
• Extends network range by regenerating signals.
• Can work with both analog and digital signals.
• Needs external power to operate.

Applications of Repeaters
• Extending Ethernet networks over longer distances.
• Boosting Wi-Fi signals in large homes or offices.
• Used in fiber optic and satellite communication systems.

Advantages of Repeaters
• Extends the effective communication range.
• Reduces signal degradation over long distances.
• Cost-effective solution for small networks.
• Enhances network reliability by maintaining signal quality.

Disadvantages of Repeaters
• Cannot filter traffic; forwards all signals, including noise.

15
• No collision management in shared network mediums.
• Does not segment a network into separate collision domains.
• Adds a small delay due to signal processing.

Questions and Answers


S.
Question Answer
No.

A Repeater regenerates or amplifies weak signals


What is the primary purpose of a
1 to extend the communication distance without
Repeater in networking?
losing quality.

At which layer of the OSI model A Repeater operates at the Physical Layer (Layer
2
does a Repeater operate? 1).

What is the difference between an Analog Repeaters amplify analog signals, while
3 Analog Repeater and a Digital Digital Repeaters regenerate digital signals
Repeater? precisely.

Give one practical use of a Wireless Extending Wi-Fi coverage in homes, offices, or
4
Repeater. large buildings.

Why can't Repeaters filter or Because they work only at the Physical Layer and
5
manage network traffic? deal with signals, not data content or addresses.

List two advantages of using 1) Extends network range; 2) Reduces signal


6
Repeaters. degradation.

State one limitation of using a It forwards all network traffic, including


7
Repeater. unnecessary noise and errors, without filtering.

16
Practical-06
Aim:-To simulate Static Routing connection in a network .
Theory
• Static Routing involves manually setting fixed paths for data packets to reach their
destination.
• Routing Information Protocol (RIP) is a dynamic routing protocol that allows routers
to share information about network topology automatically.
• In this practical, static routes are configured manually, and RIP can be used for backup
or verification purposes.
Key Concepts:

Term Description

Manually configured paths that do not change unless


Static Routing
reconfigured by an administrator.

Routing Table A database containing the paths routers use to forward packets.

RIP (Routing A protocol where routers exchange network information every 30


Information Protocol) seconds using hop count as a metric.

The number of devices (routers) data must pass through to reach


Hop Count
the destination.

Procedure
1. Set Up Devices:
o PCs, Switches, Routers as per topology diagram.

17
2. Assign IP Addresses:
a. Assign unique IP addresses and subnet masks to each PC based on the provided table.
S.NO Device IPv4 Address Subnet mask Default Gateway
1. PC0 192.168.1.1 255.255.255.0 192.168.1.3
2. PC1 192.168.1.2 255.255.255.0 192.168.1.3
3. PC2 192.168.2.1 255.255.255.0 192.168.2.3

4. PC3 192.168.2.2 255.255.255.0 192.168.2.3

b. Configure IP addresses and subnet masks for router interfaces and make sure the
connection is enabled.

3. Configure Routers:
o Set up static routing using Cisco Packet Tracer or real routers.
S.NO Device Interface IPv4 Address Subnet mask
1. router0 GigabitEthernet0/0 192.168.1.3 255.255.255.0
GigabitEthernet0/1 193.168.3.1 255.255.255.0
2. router1 GigabitEthernet0/0 192.168.2.3 255.255.255.0
GigabitEthernet0/1 192.168.3.2 255.255.255.0

4. Enable RIP:
o Configure routers to advertise connected networks using RIP.

18
5. Verification:
o Test connectivity using ping commands.
o Check routing tables to verify routes.

Applications of Static Routing


• Small to medium-sized networks with few changes.
• Networks requiring predictable and controlled routing behavior.
• Backup routes in dynamic routing environments.

Advantages of Static Routing


• Simple and predictable routing paths.
• No bandwidth consumption for route updates.
• High security because no routing advertisements are sent.

Disadvantages of Static Routing

19
• Manual configuration required for changes.
• Not scalable for large or frequently changing networks.
• Risk of misconfiguration if manual errors are made.

Questions and Answers


S.
Question Answer
No.

Static Routing is the process of manually setting


1 What is Static Routing?
routes in a router's routing table.

RIP stands for Routing Information Protocol. It


What does RIP stand for, and what is
2 allows routers to exchange routing information
its function?
based on hop count.

Why is Static Routing preferred in It provides predictable and secure routing paths
3
small networks? without the overhead of dynamic protocols.

What metric does RIP use to determine RIP uses hop count as its metric to choose the
4
the best route? best path.

What is one major disadvantage of It is not scalable and requires manual updates
5
Static Routing? for every network change.

What command is used to test


The ping command is used to test network
6 connectivity between two devices in a
connectivity.
network simulation?

How often does RIP update its routing RIP updates routing information every 30
7
information? seconds.

20
Practical-07
Aim:-To simulate Dynamic Routing in a network using Routing Information
Protocol (RIP).

Theory:-
Dynamic Routing is a technique where routers automatically calculate and update the best path
to forward data between networks based on real-time network conditions. Unlike static routing,
where paths are manually configured, dynamic routing uses routing protocols to share and
adjust routes across routers.
Dynamic routing is highly adaptive. If one path fails, the router detects the failure and
recalculates a new route based on protocols like RIP (Routing Information Protocol) or OSPF
(Open Shortest Path First).
For example, if the path R1 → R2 → R5 → R9 → R10 is disrupted due to a failure at R9, the
router can dynamically reroute the data using an alternate path like R1 → R2 → R5 → R8 →
R10 without requiring manual reconfiguration.

21
Working of Dynamic Routing
1. Protocol Installation: Routing protocols like RIP or OSPF are installed on each router
to enable communication.
2. Initial Configuration: The protocol starts manually and populates the initial routing
table.
3. Automatic Updates: Routers exchange routing information automatically and update
their routing tables.
4. Path Adjustment: If a network path fails, routers detect the issue and reroute data via
an alternative route.
5. Default Gateway Check: Hosts compare default gateway IPs with their local router to
ensure correct path delivery.
Purpose of Dynamic Routing
• Automatically explore multiple paths and select the best path.
• Enable real-time route updates in response to network changes.
• Share network topology with other routers.
• Eliminate manual routing tasks for administrators.

Components of Dynamic Routing

Component Function

Data Structure Stores routing tables and network topology information.

22
Component Function

Routing Algorithm Calculates the best paths and updates routing tables.

Routing Protocol Governs how routing information is exchanged.

Advantages of Dynamic Routing


1. Highly scalable — ideal for large networks.
2. Self-updating — no manual intervention required.
3. Reliable — reroutes automatically in case of failure.
4. Efficient communication — routers share updated status.

Disadvantages of Dynamic Routing


1. Requires powerful hardware to handle processing.
2. Higher maintenance than static routing.
3. Consumes more bandwidth for updates.
4. Network changes may require re-protocol configuration.
5. Troubleshooting can be more complex.

Questions and Answers

S.
Question Answer
No.

Dynamic routing uses protocols like RIP/OSPF to


What is dynamic routing, and
automatically update routing tables based on current
1 how does it differ from static
network conditions, unlike static routing which is
routing?
manually configured.

How does RIP (Routing RIP uses hop count to determine the best path and shares
2
Information Protocol) work? updates with neighboring routers every 30 seconds.

RIP is a distance-vector protocol based on hop count,


What is the difference
3 while OSPF is a link-state protocol that uses Dijkstra’s
between RIP and OSPF?
algorithm and is more scalable.

23
S.
Question Answer
No.

It detects failures and reroutes traffic through alternative


How does dynamic routing
4 paths without manual intervention, ensuring
improve fault tolerance?
uninterrupted connectivity.

What is the administrative RIP has an administrative distance of 120, while OSPF
5
distance of RIP and OSPF? has 110 — lower values are preferred.

What are some ways to Use show ip protocols, show ip route, show ip ospf
6 troubleshoot dynamic neighbor, or show ip bgp summary to check
routing? configurations and status.

List one scenario where In large enterprise networks where frequent topology
7 dynamic routing is preferred changes occur, dynamic routing adapts better and reduces
over static routing. manual overhead.

24
Practical-08:
Aim:-To configure a network using DHCP (Dynamic Host Configuration
Protocol)
Theory:-
DHCP (Dynamic Host Configuration Protocol) is an application-layer protocol that
automatically assigns IP addresses and other network parameters (like subnet mask, DNS, and
default gateway) to client devices in a network. It eliminates the need for manual IP
configuration and reduces IP conflicts.
DHCP is essential for efficiently managing large networks, enabling seamless device
connectivity, especially for mobile or frequently changing devices. It uses the client-server
model over UDP, with port numbers 67 (server) and 68 (client).
Why Do We Use DHCP?
• Automates IP allocation
• Prevents address conflicts
• Centralizes network configuration
• Reduces human error
• Enables easy scalability in large environments
Components of DHCP:-

Component Description

DHCP Server Holds IP address pool and configuration data.

DHCP Client Receives IP address from the DHCP server.

Forwards DHCP messages between clients and servers in different


DHCP Relay Agent
networks.

IP Address Pool Range of available IPs for distribution.

Lease Time duration for which an IP is assigned.

Subnet & Gateway Network settings provided by the server.

DNS Configuration Server sends DNS details to the client.

DHCP Options Includes subnet mask, domain name, time server, etc.

Failover Support Backup DHCP server in case of failure.

25
Component Description

Dynamic DNS
Automatically update DNS records.
Updates

Audit Logging Tracks lease history and client details.

Working of DHCP (DORA Process):-


The DHCP process follows four major steps (DORA):
1. Discover – Client broadcasts a DHCP Discover to find available servers.
2. Offer – Server offers an IP and configuration options.
3. Request – Client requests offered address.
4. Acknowledge – Server confirms and binds IP to client.
Additionally, DHCP supports lease renewal and graceful expiration.
DHCP Message Types:-
1. DHCP Discover – Client queries the network for DHCP servers.
2. DHCP Offer – Server responds with an available IP and lease.
3. DHCP Request – Client requests offered IP.
4. DHCP Acknowledge – Server confirms assignment.
5. DHCP NAK – Server denies a request.
6. DHCP Decline – Client refuses offered IP due to conflict.
7. DHCP Release – Client releases its IP address.
8. DHCP Inform – Client requests additional local config parameters.

Advantages of DHCP:-
• Centralized IP management
• Reduces manual configuration
• Prevents IP conflicts
• Supports mobile devices
• Enables fast network scaling
• Reuse of IPs improves efficiency
• Supports dynamic DNS updates
• Logging and monitoring aid troubleshooting

26
Disadvantages of DHCP:-
• IP conflicts if multiple servers offer the same range
• Clients may connect to rogue DHCP servers
• Clients can't operate without a DHCP server
• Hostname/IP changes may cause mismatches
• DHCP communication depends on open UDP ports

Applications of DHCP:-
• Enterprise networks – Automate large-scale IP allocation
• ISPs and broadband setups – Manage home IP addresses
• Wi-Fi zones – Support mobile and roaming clients
• IoT networks – Handle frequent device joins and leaves
• Virtual environments – Assign IPs to virtual machines

Questions and Answers:-


S.
Question Answer
No.

DHCP is a protocol used to automatically assign IP


What is DHCP and why is it
1 addresses and network configurations to devices,
used?
reducing manual setup and avoiding IP conflicts.

Through DORA steps: Discover → Offer → Request →


How does the DHCP leasing
2 Acknowledge. This ensures dynamic IP assignment and
process work?
lease time management.

What happens if two DHCP It may cause IP conflicts. To prevent this, servers should
3 servers exist in the same be configured with non-overlapping IP ranges or
network? coordinated using failover protocols.

How can you troubleshoot a Ensure DHCP service is active, check configurations,
4 DHCP server if clients aren’t verify network connectivity, and examine logs or firewall
getting IPs? rules on ports 67 & 68.

What’s the impact of


Clients might receive the same IP from different servers,
5 overlapping IP ranges from
leading to address conflicts and unstable connections.
two DHCP servers?

It reduces manual tasks, automates configuration, and


How does DHCP improve
6 avoids address duplication, making networks more
network efficiency?
scalable and manageable.

27
S.
Question Answer
No.

IP address, Subnet Mask, Default Gateway, DNS servers,


What network details does a
7 Lease time, and optional settings like domain name and
DHCP server provide?
time server.

28
Practical-09
Aim:-To configure and understand the working of incoming and outgoing
email communication

29
Theory:-
Email (Electronic Mail) is one of the most widely used services on the Internet. It enables
users to send and receive messages, including text, images, videos, and files, over the
internet. Emails follow a client-server model, where the sender and recipient communicate
through mail servers and protocols.
An email address typically follows the structure: [email protected], where:
• username identifies the user
• @ is a mandatory separator
• domain.com specifies the server handling the email
Emails can be sent using SMTP (Simple Mail Transfer Protocol) and received using POP3 or
IMAP, depending on the client configuration and requirements.
Components of an Email System:-

Component Description

Email client software (e.g., Gmail, Outlook) used to compose,


User Agent (UA)
send, and receive messages.

Message Transfer Agent


Transfers emails between servers using SMTP.
(MTA)

File or folder on the mail server where incoming emails are


Mailbox
stored.

Temporary location where outgoing emails are queued for


Spool File
delivery.

Email Protocols

30
Protocol Use Port

SMTP Sending emails from client to server or server to server 25, 465, 587

POP3 Receiving and downloading emails to a local device 110

IMAP Reading and managing emails directly from the server 143

Structure of a Valid Email Address:-


• Must contain one @ symbol
• Username should not exceed 64 characters
• Domain name must not exceed 254 characters
• Cannot begin or end with a dot (.)
• No invalid characters like []()<>;,: or spaces
• No consecutive dots (e.g., ..) allowed
Types of Email Systems:-
1. Web-Based Email (e.g., Gmail, Yahoo)
2. Client-Based Email (e.g., Outlook, Thunderbird)
3. Secure Email Services (e.g., ProtonMail)
4. Corporate Email Systems (e.g., Microsoft Exchange)
5. Disposable Email Services (e.g., 10 Minute Mail)
6. Encrypted Email Protocols (e.g., PGP, S/MIME)
Advantages:-
1. Fast, global communication
2. Cost-effective and accessible 24/7
3. Allows sending of attachments (files, photos, etc.)
4. Available across devices (PCs, phones, tablets)

Disadvantages:-
1. Prone to spam and phishing attacks
2. May lead to information overload
3. Misinterpretations due to lack of tone/body language
4. Dependent on server availability and network

Applications of Email:-

31
Domain Use Case

Professional Sharing reports, meeting invites, and memos

Personal Communicating with friends and family

E-Commerce Sending receipts, order updates, and customer service replies

Education Sharing assignments, schedules, and online course updates

Notification Alerts about transactions, subscriptions, and service announcements

Questions and Answers:-

S.
Question Answer
No.

SMTP (Simple Mail Transfer Protocol) is used


Which protocol is used for sending
1 to send emails from client to server or between
emails from a client to a server?
servers.

Port 25 is the default; however, 465 (SMTPS) and


What is the default port number for
2 587 (submission) are also used for encrypted
SMTP?
transmission.

Which protocol allows users to


IMAP allows users to read and manage emails on
3 access emails stored on a mail
the server itself, supporting synchronization.
server?

POP3 downloads and removes emails from the


What is the main difference
4 server; IMAP retains emails on the server,
between POP3 and IMAP?
supporting multi-device access.

The MX (Mail Exchange) record specifies the


Which DNS record type specifies
5 mail server responsible for accepting emails for a
the mail server for a domain?
domain.

Misinterpretation of tone, grammar errors, lack of


What are common causes of email
6 context, and missing attachments can lead to
miscommunication?
confusion.

Secure services like ProtonMail offer end-to-end


How do secure email services
7 encryption, preventing even the server from
differ from regular ones?
accessing message contents.

32
Practical 10
Aim:- To configure FTP connection.

33
Theory:-File transfer protocol (FTP) is an Internet tool provided by TCP/IP. The first
feature of FTP was developed by Abhay Bhushan in 1971. It helps to transfer files from one
computer to another by providing access to directories or folders on remote computers and
allows software, data, and text files to be transferred between different kinds of computers.
The end-user in the connection is known as localhost and the server which provides data is
known as the remote host.

Goals:-
1. It encourages the direct use of remote computers.
2. It shields users from system variations (operating system, directory structures, file
structures, etc.)
3. It promotes the sharing of files and other types of data.

Why FTP
FTP is a standard communication protocol. There are various other protocols like HTTP
which are used to transfer files between computers, but they lack clarity and focus as
compared to FTP. Moreover, the systems involved in connection are heterogeneous systems,
i.e. they differ in operating systems, directories, structures, character sets, etc the FTP shields
the user from these differences and transfers data efficiently and reliably.
FTP can transfer ASCII, EBCDIC, or image files. The ASCII is the default file share format,
in this, each character is encoded by NVT ASCII. In ASCII or EBCDIC the destination must
be ready to accept files in this mode. The image file format is the default format for
transforming binary files.
FTP Clients
FTP works on a client-server model. The FTP client is a program that runs on the user’s
computer to enable the user to talk to and get files from remote computers. It is a set of
commands that establishes the connection between two hosts, helps to transfer the files, and
then closes the connection.
Some of the commands are: get the filename(retrieve the file from the directories get server),
mget filename(retrieve multiple files from the server ), ls(lists files available in the current
directory of the server). There are also built-in FTP programs, which makes it easier to
transfer files and it does not require remembering the commands.

Type of FTP Connections


FTP connections are of two types:
1. Active FTP connection: In an Active FTP connection, the client establishes the command
channel and the server establishes the data channel. When the client requests the data over
the connection the server initiates the transfer of the data to the client. It is not the default
connection because it may cause problems if there is a firewall in between the client and the
server.
2. Passive FTP connection: In a Passive FTP connection, the client establishes both the data
channel as well as the command channel. When the client requests the data over the
connection, the server sends a random port number to the client, as soon as the client receives
this port number it establishes the data channel. It is the default connection, as it works better
even if the client is protected by the firewall.

Anonymous FTP
Some sites can enable anonymous FTP whose files are available for public access. So, the
user can access those files without any username or password. Instead, the username is set to

34
anonymous and the password to the guest by default. Here, the access of the user is very
limited. For example, the user can copy the files but not allowed to navigate through
directories.

How FTP works


The FTP connection is established between two systems and they communicate with each
other using a network. So, for the connection, the user can get permission by providing the
credentials to the FTP server or can use anonymous FTP.
When an FTP connection is established, there are two types of communication channels are
also established and they are known as command channel and data channel. The command
channel is used to transfer the commands and responses from client to server and server to
client. FTP uses the same approach as TELNET or SMTP to communicate across the control
connection. It uses the NVT ASCII character set for communication. It uses port number 21.
Whereas the data channel is used to actually transfer the data between client and server. It
uses port number 20.
The FTP client using the URL gives the FTP command along with the FTP server address.
As soon as the server and the client get connected to the network, the user logins using User
ID and password. If the user is not registered with the server, then also he/she can access the
files by using the anonymous login where the password is the client’s email address. The
server verifies the user login and allows the client to access the files. The client transfers the
desired files and exits the connection. The figure below shows the working of FTP.

Detail Steps of FTP


1. FTP client contacts FTP server at port 21 specifying TCP as transport protocol.
2. Client obtains authorization over control connection.
3. Client browse remote directory by sending commands over control connection.
4. When server receives a command for a file transfer, the server open a TCP data
connection to client.
5. after transferring one file, server closes connection.
6. Server opens a second TCP data connection to transfer another file.
7. FTP server maintains state i.e. current directory, earlier authentication.

Transmission Mode

35
FTP transfer files using any of the following modes:
1. Stream Mode: It is the default mode. In stream mode, the data is transferred from FTP
to TCP in stream bytes. Here TCP is the cause for fragmenting data into small
segments. The connection is automatically closed if the transforming data is in the
stream bytes. Otherwise, the sender will close the connection.
2. Block Mode: In block mode, the data is transferred from FTP to TCP in the form of
blocks, and each block followed by a 3-byte header. The first byte of the block contains
the information about the block so it is known as the description block and the other
two bytes contain the size of the block.
3. Compressed Mode: This mode is used to transfer big files. As we know that, due to
the size limit we can not transfer big files on the internet, so the compressed mode is
used to decrease the size of the file into small and send it on the internet.

Advantages
1. Multiple transfers: FTP helps to transfer multiple large files in between the systems.
2. Efficiency: FTP helps to organize files in an efficient manner and transfer them
efficiently over the network.
3. Security: FTP provides access to any user only through user ID and password.
Moreover, the server can create multiple levels of access.
4. Continuous transfer: If the transfer of the file is interrupted by any means, then the
user can resume the file transfer whenever the connection is established.
5. Simple: FTP is very simple to implement and use, thus it is a widely used connection.
6. Speed: It is the fastest way to transfer files from one computer to another.

Disadvantages
1. Less security: FTP does not provide an encryption facility when transferring files.
Moreover, the username and passwords are in plain text and not a combination of
symbols, digits, and alphabets, which makes it easier to be attacked by hackers.
2. Old technology: FTP is one of the oldest protocols and thus it uses multiple TCP/IP
connections to transfer files. These connections are hindered by firewalls.
3. Virus: The FTP connection is difficult to be scanned for viruses, which again increases
the risk of vulnerability.
4. Limited: The FTP provides very limited user permission and mobile device access.
5. Memory and programming: FTP requires more memory and programming efforts,
as it is very difficult to find errors without the commands.

Applications
The following are the applications of FTP:
1. FTP connection is used by different big business organizations for transferring files
in between them, like sharing files to other employees working at different locations
or different branches of the organization.
2. FTP connection is used by IT companies to provide backup files at disaster recovery
sites.
3. Financial services use FTP connections to securely transfer financial documents to
the respective company, organization, or government.
4. Employees use FTP connections to share any data with their co-workers.

36
Questions and Answers:-
Question
Question Answer
No.
FTP is used to transfer files between
What is the primary computers over a network. It allows
1
purpose of FTP? uploading, downloading, and managing files
on remote servers.
What are the default Port 21 is used for control (command), and
2 port numbers used by Port 20 is used for data transfer (in active
FTP? mode).
In active mode, the server opens the data
What is the difference
connection. In passive mode, the client
3 between active and
initiates both control and data connections,
passive FTP modes?
making it firewall-friendly.
Which command is
4 used to upload a file to The PUT command is used to upload files.
the server in FTP?
FTP itself is not secure. FTPS (uses SSL/TLS)
How does FTP ensure
5 and SFTP (uses SSH) are secure alternatives
secure file transfers?
for encrypted data transfers.

37
Practical - 11
Aim:-Create a socket for HTTP for web page upload and download.
Introduction:
In this practical, we will be creating a client-server application to upload and download images
using sockets. The client will read an image file from the disk, send it to the server via a socket
connection, and the server will receive and display the image. The communication is done
using the TCP protocol.
Client Side Code:
The client reads an image from the local disk, converts it into byte format, and sends it to the
server over a socket connection. The following code demonstrates the client-side
implementation:
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.OutputStream;
import java.net.Socket;

public class Client {


public static void main(String[] args) throws Exception {
Socket soc;
BufferedImage img = null;

// Create a socket connection to the server


soc = new Socket("localhost", 4000);
System.out.println("Client is running.");

try {
System.out.println("Reading image from disk.");

// Read the image from disk

38
img = ImageIO.read(new File("C:\\Users\\sachi\\Desktop\\save.jpeg"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img, "jpg", baos);
baos.flush();
byte[] bytes = baos.toByteArray();
baos.close();

System.out.println("Sending image to server.");

// Send the image data to the server


OutputStream out = soc.getOutputStream();
DataOutputStream dos = new DataOutputStream(out);
dos.writeInt(bytes.length); // Send the length of the image data
dos.write(bytes, 0, bytes.length); // Send the image data
System.out.println("Image sent to server.");

dos.close();
out.close();
} catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
soc.close();
}
soc.close();
}
}
Server Side Code:
The server listens on a specified port for incoming connections. Upon receiving a connection,
it reads the incoming image data and displays it in a graphical window.
import java.net.*;
import java.io.*;
import java.awt.image.*;

39
import javax.imageio.*;
import javax.swing.*;

public class Server {


public static void main(String args[]) throws Exception {
ServerSocket server = null;
Socket socket;

// Create a server socket to listen on port 4000


server = new ServerSocket(4000);
System.out.println("Server Waiting for image");

// Accept the incoming connection from the client


socket = server.accept();
System.out.println("Client connected.");

// Receive the image data


InputStream in = socket.getInputStream();
DataInputStream dis = new DataInputStream(in);
int len = dis.readInt();
System.out.println("Image Size: " + len / 1024 + "KB");

byte[] data = new byte[len];


dis.readFully(data);
dis.close();
in.close();

// Convert byte data into a BufferedImage


InputStream ian = new ByteArrayInputStream(data);
BufferedImage bImage = ImageIO.read(ian);

40
// Display the image in a window
JFrame f = new JFrame("Server");
ImageIcon icon = new ImageIcon(bImage);
JLabel l = new JLabel();
l.setIcon(icon);
f.add(l);
f.pack();
f.setVisible(true);
}
}

Explanation:
• Client Side: The client reads an image from the disk using ImageIO.read() and converts
it into a byte array using ByteArrayOutputStream. The byte array is then sent to the
server through the socket connection.
• Server Side: The server listens for incoming connections. Once connected, it reads the
image size and data, then displays it using ImageIO.read() and JFrame.

Output:-

41
Questions and Answers:
No. Question Answer

Sockets enable communication between a client and


What is the role of sockets in
1 server over a network by allowing data to be sent and
client-server communication?
received.

The client reads the image from the disk, converts it


How does the client send the
2 into a byte array, and sends it to the server through a
image data to the server?
socket connection.

ByteArrayOutputStream is used to convert the image


Why is ByteArrayOutputStream
3 into a byte array, which can then be sent over the
used in the client code?
network.

What does the server do when it The server reads the image data, converts it into a
4
receives the image data? BufferedImage, and then displays it in a JFrame.

DataInputStream is used to read primitive data types


Why does the server use
5 (like integers and byte arrays) from the input stream in
DataInputStream to read data?
a binary format.

42
No. Question Answer

dos.writeInt() is used to send the length of the image


What is the significance of the
6 data to the server, so the server knows how much data
dos.writeInt() method?
to expect.

The image is displayed in a JFrame by creating an


Why does the image appear in a
7 ImageIcon and setting it in a JLabel, which is added to
JFrame on the server side?
the frame to visually render the image.

43
Practical - 12
Aim:-Study of TCP/UDP performance.
Introduction:
TCP (Transmission Control Protocol): TCP is a connection-oriented transport layer protocol
that facilitates the transmission of data packets from the source to the destination. TCP ensures
reliable communication by establishing a connection between the source and destination before
transmitting data. It divides the data into packets, numbers them, and transmits them to the
destination. The receiver reassembles the packets and sends them to the application layer. The
connection remains established until the entire communication is completed.

UDP (User Datagram Protocol): UDP is a connectionless protocol in the transport layer. It is
known for its simplicity and speed, but it does not guarantee reliability. Unlike TCP, UDP does
not establish a connection or wait for acknowledgements. It is used for time-sensitive
applications where speed is more important than reliability, such as real-time video streaming,
VoIP, etc. While UDP provides basic error-checking, it does not address other issues such as
packet loss or out-of-order delivery.

Comparison of TCP and UDP:

Basis of Comparison TCP UDP

Acronym Transmission Control Protocol User Datagram Protocol

Type of Connection Connection-oriented protocol Connectionless protocol

Forwards data directly to the


Establishes connection before
Function destination without
communication
connection

Uses SYN, SYN-ACK, ACK No handshake


Handshake
handshake (connectionless protocol)

Reliable communication, e.g., web Fast communication, e.g.,


Usage
browsing, email video streaming, VoIP

DNS, DHCP, TFTP, SNMP,


Protocols Using HTTP, HTTPS, FTP, SMTP, Telnet
RIP, VoIP

Ordering of Data
Guarantees ordered packet delivery No fixed order of packets
Packets

Slower due to the connection setup and


Speed of Transfer Faster and simpler than TCP
error checking

44
Basis of Comparison TCP UDP

Unreliable, no guarantee of
Reliability Reliable, guarantees data delivery
delivery

Header Size 20-80 bytes variable length header 8 bytes fixed length header

Source port, Destination port, Sequence


Common Header Source port, Destination port,
number, Acknowledgement number,
Fields Length, Checksum
Flags, etc.

Packets are independent of


Streaming of Data Data is treated as a stream of bytes
each other

Weight Heavy-weight protocol Lightweight protocol

Follows flow control to avoid


Data Flow Control No flow control
congestion

Extensive error checking and Basic error checking with


Error Checking
acknowledgment checksums

Three-way handshake with No acknowledgment or


Acknowledgement
acknowledgment retransmission of lost data

Questions and Answers:


No. Question Answer

What is the main


TCP is connection-oriented, ensuring reliable data delivery,
1 difference between TCP
while UDP is connectionless and faster but unreliable.
and UDP?

Why is TCP considered TCP is reliable because it ensures data delivery using
2
reliable? acknowledgment, error checking, and flow control.

In which scenario would UDP is preferred in time-sensitive applications like real-time


3 you prefer UDP over video streaming or VoIP, where speed is more important than
TCP? reliability.

The handshake (SYN, SYN-ACK, ACK) in TCP establishes


What is the role of the
4 a reliable connection between the sender and receiver before
handshake in TCP?
data transmission.

45
No. Question Answer

Why does UDP have a


UDP has a simpler structure and fewer header fields (8 bytes)
5 smaller header size than
compared to TCP's more detailed 20-80 byte header.
TCP?

Can UDP guarantee No, UDP does not guarantee packet delivery, and packets may
6
packet delivery? be lost or arrive out of order.

How does TCP handle TCP handles lost or corrupted data by using acknowledgment
7
lost or corrupted data? and retransmission mechanisms, ensuring reliable delivery.

46
Practical-13
Aim:- To simulate the working of ARP (Address Resolution Protocol) and RARP
(Reverse Address Resolution Protocol) protocols using Java.

Objective:
The ARP protocol is used to map a known IP address to a MAC (Physical) address in a local
network, while RARP maps a MAC address to an IP address. In this practical, we will
implement ARP using client-server programming.

Explanation:
• Client Side: The client will send an IP address to the server, and the server will return
the corresponding MAC address.
• Server Side: The server will listen for requests from the client, check the IP address,
and send the corresponding MAC address.
1. Client Side Code (Java):

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.Socket;

class Client {
public static void main(String args[]) {
try {
BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
Socket clientSocket = new Socket("127.0.0.1", 5604); // Connect to server on
localhost, port 5604
DataInputStream din = new DataInputStream(clientSocket.getInputStream());
DataOutputStream dout = new
DataOutputStream(clientSocket.getOutputStream());

System.out.println("Enter the Logical address (IP):");


String ipAddress = in.readLine(); // Read IP address input from user

dout.writeBytes(ipAddress + '\n'); // Send IP address to the server

String macAddress = din.readLine(); // Receive the corresponding MAC


address
System.out.println("The Physical Address (MAC) is: " + macAddress);

clientSocket.close(); // Close the socket connection


} catch (Exception e) {

47
System.out.println(e);
}
}
}
Explanation of Client Code:
• The client establishes a socket connection to the server at IP 127.0.0.1 and port 5604.
• It prompts the user to enter a logical address (IP address) and sends it to the server.
• The server responds with the corresponding MAC address, which the client displays on
the console.

2. Server Side Code (Java):


import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.ServerSocket;
import java.net.Socket;

class ServerARP {
public static void main(String args[]) {
try {
ServerSocket serverSocket = new ServerSocket(5604); // Server listens on port 5604
Socket clientSocket = serverSocket.accept(); // Accept client connection

while (true) {
DataInputStream din = new DataInputStream(clientSocket.getInputStream());
DataOutputStream dout = new
DataOutputStream(clientSocket.getOutputStream());

String requestedIP = din.readLine(); // Read the requested IP address from client

// Define a set of IP addresses and corresponding MAC addresses


String ipAddresses[] = {"165.165.80.80", "165.165.79.1", "190.154.20.24"};
String macAddresses[] = {"6A:08:AA:C2", "8A:BC:E3:FA", "5D:AC:E5:AD"};

48
// Check if the IP address matches and return the corresponding MAC address
for (int i = 0; i < ipAddresses.length; i++) {
if (requestedIP.equals(ipAddresses[i])) {
dout.writeBytes(macAddresses[i] + '\n'); // Send the MAC address to the client
break;
}
}
}
} catch (Exception e) {
System.out.println(e);
}
}
}
Explanation of Server Code:
• The server listens for incoming connections on port 5604.
• Once a client connects, the server reads the requested IP address from the client.
• The server checks the IP address against a predefined list of IPs and their corresponding
MAC addresses.
• If a match is found, the server sends the corresponding MAC address back to the client.

Working:
1. Client Side:
o The client enters an IP address.
o The client sends the IP address to the server and waits for a response.
o The client displays the corresponding MAC address received from the server.
2. Server Side:
o The server waits for incoming requests from clients.
o Upon receiving an IP address, the server checks it against a list of predefined
IP-MAC pairs.
o The server sends the corresponding MAC address back to the client.

49
Output:-

Question and Answers:


No. Question Answer

ARP (Address Resolution Protocol) is used to map an IP address


1 What is ARP?
to a MAC address.

RARP (Reverse Address Resolution Protocol) is used to map a


2 What is RARP?
MAC address to an IP address.

ARP works by sending a broadcast message to the network to find


3 How does ARP work?
the MAC address corresponding to a given IP address.

What is the purpose of RARP allows a device to discover its IP address when it knows
4
RARP? only its MAC address.

A MAC (Media Access Control) address is a unique hardware


What is a MAC
5 address assigned to a network interface card (NIC) to identify
address?
devices on a network.

What is the difference


ARP maps an IP address to a MAC address, whereas RARP maps
6 between ARP and
a MAC address to an IP address.
RARP?

ARP is essential in networks for devices to communicate with


Why do we need ARP
7 each other by resolving an IP address into the corresponding
in networks?
MAC address, enabling proper data transmission.

50
Practical-14
Aim:To study and compare the performance of various Media Access
Control (MAC) protocols, specifically focusing on ALOHA, CSMA, and
CSMA/CD.
Theory:
The Media Access Control (MAC) sub-layer is part of the Data Link Layer in the OSI model.
It is responsible for managing how devices access the shared communication medium and how
data is transmitted without collision. The MAC layer is critical in controlling access to a
network, ensuring efficient communication by managing transmission and collision detection.
In shared communication networks, multiple nodes might transmit simultaneously, leading to
collisions. MAC protocols define how nodes should behave to avoid these collisions.
The MAC sub-layer has two primary functions:
1. Data Encapsulation: Ensuring correct frame assembly before transmission.
2. Media Access Control: Coordinating transmission initiation and collision recovery.
The following MAC protocols are commonly used:
1. ALOHA (Areal Location of Hawaiian Access):
• ALOHA was developed in the 1970s at the University of Hawaii for coordinating
access to a shared communication channel.
• In ALOHA, a node transmits whenever it has data to send. If a collision occurs (when
two nodes transmit simultaneously), the data is lost. Nodes listen to the channel to
determine if their transmission was successful and retransmit after a random delay if
necessary.
2. CSMA (Carrier Sense Multiple Access):
• CSMA is a method used in shared network topologies like Ethernet. Devices "sense"
the channel before transmitting. If the channel is free, they transmit; otherwise, they
wait.
• While CSMA reduces the likelihood of collisions, it does not eliminate them
completely.
3. CSMA/CD (Carrier Sense Multiple Access with Collision Detection):
• CSMA/CD is an enhancement of CSMA used in Ethernet networks. If two devices
transmit at the same time, a collision occurs. CSMA/CD detects the collision, stops
transmission, waits for a random time, and then retransmits the data.
• CSMA/CD performs well under moderate traffic but suffers from performance
degradation under heavy traffic due to frequent collisions.

51
Observations:
• Collision Rate: Measure how often collisions occur in each protocol.
• Throughput: The amount of data successfully transmitted across the network.
• Network Efficiency: The percentage of the network's total capacity used for successful
transmission.

Conclusion:
Based on the study, the following conclusions can be drawn:
• ALOHA is simple but inefficient due to high collision rates and poor throughput.
• CSMA performs better than ALOHA but still suffers from collisions and performance
degradation under heavy traffic.
• CSMA/CD is the most efficient protocol under normal conditions, with good collision
detection and recovery. However, its performance decreases significantly under heavy
network traffic.

Questions and Answers:


S.no. Conceptual Question Answer

What is the role of the Media Access The MAC layer controls access to the shared
1 Control (MAC) layer in a network, medium, preventing collisions and ensuring
and why is it essential? efficient data transmission.

Explain the difference between ALOHA transmits without checking the channel,
2 ALOHA and CSMA in terms of leading to collisions, while CSMA listens to the
collision handling. channel before transmitting to avoid collisions.

CSMA/CD detects collisions, stops transmission,


How does CSMA/CD handle
and retransmits after a random delay. High traffic
3 collisions, and what impact does this
leads to more collisions and reduced
have on network performance?
performance.

What are the advantages and


ALOHA is simple but inefficient due to high
4 limitations of the ALOHA protocol in
collision rates and low throughput.
a shared network environment?

How does CSMA reduce the CSMA senses the channel before transmitting,
5 likelihood of collisions compared to reducing the chance of collisions, unlike
ALOHA? ALOHA, which transmits anytime.

52
S.no. Conceptual Question Answer

Why does network performance


High traffic increases collisions, causing delays
6 decrease when traffic is high in
and reducing throughput.
CSMA/CD networks?

What factors determine the efficiency Efficiency depends on collision handling and
7 of a MAC protocol, and how do these channel access. Higher traffic increases
factors vary with traffic load? collisions, reducing efficiency.

53
Pracrical-15
Aim:-To study the performance comparison of different routing protocols used in
computer networks.

Introduction:
A routing protocol specifies how routers communicate with each other to select routes
between any two nodes in a computer network. These protocols enable routers to share
information about the network topology, helping them make decisions about the best paths for
data transmission. A routing algorithm determines the specific route a packet will follow from
the source to the destination. Each router only has knowledge of its directly connected network,
and it shares this information with neighboring routers, gradually disseminating the topology
information throughout the entire network.
There are three major classes of routing protocols commonly used in IP networks:
1. Interior Gateway Protocols (IGPs):
o Link-state routing protocols, such as OSPF (Open Shortest Path First).
o Distance-vector routing protocols, such as RIP (Routing Information
Protocol), RIPv2, and IGRP (Interior Gateway Routing Protocol).
2. Exterior Gateway Protocols (EGPs):
o Used for exchanging routing information between Autonomous Systems (AS)
on the internet, such as BGP (Border Gateway Protocol).

Routing Protocol Types:


1. Distance-Vector Routing Protocols:
Distance-vector routing uses the Bellman-Ford algorithm to determine the best route based
on the direction (vector) and the distance to any destination node. Routers periodically send
their routing tables to their neighbors, which allows them to determine the shortest path to a
destination node based on the hop count.
Key Points:
• Uses Bellman-Ford algorithm for calculating the shortest path.
• Each router sends information periodically to its neighbors.
• The metric used is typically hop count.
• RIP (Routing Information Protocol) is an example of a distance-vector protocol.
• Requires less CPU and memory compared to link-state protocols.
• Updates are step-by-step and may cause high bandwidth consumption as each router
sends its entire routing table.

54
2. Link-State Routing Protocols:
In link-state routing, each router builds and maintains a complete topology map of the entire
internetwork (or at least the partition to which the router is attached). Routers only send updates
when there is a change in the network topology. These updates are event-driven, reducing
bandwidth usage.
Link-state protocols use the Dijkstra algorithm to calculate the shortest path to any destination.
Key Points:
• Uses the Dijkstra algorithm for calculating the shortest path.
• Each router has complete knowledge of the network's topology.
• OSPF (Open Shortest Path First) and BGP (Border Gateway Protocol) are examples of
link-state protocols.
• Requires more CPU and memory compared to distance-vector protocols, as routers
must store the entire network's topology.
• Typically faster convergence but with higher processing overhead.

3. Hybrid Routing Protocols:


Hybrid routing protocols combine elements of both distance-vector and link-state protocols.
These protocols use metrics to assign preferences to routes, similar to distance-vector
protocols, but with more accurate metrics. Updates are event-driven, like link-state protocols,
which helps the network converge quickly.
Key Points:
• Combines the best features of both distance-vector and link-state protocols.
• Uses metrics to assign preferences to routes.
• Updates are event-driven rather than periodic, like link-state protocols.
• Typically provides faster convergence than distance-vector protocols and reduces the
cost of updates compared to link-state protocols.
• EIGRP (Enhanced Interior Gateway Routing Protocol) is an example of a hybrid
routing protocol.

Comparison of Routing Protocols:

55
Updat Suppor
Protoc Algorith Convergen Classle Administrat
Type Metric e ts
ol m ce ss ive Distance
Timer VLSM

Distan 30
Bellman-
RIPv1 ce Hop Count Slow secon No No 120
Ford
Vector ds

Distan 30
Bellman-
RIPv2 ce Hop Count Slow secon Yes Yes 120
Ford
Vector ds

Distan 90
Bandwidth/De Bellman-
IGRP ce Slow secon No No 100
lay Ford
Vector ds

Chang
90 (internal),
EIGR Bandwidth/De e
Hybrid DUAL Very Fast Yes Yes 170
P lay occurs
(external)
only

Chang
Link- e
OSPF Cost Dijkstra Fast Yes Yes 110
State occurs
only

Chang
Link- e
IS-IS Cost Dijkstra Fast Yes Yes 115
State occurs
only

Chang
20 (internal),
Path Multiple e
BGP Best Path Average Yes Yes 200
Vector Attributes occurs
(external)
only

Questions and Answers:

56
S.No. Question Answer

Distance-vector uses periodic updates with hop


Difference between distance-vector
1 count; link-state uses event-driven updates with
and link-state protocols?
complete topology knowledge.

What is the Bellman-Ford Used in distance-vector protocols to find the


2
algorithm in routing? shortest path based on hop count.

Why do link-state protocols require Link-state requires storing the entire network
3
more resources? topology, demanding more CPU and memory.

Purpose of the Dijkstra algorithm in It calculates the shortest path from the source to all
4
link-state protocols? other routers in the network.

Convergence time difference Link-state converges faster due to event-driven


5 between distance-vector and link- updates, while distance-vector has slower
state? convergence.

Hybrid combines distance-vector and link-state


What is a hybrid routing protocol,
6 features for faster convergence and efficient
and its advantage?
routing.

Why is BGP a path-vector BGP uses multiple attributes, like AS path, to


7
protocol? select the best route, rather than a single metric.

57

You might also like