Tuesday, March 31, 2020

TCP/IP

The TCP/IP model describes a set of general design guidelines and implementations of specific networking protocols to enable computers to communicate over a network.  TCP/IP provides end-to-end connectivity specifying how data should be formatted, addressed, transmitted, routed and received at the destination.  Protocols exist for a variety of different types of communication services between computers.

TCP/IP has 4 abstraction layers: Application, Transport, Internet and Link.




Application layer:
The Application layer refers to the higher-level protocols used by most applications for network communication.  Examples of application layer protocols include HTTP, FTP, SMTP, DHCP, NFS, Telnet, SNMP and POP3.  Data coded according to application layer protocols are then encapsulated into one or more transport layer protocols such as TCP or UDP which in turn use lower layer protocols to establish and effect actual data transfer.
Transport layer:
The Transport layer's responsibilities include end-to-end message transfer capabilities independent of the underlying network, along with error control, segmentation, flow control, congestion management, and application addressing through port specifics.  End to end message transmission or connecting applications at the transport layer can be categorized as either connection-oriented, implemented in TCP, or connectionless, implemented in UDP.

The Transport layer can be thought of as a transport mechanism, as a vehicle with the responsibility to make sure its contents (passengers/goods) reach their assigned destination safe and sound unless another protocol layer is responsible for safe delivery.


Internet layer:
The Internet layer solves the problem of sending packets across one or more networks.  Internetworking requires sending data from the source network to the destination network.  This process is called routing.

In the Internet protocol suite, the Internet Protocol performs two basic functions:
Host addressing and identification:  This is accomplished with a hierarchical addressing system (using IP addresses)
Packet routing: This is the basic task of getting packets of data (datagrams) from source to destination by sending them to the next network node (router) closer to the final destination.


Link layer:
The Link layer is the networking scope of the local network connection to which a host is attached.  This is the lowest component layer of the Internet protocols, as TCP/IP is designed to be hardware independent.  As a result TCP/IP is able to be implemented on top of virtually any hardware networking technology.

The Link layer is used to move packets between the Internet layer interfaces of two different hosts on the same link.  The processes of transmitting and receiving packets on a given link can be controlled in the software device driver for the network card.  These will perform data link functions such as adding a packet header to prepare it for transmission, then actually transmit the frame over a physical medium.  The TCP/IP model includes specifications of translating the network addressing methods used in the Internet Protocol to data link addressing such as Media Access Control MAC.

The Link layer is also the layer where packets may be selected to be sent over a virtual private network or other networking tunnel.  In this scenario, the Link layer data may be considered application data which traverses another instantiation of the IP stack for transmission or reception over another IP connection.




TCP:
Transmission Control Protocol (TCP) takes large blocks of information from an application and breaks them into segments.  It numbers and sequences each segment so that the destination's TCP stack can put the segments back into the order the application intended.  After these segments are sent on the transmitting host, TCP waits for an acknowledgement of the receiving end's TCP virtual circuit session, retransmitting any segments that are not acknowledged.

Before a transmitting host starts to send segments down the model, the sender's TCP stack contacts the destination's TCP stack to establish a connection.  This creates a virtual circuit, and this type of communication is known as connection-oriented.  During this initial handshake, the two TCP layers also agree on the amount of information that's going to be sent before the recipient's TCP sends back an acknowledgement.   With everything agreed upon in advance, the path is paved for reliable communication to take place.

TCP is a full-duplex, connection-oriented, reliable, and accurate protocol, but establishing all these terms and conditions, in addition to error checking, is no small task.  TCP is very complicated, and so, not surprisingly, it's costly in terms of network overhead.  And since today's networks are much more reliable than those of yore, this added reliability is often unnecessary.  Most programmers use TCP because it removes a lot of programming work, but for real-time video and VoIP, User Datagram Protocol (UDP) is often better because using it results in less overhead.

No comments:

Post a Comment