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.
3rd step in long polling
If new data is available, the server sends it to the client immediately.
4rth step in long polling
If new data is not available, the server holds the request open and waits for a predetermined amount of time (e.g., 30 seconds) before responding to the client.
5th step in long polling
If new data becomes available during this time, the server sends it to the client immediately and the process starts over again.
Where would you use long polling ?
- Real-time chat applications
- Stock market monitoring:
- Gaming
- Notifications
- Collaborative editing
- Live streaming
6th step in long polling
If new data does not become available during this time, the server sends a response to the client with a timeout message, indicating that no new data is available.
Why is long polling more efficient than traditional polling ?
It can be more efficient than traditional polling, where the client sends requests at regular intervals, as it reduces the number of unnecessary requests.
When would you choose web sockets over long polling and vice-versa ?
The choice between WebSockets and Long Polling depends on the specific use case and requirements. WebSockets are more efficient for real-time applications that require frequent updates, but they may not be supported by all browsers and servers. Long Polling can be a good alternative when frequent updates are not necessary, and it is more widely supported. Both techniques have their advantages and limitations, and the best approach depends on the specific requirements of the application.
full forms of HTTP and HTTPS
HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure)
How does HTTPS transmit secure data ?
HTTPS is a secure version of HTTP, which means that it provides encryption of data transmitted between the client and the server. HTTPS uses SSL/TLS (Secure Sockets Layer/Transport Layer Security) protocols to encrypt data, which makes it more difficult for attackers to intercept and steal sensitive information such as login credentials, credit card numbers, and other personal data.
what are the effects of HTTP not encrypting it’s data ?
data is transmitted in plaintext and can be intercepted and read by attackers.
Which ports do HTTPS and HTTP use ?
HTTPS uses a different port (port 443) than HTTP (port 80).
What certificate does HTTPS require ?
HTTPS requires a digital certificate to establish the authenticity of the server. The certificate is issued by a trusted third party called a Certificate Authority (CA), which verifies the identity of the server and provides a public key for encrypting data.
What are the after-effects of HTTP not requiring a certificate ?
HTTP does not require a certificate, which means that it is vulnerable to attacks such as man-in-the-middle attacks, where an attacker intercepts and modifies data transmitted between the client and server.
How does HTTPS influence SEO ?
HTTPS is also preferred by search engines, as they prioritize secure websites in their search results. This means that HTTPS can improve the search engine rankings of a website, which can lead to more traffic and better visibility.
HTTPS vs HTTP
HTTPS is a more secure version of HTTP that provides encryption of data, uses a different port, requires a certificate to establish authenticity, and is preferred by search engines. The choice between HTTP and HTTPS depends on the specific requirements of the application, but for websites that handle sensitive information, HTTPS is essential to protect against attacks and maintain user trust.
What is ARP ?
ARP (Address Resolution Protocol) is a protocol used to map an IP address to a physical (MAC) address on a local network.
How can a device communicate with another device on the same network ?
it broadcasts an ARP request to obtain the MAC address of the intended recipient. Once the MAC address is obtained, the data can be sent over the network using the MAC address as the destination.
What is RPC ?
RPC (Remote Procedure Call) is a protocol used for communication between different processes or applications in a distributed system. It allows a process to invoke a procedure or method in another process or application, and receive a response back as if the procedure was executed locally.
1st step in RPC
Client sends a request: The client initiates an RPC request by sending a message to the server that specifies the name of the procedure to be executed and any necessary parameters
2nd RPC step ?
Message transmission: The message is transmitted over the network using a transport protocol such as TCP or UDP.
3rd step in RPC ?
Server receives the request: The server receives the request message and parses it to determine the procedure to be executed and the parameters.
4rth step in RPC ?
Procedure execution: The server executes the requested procedure, using the provided parameters.
5th step in RPC ?
Response generation: The server generates a response message that contains the result of the procedure execution, and sends it back to the client.
6th step in RPC ?
Message transmission: The response message is transmitted back to the client over the network.
final step in RPC ?
Client receives the response: The client receives the response message, parses it to obtain the result of the procedure execution, and continues with its processing.
4 benefits of using RPC ?
There are several benefits to using RPC, including:
- Abstraction: RPC provides an abstraction layer that allows processes to communicate with each other without needing to know the details of the underlying network protocols or hardware.
- Reusability: RPC can be used to invoke procedures in different processes or applications, making it a powerful tool for building distributed systems.
- Modularity: RPC allows different components of a distributed system to be developed and tested independently, and then connected together using RPC.
- Interoperability: RPC can be implemented in different programming languages, making it possible for applications written in different languages to communicate with each other.
3 challenges faced while using RPC
However, there are also some challenges associated with RPC, such as:
- Scalability: RPC can introduce bottlenecks in highly concurrent systems, as it typically involves blocking network I/O.
- Security: RPC can be vulnerable to attacks such as injection, interception, and impersonation, which can compromise the integrity, confidentiality, and availability of the system.
- Versioning: RPC can be difficult to version, as changes to the interface of a procedure can break compatibility with existing clients.
What is the OSI
the OSI provides a standard for different computer systems to be able to communicate with each other.
why is the OSI still useful ?
- the OSI Model can help to break down the problem and isolate the source of the trouble
- If the problem can be narrowed down to one specific layer of the model, a lot of unnecessary work can be avoided.
What is WebRTC ?
WebRTC (Web Real-Time Communication) is a protocol that enables peer-to-peer communication between web browsers without the need for plugins or additional software.
webRTC applications ?
It is often used for video and audio conferencing, file sharing, and other real-time applications.
MQTT ?
MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol that is often used in IoT (Internet of Things) applications. It is designed to be low-bandwidth and efficient, making it well-suited for devices with limited processing power or battery life.
what is FTP and SFTP ?
FTP (File Transfer Protocol) and SFTP (Secure File Transfer Protocol) are protocols used for transferring files between clients and servers. FTP is an unsecured protocol, while SFTP uses SSH (Secure Shell) to encrypt data in transit.
What is DNS ?
DNS (Domain Name System) is a protocol that is used to translate domain names (e.g. google.com) into IP addresses (e.g. 172.217.7.206). It is essential to the functioning of the web, as it allows users to access websites using human-readable domain names rather than IP addresses.
What is CA ?
A CA (Certificate Authority) is a trusted third-party organization that issues digital certificates used to verify the identity of individuals, organizations, or other entities on the internet. CAs validate the identity of certificate holders and digitally sign the certificates they issue to ensure their authenticity. This helps provide a secure and reliable way to identify and communicate with other entities over the internet.
What are SSEs ?
SSE (Server-Sent Events) is a technology that enables a server to push data to a client as soon as it becomes available, without the need for the client to request it. The server sends a stream of data over a single HTTP connection, and the client receives it as a stream of events that can be processed in real-time.
Where can SSEs be used ?
SSE is typically used for real-time notifications, chat applications, and live updates.
Enlist 8 network optimization methods
Here are some network optimization methods:
- Minimize HTTP Requests
- Use Content Delivery Networks (CDNs)
- Use Compression
- Use HTTP/2
- Use Lazy Loading
- Optimize Images
- Use HTTP Caching / other caching approaches
- Use Progressive Rendering
What is the successor to SSL ?
TLS
what is the connection between TLS, HTTP and HTTPS ?
TLS is commonly used to secure HTTP traffic in the form of HTTPS.
What is the purpose of TLS ?
is used to encrypt data and provide authentication between clients and servers.
What is TLS ?
- TLS (Transport Layer Security) is a cryptographic protocol that provides secure communication over a network, such as the internet.
applications of TLS ?
TLS is used to secure a wide variety of internet traffic, including
- email,
- messaging, and
- e-commerce transactions.
1st step of a TLS handshake
- the client sends a “hello” message, including supported protocols and cryptographic algorithms, to the server.
2nd step in a TLS handshake
- The server responds with a certificate and a “hello” message of its own.
3rd step in a TLS handshake
The client and server then negotiate a shared secret key and establish a secure session for encrypted data transfer.
List 3 ways via which CDNs improve performance.
- distributing content across multiple servers,
- reducing the distance between the user and the server, and
- allowing for faster access to resources.
List 4 ways via which HTTP/2 contribute to network optimization
- supports multiplexing,
- supports server push
- can reduce the number of requests needed
- allow for faster data transfer.
What is progressive rendering ?
the browser starts to render the page as soon as possible, even if all the resources haven’t been downloaded yet.
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.
What are the 7 OSI layers ?
The OSI (Open Systems Interconnection) model consists of seven layers that represent the different stages of data communication from one device to another. From bottom to top, the layers are:
- Physical layer: Defines the physical characteristics of data transmission, such as cables and network interfaces.
- Data link layer: Manages the flow of data over a physical connection and performs error detection and correction.
- Network layer: Routes data between different networks.
- Transport layer: Provides reliable end-to-end delivery of data, using protocols such as TCP and UDP.
- Session layer: Manages and maintains sessions between applications.
- Presentation layer: Formats and encrypts data for transmission and performs data compression.
- Application layer: Provides network services to applications and end-users, such as HTTP and FTP.