Shared Flashcard Set


Lecture 11 - Transport Layer, TCP and UDP
Alejandro Saucedo - Comp2008 Lecture 11 FlashCard Set
Computer Networking
Undergraduate 2

Additional Computer Networking Flashcards




What are the key features of Transmission Control Protocol (TCP)
  • Connection oriented
  • Includes ACKs and retransmissions
  • Provides flow/congestion control
What are the key features of UDP?
  • Connectionless
  • Retransmission/adaptation is up to application
  • No flow control
What does the Transmission Control Protocol (TCP) provide?
  • Provides performance and reliability on an otherwise unreliable IP service
  • Connection management
    • Establish and release
  • Flow control
    • Adapts sending rate to capacity of receiver
  • Congestion control
    • Backs off in the event of observed packet loss
  • Data transmission (and retransmission)
    • Unacknowledged segments resent by TCP
  • Reassembly of datagrams in the correct order
What is the TCP service model?
  • A sender and receiver create sockets to act as communication endpoints
  • Sockets consist of ip address and port number
  • Needs connection identifier
What does a socket of an IP address and port number consist of?
  • Port numbers are 16-bit transport endpoint identifiers
  • e.g., port 80
  • Applications have some API through which they can use sockets to send/receive data, e.g. Berkeley API
What do connection identifiers consist of?
  • Protocol (TCP)
  • Source and destination IP address
  • Source and destination port number
  • This (and other) information is held in Transmision Control Block
Give an example of Berkeley sockets
How is a TCP connection established?
  • Server binds() and listens() for client
  • Client waits for server
  • Client creates TCB, and sends SYN
  • Server receives SYN and sends SYN+ACK
  • Client receives SYN+ACK and sends ACK
  • Client sets as connection established
  • Server receives ACK and sets connection established
Show an example of Connection establishment with TCP
How is a TCP connection released?
  • Client and servers have established connections
  • Client receives close signal from APP, sends FIN
  • Client waits-1
  • Server receives FIN, and sends ACK, tell App to close
  • Server waits for app
  • Client Receives ACK
  • When app is ready to close, server sends FIN
  • Client receives FIN, sends ACK
  • Client waits for Double Maximum Segment Life (MSL)
  • Server receives ACK and closes its connection
  • Client finishes waiting and closes connecition
Show an example of how a connection is released
What is client-server operation on ports in regards to a TCP connections?
  • A client will pick a "random" high port number >1024 (Exact method varies on OS)
  • Server will use pre-configured number (well known)
  • For efficiency, server might have dedicated process listening on all configured service ports
    • Spawns a new process to handle incoming service connections when needed
    • Some applications may be run directly
How does TCP send data?
  • Sends segments of data to receiver
  • Maximum Segment Size (MSS) usually chosen based on link's MTU
  • Uses 32-bit sequence number for the data
    • Number represents the position in the byte sequence of the data being sent
    • Segments are used both when data is sent and when data is received
How does the 32-bit sequence number for TCP data segments work?
  • Represents position in the byte sequence of the data being sent
    • If first segment has sequence number N, next segment woul dbe N + X if the first segment is X bytes long
    • N should be unpredictable to an eavesdropper
  • Sequence numbers are used both when data is sent and when it is received
    • In an ACK, the next sequence number the receiver is expecting to receive
Show the TCP header
What are the characteristics of TCP flow control
  • TCP uses a sliding window protocol to help control the sending rate
  • Should not send data unless receiver indicates it has buffer space to accept it
    • Otherwise the data is likely to be dropped and the sender will only have to resend it later
  • The "sliding window" is effectively the buffer space the receiver says it has available at any give time
    • Changes over time because TCP traffic tends not to be a consistent bit rate
How does the TCP flow control sliding window operate?
  • The sender sends a segment with a sequence number and starts a timer
  • The receiver replies with a segment with an acknowledgement number showing next sequence number it expects to receive and its available window size
  • If sender's timer goes off before this ACK is received, the sender retransmits
  • If the receiver sais its window size is 0, the sender should not send more data until the receiver sends a new ACK indicating it has capacity
What are the principles of TCP congestion control?
  • The TCP congestion window indicates the number of bytes a sender may put in the network at a give time
  • The congestion window size starts low, and starts incrementing every RTT
What is the TCP congestion window?
  • Indicates the number of bytes a sender may put into the network at a given time
    • Packet loss is an indication of congestion
    • Runs alongside the receiver's sliding window
    • Use the smaller of the two windows when sending
What are some characteristics of the TCP congestion window size?
  • Starts low
  • Usually send one segment initially, and wait for the ACK before sending further segments
    • Not efficient
  • Until loss is detected, TCP increases the number of segments it sends each tiem before receiving ACKs
    • TCP typically doubles the window every RTT
What is the congestion window threshold?
  • The window size grows until it reaches the threshold - after, the window size only grows additively
  • At this point, we add one segment to the window size per successful RTT
  • If there is congestion (Packet loss) then threshold is lowered and slow start process repeats
What are some fundamentals of TCP performance?
  • Designed to make best use of available bandwidth
    • With consideration for other clients it is "competing" with and for receiver capacity
  • Work has been done on different TCP algorithms
    • Tahoe, Reno, Vegas, Hybia, etc
  • TCP behaviour can't fix problems caused by other protocols
  • Large buffering in devices may "trick" TCP
    • May no longer get timely notifications of congestion
What are the principles of User Datagram Protocol (UDP)?
  • Connectionless
  • Sender just fires a datagram at a receiver
  • No UDP acknowledgements
  • If retransmission is required, that is the down to the application to do
  • UDP applications often use a constant data rate
  • Low overhead
Show the UDP header
What are the principles of Real-Time Transport Protocol (RTP)?
  • Good example use case of UDP
  • Designed for sending multimedia data
  • RTP packets have their own RTP header
    • Includes sequence number and timing fields
    • Allows synchronization of parallel RTP streams
    • RTP Control Protocol can report RTP loss
  • Used by many common video streaming apps
  • Used by multicast video/audo apps
Show an RTP header
Give some characteristics of how TCP would deal with video streaming e.g. youtube
  • Client connects via TCP (http) and receives the video data, buffering it if possible before playback
  • On a fast link, the client can typically buffer far ahead if watching a pre-recorded video
    • Possibly download the whole video while only part played
  • Problematic if link capacity not enough, and TCP backs off
Give some characteristics of how UDP would deal with video streaming e.g. VLC
  • Typically uses RTP
  • Immediate, with limited buffering, no retransmission
  • May experience "glitches" in video, rather tahn video hanging, in the event of congestion
  • Well-suited to live video
    • RTCP allows sender to adapt rate/quality if it can
  • Less overhead
  • Very well-suited to multicast
    • UDP datagram replicated to all receivers in a group
Supporting users have an ad free experience!