0% found this document useful (0 votes)
15 views39 pages

Cnip Final

The document outlines a practical lab file for a Computer Network and Internet Protocol course, detailing various experiments related to networking tools and protocols. It includes instructions for using tools like Wireshark, Network Miner, and commands such as ping and tracert, along with applications of bandwidth analyzers and packet capture techniques. The lab is intended for students in their second year of an Artificial Intelligence program at Delhi Technical Campus.

Uploaded by

Rishika Soni
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)
15 views39 pages

Cnip Final

The document outlines a practical lab file for a Computer Network and Internet Protocol course, detailing various experiments related to networking tools and protocols. It includes instructions for using tools like Wireshark, Network Miner, and commands such as ping and tracert, along with applications of bandwidth analyzers and packet capture techniques. The lab is intended for students in their second year of an Artificial Intelligence program at Delhi Technical Campus.

Uploaded by

Rishika Soni
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

PRACTICAL FILE

SESSION: 2023-24
COMPUTER
NETWORK
AND
INTERNET PROTOCOL
LAB (AIML-256)
II Year, IV Sem

Submitted to: Submitted by:


Name: Ms. Neha Sehgal Designation: Name: Nikhil Saini
Assistant Professor Enrollment No:
01318011623

Department of Artificial Intelligence


Delhi Technical Campus, Greater Noida
INDEX

S.N PROGRAM NAME DATE OF DATE OF SIG


O EXPERIMENT SUBMISSION N.
1 Introduction to basic networking tools:
Wireshark and Network Miner.
2 Introduction to Datadog tool for data
monitoring in network.
3 Running and using services/commands like
ping, trace, route, nslookup arp,ftp etc.
4 Introduction to Network Bandwidth
analyser tool for network monitoring.
5 Implementation of Packet Capture and
observations using packet Sniffer
6 Explore various aspects of HTTP Protocol.

7 Tracing DNS with Wireshark.

8 Analyzing various parameters for TCP


protocol in act.
9 Create Ring, Bus, Star and Mesh topologyusing
Cisco Packet Tracer.
10 Configure a network using distance vecior
routing and link state vector routing protocol.
11 Implement dijkstra's shortest path algorithm in
network routing.
Experiment 01
Wireshark
AIM:1. Introduction to basic networking tools: Wireshark, Network Miner and Datadog
tool for data monitoring in network.

Introduction- Wireshark is a software tool used to monitor the network traffic through a
network interface. It is the most widely used network monitoring tool today. Wireshark
is loved equally by system administrators, network engineers, network enthusiasts,
network security professionals and black hat hackers.
The extent of its popularity is such, that experience with Wireshark is considered as
a valuable/essential trait in a computer networking-related professional.

Reasons why Wireshark is so popular :

1. It has a great GUI as well as a conventional CLI(T Shark).


2. It offers network monitoring on almost all types of network standards (ethernet,
wlan, Bluetooth etc)
3. It is open-source with a large community of backers and developers.
4. All the necessary components for monitoring, analyzing and documenting the
network traffic are present. It is free to use.

Wireshark installation:

Step-1 : Download Wireshark from www.wireshark.org and select Windows x64 Installer.
Step-2: Select every option and click on next button till install window.

Step-3 : Click on install and “I agree” option.

Step-4: Open Wireshark using its extension.


Network Miner

Introduction:- Wireshark is the default goto tool for analyzing captured network traffic for
most network engineers. But there are a few other free and open source alternatives that are
sometimesoverlooked, one of which is NetworkMiner.

Network Miner Installation:-

Step1: Install NetworkMiner from www.netresec.com and extract it as zip file.

Step-2: Relaunch the windows and open NetworkMiner.


A data logger (also datalogger or data recorder) is an electronic device that records data
over time or about location either with a built-in instrument or sensor or via external
instruments and sensors. Increasingly, but not entirely, they are based on a digital processor
(or computer), and called digital data loggers (DDL). They generally are small, battery-
powered, portable, and equipped with a microprocessor, internal memory for data storage,
and sensors. Some data loggersinterface with a personal computer and use software to
activate the data logger and view and analyze the collected data, while others have a local
interface device (keypad, LCD) and can be used as a stand-alone device.
Data loggers vary from general-purpose types for a range of measurement applications to
very specific devices for measuring in one environment or application type only. It is
common for general purpose types to be programmable; however, many remain as static
machines with only alimited number or no changeable parameters. Electronic data loggers
have replaced chart recorders in many applications.

