In many online games, however, we may be less concerned that every packet arrives on timeor in order. Consider for example a series of packets, each of which tells us where an enemyplayer is located. If one of these packets does not arrive (or arrives late) the information isnow out of date anyway, and there is no point in having the sender resend the packet. Ofcourse, some information is of a much more important nature. Information about paymentsor certain changes to the discrete state of the game (player X is no longer in the game), mustbe communicated reliably. In short, not all information in a game is of equal importance withrespect to reliability.Lecture 226Spring 2018
CMSC 425Dave Mount & Roger EastmanCommunication reliability is handled by protocols at the transport level of the OSI model.The two most common protocols are TCP (transmission control protocol) and UDP (userdatagram protocol).Transmission Control Protocol:We will not delve into the details of the TCP protocol, butlet us highlight its major elements. First, data are transferred in a particular order. Eachpacket is assigned a uniquesequence number. When packets are received, they are reorderedaccording to these sequence numbers. Thus, packets may arrive out of order without affectingthe overall flow of data. Also, through the use of sequence numbers, the receiver can determinewhether any packets were lost. Second, the transmission containscheck-sums, to ensure thatany (random) corruption of the data will be discovered. The receiver sends acknowledgmentsof the receipt of packets. Thus, if a packet is not received, the sender will discover this andcan resend it.TCP also has a basic capability forflow control. If the sender observes that too many packetsare failing to arrive, it decreases the rate at which it is sending packets. If almost all packetsare arriving, it slowly increases this rate.In this way, the network will not become toocongested.Advantages:•Guaranteed packet delivery•Ordered packet delivery•Packet check-sum checking (basic error detection)•Transmission flow controlDisadvantages:•Point-to-point transport (as opposed to more general forms, like multi-cast)•Bandwidth and latency overhead•Packets may be delayed to preserve orderTCP is used in applications where data must be reliably sent and/or maintained in order.Since it is a reliable protocol, it can be used in games where latency is not a major concern.User Datagram Protocol:UDP is a very light-weight protocol, lacking the error control andflow control features of TCP. It is aconnectionless protocol, which provides no guarantees ofdelivery. The sender merely sends packets, with no expectation of any acknowledgment. Asa result, the overhead is much smaller than for TCP.