Unit 8: Transport Layer Flashcards Preview

Computer Systems & Networks > Unit 8: Transport Layer > Flashcards

Flashcards in Unit 8: Transport Layer Deck (62):

Transport layer is the communication between ______



a) Define Multiplexing at sender
b) What is created and by what process?

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


Define Demultiplexing at receiver

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


How many bits make up UDP port header?



What uniquely identifies a socket in UDP?

Destination IP address + port


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

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


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

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


a) Define Multi-Threading and explain how it works
b) What type of connection is supported by multi-threading?

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


a) Give 2 negative qualities of UDP
b) Give 2 reasons why it is connectionless

a) UDP segments may be lost and delivered out of order
b) There is no handshaking and each UDP segment is delivered independently


a) Give 2 real usages of UDP and why UDP suits these.
b) Give 4 sometimes useful qualities of UDP

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


Explain the steps to create a checksum

1. Split body into 16-bit and add together
2. Wraparound any leading 1s
3. Invert


Define rdt 1.0 and the environment this is used in

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


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 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


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

1. Sender sends packet
2. Receiver receives packet, responds with ACK.
3. Sender receives ACK and moves on


What happens in an operation with errors in rdt 2.0?

1. Sender sends packet
2. Receiver receives corrupt packet and responds with NAK
3. Sender receives NAK and retransmits packet


a) Define and explain rdt 2.1
b) What was feature was introduced?

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


Why do 2 sequence numbers suffice in rdt 2.1?

0 indicates new packet, 1 indicates retransmission


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) 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


a) Define rdt 3.0 and the environment this is used in
b) What feature was introduced and why?

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


a) What happens in premature timeout?
b) What does this lead to?

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


a) What can be done to avoid unnecessary timeouts?
b) What is still a problem with doing this?

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


Give the formula for calculating Transmission Delay

L = packet length (bits). R = Bandwidth (bps)
Transmission delay = L/R


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

Transmission delay (L/R)
RTT + Transmission delay

b) The fraction of time the sender is busy sending


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

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


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

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


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

a) The sequence number of the oldest, unACKed packet
b) The smallest, unused sequence number in window


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

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


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

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


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

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


Selective Repeat:
What is buffered and where?

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


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

a) The sender resends that packet and restarts timer
b) One for each packet


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

The packet is buffered and ACK is sent


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

Sender marks packet as received


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

The ACK for that packet was probably lost, retransmit ACK


What are 3 problems with selective repeat?

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


What is the rule for window size in selective repeat?

Window size <= half sequence number


Give 6 qualities of TCP

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


What does the sequence number in TCP represent?

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


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

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


What triggers retransmissions in TCP?

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


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

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


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) Immediately send single cumulative ACK, ACKing both in-order segments
b) Go-back-N


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

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


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) Send an immediate ACK provided that the segment starts at the lower end of the gap
b) Selective repeat


What does handshaking achieve?

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


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



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

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


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

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


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

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


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

Receives an ACK, indicating client is live


In handshaking, what happens if a SYN is lost?

Client times out and sends SYN again


In handshaking, what happens if a SYNACK is lost?

Server times out and terminates half-open connection


What happens in the closing of a connection in TCP?

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


What is the rwnd?

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


How does the sender limit transmission in congestion control?

LastByteSent - LastByteAcked <= cwnd


Give the equation for TCP sending rate

Send cwnd bytes, wait RTT for ACKs then send more bytes
rate = cwnd / RTT


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

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


What happens in TCP congestion avoidance?

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


How do you recognise loss via timeout on a graph?

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


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

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


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

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


What is AIMD?

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