Unit 8: Transport Layer Flashcards

1
Q

Transport layer is the communication between ______

A

Processes

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

a) Define Multiplexing at sender

b) What is created and by what process?

A

a) Handling data from mutltiple sockets, adding transport header and transporting these to the network layer
b) Segments are created by encapsulation

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

Define Demultiplexing at receiver

A

Receiving transport layer segments (from network layer), checking the header to find corresponding socket and delivering messages to app layer

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

How many bits make up UDP port header?

A

32

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

What uniquely identifies a socket in UDP?

A

Destination IP address + port

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

a) Define Connectionless Demultiplexing

b) What is an issue with this method and give an example of where this would cause issues?

A

a) IP datagrams with the same destination port but different source IP and/or port are directed to the same socket at destination
b) In telephony for example, different people could send audio signals at the same time to the same person

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

a) Define Connection-Oriented Demultiplexing
b) What protocol uses this?
c) What is an issue with this method and why?

A

a) Using both the source IP/port and destination IP/port to uniquely identify socket
b) TCP
c) Web servers have different sockets for each connecting client and in non-persistent HTTP, different socket for each request. This leads to large overhead

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

a) Define Multi-Threading and explain how it works

b) What type of connection is supported by multi-threading?

A

a) A server instance is run in a single process that deals with each client request in a single different thread. With each thread, the server creates a distinct socket associated to the TCP connection
b) Concurrent HTTP connections

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

a) Give 2 negative qualities of UDP

b) Give 2 reasons why it is connectionless

A

a) UDP segments may be lost and delivered out of order

b) There is no handshaking and each UDP segment is delivered independently

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

a) Give 2 real usages of UDP and why UDP suits these.

b) Give 4 sometimes useful qualities of UDP

A

a) Streaming multimedia - can tolerate lossy data. DNS - lower overhead than using TCP
b) (1) There is no connection overhead. (2) It is simple - no connection state at sender/receiver. (3) Small header size. (4) No congestion control means segments can be transmitted as fast as desired

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

Explain the steps to create a checksum

A
  1. Split body into 16-bit and add together
  2. Wraparound any leading 1s
  3. Invert
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Define rdt 1.0 and the environment this is used in

A

Reliable transfer over a reliable channel where there are no bit errors or loss of packets

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

a) Define rdt 2.0 and the environment this is used in

b) What three features were brought in for rdt 2.0 to address this?

A

a) A channel with bit errors (flipping bits)
b) (1) ACKS - receiver tells sender packet was received ok. (2) NAKS - receiver tells sender packet had errors. (3) Checksums

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

What happens in an operation with no errors in rdt 2.0?

A
  1. Sender sends packet
  2. Receiver receives packet, responds with ACK.
  3. Sender receives ACK and moves on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens in an operation with errors in rdt 2.0?

A
  1. Sender sends packet
  2. Receiver receives corrupt packet and responds with NAK
  3. Sender receives NAK and retransmits packet
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

a) Define and explain rdt 2.1

b) What was feature was introduced?

A

a) Senders handle garbled ACK/NAKs by using a sequence number. If sender received corrupted ACK/NAK, sequence number is set to 1 to indicate duplicate packet. If receiver gets a sequence number that differs from expected i.e. a duplicate, packet is discarded and an ACK sent back
b) Sequence numbers

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

Why do 2 sequence numbers suffice in rdt 2.1?

A

0 indicates new packet, 1 indicates retransmission

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

a) Define rdt 2.2 and the difference between rdt 2.1
b) How does ACKing work?
c) What does a duplicate ACK at sender mean?

A

a) rdt 2.2 removed NAKs and instead sends an ACK to indicate the last packet was received ok
b) The receiver includes sequence number of packet being ACKed
c) There was an error at receiver so retransmit the packet

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

a) Define rdt 3.0 and the environment this is used in

b) What feature was introduced and why?

A

a) Channels with errors and loss in which ACKs may never be received
b) Timers to wait a reasonable amount of time for an ACK to come back. Upon timeout, retransmit packet. If packet or ACK is a retransmission, the sequence number indicates this

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

