Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!asylum.sf.ca.us!root From: root@asylum.sf.ca.us (Super user) Newsgroups: comp.protocols.tcp-ip Subject: Beginner's info TCP & UDP Message-ID: <9007190124.AA11998@asylum.sf.ca.us> Date: 19 Jul 90 08:24:12 GMT References: <81247@srcsip.UUCP> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: romkey@asylum.sf.ca.us Organization: The Internet Lines: 33 UDP has a lot less overhead than TCP. For simple transaction-based protocols (request-response) that don't carry much data, UDP is much simpler to use. TCP would have the additional overhead of setting up and tearing down its connection, whereas UDP sends the request and response and doesn't care about the ret. In request-response protocols based on UDP, you have to worry about three main things: what happens if a packet gets lost (solution: set a timer and retransmit), what happens if you resend the request and its action gets duplicated (solution: be careful about your protocol design, or put sequence numbers in the packets), and what happens if your data doesn't all fit in one packet (solution: IP fragmentation, or split it across packets, or you lose). Splitting data across UDP packets is often a good reason to start using TCP, since it already has a lot of mechanism in it for dealing with this issue. Not many applications use UDP for transferring lots of data. Those applications are normally TCP-based. However, UDP is very convenient for applications wishing to use a bulk data transport protocol with different behaviour from TCP. This kind of work would be mostly experimental, though. SNMP, the main network management protocol for the Internet, is layered on top of UDP. One advantage to this is that it allows those vendors that might provide SNMP in their products that would otherwise have no (IP) protocol stack (like an ethernet hub) to include SNMP without having to implement a full TCP. While getting a TCP implementation running today is easier than it was several years ago, UDP is orders of magnitude simpler. - john romkey USENET/UUCP: romkey@asylum.sf.ca.us Internet: romkey@ftp.com "There is no loyalty except loyalty to the party. There is no love except love of Big Brother. All competing pleasures we will destroy." - 1984 (film)