cover photo

COURSEWORK

Shreevidya's CL-CY-001 course work. Lv 2

Shreevidya K RAUTHORACTIVE
This Report is yet to be approved by a Coordinator.

LEVEL 2 TASKS!!

2 / 10 / 2024


Task 1: Linux Based Task with Socket.io


Task Goal:
Set up a basic chat application using Node.js and Socket.io on a Linux system. The application should allow multiple users to connect and exchange messages in real-time.

Research Work: https://docs.google.com/document/d/1iYVusU-epqwA5ei-BqcRzSUyYir-c3DYeCX_Vjrqj_w/edit?usp=sharing

Task Work:

  • Step 1: Setting up the softwares!!
    If you don't have linux on your system, download it. I installed ubuntu. Next, I installed node.js and npm.
    code:
    sudo apt update
    sudo apt install nodejs npm

Setting-up

Step 2: Coding the server block!!

A folder named *chat-app* is created and within it node.js project is initialized using the code 'npm init -y'. This will create a package.json file to manage your dependencies.  
Now, *express* and *socket.io* is installed by the code *npm install express socket.io*  
A file named *index.js* is created to handle the server-end operations using the language javascript.    

Step 3: Coding the client-end block!!
A folder named public is created and within it a html file named index.html is created where the front-end operations is handled.

Step 4: Running the Application!!
Start the server using Node.js: 'node index.js'. The chat application should now be running on http://localhost:3000 . It looks something like this:
CR-1

Step 5: Testing the Application!!
Check if the connection is established which would be notified in terminal.
Happy texting!!
Results: CR-2

CR-3

CR-4

CR-5

Task 2: Understanding fundamentals of Gitbash and Github


Before jumping down into the key learnings of this task, let us understand the basic terminologies we need to know about this topic.
What is Git?
Well, git is a version control system which tracks the changes made on a code. Personalized tracker of your code!!

What is GitHub?
GitHub is a library of your code. A library which stores all the details of your work as well as a platform that allows developers to share, and collaborate on code.

Then, what is Git Bash?
Git Bash is a command-line tool that allows you to use Git, a version control system, on Windows. It provides an environment similar to Linux, making it easier to run Git commands and other Unix-style commands that aren't natively available in Windows.

Task work:

In this task, firstly I created a repository in my local device using git command lines, which are cd (change directory) and mkdir (make a directory) and init(to initialise an empty git repository). Later, I wrote a code to display piece of information, a change which wasn't updated. Once the changes were done, I used git add, git commit (with a message) and git push to update my changes in the remote as well. Later, I accepted the pull request and ensured that all the changes were updated remote as well. Here are few glimpses:
step 1

display

updating

updating

Task 3: OSI MODEL


Task Goal:
Research and create a simple visual representation or diagram of the OSI model using a cloud-based diagramming tool.

Write a brief explanation of each layer of the OSI model and how it relates to cloud computing .

Research work: https://docs.google.com/document/d/1LY0RfFFFnt7Bfo5DpzXm-Z0f7LHXfp8dy-B97VEmIMs/edit?usp=sharing

OSI stands for Open System Intercommunication.
In detail explanation:

WHAT IS OSI MODEL?
The OSI model was created to standardize and simplify how devices communicate in a network. It provides a common framework for understanding and designing communication systems, ensuring that different technologies and products from various vendors can work together.
There are 7 layers of OSI model, which are:

  • Application layer
  • Presentation layer
  • Session layer
  • Transport layer
  • Network layer
  • Data Link layer
  • Physical layer

