TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE) PDF Download

TCP - Reliable Byte Stream:
TCP is a more sophisticated transport  protocol  is one that offers a reliable, connection oriented byte stream service. Such a service has proven useful to a wide assortment of application because it frees the application from having to worry about missing or reordered data.

TCP guarantees the reliable in order delivery of a stream of bytes. It is a full duplex protocol meaning that each TCP connection supports a pair of byte streams, one flowing each direction. It also includes a flow control mechanism for each of these byte streams that allow the receiver to limit how much data the sender can transmit at a given time.

Finally, like UDP, TCP supports a demultiplexing mechanism that allows multiple application programs on any given host to simultaneously carry on a conversation with their peers. In addition    to   the     above  features,  TCP also implements a highly tuned  congestion control mechanism.

End To End Issues:
At the heart of TCP is sliding window algorithm. TCP supports logical connections between processes that are running on any two computers in the internet. This means that TCP needs an explicit connection establishment phase during which the two sides of the connection agree to exchange data with each other. This difference is analogous to having a dedicated phone line. TCP also has an explicit connection teardown phase.

One of the things that happen during connection establishment is that the two parties establish some shared state to enable the sliding window algorithm to begin. Connection teardown is needed so each host known it is OK to free this state.

Where as, a single physical link that always connects the same two computers has a fixed RTT, TCP connection are likely to have widely different round trip times.

Variations in the RTT are even possible during a single TCP connection. Packets may be reordered as they cross the internet, but this is not possible on a point-to-point link where the first packet put into one end of the link must be the first to appear at the other end. Packets that are slightly out of order don‟t cause a problem since the sliding window algorithm can reorder packets correctly using the sequence number.

TCP assumes that each packet has a maximum lifetime. The exact lifetime, known as the maximum segment lifetime (MSL), is an engineering choice. The current recommended setting is 120seconds.

The computers connected to a point to point link are generally engineered to support the link. For example, if a link‟s delay X bandwidth product is computed to be 8KB –meaning that a window size is selected to allow up to 8kb of data to be unacknowledgement at a given time then it is likely that the computers at either end of the link have the ability to buffer up to 8kb of data.

Because the transmitting side of a directly connected link cannot send any faster than the bandwidth of the link allows, and only one host is pumping data into the link, it is not possible to unknowingly congest the link. Said another way, the load on the link is visible in the form of a queue of packets at the sender. In contrast, the sending side of a TCP connection has no idea what links will be traversed to reach the destination.

TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE)

TCP is a byte oriented protocol, which means that the sender writes bytes into a TCP connection and the receiver reads bytes out of the TCP connection. Although “byte stream” describes the service TCP offers to application processes, TCP does not itself transmit individual bytes over the internet. Instead, TCP on the source host buffers enough bytes from the sending process to fill a reasonably sized packet and then sends this packet to its peer on the destination host. TCP on the destination host then empties the contents of the packet into a receiving process reads from this buffer at its leisure.

TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE)

The packets exchanged between TCP peers are called segments, since each one carries a segment of the byte stream. The SrcPort and Distorts fields identify the source and destination ports, respectively, just as in UDP. These two fields, plus the source and destination IP addresses, combine to uniquely identify each TCP connection. That is, TCP‟s demux key is given by the 4-tuple

(SrcPort, SrclPAddr, DstPort, DstlPAddr)
The acknowledgement, sequence num and advertised window fields are all involved in TCP‟s sliding window algorithm. Because TCP is a byte oriented protocol, each byte of data has a sequence number, thesequence num field contains the sequence number for the first byte of data carried in that segment. The acknowledgement and advertisement windowvalues flowing in the opposite direction.

TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE)

The 6-bit flags field is used to relay control information between TCP peers. The possible flags include SYN, FIN, RESET, PUSH, URG, and ACK. The SYN and FIN flags are used when establishing and terminating a TCP connection, respectively. The ACK flag is set any time the Acknowledgement field is valid, implying that the receiver should pay attention to it. The URG flag signifies that this segment contains urgent data. When this flag is set, the UrgPtr bytes into the segment. The PUSH flag signifies that the sender invoked the push operation which indicates to the receiving side of TCP that it should notify the receiving process of this fact.

The RESET flag signifies that the receiver has become confused for example, because it received a segment it did not except to receive and so wants to abort the connection.

The document TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Computer Networks.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
21 videos|113 docs|66 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on TCP - Reliable Byte Stream - Computer Networks - Computer Science Engineering (CSE)

1. What is TCP?
Ans. TCP stands for Transmission Control Protocol. It is a reliable and connection-oriented protocol that operates at the transport layer of the TCP/IP network model. TCP provides a reliable byte stream by ensuring that all data packets are delivered in order and without errors.
2. What does it mean for TCP to be a reliable byte stream?
Ans. TCP being a reliable byte stream means that it guarantees the delivery of data packets in the same order they were sent and without any errors. It achieves this reliability through various mechanisms such as acknowledgment, retransmission, flow control, and congestion control.
3. How does TCP ensure reliable delivery of data packets?
Ans. TCP ensures reliable delivery of data packets through several mechanisms. Firstly, it uses acknowledgments to confirm the successful receipt of packets, and if an acknowledgment is not received, the sender can retransmit the packet. Secondly, TCP uses sequence numbers to order the packets and reassemble them at the receiver's end. Additionally, TCP implements flow control to prevent overwhelming the receiver with excessive data and congestion control to manage network congestion.
4. What are the advantages of a reliable byte stream in TCP?
Ans. The advantages of a reliable byte stream in TCP are: - Data integrity: TCP ensures that the data packets are delivered without any errors or corruption. - Order preservation: TCP guarantees that the packets are received in the same order they were sent, ensuring the integrity of the data stream. - Error recovery: TCP's acknowledgment and retransmission mechanisms allow for the recovery of lost or corrupted packets, ensuring reliable data delivery. - Flow control: TCP prevents the receiver from being overwhelmed by regulating the rate at which data is sent. - Congestion control: TCP manages network congestion to maintain optimal performance and prevent packet loss.
5. Can TCP guarantee 100% reliability in data delivery?
Ans. While TCP is designed to provide reliable data delivery, it cannot guarantee 100% reliability in all scenarios. Factors such as network failures, hardware issues, or extreme congestion can still lead to packet loss or corruption. However, TCP's mechanisms such as acknowledgment, retransmission, and error detection significantly improve the reliability of data delivery compared to protocols like UDP, which do not have built-in reliability features.
21 videos|113 docs|66 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Previous Year Questions with Solutions

,

MCQs

,

shortcuts and tricks

,

practice quizzes

,

TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE)

,

Summary

,

ppt

,

pdf

,

Extra Questions

,

TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE)

,

Important questions

,

Exam

,

Objective type Questions

,

mock tests for examination

,

study material

,

TCP - Reliable Byte Stream | Computer Networks - Computer Science Engineering (CSE)

,

Free

,

Viva Questions

,

video lectures

,

past year papers

,

Sample Paper

,

Semester Notes

;