N5.1 TCP Flashcards
What layer of the internet model are TCP and UDP protocols used in?
Transport Layer
What are TCP packets called?
Segments
Is TCP connection-oriented or connection-less?
Connection-oriented
(ordered, confirmed, reliable)
- byte stream service (treats segments like a byte stream)
What does TCP stand for?
Transmission Control Protocol
What does UDP stand for?
User Datagram Protocol
What addressing do TCP and UDP use?
Port numbers
Describe a TCP connection set-up (3 way handshake)
Connection set-up
- Client: active open (looking for server connection)
- Client sends SYN
- Server (passive open): listening for connection
- Server acknowledges connection request (SYN ACK)
- Client opens socket at Local Connection Name
- Sends SYN ACK
- Server accepts and connects on Local Connection Name
Describe a TCP connection tear-down
Connection tear-down
- user A sends close request (FIN)
- user B acknowledges (FIN ACK)
- user B sends remaining data and ACKs
- user B sends FIN
- user A sends FIN ACK and waits for a number of seconds before close
- user B closes.
Give a TCP security precaution for sequence numbers
Use a random sequence number to start byte stream -not zero because its too predictable and packets could be faked.
What is the transport layer 5-tuple?
A - IP Address
P - Transport Layer Port Number
Each unique 5-tuple is a unique flow
Describe server port numbers for TCP
- well-known
- assigned
- server listens on well-known port for clients to connect
Describe client port numbers for TCP
- Ephemeral
- Allocated by OS
- Connections to same server will have different client port numbers
Give examples of TCP’s reliability
- Sequence numbers: maintain ordering of segments
- Acknowledgement: next expected sequence number at receiver given in TCP header
- Sender has a re-transmission strategy
- Checksum: uses pseudo header, checksum re-evaluated at receiver, bad checksum means packet discarded
Possible reliability strategies:
Describe the single packet (Idle-RQ) strategy.
Single packet (Idle-RQ) strategy
- send and wait
- sends one packet then waits for an ACK before sending next packet
- simple to implement but inefficient
Possible reliability strategies:
Describe the multiple packets (Continuous-RQ) strategy.
Multiple packets (Continuous-RQ) strategy.
- Transmitter sends as many packets as it can (finite number before it must wait for an ACK)
- Receiver sends ACKs as packets arrive
- Transmitter can resend any missing packet if no acknowledgement arrives