Functions of each layer:

  1. Application layer: The top layer where end-user applications interact with the network. It provides network services directly to users and allows applications to communicate over the network.
  2. Presentation layer: This layer translates data between the application layer and the network. It handles data formatting, compression, and encryption, ensuring the application can understand the transmitted data.
  3. Session layer: This layer manages sessions or connections between applications. It establishes, maintains, and terminates communication sessions.
  4. Transport layer: This layer ensures reliable data transmission between devices. It breaks data into segments, manages flow control, and can provide error recovery.
  5. Network layer: The network layer is responsible for determining the best path for data to travel across multiple networks. It manages logical addressing through IP addresses and handles routing between different networks.
  6. Data Link layer: This layer ensures that data transferred over the physical layer is error-free. It manages how data is packaged into frames and provides addressing through MAC (Media Access Control) addresses
  7. Physical Layer: This layer is all about the physical connection between devices. It defines the hardware elements involved in the data transmission, such as cables, switches, and network interface cards (NICs).
    Reference: https://youtu.be/vv4y_uOneC0?feature=shared

Result:
https://drive.google.com/file/d/17lCzxKdCcJlijykdzzuDMUbHdTEbtfAg/view?usp=sharing

image1

image2

Task 4: Encryption Techniques


Task Goal:
Implement a basic encryption and decryption program using Python with the PyCrypto library.

Research Work: https://docs.google.com/document/d/1BX8PeZXur9GYPRvwGi99-Cr9NSB-StDDkjjK5-jcXrk/edit?usp=sharing

What is encryption?
Encryption is a process that converts plain text (readable data) into a coded format (cipher text) so that only authorized users can read it.

How It Works:
Plain Text: This is the original readable data (like a message or a file).

Encryption: A special algorithm (or method) scrambles the plain text into an unreadable format using a key (a secret password or code).

Cipher Text: This is the scrambled version of the plain text. It looks like random data and is unreadable without the key.

Decryption: To read the original data again, the recipient uses the same key to turn the cipher text back into plain text.

Glimpse of code work:
code

code 1

result

Task 5: IP Addressing and Protocols


Task Goal:
Use Python and libraries like Beautiful Soup to scrape IP address data from a website and analyse it. This task will reinforce understanding of IP addressing and protocols such as TCP/IP.
Research Work: https://docs.google.com/document/d/1GPh1EVcsS0RqIdoEwKGoBjowjqq4Rz1XbrJsmcY-lH0/edit?usp=sharing

Task Work:

Step 1:
Firstly, python should be downloaded if it isn't installed yet. Then, in order to successively accomplish this task, the required libraries: request, Beautiful Soup and re(built-in) must be installed.

Step 2:
Now, proceed by writing a code in the text editor to scrape an IP address from a website. I scrapped from the website https://hide.me/en/proxy (freeproxylist).

Step 3:
Now, test your code. You will be able to see the html fragments and IP addresses.
Results:
ip1
ip2
ip3
ip4

Step 4:
Lastly, analyse the IP addresses you received i.e. to sort out public and private ips and you are done with the job!!!

Results after analysis:
ip5
ip6
ip7

Task 7: Databases


Task Goal:
Set up a MySQL database and create a simple CRUD (Create, Read, Update, Delete) application using Node.js. This task will familiarize students with database management and querying.

Research Work: https://docs.google.com/document/d/1SKQiqZLDB_C8oqrM4-IdnEFg-KgWMR9NhzFJXEq2WxA/edit?usp=sharing

TASK WORK:

Step 1: Setting up the required software.

Ensure MySQL is installed and start the MySQL server to perform the task.

Step 2: CRUD Application

  1. In a node.js environment, create a folder named my my_app. Initialize a node.js project creating a package.json file with default settings.
  2. npm install express mysql body-parser cors --> Installs several packages (like Express for web applications and MySQL for database handling) necessary for my project.
  3. Create an js file and set-up express server.
  4. Parallely, create a database using the code CREATE DATABASE my_app;
  5. Interact with the database using the code USE my_app;
  6. Create/Write the body of the database i.e. the data elements of the database. Here, I created a database consisting of data elements like: id, name, email id and time stamp of registeration.

Step 3: Run the server!!

Test the CRUD Operations -->

Interacting with MySQL from Node.js:
Use the code mysql -u root -p to connect to MySQL.

TASK RESULTS:

db-1

db-2

db-3

db-4

UVCE,
K. R Circle,
Bengaluru 01