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.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
small, multi network, problem 3 95
LaserJet 4250 5 50
VOIP: SIP vs. proprietary Broadview Networks Silnet ?? 12 121
server DNS address could not be found 22 184
When posting a question about a Cisco ASA, Cisco Router or Cisco Switch, it can aid diagnosis if a suitably sanitised copy of the config is provided. It is much better to leave as much of the configuration as original as possible, as it could be tha…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
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…

773 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