So welcome back, guys.
Now, in this lecture video, we will going to understand what are the various type of TCP segments
the TCP protocol uses.
So you can see that on the right hand side.
I have listed the type of segments which TCP protocol uses.
The first type of segment is called Data segment.
The second type of segments is called pure segments.
And the third type of segment is data segment plus a segment.
In fact, the third type of segment is a mixture of the first two.
Now, let us try to understand the use of these three types of segments with the help of an example.
So in this example, suppose the communication is being happening between the two process A and process
B, right?
And the communication is duplex that is bidirectional.
Now suppose the TCP for application A sends 100 bytes of application data to the recipient TCP running
on behalf of application B.
Now you can see that the sequence number that has been used is 100.
Right?
I have taken this number randomly.
And the amount of application data contained in this segment is 100 bytes.
Now, these type of segments are called data segments because these segment contains only application
data and the range of sequence number which this segment delivers to the process.
B is from 100 to 199.
Now, once this segment is received by TCP B successfully, then TCP B has to send confirmation to the
TCP that it has successfully received this segment.
For that purpose, the TCP B will send a special segment called Pure Segment.
And this pure segment will contain a special number called acknowledgement number.
So what is this acknowledgement number?
This acknowledgement number tells the sender the next expected byte.
So you can see that in the previous data segment, the byte number that has been delivered to process
B is from 100 to 199.
It means that the next byte process B is expecting is the byte with sequence number 200.
Therefore, it will send an Ack in which number is the next expected byte number.
That is number will be 200.
So when this acknowledgement number is received by TCP A, it confirms the TCP A that the previous segment
has successfully received by the recipient.
It means that TCP A, after having received this acknowledgement, will now send new fresh bytes of
application data with increased sequence number.
So now you can see that the TCP has again send a new segment to B.
Now, again, let us assume that the amount of application data in this segment is 100 bytes.
And of course, the segment number of this segment will be 200.
Why 200?
Because the acknowledgement that was received last was acknowledgement number 200.
Now, let us suppose that this segment has been successfully received by B.
Now let us suppose that the process running on B has its own application data to be sent to A.
So it means that it will generate a segment which is not only a data segment, but also a segment.
It will be data segment because the application B has its own data to send to the process.
A Right.
And it will have acknowledgement number because the process B has to acknowledge the previous data segment
it has received from Process A.
So it means that in this packet the Process B is doing two tasks in one go.
I have chosen the starting segment number 2000 randomly and let us suppose that this segment contains
150 bytes of application data which is generated by Application B.
And also note that the acknowledgement number will be 300 because in the previous segment, sent by
A to B, the last successfully delivered byte number was 299.
So the next byte which be expect from a is the byte number 300.
So note that here the communication is duplex that is not only a is sending its data to B, but B is
also sending its data to A.
Now since this segment is also an acknowledgement, therefore A has received the acknowledgement confirming
that byte number until 299 has been successfully received by Process B.
So it simply means that process A is now in a position to send a brand new segment with fresh application
data.
So it again, send a segment with segment number 300.
Or in other words, it's a sequence number 300.
And this segment contains 100 bytes of application data.
Now, note that in this particular segment it has successfully received 150 bytes of data from Process
B.
It means that A has a responsibility to acknowledge this data.
It simply means that the TCP running on a has to send a pure acknowledgement to the process.
B confirming process B that the byte number until 2149 has been successfully received.
And I'm expecting bite number with sequence number 2150.
In fact, the TCP on A could have clubbed the data segment.
This one and the pure this one to create a single segment which would have served the purpose of data
segment plus a segment.
So you can see that in this example.
The first segment is data segment.
Then the second one is pork.
The third one is again data segment.
Then fourth one is data segment plus arc.
Then the fifth one is again pure data segment, and the sixth one is again pure arc.
Right?
So these are the three types of segments which TCP protocol uses during its operation.