Sunday, June 21, 2020

TCP/IP vs UDP/IP


Internet Protocol (IP)
IP is a protocol or set of rules for routing and addressing the data traveling over network. so that the data can reach the correct destination.
Data transferred over network in the form of small packets, each device in the network will have dedicated IP address assigned. so each packet will be labeled with destination IP, this helps the routers to route the data to appropriate device.

each data packet header will have sender and receiver IP address along with 42 other information fields in bits to send the packet over.
few such fields are
  • Header Length
  • Packet Length
  • TTL(Time To Live) or Number of Hops each packet can make before it discard packet.
  • Transport Protocol information (TCP or UDP)


TCP/IP
TCP (Transmission Control Protocol) is a transport protocol, which means it dictate how the packet data needs to be transported. each packet data will have TCP header information attached along with IP header.
TCP guaranties the packet delivery and order of the packets between source and destination IP by following 3 way acknowledgement for each packet transmission. This is the reason TCP is slower than UDP. but most reliable transport protocol.

TCP is used in many places where packet loss is not compromised and order of the packets is important. like File Transfer, web pages (http) etc..




UDP/IP
UDP (User Datagram Protocol) is another widely used transport protocol. where speed is required over guaranty and order of packets. it is faster then TCP but less reliable.
UDP will have simple 8 byte header compared to 20 byte TCP header.
UDP is a connection less protocol meaning it will not establish a connection before sending or while receiving the packets. it will just keep sending the packetet and do not expect acknowledgement.

An example of a use of the UDP protocol is DNS queries. When you attempt to use your Web browser to access www.syngress.com, it must first resolve the name to an IP address. This would require a DNS query. The query is sent over a single UDP packet. The DNS server would then respond by telling the originating system the IP address of the Web server. Because the UDP response is faster than setting up a TCP session, UDP makes sense in these situations. Another example of using UDP is Voice over IP (VoIP), video and audio streaming. The downfall, of course, is the lack of reliability, so you may have to employ other methods to guarantee delivery.

TCP used in 80% of the network and the rest is UDP

0 comments:

Post a Comment

Popular Posts

Blogger templates

Blogroll

About

Powered by Blogger.

Wikipedia

Search results