Chapter 30 - Introduction to TCP/IP Transport and Applications Flashcards
What are some uses of UDP that TCP does not have?
- Smaller segments and less processing cycles due to requiring less information in its header
- UDP does not slow down data transfer
- Some applications do not need error correction (real time applications like VOIP) so will use UDP. Applications such as FTP that are required for sending/receiving files will likely use TCP.
What transport functions are supported by both UDP and TCP? What transport layer functions are supported only by TCP?
- Multiplexing using ports - UDP/TCP - Allows receiving hosts to choose the correct application for which data is destined based on port number.
- Error correction (Reliability) - TCP - Adding sequence numbers to data headers and sending acknowledgements once data has been successfully received.
- Flow control (Windowing) - TCP - Uses window sizes to protect buffer space and routing devices from being overloaded with traffic. Does this by including buffer space field in TCP acknowledgments that advises how much data the sender can safely send in the next segment.
- Connection establishment and termination - TCP - Process used to intialise port numbers and Sequence and Acknowledgement fields.
- Ordered data transfer and data segmentation - TCP - Sends a continuous stream of bytes from a higher layer process that is segmented for transmission and delivered to the same higher layer process at the receiving device in the same order.
What is Multiplexing in TCP/UDP?
- Allows the protocol to tell the receiving device specificially what application the data is destined for by adding a port number in the TCP/UDP header
What is a Socket?
- An end point on one side of a Transport Layer connection between two applications
- Consists of:
- IP address
- Transport protocol
- Port number
What are the different port ranges defined by IANA?
- Well Known (System) Ports:
- From 0 to 1023
- Assigned by IANA
- A strict review process is required to assign these to applications - User (Registered) Ports:
- From 1024 to 49151
- Assigned by IANA
- Less strict review process to assign to applications when compared to Well Known - Ephemeral (Dynamic, Private) Ports:
- From 49152 to 65535
- Not assigned to specific applications. Intended to be used temporarily while an application is running
List well known port numbers
- 20 - TCP - FTP data
- 21 - TCP - FTP control
- 22 - TCP - SSH
- 23 - TCP - Telnet
- 25 - TCP - SMTP
- 53 - UDP/TCP - DNS
- 67 - UDP - DHCP server
- 68 - UDP - DHCP client
- 69 - UDP - TFTP
- 80 - TCP - HTTP
- 110 - TCP - POP3
- 123 - UDP - NTP
- 161 - UDP - SNMP agent
- 162 - UDP - SNMP manager
- 443 - TCP - SSL
- 514 - UDP - Syslog
What is the TCP three-way handshake?
- Used to establish TCP connections between applications
- The initiator will send a TCP SYN flag (Used to synchronise sequence numbers) with a src and dst port in its TCP header
- The receiver will respond with a TCP SYN and TCP ACK flag with the initiators src port as its dst port and the initiators dst
port as its src port
- The initiator will respond with its own TCP ACK - The connection is now established
How does a TCP application terminate connections? (Four-way handshake)
- Sends and ACK and FIN flag
- Responder responds with an ACK flag to advise that it has received the request to close the connection
- Responder sends and ACK FIN
- Sender sends an ACK
What is a Connection-Oriented Protocol?
- Also known as stateful
- Requires an exchange of messages to establish a connection before data transfer can begin
- Protocols using TCP will be Connection-Oriented
What is a Connectionless Protocol?
- Also know as stateless
- A protocol that does not require an exchange of messages and does not require an established connection before data transfer can begin
- Protocols using UDP will be Connectionless
What is TCPs Error Recovery function otherwise known as?
Reliability
How does TCPs Error Recovery work?
- Numbers data bytes using the Sequence and Acknowledgement fields in the TCP header.
- Uses the Sequence number in one direction combined with the Acknowledgement field in the opposite direction to determine if an error has occurred.
- After a determined amount of data has been received (determined by the window size) by the receiver it will respond with an ACK that has a sequence number 1 higher than the most recently received segment. This is known as Forward Acknowledgement.
- So if the sender receives an ACK with a lower sequence number than what it has already sent, it knows there has been an error and knows which segment to resend.
Example: Sender sends upto sequence 4. Receiver should acknowledge upto sequence 5 but only acknowledges upto sequence 2. Sender knows to resend sequence 3 upwards.
What is a Retransmission Timer?
- How long a sender will wait after not receiving an ACK before responding with potentially lost data.
What is Windowing?
- Flow control used by TCP
- Allows the sender to determine how much data is awaiting acknowledgement and processing by the receiver
- The receiver will tell the sender how much data it can receive at that point in time
- Uses a Sliding Window/Dynamic Window function to dynamically cause the sender to speed up or slow down tranmission
Examples of applications that may prefer UDP over TCP.
- Real time protocols like VoIP and video as if there were any errors, it would be too late to resend the missing segment without the data sounding/looking strange
- DNS as if the resolution fails, the sender will just retry the operation again
- NFS (Network File System) as it performs recovery at the application layer