a) What happens in premature timeout?

b) What does this lead to?

A

a) The sender waits too short of a time for an ACK to return from the receiver when it is just delayed
b) The sender resends the packet after timeout and the receiver sees this as a duplicate, so retransmits the ACK. Meanwhile, the original ACK arrives at sender, so sender begins to transmit another packet. Upon arrival of second ACK, the sender now thinks this is a duplicate so resends the packet. The receiver sees the duplicate packet so retransmits ACK. This leads to unnecessary retransmissions

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

a) What can be done to avoid unnecessary timeouts?

b) What is still a problem with doing this?

A

a) Discarding duplicate ACKs at sender
b) The sender doesn’t know whether the duplicate ACK was caused by corruption of packet at receiver or by premature timeout

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

Give the formula for calculating Transmission Delay

A

L = packet length (bits). R = Bandwidth (bps)

Transmission delay = L/R

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

a) Give the formula for calculating Sender Utilisation via stop-and-wait
b) What does this represent?

A

a)
Transmission delay (L/R)
———————————–
RTT + Transmission delay

b) The fraction of time the sender is busy sending

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

a) How would you calculate Sender Utilisation when using Pipelining?
b) Define pipelining

A

a)
No. of packets pipelined * Transmission delay (L/R)
————————————————————————-
RTT + Transmission delay

b) Multiple ‘in-flight’ packets sent concurrently, don’t have to wait for packet to be received to send the next

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

a) Give a similarity of Go-Back-N and Selective Repeat

b) Give two differences

A

a) Sender can have up to N unACKed packets
b) (1) In go-back-n, receiver sends a cumulative ACK, selective repeat sends individual ACK for each packet. (2) In go-back-n, sender has a timer for the oldest unACKed packet and upon timeout, retransmits all unACKed packets. Selective repeat maintains a timer for each unACKed packet, upon timeout retransmit that one packet

26
Q

Go-Back-N:

a) What is send_base?
b) What is nextseqnum?

A

a) The sequence number of the oldest, unACKed packet

b) The smallest, unused sequence number in window

27
Q

Go-Back-N:

What happens when the timer for the oldest unACKed packet runs out?

A

The sender retransmits the oldest packet and all in the window with higher sequence numbers

28
Q

Go-Back-N:

a) What does it mean when sender receives an ACK, for example, with sequence #2 before #0 & #1?
b) What is this called?

A

a) This means that #0 and #1 have been received correctly

b) Cumulative acknowledgement

29
Q

Go-Back-N:

What happens when a receiver receives an out-of-order packet?

A

Discard the packet (don’t buffer) and re-ACK packet with highest in-order sequence number

30
Q

Selective Repeat:

What is buffered and where?

A

The receiver buffers all out of order packets at most N in a receive window

31
Q

Selective Repeat:

a) What happens when the timer runs out for a packet?
b) How many timers are there?

A

a) The sender resends that packet and restarts timer

b) One for each packet

32
Q

Selective Repeat:

What happens when an out of order packet is received at receiver?

A

The packet is buffered and ACK is sent

33
Q

Selective Repeat:

What happens when an in-order packet is received at receiver?

A

Sender marks packet as received

34
Q

Selective Repeat:

What happens if packet is received out of window and why?

A

The ACK for that packet was probably lost, retransmit ACK

35
Q

What are 3 problems with selective repeat?

A
  1. There is a lack of synchronisation between sender & receiver
  2. The receiver doesn’t know any behavious or status of sender
  3. Receiver can end up accepting duplicate data
36
Q

What is the rule for window size in selective repeat?

A

Window size <= half sequence number

37
Q

Give 6 qualities of TCP

A
  1. Point-to-point - communication between one sender + receiver
  2. Full duplex data - bidirectional data flow in same connection
  3. Pipelined - multiple segments being transmitted in channel at same time
  4. Reliable, in-order - transmitted as byte stream, not sequence of segments
  5. Connection-oriented - handshaking is required
  6. Rate controlled - sender rate of transmission limited by receiver
