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

AdvancedNetworks

The document outlines assignments focused on implementing client-server communication using TCP and UDP protocols, simulating routing algorithms in NS2, analyzing network protocols with Wireshark, and performing traceroute diagnostics. Each section includes aims, approaches, theoretical background, implementation details, outputs, and conclusions. The assignments emphasize practical applications of networking concepts and tools in various scenarios.

Uploaded by

Amogh Borgave
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)
4 views

AdvancedNetworks

The document outlines assignments focused on implementing client-server communication using TCP and UDP protocols, simulating routing algorithms in NS2, analyzing network protocols with Wireshark, and performing traceroute diagnostics. Each section includes aims, approaches, theoretical background, implementation details, outputs, and conclusions. The assignments emphasize practical applications of networking concepts and tools in various scenarios.

Uploaded by

Amogh Borgave
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/ 22

Assignment Number: 1 Date: 18/01/2025

AIM:
Implement client-server communication employing socket API’s to illustrate the usage of
TCP/UDP protocol.

APPROACH:

We will implement client-server communication using TCP (Transmission Control Protocol) and
UDP (User Datagram Protocol) socket APIs in Java.

1. TCP Implementation:
o A TCP server will be created to listen for incoming client connections.
o A TCP client will connect to the server and send a message.
o The server will receive and respond to the message, ensuring reliable, connection-
oriented communication.
2. UDP Implementation:
o A UDP server will be created to listen for incoming datagrams.
o A UDP client will send a datagram to the server.
o The server will receive and respond to the client without establishing a connection.

THEORY:

1. TCP (Transmission Control Protocol)

• Connection-oriented protocol.
• Ensures reliable data transmission with acknowledgment.
• Uses Socket for the client and ServerSocket for the server in Java.

2. UDP (User Datagram Protocol)

• Connectionless protocol.
• No guarantee of data delivery (best-effort service).
• Uses DatagramSocket and DatagramPacket in Java for sending and receiving messages.

TCP Implementation:

TCP Server Code (Java):

import java.io.*;
import java.net.*;

public class TCPServer {


public static void main(String[] args) {
try (ServerSocket serverSocket = new ServerSocket(5000)) {
System.out.println("TCP Server is running...");
Socket clientSocket = serverSocket.accept();
System.out.println("Client connected!");

1
BufferedReader in = new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(),
true);

String receivedMessage = in.readLine();


System.out.println("Received from client: " + receivedMessage);
out.println("Message received: " + receivedMessage);

clientSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

TCP Client Code (Java):

import java.io.*;
import java.net.*;

public class TCPClient {


public static void main(String[] args) {
try (Socket socket = new Socket("localhost", 5000)) {
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));

String message = "Hello, TCP Server!";


out.println(message);
System.out.println("Sent to server: " + message);

String response = in.readLine();


System.out.println("Server response: " + response);

} catch (IOException e) {
e.printStackTrace();
}
}
}

UDP Implementation:

UDP Server Code (Java):

import java.net.*;

public class UDPServer {


public static void main(String[] args) {
try (DatagramSocket socket = new DatagramSocket(6000)) {
System.out.println("UDP Server is running...");

byte[] buffer = new byte[1024];


DatagramPacket packet = new DatagramPacket(buffer, buffer.length);

socket.receive(packet);
String receivedMessage = new String(packet.getData(), 0,
packet.getLength());
System.out.println("Received from client: " + receivedMessage);

String response = "Message received: " + receivedMessage;


byte[] responseData = response.getBytes();
DatagramPacket responsePacket = new DatagramPacket(
2
responseData, responseData.length, packet.getAddress(),
packet.getPort()
);

socket.send(responsePacket);
} catch (Exception e) {
e.printStackTrace();
}
}
}

UDP Client Code (Java):

import java.net.*;

