Solved

500: UDP TCP direction and duplex

Posted on 2007-03-21
9
2,531 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
9 Comments
 
LVL 4

Accepted Solution

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

Assisted Solution

by:calvinetter
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
0
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 
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 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.
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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Hello All, I have been training on Multicast for a while now and whenever I start the topic , I find out that my friends /  Colleagues mention that they do not know how to test Multicast Joins. As most of the multicast would be video traffic and …
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…
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 (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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now