- Networks
- HTTP Protocol
- IP Address
- DNS (Domain Name System)
- APIs (Application Programming Interfaces)
- Express NodeJS - First API call
- API Testing
- References
A network consists of two or more computers that are linked in order to share resources (such as printers and CDs), exchange files, or allow electronic communications. The computers on a network may be linked through cables, telephone lines, radio waves, satellites, or infrared light beams.
- Local Area Network (LAN)
- Wid Area Network (WAN)
Explain the backbone of communication between clients and servers:
-
What is HTTP ?
- Hypertext Transfer Protocol: A stateless, application-layer protocol used for transferring data over the web.
-
HTTP Methods
GET
POST
PUT
DELETE
PATCH
-
HTTP Request/Response cycle.
-
HTTP Headers
- Common headers: Content-Type, Authorization, Cache-Control, etc.
-
HTTP VS HTTPS:
- Secure communication with SSL/TLS.
-
Cookies and Sessions
- State management and authentication.
-
What is an IP Address ?
An IP address (Internet Protocol address) is a unique identifier assigned to devices on a network (like computers, phones, servers). It helps devices locate and communicate with each other over the internet or a private network.
-
IPv4 VS IPv6:
- IPv4 (Internet Protocol Version 4):
- Format: IPv4 addresses are written in dot-decimal notation, consisting of four numbers separated by dots. Each number is between
0
and255
. - Example:
192.168.1.1
- Bit Size:
32-bit
address (2³² possible addresses, about 4.3 billion unique IPs). - Usage: Most common type of IP address, used since the early days of the internet.
- Limitation: With the explosion of internet-connected devices, IPv4 addresses are running out, leading to the adoption of
IPv6
.
- Format: IPv4 addresses are written in dot-decimal notation, consisting of four numbers separated by dots. Each number is between
- IPv6 (Internet Protocol Version 6):
- Format: IPv6 addresses are written in colon-separated hexadecimal notation, consisting of eight groups of four hexadecimal digits.
- Example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
- Groups of zeroes can be shortened with
::
(e.g.,2001:db8::8a2e:370:7334
).
- Example:
- Bit Size:
128-bit
address (2¹²⁸ possible addresses, about 340 undecillion unique IPs). - Usage: Designed to replace IPv4 and accommodate the growing number of devices. It also improves security and efficiency.
- Format: IPv6 addresses are written in colon-separated hexadecimal notation, consisting of eight groups of four hexadecimal digits.
- IPv4 (Internet Protocol Version 4):
Tables | Are | Cool |
---|---|---|
Address Size | 32-bit (4.3 billion IPs) | 128-bit (340 undecillion IPs) |
Format | Decimal (e.g., 192.168.1.1) | Hexadecimal (e.g., 2001:db8::1) |
Security | No built-in encryption | Built-in IPSec for security |
Efficiency | Simple, but limited | Optimized for modern networks |
Address Length | Shorter | Longer |
Cover how DNS plays a role in resolving web addresses:
- What is DNS?
- Converts human-readable domain names (e.g., example.com) into IP addresses.
- DNS Components:
- Domain Name, IP Address, Nameservers.
- DNS Lookup Process:
- Recursive Resolver → Root Server → TLD Server → Authoritative Name Server.
- Caching:
- Role of DNS caching in speeding up requests.
- DNS Records:
A
-
Purpose: Maps a domain name.
-
Example:
example.com A 192.168.1.1
-
Usage: Directs traffic to a server's IPv4 address.
-
AAAA
-
Purpose: Maps a domain name to an IPv6 address.
-
Example:
example.com AAAA 2001:0db8:85a3::8a2e:0370:7334
-
Usage: Directs traffic to a server's IPv6 address.
-
CNAME
-
Purpose: Aliases one domain name to another.
-
Example:
www.example.com CNAME example.com
-
Usage: Allows
www.example.com
to point toexample.com
without duplicating A or AAAA records.
-
MX
- Purpose: Specifies the mail servers responsible for receiving emails for a domain.
- Example:
example.com MX 10 mail.example.com
- Priority: Lower numbers have higher priority (e.g.,
10
is higher priority than20
).
- Priority: Lower numbers have higher priority (e.g.,
- Usage: Routes emails to the correct mail server.
TXT
NS
SOA
PTR
SRV
ALIAS or ANAME Record
- Common DNS Issues:
- DNS propagation delays, misconfigurations.
Discuss how backend systems communicate using APIs:
- What is an API?
- Interface for communication between software components.
- Types of APIs:
REST
(most common)GraphQL
SOAP
gRPC.
- RESTful APIs:
- Principles:
- Stateless: means that calls can be made independently of one anther
- CRUD Operations: Create, Read, Update, Delete.
- Via HTTP protocol
JSON
andXML
formats.
- Principles:
- Authentication in APIs:
API keys
,OAuth2
,JWT
.
- API Documentation:
- Importance of clear docs and tools like
Swagger
,Postman
,Thunder clint
.
- Importance of clear docs and tools like
To establish a server using Node.js, you can use either the built-in http module or Express.js (which simplifies the process). Below are two methods:
- Method 1 (Using Node.JS direct):
const http = require('http');
// Create a server
const server = http.createServer();
// Listen on a port
const PORT = 3000;
server.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});
- Method 2 (Using Express Node.JS)
const express = require('express');
const app = express();
// Listen on a port
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});
- Make sure to understand all the previous sessions.
- Publish a server using Node.Js direct.
- Publish a server using Express.Node.Js.
- Access the server though your phone.
- Only run meefr-quiz-game test - follow the steps mentioned in readme file.
on github tasks repo.