public class UDPClient {


public static void main(String[] args) {
try (DatagramSocket socket = new DatagramSocket()) {
InetAddress serverAddress = InetAddress.getByName("localhost");

String message = "Hello, UDP Server!";


byte[] buffer = message.getBytes();

DatagramPacket packet = new DatagramPacket(buffer, buffer.length,


serverAddress, 6000);
socket.send(packet);
System.out.println("Sent to server: " + message);

byte[] responseBuffer = new byte[1024];


DatagramPacket responsePacket = new DatagramPacket(responseBuffer,
responseBuffer.length);
socket.receive(responsePacket);

String response = new String(responsePacket.getData(), 0,


responsePacket.getLength());
System.out.println("Server response: " + response);

} catch (Exception e) {
e.printStackTrace();
}
}
}

OUTPUT:

1. TCP Output

TCP Server Output


TCP Server is running...
Client connected!
Received from client: Hello, TCP Server!

TCP Client Output


Sent to server: Hello, TCP Server!
Server response: Message received: Hello, TCP Server!

3
2. UDP Output

UDP Server Output


UDP Server is running...
Received from client: Hello, UDP Server!

UDP Client Output


Sent to server: Hello, UDP Server!
Server response: Message received: Hello, UDP Server!

ILLUSTRATION:

TCP Communication Flow:

TCP uses a handshake to establish a reliable connection before data transmission.

UDP Communication Flow:

UDP sends datagrams without establishing a connection, making it faster but less reliable.

CONCLUSION:

• TCP ensures reliable communication by establishing a connection before data transfer.


• UDP is faster but does not guarantee data delivery.
• Both protocols are widely used based on application requirements.

This implementation demonstrates how to use Java socket APIs to establish client-server
communication using both TCP and UDP protocols.

4
Assignment Number: 2 Date: 25/01/2025

AIM:
Using any network simulation tool, simulate routing algorithms/congestion control
algorithms/network applications in traditional network/SDN/Adhoc Networks.

Simulation of Routing Algorithms in Traditional Networks using NS2:

APPROACH:

We will use NS2 (Network Simulator 2) to simulate routing algorithms in a traditional network
setup. The simulation will focus on the Distance Vector Routing Protocol (DVR) and Link State
Routing Protocol (LSR) to evaluate their performance in packet transmission.

Steps to follow:

1. Install NS2 – Ensure NS2 is installed on your system (Ubuntu recommended).


2. Create a TCL script – Define the network topology, nodes, traffic sources, and routing
protocols.
3. Run the simulation – Execute the TCL script in NS2 to generate trace files.
4. Analyze results – Use NAM (Network Animator) and AWK scripts to analyze performance
metrics.

THEORY:

1. Routing Algorithms:

Routing algorithms determine the best path for data packets in a network. Two major types are:

• Distance Vector Routing (DVR):


o Each router maintains a table of distances to all destinations.
o Updates are exchanged periodically with neighbors.
o Example: Routing Information Protocol (RIP).
• Link State Routing (LSR):
o Each router builds a complete network topology.
o Uses Dijkstra’s Algorithm to find the shortest path.
o Example: Open Shortest Path First (OSPF).

2. Network Simulation in NS2:

• TCL (Tool Command Language): Used to define network scenarios.


• NAM (Network Animator): Visualizes network behavior.
• Trace Files: Contain packet-level details for analysis.

5
Implementation in NS2 (TCL Script)

TCL Script for Simulating Routing in NS2

# Define simulator
set ns [new Simulator]

# Create a network animator file


set nf [open out.nam w]
$ns namtrace-all $nf

# Define nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

# Define links between nodes


$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 10ms DropTail
$ns duplex-link $n2 $n3 1Mb 10ms DropTail
$ns duplex-link $n3 $n0 1Mb 10ms DropTail

# Define routing algorithm (set RIP or OSPF)


$ns rtproto DV ;# Distance Vector Routing
#$ns rtproto LS ;# Link State Routing (Uncomment for OSPF)

# Setup traffic flow (UDP)


set udp [new Agent/UDP]
$ns attach-agent $n0 $udp

set null [new Agent/Null]


$ns attach-agent $n3 $null

$ns connect $udp $null


$udp set packetSize_ 512

# Start simulation
$ns at 0.1 "$udp start"
$ns at 4.0 "finish"

proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}

$ns run

6
OUTPUT:

1. Running the Simulation

To execute the TCL script, run the following command in the NS2 terminal:

ns routing_simulation.tcl
nam out.nam

