transport layer Flashcards

1
Q

Where does the transport layer run?

A

only on the host and destination

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

transport layer functions

A

provides a reliable data stream over an unreliable network
provides communication between processes

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

primitives used by transport layer to provide communication between processes

A
  1. listen - wait for another process to contact us
  2. connect - connect to a process that is listening
  3. send - send data over the established connection
  4. receive - receive data over the established connection
  5. disconnect - release the connection
    • the interface exposed to the application layer
    • connection-oriented service over (possibly) connectionless network
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Berkley Socket primitives

A

the interface exposed to the application layer
used by TCP
1. socket- create a new communication endpoint
2. bind - assign a local address to an endpoint (socket)
3. listen
4. accept- passively establish an incoming connection
5. connect
6. send
7. receive
8. close

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

addressing

A

TSAP = Transport Service Access Point
NSAP = Network Service Access Point
internet uses IP addresses for NSAPs and ports for TSAPs

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

process servers

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

multiplexing

A

multiple transport connections over one network connection
servers typically hardcoded

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

inverse multiplexing

A

one transport connection over multiple network connections
a form of multihoming: multiple paths to the same destination

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

NAT

A

network address translation

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

Connection establishment using sequence numbers

A
  • if a segment comes in with a sequence number that we have already seen, we discard it
  • How do we ensure that there are never multiple packets with the same sequence number?
  • If a machine crashes and reboots, what sequence number should it choose?
    1. we use a packet hop limit to remove old packets; after time T, sequence numbers safe to wrap around
    2. we use time-of-day clock to decide which sequence number to choose; keeps working when host crashes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do sequence number affect performance?

A

they limit it
- x-bit sequence number
- y bytes per second sending rate
- sequence number wraps around after 2^x/y seconds
- sequence number that reappears within T seconds is retransmission
- sequence number that reappears later is new segment
- maximum sending rate: 2^x/T (bytes per second)

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

clock-based seq numbers

A

sequence numbers to use increase with clock, regardless of sending rate

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

forbidden region

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

three-way handashake

A

used by TCP
agreement on which seq num to use

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

connection release

A

when the exchange is complete, the connection should be closed

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

asymmetric connection release

A

connection ended by either participant without agreement → may result in data loss

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

symmetric connection release

A

the two armies problem
- the last party to send a message cannot know if it arrived
participants agree to end connection

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

the end-to-end argument

A

if the network(lower layers) are unable to provide a feature by itself, it should be removed from the network and provided by the hosts (transport layer or higher)

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

error control in transport layer

A

the transport layer is responsible for providing a reliable data stream over an unreliable network
transport layer check the end-to-end correctness of data

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

reliable delivery through retransmission

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

improving performance by using error control on lower layers

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

error control and crash recovery

A

protocol under normal circumstances:
1. segment
2. ACK
3. pass on to layer
4. segment

when machine fails:
1. segment
ACK not transmitted
2. pass on to layer
3. segment

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

crash recovery

A

machine fails:
1. segment
2. ACK
data not passed
3. segment

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

crash recovery on layer X

A
  • recovery from layer X crash can only be done by layer >X
  • when a crash occurs, the transport layer leaves it to the application layer to fix it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