Data formats
Standardization of protocols and data formats has been a problem but is now growing in
the industry and XML, JSON, and YAML are increasingly being adopted for data
exchange. The development of the Semantic Web and the Internet of Things is likely to
accelerate this presenttrend.
Applications:-

● Unattended weather station recording (such as wind speed /


direction, temperature, relativehumidity, solar radiation).
● Unattended hydrographic recording (such as water level, water depth, water
flow, water pH,water conductivity).
● Unattended soil moisture level recording.
● Unattended gas pressure recording.
● Offshore buoys for recording a variety of environmental conditions.
● Road traffic counting.

Examples:-

● Black-box (stimulus/response) loggers:


o A flight data recorder (FDR) is a piece of recording equipment used to
collect specific aircraft performance data. The term may also be used, albeit
less accurately, to describethe cockpit voice recorder (CVR), another type
of data recording device found on boardaircraft.
o An event data recorder (EDR) is a device installed by the manufacturer in
some automobiles which collects and stores various data during the
time-frame immediatelybefore and after a crash.
o A voyage data recorder (VDR) is a data recording system designed to
collect data fromvarious sensors on board a ship.
o A train event recorder is a device that records data about the operation of
train controls andperformance in response to those controls and other
train control systems.
o An accident data recorder (ADR) is a device for triggering accidents or incidents in
most kind of land vehicles and recording the relevant data. In automobiles, all
diagnostic trouble codes (DTCs) are logged in engine control units (ECUs) so that
at the time of service of a vehicle, a service engineer will read all the DTCs using
Tech-2 or similar tools connected tothe on-board diagnostics port, and will come
to know problems occurred in the vehicle. Sometimes a small OBD data logger is
plugged into the same port to continuously record vehicle data.
o In embedded system and digital electronics design, specialized
high-speed digital datalogger help overcome the limitations of more
traditional instruments such as
the oscilloscope and the logic analyzer. The main advantage of a data logger is
its ability torecord very long traces, which proves very useful when trying to
correct functional bugs that happen once in while.
o In the racing industry, Data Loggers are used to record data such as
braking points,lap/sector timing, and track maps, as well as any on-board
vehicle sensors.
● Health data loggers:
o The growing, preparation, storage and transportation of food. Data logger
is generally usedfor data storage and these are small in size.
o A Holter monitor is a portable device for continuously monitoring various
electrical activityof the cardiovascular system for at least 24 hours.
o Electronic health record loggers.
● Other general data acquisition loggers:
o An (scientific) experimental testing data acquisition tool.
o Ultra Wideband Data Recorder, high-speed data recording up to 2
Giga Samples persecond.
EXPERIMENT 02

AIM: Running and using commands like ping, trace, route, nslookup, ftp, etc

Tracert: This command is used to diagnose path-related problems. On an IP network,


routers exchange IP packets between the source and the destination. They take IP packets
from the source host and forward them in a sequence until they reach the destination host.
The sequence of routers between the source and destination is known as the path. A path
consists of all routers in a sequence that IP packets sent from the source host traverse to
reach the destination host.

The tracert command prints the path. If all routers on the path are functional, this command
prints the full path. If a router is down on the path, this command prints the path up to the
last operational router.

The tracert command uses the following syntax.

The following table lists some important options of the tracert command.

● -d : Do not resolve the IP addresses of intermediate routers to their names.


● -h : Specifies the maximum number of hops to search on the path. The default is 30 hops.
● -w : Specifies the amount of time in milliseconds to wait for a reply message from the router.

Ping :- The ping command is used to test connectivity between two hosts. It sends ICMP
echo request messages to the destination. The destination host replies with ICMP reply
messages. If the ping command gets a reply from the destination host, it displays the reply
along with round-trip times.

The ping command uses the following syntax.


