Computer Network - Transport Layer
Multiplexing/Demultiplexing (Transport Layer)β

UDP Multiplexing/Demultiplexing: Uses 2-tuple (D-IP, D-Port)

TCP Multiplexing/Demultiplexing: Uses 4-tuple (S-IP, S-Port, D-IP, D-Port)

Rdt2.0 FSM (Finite State Machine) Specificationβ
Bit errors may occur: 0 becomes 1, 1 becomes 0

Sender handles corrupted ACK, NAK packets
rdt2.1 adds sequence number to ensure messages are not processed repeatedly

When ACK received, process next message, seq + 1.
Receiver handles corrupted ACK, NAK packets

rdt2.2 removes NAK
Receiver resends previous ACK and sequence number when message processing fails

rdt3.0 Packets may be lost




Go-Back-Nβ

Selective Repeatβ


Correct Mathematical Constraint Relationshipβ
2^k β₯ 2N
That is:
Ns + Nr β€ 2^k / 2 = N_max
2N β€ 2^k
N β€ 2^(k-1)Where:
k: Number of bits for sequence number2^k: Sequence number space sizeN: Sender window size (Sender and Receiver windows are generally equal)Ns: Sender window sizeNr: Receiver window size (In SR, often setNs = Nr = N)
| k (Seq bits) | Sequence Number Space (2^k) | Max Window Size (N β€) |
|---|---|---|
| 3 | 8 | 4 |
| 4 | 16 | 8 |
| 5 | 32 | 16 |
TCP Structureβ


- Represents: Host A sent data
'C', which is its 42nd byte. - Also ACK = 79: It tells B: "I have received your data up to byte 78, the next one I want is byte 79."
- B sent data byte number 79 (This is byte number in B's sending direction)
- ACK = 43: B tells A: "I received your 42nd byte ('C'), now I am waiting for the 43rd byte."
- Host A's next byte is 43 (It finished previous 42)
- Its ACK = 80, indicates it received byte 79 from B, next byte is 80.
TCP Connection Establishment and Terminationβ
Connection Establishment

Connection Termination



All content comes from sources, course copyright reserved. Document is for learning use only.
If there is any infringement, contact [email protected]
https://www.icourse163.org/learn/HIT-154005?tid=1474180488#/learn/announce
- Attribution: Retain the original author's signature and code source information in the original and derivative code.
- Preserve License: Retain the Apache 2.0 license file in the original and derivative code.
- Attribution: Give appropriate credit, provide a link to the license, and indicate if changes were made.
- NonCommercial: You may not use the material for commercial purposes. For commercial use, please contact the author.
- ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.