DEV Community

Cover image for You, me and Computer Networks
Sanju Shaw
Sanju Shaw

Posted on

You, me and Computer Networks

This article is intended for beginners in Computer Networks.

First of all let's understand what is "Network" in computer?

Network is defined as the connection of different computers or machines both via wirelessly and wired to the internet.

Let's assume you have a router, this creates a LAN (Local Area Network) by connecting your devices. These devices need to be within a certain range to maintain a connection, especially if using Wi-Fi. The router itself connects to a WAN (Wide Area Network) through your ISP (Internet Service Provider), providing internet access to your LAN.
internet

Basic Network Hardware: To connect devices in a network, we use essential hardware like routers, switches, and modems.

A router directs data between your local network (LAN) and the internet, often connecting multiple devices wirelessly or via cables.

Switch is used within a LAN to connect multiple devices, enabling them to communicate with each other efficiently by forwarding data only to the intended recipient.

Modem connects your network to your ISP, converting digital data from your devices into a signal that can be transmitted over your internet connection, whether it's cable, DSL, or fiber. Together, these devices form the backbone of most home and business networks.

network hardwares

Understanding IP Addresses in Networking

Consider IP addresses like real-life addresses. To send something to a particular place, you need that place's address. Similarly, an IP address is a unique identifier assigned to every machine that wants to send and receive data over the internet. Without IP addresses, devices wouldn't know where to send or receive data.

ip-pic

Types of IP Addresses

IPv4 and IPv6 An IPv4 address looks like 192.168.0.1. It consists of four numbers separated by dots, with each number ranging from 0 to 255. Due to the limited number of IPv4 addresses, we moved to IPv6, which looks like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. IPv6 provides a much larger pool of addresses, but even with this, managing IP addresses efficiently remains a challenge due to the increasing number of internet-connected devices.

Public and Private IP Addresses

img-3

  • Public IP Address: Assigned by your ISP, used to connect your network to the internet.

For example, 203.0.113.42 might be the public IP address assigned to your home router. This public address is used as the default gateway for your devices to send and receive data from the internet outside your local area network.

  • Private IP Address: Used within a local network, such as 192.168.1.0, to communicate between devices without using the internet.

Subnetting

subnetting-image

Subnetting is a method of dividing a large network into smaller, more manageable segments or sub-networks (subnets). This helps improve network performance and security by limiting the number of devices in each subnet.

Example: If you have a network with the IP range 192.168.1.0/24 (256 addresses), you can create two subnets:
192.168.1.0/25 (128 addresses)
192.168.1.128/25 (128 addresses)
This ensures each subnet can handle up to 128 devices, making network management more efficient.

Check your IP address

  • Windows: Type ipconfig in Command prompt.
  • macOS/Linux: type ifconfig or ip a in terminal.

Network protocols

By "protocol," we mean a set of rules or standards that define how to complete a task. In networking, a network protocol is a set of rules that devices must follow to send and receive data over the internet. These protocols ensure that data is transferred accurately and securely between devices.

There are many network protocols, such as FTP, HTTP/HTTPS, SMTP, SSH, ARP, PPP, TCP/IP, TELNET, and more.
For simplicity, we'll focus on TCP/IP, FTP, HTTP/HTTPS, and SMTP.

Key Network Protocols

  • TCP/IP (Transmission Control Protocol/Internet Protocol)

TCP/IP is the foundation of internet communication. It ensures that data sent over the network is broken into packets, transmitted, and reassembled correctly at the destination.
Example: When you load a webpage, TCP breaks the data into packets, IP routes them, and TCP reassembles them for your browser.

  • FTP (File Transfer Protocol)

ftp-img
FTP is used to transfer files between a client and a server over the internet.
Example: Web developers often use FTP to upload website files from their local computer to a web server.

  • HTTP/HTTPS (HyperText Transfer Protocol / HyperText Transfer Protocol Secure)

HTTP is the protocol for transferring web pages. HTTPS is the secure version, encrypting data to protect it from interception.
Example: When you visit a website, your browser uses HTTP or HTTPS to request and receive the page's content from the server.

  • SMTP (Simple Mail Transfer Protocol)

smtp-image

SMTP is used to send emails. It ensures that emails are correctly routed from the sender's server to the recipient's server.
Example: When you hit "send" on an email, SMTP handles the delivery of that message to the recipient's email server.

These few protocols are essential for the seamless operation of the internet, enabling everything from browsing websites to sending emails.


DNS(Domain Naming System)

When you visit a website by entering a domain name in your browser, like 'www.dev.to' or 'dev.to', how does the browser know where to go? The browser sends this request to a DNS server, which resolves the domain name to its corresponding IP address.

The DNS server uses a DNS map table to look up the IP address associated with the domain. Once it finds the correct IP address, it returns this information to the browser, which then uses the IP address to contact the website's server and load the webpage.

DNS is a complex system involving multiple layers, including root servers, TLD servers, and authoritative name servers. However, this overview provides a simplified explanation to help you grasp the basic concept. The full workings of DNS involve more detailed processes that ensure efficient and reliable domain name resolution.


If you liked reading consider upvoting, share and comment for more articles revolving around CS fundamentals ;-)

Top comments (0)