๐ Week 1: Networking Challenge - Letโs Learn the Basics of the Internet! ๐
Hey there! ๐ Welcome to Week 1 of our DevOps 90 Days Challenge. This week, we're going to talk about Networking. Don't worry! It's just how computers talk to each other, like how you chat with your friends on the phone or play games online. ๐ฎ
Letโs break it down step-by-step, nice and easy! โจ
1. What is the OSI Model? ๐ฆ
Think of the OSI Model as a special set of instructions that shows how your computer sends messages through the internet. ๐
There are 7 layers (or steps) in this model. Each layer has a job to do before the message gets to its destination.
Layer 1: Physical Layer โ Imagine this is the wire or Wi-Fi that sends messages. ๐๐ถ
Layer 2: Data Link Layer โ This is like the delivery driver that carries your message. ๐
Layer 3: Network Layer โ This is the map that shows where the message needs to go. ๐บ๏ธ
Layer 4: Transport Layer โ Think of this as the bus that makes sure the message goes to the right place. ๐
Layer 5: Session Layer โ This keeps track of your conversations. Like, you wouldnโt want to forget who youโre talking to! ๐ฃ๏ธ
Layer 6: Presentation Layer โ This layer makes sure the message is readable (like a letter being written clearly). โ๏ธ
Layer 7: Application Layer โ This is where the apps you use (like Facebook or YouTube) work! ๐ฑ
2. What Are Protocols and Ports? ๐ก
Now letโs talk about protocols. Protocols are like rules that computers use to talk to each other. Each protocol has a port number (like a house number) where it lives. Here are some examples:
HTTP (Port 80) โ This is for regular websites. Itโs like when you visit a fun site online. ๐
HTTPS (Port 443) โ This is for secure websites, like when you log in to your bank online. It keeps things safe. ๐
FTP (Port 21) โ This helps computers send files to each other, like sending pictures or videos. ๐
SSH (Port 22) โ This helps you talk to another computer far away, like youโre chatting with a robot! ๐ค
DNS (Port 53) โ This helps computers figure out what website you're looking for (like when you type in google.com and it finds the website for you). ๐
3. AWS EC2 and Security Groups ๐ป๐
Next, letโs learn about AWS EC2. This is like a virtual computer you can use on the internet! Itโs like renting a super-powerful computer from Amazon to run your websites or apps. ๐
Now, we need to secure our EC2 computer so no one can mess with it. Security groups are like guard dogs that make sure only the right people (or computers) can talk to your EC2 computer. ๐โ๐ฆบ
How to secure your EC2:
Security Groups:
These are like virtual firewalls that protect your EC2 instance. You set rules to decide which traffic is allowed in or out (e.g., allowing only web traffic on port 80).
For example, if you want to allow SSH (port 22) to connect to your EC2 instance, you would set up a rule in the Security Group to let that traffic through.
Step-by-Step Guide:
Log in to your AWS account and navigate to EC2.
Click on โLaunch Instance.โ
Choose an Amazon Machine Image (AMI), like the free Ubuntu one.
Select the instance type (t2.micro for free tier).
Configure your instance, including networking and security group settings.
Create a new security group and add rules for the ports you need (e.g., HTTP on port 80, SSH on port 22).
Launch the instance, and you can connect to it using SSH or access it via a browser if it's running a web server.
4. Networking Commands ๐ป๐ง
Now, letโs talk about some commands (like instructions for the computer) you can use to check if your internet is working or if something is wrong. โ๏ธ
Here are some simple ones:
ping โ This checks if you can reach a website. Itโs like saying, โHey, are you there?โ ๐
Example:
ping
google.com
traceroute โ This shows you the path your message takes to reach a website. It's like seeing all the stops your message makes on its way. ๐
- Example:
traceroute
google.com
- Example:
netstat โ This shows which websites and computers your computer is talking to. ๐ฅ๏ธ๐ฌ
- Example:
netstat
- Example:
curl โ This helps you check if a website is working. It's like knocking on the door of a website and seeing if anyone answers. ๐ช
Example:
curl
http://example.com
dig or nslookup โ These tools help you find the address of a website, so your computer knows where to go. ๐
Example:
dig
google.com