Lindsay Gaudinier at Hook 42
Quick note: sometimes words are mentioned before they are defined. Please have patience.
OSI model is a conceptual model that explains how network systems are supposed to communicate with each another, and breaks down this communication into abstract layers.
a.k.a. Transmission Control Protocol (TCP) / Internet Protocol (IP) because these are the foundational protocols in the suite
a.k.a. Department of Defense (DoD) model
Protocol: "a defined set of rules and regulations that determine how data is transmitted in telecommunications and computer networking" - Wikipedia
Each layer adds a header and an (optional) trailer to the information from the preceding layer
1. The user types in a Uniform Resource Locator (URL) into a browser
https://www.hook42.com/blog?page=2
2. Client (laptop) sends an HTTP Request to the Server
3. Server sends an HTTP Response back to the Client
Response Number | What it means | Example |
---|---|---|
1xx | Informational Response | 103 Early Hints |
2xx | Success | 204 No Content |
3xx | Redirection | 301 Moved Permanently |
4xx | Client Errors | 404 Not Found |
5xx | Server Errors | 503 Service Unavailable |
The difference between this:
and this:
a.k.a. HTTP over TLS or HTTP over SSL
The S stands for Secure
1. Basic TLS Handshake
Client sends a ClientHello to the server, includes list of supported protocols
Server responds with a ServerHello message, includes chosen protocol version
Server sends a Certificate messasge
Server sends a ServerHelloDone message
Client responds with a ClientKeyExchange message (contains either a PreMaster secret, public key, or nothing)
Client and server now compute a "master secret"
2. Client sends a ChangeCipherSpec record that says everything sent is now encrypted
Client sends authenticated and encrypted Finished message to the Server
Server attempts to decrypt the client's Finished message and verfy it. If the decrytion/verification fails, the handshake has failed, and connection should be dropped.
3. Server sends a ChangeCipherSpec record that says everything sent is now encrypted
Server sends authenticated and encrypted Finished message to the Client
Client attempts to decrypt the server's Finished message and verfy it. If the decrytion/verification fails, the handshake has failed, and connection should be dropped.
4. Application phase: now all the exchanges between the client and server are authenticated and encrypted
Creating a SSH Key
Public Key
Private Key
a.k.a. Secure File Transfer Protocol (SFTP)
Note: FTP can also use SSL/TLS, which is known as FTPS. NOT the same as SFTP.
Other ways to securely transfer files include Secure copy protocol (SCP) and rsync.
Widely used types of network services
Port # | Description |
---|---|
1 | TCP | 20 | FTP data transfer |
21 | FTP control command |
22 | SSH, SFTP |
23 | Telnet |
53 | DNS |
80 | HTTP |
118 | Structured Query Language (SQL) Services |
194 | Internet Relay Chat (IRC) |
443 | HTTPS |
666 | Doom |
Assigned by the Internet Assigned Numbers Authority (IANA)
Port # | Description |
---|---|
2375 | Docker |
3306 | MySQL database system | 8888 | MAMP web server | 8889 | MAMP MySQL database server |
8983 | Apache Solr |
9418 | git |
11211 | memcached |
33434 | traceroute |
33848 | Jenkins |
State | Meaning |
---|---|
CLOSED | The socket is not in use. |
LISTEN | The socket is listening for incoming connections. |
SYN_SENT | The socket is actively trying to establish a connection to a remote peer. |
SYN_RCVD | The socket has passively received a connection request from a remote peer. |
ESTABLISHED | The socket has an established connection between a local application and a remote peer. |
CLOSE_WAIT | The socket connection has been closed by the remote peer, and the system is waiting for the local application to close its half of the connection. |
LAST_ACK | The socket connection has been closed by the remote peer, the local application has closed its half of the connection, and the system is waiting for the remote peer to acknowledge the close. |
FIN_WAIT_1 | The socket connection has been closed by the local application, the remote peer has not yet acknowledged the close, and the system is waiting for it to close its half of the connection. |
FIN_WAIT_2 | The socket connection has been closed by the local application, the remote peer has acknowledged the close, and the system is waiting for it to close its half of the connection. |
CLOSING | The socket connection has been closed by the local application and the remote peer simultaneously, and the remote peer has not yet acknowledged the close attempt of the local application. |
TIME_WAIT | The socket connection has been closed by the local application, the remote peer has closed its half of the connection, and the system is waiting to be sure that the remote peer received the last acknowledgement. |