Ipconfig :- This command displays all current TCP/IP network configuration values and
refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS)
settings. This command is mainly used to view the IP addresses on the computers that are
configured to obtain theirIP address automatically.

The following image shows the sample output of this command

Arp :- To send IP packets, a computer needs two addresses. These addresses are the MAC
address and the IP address. A MAC address is the physical or hardware address of the NIC.
An IP address is the logical or software address of NIC. If a computer knows the IP address
of the destination computerbut it does not know the MAC address of the destination
computer, it uses the ARP protocol to knowthe MAC address of the destination computer.
The ARP protocol broadcasts a given IP address over a local network. The corresponding
host responds to the broadcast with its MAC address. To avoid repetition, ARP stores the
answer in a tableknown as ARP table. ARP maintains a separate ARP table for each NIC.

To view the ARP table, you can use the following command.

Netstat :-
This command displays active connections, ports on which the computer is listening,
Ethernet statistics, the IP routing table, and IP statistics.

The output of this command is organized in rows and columns. Each row represents a new
connection or an entry in the output. It contains four columns. These columns provide the
following informationabout the row.

Proto: - This column displays the name of the protocol (TCP or UDP).

Local Address: - This column displays the IP address of the local computer and the port
number being used. If the port is not yet established, the port number is shown as an asterisk
(*).

Foreign Address: - This column displays the IP address and port number of the remote
computer towhich the port is connected.
State: - This column displays the status of the connection.

The following image shows the sample output of this command.


EXPERIMENT 03

Aim: Introduction to Network Bandwidth analyzer tool for network monitoring.


Theory:

A bandwidth analyzer is a type of software that detects, collects, monitors, and analyzes
network bandwidth data and metrics. It is used by network administrators to view the
overall network/Internet bandwidth that a particular network is receiving and sending. Here
are some key points about bandwidth analyzers:

Function: A bandwidth analyzer is part of network management software. It is usually


installed or operates at the network gateway, recording each packet that moves in or out of
the network.

Measurement: Its key function is to provide the amount/size of data that is downloaded or
uploaded and the overall bandwidth being used.

Advanced Features: Enterprise-level bandwidth analyzers can drill into the details of each
network packet, offering performance and security-related data. This includes peak usage
time, most-used protocols, active systems, source and destination IP addresses, and more.

Alerts: Bandwidth analyzers can also alert network administrators when a bandwidth use
threshold is reached, providing application/user/system-specific bandwidth use details.

Traffic Analysis: They provide detailed insights into the traffic patterns on your network.

Bandwidth Monitoring: Track the amount of bandwidth being used by various devices
and applications.

Performance Dashboards: Visualize network performance metrics in real-time through


intuitive dashboards.
Some of the Network Bandwidth Analyzer tools are as follows:

SolarWinds NetFlow Traffic Analyzer: This tool provides comprehensive network


bandwidth analysis and performance monitoring. It communicates with network devices to
extract traffic dataand can manage multi-vendor networks. It runs on Windows Server.

Site24x7 Network Bandwidth Monitoring: A SaaS service that monitors network traffic
using flow protocols. It’s great for tracking bandwidth usage and identifying potential
issues. You can start a 30-day free trial.

Paessler PRTG Network Monitor: PRTG offers a bundle of monitoring tools for
networks, servers, and applications. It includes traffic sampling sensors for effective traffic
management. Thesoftware installs on Windows Server.

Datadog Network Performance Monitoring: Datadog’s cloud-based package tracks


network traffic patterns, providing insights into performance and potential bottlenecks.

ManageEngine Network Bandwidth Monitor: This system uses various protocols to


communicate with network devices from different manufacturers. It’s available for
Windows Server, Linux, and AWS.

Nagios: A monitoring package for networks, servers, and applications. It’s available in both
free and paid versions and runs on Linux or as a VM for Windows.

Datadog Network Performance Monitoring: A cloud-based service that tracks network


traffic patterns.

ntopng: An open-source network monitor that uses nProbe for traffic flow information.

Cacti: A complete network graphing solution harnessing the power of RRDTool’s data
storage and graphing
functionality.
Experiment 04
AIM: Implementation of packet capture and observations using packet sniffer