38
Q

What does the sequence number in TCP represent?

A

The first byte of data in a chunk of data within a stream

39
Q

In TCP, With what acknowledgement number does a receiver respond?

A

An ACK equal to the sequence number of the next expected packet

40
Q

What triggers retransmissions in TCP?

A

Timeout events and duplicate ACKs - if sender receives 3 ACKs for same data, resend unACKed packet with smallest sequence number

41
Q

What happens when an in-order packet is received in TCP? What is this called?

A

Wait up to 500ms for next segment, if no further segment, send ACK - cumulative ACK

42
Q

a) What happens when an in-order packet is received, with one in-order segment waiting for ACK transmission in TCP?
b) What type of approach is this like?

A

a) Immediately send single cumulative ACK, ACKing both in-order segments
b) Go-back-N

43
Q

What happens when an out-of-order packet is received with a higher-than-expected sequence number in TCP? (Gap detected)

A

Immediately send duplicate ACK, indicating the expected sequence number and buffer the segment

44
Q

a) What happens when a segment arrives that partially or completely fills a gap in TCP?
b) What type of approach is this like?

A

a) Send an immediate ACK provided that the segment starts at the lower end of the gap
b) Selective repeat

45
Q

What does handshaking achieve?

A

It establishes a connection by agreeing on connection parameters, e.g. initial sequence number and buffer size

46
Q

In handshaking, what state does the client and server start in?

A

Listen

47
Q

In handshaking, how does the client get to SYNSENT state?

A

It chooses initial sequence number and sets TCP SYN flag to 1

48
Q

In handshaking, how does the server get to SYN RCVD state?

A

It receives a TCP SYN message from client and sends TCP SYNACK (ACK = x+1) with an initial sequence number. At this point it is a half-open connection

49
Q

In handshaking, how does the client get to ESTAB state?

A

It receives a SYNACK which indicates the server is live. It then sends an ACK to server (ACK = y+1)

50
Q

In handshaking, how does the server get to ESTAB state?

A

Receives an ACK, indicating client is live

51
Q

In handshaking, what happens if a SYN is lost?

A

Client times out and sends SYN again

52
Q

In handshaking, what happens if a SYNACK is lost?

A

Server times out and terminates half-open connection

53
Q

What happens in the closing of a connection in TCP?

A

The client and server each close their side of the connection by sending a TCP segment with FIN bit = 1. Each side responds to received FIN with ACK

54
Q

What is the rwnd?

A

The receiver advertises free buffer space by including a receive window in TCP header of receiver-to-sender segments

55
Q

How does the sender limit transmission in congestion control?

A

LastByteSent - LastByteAcked <= cwnd

56
Q

Give the equation for TCP sending rate

A

Send cwnd bytes, wait RTT for ACKs then send more bytes

rate = cwnd / RTT

57
Q

What happens in TCP slow start? When does this state change?

A

cwnd is doubled every RTT (increased exponentially)
When cwnd gets to threshold value before timeout, switch to linear increase (congestion avoidance) and set ssthresh to 1/2 of the cwnd without congestion

58
Q

What happens in TCP congestion avoidance?

A

On detected congestion, ssthresh is set to 1/2 of cwnd without congestion. cwnd increases by one for each transmission

59
Q

How do you recognise loss via timeout on a graph?

A

The cwnd is set to 1 MSS and then grows exponentially (slow start) to ssthresh

60
Q

How do you recognise 3 duplicate ACKs on a graph in TCP Reno?

A

The cwnd is set to 1/2 (fast recovery) and grows linearly (congestion avoidance)

61
Q

How do you recognise 3 duplicate ACKs on a graph in TCP Tahoe?

A

The cwnd is set to 1 (as in timeout) and grows exponentially (slow start)

62
Q

What is AIMD?

A

Additive increase (increase cwnd by 1 MSS every RTT until loss detected) multiplicative decrease (cut cwnd in half after loss) - sender increases transmission rate, probing for usable bandwidth until loss occurs