From 6d29dcf343ecf260a254ceee769f0f238512da71 Mon Sep 17 00:00:00 2001 From: Akash Sivakumar <73591598+Akash-0818@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:47:05 -0700 Subject: [PATCH] Update README.md --- preprocessing/README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/preprocessing/README.md b/preprocessing/README.md index ab835fb..59df36e 100644 --- a/preprocessing/README.md +++ b/preprocessing/README.md @@ -15,7 +15,22 @@ - Packet size - in bytes - `sample_output.csv` contains a partial subset of `202310081400.pcap`, ~600K packets +# Setting up Kafka +- Download and install kafka [from here](https://kafka.apache.org/downloads) +- Run all commands in separate terminals from installation location +- Zookeeper: + - Windows: `.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties` + - Mac: `bin/zookeeper-server-start.sh config/zookeeper.properties` +- Kafka Broker: + - Windows: `.\bin\windows\kafka-server-start.bat .\config\server.properties` + - Mac: `bin/kafka-server-start.sh config/server.properties` +- Creating a Kafka topic: +- Windows: `.\bin\windows\kafka-topics.bat --create --topic %topicname% --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1` +- Mac: `bin/kafka-topics.sh --create --topic %topicname% --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1` + + # Streaming from pcap file using Kafka +- Start zookeeper and Kafka broker whenever python code is run after machine reboot - Run pcap_processor.py file - Arguments - -f or --pcap_file: pcap file path, mandatory argument @@ -26,4 +41,4 @@ - -d or --debug: boolean value indicating if program is run in debug mode -python pcap_processor.py -f C:/Users/akash/storage/Asu/sem3/dds/project/202310081400.pcap -s --sample-size 1000 \ No newline at end of file +python pcap_processor.py -f C:/Users/akash/storage/Asu/sem3/dds/project/202310081400.pcap -s --sample-size 1000