Transport Layer

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/44

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

45 Terms

1
New cards

Flow control

  • A TCP mechanism that ensures the sender does not overwhelm the receiver.

  • The sender regulates the rate of data transmitted based on the receiver's ability to process and buffer the incoming data.

2
New cards

What does a window do ?

Advertises to the sender in every TCP segment to inform the sender of the available buffer space at the receiver.

3
New cards

What is the window size ?

The amount of bytes the sender can transmit before receiving a TCP ACK from the receiver.

4
New cards

TCP Sliding windows (2 answers)

A flow control mechanism that dynamically adjusts the amount of data a sender can transmit before needing an ACK

  • Helps ensure efficient and reliable data transfer by preventing congestion and packet loss.

5
New cards

The TCP Maximum Segment Size Concept

The largest amount of bytes that a device is willing to receive or transmit in a single TCP segment.

6
New cards

How many bytes in TCP Maximum Segment Size (4 answers)

  • Typically set to 1460 bytes for IPv4 packets

  • 1440 bytes for IPv6 packets

  • Meant to optimize performance by fitting within the standard Ethernet MTU (Maximum Transmission Unit) of 1500 bytes.

  • Note, IPv4 and IPv6 have different header sizes which is why they can transmit different amounts.

7
New cards

Congestion Window (2 answers)

  • Manages the amount of data that can be sent into the network without receiving an ACK from the receiver to avoid network congestion (this is done algorithmically).

  • Determined by the sender

8
New cards

Receive window (2 answers)

  • Advertised by the receiver

  • How much data the receiver can handle/process - available buffer space.

9
New cards

What is TCP Slow Start and how does it work? (5 answers)

  • Used at the start of a TCP connection to avoid congestion.

  • Starts with congestion window (cwnd) = 1 MSS (Maximum Segment Size).

  • cwnd doubles every Round Trip Time (RTT) by increasing it with each ACK received.

  • Rate increases exponentially until the first loss is detected.

  • Purpose: slowly probe the network capacity without overwhelming it.

10
New cards

When and how does TCP switch from Slow Start to Congestion Avoidance?

  • When: When cwnd reaches the slow start threshold (ssthresh).

  • Why: To prevent overshooting the available network capacity.

  • How:

    • On loss event, set ssthresh = cwnd / 2 (just before the loss).

    • If cwnd < ssthresh: use exponential growth (slow start).

    • If cwnd ≥ ssthresh: switch to congestion avoidance (linear growth).

11
New cards

Why use UDP ?(4.5 answers)

  • No connection establishment (which can add RTT delay)

  • Simple: no connection state at sender, receiver

  • Small header size

  • No congestion control

    • UDP can blast away as fast as desired!

    • Can function in the face of congestion

12
New cards

