You are on page 1of 3

Tcp (Transmission Control protocol) is connection-oriented, reliable. It is defined in rfc 793.

Between two processes (port no) running in hosts (ip).

The Tcp Connection:


1) Three way handshaking. (Sending preliminary segments). 2) Tcp runs only in end-systems not in intermediate routers. 3) Full-duplex service and point-to-point service (multicasting not possible). 4) Tcp comprises of send buffer and receive buffer. 5) Based on maximum transmission unit in link-layer the maximum segment size (limit for application-layer data in a segment) is allocated.

Tcp Segment Structure:


Obeying the mss, Tcp segment structure is as follows. 1) The diagram and each function. 2) Sequence numbers (prev_ack) and Acknowledgement numbers (prev_seq + 1) case study. 3) Piggy backed (echo backed) cumulative acknowledgements. (Send, received, Im glad you have received).

Round trip time estimation and timeout:

Tcp works on timeout mechanisms. How do we decide time-out interval? How to estimate RTT? Time-out should obviously be greater than RTT, by how much? 1) We consider sample RTTs (not for re-transmitted segments) and take average. 2) New Estimated sample RTT = (1-alpha) estimated sample RTT + (alpha) average of samples, where alpha=0.875. 3) EWMA (exponential weighted moving average). 4) Due to lot of fluctuations, dev RTT = (1-beta) dev RTT + (beta) (sample RTT Estimated RTT), where beta = 0.25. 5) Therefore, time-out interval = Estimated RTT + 4 (Dev RTT).

Reliable Data Transfer:


As Ip is unreliable, Tcp should stay reliable. The two mechanisms it follows for reliability are time-out and duplicate acknowledgements. We assume that we only have single-timer here. 1) The three-event algorithm. 2) Few interesting scenarios. (Retransmission due to lost acknowledgements, second segment not retransmitted until firsts acknowledgement is received, and cumulative acknowledgements avoid retransmission of the first one). 3) Doubling the time-out interval. (After re-transmitting the packet it sets the timer to double of its previous value, all other cases it calculates using the formula). 4) Fast re-transmit (duplicate acknowledgements), when out-of-order wait for 3, and then retransmit the segment. (Include code piece). 5) Go-back-N or selective repeat? Cumulative acknowledgements so we might think it is go-back-n, but consider when retransmitting, go-back-n retransmits all packets after lost packet again, Tcp might not retransmit the un-acknowledged packets also. So its more of hybrid of SR and go-back-n.

Flow Control:
Speed matching mechanism. Udp cannot provide this, so buffer overflow and packets are lost. Receive window. 1) LASTBYTERCVD LASTBYTEREAD <= RCVBUFFER.

2) RWND = RCVBUFFER (LASTBYTERCVD LASTBYTEREAD). 3) LASTBYTESENT-LASTBYTEACKD <= RWND. 4) After RWND =0, we should keep sending 1 byte data, frequently to get updated regarding the free space in the receive buffer of the receiver.

TCP Connection Management:


The Tcp connection is established this way client-server (SYN and client_isn) then serverclient (client_isn +1, server_isn) and finally client-server (server_isn + 1). Similarly the closing process happens the same way with the only bit varying is FIN. 1) The Tcp state diagrams in both client and server side for above actions. 2) Nmap is a powerful tool when analysing the TCP SYNACK (opens), TCP RST, receives nothing.

You might also like