Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC364 Lecture 05

CSC364 Lecture 05

Introduction to Networked, Distributed, and Parallel Computing
Multiple Connections
(202601)

Avatar for Javier Gonzalez-Sanchez

Javier Gonzalez-Sanchez PRO

January 16, 2026
Tweet

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 364 Introduction to Networked, Distributed, and Parallel Computing Lecture 05. Blocking 1
  2. 2 Previously Your Computer Port Port Port Port Port Port

    Port Port Socket Socket example.org
  3. 3

  4. 5 nslookup • nslookup j a viergs.info ✅ http a

    ccess without a problem - sm a ll a lert • nslookup c a lpoly.edu ❌ http a ccess f a il - Certi f ic a te v a lid for n a me not for the numeric a ddress Name: javiergs.info Address: 35.165.238.131 Name: calpoly.edu Address: 23.185.0.1
  5. 7 HTTP de f ines: • Requests (GET, POST) •

    He a ders (Host, Content-Type) • Responses (200 OK, 404 Not Found) Ex a mple: GET /index.html HTTP/1.1 Host: calpoly.edu
  6. 8 Analogy - a person making a phone call 🖥

    Client (Web Browser) → You holding the phone • You w a nt to communic a te • You know wh a t you w a nt to s a y (HTTP) • You do not know how the network works intern a lly 📒 DNS Server → Your cont a cts list • You a sk: “Wh a t is the phone number for c a lpoly.edu?” • DNS a nswers: 23.185.0.1 • DNS h a ppens before the c a ll st a rts. • DNS is not p a rt of the convers a tion.
  7. 9 Analogy - a person making a phone call •

    🌐 IP → Phone number + phone network • The IP a ddress is the phone number • Routers a re the cell towers / exch a nges • E a ch router forw a rds the c a ll b a sed on the number • IP does: (1) Addressing, (2) Routing, (3) Best-e ff ort delivery • IP does NOT: (1) Gu a r a ntee delivery, (2) C a re a bout order, (3) Know a bout websites
  8. 10 Analogy - a person making a phone call •

    🔁 TCP → The phone c a ll protocol • Even though p a ckets p a ss through m a ny routers, TCP exists only a t the endpoints. • Routers do not underst a nd TCP — they only forw a rd IP p a ckets. Im a gine something like this: • “C a n you he a r me?” • “Yes.” • “Ok a y, let’s t a lk.”
  9. 11 Analogy - a person making a phone call 🌍

    Web Server → The person you a re c a lling • The server a nswers the c a ll • It underst a nds HTTP • It does not c a re how the network routed the p a ckets 📝 HTTP (green a rrow) → The l a ngu a ge spoken • HTTP is the content of the convers a tion • Requests a nd responses • Me a ningful only once the c a ll is st a ble
  10. 12 TCP provides: • Connection setup (3-w a y h

    a ndsh a ke) • Reli a ble delivery • Correct ordering • Retr a nsmission • Flow control • HTTP doesn’t c a re how this h a ppens.
  11. 13 IP provides: • Logic a l a ddressing (IP

    a ddresses) • P a cket forw a rding between networks • Best-e ff ort delivery (no gu a r a ntees) Key Ide a : • IP does not gu a r a ntee delivery. • IP only tries its best. • Th a t’s why TCP exists.
  12. 15

  13. 16 What happens if two clients connect at the same

    time? Client Port Port Port Port Port Port Port Port Socket Socket Server Client Port Port Port Port Socket
  14. 19

  15. 20

  16. 23 HTTP Request • The QUERY_STRING is the p a

    rt of a URL th a t c a rries p a r a meters from the client to the server using the HTTP protocol. • It a ppe a rs a fter the ? in a URL. • When a browser requests a p a ge like: http://loc a lhost:8080/?n a me=J a vier&course=CSC364 • It sends the following HTTP request line to the server: GET /?n a me=J a vier&course=CSC364 HTTP/1.1
  17. 27 Lab • Run a HTTP server written in J

    a v a (ServerSocket) • Observe blocking beh a vior with multiple browser clients • Inspect HTTP request lines a nd he a ders • Simul a te a slow client a nd see its imp a ct • Extend the server (progr a mming a ctivity) ⚠ This server is single-thre a ded by design
  18. CSC 364 Introduction to Introduction to Networked, Distributed, and Parallel

    Computing Javier Gonzalez-Sanchez, Ph.D. [email protected] Winter 2026 Copyright. These slides can only be used as study material for the class CSC 364 at Cal Poly. They cannot be distributed or used for another purpose. 29