Académique Documents
Professionnel Documents
Culture Documents
Network protocols: defines rules and conventions for communication between network devices.
Network protocols include mechanisms for devices to identify and make connections with each other,
as well as formatting rules that specify how data is packaged into messages sent and received. Some
protocols also support message acknowledgement and data compression designed for reliable and/or
high-performance network communication. Hundreds of different computer network protocols have
been developed each designed for specific purposes and environments.
Transport layer: The transport layer is the fourth layer of the OSI reference model. It provides
transparent transfer of data between end systems using the services of the network layer .The
end-user cannot control what is in the network. So the end-user establishes another layer, only
at end hosts, to provide a transport service that is more reliable than the underlying network
service.
Transport layer protocols: the most important and common protocols of transport layers are:
TCP :
Function: As a message makes its way across the internet from one computer to another. This is
connection based
Usage: TCP is suited for applications that require high reliability, and transmission time is
relatively less critical.
Ordering of data packets: TCP rearranges data packets in the order specified.
Reliability: There is absolute guarantee that the data transferred remains intact and arrives in the
same order in which it was sent.
Weight: TCP is heavy-weight. TCP requires three packets to set up a socket connection,
before any user data can be sent. TCP handles reliability and congestion control.
Data Flow Control: TCP does Flow Control. TCP requires three packets to set up a socket
connection, before any user data can be sent. TCP handles reliability and congestion control.
UDP:
Acronym for: User Datagram Protocol or Universal Datagram Protocol.
Usage: UDP is suitable for applications that need fast, efficient transmission, such as
games. UDP's stateless nature is also useful for servers that answer small queries from huge
numbers of clients.
Ordering of data packets:UDP has no inherent order as all packets are independent of
each other. If ordering is required, it has to be managed by the application layer.
Reliability: There is no guarantee that the messages or packets sent would reach at all.
Streaming of data: Packets are sent individually and are checked for integrity only if they
arrive. Packets have definite boundaries which are honored upon receipt, meaning a read
operation at the receiver socket will yield an entire message as it was originally sent.
Data Flow Control: UDP does not have an option for flow control.
Acknowledgement: No Acknowledgment.
Web browsing, email and file transfer are common applications that make use of TCP. TCP
is used to control segment size, rate of data exchange, flow control and network
congestion. TCP is preferred where error correction facilities are required at network
interface level. UDP is largely used by time sensitive applications as well as by servers that
answer small queries from huge number of clients. UDP is compatible with packet
broadcast - sending to all on a network and multicasting – sending to all subscribers. UDP is
commonly used in Domain Name System, Voice over IP, Trivial File Transfer Protocol and
online games.
TCP vs. UDP for game servers:
For massively multiplayer online (MMO) games, developers often have to make an
architectural choice between using UDP or TCP persistent connections. The advantages
of TCP are persistent connections, reliability, and being able to use packets of arbitrary
sizes. The biggest problem with TCP in this scenario is its congestion control algorithm,
which treats packet loss as a sign of bandwidth limitations and automatically throttles
the sending of packets. On 3G or Wi-Fi networks, this can cause a significant latency.
A lot of people ask this question and think in these terms, but here’s a
different point of view. TCP and UDP are not at the same level of
abstraction and they’re not really competitors.
The most popular way to do that is to use TCP, the Transmission Control
Protocol. TCP runs on top of “best-effort datagram service” and turns that
into a “bidirectional reliable ordered byte stream” between applications.
An application provides TCP with a sequence of bytes, and TCP guarantees
that it will deliver them to the remote computer accurately and in order, if
they get there at all. TCP provides this not “ to a computer” but “between
applications” — meaning TCP has another level of addressing that keeps
track of which application the stream belongs to (i.e. a port number).
To do this, the OS provides UDP — the “user” datagram protocol. It’s just
like IP, in that the service is best-effort datagram’s, but instead of
delivering those datagrams “to a computer,” there’s an added layer of
addressing that says which application is interested in them (and like TCP,
UDP does this with a port number).
TCP is one of those protocol, and it can run on top of IP datagrams (as is done typically) or UDP
datagrams, in the case of applications like MixApp that don’t want to use the operating
system’s “default” implementation of TCP.
In addition to TCP, there are plenty of other protocols that run on top of “best-effort datagram
service” — e.g. Skype, BitTorrent (LEDBAT), the Web (QUIC and WebRTC), Mosh (SSP), Bonjour
(mDNS), and NTP. These all run over UDP because they want to provide different kinds of
abstractions or different performance characteristics than TCP does.