flow control
regulating sending rate needed to slow down the sender if the receiver cannot handle the data rate example: phone cannot handle data rate - small capacity receiver
26
stop-and-wait: a 1-bit sliding window protocol
bandwidth inefficient for high-latency channels
27
sliding window protocols
- send multiple frames at the same time before waiting for an acknowledgment (i.e., filling the pipe) - ex: go-back-N, selective repeat
28
flow control and buffer management
received packets have to be buffered at the receiver - we have to wait for the application to read the data - used by TCP! perform buffer management separately
29
regulating sending rate
- congestion control is needed to slow down the sender if the network cannot handle the data rate - network cannot handle high data rate - small capacity network - this can also happen when many users share the same links
30
packet loss and end-to-end delay can be used to signal ....
congestion control
31
when foes congestion occur?
if the workload is too large for the available network resources
32
fair bandwidth allocation
max-min fairness convergence
33
max-min fairness
maximises minimum bandwidth, then uses excess bandwidth where possible
34
convergence
when new connections enter the network, the bandwidth needs to be reallocated
35
Why is available bandwidth unknown
the transport layer isn’t aware of the network topology, or who else is using the network
36
solution for unknown bandwidth
dynamically adjust bandwidth using trial and error keep trying to increase bandwidth usage → slow down when you receive congestion signal can we send using this much bandwidth? → no
37
additive increase, additive decrease
38
multiplicative increase, multiplicative decrease
39
additive increase, multiplicative decrease
40
regulating sending rate - efficiency and fairness
41
internet protocols
transport layer: TCP and UDP - all or nothing - may not meet your application’d requirements - insufficient separation between mechanism and policy
42
RFCs
(request for comment) are published by the Internet Engineering Task Force (IETF)
43
comparing complexity by number of RFCs
TCP > UDP ??
44
UDP
RFC: 768 very thin layer on top of IP doesn't do: - flow control - congestion control
45
UDP header
- provides ports needed to connect to remote applications - 32 bits - source port + destination port + UDP length + UDP checksum (includes fields from the IP header!)
46
TCP
one of the most important protocols on the internet provides a reliable end-to-end byte stream over an unreliable network
47
TCP header
- 32 bits - sequence number and acknowledgements allow reliable, in-order delivery and enable sliding window protocols - TCP checksum uses same IP-header fields as the UDP checksum - header length, options (o or more 32-bit words) - how do we know how long the TCP segment is? - window size: used for flow or congestion control??
48
flags used to establish/release TCP connections
ACK, SYN, FIN
49
connection establishment - three-way handshake
- every data byte has its own sequence number (SYN and FIN also have their own sequence numbers - sequence number **x+1**: bytes 0 to x have been received, expecting byte x+1 next - initial sequence numbers are randomly generated → ensures security
50
timestamp option
- use sequence number + timestamp to detect duplicates - improves performance
51
TCP PAWS
52
TCP sequence numbers
- every data byte has its own sequence number - initial sequence numbers are randomly generated
53
error control in TCP
reliable delivery through retransmissions dynamic timeouts in TCP
54
setting retransmission timers
- how long to wait before retransmitting a frame? - timer must be longer than round-trip time - congestion makes round-trip variable - if we set timer too high, bandwidth efficiency goes down
55
dynamic timeouts in TCP
- use a weighted moving average to smooth round trip time (SRTT) - do the same for the round trip time variance (RTTVAR) - calculate new retransmission timeout (RTO) based on these - R: round trip time
56
fast retransmission
→ performance improvement - packet loss detected when timers expire - takes time by design - duplicate ack can indicate packet loss
57
flow control in TCP
buffer management window size Nagle's algorithm
58
TCP window size - Nagle’s algorithm
- do not send more than one small packet at a time: wait for ack - a sender produces data in small amounts - small segments cause large overhead
59
Silly-window syndrome
- do not send window updates if available space is too small - a receiver that consumes data in small amounts - tiny window sizes cause large overhead
60
TCP delayed ACKs
- try to improve bandwidth efficiency (e.g. through piggyback) - wait up to 500 ms to send ack - send ack for every second full-size segment
61
Congestion Control in TCP
- flags OWR and EOE used for explicit congestion notification - additive increase multiplicative decrease in TCP (AIMD) - AIMD used to prevent network congestion - converges to fair and efficient bandwidth allocation - TCP implements this using its **congestion window** - **congestion window** is tracked on the sender - specifies how many segments can be transmitted - how does TCP combine the two windows? - we want **fast convergence**, but sending a large burst can occupy low-bandwidth links for a long time - increase congestion window whenever acks arrive - ack rate tells us data rate of slowest link
62
slow starts
- congestion window size grows based on ack rate - arbitrary threshold switches from slow start to additive increase slow start → congestion window growing over time
63
TCP Tahoe
- arbitrary threshold switches from slow start to additive increase - wait 1 RTT for segments to leave the network - additive increase - packet loss detected → reset congestion window - multiplicative decrease (threshold window)
64
fast retransmission
- packet loss detected when timers expire - we can count the number of packets in the network
65
TCP Reno (Tahoe + fast recovery)
- calculates the number of segments in the network by counting the number of duplicate acks - threshold reduced using multiplicative decrease - congestion window set to new threshold value
66
TCP versions that have implicit congestion control
TCP CUBIC TCP FAST TCP Compound TCP
67
TCP versions that have explicit congestion control
TCP with Explicit Congestion Notification TCP explicitly tells sender what rate to use
68
CUBIC TCP
determines rate based on packet loss used by default in Linux, Windows, MacOS
68
FAST TCP
determines rate based on end-to-end delay
69
Compound TCP
determines rate based on end-to-end delay and packet loss
70
how does TCP combine them (congestion window and window size)?
uses the smaller number
71
AIMD in TCP
we want fast convergence, but sending large burst can occupy low-bandwidth links for a long time increase congestion window whenever acks arrive slow start - starts with congestion window 1 and window size 1 - after receiving the first ack double the number of segments allowed at the same time (exponential growth) duplicate ack → packet loss or out of order arrival - TCP fast retransmission detects lost segment after 3 duplicate acks; triggers retransmission and multiplicative decrease