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
Q

flow control

A

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

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

stop-and-wait: a 1-bit sliding window protocol

A

bandwidth inefficient for high-latency channels

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

sliding window protocols

A
  • send multiple frames at the same time before waiting for an acknowledgment (i.e., filling the pipe)
  • ex: go-back-N, selective repeat
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

flow control and buffer management

A

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

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

regulating sending rate

A
  • 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
Q

packet loss and end-to-end delay can be used to signal ….

A

congestion control

31
Q

when foes congestion occur?

A

if the workload is too large for the available network resources

32
Q

fair bandwidth allocation

A

max-min fairness
convergence

33
Q

max-min fairness

A

maximises minimum bandwidth, then uses excess bandwidth where possible

34
Q

convergence

A

when new connections enter the network, the bandwidth needs to be reallocated

35
Q

Why is available bandwidth unknown

A

the transport layer isn’t aware of the network topology, or who else is using the network

36
Q

solution for unknown bandwidth

A

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
Q

additive increase, additive decrease

A
38
Q

multiplicative increase, multiplicative decrease

A
39
Q

additive increase, multiplicative decrease

A
40
Q

regulating sending rate - efficiency and fairness

A
41
Q

internet protocols

A

transport layer: TCP and UDP
- all or nothing
- may not meet your application’d requirements
- insufficient separation between mechanism and policy

42
Q

RFCs

A

(request for comment) are published by the Internet Engineering Task Force (IETF)

43
Q

comparing complexity by number of RFCs

A

TCP > UDP ??

44
Q

UDP

A

RFC: 768
very thin layer on top of IP
doesn’t do:
- flow control
- congestion control

45
Q

UDP header

A
  • 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
Q

TCP

A

one of the most important protocols on the internet
provides a reliable end-to-end byte stream over an unreliable network

47
Q

TCP header

A
  • 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
Q

flags used to establish/release TCP connections

A

ACK, SYN, FIN

49
Q

connection establishment - three-way handshake

A
  • 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
Q

timestamp option

A
  • use sequence number + timestamp to detect duplicates
  • improves performance
51
Q

TCP PAWS

A
52
Q

TCP sequence numbers

A
  • every data byte has its own sequence number
  • initial sequence numbers are randomly generated
53
Q

error control in TCP

A

reliable delivery through retransmissions
dynamic timeouts in TCP

54
Q

setting retransmission timers

A
  • 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
Q

dynamic timeouts in TCP

A
  • 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
Q

fast retransmission

A

→ performance improvement
- packet loss detected when timers expire
- takes time by design
- duplicate ack can indicate packet loss

57
Q

flow control in TCP

A

buffer management
window size
Nagle’s algorithm

58
Q

TCP window size - Nagle’s algorithm

A
  • 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
Q

Silly-window syndrome

A
  • 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
Q

TCP delayed ACKs

A
  • 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
Q

Congestion Control in TCP

A
  • 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
Q

slow starts

A
  • 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
Q

TCP Tahoe

A
  • 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
Q

fast retransmission

A
  • packet loss detected when timers expire
  • we can count the number of packets in the network
65
Q

TCP Reno (Tahoe + fast recovery)

A
  • 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
Q

TCP versions that have implicit congestion control

A

TCP
CUBIC TCP
FAST TCP
Compound TCP

67
Q

TCP versions that have explicit congestion control

A

TCP with Explicit Congestion Notification
TCP explicitly tells sender what rate to use

68
Q

CUBIC TCP

A

determines rate based on packet loss
used by default in Linux, Windows, MacOS

68
Q

FAST TCP

A

determines rate based on end-to-end delay

69
Q

Compound TCP

A

determines rate based on end-to-end delay and packet loss

70
Q

how does TCP combine them (congestion window and window size)?

A

uses the smaller number

71
Q

AIMD in TCP

A

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