Packet Capture refers to the action of capturing Internet Protocol (IP) packets for review or
analysis. The term can also be used to describe the files that packet capture tools output,
which areoften saved in the .pcap format. Capturing packets is a common troubleshooting
technique for network administrators, and is also used to examine network traffic for
security threats.

Following a data breach or other incident, packet captures provide vital forensic clues that
aid investigations. From a threat actor’s perspective, packet captures might be used to steal
passwordsand other sensitive data. Unlike active reconnaissance techniques like port
scanning, capturing packets can be accomplished without leaving any trace behind for
investigators.

Steps for packet capture using wireshark:

1. Download and Install Wireshark: Get Wireshark from the official website
and install it onyour computer.
2. Launch Wireshark: Open Wireshark after installation.
3. Select Network Interface: Choose the network interface (like Ethernet or Wi-
Fi) throughwhich you want to capture packets.
4. Start Capture: Click the "Start" button (usually a green shark fin icon)
to begin capturingpackets.
5. Optional Filters: Apply capture filters if needed to capture specific types of
traffic or filter bycriteria like IP addresses or protocols.
6. Stop and Save Capture: Click "Stop" (red square icon) when you've
captured enough data,then save the capture file (PCAP or PCAPNG format).
7. Analysis: Open the saved capture file in Wireshark for detailed analysis, using
filters, statistics,and other tools for deeper insights into network traffic and
protocols.
Packet sniffing
Wireshark is a packet sniffing program that administrators can use to isolate and
troubleshoot problems on the network. It can also be used to capture sensitive data like
usernames and passwords. It can also be used in wrong way (hacking) to ease drop. Packet
sniffing is defined as the process to capture the packets of data flowing across a computer
network. The Packet sniffer is a device or software used for the process of sniffing.
Overall, Wireshark's capabilities make it an essential tool for network troubleshooting,
performance optimization, security monitoring, and protocol analysis. However, it's
important to use packet sniffing tools like Wireshark responsibly and in compliance with
legal and ethical guidelines, especially when capturing sensitive or confidential information.

Steps for packet sniffing using wireshark:

1. Download and Install Wireshark: Get Wireshark from their official


website and install it onyour computer.
2. Launch Wireshark: Open Wireshark after installation.
3. Select Network Interface: Choose the network interface (like Ethernet or Wi-
Fi) that you wantto sniff packets on.
4. Start Packet Capture: Click the "Start" button in Wireshark to
begin capturing packets in real-time.
5. Analyze Captured Packets: Wireshark will display detailed information
about each packet,including source/destination IP, protocols, ports, and
more.
6. Stop and Save Capture: Click "Stop" when you're done capturing packets, and
save the capturefile for later analysis if needed.
7. Use Filters and Search: Utilize Wireshark's filtering and search features
to focus on specificpackets or types of traffic for analysis.
EXPERIMENT 05

Aim: Explore various aspects of HTTP

Protocol Theory:

Hypertext Transfer Protocol (HTTP) is an application layer protocol that is used for loading web
pages consisting of hypertext links. It is designed within the framework of Internet Protocol Suite.
This protocol aims to transfer information among network devices. It runs on top of other layers of
the network protocol stack. It is used for transferring data in the format of audio, video, hypertext,
and plain text. Hypertext Transfer Protocol has a client-server architecture. It allows the reliable
transfer of resources between the web application server and the user agent.

The various aspects of HTTP Protocol are as follows:

Client-Server Model: HTTP operates on a client-server model, where a client (such as a web
browser) sends requests to a server (such as a web server), and the server responds with the requested
resources.

Statelessness: HTTP is stateless, meaning each request from a client to the server is independent and
unrelated to any previous requests. This simplifies implementation but requires additional
mechanisms for maintaining state, such as cookies or session management.

Request Methods: HTTP defines several request methods or verbs that indicate the desired action to
be performed on a resource. Common methods include GET (retrieve a resource), POST (submit
data to be processed), PUT (store a resource), DELETE (remove a resource), and more.

Uniform Resource Identifier (URI): HTTP uses URIs to identify resources on the web. A URI
consists ofa scheme (such as "http" or "https"), a hostname, and a path to the resource.

