End to End Flashcards
what layer is end to end
transport
limitations of network layer
- best effort basis so it can:
- drop msgs
- send dup msg
- limit size of msg
- deliver after delay
requirements from some applications
- guaranteed delivery
- delivered in the same order as sent
- msg delivered at most once
- no limit on msg size
- flow control
- congestion control
- multiple connections per host
How does UDP work
- uses demultiplexing to direct datagrams to correct socket based on the port
- best effort
- connectionless
what is multiplexing
gather data chunks from source node and encapsulate with header, create segments, and pass to network layer
what is demultiplexing
- host gets IP datagram
- host uses the protocol + port to direct the segment to the correct socket
datagram vs segment
datagram:
- IP
- network layer
- contains a segment as the payload
segment:
- transport layer
- has the app data + source port, dest port in the header
setup and teardown of TCP
3 way handshake setup:
1) client sends syn seg to server with random seq # J
2) server responds with syn-ack with random seq # K and ack # = J+1
3) client sends ACK to server Ack # K+1
4 way teardown:
1) client sends FIN seg to server with seg # J
2) server sends ACK with ack # J+1
3) server sends FIN with seg # K
4) client sends ACK with ack # K+1
pros of UDP
- smaller RTT
- smaller header
- simple
- no flow control
- can support lots of clients
const of UDP
- no guarteed delivery
- best effort basis
…
why is TCP transport layer
if it was in network layer than all routers would need to do tcp things like flow control, congestion control and would be complex
TCP data transport
- sender process writes bytes to the TCP send buffer
- sends a segment once it has MSS bytes from the process
- receiver gets bytes into TCP recv buffer and gives them to the reveicer process as needed
what is MSS
- the max segment size
- max amount of DATA in a segment
MSS = MTU - (TCP header + IP header)
what is MTU
- max transmit unit
- max packet size including headers
- ex: MTU = 1500B for ethernet
- 20B is for IP header and 20B is for TCP header, so TCP segment can have 1460B of DATA
so MSS = 1460B
what is flow control
ensure that the sender does not overwhelm the receiver by sending more segments than it can handle
TCP flow control (sender side)
- use a variable window size
- gets window size from reciever ack msg
- can send # segments = window size / seg size until we wait for an ack
- can slide window out of a seg once an ack arrives for that seg
TCP flow control (receiver side)
- defines the size of ad window
- AW = (max recieve buffer) - (next byte expected - next byte read)
- shrinks as data arrives
- grows as process consumes data from buffer
problem of AW going to 0
senders buffer will fill up, so now it cant receive updates from receiver to know that the window has changed
solution to AW to 0
sender periodicly sends 1 byte segments to trigger response
what is silly window syndrome
- when the sender sends lots of really small segments
- very ineficient
solution to silly window
- Nagles algorithm
what is nagles alg
- clock based solution
if availible data >= MSS and window >= MSS then send full segment
else: if there is unacked data in flight:
buffer data until ack arrives
else: send data now
basicly wait until segment is full until sending data
why would you want to disable nalges
- if your application requires low latency or instant feedback, but does not require to send a lot of data
ex: voice calling, keyboard strokes
what is the sequence number in a TCP segment
- it represents the number of the first byte of data in the segment