UDP Uses (5 answers)

  • Streaming

  • Online games

  • DNS

  • SNMP (Simple network Management Protocol

  • HTTP/3 (Hypertext Transfer Protocol)

13
New cards

What are ways to make UDP more reliable

  • Add needed reliability at application layer

  • Add congestion control at application layer

14
New cards

Why use TCP ?(5.5 answers)

  • Offers reliable, in-order byte stream: no “message boundaries"

  • Full duplex data: bi-directional data flow in same connection

  • Connection-oriented: client and sender do handshake before exchanging data

  • Flow and Congestion control limit the size of the window, i.e. effectively limiting the send rate

    • To avoid overloading receiver and the network in the middle

  • Point-to-point: one sender, one receiver

15
New cards

TCP Disadvantages (3 answers)

  • TCP is made for Wide Area Networks, thus its size can become an issue for small networks with low resources.

  • TCP runs several layers so it can slow down the speed of the network.

  • It is not generic in nature. It cannot represent any protocol stack other than the TCP/IP suite. E.g., it cannot work with a Bluetooth connection.

16
New cards

TCP uses (3 answers)

  • Email

  • Web browsing

  • File transfer

17
New cards

TCP connection process (5 steps)

  • Server creates welcome socket then waits for the client to connect (uses source port num and IP address to distinguish clients)

  • Client creates a socket then connects to server

  • Server creates a new socket for that specific client

  • Client and server now transmit data using this new socket

  • Repeated until sockets close

18
New cards

Why must the TCP timeout be set longer than the RTT?

Because RTT varies; if the timeout is too short, it causes unnecessary retransmissions. If it's too long, the response to segment loss is delayed.

19
New cards

What happens if the TCP timeout is set too short or too long?

  • Too short: premature timeouts and unnecessary retransmissions.

  • Too long: slow reaction to segment loss.

20
New cards

How is SampleRTT measured in TCP?

SampleRTT is the time measured from when a segment is sent until its ACK is received. Retransmitted segments are ignored for this calculation.

21
New cards

Why can't we just use the latest SampleRTT as the estimated RTT in TCP?

Because SampleRTT can vary significantly. Using only the latest value would make the timeout unstable.

22
New cards

How does TCP estimate RTT to smooth out variation?

TCP uses an average of several recent SampleRTT measurements to calculate a more stable EstimatedRTT.

23
New cards

What is TCP fast retransmit

if sender receives 3 additional ACKs for same data (“triple duplicate ACKs”), resend unACKed segment with smallest seq # It is likely that unACKed segment lost, so don’t wait for timeout

<p>if sender receives 3 additional ACKs for same data (“triple duplicate ACKs”), resend unACKed segment with smallest seq # It is likely that unACKed segment lost, so don’t wait for timeout</p>
24
New cards

UDP connection process

  • Sender explicitly informs IP destination address and port# to each packet.

  • Receiver extracts sender IP address and port# from each received packet

  • In this case the server and client create sockets the client sends data through their datagram socket and the server receives and sends through that same socket.

25
New cards

What are the main Transport Services and Protocols?

  • TCP and UDP

  • Provide logical communication between application processes running on different hosts.

26
New cards

Transport protocol actions

  • The sender breaks application messages into segments and passes them down to network layer. (Multiplexing)

  • The receiver reassembles segments into messages, passes up to application layer. (Demultiplexing)

27
New cards

Multiplexing concept

Gathering data chunks at the source host from different sockets then encapsulating each data chunk with header info to create segments, then passing the segments to the network layer.

28
New cards

Demultiplexing concept

Examines the header fields in the segment to determine the receiving socket then directs the segment to that socket.

29
New cards

What actions does the transport layer take to send to another transport layer? (7 answers)

  • Sender application prepares an application message to send through the socket.

  • The sender Transport layer makes a header with fields (e.g. port numbers) and completes those fields, creating a segment.

  • This will then get sent to the Network Layer, where the network layer tries to make sure that the segment is delivered to the target host

  • The receiving Network layer will then send this up to their Transport layer

  • The receiving Transport will then check the header values and try to make sure that its correct.

  • The Transport will then extract the application-layer message and it will be demultiplexed by the machine.

  • The sender application message is then delivered to the application side on the receivers end.

30
New cards

UDP multiplexing and demultiplexing (2 answers)

  • Packets have the source port and IP address, and destination port and IP address in the header. (Multiplexing)

  • When the transport gets this it will check the destination port and IP address then direct it to the socket bound to that port# and IP address. (Demultiplexing)

31
New cards

TCP multiplexing and demultiplexing (3 answers)

  • TCP socket has a 4-tuple with the Source IP address, source port number, Destination IP address, and destination port number. (Multiplexing)

  • Receiver uses all four values to direct the segment to the appropriate socket. (Demultiplexing)

  • Server may support many simultaneous TCP sockets where each socket is identified by its own 4-tuple and associated with a different connecting client.

32
New cards

Checksum purpose

To detect packet corruption in both directions

33
New cards

Congestion meaning (2 answers)

Too many sources sending too much data too fast for the network to handle

  • Leads to long delays (queueing in router buffers) and packet loss (buffer overflow at routers)

34
New cards

What are some TCP Congestion Control methods ?

  • AIMD (Additive Increase Multiplicative Decrease)

    • Senders can increase sending rate until packet loss (congestion) occurs then decrease sending rate on loss event.

  • TCP Slow Start

35
New cards

What is AIMD ?(Additive Increase Multiplicative Decrease)

  • Additive increase: Increase sending rate by 1 maximum segment size every RTT until loss detected

  • Multiplicative Decrease: Cut sending rate in half at each loss.

  • Sawtooth behavior: probing for bandwidth.

36
New cards

What is the Go-Back-N Protocol ?

When the sender is allowed to transmit multiple packets (when available) without waiting for an acknowledgment, but is constrained to have no more than some maximum allowable number, N, of unacknowledged packets in the pipeline.

<p>When the sender is allowed to transmit multiple packets (when available) without waiting for an acknowledgment, but is constrained to have no more than some maximum allowable number, N, of unacknowledged packets in the pipeline.</p><p></p>
37
New cards

How does the Go-Back-N protocol handle reliable transmission? (6 answers)

  • Sender maintains a window of up to N unACKed packets.

  • Each packet is labeled with a sequence number.

  • ACKs are cumulative: ACK(n) confirms receipt of all packets ≤ n.

  • On receiving ACK(n), sender slides window to begin at n+1.

  • A single timer tracks the oldest unACKed packet.

  • On timeout, the sender retransmits that packet and all following packets in the window.

38
New cards

How does the receiver behave in the Go-Back-N protocol? (5.5 answers)

  • Receiver sends ACK-only messages for the highest in-order packet received so far.

  • Keeps track of rcv_base: the first missing in-order packet.

  • May receive/send duplicate ACKs if out-of-order packets arrive.

  • On out-of-order packets, receiver can either:

    • Discard them (no buffering), or

    • Buffer them (implementation choice).

  • Regardless, receiver always re-ACKs the highest in-order packet.

39
New cards

How does the Go-Back-N receiver identify the data

  • The sender places a sequence number in the packet header

40
New cards

What are the key features of the Selective Repeat protocol ?

  • Receiver individually ACKs each correctly received packet

  • Receiver buffers out-of-order packets for in-order delivery

  • Sender selectively retransmits only unACKed packets

  • Sender maintains a timer for each unACKed packet

  • Sender window holds N consecutive sequence numbers

  • Window restricts sending to unACKed sequence numbers only

41
New cards

What are the 3 possible events for a selective repeat sender ?

  • Gets data from application if next available seq # is within window send packet

  • If there is a timeout for packet n resend packet n, restart timer

  • sender gets ACK(n)

42
New cards

What does the sender do when it receives data from the application in Selective Repeat?

If the next sequence number is within the sender’s window, it sends the packet.

43
New cards

What happens at the sender when a timeout occurs for packet n in Selective Repeat?

The sender resends packet n and restarts its timer.

44
New cards

How does the sender handle an incoming ACK(n) in Selective Repeat? (3 answers)

  • If n is within the send window [sendBase, sendBase + N - 1], mark packet n as acknowledged.

  • If n is the smallest unACKed packet, advance sendBase to the next unACKed sequence number.

  • Otherwise, ignore the ACK.

45
New cards

What does the receiver do with packets outside the expected range in Selective Repeat?

It ignores the packets.