Headers: HTTP headers provide additional information about the request or response. Request
headers can include information such as te type of content the client can accept, while response
headers can include details like the content type of the resource being returned.
Status Codes: HTTP uses status codes to indicate the result of a request. These codes are grouped
into different categories, such as 1xx for informational responses, 2xx for successful responses, 3xx
for redirection responses, 4xx for client error responses, and 5xx for server error responses.

Message Format: HTTP messages consist of a start line, headers, and an optional message body.
The startline includes the request method or status code, the URI or target resource, and the HTTP
version.

Connection Management: HTTP allows for various mechanisms for managing connections
betweenclients and servers, including keep-alive connections to reuse TCP connections for multiple
requests.

Caching: HTTP supports caching to improve performance and reduce network traffic. Both clients
andservers can use caching mechanisms to store and reuse previously requested resources.

Security: While HTTP itself is not secure, HTTPS (HTTP Secure) provides a secure version of HTTP by
encrypting data transmitted between the client and server using SSL/TLS protocols.

Advantages:
● It helps in fetching not only hypertext documents but also media like videos and images.
● Enables easy communication among devices and applications on the web.
● Reduces network congestion as there are very few TCP connections.
● It eliminates the need to ask the sender about applications that are required to read or view
file content.

Disadvantages:

● It is difficult to confirm if the web server sending the request is the same one that has
returned the response. This increases the probability that the client may be spoofed.
● There is difficulty of blocking Dos attacks under massive requests.
● Since it cannot prove the integrity of the message of communication, it is impossible to
confirm the request and received response is the same. This allows attackers to intercept and
tamper the content while the response is in transit.
Experiment 06
AIM: Tracing DNS with Wireshark
Theory:
DNS or Domain Name System abbreviated as DNS is a system used to resolve domain
names, IP addresses, different servers for e.g., FTP servers, game servers,active
directories, etc., and keep their records. Invented by Jon Postel and Paul Mockapetris in
1982, DNS has now become one of the most significant players inthe modern-day web
world.

DNS actually gives a mapping of the hostname of a network and its address. It
hasproved to ease human life manifold when one looks at its working and the service it
offers. It helps users by translating the domain names into IP addresses, allowingthem
to surf the web without memorizing such complex IP codes. Coming on to Wireshark,
which is an open-source packet analyzer and has been widely in use since its inception
in the web world, to analyze packets received or sent in a network. We can use
Wireshark to segment the DNS system and get a detailed look at it. The default port for
DNS traffic in Wireshark is 53, and the protocol is UDP (User Datagram Protocol).
After we start Wireshark, we can analyze DNS queries easily. We shall be following the
below steps:

In the menu bar, Capture → Interfaces.

Select a particular Ethernet adapter and click start.

After this, browse to any web address and then return to Wireshark. Browsing would get
packets captured and in Wireshark click the stop in the Capture menu tostop the capture.

If you haven’t got the packet list by now, you can access it using Edit → Find
Packets. This will give you the packet list.

Since we are going to analyze DNS we shall be studying only DNS packets and toget
DNS packets, only you can apply DNS in the filters above.
A basic DNS response has:

● Transaction Id-for identification of the communication done.


● Flags-for verification of response whether it is valid or not.
● Questions-default is 1 for any request sent or received. It mainly
denotes whether you have queried for something or not.
● Answers-default is 0 if the response is sent, and it’s 1 if received. If the received
packet is viewed then the Answers section has the IP address of thedesired
domain name along with Time to Live which is basically a counter which
expires after its allotted time.
Besides, these, it has a Queries section which gives the subjective details of the
communication. The queries section has the following:

Name: Domain name of the destination or web address to be reached or reached byin
case of the received packet. This section further has its length, character by character
under [Name-Length], and the count of words separated by separators, i.e., dot(.) under
the name[Labels].

Type: which is ‘A’ for IPv4 (32 bits) and is ‘AAAA‘ for IPv6 (128 bits).

Class: which is ‘IN‘ by default, which means an internet IP address has been askedfor.

Captured packets are also stored in the local machine, We can also view ourreceived
packets in command prompt by typing the following instruction:

