A - B
understanding TCP
IP is a connectionless
protocol, so it doesn't care whether datagrams ever reach their eventual destination. It
just routes the datagram according to the destination and address and then forgets about
them. This why IP address is called an unreliable protocol.
We know the internet is
reliable (most of times!). So where does this reliability come from if not from IP?it
comes from the rest of TCP/IP equation: TCP. You can think of TCP as IP's better half,
because through TCP, applications can make sure that their data gets where it's supposed
to go and that it arrives there intact.
To help You to visualize
the difference between IP and TCP, imagine IP as analogous can to sending a letter through
the mail. You put the letter in an envelope, address the envelope, and drop it in a
mailbox. You don't know when the letter gets picked up, how it gets to its destination, or
even even whether it gets there. Suppose, however, that after mailing the letter you were
to call up the recipient and tell her that a letter was on its way.You could give
the recipient your telephone number and have her call you when the she receives the
letter. If the letter doesn't arrive after a present length of time, the recipient could
let you know so that you could resend it.
That phone link between you
and the recipient is analogous to what TCP does for data transfer. TCP is a
connection-oriented protocol that sets up a two-way connection channel between the
source and destination to monitor the IP routing.
TCP Sockets
In the TCP scheme of things, this
communication channel is called a socket, and it has two component on each end:
IP address: You know that each IP datagram header includes both source and
destination IP address. For a TCP socket, these addresses are analogous to the sender and
receiver having each other's phone number.
Port number: Having a phone number might not be enough to get in touch with someone.If
the person works in an office, you might have to specify his extension. Similarly knowing
the IP address of a host isn't enough information for TCP. it must know which application
sent the datagram. After all in multitasking environment like you could be running a web
browser, an e-mail client, and FTP program all at the same time. To differentiate between
programs, TCP uses a 16-bit number called port that uniquely each running process.
Some ports
are fixed, the port number usually specifies an application, but it's more likely that the
is a fixed number used by an internet service. For example FTP uses port 21, Telnet uses
port 23 and HTTP uses port 80. |