|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all ,
I am new to this group . A basic question.I want to know what is a difference b/w TCP and UDP packet i.e how will u know that the data which u are receiving is travelling via a UDP/TCP packet without using any sniffer. ankit |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Go through this link:
http://www.iana.org/assignments/port-numbers ankitjain.bvcoe@gmail.com wrote: > Hi all , > I am new to this group . > A basic question.I want to know what is a difference b/w TCP and UDP > packet i.e how will u know that the data which u are receiving is > travelling via a UDP/TCP packet without using any sniffer. > > ankit |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
In article <1149664377.664911.123520@g10g2000cwb.googlegroups .com>,
ankitjain.bvcoe@gmail.com wrote: > Hi all , > I am new to this group . > A basic question.I want to know what is a difference b/w TCP and UDP > packet i.e how will u know that the data which u are receiving is > travelling via a UDP/TCP packet without using any sniffer. When an application opens a network socket, it has to specify whether it's using TCP or UDP (or something else). So it won't get a TCP packet if it's listening for UDP, and vice versa. So the problem you describe doesn't exist unless you're using raw sockets. If that's the case, you look at the protocol field in the IP header -- if it's 6 then it's TCP, if it's 17 it's UDP. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
ankitjain.bvcoe@gmail.com wrote: > Hi all , > I am new to this group . > A basic question.I want to know what is a difference b/w TCP and UDP > packet i.e how will u know that the data which u are receiving is > travelling via a UDP/TCP packet without using any sniffer. > > ankit The command: netstat -a Shows you the current TCP connections (and its corresponding state) and also UDP ports that your computer is listening to. It is clear that, since UDP does not stablish a connection (since it is not connection oriented) it is not possible to detect "open connections" in an UDP transmission. So mainly, TCP will send syncs to inform that a connection is required, and given that TCP provides reliability, its packets will be larger due to the information included in the headers. UDP packets are smaller since its objective is efficiency, which can be achieved by reducing the overhead of the information transported by TCP. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
<ankitjain.bvcoe@gmail.com> wrote in message news:1149664377.664911.123520@g10g2000cwb.googlegr oups.com... > Hi all , > I am new to this group . > A basic question.I want to know what is a difference b/w TCP and UDP > packet i.e how will u know that the data which u are receiving is > travelling via a UDP/TCP packet without using any sniffer. > > ankit > As you know, TCP uses 3-way handshake and it's connection oriented; TCP gives guarenteed delivery, flow control and windowing. That's why TCP packets use sequence numbers, acknowledge numbers, etc.; UDP packets don't use sequence numbers. UDP is connectionless, which means best effort delievery. Some of TCP protocols are POP3, SMTP, FTP, HTTP etc. whereas some of UDP protocols are TFTP, DHCP, SNMP etc. new guy ![]() |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
new guy wrote:
> <ankitjain.bvcoe@gmail.com> wrote in message > news:1149664377.664911.123520@g10g2000cwb.googlegr oups.com... >> Hi all , >> I am new to this group . >> A basic question.I want to know what is a difference b/w TCP and UDP >> packet i.e how will u know that the data which u are receiving is >> travelling via a UDP/TCP packet without using any sniffer. >> >> ankit >> > > As you know, TCP uses 3-way handshake and it's connection oriented; TCP > gives guarenteed delivery, flow control and windowing. That's why TCP > packets use sequence numbers, acknowledge numbers, etc.; UDP packets don't > use sequence numbers. UDP is connectionless, which means best effort > delievery. Some of TCP protocols are POP3, SMTP, FTP, HTTP etc. whereas some > of UDP protocols are TFTP, DHCP, SNMP etc. > > new guy ![]() > > UDP is definitely not best effort delivery. That would be TCP. UDP is minimal effort delivery. With UDP the packet is sent once and if it doesn't make, UDP couldn't care less. NM |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
In article <_MWdncduPKGgXxXZnZ2dnUVZ_u2dnZ2d@comcast.com>,
News 2 Me <em2swen@comcast.net> wrote: > new guy wrote: > > <ankitjain.bvcoe@gmail.com> wrote in message > > news:1149664377.664911.123520@g10g2000cwb.googlegr oups.com... > >> Hi all , > >> I am new to this group . > >> A basic question.I want to know what is a difference b/w TCP and UDP > >> packet i.e how will u know that the data which u are receiving is > >> travelling via a UDP/TCP packet without using any sniffer. > >> > >> ankit > >> > > > > As you know, TCP uses 3-way handshake and it's connection oriented; TCP > > gives guarenteed delivery, flow control and windowing. That's why TCP > > packets use sequence numbers, acknowledge numbers, etc.; UDP packets don't > > use sequence numbers. UDP is connectionless, which means best effort > > delievery. Some of TCP protocols are POP3, SMTP, FTP, HTTP etc. whereas > > some > > of UDP protocols are TFTP, DHCP, SNMP etc. > > > > new guy ![]() > > > > > > UDP is definitely not best effort delivery. That would be TCP. UDP is > minimal effort delivery. With UDP the packet is sent once and if it > doesn't make, UDP couldn't care less. That's not how the term "best effort" is normally defined. IP and UDP provide best-effort delivery, while TCP provides guaranteed delivery. See <http://www.linktionary.com/b/best_effort.html> for a good description of these terms. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
"Barry Margolin" <barmar@alum.mit.edu> wrote:
> News 2 Me <em2swen@comcast.net> wrote: >> UDP is definitely not best effort delivery. That would be TCP. UDP >> is >> minimal effort delivery. With UDP the packet is sent once and if it >> doesn't make, UDP couldn't care less. > > That's not how the term "best effort" is normally defined. IP and UDP > provide best-effort delivery, while TCP provides guaranteed delivery. > > See <http://www.linktionary.com/b/best_effort.html> for a good > description of these terms. I know people who insist on redefining "best effort" as "worst effort." The term "guaranteed delivery" is also misleading, unfortunately, as it implies to the clue-challenged that TCP will always get the message across. In truth, all TCP can do is keep retrying something that is having problems getting across. UDP, in certain applications, such as streaming media, actually does this far better than TCP can. Because the very nature of streaming media is that packets are sent continuously, and it's far better (in this streaming media case) to allow an occasional packet to be dropped than to back up the entire queue with TCP retries. If the link is so bad that many UDP datagrams are dropped, then a TCP connection for this stream would be even worse. And, too, one can always build in forward error correction in the UDP datagrams, to alleviate any data corruption problem, potentially making this streaming connection a lot better with UDP than TCP. I think whenever packets are to be sent frequently and periodically, and stale packets are of no use, then UDP is a better choice than TCP, even if errors occur. If messages are only sent "by exception," then TCP is the better choice. Bert |
|
![]() |
| Outils de la discussion | |
|
|