Connection-Oriented Communication
Saturday, December 03, 2011
By
Unknown
ccna
1 comments
Connection-Oriented Communication at Layer 4
We know that Transport Layers work is to decide what type of communication should occur, connection-oriented or connectionless, makes segments of the data stream, labels them, and proceed accordingly.
As Network Engineers we are more concerned about connection-oriented communication.
Now let us pull the curtains up and see what happens in a connection-oriented communication.
We can think a connection-oriented communication more like a communication on walkie-talkie, where a person on one side says Hello and the person on the other side acknowledges by answering hello.
Here, before a communication takes place, a session is established between the sender and receiver. This is called a “Call-Setup” or “Three way handshake”.
Suppose a host “Host A” wants to communicate with host “Host B”, first a session called a call-setup is established. Now the Question is how is this call-setup established?
HOST A ----------------------------------------------------------------- HOST B
Host A sends a sync packet to host B, says “Hey Host B, I have some data for you.”
Host B, negotiates to check if it is okay to communicate and receive the data from Host A (which is generally work of the session layer), here let us suppose that it can receive the data from Host A, and it sends back a sync-packet which says “Okay Host A, I see that I can rely and communicate with you, so I have no problem, you can send me the data”
Host A receives the message and acknowledges Host B by sending an acknowledging packet, which says, “Okay, Host B, I have received your message, and I will be sending you the data shortly”
Host B, when received the acknowledgment-packet, a session is created for data communication, and hence data communication begins.
Wait a minute, will Host A send all data at once without caring if Host B can accept the data all at once? Remember, here we are talking about connection-oriented communication, so Host A cares for Host B, so now when session is created for data communication, Host A will use Flow Control, so that Host B is not flooded with data.
Flow Control uses Windowing and Acknowledgment to transfer data.
We are still in Layer 4, that is the Transport Layer so we are here talking about data segments, Flow-Control is achieved by Windowing and Acknowledgments, which means it has a window size(the amount of data that Host A can send to Host B at a time, so that Host B is not overloaded or flooded with data)
Now how does Host A know what is the window size? Well it doesn’t know, so first it will send 1 segment, Host B on receiving the 1 segment sends an acknowledgment that it has received the segment and asks to send more, now A thinks okay so B has successfully received the first segment, now let me double the number of segment to be sent, so now it sends the next 2 segments, B on receiving the next 2 segments, sends back an acknowledgment saying that it has received the segments and asks for more, A again thinks “Wonderful! Now let me double the number of segments again to be sent” So now it send next 4 segments, B on receiving the next 4 segments acknowledges back and asks for more, again A doubles the size and sends next 8 segments, B receives it and asks for more, and this continues.
Well, A will keep on doubling the size until B sends acknowledgments and asks for more, but suppose A is at a point where it is sending 64 segments at a time, and B sends an acknowledgment that it has not received one of the 64 segments, A will immediately stop doubling the size, and will re-transfer the segment that B has not received and again A will start the counter of window size from 1 and will keep doubling until B says to stop, or fails to send an acknowledgment due to overload or flood, or if it says that it has not received any of the segment.
Best example to see this is, if we try to download anything on a slow speed internet connection, probably a dial-up connection, we can see the download progress of the progress bar moving from slow to fast and then again slow gradually increasing the speed of the download, and then suddenly it stops and progress bar again continues from to slow to fast, this is nothing but it is happening due to Windowing.
So, the concept of Flow-Control ensures Data Integrity at the Transport Layer for Connection-Oriented communication and it prevents a sending host on one side of the connection from overflowing the buffers in the receiving host – an event that can result in data loss.
Windowing is the concept of allowing amount of data (measured in bytes) that the transmitting machine can send without receiving an acknowledgment for them.
Acknowledgment is the concept of acknowledging the sender by the receiver that it has received the data, and to send more data if any.
Thank You!
If Our Article Has Helped You, Consider Supporting Us, By Making A Small Contribution, Thank You
very good explanation...
ReplyDelete