Transport LAYER Flashcards

1
Q

What is a socket used for

A

Analogous to a door, used to identify which application to the network data belongs to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What information is stored in a socket

A

The 5 tuple, local IP,remote IP ,local port ,remote port ,protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Differences between tcp and udp

A

TCP is connection oriented, udp is connection less

TCP has Additional features, udp is lightweight

TCP has error recovery, udp does not

Because tcp has error recovery and retransmits, it is known as reliable while udp is unreliable

TCP has windowing flow control, udp does not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Udp sounds a bit trash, what’s it even used for

A

Udp is great for video streaming and phone calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In tcp what’s the three way handshake

A

The client sends a tcp segment with the flag SYN, short for synchronise with me, the server can then decide if it wants to participate in the connection or not, if it does it’ll send a tcp segment back with the ACK and SYN flags set, then the client sends back a segment with the ACK flag set.

The three way handshake is used to start a connection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the steps for closing a connection in tcp the main way

A

Client or server can start the process.

Either first sends a segment with the FIN, short for finish and ACK flags set. The other then sends back a segment with the ACK flag set. Then it sends a segment with the same FIN and ACK flags set. The other then responds with a segment with the ACK flag set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the other way to close a tcp connnection

A

Either the client or server will send a segment with the RST flag set, which is short for RESET. This will close the connection completely. This message is usually sent when something has gone wrong and is good when troubleshooting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

ISN

A

Initial sequence number, in the first SYN segment, this is set to a random number at the start of the tcp connection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the window size

A

The amount of data an application can send before it needs an acknowledgement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is it possible for UDP to be reliable?

A

If the application which uses it implements its own reliability measures such as acknowledgments and timers etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is a checksum calculated?

A

The sender will computer the checksum as the binary addition of the bit chunks it is sending. After this, the sender takes the 1’s compliment of this number (XOR operation changing zeroes to ones and ones to zeroes). The result is the checksum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does a receiver validate data using the checksum?

A

The receiver after receiving all the data blocks sums up the chunks of bits and checksum. If the result is all 1’s, the data is validated and there is no bit loss. Otherwise, it rejects the packet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a NACK protocol?

A

NACK *(Negative Acknowledgment) is when a receiver only sends an ACK when a packet has not been received.

Example packet loss of x is only detected when packet x+1 is received

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Disadvantage of NACK

A

If packet x is lost and the transmission time of data between a sender and receiver is very large, it will take some time before packet x is received again

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Advantage of NACK

A

If the connection and transmission of data between a sender and receiver is very reliable, there is no need for acknowledgment, compared with normal acknowledgment. Can speed things up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the two error recovery strategies in a TCP connection?

A

Go back N and Selective Repeat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which error recovery strategy used in TCP is more efficient on network bandwidth?

A

Selective repeat because it only re-transmits messages that have been lost at the receiver

Go back N sends the first message that was lost and then re-transmits all subsequent messages, without any regard for whether the receiver has actually received these messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the Bandwidth Delay Product and how is it calculated?

A

A measure of how many bits can fill up a network link. It gives the maximum amount of data that can be transmitted by the sender at a given time before waiting for acknowledgment.

= Round Trip Delay (RTT in seconds) x Link Capacity of the Channel (bits/second)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Why did the designers of TCP decide to add a fast transmit after three consecutive duplicates ACKS instead of just re-transmitting after one duplicate ACK?

A

Because the re-ordering of data would cause an unnecessary retransmission

20
Q

what are the two ways tcp detects losses?

A

using a re-transmission timeout (RTO) or when it receives three ACKS in a row

21
Q

What happens to the window size when a TCP party idenfise packet loss?

A

if the loss was detected through a timeout, then the window size is reduced to 1

if the loss was detected through receiving three consecutive ACKS, the window size is halved

22
Q

What does a UDP segment header consist of and how large is it?

A
Source port number
Destination port number
Length (in bytes, including header)
Checksum (this is optional)
Payload

A UDP segment header is 8 bytes in size

23
Q

What is pipelining?

A

Pipelining allows the sender to send multiple yet to be acknowledged packets. To achieve this, the range of sequence numbers must be increased, and there must be buffering at the sender and/or receiver