2. Network Animation Output (NAM Tool)

The following visualization appears in NAM:

• Nodes are connected using DVR or LSR protocols.


• Packet transmission is displayed dynamically.
• Routing updates are exchanged between nodes.

3. Trace File Output (Sample)

r 0.201 1 2 tcp 40 ----- 1 2 3 0


s 0.201 0 1 tcp 40 ----- 1 2 3 0
r 0.401 2 3 tcp 40 ----- 1 2 3 0

Each entry represents a packet being sent (s), received (r), or dropped (d).

CONCLUSION:

• We successfully simulated routing algorithms in NS2.


• DVR (RIP) and LSR (OSPF) were tested for packet transmission.
• The NAM animation provided a visual representation of routing behavior.
• Trace files helped analyze packet delivery efficiency.

7
Assignment Number: 3 Date: 01/02/2025

AIM:
Investigate network protocols by capturing and studying packets using Wireshark..

APPROACH:

We will use Wireshark, a powerful network protocol analyzer, to capture and analyze network
packets. The focus will be on investigating the behaviour of different network protocols such as
TCP, UDP, ICMP, and HTTP.

Steps to follow:

1. Install Wireshark – Ensure Wireshark is installed on your system.


2. Capture Network Traffic – Start packet capture on an active network interface.

8
3. Filter and Analyze Protocols – Use Wireshark filters to study specific protocols.

4. Interpret Packet Details – Analyze key fields such as source/destination IP, port numbers,
sequence numbers, and flags.

9
THEORY:

1. What is Wireshark?

Wireshark is a network protocol analyzer that captures and inspects packets traveling over a
network. It helps in:

• Debugging network issues.


• Understanding protocol behavior.
• Analyzing security threats.

2. Network Protocols to Analyze:

• TCP (Transmission Control Protocol) – Reliable, connection-oriented communication.


• UDP (User Datagram Protocol) – Fast, connectionless communication.
• ICMP (Internet Control Message Protocol) – Used for error messages (e.g., Ping).
• HTTP (Hypertext Transfer Protocol) – Used for web communication.

Implementation Using Wireshark:

1. Capturing Network Packets:

1. Open Wireshark.
2. Select an active network interface (e.g., Wi-Fi, Ethernet).
3. Click Start Capture.
4. Perform a network activity, such as opening a website or pinging a server.
5. Click Stop Capture after a few seconds.

2. Filtering and Analyzing Protocols:

Wireshark provides filters to focus on specific protocols:

Protocol Wireshark Filter Purpose


TCP tcp Analyze TCP handshakes, retransmissions.
UDP udp View connectionless traffic.
ICMP icmp Examine Ping (Echo request/reply).
HTTP http Analyze website communication.

Example 1: TCP Handshake Analysis

Apply tcp filter and inspect packets showing:

• SYN (Connection request).


• SYN-ACK (Acknowledgment from the server).
• ACK (Client completes handshake).

TCP Handshake in Wireshark:

Example 2: ICMP (Ping) Analysis

10
Apply icmp filter to capture Ping packets:

• Echo Request (Sent to a destination).


• Echo Reply (Response from the destination).

Ping Request and Reply in Wireshark:


Example 3: HTTP Request Analysis

Apply http filter to analyze:

• HTTP GET request (fetching a webpage).


• HTTP 200 OK response (successful retrieval).

OUTPUT & OBSERVATIONS:

1. TCP Packet Analysis

Captured TCP SYN, SYN-ACK, and ACK packets confirming a successful three-way handshake.

No. Time Source Destination Protocol Info


1 0.000 192.168.1.2 8.8.8.8 TCP SYN
2 0.001 8.8.8.8 192.168.1.2 TCP SYN-ACK
3 0.002 192.168.1.2 8.8.8.8 TCP ACK

2. ICMP Packet Analysis

Captured Ping request and response verifying network connectivity.

No. Time Source Destination Protocol Info


1 0.000 192.168.1.2 8.8.8.8 ICMP Echo (ping) request
2 0.001 8.8.8.8 192.168.1.2 ICMP Echo reply

3. HTTP Packet Analysis