ipconfig /displaydns:

You can have a look at the below diagram for reference. Once you have visited a
particular resource it will be stored and the next time you want to locate a particular
resource, the host will try to find it in the local storage. So this is how wecan analyze
DNS queries in Wireshark and get a detailed knowledge of DNS packet functionalities.
Checking DNS queries in Wireshark is one of the major
tools for studying network behaviors, and Wireshark is by far the leading forum
for protocol analysis because of its beginner-friendly and detailed nature.

Wireshark’s packet capturing and additional features of decoding various


protocol responses have been the biggest factor in network analysis in today’s
world.
Examining DNS can be very useful as it shows where the flaws present in the network
are. Especially in case of abnormal DNS behavior, problems arise such asdelay in
web page loading or greater response time. Weird DNS behavior is of major symptom
of a
hacked system or network. Such cases are mainly of the type called “MIM” (Man-in-the-
Middle) which causes a delay in packet exchange as it gets access to all the packets, thus
compromising the system. Cyber security analysts often look for the DNS query
responses first in order to understand the network flaw.
Experiment-07
AIM: Analyzing various parameters for TCP protocol in action

Theory:

TCP or Transmission Control Protocol is one of the most important protocols or


standards for enabling communication possible amongst devices present over a
particular network. It has algorithms that solve complex errors arising in packet
communications, i.e. corrupted packets, invalid packets, duplicates, etc. Since it isused
with IP (Internet Protocol), many times it is also referred to as TCP/IP. In order to start
a communication, the TCP first establishes a connection using the three-way-
handshake. TCP’s efficiency over other protocols lies in its error detecting and
correction attribute. Not only this, it organizes packets and segmentslarger data into a
number of packets without disrupting the integrity of the data.

So now we are a bit familiar with TCP, let’s look at how we can analyze TCP
using Wireshark, which is the most widely used protocol analyzer in the world.
Inorder to analyze TCP, you first need to launch Wireshark and follow the steps
given below:

● From the menu bar, select capture -> options -> interfaces.
● In the interfaces, choose a particular Ethernet adapter and note down its
IP,and click the start button of the selected adapter.
● Now we shall be capturing packets. Browse to a particular web address
to generate traffic to capture packets from the communication for e.g.
geeksforgeeks.org and return to Wireshark and stop the capture by
selectingstop from the capture menu. You can have a look at it in the image

below.
Now we have the captured packets and you will be having the captured packet list on the
screen. Since we are concerned here with only TCP packets as we are doing TCP
analysis, we shall be filtering out TCP packets from the packet pool. You can apply a
filter in any of the following ways:

● In the display filter bar on the screen, enter TCP and apply the filter.

● From analyzing the menu in the menu bar select display filters
or from capture select capture filters and then TCP only and ok.
Here you will have the list of TCP packets. The first three packets of this list arepart of
the three-way handshake mechanism of TCP to establish a connection.
Let’s get a basic knowledge of this mechanism which happens in the following 3steps:

● A synchronization packet (SYN) is sent by your local host IP to the


server it desires to connect to.
● The server reciprocates by sending an acknowledgment packet (ACK) to
thelocal host signaling that it has received the SYN request of the host IP to
connect and also sends a synchronization packet (SYN) to the local host to
confirm the connection. So this one is basically an SYN+ACK packet.
● The host answers this request by sending the ACK on receiving the SYN
ofthe server. You can understand it better by looking at the diagram
below.

You can observe these three steps in the first three packets of the TCP list whereeach
of the packet types i.e. ACK, SYN, SYN-ACK is listed on their respective side. Now
to examine a packet closely we shall select a packet and in the expertview in the
packet detail section just below the packet list we shall be having theTCP parameters
as you can see in the below diagram. Let’s look at each one of them and their
significance:

● Source port: This is the port of your host network used for communication.
● Destination port: This is the port of the destination server.
● TCP segment length: It represents the data length in the selected packet.
● Sequence number: It is a method used by Wireshark to give particular
indexing to each packet for tracking packets with ease. This indexing
startsfrom 0.
● Next sequence number: It is the sum of the sequence number and the
segment length of the current packet.
● Acknowledgment number: It contains the byte length of data received.
● Header length: It is the length of the TCP header and can vary from 20 to 60
A major section of this TCP packet analysis is the flag section of a packet whichgives further in-depth
information about the packet. The flag section has the following parameters which are enlisted with their
respective significance.

