port
160bit number that's used to direct traffic to specific services running on a networked computer.
TCP segment
Made up of a TCP header and a data section.
6 TCP control flags
1. URG(Urgent) : indicates that the segment is considered urgent and that the urgent pointer field has more data about this.
Handshake
A way for two devices to ensure that they're speaking the same protocol and will be able to understand each other.
Three way handshake.
Once the three way handshake is complete, the TCP connection is established.
Four way handshake.
Once on of the devices involved with the TCP connection is ready to close the connection, four way handshake happens.
Socket
The instantiation of an end-point in a potential TCP connection.
Instantiation
actual implementation of something defined elsewhere.
TCP sockets states
1. LISTEN : means that a TCP socket is readt and listening for incoming connections.
SYN_SENT: means that a synchronization request has been sent, but the connection hasn't been established yet.
SYN_RECEIVED : means that a socket previously in a listener state, has received a synchronization request and sent a SYN_ACK back.
But is hasn't received the final ACK from the client yet.
ESTABLISHED : means that the TCP connection is in working order, and both sides are free to send each other data.
FIN_WAIT : measns that a FIN has bben send, but the corresponding ACK from the other end hasn't been received yet.
CLOSE_WAIT : This means that the connection has been closed at the TCP layer, but that the application that opened the socket hasn't released its hold on the socket yet.
CLOSED : means that the connection has been fully terminated, and that no further communication is possible.
Socket states and their names can vary from operating system and operating system.