When two processes communicate over TCP, it is as if there was a pipe between the two processes. This pipe remains
in place until one of the two processes close it. When one of the processes wants to send some bytes to the other process,
it simply inserts the bytes into the pipe. The sending process does not have to attach a destination address to the
bytes because the pipe is logically connected to the sedtination. The pipe provides a reliable byte stream channel--the
sequence of bytes received by the receiving process is exactly the sequence of bytes that the sender inserted into the pipe.
UDP also allows two (or more) processes running on different hosts to communicate. UDP differs from TCP in many
fundamental ways. First, UDP is a connectionless service--there isn't an initial handshaking phase during which a pipe
is established between the two processes. Because UDP doesn't have a pipe, when a process wants to send a batch of bytes
to another process, the sending process must attach the destination process's address to the batch of bytes.
|