● Congestion window reduced(CWR): It signals a decrease in transmissionrate.


● ECN-Echo: It is set on receiving earlier congestion notifications.
● Urgent: It is set when the packet is to be considered a priority.
● Acknowledgment: It indicates whether the current packet
contains an acknowledgment packet or not.
● Push: The data should be saved and removed from
the communication channel.
● Reset: It indicates an error in the communication.
● Syn: It denotes whether the packet is synchronization or SYN packet or not.
● Fin: It indicates finalization i.e. end of the communication

Further, in the subsections we have:

● Window size value: This is the buffer size of the current host.
● Checksum: It is used to verify that the received packet is OK or has an error.
● Checksum status: The packet checksum is not verified by default, but
onecan enable it as per requirements.

Finally, after we have done the analysis it’s time to understand how the TCP
connection is closed. It is commonly known as a TCP termination handshake. It
further happens in the following steps:

● The closing side or the local host sends the FIN or finalization packet.
● The server sends an ACK signaling it has received the FIN packet and
sendsa FIN packet for confirmation on the closing side.
EXPERIMENT 08
AIM: Create Ring, Star, Bus and Mesh topology using cisco packet tracer.

Theory:

Experiment Setup:
1. Launch Cisco Packet Tracer and create a new network simulation.
2. Use appropriate devices such as routers, switches, and PCs to represent the nodes in each topology.
3. Configure the connections between devices according to the chosen topology (ring, star, bus, or mesh).
4. Assign IP addresses to devices and configure basic settings such as subnet masks and default gateways.
5. Test the connectivity between devices within each network and observe how data transmission
behaves in different scenarios

1. Ring Topology:

● In a ring topology, devices are connected in a closed loop, where each device is connected
to exactly two other devices.
● Data travels in one direction around the ring until it reaches its destination.
● Advantages include simplicity and equal access to resources for all devices.
● Disadvantages include the potential for a single point of failure if one device fails or if there is a
break in the ring.
2. Star Topology:

● In a star topology, all devices are connected to a central hub or switch.


● Data travels through the central hub, which then forwards it to the appropriate destination device.
● Advantages include easy scalability, simple troubleshooting, and the ability to isolate
individual devices.
● Disadvantages include dependency on the central hub, which if fails, can disrupt the entire
network.

3. Bus Topology:

● In a bus topology, all devices are connected to a single shared communication line, known as
a bus.
● Data is transmitted along the bus, and each device reads the data to determine if it is the intended
recipient.
● Advantages include simplicity, low cost, and easy expansion.
● Disadvantages include the potential for collisions and the entire network being affected if the
bus fails.
1. Mesh Topology:

● In a mesh topology, every device is connected to every other device in the network.
● Data can take multiple paths to reach its destination, providing redundancy and fault tolerance.
● Advantages include high reliability, scalability, and fault tolerance.
● Disadvantages include complexity, high cost, and the need for careful planning to avoid
network congestion.
Testing the connectivity between devices within each network by using PING command
Experiment no - 10

Aim : Implement Dijkstra’s shortest path algorithm in network routing.

CODE

import heapq

def dijkstra(graph, start):


"""
Implements Dijkstra's shortest path algorithm.

Args:
graph: A dictionary representing the network graph where keys are nodes
and values are dictionaries of neighbors with associated edge
weights.
start: The starting node for the shortest path computation.

Returns:
A dictionary containing the shortest distances from the start node to all other
reachable nodes in the graph.
"""
distances = {node: float('inf') for node in graph}
distances[start] = 0
priority_queue = [(0, start)]
while priority_queue:
current_distance, current_node =
heapq.heappop(priority_queue) if current_distance >
distances[current_node]:
continue
for neighbor, weight in
graph[current_node].items(): distance =
current_distance + weight
if distance < distances[neighbor]:
distances[neighbor] = distance
heapq.heappush(priority_queue, (distance, neighbor))
return distances

