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
how does rdt work on channels with errors and potential losses
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
26
what causes the bad performance on channels with errors and potential losses and how do we fix it
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
27
cumulative ack
acknowledges all packets up to and including the sequence number
28
how does go-back-N work on the sender side
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
29
how does go-back-N work on the receiver side
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
30
what is flow control + 1 positive
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
data offset
tells you where the data starts in a segment
32
what are the 3 flags for congestion management
RST SYN FIN
33
FIN flag
connection should be closed
34
SYN flag
starts the handshake
35
RST flag
reset; abruptly terminates the connection
36
what does the sequence number signify in a tcp segment
counts the bytes of data being sent into the data stream
37
what does the acknowledgement number do in a tcp packet and what does it contain when being sent from the receiver side
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
what are the two flags for congestion notification
C; congestion experienced E; echos the congestion indication from receiver to sender
39
how does tcp fast transmit work
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
what happens if the timeout value is too short
unnecessarily retransmitting data
41
what happens if the timeout value is too long
then the sender is reacting too slowly to lost segments
42
sample rtt
measured time from segment transmission until the ack is received ignoring retransmissions
43
how do you calculate the estimated rtt
(1-a) * estimatedRtt + a * sampleRtt
44
when calculating estimated rtt what is the typical value of a
0.125
45
how do we calculate the timeout interval
estimatedRtt + 4*deviatedRtt
46
what does a larger rtt deviation mean for the timeout interval
it will be larger
47
how do we calculate the deviated rtt
(1-b) * devRtt + b*(sampleRtt - estimatedRtt)
48
when calculating devRtt what is the typical value of b
0.25
49
what does rcvbuffer() do
sets the size of the buffer
50
what is the default size for the rcv buffer
4096 bytes
51
what is the purpose of the receive window field in the tcp segment header
the receiver advertises its free buffer space
52
what is the point of a handshake
establishes connection between receiver and sender and agrees on connection parameters
53
how does the 3-way handshake work
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
how do we usually close the tcp connection
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
how do we abruptly close the tcp connection and what will happen when we do this
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
in which two ways can unnecessary duplicates of segments be caused
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
what is a cost of congestion
when a packet is dropped any recourses (network capacity/buffer space) already going up will have to be dropped and wasted too?
58
end-end congestion control
controls congestion by controlling the window on the sender/receiver side
59
what happens as transmission delay increases
buffer capacity approaches
60
how does selective repeat work
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
aimd
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
how does multiplicative decrease differ when triggered by a triple ack compared to a timeout
triple ack; loss cut in half timeout; cut to 1 max segment size
63
why do we use aimd (3)
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
congestion window
has byte indexes and the sender can only send the number of bytes in the window
65
how does slow start tcp work
the cwnd starts at 1 and doubles every rtt until it reaches the threshold then it switches to being increased by 1
66
how does slow start work if the packet is lost due to a timeout
the rate is reduced to 1 and the new threshold its 1/2 the rate when the packet was lost
67
how does slow start work if the packet is lost due to a triple ack
you enter congestion avoidance mode the cwnd = 1/2
68
how does tcp cubic work
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
wmax
window max rate the sending rate when a packet was lost (initially an arbitrary value)
70
bottleneck link
the routers output where packet loss occurs
71
what is the benefit of delay based congestion control
allows tcp to slow down the rate before packet loss occurs
72
how does delay based congestion control work
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
how to we calculate the measured throughput
num bytes in last rtt interval/rtt measured
74
ecn; explicit congestion notification
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