What is udp and tcp




















Before we can get into the nitty-gritty of discussing the difference between TCP and UDP, you first need to understand how the internet protocol works. This will serve as a foundation for helping to explain the other two concepts.

As you can probably guess, this process involves the use of routers or gateways to regulate traffic. According to a TechRepublic article by network engineer and tech writer Brien Posey, routers are typically for similar networks, whereas gateways help to bridge dissimilar networks. Now, to ensure that the data reaches the intended recipient, every individual device has its own assigned IP address — much like you have a specific address for your house or apartment. But instead of Main Street, your IP address on the internet might look something like This bit number consists of a series of subnets segments of numbers that are divided by periods — each of which contains up to three digits for up to a total of 12 digits or 15 characters, including the periods.

Of course, this looks different for IPv6 IP addresses, which are bit numbers and look akin to this: dbaa2e this is an example IPv6 address from Wikipedia. Packets is the most commonly used term for data units in networking. Each of these individual little bundles of data is slapped with a label header that tells the delivery person where it needs to go and where it was sent from.

The data is transferred routers or gateways that have lists information for different IP addresses and their corresponding domains across the internet. Now, just keep in mind that this is a highly simplified breakdown of how IP works.

The internet protocol works much the same way but for digital data transmissions. Now, continuing with the delivery service analogy, imagine that your mom wants to send you a BUNCH of home baked items: cookies, breads, dehydrated fruits — you name it. You lucky devil. Otherwise, those delicious treats could end up in the hands of your least favorite neighbors, Greg and Jill and nobody wants that. Once the packages leave her house, they wind up at the transfer station gateway to make their way to the next delivery point closest to the destination.

There, the packages make their way from station to station gateway to gateway until they get to the one that knows your exact address. TCP stands for transmission control protocol , which is a type of connection-oriented data communication method.

It was designed to help establish reliable connections on virtually any network — even those that are unreliable. Basically, the goal of TCP is to be an error-free method of data transmission. The transmission control protocol helps to:. TCP does this by establishing a reliable connection that helps it to verify that packets are received successfully.

If not, then the TCP will have the sender re-send the data again. It was later obsoleted by RFC in This is where UDP or other communication protocols comes into play. More on UDP momentarily. The transmission control protocol requires establishing a connection via a three-way handshake before transferring data packets from the server to the client. It looks something like this:. This all sounds great in theory. As we mentioned earlier, UDP stands for user datagram protocol.

With UDP, no three-way handshake is necessary before transmitting data to the intended recipient. UDP is a simpler, connectionless Internet protocol.

Multiple messages are sent as packets in chunks using UDP. Nitin Sharma. Previous Page Print Page. If ordering is required, it has to be managed by the application layer. UDP is faster because error recovery is not attempted. It is a "best effort" protocol. There is absolute guarantee that the data transferred remains intact and arrives in the same order in which it was sent.

There is no guarantee that the messages or packets sent would reach at all. Data is read as a byte stream, no distinguishing indications are transmitted to signal message segment boundaries.

Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent. TCP is heavy-weight. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. UDP is lightweight.

There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP. TCP does Flow Control. TCP does error checking and error recovery. Erroneous packets are retransmitted from the source to the destination. UDP does error checking but simply discards erroneous packets. Error recovery is not attempted. Sequence Number, 2. AcK number, 3. Data offset, 4. Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer 8.

Options, 9. Padding, Check Sum, Source port,



0コメント

  • 1000 / 1000