Chapter #9 - Transport Layer : Internet Porotocols

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/37

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:19 AM on 8/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

38 Terms

1
New cards

What does the transport layer connect?

End processes (applications) on different hosts — end-to-end communication, above the network layer.

2
New cards

What does TSAP stand for, and what are TSAPs called in the Internet?

Transport Service Access Point(Transport Layer Address). In the Internet they are called ports.

3
New cards

Three ways to find a service provider's TSAP?

1) Well-known ports (standardized), 2) Portmapper/directory service, 3) Initial connection protocol (handler process).

4
New cards

Name 5 core functions of a transport protocol.

Multiplexing/demultiplexing (ports), connection establishment, error control, flow control, congestion control.

<p>Multiplexing/demultiplexing (ports), connection establishment, error control, flow control, congestion control.</p>
5
New cards

Why are ports used instead of process IDs?

1) PIDs change on every restart — ports remain stable.

2) Multiple processes can share a port via sockets; port is an OS-independent abstraction.

6
New cards

UDP in one sentence.

Connectionless, unreliable, message-oriented transport(isolated unit data transfer) — essentially IP with port numbers and an optional checksum.

<p>Connectionless, unreliable, message-oriented transport(isolated unit data transfer) — essentially IP with port numbers and an optional checksum.</p>
7
New cards

UDP header fields (4 fields)?

Source port (16 bit, optional), Destination port (16 bit), Length (min 8, header + data), Checksum (optional).

<p>Source port (16 bit, optional), Destination port (16 bit), Length (min 8, header + data), Checksum (optional).</p>
8
New cards

Why does UDP exist instead of letting apps send raw IP packets?

UDP adds port-based multiplexing/demultiplexing and a checksum — raw IP offers neither, so apps couldn't distinguish which process a packet belongs to.

9
New cards

TCP service model in one sentence.

Reliable, ordered, bidirectional, unstructured byte stream between two endpoints over an unreliable internetwork.

10
New cards

Differences between TCP and UDP?

TCP: reliable, connection-oriented, ordered, flow + congestion control.

UDP: unreliable, connectionless, unordered, no flow/congestion control.

11
New cards

Similarities between TCP and UDP?

Both use port numbers, both compute a checksum, both run over IP.

12
New cards

How does TCP number data?

Every byte has a unique 32-bit sequence number; each segment carries the sequence number of its first byte.

13
New cards

Typical max TCP segment data size and why?

≤1460 bytes (1500 B Ethernet MTU − 20 B IP header − 20 B TCP header).

14
New cards

What reliability mechanism does TCP use?

Sliding window with cumulative ACKs and retransmission on timer expiry.

15
New cards

Worst-case overhead ratio for TCP (1 byte payload, ACK not piggybackable)?

Data segment: 1 B data + 20 B IP + 20 B TCP = 41 B. ACK: 40 B. Total 81 B for 1 B useful data.

16
New cards

Worst-case overhead ratio for UDP (1 byte payload)?

1 B data + 20 B IP + 8 B UDP = 29 B total.

17
New cards

What does the Acknowledgement Number field mean? TCP

The next byte the receiver expects — confirms all bytes up to (AckNo − 1) received.

18
New cards

What does the Window field do? TCP

Controls Senders Sliding Window by advertising the receivers Buffer size in Bytes.
Window = 0 means pause sending

19
New cards

What is the Pseudoheader and why is it used? TCP

To detect misdelivered Packets - this violates layering principle.

It is a conceptual Header only used in checksum calculation.

20
New cards

What does Header Length (HL) indicate? - in TCP

Length of the TCP header including options, in 32-bit words — marks where data begins.

21
New cards

Explain SYN, ACK, FIN. - TCP Flags

SYN — synchronize sequence numbers / initiate connection (SYN=1 ACK=0: request; SYN=1 ACK=1: accept).

ACK — Ack Number is valid.

FIN — sender has no more data; releases this direction.

22
New cards

What do RST, PSH, URG do? Topic: TCP Flags

RST: abort/reset connection immediately.

PSH: deliver buffered data to app right away.

URG: urgent data present at offset given by Urgent Pointer.

23
New cards

Topic: TCP Flags What do CWR and ECE do?

