81. Protocol
A protocol is a set of rules or agreed upon guidelines for communication. When communicating, it is important to agree on how to do so. If one party speaks Indian and one German the communications will most likely fail. If they both agree on a single language, communications will work. On the Internet the set of communications protocols used is called TCP/IP. TCP/IP is actually a collection of various protocols that each has their own special function or purpose. These protocols have been established by international standards bodies and are used in almost all platforms and around the globe to ensure that all devices on the Internet can communicate successfully. For purposes of the MCPP, a communications protocol is the set of rules for information exchange to accomplish pre-defined tasks between a client computer and server computer connected by a network. These rules govern the format, semantics, timing, sequencing and error control messages exchanged over a network.
A protocol is a set of RULES recognized by the Network resources, like Servers, Network Devices like Switches, Hubs, and Routers. Etc. for example HTTP is a protocol that is used for sending HTML web pages. FTP (File Transfer) is a protocol for downloading files over network. If 2 PCs communicate with each other with HTTP rules, they are actually requesting or sending web page files from their hard drives. But if the 2 PCs communicate with their FTP ports using FTP protocol, they are actually requesting or sending normal files e.g. pix from their hard drives to each other. There are many protocols in networking because there are many different types of communication between 2 PCs. HTTP over IE or FTP over download software are 2 very common ones. Just like the rules for transferring goods between 2 countries that's done by two shipping companies. The 2 shipping companies communicate with each other through specific Shipment rules or protocols.
For example, in Java (where protocols are termed interfaces), there is the Comparable interface specifies a method compareTo() which implementing classes should implement. So, this means that a separate sorting method, for example, can sort any object which implements the Comparable interface, without having to know anything about the inner nature of the class (except that two of these objects can be compared by means of compareTo()). The protocol is a description of: the messages that are understood by the object, the arguments that these messages may be supplied with, and the types of results that these messages return, the invariants that are preserved despite modifications to the state of the object, the exceptional situations that will be required to be handled by clients to the object. If the objects are fully encapsulated then the protocol will describe the only way in which objects may be accessed by other objects.
Some programming languages directly support protocols or interfaces (Objective-C, Java, C#, D, Ada, and Logtalk). Older languages may also have features that can support the interface concept, such as abstract base classes with pure virtual functions in C++, or object-oriented features in Perl. Note that functional programming and distributed programming languages have a concept which is also called a protocol, but whose meaning is subtly different (i.e. a specification of allowed exchanges of messages, emphasis on exchanges, not on messages). This difference is due to somewhat different assumptions of functional programming and object-oriented programming paradigms. In particular, the following are also considered as part of a protocol in these languages: The allowed sequences of messages, Restrictions placed on either participant in the communication, Expected effects that will occur as the message is handled.
Sunday, March 1, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment