TCP Flashcards
What is TCP?
Protocol that control transmission
What are some TCP use cases ?
- Database connection
- Web connection
- Remote ssh connection
- Any bidirectional communication
How segments are being tracked in TCP ?
They are numbered with a sequence and acknowledge for “ order and retransmission purposes”
What is a file descriptor ?
Everything in linux is treated as a file , tcp connection is called file descriptor that uniquely represent a socket.
Socket/file descriptor example :
10.0.0.1:5555:10.0.0.2:22
What is a Four way handshake ?
The way a TCP connection is closed (fin-ack-fin-ack) , we delete the file descriptors from both sides
What is flow control ?
Property of TCP which manage how much a receiver can handle
What are the components of flow control ?
- Receiver window
- Sliding window (when the sender receives as acknowledgment it will slide its window
What is congestion control ?
A way to avoid congestion the middle boxes (routers) between receiver and sender
What are the existing algorithms of congestion control ?
- Slow start : with each ack , increment the MSS (maximum segment size) by one
- Congestion avoidance : increases linearly , all sent segments needs to be acknowledged to increase the MSS
How can the router notify the sender that it will face a congestion ?
Every IP header have an ECN (explicit congestion notification) flag which the router will set to 1 if its facing a congestion
How the router remember the ips when doing NAT ?
He keeps a NAT Table of the ips he replaced