
Master TCP from three-way handshake to windowing with in-depth coverage of connection-oriented services, state transitions, flow and congestion control, timers, and advanced features like selective acknowledgment and fast recovery.
Join the Telegram group to engage with peers in the master class on TCP/IP mechanics from scratch to expert.
Explore the OSI model basics and the TCP/IP stack, examine the transport layer with UDP and TCP, and compare UDP versus TCP to clarify reliable communication concepts.
Explore how tcp/ip stack layers function together, from physical layer handling electrical signals to link, network, transport, and application layers with protocols like ip, ipv6, tcp, udp, http, and ethernet.
Explore the transport layer (socket layer) and its goals to enable application-to-application data exchange, and compare UDP and TCP, with a brief mention of SCTP as a hybrid.
Understand the properties of UDP, the user datagram protocol, a connectionless, stateless, datagram-based transport protocol that follows the sand and forget model and treats data as independent datagrams.
Recognize that UDP is an unreliable protocol that does not guarantee delivery or order of datagrams. Choose UDP for loss-insensitive applications such as video streaming, tolerating missing or out-of-order datagrams.
Learn how tcp forms a connection by mutual agreement, exchanges a connection request and acknowledgement, and negotiates capabilities like 5000 and 1000 bytes per second before data exchange.
TCP is a stateful protocol where the sender and receiver track data exchanges, including bytes sent and received, and which bytes must be resent in a duplex connection.
Explore how tcp treats data as a continuous flow of bytes, tracks every byte, and ensures delivery by recovering lost bytes and retransmitting them for reliability at the byte level.
tcp handles out-of-order delivery by accumulating arrived packets at the receiving end and reordering them before delivering to the application in the correct order, even on an open internet.
Explain how reliable delivery uses automatic repeat request, with sender and receiver cooperating to retransmit lost packets and deliver data in order over lossy networks.
Compare tcp and udp protocols: tcp is slower and reliable, connection oriented and byte oriented; udp is faster and unreliable, connectionless and datagram oriented, used for video conferencing.
Explore the tcp/ip stack and osi model, compare udp and tcp, and preview a deep dive into tcp protocol internals, features, and functionality.
Explore the TCP overview at a high level to build a base and spark how and why questions, then dive into the TCP protocol's technicalities in later sections.
Let us See what TCP brings to the table as compared to other protocols in TCP/IP Stack
Explore the challenges of tcp arq amid slow routers, limited bandwidth, and lossy networks, and learn how sender and receiver dynamics and acknowledgments shape reliable data delivery.
Tcp is a byte oriented protocol that tracks each byte with a sequence number and uses circular sending and receiving buffers on both ends to manage bidirectional data.
Trace how application data becomes TCP segments with a TCP header, travels through the IP layer as IP datagrams, and is delivered using sequence numbers while avoiding fragmentation.
Assigns incremental sequence numbers to every byte of application data, using the first byte as the segment number; examples show 500–599, 600–699, and 700–799, enabling reliable delivery.
Learn how the TCP header stores the sequence and acknowledgement numbers, with the ack bit marking validity, how sequence numbers advance per data byte, and piggybacking of data with acknowledgments.
Explore the three tcp segment types—data segment, pure segment, and data segment plus an ack—through a duplex exchange between two processes, illustrating sequence and acknowledgement numbers and data flow.
Examine how UDP's send-and-forget approach contrasts with TCP's reliable delivery, using acks and retransmission timers to retransmit lost segments and manage congestion.
Understand how tcp uses a retransmission timer to ensure reliable delivery, with duplex send/receive, sequence numbers, acks, and timer-based retransmission when segments fail.
Master the tcp/ip mechanics in this masterclass, examining tcp goals, connection oriented and stream oriented models, feedback and retransmission for reliable delivery, and the tcp header format.
Explore tcp connection management from first principles, including the finite state machine, the three-way handshake, initial sequence number synchronization, and graceful connection termination for bidirectional data exchange.
Identify client and server roles in network communication by noting who initiates the connection and who responds, and recognize that a process can act as both depending on the conversation.
A TCP connection is uniquely identified by four tuples: client IP, client port, server IP, and server port, enabling isolated communication between specific client and server processes.
Explains how a TCP client and server open bidirectional communication via the three way handshake, using syn and ack flags, and establishes initial sequence numbers for synchronized data exchange.
Explain how tcp connection closing works: the client sends a fin, the server replies with an ack and fin, then the client sends a final ack to complete four segments.
Learn the TCP sequence number consumption rules for syn, fin, and ack segments, and how application data affects how many sequence numbers are consumed.
Explain how a TCP connection experiences timeout when a server is down, using exponential backoff to double syn retransmission intervals up to five retries.
Explore how TCP uses a retransmission timer and timeout to detect lost segments, triggering retransmission to ensure reliable data delivery across the IP network.
Learn how to compute the TCP retransmission timeout R2 and why wrong values cause underutilization or false retransmissions, worsening congestion.
Explain how tcp sender handles segment loss, going beyond retransmission to tasks like timer-based and fast retransmission, adjusting segment size, retransmission count, and R2 to network congestion.
Explore exponential backoff in TCP when consecutive segment loss occurs, showing how retransmission timers double after each failed delivery to ease network congestion.
Explore how tcp estimates rtt per connection with a smoothing formula that blends the newest rtt sample and old average using a smoothing factor x, updating r2 and avoiding overreactions.
Explore the retransmission ambiguity problem in TCP, where delayed or lost acks create indistinguishable ack values, producing two possible RTT calculations and false retransmissions; introduce Khan's algorithm as the solution.
Apply Karn's algorithm by ignoring RTT for retransmitted segments in R2 evaluation. Back off retransmission timers with exponential backoff, doubling after each retransmission and resetting only after a successful transmission.
Karn's algorithm illustrates how a TCP sender and receiver manage a retransmission timer R2, backoffs, and reset after a fresh segment is delivered.
Analyze Karn's algorithm to show how retransmissions double R2 to curb congestion, ignore RTT for retransmitted segments, and restore R2 after a successful transmission to sustain network utilization.
Master class introduces fast retransmission, reduces underutilization by using receiver feedback to detect losses rather than waiting for the retransmission timer, with the end goal of retransmitting the lost segment.
Explains how the TCP receiver handles out-of-order segments, fills holes in its circular buffer, and uses acknowledgement number 201 to trigger retransmission of the missing segment after three acks.
Demonstrates how three consecutive duplicate acks reveal a hole in the receiving buffer and trigger fast retransmission of the missing segment (sequence 201) without waiting for a timer.
Master how the tcp receiver repairs holes in its receiving buffer using duplicate acks and fast retransmission, and learn how selective acks enable fixing multiple holes in one shot.
Explore how three duplicate acks trigger fast retransmission, yet cause redundant retransmissions of already received segments when holes appear, and how selective acknowledgement resolves this.
Compare timer-based retransmission and fast retransmission in TCP, noting that timer expiry triggers loss recovery and three duplicate acks enable instant retransmission, affecting utilization and congestion.
Explore selective acknowledgements (SAC) that allow a TCP receiver to repair multiple holes in its buffer in one RTT by conveying hole ranges in the TCP header.
Learn how selective acknowledgment (SAC) uses multiple holes in the receiving buffer to drive fast retransmission of multiple lost segments per RTT, outperforming duplicate acks.
Explore cumulative acknowledgment, where the TCP receiver acknowledges multiple data segments with one acknowledgment number to improve efficiency in shipping application data. Understand how delayed acks cut header overhead.
Illustrates how tcp receiver uses delayed ack and cumulative ack to acknowledge multiple received segments, and how piggybacking a data segment with an ack avoids pure acks.
Explore tcp data flow and window management, examine how segment size affects congestion and network utilization, and analyze sender limits per rtt, receiver buffer capacity, and feedback for congestion control.
Master the TCP sliding window mechanism to ensure reliable data delivery, congestion and flow control, and synchronized duplex communication through send and receive windows.
Explore the TCP send and receive layout within a sliding window protocol, detailing four send window categories, three receive window categories, and definitions of window size and usable window size.
Explain TCP window-based flow control: receivers advertise their receive window to constrain the sender's send window, using the 16-bit field during the three-way handshake to manage congestion.
Explain how TCP sender and receiver exchange their receiving window sizes during a three-way handshake, initially advertising the maximum 65,535 and later adjusting independently.
Explore sliding window rules in TCP to understand how send and receive windows slide with acks and data segments, enabling flow control.
Explore how TCP send and receive windows regulate data flow between client and server after a completed three-way handshake, using una and next pointers to track bytes.
describes phase one of a tcp window management demonstration, showing client and server send and receive windows sliding after data and ack exchanges.
Show how the TCP server can send only 120 bytes in segment four due to the send window, while 160 bytes remain pending after generating 280 bytes.
Analyze phase three of tcp window management, illustrating send window expansion and data transmission. Observe how the client and server windows synchronize after ack reception, with no segments in transit.
Examine how receiving a data segment slides the receiver's window and how receiving an ack slides the sender's window, illustrating the six window-management points.
Explore how TCP tiny grams increase header overhead and waste bandwidth, and learn how Nagle's algorithm helps avoid sending these small payloads by batching data.
Understand Nagle's algorithm, which delays tiny TCP segments until the 100-byte threshold is reached or all outstanding segments are acknowledged.
Nagle's algorithm reduces network traffic by sending fewer, larger packets and delaying tiny grams until acknowledgments arrive, a self-clocking trade-off that improves efficiency at the cost of delay.
Learn how TCP window resizing adjusts the send and receive windows to match recipient capability and network capacity, shaping the rate of data exchange between TCP peers.
A slow TCP receiver causes network congestion when a fast sender overwhelms it, and window size reduction slows the sender to prevent drops.
Explore tcp window resizing, where the recipient communicates its capacity to the sender via dynamic receive window adjustments, shrinking on pending data and expanding after delivery.
Demonstrates an end-to-end tcp window resizing with sender and receiver windows, ack interactions, and window opening segments to recover from zero window.
Learn how window reopening resumes TCP data flow after both sides shrink to zero, with the receiver enlarging its receive window and the sender expanding its send window.
Explore how TCP uses zero window probe segments and a persistent timer to avoid deadlock when a receiver's window is zero, and how tiny window openings cause silly window syndrome.
Analyze the silly window syndrome, how tiny data segments cause network underutilization, and how sender and receiver behaviors—with Nagel algorithm for the sender and avoidance rules for the receiver—address it.
Explore the silly window syndrome avoidance rules for the TCP receiver, where advertising a zero window prevents tiny grams, depending on the maximum segment size and buffer size.
Demonstrates how silly window syndrome avoidance prevents declaring tiny receive windows in TCP communication. Illustrates a sender-receiver scenario with acknowledgments, window opening, and maximum segment size constraints.
Learn how TCP congestion control shifts responsibility to the sender to cope with slow networks. It works without feedback from the receiver, unlike flow control.
Identify two goals: slow down when the network is congested, and speed up when it recovers. Congestion control is sender-driven and differentiates from flow control.
Learn how TCP relies on sender-side congestion control without explicit network signals, and explore the three parts: detect congestion, slow the sending rate, and cautiously increase it as congestion eases.
Explain how TCP congestion window constrains the sender's data to the minimum of the congestion window and the receiver's advertised window, and how it adapts with network capacity.
Examine TCP congestion control with slow start and congestion avoidance, starting at one MSS, doubling cwnd during slow start, then increasing linearly after switching, guided by ACKs and packet loss.
The slow start algorithm helps TCP determine the maximum data rate without loss, starting cwnd at one MSS and triggering after handshake, on timeout for loss, or after idle.
Explore the slow start algorithm in TCP, where the sender's congestion window doubles with each Ack, while the sending window equals the minimum of congestion window and receiver's advertised window.
Explore slow start, doubling the congestion window on each good ack, defined as the largest ack seen so far. An almost infinite advertised window lets growth continue until loss.
Explore slow start execution with a graph, showing cwnd growth from 1 to 128, ssthresh updates on loss, and transition to congestion avoidance at cwnd meeting the advertised 200 window.
Thresh is the TCP sender's estimate of network capacity after loss. When the size of the congestion window reaches thresh, growth becomes linear rather than exponential to avoid further loss.
Navigate the slow start algorithm via a flowchart that captures cwnd and ssthresh dynamics after the three-way handshake, showing doubling on good acks and reset to one when loss occurs.
Discover how congestion avoidance uses additive increase, raising the congestion window by one MSS per good ack, and contrasts with slow start's exponential growth in TCP.
Demonstrate congestion avoidance in action: additive increase yields linear congestion window growth after slow start, with TCP sender A and receiver B handling cumulative vs individual acks.
Learn how Using ssthrash Variable, TCP decides to switch from Slow-start to Congestion Avoidance, and from Congestion Avoidance back to slow-start
This lecture introduces fast recovery in TCP, showing how loss detected by three duplicate acks avoids resetting the congestion window, unlike retransmission timeout that triggers slow start and underutilization.
Trigger fast recovery when three duplicate acks arrive, halve the congestion window rather than resetting to one, and resume in congestion avoidance to avoid starting from scratch.
This lecture shows how TCP updates cwnd and thresh during fast recovery after three duplicate acks, including an example where cwnd drops to eight and thresh to five.
Explain how TCP fast recovery uses three duplicate acks to update congestion window and SS thrash, toggle between slow start and congestion avoidance, and honor the receiver's advertised window.
Examine the complete TCP congestion control flow, covering slow start, congestion avoidance, and fast recovery. Learn how losses trigger window and thrash updates via timeout or three duplicate acks.
Explore coding projects across operating system networking, Linux system programming, and multithreading, including TCP/IP stack memory manager and thread synchronization, to boost your resume and attract interview calls.
This is Master Class course on TCP/IP protocol - Transmission Control Protocol. Since it is Master Class course, this course discusses the internal design and functioning of complex transport layer protocol - TCP.
Almost all traffic on internet today is transported by TCP protocol. TCP, as where it stands today, mature and solid, is the result of over 25 yrs of research by network gurus. TCP is complicated and difficult to understand, therefore i have paid utmost attention to present the concept in most simplest way as possible without any loss of information.
In this course, we unwrap internals of TCP and try to understand how it works and why it is so designed. So, be ready and place yourself in first gear !
TCP is difficult to understand and confusing if not done in the right way. In this course, I shall be covering all aspects of TCP internal functioning STEP BY STEP with beautiful diagrams, Assignments, Questions and exercises. At no point you shall be left with doubts is my promise. There is no programming in this course.
This is a little Advanced Course, if you are absolute beginner in networking, I would recommend you to first enroll in my other course "Networking course - Network Concepts and Programming from Scratch" and cover important sections on L2 routing, L3 routing, and Transport Layer at-least before jumping into this course. If you are already familiar with this much networking basics, then you are all set to sail through this course.
Table Of Contents:
Section 1 : Basics
1. Agenda of the course
2. General overview of OSI model and TCP/IP stack
3. TCP IP Stack layer functions
4. Transport Layer Goals
5. User Datagram Protocol (UDP)
6. Transmission Control Protocol (TCP)
7. UDP Vs TCP
8. Summary
Section 2 : TCP Preliminaries
1. TCP Vs Other Protocols
2. TCP ARQ Challanges
3. TCP Byte Circular Buffers
4. Segments and Sequence Numbers
5. TCP Segments Type
6. TCP Reliable Delivery
7. TCP Retransmission Timer Illustration
8. TCP together with IP Protocol
9. Summary
From here on we shall dive deep into specifics of TCP
Section 3 : TCP Connection Management
1. Who is Client and Who is Server ?
2. TCP - 4-tuples
3. TCP Connection Open - 3-way handshake Explained
4. TCP Connection Closing - 4-way handshake
5. Sequence Numbers Consumption Rules
6. TCP Connection Timeout and Exponential Backoff
Section 4 : TCP Timeout and Retransmission
1. TCP Retransmission
2. TCP RTO Problems if computed Wrongly
3. Expectations from TCP when Segment loss occurs
4. TCP Exponential backoff - When consecutive segment loss occurs
5. TCP RTO Value Estimation
6. TCP Retransmission Ambiguity Problem
7. Karn's Algorithm
8. Karn's Algorithm Illustration
9. Karns Algorithm Analysis
9. Concept of Fast Retransmission
10. TCP handling out of order segments
11. TCP holes Problem and its remedy
12. Redundant Retransmission due to dupACK
13. Fast Re-transmission Vs Timer based Re-transmissions
14. Selective Acknowledgement (SACKs)
15. SACKs Example
16. Cumulative Acknowledgement
Section 5 : TCP Data flow and Window Management
1. TCP Send and Recv Windows
2. TCP Send and Recv Window Layout
3. TCP Flow control
4. TCP Window Advertisement
5. Sliding Window Rules
6. Window Management Example
7. Data Accumulation - TCP Nagle Algorithm
9. TCP Window Size Resizing
10. TCP Zero Window
11. TCP Probe Segments
12. Problem of Silly Window Syndrome (SWS)
13. Silly Window Syndrome Solution (SWS - Solution)
14. SWS - Complete Example
Section 6 : TCP Congestion Control Procedures
1. TCP - Congestion Control Procedures
2. TCP - CCP Goals
3. TCP - 3 Parts of CCP
4. Introducing Congestion Window
5. Congestion Control Algorithms
a. Slow Start
b. Congestion Avoidance
6. Slow Start Algorithm
7. Slow Start Algorithm in Action
8. Slow Start Algorithm Summary and SSthrash
9. Congestion Avoidance Algorithm With Example
10. Congestion Control Algorithm Selection and Switching
11. Typical TCP Graph
12. Concept of Fast Recovery
13. Algorithm Selection Flowchart
Good Luck ! Hope you Enjoy the course.