Features of TCP and UDP- The Veins of networking

Thanks for the huge support to the previous articles and i am trying my level best to cover all the topics on what people are asking me the queries. I am very thankful for your support.

Today I will cover the article on TCP and UDP protocols and where they generally used. These protocols are actually called as Veins of the networking. Lets talk about these protocols one by one

TCP-Transmission Control Protocol
TCP named as Transmission control protocol is a transport layer protocol and generally used for guaranteed delivery of the packet across the network.TCP establishes a full duplex virtual connection between two endpoints. Each endpoint is defined by an IP address and a TCP port number.

The operation of TCP is implemented as a finite state machine.The byte stream is transferred in segments. The window size determines the number of bytes of data that can be sent before an acknowledgement from the receiver is necessary.

It means TCP uses 3 way handshaking process between source and destination for sure delivery.

Fig 1.1- TCP Header
If we evaluate the TCP header, you will came to know that Source and destination ports are of 16 bits.

Sequence number is also for 32 bits which describes the sequence number of the first data byte in this segment. If the SYN bit is set, the sequence number is the initial sequence number and the first data byte is initial sequence number + 1.

ACK number is 32 bits, this field contains the value of the next sequence number the sender of the segment is expecting to receive. Once a connection is established this is always sent.

Data-offset is of 4 bits, it indicates where the data begins. The length of the TCP header is always a multiple of 32 bits.

UDP- User Datagram Protocol
UDP is also a transport layer protocol which delivers packet from source to destination but the delivery is not guaranteed. UDP is used by applications that do not require the level of service of TCP or that wish to use communications services.

An application program running over UDP must deal directly with end-to-end communication problems that a connection-oriented protocol would have handled -- e.g., retransmission for reliable delivery, packetization and reassembly, flow control, congestion avoidance, etc., when these are required. The fairly complex coupling between IP and TCP will be mirrored in the coupling between UDP and many applications using UDP.

Fig 1.2- UDP Header

So here in the header you can clearly see that source port is of 16 Bits, Destination port is of 16 bits; Length is also 16 bits and 16 bit of checksum is used in the UDP header for the communication between source and destination in the network.

Lets talk about the feature comparison between these two protocols in the below mentioned table.

Fig 1.3- TCP and UDP features comparison 
Hope you guys understand some of the features of TCP and UDP when compared with each other.