You are on page 1of 1

TCP (Transmission Control Protocol)

Connection-oriented, reliable, full-duplex, byte-stream service. In other words, exactly

what most applications (and application programmers) want.

Byte stream means that message boundaries don't exist. The receiving process can't tell
how the data was written by the sending process. This makes application protocols a little
trickier, since the demarkations of application messages must be in the data itself.

TCP handles:

• establishment and termination - setting up the connection

• sequencing of data
• end-to-end reliability (checksums, acks, timeouts)
• end-to-end flow control via a sliding window algorithm

Data is buffered at the TCP layer, since it must be delivered to the app in reliable,
sequenced chunks. This buffering can be defeated for urgent data. This is know as "out
of band" data.

The TPDUs are called segments by TCP. Each segment has data plus a 20 byte header,
and winds up being sent by one or more IP datagram. The segments may be up to 64k
bytes (but are usually much smaller) and must be reassembled into the original data
stream when they are received

UDP (User Datagram Protocol)

Connectionless, unreliable, datagram service. Note that unreliable does not refer to the
presence of undetected errors (data integrity is guaranteed, but delivery and sequence is
not). A very thin veneer on top of IP. Lower overhead both for header and for time (no
connection set-up).

UDP is a good match to applications that don't need reliability, for example SNMP, DNS.
Or for those in which the environment is clean and small (LAN) so that errors are quite

UDP packets may be corrupted in transit, lost due to congestion in a router, lost due to
buffer overrun in the receiver's buffer. In all cases their is no indication given to the
sending process. Packets just disappear.