DEV Community 👩‍💻👨‍💻


Posted on • Updated on

Tcp, Udp, Http

Many times while learning about web applications and application architecture, it is common to get across some basic concepts related to computer networks, I got across the terms "TCP/UDP" "HTTP/HTTPS" "SSL/tls" quite a lot and realized that I don't understand these terms correctly, so as a result of re-learning those terms related to networking am writing this post this is more of a revision note for myself :}


before starting it will be great to mention about OSI model
OSI model is a set of standardized rules that specifies the communication functions of a computer networking system. This model divides the transfer process of data from one computer to another into 7 layers tasks, such that each layer serves to the next layer of completing the required task.

Layer Architecture

  • Layer 1: Physical Layer
  • Layer 2: Data Link Layer
  • Layer 3: Network Layer
  • Layer 4: Transport Layer
  • Layer 5: Session Layer
  • Layer 6: Presentation Layer
  • Layer 7: Application Layer

not going in the depth

now, before going to protocols, one doubt I got was:

why are there two protocols like HTTP, and TCP/UDP

And these are mentioned quite often, I was confused after some reading online I realized HTTP and TCP are not alternatives, These protocols work in two different layers. HTTP needs some transport layer protocol.

what is HTTP?

HTTP is a Hypertext Transfer Protocol. It works in layer seven or the application layer and it fetches resources such as HTML documents. It is used for exchanging data on the Web and is a client-server protocol which means requests are initiated by the recipient usually the Web browser.
HTTP clients generally use Transmission Control Protocol (TCP) connection to communicate with servers.

what is TCP?

TCP is Transmission Control Protocol. It works in layer four or transport layer it states a connection is established and maintained until the application data at each end have finished exchange. TCP breaks application data into packets. This packet delivers to the transport layer.

Where TCP ensures that all the packets are received by re-transmitting any defected or lost packets sometimes this is not required. Then udp comes in to picture it does not re-transmit the dropped packets thus ensuring fast delivery hence when the requirement is of fast delivery rather than of ensuring everything is delivered UDP is preferred.

that's it thanks for reading :)

Top comments (0)

18 Useful Github Repositories Every Developer Should Bookmark

>> Check out this classic DEV post <<