Standard protocols, TCP/IP stack and sockets
Posted in Computing, Networking conceptsStandard protocols
For any two computers in any network to communicate they must obey a common set of rules about how to communicate successfully. For example, how to start and finish networked communications. These pre-agreed signals, codes and rules for data transmission are known as a network protocol.
A standard protocol is a protocol which conforms to a standard laid down by a standards authority (e.g. IOS) to allow data exchange between any computer which conforms to the same standard
TCP/IP Protocol stack
The Transmission Control Protocol/Internet Protocol is the most common standard protocol. The need for a standard protocol is that it allows computers from allow over the world, made by different companies, running different software to communicate successfully which one another. TCP/IP is a collection of protocols and so is often (correctly) called a protocol suite.
The TCP/IP protocol stack is split into 4 layers
Application layer
The application layer provides applications with access to the services of the other 3 layers and defines the protocols that applications use to exchange data. Such protocols in this layer include HTTP, Telnet, FTP and SMTP
Transport layer
The transport layer splits the data passed to it from the application for the network layer, below, to send. The transport layer uses the TCP and UDP protocols. The TCP is a reliable, connection-oriented protocol - it provides error checking, is responsible for acknowledgment of packets sent and can retransmit packets if required. UDP is an unreliable, connectionless protocol - it provides easy transmission for small pieces of data which may only require a single packet.
Network layer
The network layer is responsible for addressing, packaging, sequencing and routing functions of the TCP/IP suite. This network layer uses the internet protocol which is fast but unreliable, it rests on the assumption that the other protocols used ensure reliable delivery of data.
Data link layer
The data link layer handles the physical details of interfacing with the cable. It is responsible for placing TCP/IP packets on the cable and receiving them.
Sockets
A socket allows communication between two processes running on different computers connected by a TCP/IP network. Sockets can also connect an application to a network protocol, such as TCP/IP. A Datagram socket allows a computer to send a single message whilst a stream socket supports continual data exchange between the two processes.