TCP / HTTP Flashcards
What is TCP?
Transmission Control Protocol.
Sends streams of bytes, endlessly long.
The packets are labeled with a number, so if the application arrives too many packets out of order, it will wait for the remaining packets, and then send it in order. It has enough knowledge to know what is missing.
Stream-oriented
Multiplexer
Complex
Slow Startup (needs handshake)
What is the different between TCP (transmission control protocol) and UDP (user datagram protocol)?
TCP sends packets in order, and UDP (can) sends packets out of order.
TCP are stream oriented, and UDP are message oriented.
What are the WEB built up with?
URL + HTTP + HTML
How is an URL built?
Schema
Host
Path
How does the HTML in the Web work?
- Get IP of host in URL
- Connects to IP of host via TCP port 80
- Issue command (method) on path + options (headers)
- Get response
What it the difference between a Client and a Server?
The Client wants information. Uses random TCP port.
The Server provides information. Uses well-known TCP port.
What does GET, POST, HEAD and OPTIONS in HTML methods mean?
GET = retrieve path POST = modify this data on path HEAD = retrieve info about path OPTIONS = retrieve extra info about path
HTTP status code 1xx, 2xx, 3xx, 4xx and 5xx? (
1xx = information 2xx = success 3xx = redirects 4xx = client error 5xx = server error
Common HTTP status codes?
200 OK 100 Continue 307 Temporary redirect 308 Permanent redirect 403 Forbidden 404 Not found 405 Method not allowed 410 Gone 500 Internal Server Error
What does wget do?
Download and stores a file from the web.
What does curl do?
Download a file from the web, and show the content in stdout (like cat).