# Example graph representing a network


# Keys are routers, values are dictionaries of connected routers with link
costs. network_graph = {
'A': {'B': 4, 'C': 2},
'B': {'A': 4, 'C': 1, 'D': 5},
'C': {'A': 2, 'B': 1, 'D': 8, 'E': 10},
'D': {'B': 5, 'C': 8, 'E': 2},
'E': {'C': 10, 'D': 2}
}

# Calculate shortest paths from router


'A' shortest_paths =
dijkstra(network_graph, 'A')

# Print the shortest distances from 'A' to all other routers


print("Shortest distances from router A:")
for router, distance in
shortest_paths.items(): print(f"To router
{router}: {distance}")

OUTPUT
EXPERIMENT 09
AIM: Configure a network using distance network routing and link state vector routing protocol
Theory:
1. Distance Vector Routing Protocol (RIP):
● RIP is a simple routing protocol where routers exchange routing tables with their neighbors.
● Each router maintains a routing table containing the distance to each destination network and
the next hop router to reach it.
● RIP uses the Bellman-Ford algorithm to determine the best path to each destination network.
● RIP periodically broadcasts routing updates to its neighbors, which can lead to
convergence issues in large networks.
● RIP has a maximum hop count limit of 15, which limits its scalability in larger networks.

Configuring RIP (Distance Vector Routing Protocol)


1. Launch Cisco Packet Tracer:
• Open Cisco Packet Tracer on your computer.
2. Create Network Topology:
• Drag and drop routers, switches, and PCs onto the workspace to create your desired
network topology.
• Connect the devices using appropriate cables (Ethernet cables for connecting
devices to switches, serial cables for connecting routers, etc.).

3. Configure IP Addresses:
• Access the CLI (Command Line Interface) of each router by double-clicking on it.
• Configure IP addresses on router interfaces using the interface and ip address
commands (e.g., interface GigabitEthernet0/0, ip address 192.168.1.1 255.255.255.0).
4. Enable RIP on Routers:
• Access the CLI of each router and enter global configuration mode using the configure
terminal command.
• Enable RIP routing protocol using the router rip command.
• Configure network statements to advertise connected networks (e.g., network 192.168.1.0).
5. Verify RIP Configuration:
• Use the show ip route command to verify the routing table entries on each router.
• Use the show ip protocols command to verify the RIP configuration and routing updates.

6. Test Connectivity:
• Ping between PCs or routers to test network connectivity.
• Verify that RIP is dynamically updating routing tables based on network changes.
2. Link-State Routing Protocol (OSPF):
● OSPF is a more sophisticated routing protocol based on link-state advertisements.
● Each router maintains a link-state database containing information about the network topology.
● OSPF routers exchange link-state advertisements (LSAs) to update their link-state databases
and calculate the shortest path to each destination network using Dijkstra's algorithm.
● OSPF supports hierarchical network design through the use of areas, which can improve
scalability and reduce routing overhead.
● OSPF converges faster and scales better than RIP in large networks.

Configuring OSPF (Link-State Routing Protocol)


1. Create Network Topology:
• Drag and drop routers, switches, and PCs onto the workspace to create your desired
network topology.
● Connect the devices using appropriate cables (Ethernet cables for connecting devices
to switches, serial cables for connecting routers, etc.).Configure IP Addresses:

1. Enable OSPF on Routers:


● Access the CLI of each router and enter global configuration mode.
● Enable OSPF routing protocol using the router ospf command.
● Configure OSPF process ID using the router-id command.
● Configure network statements to advertise connected networks (e.g., network 192.168.1.0
0.0.0.255 area 0).
2. Verify OSPF Configuration:
● Use the show ip ospf neighbor command to verify neighbor relationships between
OSPF routers.
● Use the show ip ospf interface command to verify OSPF interface settings.
● Use the show ip route ospf command to verify OSPF routing table entries.

3. Test Connectivity:
● Repeat step 6 from RIP Experiment to test network connectivity.
● Verify that OSPF is dynamically updating routing tables and forming neighbor adjacencies.

You might also like