TCP Protocol Overview
TCP (Transmission Control Protocol) is one of the two major transport layer protocols alongside UDP. When data arrives from the application layer, TCP adds a header to create segments. This video covers the fundamentals of TCP and its header structure, building upon core concepts explained in our guide to IP, TCP, and UDP Explained: Networking Fundamentals for A+ Certification.
Key Features of TCP
Byte Streaming
- TCP is a byte streaming protocol, accepting unlimited continuous data from the application layer
- It converts incoming bits into bytes, then groups bytes into segments for transmission
- Each segment contains a collection of bytes
Connection-Oriented
- Unlike IP (connectionless datagram service), TCP establishes a connection before data transfer
- Uses three-way handshaking protocol to establish connections:
- Sender sends connection request
- Receiver responds with readiness
- Sender confirms and begins data transmission
- Provides reliability , guarantees data delivery with retransmission capability
Full Duplex Communication
- Both sender and receiver can transmit data simultaneously
- Enables bidirectional data flow over the same connection
Piggybacking
- Combines acknowledgement with outgoing data in a single packet
- Reduces network load by avoiding separate packets for acknowledgements
- Supports both go-back-n and selective repeat sliding window protocols
Error Control
- Detects data corruption caused by noise during transmission
- Provides mandatory error detection mechanisms
Flow Control
- Prevents receiver buffer overflow by ensuring sender transmits within receiver capacity
- Adjusts data rate to match receiver's processing capability
Congestion Control
- Monitors network conditions between sender and receiver
- Avoids network congestion by considering both receiver capacity and network state
TCP Header Structure
- Minimum size: 20 bytes (160 bits)
- Maximum size: 60 bytes
Header Fields
Source & Destination Ports (16 bits each)
- Port numbers range from 0 to 65535 (2^16 possibilities)
- Well-known ports (0–1023): Used by standard applications
- HTTP: Port 80
- SMTP: Port 25
- FTP: Port 21
- Registered/Ephemeral ports (1024–65535): Assigned by OS to client applications
Sequence Number (32 bits)
- Every byte in TCP is numbered (byte streaming)
- Uses random starting sequence numbers
- Example: If segment starts at byte 1000, next byte is 1001
- Each segment's bytes are consecutively numbered
Acknowledgement Number (32 bits)
- Receiver sends acknowledgement of received data
- Contains "next expected byte number"
- Example: If sender transmits bytes 1000–1050, receiver sends acknowledgement number 1051
- Indicates successful receipt and expectation for next segment
Visual Summary
| Field | Size | Purpose | |-------|------|---------| | Source Port | 16 bits | Identifies sending application | | Destination Port | 16 bits | Identifies receiving application | | Sequence Number | 32 bits | Byte numbering for ordering | | Acknowledgement Number | 32 bits | Confirms receipt & next expected byte |
Practical Application
- When accessing a web server, your browser gets a temporary port (e.g., 50001)
- The server receives requests on well-known port 80 (HTTP)
- This enables port-to-port (end-to-end) delivery across the network
For a deeper look at how TCP and UDP differ in practice, check out our Understanding Networking Protocols: IP, TCP, and UDP Explained article. If you're studying for CompTIA A+, our comprehensive guide on CompTIA A+ Network Port Numbers: TCP/UDP Protocols Explained covers the essential port numbers you need to know.
To better understand how TCP fits within the overall networking stack, see Understanding the OSI Model and Computer Network Communication. For a broader view of how network protocols handle data communication, read Understanding Network Protocols and Data Communication.
- Hello friends, welcome to Gate Smashers - the topic is TCP i.e.transmission control protocol - in transport layer there are two protocols which are majorly used i.e. TCP and UDP
- in this video we are going to see the TCP and the overview of header - header means whenever we send the data through TCP - TCP adds the header along with the data
- so header provides lots of functionalities and what are the various functionalities - means in this there are different entries, the advantage of that entries is - to send the data properly to the receiver, that we are going to see one by one
- so first of all TCP, transmission control protocol - we are firstly discussing about its basic functionalities - means what is TCP actually, we uss transmission control protocol in transport layer
- data comes from application layer to transport layer through presentation and session layer - when data comes from application layer to transport layer along with that data - we add a header. It depends on which protocol I'm using either TCP or UDP
- if I'm using TCP, then I send TCP header along with this data - now what is the advantage of adding this TCP header - first is byte streaming. Byte streaming means, TCP is a byte streaming protocol
- from the application layer continuous data comes means - data comes continuously from application layer to transport layer without any limitation means there is no limitation that only this amount of data can come - unlimited data can come from application layer to transport layer
- but what does transport layer does to that, bytes, bytes means collection of bits - and it converts it into segments - this is a very important point because here the first functionality of TCP is segmentation
- segmentation means whenever the data comes from the application layer - TCP converts it into segments and in every segment there will be a lot of bytes - a lot of bytes. These all are bytes. These aren't bits, these are all the bytes
- means, what is a segment? Segment is a collection of bytes - so when bits comes continuously. It converts those bits into bytes and we call a collection of bytes as segment - so TCP creates a segment. When that segment is sent it creates another segment
- and each segment is a collection of various bytes. Next is - connection oriented. TCP is working as a connection-oriented - because when be talk about network layer, we use IP protocol in network layer
- IP is a connectionless it is known as datagram service - means, but if I want proper reliability here - main advantage of connection oriented here is reliability
- reliability. Means, the data I'm sending, all that data should reach at receiver end without any loss - If in case there is a loss, I have to re-transmit dat data. - so TCP provides guarantee of this thing. If I'm using UDP here then that doesn't give any guarantee
- that all the data will reach there or not. TCP is a connection-oriented - and here it uses three way - 3 way handshaking means, first it sends request to make the connection
- receiver sends the response that ok I am ready. Then a third request is sent - that ok now I am sending the data. So it uses three way handshaking protocol to establish the connection - advantage of this is, it provides reliability that all the data will reach at the receiver end for sure
- 3rd is full duplex, full duplex means - it's working on both end here, the TCP, if I talk about two entries here A and B - So if a starts to transmit the data first or sends a request to establish the connection
- so when A and B will be connected with each other through TCP - then that channel will work as a full duplex, means A can send data to B, at the same time B can also send data to A - so it is working as a full duplex, both can transmit the data at a same time
- so this is called the full duplex network - next is piggybacking, What is piggybacking means, whenever we receive the data - we have to send the acknowledgement. Acknowledgement means
- that I have to send a acknowledgement to the person who has sent me data that ok - like we do online transaction so the last acknowledgement received is transaction completed - or message sent. So that is what a kind of acknowledgement
- so when we send that acknowledgement to the sender, along with that acknowledgement we can also send the data that is called as piggybacking - let me tell you one more thing about TCP, in sliding window protocol TCP uses go back n - as well as selective repeat. It uses both these technologies
- go back n and selective repeat to send the data - acknowledgement we are talking about here that acknowledgement is commutative also - as well as piggybacking, means, if I am receiving many packets
- I don't have to send acknowledgement of all the packets, after accepting all the packets - I send only one acknowledgement. We'll discuss further that what is that acknowledgement - here are just looking at the brief introduction that what is piggybacking and along with the acknowledgement
- we can send the data also, that helps in lowering the load on the network - because acknowledgment is going individually, the data is going individually, the best is that we can send both together in 1 packet - Error control. TCP also provides the error control
- error control means if I am sending some data and there's some change in that due to some noise or due to some other activity - there is some change occurred in the data. So the person who is receiving the data - atleast they should know, they can detect that there is some kind of error in the data
- so TCP support error control and these are the mandatory fields - these are the mandatory fields in the TCP - Flow control. Flow control means, whenever we send the data to the receiver
- we have to maintain some flow control - otherwise the receiver will be filled fully with the data - means if I am sending data to the receiver, then the buffer of the receiver
- means it's capacity of receiving, to send data less than or equal to that capacity - if I send data more than that, then receiver won't be able to receive that data properly, so there can be some loss of data - Congestion control. Congestion control means, whenever we send the data to the receiver
- so we take care about the receiver that if the capacity of accepting of receiver is of 1000 byte - then I will send maximum data of 1000 byte only not more than that - but TCP also takes care of that network
- that means, if I'm sending data to A then the data will go through network - if A sending data to B, then it will take care of the capacity of B of accepting the data - plus it will also take care of the network between A to B
- that the network doesn't come in congestion. So for that TCP - take care of B, as well as it will also try to protect/avoid congestion in that network - these all are different proper method that we will see in detail one by one. Here we're just looking at the overview of TCP
- now here we are talking about the header of TCP. The header of TCP - should be of minimum 20 byte and maximum 60 byte. - if we talk about 20 byte, so 20 bytes means there are 160 bits
- maximum it can be 60 byte but minimum it should be of 160 bits or 20 bytes - we can't send data lower than that. Means the header can't be less than 20 byte - if the header is of less than 20 bytes then it can create a problem
- I don't have to send header less than 20 - firstly if we talk about the first field i.e.source port and destination port - both are of 16 bits. Here we talked about port number, I told that in details in transport layer
- that when we are talking about port, we are talking about end to end delivery - many applications are running in machine. Every application has it's own port number - when we send data from that port, then many applications can run in the receiver also
- then in receiver which application/port will receive the data, that is called the end to end delivery - if we talk about ports here, so here - port number is of 16 bit. 16 bit means
- 2¹⁶ possible numbers are there. Means I can have numbers from 0 to 65535 for ports - but from that, 0 to 1023 - 0 to 1023 are known as well known port numbers
- well known port numbers. Means, these well known port numbers uses standard applications like http - uses 80 number port. Simple mail transfer protocol uses 25 number port. - FTP uses 21 number. Means the different standard applications
- that are used in the network, all of them uses ports in this range - this well-known means is just like your, like we know 100 is for police - so that is a well-known number. So that is what we are talking about here that 0 to 1023 we've well known numbers
- the range that comes after that, some are registered ports, some are normal - means if I am opening browser from my system, I opened a simple Mozilla browser or Firefox - then my operating system will assign me a port number. That port number won't be a well known port number, it's a normal port number
- which can be till 65535. Now, when a request will be sent from my machine - to any server. Let's say I'm accessing a web server, that means my request will be sent to port number 80 - because web pages are transferred by using HTTP protocol
- so in my system, let say when I turned on the system and opened the browser then operating system - operating system assigned me a port number 50001 - now when I am accessing a web server from here, then in that web server my request will be handled by port number 80
- so that means, from by system, from my application, from my end to other end, who will accept my request, that is done by the port to port delivery or end to end delivery - means I am also using 16 bit port number, and the destination port number should also be used - that port number are in the range of 0 to 65535, out of which 0 to 1023 these are known as well known port numbers
- then is sequence number. Sequence number means, in TCP every byte is counted - like we said that it's byte streaming protocol, byte streaming means continuous bits are coming from application layer - continuous data is coming. TCP converts it into byte
- and the collection of bytes is known as segment. So if I have a segment - let's say, if I take this, there is already a segment created - in this statement, let's say this is the first byte. Let's say I gave this first byte the number 1000
- then the number of the next byte will be 1001. Let's say, I entered 50 bytes like this here - so the size of the segment is 50 byte. And in this segment every byte will be counted - means every byte will have it's number. Whenever I'll send a byte to the receiver, there will be number written on that
- so that is the byte and we call this sequence number - and generally the TCP uses random sequence numbers. Means we'll start from any random number and then we'll give continuous number in that segment - then the acknowledgement number. Acknowledgement number means, when we'll send the data to the receiver
- receiver will send me an acknowledgement there. If I talk about this case - let say, sender sent the data from 1000 to 1050. When the data will reach to receiver - then the receiver generally sends the acknowledgement and acknowledgement is that, if I have sent byte x
- then the receiver will always send the acknowledgement x+1 - means my last byte here is 1050, then the receiver will send me 1051 - because I sent from 1000 to 1050, so the receiver accepted that
- and added 1 to that, means, this 1051 means that I have accepted 1050 - now my next expectation is 1051. So the acknowledgement number is always the next expected byte number - that is the advantage of the acknowledgement number
TCP treats data as a continuous stream of bytes from the application layer. It converts incoming bits into bytes and groups them into segments for transmission, with each segment containing a sequence of consecutively numbered bytes. This byte numbering (using sequence numbers) enables reliable data ordering and retransmission at the receiver's end.
TCP uses a three-step process: First, the sender sends a connection request to the receiver. Second, the receiver responds with a message indicating readiness to communicate. Third, the sender confirms the connection, and data transfer begins. This ensures both parties are synchronized before any data is sent, guaranteeing reliable delivery.
Piggybacking combines an acknowledgment (ACK) with outgoing data in a single packet, rather than sending separate ACK packets. This reduces network load and improves efficiency by utilizing the same packet for both acknowledgement and data transmission, supporting sliding window protocols like go-back-n and selective repeat.
Flow control prevents receiver buffer overflow by adjusting the sender's data rate based on the receiver's processing capacity, ensuring that the receiver isn't overwhelmed. Congestion control monitors network conditions between sender and receiver to avoid network congestion by considering both the receiver's capacity and the overall network state.
Sequence numbers number every byte in the data stream (starting from a random value) for ordering and reassembly. Acknowledgment numbers indicate the next expected byte number, confirming successful receipt of previous data. For example, if segment bytes 1000–1050 are received, the receiver sends an acknowledgment number of 1051, requesting the next byte.
TCP employs mandatory error detection mechanisms to identify data corruption caused by noise during transmission. It detects errors and triggers retransmission of lost or corrupted segments using sequence numbers and acknowledgments, guaranteeing that data arrives intact and in order.
Keep this summary
Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.
Save to LunaNotesOr summarise for another video.
This summary and transcript were automatically generated using AI with the Free YouTube Transcript Summary Tool by LunaNotes.
Related summaries
IP, TCP, and UDP Explained: Networking Fundamentals for A+ Certification
This video from a CompTIA A+ prep course demystifies core networking protocols: IP, TCP, and UDP. Learn how these protocols work together to transport data across networks using the truck-box-road analogy, and understand the differences between connection-oriented reliable delivery and connectionless, low-overhead communication.
Understanding Networking Protocols: IP, TCP, and UDP Explained
Explore how IP, TCP, and UDP work together to efficiently transport data across networks.
Understanding Network Protocols and Data Communication
In this session, we explore the fundamentals of network protocols and data communication, including data flow types (simplex, half-duplex, full-duplex) and the essential elements of protocols. We emphasize the importance of protocols in ensuring effective communication between nodes in a network.
Understanding the OSI Model and Computer Network Communication
This video provides a comprehensive overview of computer network communication, focusing on the OSI model, its seven layers, and the essential elements of data communication. It explains the functions of each layer, the importance of protocols, and the characteristics of effective data transfer.
CompTIA A+ Network Port Numbers: TCP/UDP Protocols Explained
This CompTIA A+ study guide breaks down essential TCP and UDP port numbers for network troubleshooting and firewall configuration. Learn the functions, protocols, and security implications of key ports like FTP (20-21), SSH (22), SMTP (25), DNS (53), DHCP (67-68), HTTP (80), HTTPS (443), and more.
Most viewed summaries
A Comprehensive Guide to Using Stable Diffusion Forge UI
Explore the Stable Diffusion Forge UI, customizable settings, models, and more to enhance your image generation experience.
Kolonyalismo at Imperyalismo: Ang Kasaysayan ng Pagsakop sa Pilipinas
Tuklasin ang kasaysayan ng kolonyalismo at imperyalismo sa Pilipinas sa pamamagitan ni Ferdinand Magellan.
Mastering Inpainting with Stable Diffusion: Fix Mistakes and Enhance Your Images
Learn to fix mistakes and enhance images with Stable Diffusion's inpainting features effectively.
Pamamaraan at Patakarang Kolonyal ng mga Espanyol sa Pilipinas
Tuklasin ang mga pamamaraan at patakaran ng mga Espanyol sa Pilipinas, at ang epekto nito sa mga Pilipino.
How to Install and Configure Forge: A New Stable Diffusion Web UI
Learn to install and configure the new Forge web UI for Stable Diffusion, with tips on models and settings.
Found this summary useful?
Take it with you. One click puts it in your own LunaNotes library.
Save to LunaNotes