TCP & Udp
TCP & Udp
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:
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 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
unlikely.
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.