- HTTP -> TCP/UDP
- NodeJS Webserver
- Internet a network of nodes sending packets
- Five layers to every packet
- Physical => Cables
- Link => WIFI/Ethernet |
- Network => IP |> TCP/IP
- Transport => UDP/TCP |
- Application => HTTP(S)/F(S)TP/SSH/SMTP
Transport layer creates 2^16 ports ~65.000
Ports are like room numbers in a hotel
WS: 49742 => SEGMENT => NETWORK
Destination port 80 UDP - lightweight/fast 8byte HEADER
Source: 49742 - Connectionless
- Consistency => sends data no matter what | UNRELIABLE
TCP - Connection-Based | Three way handshake
- RELIABLE
1. Delivery acknowledgement
2. Retransmission
3. In-order packets
4. Congestion Control
- Efficient
- Only connected when required
- Stateless
- No dialog | Everything forgotten after closing connection
Start line - REQUEST => Method: GET | Protocol: HTTP/1.1 RESPONSE => Protocol: HTTP/1.1 | StatusCode 201 Header - Content-type: text/html
Body - Content