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
Transport-Layer Congestion
List the possible causes of congestion.
Causes of congestion
- too many packets
- buffer overflow in routers
- unpredictable traffic patterns
- route changes
- time-of-day traffic
Transport-Layer Congestion
List the possible effects of congestion.
Effects of congestion
- higher end-to-end delay
- lost packets
- network instability
- loss of service
Describe the strategy for TCP congestion control
Slow start:
send 1 segment, if successfully ACK’d then send 2 segments, then 4, then 8 etc. (doubles for each ACK)
Congestion avoidance:
if an ACK is missing/delayed, then drop to half as many segments sent and start to increase number linearly
Transmitter uses RTT to monitor how busy network is
What is RTT?
RTT - Round Trip Time
Time for an acknowledgement to be received by the transmitter for a packet sent out.
Used in congestion-avoidance to monitor how busy network is.
What is flow control for TCP?
- end-to-end signal from the receiver
- explicit control from the receiver
Is TCP secure? Why/why not?
No TCP is not secure
TCP transmissions are not protected from inspection, forgery, modification or replay.
Problems with TCP
- security
- delay