LOGBOOK

HELP

1 / 458
time's up — finish this card
Other keys: show • Space: good • 1-4: rate • 0: skip • 5: flag
Topic Transport Layer

Question

How does TCP session termination work?

Answer

A four-way exchange: FIN → ACK → FIN → ACK. Each direction is closed independently, so it needs four segments (vs. three for setup); either host can initiate, and the two middle steps can sometimes combine into one FIN+ACK.

TCP four-way connection teardown sequence

* FIN, ACK, FIN, ACK: each direction is closed independently, so teardown takes four segments. *

TCP Session Termination (Four-Way Handshake):

Host A                              Host B
  │                                    │
  │──────── FIN ─────────────────────→│  Step 1: A has no more data
  │                                    │
  │←─────── ACK ──────────────────────│  Step 2: B acknowledges FIN
  │                                    │
  │←─────── FIN ──────────────────────│  Step 3: B has no more data
  │                                    │
  │──────── ACK ─────────────────────→│  Step 4: A acknowledges FIN
  │                                    │
  │         Connection Closed          │

Four Steps:

Step Action Purpose
1 Client sends FIN "I have no more data to send"
2 Server sends ACK Acknowledges client's FIN
3 Server sends FIN "I have no more data to send"
4 Client sends ACK Acknowledges server's FIN

Note: Steps 2 and 3 can occur in the same segment (FIN+ACK combined).

Key insight: Either host can initiate termination. Both directions must be closed independently.

Why four segments instead of three? During setup, the server can combine SYN+ACK because both sides agree to open at once. During teardown, when one side sends FIN the other may still have data to send, so its ACK and its own FIN are often separate - giving four steps: "I'm done" → "OK" → "Me too" → "OK".

Go deeper:

TCP sequence numbers and receive windows behave very much like a clock. The receive window shifts each time the receiver receives and acknowledges a new segment of data. Once it runs out of sequence numbers, the sequence number loops back to 0.
TCP sequence numbers and receive windows behave very much like a clock. The receive window shifts each time the receiver receives and acknowledges a new segment of data. Once it runs out of sequence numbers, the sequence number loops back to 0.
Mike de · CC BY-SA 3.0 · Wikimedia Commons
or press any other key
Topic Build a Small Network

Question

What are the common protocols used in a small network, and what does each do?

Answer

Remote access: Telnet/SSH; web: HTTP/HTTPS; email: SMTP (send), POP3/IMAP (retrieve); file transfer: FTP/SFTP; addressing: DHCP; name resolution: DNS.

Common Protocols of a Small Network:

Network protocols support the applications and services employees use.

Protocol Purpose
Telnet / SSH Remote access to network devices and servers (SSH is the secure option)
HTTP / HTTPS Communication between web clients and web servers
SMTP Sends email
POP3 / IMAP Used by clients to retrieve email
FTP / SFTP Downloads and uploads files between a client and an FTP server
DHCP Lets clients acquire an IP configuration automatically from a DHCP server
DNS Resolves domain names to IP addresses

Key insight: A single server can provide several of these services at once (e.g. an email, FTP, and SSH server on one box), so a small network often needs only a handful of physical servers.

Go deeper:

A DNS resolver that implements the iterative approach mandated by RFC 1034; in this case, the resolver consults three name servers to resolve the fully qualified domain name "www.wikipedia.org".
A DNS resolver that implements the iterative approach mandated by RFC 1034; in this case, the resolver consults three name servers to resolve the fully qualified domain name "www.wikipedia.org".
Lion Kimbro · Public domain · Wikimedia Commons
or press any other key