cover photo

COURSEWORK

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

PuneethAUTHORACTIVE

Level 3 Report

3 / 3 / 2024


Level 3 Report


Task1- OSI with Switching, Routing, Handshakes, Ip Addressing

The OSI (Open Systems Interconnection) model is a framework that divides network communication into seven layers, each with specific tasks

1 Physical Layer: Handles the actual transmission of data over the network medium. Protocols: USB, Ethernet

2 Data Link Layer: Manages data flow and error correction between devices on the same network. Protocols: Ethernet, Wi-Fi

3 Network Layer: Addresses and routes data between different networks and subnets. Protocols: IP (IPv4 and IPv6)

4 Transport Layer: Ensures end-to-end communication, data segmentation, and error recovery. Protocols: TCP, UDP

5 Session Layer: Establishes, maintains, and terminates communication sessions between applications. Protocols: NetBIOS, RPC.

6 Presentation Layer: Translates, encrypts, and compresses data for compatibility. Protocols: GIF, JPEG

7 Application Layer: Provides network services directly to user applications and manages application-specific protocols. Protocols: Protocols: HTTP, DNS

1 Switching: Happens at Layer 2 (Data Link). It directs data within a local network based on MAC addresses.

2 Routing: Occurs at Layer 3 (Network). Routers guide data between different networks or subnets.

3 IP Addressing: Managed at Layer 3 (Network), assigning unique IP addresses for devices, like IPv4 and IPv6.

4 Handshakes: Occurs at Layer 4(Transport), Eg: TCP's three-way handshake for connection setup.


Task3- Sockets!

1 In this task, I used the features of nodejs to build a real time chat application.

2 The messages in the application get updated without refreshing the webpage. It is done with the help of socket.io library.

Code


Task7- Webscraping and Automation

1 In this task, I automated an instagram account to follow a account, send a message and like a post of the followed account.

2 This was done using the Instabot package.

3 Update : This method is dependent on the instagram's policy and may or may not work. (It worked for me)

Code


Task5- Docker

In this task, I created a Docker container every time when a push to production branch is made on a (VCS).

1 A Dockerfile was created specifying image configurations.

2 A GitHub Actions workflow (build.yml) was defined to trigger on pushes to the production branch.

3 Workflow steps included code checkout, Docker Hub login, image building, and pushing to Docker Hub.

Code


Task6-Docker file spyware

  • In this task, I wrote a dockerfile spyware that constantly monitors a folder and sends all images posted into that folder.

Steps

  • Build the docker image.

docker build -t image-monitor .

  • Run the container.

docker run -d --name img99 image-monitor

  • Verify

Code


Task2-Serverless

In this task, I created a server which supports running serverless nodejs code which supports cold starts, terminates an app when not in use, and boots it when a request is made.

Deployment Steps

  • Lambda Setup: Created a Lambda function with Node.js runtime and appropriate IAM role. Initialized resources outside the handler and implemented cleanup for efficient execution.

  • API Gateway: Created an API, added a resource associated with the Lambda function, and deployed for public access.

  • Monitoring and Optimization: Monitored Lambda function executions with CloudWatch Logs and explored techniques to further decrease cold start times.

  • Testing confirmed successful invocation of the Lambda function through the API Gateway URL. Cold starts were observed after periods of inactivity but mitigated by the implemented initialization and cleanup processes.


UVCE,
K. R Circle,
Bengaluru 01