Communication Protocols Flashcards
TCP purpose ?
used for transmitting data over the internet
UDP purpose ?
used for transmitting data over the internet
TCP full form ?
Transmission control protocol
UDP full form ?
User Datagram Protocol
Why is TCP a reliable protocol ?
- data delivery is guaranteed
- order of data delivery is guaranteed
- error-free data transmission mostly
- receiver acknowledges to the sender that data packets have been delivered
Why is UDP an unreliable protocol ?
- delivery isnt guaranteed
- delivery order isnt guaranteed
- there could be errors during data transmission
What do you mean by “TCP is a connection-oriented protocol” ?
- a connection to be established between the sender and receiver before data can be transmitted.
- successful receipt of data delivery back to the sender after data transmission is complete
What do you mean by “UDP is a connectionless protocol” ?
Connection does not need to be established before data is transmitted
Why does TCP have a higher overhead than UDP ?
because it includes additional information in each packet to ensure reliability and order.
What are the repurcussions of having a “higher overhead” based protocol ?
- slower data transmission
- network congestion
What are the repurcussions of a comm protocol having a lower overhead ?
the protocol will be faster but less reliable
What are some use-cases for TCP ?
file transfers, email, and web browsing.
What are some use-cases for UDP ?
- online gaming
- video streaming
- VoIP (Voice over Internet Protocol).
TCP vs UDP ? Which one would you choose ?
TCP is a reliable, connection-oriented protocol with higher overhead, while UDP is an unreliable, connectionless protocol with lower overhead. The choice between TCP and UDP depends on the specific application and requirements for reliability and speed.
IPv4 and IPv6
Internet Protocol versions for identifying devices on a network
What is the size of IPV4
IPv4 has a 32-bit address, providing roughly 4 billion unique addresses
What is the size of IPV6 ?
IPv6 has a 128-bit address, allowing for trillions of unique addresses.
Which features make IPV6 more desirable in comparison to IPV4 ?
- better security,
- auto-configuration, and
- simplified routing
what is the purpose of an IP ?
It is a numerical label that allows devices to communicate with each other over a network.
What is an IP ?
An IP (Internet Protocol) is a unique identifier assigned to every device that connects to the internet.
Name 2 techniques used for real-time communication between a client and a server
WebSockets and Long Polling
What type of a communication channel does a websocket provide ?
WebSockets is a protocol that provides a persistent, bidirectional communication channel between a client and a server.
Why are websockets designed to work over a single TCP connection ?
To reduce the overhead and latency compared to traditional HTTP requests.
2nd websocket step
If the server supports WebSockets, it sends a response back to the client with an Upgrade header, indicating that the connection has been upgraded to a WebSocket connection.
1st step in the websocket process
A client sends a request to the server, asking to establish a WebSocket connection.
3rd websocket step
The client and server then perform a WebSocket handshake to establish the connection. This involves exchanging headers to negotiate the protocol and version to use, as well as generating a unique key to confirm the connection.
4rth websocket step
Once the connection is established, the client and server can send data to each other using the WebSocket protocol. This involves sending data frames that can be split into smaller packets for transmission over the network.
Name some applications where web sockets are commonly used
- chat applications,
- online gaming, and
- financial trading applications.
5th websocket step
Data can be sent in either direction, with each side using a send() method to transmit data to the other side.
6th websocket step ?
The connection remains open until one side decides to close it, or if there is a network error or timeout.
Explain long polling in 1 sentence
Long polling is a technique used in web development that allows a web server to push new data to a client whenever it becomes available, instead of relying on the client to periodically request new data.
1st step in long polling
The client sends a request to the server for new data.
2nd step in long polling
The server waits for new data to become available.