Skip to main content

TCP & UDP


TCP stands for "Transmission Control Protocol." it is the special way in which computers talk, communicate and share information. in simple words TCP is used by computers to send and recieve data. Now comes in TCP connections. TCP connection is established between two computers when they want to talk and communicate i.e they want to share data.

In TCP connections there are servers and clients, Imagine the client as a person who wants to ask for something, and the server as the person who provides what the client needs. Clients send requests to the server, asking for information or help. The server, on the other hand, receives the client's request and provides the requested information or service.

Before the client and server start exchanging information, they perform a special handshake. It's like when you meet someone new and say "hello" before you start talking. the client sends the request to establish connection, the server checks it and acknowledges it and allows the communication to begin. Once the handshake is complete, the client and server can start sending data back and forth. the data could be anything, pictures, videos or even text.

thats how TCP works.

UDP

UDP stands for "User Datagram Protocol." it is another special way in which computers talk to each other. just like TCP, UDP helps computers send and recieve data. However, UDP works a little differently than TCP and we will see how. Unlike TCP, UDP doesn't establish a connection between two systems and doesnt wait for acknowledgements between the clients and servers. When one computer sends data using UDP, it doesn't wait for a response from the other computer. It just sends the message and hopes it reaches its destination.

in the case of clients and servers, in UDP clients requests for information and the server just sends the requested information, now this system is fast and simple, why? because there is no need to acknowledge and authenticate the client, hence it can send data more quickly. Now unlike TCP, UDP doesn't guarantee that the message will reach its destination. It's like throwing a message in a bottle into the sea; you hope someone finds it, but there's a chance it might get lost or damaged along the way.

COMPARISON

if we compare TCP and UDP, TCP is slower than UDP in speed but TCP far more securer as it authenticates clients unlike UDP which is fast but does not verify.

Comments

Popular posts from this blog

ARRAYS VS VARIABLES IN PYTHON

Beginners mostly prefer variables over arrays, usually because they dont know the real power of array and they end up wasting time storing bunch of items in tens of variables whereas they can use an array and store all those into one variable ` Why people use variables than array Most programmers when starting out learn how to create variables to store information in as a way to make their program more dynamic. However, when they start writing a program, they soon find themselves using lots of variables for the same datatype which results in a waste of time and memory, then they say to themselves, “There has to be a better way.” If they are smart enough and love to research and update their programming, they will turn to using arrays. Arrays are a complex data structure compared to variables but once the progammer gets the hang of it he will be using it all the time for storing same datatype items. (btw in this blog post: https://cyber1571.blogspot.com/2022/10/arrays-in-python.html...

HOW HAS THE CREATION OF CODE IMPACTED US AS HUMANS

The invention of coding has revolutionized the way we live and communicate. today almost everything around us is being run by a written code and thus has made our lives easier. look at the device you are reading this, the mobile phone where you get a notification, your washing machine, everything has a code that makes it function.  Coding, or programming, has had a significant impact on society and the way we live our lives. It has enabled the development of many technologies and tools that we use daily, such as computers, smartphones, and the internet. It has also brought in the idea of automation of processes leading to AI, and this has increased productivity and efficiency. It has hence contributed to the creation of new industries and job opportunities. interesting fields such as the internet of things, artificial intelligence, virtual reality, and 3d game development are created due to the advent of code. The Internet which came into existence due to coding has given humans li...

ARRAYS IN PYTHON

An array in python is a data structure that can hold more than one value at a time just like a list but their is a slight different in both of them which is discussed below. arrays can hold values of only single data type e.g integers or strings. All values in an array are indexed hence have their own unique address by which they can be called at any time. Now the indexing of array values in python always starts from 0, so if I have an array starting from 1 till 100 the first value of this array i.e 1 will have its index number as 0 and the array's last value i.e 100 will have an index number of 99. to visualise it we can say: array:     1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ,9 , .........., 100           array's       index  :  0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , .........,  99 So now you can easily see how arrays are indexed in python so If using python code which is (discussed below), call out a specific index number it wi...