NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are still here
NUS.SoC.CS2105 Ooi Wei Tsang TCP Transmission Control Protocol
NUS.SOC.CS2105 Ooi Wei Tsang Application Transport (process-to-process) Network (unreliable, host-to-host)
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang src port checksum dest port
NUS.SOC.CS2105 Ooi Wei Tsang sequence number acknowledgement number
NUS.SOC.CS2105 Ooi Wei Tsang Data to Send Data Received
TCP TCP is a full-duplex, connection-oriented, reliable protocol. TCP grabs data from a send buffer (containing data from applications), add TCP header, and pass to network layer for transmission. TCP can grab MSS bytes (maximum segment size) at one time. TCP header is 20 bytes (maybe longer if includes option header). Each segment contains a 32-bit sequence number and acknowledgement number. Sequence number is the byte number of the first byte in the segment; Acknowledgement number is the byte number of the first byte expected.
NUS.SOC.CS2105 Ooi Wei Tsang GBNSR ACKCumulativeSelective Out-of- OrderThrowBuffer RetransmitAll unACK1 unACK TimerOneMany
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang call from above
NUS.SOC.CS2105 Ooi Wei Tsang recv ACK y
NUS.SOC.CS2105 Ooi Wei Tsang timeout
Reliability in TCP TCP uses a mixed of techniques from GBN and SR. Cumulative ACK : since ACK number tells sender which byte the receiver is expecting. Only one timer : for oldest unacknowledged segment. Receiver buffers out-of-order segments. Retransmit only one packet when timeout occur. TCP retransmit if it receives duplicate ACKs, but only after 3 of them is received (fast retransmit)
NUS.SOC.CS2105 Ooi Wei Tsang receiver window
NUS.SOC.CS2105 Ooi Wei Tsang Receiver Buffer Sender
Flow Control in TCP To avoid buffer overflow at receiver, the receiver limits the number of bytes the sender can send through a receiver window (rcvwin), which is the size of the spare room in the receiver buffer. The sender ensures that the amount of outstanding bytes (sent but not acknowledged) is less than rcvwin.
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang
NUS.SOC.CS2105 Ooi Wei Tsang
TCP Connection Management Other fields of interest in TCP header are bits to indicate type of packets (SYN, FIN, ACK, RST etc). To establish connection, TCP uses a 3-way handshake: A send SYN to B, B replies with SYN+ACK, A replies with ACK+data (optional). To tear down connection, A sends FIN to B, B sends ACK back. B sends FIN to A, A sends ACK back to B.