For clients and servers to communicate, they need a common protocol. Most networks today used TCP/IP, so there is no problem. There is a problem if clients and servers do not have a common protocol.
To support different client types a server can support multiple protocols as shown below. To connect to different server types a client can support multiple protocols.
Each protocol has a packet header with fields to provide whatever functionality is required for that protocol. The highest layer protocol has application data as in the example of a HTTP packet sending a web page. Lower layer protocols have the higher layer packet as data. Each protocol layer encapsulates the higher layer packet until they are put into an Ethernet frame which can be sent on the cable as a bit stream.
TCP/IP is a suite of protocols. Some of the component protocols are shown in the following diagram.
TCP is a connection oriented protocol that establishes a virtual circuit before it sends data. It is designed to ensure that we have a connection to the destination before we send data just as you do with a telephone conversation. When large amounts of data are exchanged, TCP is normally used. TCP uses sequence numbers and acknowledgements to ensure that no data is lost.
UDP is a connectionless protocol that provides a datagram service. Data is sent and no acknowledgement is required. It provides a best-effort service and does not retransmit lost data. It is used for sending small amounts of data and broadcasts where loss of data is not a serious problem. It is like sending junk mail, where if the junk mail is lost, you will be sent another message in the near future.
TCP Window Size
Traditionally network protocols exchanged information and acknowledgements in a pin-pong fashion. Although the data get through, delays accumulate and performance is poor. TCP supports the transfer of more than one packet for each acknowledgement through a process known as a sliding window. The bigger the window size the fewer acknowledgements are sent. If the window is too large, there will be too much unnecessary traffic after a server failure. In general, a smaller widow size is appropriate for slow WAN Wide-Area Networks, and a larger windows size should be used for high speed LANs.
To optimize the TCP Windows Size, use Network Monitor to observe typical network traffic. If the number of replies fills the TCP windows, then your performance is limited by the TCP window size and it should be increase. If the number of replies is less then the TCP windows size, then increasing the size will have no benefit.
The TCP windows size is set in the registry key
Software sorts out protocol packets by checking encoded fields. The EtherType field indicates which protocol is encapsulated within the Ethernet data field. EtherType=0800 indicates IP and EtherType=0806 indicates ARP. Similarly the protocol field in IP indicates which transport protocol is used, e.g. TCP or UDP. TCP and UDP have port numbers which are used to identify application services. The following diagram shows shows how packets are encoded on the server and decoded on a client.