Lesson 2 - Transport and Application Layers Flashcards
What does the transport layer provide?
Logical end-to-end connection between processes running on different hosts. May provide services such as reliability, flow control, congestion control, and more.
What are the 2 main protocols within the transport layer
User datagram protocol (UDP) and the Transmission Control Protocol (TCP)
What is the need for multiplexing / demultiplexing?
It’s required in order for multiple applications to use the network simultaneously via ports. Each app binds itself to a unique port.
Describe the two types of multiplexing/demultiplexing.
Connectionless and connection oriented which depends on whether we have a connection established between sender and receiver. Demultiplexing is the job of delivering data included in a segment to the appropriate socket.
What is connection-oriented multiplexing/demultiplexing?
TCP socket = four-tuple of source IP, source port, destination IP, and destination port
What is connection-less multiplexing/demultiplexing?
UDP socket = two-tuple of destination IP and destination port
What is the relationship between the network and the transport layer
The transport layer is responsible for end-to-end communication between end hosts The network layer is responsible for moving datagrams from one internet host to another. Receives from transport layer and delivers the datagram to the host’s transport layer
What are the differences between UDP & TCP?
TCP provides strong primitives that make e2e communication reliable and cost effective while UDP has only basic functionality and relies on application-layer to implement the rest.
Explain TCP three-way handshake.
- Send segment with no data, SYN bit set to 1 and initial sequence number
- Server receives and allocates resources and sends back SYNACK with SYN bit set to 1 and randomly chosen initial sequence number
- Client receives SYNACK, also allocates buffer/resources, and sends back SYN bit set to 0.
SYN-SYNACK-SYN (110)
Explain TCP connection teardown
- Send FIN bit set to 1.
- Server acknowledges by sending ACK.
- Server sends FIN bit set to 1, indicating it is closed.
- Receiver sends ACK.
FIN-ACK-FIN-ACK
What is Automatic Repeat Request or ARQ?
Method for reliable transmission where the receiver acknowledges receiving specific segments. If the sender does not receive acknowledgement within a given period of time, it will assume the packet is lost and resend it.
What is Stop and Wait?
The most basic method for identifying a lost packet. In this case the sender sends a packet and waits for its acknowledgement from the receiver.
What is Go-back-N?
A way for the receiver to notify the sender of a missing segment by sending ACK for the most recently received in-order packet so the sender will send all packets from then on - even if there are duplicates. The receiver discards any out of order received packets.
What is selective ACKing?
Go-back-N can lead to many unnecessary retransmissions so selective ACKing solves this by having the sender retransmit only those that were received in error. The receiver buffers the out-of-order packets until the missing packets are received to fill in the blanks.
What is fast retransmit?
When the sender receives 3 duplicate ACKs for a packet, it considers the packet to be lost and will retransmit it instead of waiting for the timeout.