[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

500: UDP TCP direction and duplex

Posted on 2007-03-21
9
Medium Priority
?
3,056 Views
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.
BUT....is 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
0
Comment
Question by:smotbd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 4

Accepted Solution

by:
davystocks earned 500 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.  
0
 

Author Comment

by:smotbd
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
0
 

Assisted Solution

by:lourite
lourite earned 500 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.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 20

Assisted Solution

by:calvinetter
calvinetter earned 500 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
0
 
LVL 22

Expert Comment

by:blu
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.
0
 

Author Comment

by:smotbd
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:
http://www.sockets.com/winsock.htm 
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).
0
 
LVL 22

Assisted Solution

by:blu
blu earned 500 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.
0
 
LVL 22

Expert Comment

by:blu
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?
0
 

Author Comment

by:smotbd
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.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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 …
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), 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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

656 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