TCP and UDP use the same addressing scheme. An IP address (32 bits number, always written as four 8-bit number expressed as unsigned 3-digit decimal numbers separated by dots such as 188.8.131.52) and a port number (a 16-bit number expressed as a unsigned decimal number).
The IP address is used by the low-level protocol (IP) to route the datagram to the correct host on the specified network. Then the port number is used to route the datagram to the correct host process (a program on the host).
For a given protocol (TCP or UDP), a single host process can exist at a time to receive data sent to the given port. Usually one port is dedicated to one process.
Being stream oriented means that the data is an anonymous sequence of bytes. There is nothing to make data boundaries apparent. The receiver has no means of knowing how the data was actually transmitted. The sender can send many small data chunks and the receiver receive only one big chunk, or the sender can send a big chunk, the receiver receiving it in a number of smaller chunks. The only thing that is guaranteed is that all data sent will be received without any error and in the correct order. Should any error occur, it will automatically be corrected (retransmitted as needed) or the error will be notified if it can't be corrected.
UDP is pretty much the polar opposite of TCP/IP and has certain problems for game development: 1) Your data is not guaranteed to get to its destination. 2) The packets may be received out of order. 3) There is no connection. Now why would we want to use UDP? Simple, it's fast. Because UDP doesn't make any guarantees, all it does is send the packet. There's no overhead making sure it gets there or really anything. But that does mean that we have to deal with lost packets, out of order packets, etc. ourselves. This basically just means that we have to potentially rewrite TCP/IP's functionality, well sometimes anyway. And in cases where you need that reliability, it pretty much gets rid of the speed factor as both will be running in the same manner. However due to the way in which UDP works, it is generally useful for any game type that requires less reliability and more speed.
Being connection-oriented means that before actually transmitting data, you must open the connection between the two end points. The data can be transferred in full duplex (send and receive on a single connection). When the transfer is done, you have to close the connection to free system resources. Both ends know when the session is opened (begin) and is closed (end). The data transfer cannot take place before both ends have agreed upon the connection. The connection can be closed by either side; the other is notified. Provision is made to close gracefully or just abort the connection.
TCP/IP is a great networking protocol and has many things going for it:1) Its reliable. 2) You get the data in order of it being sent. 3) Its connection oriented. This basically means that most of the programming that you would need if you used UDP is done for you, making your job that much easier. For most games, this works perfectly fine but there are some problems. Namely if there is an error in the line you have to wait for TCP/IP to resend the data. In fact you can't send anything else because the data has to be received in order. Another problem, although you can turn it off, is Nagel's algorithm. This basically collects a bunch of smaller packets and then sends them all in one shot. If you're unaware of Nagel's algorithm's existence, this can lead to some disappointing ping times. Also since it is connection oriented its really only fit for client/server applications.
Short for User Datagram Protocol, a connectionless protocol that, like TCP, runs on top of IP networks. Unlike TCP/IP, UDP/IP provides very few error recovery services, offering instead a direct way to send and receive datagrams over an IP network. It's used primarily for broadcasting messages over a network.
Abbreviation of Transmission Control Protocol, and pronounced as separate letters. TCP is one of the main protocols in TCP/IP networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.
In 1974 a UCLA graduate student, Vinton Cerf, and an MIT professor, Robert Kahn, developed the first version of the Transmission Control Protocol/Internet Protocol (TCP/IP) protocols. Over the next 8 years TCP/IP became the standard suite of protocols for inter-computer communications. Although other protocols had strong support at that time, TCP/IP was freely available and was popular at universities. Today, this protocol is the most popular in use.TCP/IP is actually an entire group of protocols working together to provide multiple, interrelated applications and services. Groups of protocols that work together, such as TCP/IP, NetWare's IPX/SPX, and AppleTalk, are known as protocol suites. They are also sometimes referred to as protocol stacks.
In the late 1960's, the United States Department of Defense Advance Research Projects Agency funded research for a prototype internetwork, the ARPANET. The goal was to build a communications system that could withstand a catastrophic nuclear disaster. Another goal was to encourage communications among major research institutions. The original ARPANET connected four different geographical locations. As it grew, it facilitated communications among major research institutions and the military.
Protocols are the rules and procedures that govern communications between devices on a network. Actually, protocols are found throughout the computer, data communications, and network fields. Protocols are used to
define the way in which devices communicate. They govern how a modem and computer communicate, how a video display adapter accesses computer memory, how a file is transferred over the Internet, and how a telephone connects to the telephone network.