The two forms of pipelined protocols are go back n and selective repeat

24
Q

What is the formula for the utilisation of a link when a pipelined protocol with window size N is used?

A

U = N * L/R * 1/(L/R + RTT)

25
Q

What does a tcp header include and how large is the tcp header?

A
Source port number
Destination port number
Sequence number
Acknowledgement number
Receive window
Header length
Checksum 
Options
Data

A tcp header is 20 bytes in size

26
Q

What does MSS stand for?

A

Maximum segment size, refers to the maximum size a TCP segment is (payload + header)

27
Q

Formula for TCP timeout interval

A

EstimatedRTT + 4 * DevRTT

28
Q

Formula for TCP estimatedRTT and what are its characteristics?

(Hint: alpha is in it and what value is it?)

A

(1-alpha) * EstimatedRTT + alpha*SampleRTT

Alpha is typically 0.125

Exponential weighted moving average

Influence of past sample decreases exponentially fast

29
Q

What is the SampleRTT in tcp timeout?

A

Measured time from segment transmission until ACK is received

30
Q

Formula for DevRTT in tcp transmission

Hint: What is the value of beta typically?

A

(1-beta) * DevRTT + beta * abs(SampleRTT - EstimatedRTT)

Beta is usually 0.25

31
Q

What does DevRTT stand for?

A

Deviation in RTT

32
Q

What is the formula for TCP sending rate?

A

Approximately equal to:

Control window = cwnd
RTT = round trip time

Rate = cwnd / RTT

33
Q

What is TCP slow start?

A

When a tcp connection begins, the value of the congestion window = 1 MSS. Every time a transmitted segment is first ack’d, every RTT, the cwnd is doubled. In slow start phase, the sending rate is increased exponentially until the first loss is experienced. The initial sending rate is slow, but increases rapidly.

34
Q

What does ssthresh stand for?

A

Slow start threshold, determines the (de)activation of slow start

35
Q

What happens when a loss event is detected by a timeout in a tcp connection?

A

Cwnd is set back to 1 MSS, and slow start phase starts again. A variable ssthresh is also set to cwnd/2

36
Q

What happens when cwnd reaches the value of ssthresh?

A

The slow start phase ends and the congestion avoidance phase begins

37
Q

What happens on entry into the congestion avoidance phase?

A

Cwnd is approx half its value when congestion was last encountered. Cwnd only increases by 1 each RTT

38
Q

What happens in congestion avoidance when a timeout occurs?

A

The congestion avoidance phase behaves the same way as the slow start phase when a timeout occurs, that is it sets cwnd to 1 MSS and the value of ssthresh is set to cwnd/2

39
Q

What happens when a loss event occurs in congestion avoidance?

A

A loss is detected here by a triple ACK, the value of cwnd is halved and ssthresh is set to cwnd/2. In this case, the congestion avoidance phase ends and the fast recovery phase begins

40
Q

What happens in the beginning of fast recovery?

A

The value of cwnd is increased by 1 MSS for every duplicate ACK received for the missing segment that caused the TCP to enter the fast recovery phase. Eventually when an ACK arrives for the missing segment, TCP enters the congestion avoidance phase after deflating cwnd

41
Q

What happens when a timeout occurs in the fast recovery phase?

A

TCP enters the slow start phase, cwnd is set to 1 MSS and the value of ssthresh is set to cwnd/2

42
Q

What is AIMD and what are its characteristics?

A

In AIMD (Additive Increase Multiplicative Decrease), the sender increases the transmission rate (window size), probing for usable bandwith, until another congestion event occurs

43
Q

What is additive increase?

A

Refers to increasing the cwnd by 1 MSS every RTT until a loss is detected

44
Q

What is multiplicative decrease?

A

Refers to cutting cwnd in half after a loss

45
Q

What are the three flavours of TCP and what are their characteristics?

A

TCP Tahoe
- cwnd = 1 and enters slow start phase after either a timeout or triple duplicate ACK

TCP Reno

  • cwnd = 1 on timeout
  • cwnd = cwnd/2 on triple duplicate ACK

TCP New Reno
- TCP Reno + improved fast recovery