500: UDP TCP direction and duplex

Posted on 2007-03-21
Last Modified: 2013-11-29
Can some on clear one fundamental issue for please as I read contradicting views on the following:
UDP is a connectionless protocol unlike TCP. UDP unidirectional or bidirectional and what is really meant by each. What about TCP (uni or bi??)
So then: is UDP and TCP half duplex or full duplex....... or does the duplex characteristic depend on the hardware - switches and ethernet etc.....

Many thanks
Question by:smotbd

Accepted Solution

davystocks earned 125 total points
ID: 18770307
I think that you are mixing things up a bit.  UDP and TCP are transport layer protocols and logical in nature.  The half or full duplex relates to the physical layer or the wiring technology in ethernet switches.  

UDP is a connectionless protocol in that it does not establish a (logical) connection with another device before sending data and uses higher layer protocols to determine whether data is lost, needs to be retransmitted etc.  TCP on the other hand uses a three way handshake to establish a connection before sending data and uses other aspects of the protocol to detect lost packets and request for them to be retransmitted.  

Half duplex settings in an ethernet context implies that a device can only send or receive at a given time.  Wiring in the NIC using half duplex loops back the transmit pins to the receive pins and is used to detect collisions during transmission.  Full duplex on the other hand is capable of transmitting and receiving at the same time and uses no loopback wiring.  

Author Comment

ID: 18770895
Ok that's clear thanks.............but can you explain whether UDP and TCP transport is bi-directional or unidirectional. I think TCP is bi-directional where UDP is uni-directional i.e. TCP can send & receive data in both directions at the same time where as UDP can only send OR receive at any given time but since UDP is so much quicker then it seems bi-directional in effect............does that make sence!!?!?!! Is it correct?

Thanks  v much

Assisted Solution

lourite earned 125 total points
ID: 18795472
Both can "communicate in both directions" The reason that UDP is faster is because it is not guaranteed.  For example a TCP connection goes like this "Hey" (Syn packet)  "Hey Whatcha need" (Syn+Ack) "Could you take a look at this (ESTABLISHED).  This is called a 3 way handshake and is what guarantees delivery.  This creates overhead which takes time but guarantees delivery.  UDP does not do this instead it just throws the data out there and goes for broke.

This whole BiDirectional, Unidirectional sounds more like the whole Full Duplex, Half Duplex thing that Davystocks was talking about.  Half Duplex Transmits.........then Receives.....  (could be considered unidirectional)  While Full Duplex transmits down one wire at the same time it is receiving on another.  This effectively doubles your bandwidth by providing 100mb (for example) sending and receiving at the same time...NOW 200mbps.
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

LVL 20

Assisted Solution

calvinetter earned 125 total points
ID: 19037581
Good points presented by davystocks & lourite...  LOL lourite, love your spin on the 3-way handshake!  I'll definitely be quoting that here on EE (giving proper credit of course).

As already stated, don't confuse "uni-/bi-directional" with "full-/half-duplex".  Both protocols are "bi-directional" - they can both send & receive data.  Both *can* send & receive data simultaneously - ie, operate full-duplex...
   Whether or not your device can operate in full-duplex mode (transmit & receive simultaneously) depends on both hardware & software.  But nowadays, just about everything networked can operate full-duplex - PCs, firewalls, print servers, etc.  Half-duplex has pretty much gone the way of dinosaurs & hubs.

>UDP is a connectionless protocol unlike TCP
   Right.   "connectionless" just means what lourite said: UDP doesn't establish a connection to the destination box to ensure the receiver is ready & that the data gets there, it just shoots it out like a blind man with a shotgun, hoping to hit the intended target.

Make sense? Clear as mud?

cheers all
LVL 22

Expert Comment

ID: 19179607
To further comment, UDP is not "so much quicker" than TCP, the bits flow with exactly the same speed. It is more correct to say that it has lower overhead, since it does not require the three-way handshake to establish the connection. As far as uni- vs. bi- directional, neither TCP or UDP is bi-directional in the way you seem to be saying. A packet starts from one machine and goes to another and can only carry data going from the source to the destination. Both protocols allow packets to flow in both directions simultaneously. So while a packet is carrying data from system 1 to system 2, at the very same time there could be a packet carrying data from system 2 to system 1. In this sense they are both bidirectional.

Author Comment

ID: 19179948
Yes I thinki calvinetter comments is correct and helpfull BUT on top of this I think that there are two main types of sockets: stream and datagram (as seen in PHP manual and  the following link: 
says that Sockets of type SOCK_STREAM are full-duplex byte streams.

Stream sockets provides sequenced, reliable, full-duplex, connection-based byte streams. The TCP protocol is based on this socket type.
Datagram sockets supports datagrams (connectionless, unreliable messages of a fixed maximum length). The UDP protocol is based on this socket type.

So Windows API does support full duplex on TCP but maybe only half duplex on UDP since unidirectional at any instance).
LVL 22

Assisted Solution

blu earned 125 total points
ID: 19180067
You are mixing up the difference between the transport protocol and the API used to access it. What you said about SOCK_STREAM and SOCK_DGRAM are sort of true, but these are just flags used to tell the sockets API whether you want TCP or UDP. UDP is bidirectional in exactly the same way that TCP is. I think that they neglect to mention that UDP is full-duplex because it is trivially true since it is connectionless.
LVL 22

Expert Comment

ID: 19180084
Perhaps it might help us if you explain why you want to know whether TCP and UDP are full duplex or not. Is there a particular problem you are trying to solve or is this just to help your own understanding?

Author Comment

ID: 19184799
Just to help my understanding.....and to try and start an argument!!!!

Thanks very much for all comments - very helpfull. I am clear of all point now and agree fully.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cradle point vpn to sonicwall 5 125
F5 SSL Sticky Load Balancing Question 3 65
CISCO Smartnet agreement 5 67
NAS ISCSI Sharing 8 42
Hi there, This article summarizes what you need if you are going to set up your home or small business Network Attached Storage (NAS) to be accessible from the internet. Of course there are configuration differences based on your NAS or router ma…
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question