Contents

TCP/IP | Backend 101

What’s TCP/IP

Internet protocol suite1

The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria.

/blog/posts/2022/tcpip-backend-101/foundational-protocols.png
foundational-protocols
The foundational protocols in the suite are

In the development of this networking model, early versions of it were known as the Department of Defense (DoD) model because the research and development were funded by the United States Department of Defense through DARPA.

The Internet protocol suite provides end-to-end data communication specifying how data should be packetized, addressed, transmitted, routed, and received.

featured-image.png
tcp-ip-model
This functionality is organized into four abstraction layers, which classify all related protocols according to each protocol’s scope of networking.[1][2] An implementation of the layers for a particular application forms a protocol stack. From lowest to highest, the layers are

How They Work

  • Pysical -> Data Link

    0/1 Data to Frame (Ethernet Protocol)

    Header: Mac Address
    IP-Packet: Data
    Trailer: Error Checking Data
    
    • Mac Address: A3:12:56:B5:95:7F

    • IP Address:

      1
      2
      
      192.168.1.3
      (11000000-10101000-10000000-00000000)
      
  • Transport

    In the world of Internet protocol traffic, consumers can choose between a TCP or UDP setup for their business or personal use. When it comes to TCP vs UDP features and functions, each brings its own set of advantages and challenges.

    What is TCP?

    Transmission Control Protocol (TCP) is connection-oriented.

    Once a connection has been established, data can be transmitted in two directions.

    TCP has built-in systems to check for errors and to guarantee data will be delivered in the order it was sent, making it the perfect protocol for transferring information like still images, data files, and web pages.

    But while TCP is instinctively reliable, its feedback mechanisms also result in a larger overhead, translating to greater use of the available bandwidth on your network.

    1
    2
    3
    4
    5
    
    Sender TCP ---Connection Request---> Receiver TCP
    Sender TCP <----------ACK---------- Receiver TCP
    Sender TCP ----------ACK----------> Receiver TCP
    
    # Three-way Handshake
    

    What is UDP?

    User Datagram Protocol (UDP) is a simpler, connectionless Internet protocol wherein error-checking and recovery services are not required. With UDP, there is no overhead for opening a connection, maintaining a connection, or terminating a connection.

    Data is continuously sent to the recipient, whether or not they receive it.

    Although UDP isn’t ideal for sending an email, viewing a webpage, or downloading a file, it is largely preferred for real-time communications like broadcast or multitask network transmission.

    What is the Difference Between TCP and UDP?

    /blog/posts/2022/tcpip-backend-101/TCP-vs-UDP.png
    TCP-vs-UDP

    TCP is a connection-oriented protocol, whereas UDP is a connectionless protocol.

    A key difference between TCP and UDP is speed, as TCP is comparatively slower than UDP. Overall, UDP is a much faster, simpler, and efficient protocol, however, retransmission of lost data packets is only possible with TCP.

    Another notable discrepancy with TCP vs UDP is that TCP provides an ordered delivery of data from user to server (and vice versa), whereas UDP is not dedicated to end-to-end communications, nor does it check the readiness of the receiver (requiring fewer overheads and taking up less space).

  • Application2

    The application layer is the highest abstraction layer of the TCP/IP model that provides the interfaces and protocols needed by the users. It combines the functionalities of the session layer, the presentation layer and the application layer of the OSI model.

    • The functions of the application layer are −

      • It facilitates the user to use the services of the network.
      • It is used to develop network-based applications.
      • It provides user services like user login, naming network devices, formatting messages, and e-mails, transfer of files etc.
      • It is also concerned with error handling and recovery of the message as a whole.
    • This layer uses a number of protocols, the main among which are as follows −

      • Hyper Text Transfer Protocol, HTTP − It is the underlying protocol for world wide web. It defines how hypermedia messages are formatted and transmitted.
      • File Transfer Protocol, FTP − It is a client-server based protocol for transfer of files between client and server over the network.
      • Simple Mail Transfer Protocol, SMTP − It lays down the rules and semantics for sending and receiving electronic mails (e-mails).
      • Domain Name System, DNS − It is a naming system for devices in networks. It provides services for translating domain names to IP addresses.
      • TELNET − It provides bi-directional text-oriented services for remote login to the hosts over the network.
      • Simple Network Management Protocol, SNMP − It is for managing, monitoring the network and for organizing information about the networked devices.

More to read

  1. TCP vs. UDP: What’s the Difference? - Lifesize
  2. (20) 2018 Network Programming Basics #01 Quick Understanding Network Protocol (1) - YouTube
  3. (20) 2018 Network Programming Basics #02 Quick Understanding Network Communication Protocol Part2 - YouTube