transport layer Flashcards

1
Q

what does the transport layer do

A

provides logical communication between application processes running on different hosts

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

what is the senders role in the transport layer

A

breaks the application message into segments, determines the header field values and passes them on to the network layer

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

what is the role of the receiver on the transport layer

A

reassembles the segments into messages by using the header values and demultiplexes the message to the application layer

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

multiplexing as a sender

A

data from multiple sockets is combined and when broken into segments the transport header allows them to be reassembled

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

demultiplexing as the receiver

A

the header info it used to deliver the segments to the correct socket or appropriate application

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

connectionless demultiplexing

A

the receiver uses the destination port number to direct the segment to the right socket

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

how do applications get the port number

A

they negotiate with the os and once its gotten it is attached to all outgoing udp packets
this allows the os to choose which applications get access to the network layer

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

how are ports like queues

A

the os creates an internal queue when it provides the port number
a buffer is attached to sockets so incoming data can join and wait its turn to be processed
if its full the data is dropped due to buffer overload
if the port number doesn’t match any ports it is discarded and a port unreachable icmp packet is sent

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

connection oriented demultiplexing

A

a handshake is required before transmission
each socket is identified by a 4 tuple; source and destination port number and ip which are all used to direct each segment to the appropriate socket

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

what are the key components of udp (3)

A

no delay or bandwidth guarantees
a best effort service; segments may be lost or delivered out of order
doesn’t require a handshake before transmission

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

how can you add more reliability to udp

A

adding it in the application layer or having appliation-specific error recovery

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

how are segments handled in udp

A

independently as the order isn’t important

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

what are some key points about the udp header (2)

A

smaller header size only 8 bytes long
no congestion control so can go as fast as possible

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

checksum

A

detects errors in the transmitted segment

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

how do checksums work

A

the sender treats the contents of the segment as a sequence of 16 bit integers and adds them up and the value is put into the checksum field of the udp header
the receiver computes the checksum of the received segment and compares it with the value in the header
if they’re the same then threes no errors

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

what is one of the problems with checksums

A

if there is an even amount of errors it wont be detected

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

rdt

A

reliable data transfer protocol

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

how does rdt work over a reliable channel

A

the sender waits for the application layer to send the data and adds a header to it
the receiver waits for the recv call from the network layer

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

stop and wait protocol

A

once the sender sends a packet it waits for an ack/nak

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

how does rdt work on a channel with bit errors

A

the sender transmits the packet and waits for an ack/nak and resends the packet if it gets an nak
the receiver sends an nak if the packet is corrupt and an ack if not

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

when working on a channel with only bit errors how do we solve the issue of the ack potentially being corrupted

A

when the sender resends the same packet, this may be a duplicate therefore we add sequence numbers (0 and 1 suffices) to indicate whether a packet is a duplicate

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

ack

A

acknowledge; sent by the receiver if a packet isn’t corrupted

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

nak

A

negative acknowledgement; sent by the receiver when the packet is corrupt

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

how does an nak-free protocol work

A

when a packet is corrupted the receiver sends the acknowledgment of the last uncorrupted packet including its sequence number

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

how does rdt work on channels with errors and potential losses

A

the sender starts a timer when it sends a packet and if it doesnt get an ack before the timer runs out, it assumes its lost and resends it
once an ack is received the timer is stopped

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

what causes the bad performance on channels with errors and potential losses and how do we fix it

A

whilst the packet is being transmitted and the ack is being sent back the channel isn’t being used at all
fixed with pipelining; sending multiple yet-to-be-acknowledged packets

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

cumulative ack

A

acknowledges all packets up to and including the sequence number

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

how does go-back-N work on the sender side

A

the sender has a window of up to N packets that it can send
once an ack has been received, the window is moved forward so it starts at n+1
the sender has a timer for the oldest in flight packet and if the ack doesn’t come withing the timeout then it’ll go back and resend it

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

how does go-back-N work on the receiver side

A

the receiver expects the packets in order
if the next sequence number expected isn’t the one on the next packet, it is buffered/ discarded and it re-ack the packet with the highest in order sequence number so the sender knows where to start resending from

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

flow control

A

the number of bytes the receiver is willing to accept
makes sure that the receiver buffer doesnt get too full and it has to start dropping packets

31
Q

data offset

A

tells you where the data starts in a segment

32
Q

what are the 3 flags for congestion management

A

RST
SYN
FIN

33
Q

FIN flag

A

connection should be closed

34
Q

SYN flag

A

starts the handshake

35
Q

RST flag

A

reset; abruptly terminates the connection

36
Q

what does the sequence number signify in a tcp segment

A

counts the bytes of data being sent into the data stream

37
Q

what does the acknowledgement number do in a tcp packet and what does it contain when being sent from the receiver side

A

makes sure that the data is being transferred from source to destination
contains the sequence number of the next byte expected from the sender

38
Q

what are the two flags for congestion notification

A

