LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   About TCP / UDP (https://www.linuxquestions.org/questions/linux-newbie-8/about-tcp-udp-443671/)

shipon_97 05-10-2006 10:22 PM

About TCP / UDP
 
Friends ,

I have some confused about TCP and UDP protocol .

Suppose i have two computer which are connected using UTP Cable. Since TCP is "connection-oriented" and UDP is "Connectionless" protocol . So i think two pc is connected using only TCP protocol . Am i right ? My question is , in this
condition Can UDP protocol is used in the above two pc's ?

My another question is :

When two different Network are connected using switch or Hub (Like a Intranet)then for transmitting data from One network to another network , which protocol and which ports may can be used between these different two networks ?

Plz kindly inform me...............Thx...

haertig 05-10-2006 10:50 PM

I think your questions indicate you would benefit greatly from a book or online tutorial on networking basics. I would recommend searching Google using terms like "networking", "basic", "tutorial", "howto", "tcp/ip", etc.

You need a basic concept of how a network operates before you can understand what you might be told here. This is not something you appear to be cognisant of, and I doubt it could be easily taught in an online forum like this one. For one, "connection-oriented" vs. "connection-less" as used to describe TCP and UDP protocols has absolutely nothing to do with a physical cable "connecting" the two computers together. Concepts like this are better covered by reading a tutorial than by a question/answer format like a forum. You don't even know what questions to ask yet. I'm not saying this to put you down - I'm trying to come up with the best way to help you.

redhatrosh 05-10-2006 11:02 PM

Quote:

Originally Posted by shipon_97
Friends ,

I have some confused about TCP and UDP protocol .

Suppose i have two computer which are connected using UTP Cable. Since TCP is "connection-oriented" and UDP is "Connectionless" protocol . So i think two pc is connected using only TCP protocol . Am i right ? My question is , in this
condition Can UDP protocol is used in the above two pc's ?

When two computers are connected using a UTP cable, they are just "physically connected". You don't determine the protocol by which they are connected. Rather, the physical medium just possesses, physical properties of transmitting signals through it.

The protocol comes at an abstraction layer of the systems. The transport layer in the TCP/IP protocol suite, is the one who handles the protocol communication deciding on which one to use, which in turn is guided by an application requiring access to a network resource or sending data to a network device.

The application would issue commands to the system as to which protocol should be used for communication and what kind of transmission is required between the systems.

UDP or TCP protocol can be used between the two systems, based on what is required to be done by an application.

For example, a FTP Server running on one and the client running on other would require a TCP connection, to ensure that all the packets of the transmission reach safely and completely.

UDP protocol are more commonly used to broadcast things, and are used in real world for Streaming applications, like Internet Radio / Playing songs online etc.

Quote:

Originally Posted by shipon_97
My another question is :

When two different Network are connected using switch or Hub (Like a Intranet)then for transmitting data from One network to another network , which protocol and which ports may can be used between these different two networks ?

Plz kindly inform me...............Thx...

It again depends on what kind of networks they are. There are a few protocols associated with routing the data but I don't have the exact details. Most interior networks Routing Information Protocol (RIP) and Open Shortest Path First(OSPF) are used.
I'll get details about this and you too can get from the following books:

1."Data Communication and Networking" 2nd Edition Behrouz A Forouzan
2."Computer Networks" 4th Edition Andrew S. Tanenbaum
3. "TCP/IP Protocol Suite" 2nd Edition Behrouz A Forouzan
4. "Data and Computer Communications" Sixth Edition William Stallings

Amuro-Ray2020 05-10-2006 11:35 PM

More simply put, TCP and UDP are protocols. They have nothing to do with the physical media (your cord). They simply allow for data transfer. TCP uses something akin to the "Three-way handshake", which means it relies on a SYN, ACK, SYN-ACK process.

Say a computer wanted to communicate something using TCP to a server. First the computer would send a request for SYNchronization, then the server would respond with a ACKnowledgement, and the computer would respond to the ACKnowledgement with a SYNchronization ACKnowledgement.

With UDP, this process is skipped to improve throughput. As redhatrosh mentioned, it is mostly used when streaming data. There is no three-way handshake, thus it is connectionless, since no real acknowledgements are made to synchronization. This is why you will sometimes notice gaps in video or audio streamed to your computer through the internet.

hariharan.v 06-24-2012 04:54 AM

I need to tell you one thing, if you want TCP to connect with UDP .. its very good

But there are problems like UDP is a broadcasting protocol where TCP weekens, but you can do by using signals ..

There must be some interrupts to work on efficient way

chrism01 06-24-2012 06:22 PM

Quote:

if you want TCP to connect with UDP .. its very good
As per higher up comments, UDP and TCP are different protocols, therefore this statement makes no sense.

Try these links
http://beej.us/guide/bgnet/
http://www.kohala.com/start/
http://www.linuxtopia.org/online_boo...ide/index.html


All times are GMT -5. The time now is 04:10 AM.