Level 3
5 / 10 / 2024
Task 1: OSI Model Overview
The Open Systems Interconnection (OSI) Model is a conceptual framework used to understand and implement network communications. It divides the communication process into seven distinct layers:
- Physical Layer: Deals with the physical connection between devices, including cables, switches, and signaling.
- Data Link Layer: Provides node-to-node data transfer and handles error correction from the physical layer.
- Network Layer: Responsible for packet forwarding, including routing through different networks.
- Transport Layer: Ensures complete data transfer, providing error recovery and flow control.
- Session Layer: Manages sessions between applications, including establishing, maintaining, and terminating connections.
- Presentation Layer: Translates data between the application layer and the network, including data encryption and compression.
- Application Layer: Closest to the end user, it interacts with software applications to provide network services.
The OSI model helps in standardizing network protocols and enhances interoperability among different systems and technologies.
Task 2: Serverless Computing
Serverless computing allows developers to build applications without managing infrastructure. It offers event-driven execution, automatic scaling, and pay-as-you-go pricing. Popular platforms include AWS Lambda, Azure Functions, and Google Cloud Functions, enabling rapid development and deployment of microservices and data processing tasks.
I tried to first use AWS and make a lambda function which would run the code in response to events. But it didn't work out for some reason and hence I had to make a simple web application and host it via vercel.
Task 3: Sockets
Basics of Sockets
Sockets are endpoints for sending and receiving data across a network. They enable real-time communication between clients and servers. Sockets can operate over various protocols, with TCP (Transmission Control Protocol) being the most common for reliable communication.
Socket.IO Overview
Socket.IO is a JavaScript library that enables real-time, bidirectional communication between web clients and servers. It abstracts the complexities of WebSockets and provides a simple API for creating real-time applications, like chat apps.
Key Features
- Real-Time Communication: Allows instant messaging without needing to refresh the page.
- Automatic Reconnection: Handles network interruptions and automatically reconnects clients.
- Event-Based: Uses an event-driven model, making it easy to listen for and emit events.
[https://github.com/Shreyas-rao17/MarvelCLCYL2/blob/main/app.js]
Task 4- Web Application
A simple Resource Library was made using nodejs, express and MongoDB. The web app had a login page and could assist in browsing from available resources and books. It was made with the help of MDN WebDocs and gave good insights into server side computing.
Express.js and Node.js
Node.js is a JavaScript runtime built on Chrome's V8 engine, enabling server-side development. Express.js is a minimal web application framework for Node.js, providing robust features for building web applications and APIs, streamlining routing, middleware, and handling HTTP requests.
Task 5- Docker
Docker and Containerization
Docker is an open-source platform that automates application deployment using containers—lightweight, portable units that include all necessary dependencies. Containerization is operating-system-level virtualization or application-level virtualization over multiple network resources so that software applications can run in isolated user spaces called containers in any cloud or non-cloud environment, regardless of type or vendor.
Docker is the software which has a set of Platform as a Service(PaaS) products which make development, deployment, testing and scaling of applications simpler and hence is extensively used in modern application deployments. **In this task, I made a simple python application which when pushed to the production branch of my github, triggered the action/workflows and built and deployed a docker container. It needed a python application and a dockerfile which is a set of commands giving context and information to docker to run and execute.
Key Benefits
- Portability: Run containers consistently across environments.
- Isolation: Prevent application conflicts and enhance security.
- Scalability: Easily scale applications with multiple container instances.
[https://github.com/Shreyas-rao17/MarvelCLCYL2/tree/main/simple-docker-app]
Task 6- Docker File Spyware
For Docker File Spyware, I built a simple flask based server which lsitens on port 5000. In the host side, a python spyware which monitors a target file and waits for any actions was made. As I drop an image into the folder, dockerfile builds and initialises a container, which fetched the image and sends it to the server. The server stores these images in the final directory.
[https://github.com/Shreyas-rao17/MarvelCLCYL2/tree/main/SpywareHost] [https://github.com/Shreyas-rao17/MarvelCLCYL2/tree/main/SpywareServer]
Task 7- WebScraping and Automation
The goal was to automate the entire process of logging into an Instagram account, finding the list of followers, liking their latest post, and sending a message if there wasn't a reply in 5 minutes. I made use of BeautifulSoup, Selenium and Chrome Driver for this task.
Beautiful Soup, Selenium, and ChromeDriver
Beautiful Soup is a Python library for parsing HTML and XML documents. It provides tools for navigating and searching the parse tree, making it ideal for web scraping tasks.
Selenium is a web automation tool that allows you to interact with web browsers programmatically. It supports multiple programming languages and is used for automating web applications for testing purposes.
ChromeDriver is a separate executable that Selenium uses to control the Google Chrome browser. It acts as a bridge between Selenium and Chrome, enabling automation of tasks such as filling forms, clicking buttons, and scraping data from dynamic web pages.
Together, these tools allow developers to efficiently scrape and automate interactions with web applications.
[https://github.com/Shreyas-rao17/MarvelCLCYL2/tree/main/instagram_bot]