C; congestion experienced
E; echos the congestion indication from receiver to sender

39
Q

how does tcp fast transmit work

A

when a packet is lost in the middle of multiple packets being transmitted the receiver resends the last in order highest sequence number 3 times.
when this is received by the sender it will resend the un-ack-ed segment with the smallest sequence number

40
Q

what happens if the timeout value is too short

A

unnecessarily retransmitting data

41
Q

what happens if the timeout value is too long

A

then the sender is reacting too slowly to lost segments

42
Q

sample rtt

A

measured time from segment transmission until the ack is received ignoring retransmissions

43
Q

how do you calculate the estimated rtt

A

(1-a) * estimatedRtt + a * sampleRtt

44
Q

when calculating estimated rtt what is the typical value of a

A

0.125

45
Q

how do we calculate the timeout interval

A

estimatedRtt + 4*deviatedRtt

46
Q

what does a larger rtt deviation mean for the timeout interval

A

it will be larger

47
Q

how do we calculate the deviated rtt

A

(1-b) * devRtt + b*(sampleRtt - estimatedRtt)

48
Q

when calculating devRtt what is the typical value of b

A

0.25

49
Q

what does rcvbuffer() do

A

sets the size of the buffer

50
Q

what is the default size for the rcv buffer

A

4096 bytes

51
Q

what is the purpose of the receive window field in the tcp segmetn header

A

teh receiver advertises its free buffer space

52
Q

what is the point of a handshake

A

establishes connection between receiver and sender and agrees on connection parameters

53
Q

how does the 3-way handshake work

A

both the client and server open a socket in the listening state
client sends a packet to establish the connection with the SYNbit flag on and the starting seq number of the window
receiver receives the syn and enters the syn received state and sends an ack
the sender now knows the server is ready to accept packets
to establish the connection on the server side the sender should send an ack of the SYNbit ack

54
Q

how do we usually close the tcp connection

A

either the server or sender can close the connection from their side by sending a FINbit packet indicating that they want to close the connection

55
Q

how do we abruptly close the tcp connection

A

send an RSTbit packet
receiving this may mean that the other side wants to come back so the reciever of the rst will stay in the same state of connection so it can be continued if the other side comes back

56
Q

in which two ways can unnecessary duplicates of segments be caused

A

packets can be lost/dropped by the router due to full buffers which requires retransmission
the sender timer could timeout prematurely which means two copies have been sent and both have been delivered

57
Q

what is a cost of congestion

A

when a packet is dropped any recourses (network capacity/buffer space) already going up will have to be dropped and wasted too?

58
Q

end-end congestion control

A

controls congestion by controlling the window on the sender/receiver side

59
Q

what happens as transmission delay increases

A

buffer capacity approaches

60
Q

how does selective repeat work

A

the receiver sends an ack for every packet including its sequence number
the sender has an individual timer for each packet and once it times out it simply resends the packet

61
Q

aimd

A

additive increase; sendinig rate increased by 1 max segment size every rtt until loss is detected
multiplicative decrease; cut sending rate in half at each loss event

62
Q

how does multiplicative decrease differ when triggered by a triple ack compared to a timeout

A

triple ack; loss cut in half
timeout; cut to 1 max segment size

63
Q

why do we use aimd (3)

A

leads to a stable design as there’s no fluctuation in congestion
more congestion = more recourses wasted
rate is decreased to avoid congestion for others so they can still use the same line

64
Q

congestion window

A

has byte indexes and the sender can only send the number of bytes in the window

65
Q

how does slow start tcp work

A

the cwnd starts at 1 and doubles every rtt until it reaches the threshold then it switches to being increased by 1

66
Q

how does slow start work if the packet is lost due to a timeout

A

the rate is reduced to 1 and the new threshold its 1/2 the rate when the packet was lost

67
Q

how does slow start work if the packet is lost due to a triple ack

A

you enter congestion avoidance mode
the cwnd = 1/2

68
Q

how does tcp cubic work

A

there is a target time to reach the wmax rate
the farther away the sender is from it, the rate increases faster and slows down as the time approaches

69
Q

wmax

A

window max rate
the sending rate when a packet was lost (initially an arbitrary value)

70
Q

bottleneck link

A

the routers output where packet loss occurs

71
Q

what is the benefit of delay based congestion control

A

allows tcp to slow does the rate before packet loss occurs

72
Q

how does delay based congestion control work

A

the sender monitors the rtt and takes the min value which signifies no congestion
the it uses the amount of data successfully sent to calculate the throughput
if the measured tp is close to the uncongested tp then cwnd is increased
if the measured tp is far below the uncongested tp then the cwnd is decreased

73
Q

how to we calculate the measured throughput

A

num bytes in last rtt interval/rtt measured

74
Q

ecn; explicit congestion notification

A

the receiver sends packets back to the sender with an ack
when the routers buffer is almost full it tags the packet by changing the ecn bit to a 1 which indicated to the sender to slow down therefore you don’t lose any packets