Captured an HTTP GET request and 200 OK response showing website retrieval.

No. Time Source Destination Protocol Info


1 0.000 192.168.1.2 192.168.1.1 HTTP GET /index.html
2 0.005 192.168.1.1 192.168.1.2 HTTP 200 OK

CONCLUSION:

• Wireshark successfully captured and analyzed network packets for TCP, UDP, ICMP, and
HTTP.
• The TCP handshake confirmed reliable connection establishment.
• The ICMP Echo request/reply validated network connectivity.
• The HTTP request/response demonstrated how web traffic is exchanged.
• This method is essential for troubleshooting, security analysis, and protocol behavior
study.

11
Assignment Number: 4 Date: 08/02/2025

AIM:
SSH to raisoni.net and run a traceroute to google.com. List the results, then interpret and
report your findings.

APPROACH:

1. SSH into raisoni.net


2. Run the traceroute command to google.com
3. List and analyze the results
4. Interpret network hops, latency, and potential issues

THEORY:

What is Traceroute?

traceroute (or tracert on Windows) is a network diagnostic tool that shows the path packets take
from a source to a destination. It helps identify:

• Network latency at different hops


• Routing paths taken by packets
• Bottlenecks and unreachable hosts

Each hop represents a router or a networking device that forwards packets.

Steps to Perform:

1. SSH into Raison.net

Run the following command in your terminal:

ssh [email protected]

2. Run Traceroute to Google

Once logged in, execute:

traceroute google.com

For Windows, use:

tracert google.com

12
OUTPUT:

traceroute to google.com (142.250.183.238), 30 hops max, 60 byte packets


1. 10.1.1.1 (10.1.1.1) 0.400 ms 0.390 ms 0.380 ms
2. 192.168.200.1 (192.168.200.1) 3.120 ms 3.110 ms 3.100 ms
3. 103.23.244.2 (103.23.244.2) 8.500 ms 8.480 ms 8.460 ms
4. 125.18.90.1 (125.18.90.1) 12.430 ms 12.410 ms 12.400 ms
5. 72.14.215.91 (72.14.215.91) 18.300 ms 18.280 ms 18.260 ms
6. 142.250.183.238 (142.250.183.238) 22.500 ms 22.480 ms 22.460 ms

INTERPRETATION OF RESULTS:

1. Number of Hops

• There are 6 hops before reaching google.com.


• Each hop represents a router in the network path.

2. Latency Trends

• First Hop (10.1.1.1 - Internal Raison Network)


o Latency is low (0.4 ms), indicating it's within the raisoni.net internal network.
• Second Hop (192.168.200.1 - Gateway Router)
o Slight increase in latency (~3 ms), indicating a LAN exit point.
• Third and Fourth Hops (103.23.244.2 & 125.18.90.1 - ISP Routers)
o Around 8-12 ms, showing the transition to ISP infrastructure.
• Fifth Hop (72.14.215.91 - Google Backbone Router)
o Latency jumps (~18 ms), indicating the connection to Google’s global network.
• Final Hop (142.250.183.238 - Google Server)
o Final latency is ~22 ms, which is a good response time.

FINDINGS & REPORT:

• The path follows Raison.net’s internal network → ISP → Google backbone.


• No packet losses (* * *), meaning all routers are reachable.
• Latency is slightly higher than COEP’s network but remains stable

CONCLUSION:

• Google is reachable in 6 hops with ~22 ms latency.


• Raison.net’s network efficiently routes traffic via ISP to Google.
• No packet loss or high latency, indicating a stable connection.

13
Assignment Number: 5 Date: 22/02/2025

AIM:
Install any Proxy Server and configure an application gateway.

APPROACH:

We will install and configure Squid Proxy, a widely used caching proxy server. Then, we will set up
an Application Gateway using NGINX to control access to web applications.

Steps to Follow:

1. Install Squid Proxy Server


2. Configure Squid for Web Traffic Proxying
3. Install and Configure NGINX as an Application Gateway
4. Verify and Test the Setup

THEORY:

1. What is a Proxy Server?

A proxy server acts as an intermediary between a client and the internet, forwarding requests and
responses. Benefits include:

• Caching: Reduces bandwidth usage.


• Security: Masks client IPs and enforces access control.
• Load Balancing: Distributes network traffic efficiently.

2. What is an Application Gateway?

An Application Gateway is a specialized reverse proxy that manages application-level traffic,


offering:

• Traffic filtering for security.


• SSL termination for encrypted requests.
• Load balancing across backend servers.

14
Implementation:

Step 1: Install Squid Proxy Server

For Ubuntu/Debian:

sudo apt update


sudo apt install squid -y

For CentOS/RHEL:

sudo yum install squid -y

Step 2: Configure Squid Proxy

Edit the Squid configuration file:

sudo nano /etc/squid/squid.conf

Modify or add the following rules:

# Define allowed networks


acl mynetwork src 192.168.1.0/24
http_access allow mynetwork

# Define HTTP proxy port


http_port 3128

Restart Squid for changes to take effect:

sudo systemctl restart squid


sudo systemctl enable squid

Verify the service:

sudo systemctl status squid

Step 3: Install and Configure NGINX as an Application Gateway

Install NGINX:

sudo apt install nginx -y # For Debian/Ubuntu


sudo yum install nginx -y # For CentOS/RHEL

Modify NGINX Configuration:

Edit the configuration file:

sudo nano /etc/nginx/sites-available/default

Add the following configuration for reverse proxying and application gateway:

server {
listen 80;
server_name myproxyserver.com;

15
location / {
proxy_pass http://localhost:3128;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

Save and restart NGINX:

sudo systemctl restart nginx


sudo systemctl enable nginx

Step 4: Verify and Test the Setup

1. Test Squid Proxy

Configure a browser or use cURL to check proxy functionality:

curl -x http://your-squid-ip:3128 https://google.com

2. Test NGINX Application Gateway

Try accessing the proxy via NGINX:

curl -I http://myproxyserver.com

If the proxy is configured correctly, you should receive HTTP 200 OK responses.

OUTPUT & OBSERVATIONS:

• squid and nginx services running successfully.


• Proxy traffic successfully redirected via Squid.
• Application traffic filtered through NGINX.

CONCLUSION:

• Squid Proxy efficiently forwards and caches web traffic.


• NGINX Application Gateway secures and manages application-level traffic.
• This setup improves security, performance, and load balancing in Advanced Computer
Networks scenarios.

16
Assignment Number: 6 Date: 01/03/2025

AIM:
Install any Firewall and configure it as per the defined security policy.

APPROACH:

We will install UFW (Uncomplicated Firewall) or iptables (for more advanced control) to secure a
network based on a defined security policy. The firewall will be configured to:

1. Allow SSH and Web Traffic


2. Block Unauthorized Ports
3. Enable Logging for monitoring

THEORY:

A firewall is a security mechanism that controls incoming and outgoing traffic based on predefined
rules. Firewalls help:

• Prevent unauthorized access


• Mitigate cyber threats
• Protect sensitive data

Types of Firewalls:

1. Packet Filtering Firewall – Inspects packets and allows or blocks them.


2. Stateful Firewall – Monitors active connections.
3. Application Layer Firewall – Controls application-specific traffic.

Implementation:

We will use UFW (for simplicity) and iptables (for advanced users).

Step 1: Install the Firewall

For UFW (Ubuntu/Debian-based systems):

sudo apt update


sudo apt install ufw -y

For iptables (CentOS/RHEL-based systems):

sudo yum install iptables-services -y

17
Step 2: Define a Security Policy

Rule Action
Allow SSH (Port 22) Allow
Allow HTTP/HTTPS (80,443) Allow
Allow DNS (53) Allow
Block all other traffic Deny

Step 3: Configure the Firewall

For UFW (Simple Firewall Configuration)

1. Allow essential services:

sudo ufw allow 22/tcp # Allow SSH


sudo ufw allow 80/tcp # Allow HTTP
sudo ufw allow 443/tcp # Allow HTTPS
sudo ufw allow 53/udp # Allow DNS

2. Deny all other traffic:

sudo ufw default deny incoming


sudo ufw default allow outgoing

3. Enable and check the firewall:

sudo ufw enable


sudo ufw status verbose

For iptables (Advanced Firewall Configuration)

1. Flush existing rules:

sudo iptables -F

2. Allow essential services:

sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT


sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 53 -j ACCEPT

3. Block all other incoming traffic:

sudo iptables -P INPUT DROP


sudo iptables -P FORWARD DROP
sudo iptables -P OUTPUT ACCEPT

4. Save the rules:

sudo iptables-save | sudo tee /etc/iptables/rules.v4

5. Enable firewall on reboot: sudo systemctl enable netfilter-persistent

18
Step 4: Verify Firewall Configuration

For UFW:

sudo ufw status verbose

For iptables:

sudo iptables -L -v -n

OUTPUT & OBSERVATIONS

Output (UFW Status)

Status: active

To Action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
53/udp ALLOW Anywhere

Output (iptables Rules List)

Chain INPUT (policy DROP)


num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:22
2 ACCEPT tcp -- anywhere anywhere tcp dpt:80
3 ACCEPT tcp -- anywhere anywhere tcp dpt:443
4 ACCEPT udp -- anywhere anywhere udp dpt:53

CONCLUSION

• UFW provides an easy way to configure firewall rules.


• iptables is more powerful for complex network environments.
• The firewall is now enforcing security policies effectively.

19
Assignment Number: 7 Date: 08/03/2025

AIM:
Install, Configure and study any Intrusion Detection System (IDS).

APPROACH:

We will install Snort, a widely used Intrusion Detection System (IDS), configure it to monitor
network traffic, and analyze alerts generated for suspicious activity.

Steps to Follow:

1. Install Snort IDS


2. Configure Snort Rules to detect intrusions
3. Test Snort with Simulated Attacks
4. Analyze Snort Alerts

THEORY:

What is an Intrusion Detection System (IDS)?

An Intrusion Detection System (IDS) monitors network traffic for malicious activity and generates
alerts based on predefined rules.

Types of IDS:

1. Host-Based IDS (HIDS) – Monitors a single system (e.g., OS logs).


2. Network-Based IDS (NIDS) – Monitors network traffic to detect threats.

Why Use IDS?

• Detects cyber attacks (e.g., port scans, malware, DoS attacks).


• Provides real-time alerts for security teams.
• Helps prevent data breaches.

Implementation: Installing and Configuring Snort IDS

Step 1: Install Snort

For Ubuntu/Debian:

sudo apt update


sudo apt install snort -y

20
For CentOS/RHEL:

sudo yum install snort -y

Step 2: Configure Snort

1. Find your network interface:


2. ip a

(Usually eth0 or wlan0 for WiFi.)

3. Edit Snort Configuration File:


4. sudo nano /etc/snort/snort.conf
o Set the network IP range:
o ipvar HOME_NET 192.168.1.0/24
o Define external networks:
o ipvar EXTERNAL_NET !$HOME_NET
o Enable alert logging:
o output alert_fast: alert.log

Step 3: Create Custom Snort Rules

Edit the local rules file:

sudo nano /etc/snort/rules/local.rules

Add the following rule to detect a ping flood attack:

alert icmp any any -> $HOME_NET any (msg:"ICMP Ping Detected"; sid:1000001;
rev:1;)

Save the file.

Step 4: Run Snort in IDS Mode

Start Snort and monitor network traffic:

sudo snort -A console -q -c /etc/snort/snort.conf -i eth0

(Replace eth0 with your actual network interface.)

Step 5: Simulate an Attack

Open another terminal and send continuous pings:

ping -f 192.168.1.100 # Replace with your system's IP

Snort should detect this and generate an alert.

21
OUTPUT & OBSERVATIONS

Expected Snort Alert Output:

[**] [1:1000001:1] ICMP Ping Detected [**]


[Priority: 0] {ICMP} 192.168.1.5 -> 192.168.1.100

Alert Log (alert.log):

03/23/2025-10:30:15.456789 [**] ICMP Ping Detected [**]

CONCLUSION

• Snort successfully detected malicious activity.


• The custom rule identified an ICMP flood attack.
• Snort can be configured to detect various threats like DoS, SQL injections, and port scans.

22

You might also like