DEV Community

loading...

Tcp, Udp, Http

PHAGUN JAIN
I am a learner, hyped to contribute in the world of open source also I m intrested in blockchain and fascinated how its growing, various innovations in space like polygon, chainlink excites me!!!
・2 min read

Many times while learning about web applications and application architcture, it is common to get across some basic concepts related to computer networks, I got across terms "tcp/udp" "http/https" "ssl/tls" quite a lot and realised that i dont understand these terms correcltly, 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 :}

Introduction

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 a data from one computer to another into 7 layers task, 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 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 so i was confused, after some reading online i realized http and tcp are not alternatives, These protocols work in two different layers. Infact, HTTP needs some transport layer protocol.

what is http?

HTTP is a Hypertext Transfer Protocol. It works in the layer 7 or 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 4 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.

now where tcp ensures that all the packets are received by retransmitting any defected of lost packets sometimes this is not required then udp comes in to picture it does not retransmit the dropped packets thus ensuring fast delivery hence when the requirement is of fast delivery rather than of ensuring everything is deliverd udp is preferred.

that's it thanks for reading :)

Discussion (0)