TCP UDP and Reliable Data Transfer Mechanisms Flashcards
What are the responsibilities of the transport layer service
- Provide logical communication between application processes running on different hosts
How do transport protocols run? And what does this mean?
They run in end systems meaning the send side breaks application messages into segments and the receiver side reassembles segments into messages to pass to the application layer.
What are 2 main forms of transport layer protocol?
TCP and UDP (transmission control protocol) (user datagram protocol)
What does UDP provide? 4
- Unreliable connectionless transport layer protocol
- demultiplexes IP packets
- Error checking of data
- Has multiple applications in the host
What kind of services is UDP used by?
- Streaming media
What famous services sometimes go on top of UDP?
- SNMP
-DHCP - DNS
What happens if a UDP segment checksum field returns incorrect?
We dump the segment
What is TCP?
connection-oriented data streaming service transport layer protocol
What does TCP provide? 4
- Full duplex reliable mechanisms (go back n, selective repeat)
- A recovery mechanism for out-of-order packets, duplicates, lost packets, corrupt packets
- Flow and congestion control mechanisms
- Support for multiple application processes in the same system
In reliable data transfer (RDT) what are two things that can accidentally trigger a resend leading to unnecessary loss?
- Premature timeout
- Delayed acknowledgement
What are 2 RDT mechanisms?
- Stop and wait
- Sliding Window protocol
How does TCP initiate a connection?
- 3-way handshake: send connecting signal with initial SYN message, server sends TCP SYNACK msg, to ack the SYN then client sends an ACK to server –> connection is established
Where does the senders window start and end from for TCP?
First segment in window is the first that has been sent, but not yet ACKED in return, and the last element of the window will one that is ready to be sent but not yet sent.
When sending a segment with a sequence number –> if the previous ACK had number 92 and the previous Sequence had number = 27, what will the next sequence number and returning ACK be?
- Next sequence number : 92
- Next ACK: 28
(next sequence is same as previous ACK - next ACK is one more than previous sequence)
How does TCP close its connection?
- 4 way handshake
- client initiates with .close() command
- FINbit is sent
- Server responds with ACK
- Then server sends its own FINbit and then when it receives the last ACK to its FINbit from client, connection is fully shut
What kind of service does TCP provide and where?
TCP provides reliable data transfer service on top of IP connectionless service
What 3 things does TCP do to increase reliability?
- Pipelined sliding window segments so we can have a window size.
- Cumulative acknowledgements
- Single retransmission timer
What are retransmissions triggered by? (2)
- Timeout events
- Duplicate acknowledgements
How does TCP implement flow control?
It has a TCP socket buffer where it stores segments going to application layer, and another where segments going down to the network layer are stored too.
What are 2 congestion control approaches that can be followed? And which is taken by TCP?
- Network-assisted congestion control
- End to end congestion control (taken by TCP)
What is network assisted congestion control?
- Routers provide feedback to end systems such as:
- There is a single bit indicating congestion
- Explicit rate for sender to send at
What is end to end congestion control?
- No explicit feedback from system aka from network routers
- Congestion is inferred from end-system observed loss and delay (aka not receiving ACKS , buffers getting filled.)
What are some causes of congestion?
- If there is no space in the dedicated buffer (the new packets will either be dumped or will timeout
- The shared output link buffers are often bottlenecks
What happens as segments keep on getting added to the network traffic?
The throughput will increase initially and then the system will become congested, if this continues, throughput will reduce to 0, this happens when rate of entry is about half the system capacity (C/2)
Why is it good to have a long timeout?
If timeout is long - even if you retransmit many times, it does not create critical situation.
What can happen if timeout is too short?
The timer will have timed out though a packet will then have arrived shortly after - this means the next ACK number will increase even though the previous package must be resent. Basically then when the next package is resent, the package sent after it is not the one sequentially after because the ACK system has fucked up (this occurs when the timeout is too short for the RTT.
What is a good timeout interval?
TimeoutInterval = EstimatedRTT + 4*DevRTT
DevRTT = (1-b) * DevRTT + b * |SampleRTT - EstimatedRTT|
typical values of b are = 0.25 (OR 0.25)
What is Additive Increase Multiplicative Decrease (AIMD)
- Additively increase window size until loss occurs
- When loss occurs cut window size in half and then repeat
What is TCP Slow Start (SS)?
- When connection begins, increase rate exponentially until first loss event.
What is TCP Slow Start (SS)?
- When connection begins, increase rate exponentially until first loss event this occurs at the SS-threshold
What is the other name for AIMD?
TCP RENO
How does TCP Tahoe work?
- Uses slow start (SS) until a predefined ss threshold (no loss occurs by ss threshold)
- When ss_threshold is reached, starts increasing in linear way,
- Then when first loss occurs, move the ss threshold to half of the value at first loss, and then cut window size back down to original size.
- Start from ss again repeating above steps.
This greates a variable ss threshold.
TCP fairness - how is bandwidth to K TCP sessions sharing the same bottleneck link with capacity R assigned?
k/m
Why is TCP fair?
Resource repartition converges to a central point through using methods of loss reaction (cutting send window in half) and congestion avoidance (slowly increasing window through additive increase)