Same-host: OS communication (pipes, shared memory)
Different hosts: network communication
Client process initiates; Server process waits
๐ช Q4: What is a Socket?
Interface between application & transport layer
Acts like a communication "door"
Sending process writes to socket
Receiving process reads from socket
Developer controls app side; OS controls transport side
Socket API: socket(), bind(), listen(), accept()
๐ข Q5: How is a process identified?
By IP address (identifies host)
By Port number (identifies process)
Complete identification = (IP + Port)
Example: HTTP โ port 80, SSH โ port 22
๐ Summary: Application layer is topmost layer. Processes communicate via messages through sockets. Each process is uniquely identified by (IP address, Port number).
2 RTT per object (TCP handshake + HTTP request/response)
Connection closed after each response
Higher delay, more overhead
๐ Q20: Persistent HTTP
Single TCP connection for multiple objects
Connection remains open after response
Fewer RTTs, more efficient
Default in HTTP/1.1 and later
๐ Feature
๐ Non-Persistent HTTP (HTTP/1.0)
๐ Persistent HTTP (HTTP/1.1+)
TCP Connection
Separate connection for each object (HTML, images, CSS)
Single TCP connection for multiple objects
RTT Overhead
2 RTT per object
Only 1 initial RTT for handshake
Connection Close
Server closes after each response
Connection remains open (timeout or explicit close)
Delay
Higher delay, more network overhead
Lower delay, faster page loading
โ Q21: HTTP request parts: Request line (method + URL + version), header lines (Host, User-Agent, etc.), optional body. โ Q22: GET vs POST: GET retrieves data (data in URL, limited size, cached); POST sends data in body (form submission, unlimited, not cached). โ Q23: Common HTTP response codes: 200 OK, 301 Moved Permanently, 400 Bad Request, 404 Not Found, 505 HTTP Version Not Supported.
๐ช 6. Cookies โ Maintaining State over Stateless HTTP
โ Q24: Why are cookies needed?
HTTP is stateless โ cannot remember users
Cookies maintain user state across requests
Used for login sessions, shopping carts, personalization, tracking
โ Q25: Four components of cookies
1. Cookie header in HTTP response (Set-Cookie)
2. Cookie header in HTTP request (Cookie)
3. Cookie file stored in browser
4. Server-side database mapping cookie ID โ user data
๐ How cookies work: Server sends Set-Cookie โ Browser stores โ Browser includes Cookie in future requests โ Server identifies user via cookie ID.
โ Q27: What is Conditional GET? โ Client asks server if object was modified using If-Modified-Since header. Server replies 304 Not Modified if unchanged โ saves bandwidth and time.
TLS 1.3 is current standard (faster & more secure)
โ ๏ธ Why important? Without SSL/TLS, all data (passwords, credit cards) sent over HTTP is plain text and vulnerable to sniffing. Banking, e-commerce, email all rely on TLS.
7. Browser requests each object (using persistent connection if available)
8. Browser renders page and displays it to user
โ Q39: DNS resolution step-by-step (iterative)
1. Client queries local DNS resolver (configured by ISP/network)
2. Local DNS resolver queries a Root DNS server
3. Root server responds with referral to TLD server (e.g., .com)
4. Local DNS resolver queries TLD server
5. TLD server responds with referral to Authoritative server
6. Local DNS resolver queries Authoritative server
7. Authoritative server returns IP address for the hostname
8. Local resolver caches the result and returns IP to client
โ Q40: How cookies maintain state over stateless HTTP
1. Server sends Set-Cookie header in HTTP response (first visit)
2. Browser stores cookie (key-value pair) in cookie file/database
3. For subsequent requests to same domain, browser automatically includes Cookie header
4. Server reads cookie ID from request header
5. Server looks up cookie ID in its database to retrieve user state (login, cart, preferences)
6. Cookies can be persistent (with expiry date) or session-only (deleted after browser close)
Content Locked / ุงูู ุญุชูู ู ุบูู
Please log in using an educational email in Qatar ending with .edu.qa to view this summary.
ุงูุฑุฌุงุก ุชุณุฌูู ุงูุฏุฎูู ุจุงุณุชุฎุฏุงู ุจุฑูุฏ ุฅููุชุฑููู ุชุนููู ู ูู ูุทุฑ ููุชูู ุจู .edu.qa ูุนุฑุถ ูุฐุง ุงูู ูุฎุต.