What is the difference between a port and a protocol?
A protocol is an agreement on how to interpret data and how to respond to messages. They generally specify message formats and legal messages. Examples of protocols include:
A port is part of socket end point in TCP and UDP. They allow the operating system to distinguish which TCP or UDP service on the host should receive incoming messages.
The confusion generally arises because, a number of ports are reserved (eg. port 80) and are generally listened to by severs expecting a particular protocol (HTTP in the case of port 80). While messages send to port 80 are generally expected to be HTTP messages, there is nothing stopping an non-HTTP server from listening on port 80 or an HTTP server from listening on an alternative port (for example 8080 or 8088).
A port is just a channel that you select for the communication, and the protocol determines how the communication is done. A certain protocol usually uses a specific port, like port 80 for HTTP, port 21 for FTP.
Port = Place where ships come in
Protocol = How the cargo is loaded on the ship
A protocol is a description of how data is exchanged between systems, usually documented in an RFC document.
For IP networks, a port is a 16-bit number representing a particular service end-point on a server.
Where confusion may arise is that most protocols have a standard port on which they run (i.e. HTTP is usually run on port 80). However that's just convention and isn't mandatory in most cases.
A protocol is a specification for how two devices should exchange data in a way that they can both understand. A port is kind of a numbered 'tag' that helps a computer decide who should receive an incoming piece of data.
Many protocols have a port that they run on by default; this makes it easier to discover them or configure applications that use them. But that's not a hard rule; they could always listen on a different port, as long as anyone contacting them knew about the change.
You can think of a port as a phone extension, with the computer's IP address being like its phone number. You can call the number (IP address) to talk to the computer, then dial the extension (port) to talk to a specific application. An application needs to be listening on a port in order to communicate.
A protocol is just the language that the two applications on either end of a conversation agree to speak in. If your application is sending streams of bytes to my application, my application needs to know how to interpret those bytes.
Everyone is right: my favorite analogy is the one of the ships. Port: where cargo is loaded, Protocol: how the cargo is loaded/unloaded.
This wikipedia article might help you a little.
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
ports = ears, mouth, eyeball, touch
protocols = English, Spanish, Sign Language, Braille
in Simple port means to whom you communicate. & Protocol means how to communicate or way of communication.
Protocol number :- The protocol number is a single byte in the third word of the datagram header. The value identifies the protocol in the layer above IP to which the data should be passed. Port Numbers/Port Address After IP passes incoming data to the transport protocol, the transport protocol passes the data to the correct application process. Application processes (also called network services) are identified by port numbers, which are 16-bit values. The source port number, which identifies the process that sent the data, and the destination port number, which identifies the process that is to receive the data, are contained in the first header word of each TCP segment and UDP packet. atul malviya bhopal