ECE: receiver signals network congestion to sender.

CWR: sender confirms it reduced its congestion window.

24
New cards

Why is a two-way handshake insufficient?

An old duplicate SYN can arrive and open a stale connection. The third leg (ACK) lets the initiator confirm the SYN-ACK matches the current attempt.

25
New cards

TCP three-way handshake steps.

1) Client → SYN (seq=x).

2) Server → SYN+ACK (seq=y, ack=x+1).

3) Client → ACK (ack=y+1). Connection established after step 3.

26
New cards

Why is the initial sequence number random, not 0?

To reduce the chance that old connection's sequence numbers overlap with a new connection on the same socket pair.

27
New cards

Security problem with the three-way handshake?

SYN flood attack — attacker sends many SYNs without completing handshakes, exhausting server's half-open connection table.

28
New cards

How is a TCP connection released reliably?

Each direction is closed independently with a FIN + ACK. Full release requires both directions shut down (typically four segments).

<p>Each direction is closed independently with a FIN + ACK. Full release requires both directions shut down (typically four segments).</p>
29
New cards

Two types of TCP connection release?

1) Graceful (FIN-based) — drains data, closes each direction independently. 2) Abrupt (RST) — immediate teardown, data may be lost.

30
New cards

What is the 2-Armies Problem and how does TCP handle it?

No protocol over an unreliable channel can guarantee both sides agree to close simultaneously.

→TCP uses TIME-WAIT (waits 2×MSL) so delayed segments expire before the port is reused.

31
New cards

Why must RTO(Retransmission Timeout) > RTT(Round Trip Timet)? What if it's too short or too long? TCP Timer & RTT

Must exceed one round trip to distinguish loss from a slow ACK.

RTO must be set slightly above RTT

Too short → unnecessary retransmissions.

Too long → unnecessary latency on loss.

<p>Must exceed one round trip to distinguish loss from a slow ACK.</p><p>RTO must be set slightly above RTT</p><p>Too short → unnecessary retransmissions.</p><p>Too long → unnecessary latency on loss.</p>
32
New cards

RTT smoothing formula - TCP Timer & RTT

what is the typical value for α?

new_RTT = α × old_RTT + (1−α) × sample. Typical α = 7/8. Higher α = more weight on history.

<p>new_RTT = α × old_RTT + (1−α) × sample. Typical α = 7/8. Higher α = more weight on history.</p>
33
New cards

Topic: TCP Timer & RTT

How is deviation D used to set RTO?

D = α×D + (1−α)×|RTT − sample|. RTO = RTT + 4×D. Adapts to high variance under congestion.

34
New cards

Topic: TCP Congestion Control

What does TCP use as a congestion signal?

Packet loss (timeout or duplicate ACKs).

35
New cards

Topic: TCP Congestion Control

Slow start: how does cwnd grow?

Phase 1 — Slow Start

cwnd starts at 1; increments by 1 per ACK → doubles each RTT (exponential) until ss_thresh or loss.

<p><strong>Phase 1 — Slow Start</strong></p><p>cwnd starts at 1; increments by 1 per ACK → doubles each RTT (exponential) until ss_thresh or loss.</p>
36
New cards

Topic: TCP Congestion Control

Congestion avoidance: how does cwnd grow?

Phase 2 — Congestion Avoidance (what kicks in after ss_thresh)

No more exponential increase since cwnd>=ss_thresh now:

Additive increase — cwnd += 1/cwnd per ACK → grows by ~1 segment per RTT (linear).

<p><strong>Phase 2 — Congestion Avoidance</strong> (what kicks in after ss_thresh)</p><p>No more exponential increase since cwnd&gt;=ss_thresh now:<br></p><p>Additive increase — cwnd += 1/cwnd per ACK → grows by ~1 segment per RTT (linear).</p>
37
New cards

Topic: TCP Congestion Control

cwnd

What happens on timeout (loss)?

TCP panics , assumes network=congested, does either 1 or 2:

ss_thresh = cwnd / 2;

cwnd = 1; restart slow start.

38
New cards

Topic: TCP Congestion Control

Name four TCP variants.

Tahoe (basic + fast retransmit), Reno (+ fast recovery), CUBIC (Linux default), Vegas (RTT-based window).