0% found this document useful (0 votes)
3 views2 pages

05 Computer Networks

The document provides an overview of computer networking fundamentals, including the OSI and TCP/IP models, key protocols, and addressing methods essential for web application communication. It covers concepts such as TCP vs UDP, the three-way handshake, HTTP vs HTTPS, DNS resolution, and load balancing, along with common interview questions related to these topics. Additionally, it explains the importance of CORS in MERN applications and the differences between various HTTP status codes.

Uploaded by

princa3006
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

05 Computer Networks

The document provides an overview of computer networking fundamentals, including the OSI and TCP/IP models, key protocols, and addressing methods essential for web application communication. It covers concepts such as TCP vs UDP, the three-way handshake, HTTP vs HTTPS, DNS resolution, and load balancing, along with common interview questions related to these topics. Additionally, it explains the importance of CORS in MERN applications and the differences between various HTTP status codes.

Uploaded by

princa3006
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Computer Networks

Overview
Networking fundamentals — the OSI/TCP-IP model, protocols, and addressing — underpin how web applications
(like the MERN apps you've built) actually communicate over the wire.

Key Concepts
• OSI Model (7 Layers): Physical, Data Link, Network, Transport, Session, Presentation, Application — a
conceptual framework for how data moves from one device to another.
• TCP/IP Model: A practical 4-layer model (Link, Internet, Transport, Application) that the modern internet
actually runs on; TCP/IP consolidates several OSI layers.
• TCP vs UDP: TCP is connection-oriented, reliable, ordered, with flow/congestion control (used for HTTP,
email); UDP is connectionless, faster, no delivery guarantee (used for video streaming, DNS, gaming).
• Three-Way Handshake: TCP connection setup: SYN → SYN-ACK → ACK, establishing sequence numbers and
confirming both sides are ready to communicate.
• HTTP vs HTTPS: HTTPS is HTTP layered over TLS/SSL, encrypting traffic and authenticating the server via
certificates to prevent eavesdropping and tampering.
• DNS Resolution: Translates human-readable domain names into IP addresses via a hierarchical lookup:
browser cache → OS cache → resolver → root, TLD, and authoritative name servers.
• IP Addressing & Subnetting: IPv4 addresses are 32-bit, divided into network and host portions via a subnet
mask; CIDR notation (e.g., /24) specifies the network prefix length.
• Sockets: An endpoint for sending/receiving data across a network, identified by an IP address and port
number, forming the basis of client-server communication.
• Load Balancing: Distributing incoming requests across multiple servers to improve availability and
throughput, using strategies like round robin, least connections, or IP hash.
• CDN (Content Delivery Network): A geographically distributed network of caching servers that serve static
content from a location close to the user, reducing latency.
Common Interview Questions
Q1. What happens when you type a URL into a browser?
DNS resolves the domain to an IP, the browser establishes a TCP connection (and TLS handshake for HTTPS),
sends an HTTP request, the server processes it and returns a response, and the browser renders the
received HTML/CSS/JS.

Q2. Why does TCP use a three-way handshake instead of two?


Two-way isn't enough to confirm both directions of communication are reliable — the handshake ensures
both client and server agree on initial sequence numbers and confirms bidirectional readiness before data
transfer begins.

Q3. What is the difference between a forward proxy and a reverse proxy?
A forward proxy sits in front of clients and forwards their requests to the internet (hiding the client); a
reverse proxy sits in front of servers and forwards client requests to the appropriate backend (hiding the
server).

Q4. Explain the difference between HTTP/1.1, HTTP/2, and HTTP/3.


HTTP/1.1 opens multiple connections and suffers head-of-line blocking; HTTP/2 introduces multiplexing over
a single connection with header compression; HTTP/3 runs over QUIC (UDP-based) to avoid TCP head-of-line
blocking entirely.

Q5. What is CORS and why does it matter for a MERN app?
Cross-Origin Resource Sharing is a browser security mechanism that restricts web pages from making
requests to a different origin unless the server explicitly allows it via response headers — relevant whenever
your React frontend and Node backend run on different ports/domains.

Q6. What's the difference between a 401 and 403 HTTP status code?
401 Unauthorized means authentication is required or has failed; 403 Forbidden means the server
understood the request and identified the client, but refuses to authorize it regardless of credentials.

Q7. How does DNS caching improve performance?


Repeated lookups for the same domain are served from cache (browser, OS, or resolver level) rather than
traversing the full DNS hierarchy again, reducing latency for subsequent requests until the TTL expires.

You might also like