transport layer Flashcards
Where does the transport layer run?
only on the host and destination
transport layer functions
provides a reliable data stream over an unreliable network
provides communication between processes
primitives used by transport layer to provide communication between processes
- listen - wait for another process to contact us
- connect - connect to a process that is listening
- send - send data over the established connection
- receive - receive data over the established connection
- disconnect - release the connection
- the interface exposed to the application layer
- connection-oriented service over (possibly) connectionless network
Berkley Socket primitives
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
addressing
TSAP = Transport Service Access Point
NSAP = Network Service Access Point
internet uses IP addresses for NSAPs and ports for TSAPs
process servers
multiplexing
multiple transport connections over one network connection
servers typically hardcoded
inverse multiplexing
one transport connection over multiple network connections
a form of multihoming: multiple paths to the same destination
NAT
network address translation
Connection establishment using sequence numbers
- 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 do sequence number affect performance?
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)
clock-based seq numbers
sequence numbers to use increase with clock, regardless of sending rate
forbidden region
three-way handashake
used by TCP
agreement on which seq num to use
connection release
when the exchange is complete, the connection should be closed
asymmetric connection release
connection ended by either participant without agreement → may result in data loss
symmetric connection release
the two armies problem
- the last party to send a message cannot know if it arrived
participants agree to end connection
the end-to-end argument
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)
error control in transport layer
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
reliable delivery through retransmission
improving performance by using error control on lower layers
error control and crash recovery
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
crash recovery
machine fails:
1. segment
2. ACK
data not passed
3. segment
crash recovery on layer X
- 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
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
stop-and-wait: a 1-bit sliding window protocol
bandwidth inefficient for high-latency channels
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
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