Product developmentManual web testingAPI

Low level network protocols

3 minutes read

Low-level network protocols govern how data is transmitted, received, and interpreted, ensuring that information flows smoothly and securely between different machines. In this topic, you will cover the main low-level protocols and what they are needed for.

IP

Internet protocol ensures that data packets reach their intended destinations across the vast network of networks that is the Internet. Understanding IP is crucial because it's the foundation upon which much of internet communication is built. Whether you are testing websites, applications, or network infrastructure, having a solid grasp of IP can help you diagnose issues, optimize performance, and ensure the reliability of your systems.

The key concepts of IP:

  • IPv4 vs. IPv6. IP comes in two main versions: IPv4 and IPv6. IPv4 is like the old reliable workhorse, with its familiar dotted-decimal notation (e.g., 192.168.1.1). However, with the explosion of internet-connected devices, IPv4 addresses are running out fast. Enter IPv6, with its fancy hexadecimal addresses (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334), offering an almost inexhaustible supply of unique addresses.

  • Packet Structure. At its core, IP works by putting data into packets. These packets include a header and a payload. The header contains important information like source and destination addresses, packet length, and protocol version. The payload carries the actual data being transmitted, whether it's a cute cat video or a critical business document.

  • Routing. One of IP's main tasks is routing packets from source to destination. It does this by using routing tables, which are like maps of the internet's layout. When a packet arrives at a router, the router checks its routing table to figure out the best path to send the packet towards its destination.

For example, you're testing a web application hosted on a server halfway across the world. As a tester, you want to ensure that users can access the application quickly and reliably. By understanding how IP routing works, you can find bottlenecks in the network infrastructure, improve routing paths, and ultimately make the user experience better.

UDP

User Datagram Protocol is a simple, connectionless transport layer protocol in computer networking. It's like sending a postcard instead of a certified letter – quicker, but with a higher chance of getting lost. As a tester, understanding UDP is important because it's often used in real-time applications where speed matters a lot, such as video streaming, online gaming, and VoIP (Voice over Internet Protocol). It helps you identify and solve problems in these kinds of applications.

The key concepts of UDP:

  • Connectionless communication, UDP works without needing to connect first. This means that packets can be sent without having to set things up beforehand, making UDP ideal for situations where speed is key.

  • Unreliable delivery. With UDP, there's no promise that packets will get to their destination or in the right order. While this might seem risky, it's great for applications where losing a bit of data is ok.

  • Packet structure. UDP packets are made of a header and a payload. This simple design helps make UDP fast and efficient.

For example, you're testing a multiplayer online game that uses UDP to let players talk to each other. You want to ensure that the game runs well and that players can interact without delays. By watching UDP traffic and looking at packet loss rates, you can find possible performance problems, like network congestion or server overload, and help developers make things better.

UDP includes a UDP header with four sections that total eight bytes.

TCP

Transmission Control Protocol ensures that every piece of data gets to its destination safely and in order. TCP is the backbone of many internet applications, including web browsing, email, and file transfers. By learning TCP well, you'll be able to find and fix problems in these applications, making sure users have a smooth experience.

The key features of TCP:

  • Reliable delivery. TCP's main feature is its promise of reliable delivery. When you send data over TCP, you know it will get to the other end without loss and in order. TCP does this with error checking, acknowledgments, and re-sending lost data.

  • Connection-oriented communication. TCP builds a connection between the sender and receiver before starting to send data. This connection-based method ensures that both sides are ready to exchange data, lowering the chance of losing data or corruption.

  • Flow control and congestion avoidance. TCP uses complex ways of controlling flow and avoiding congestion to manage data transfer over networks with different speeds and capacities. These methods help avoid bottlenecks and make sure the network uses bandwidth effectively.

For example, you're testing a web application that depends on TCP for data transfer, like an online banking site. You want to make sure users can safely access their accounts and do transactions without issues. By monitoring TCP connections and analyzing network traffic, you can spot problems like slow responses or lost connections and work with developers to fix them quickly.

The TCP header is more complicated than UDP's because TCP has features for making connections, controlling flow, managing load, and delivering messages reliably.

TCP vs UDP

Get ready for a possible interview question: "What is the difference between the TCP and UDP protocols?" Both protocols are used in computer networking to send data over the internet. But they are different.

Details

TCP

UDP

It is connection-based, meaning it creates a connection between the sender and receiver before data is sent. It ensures the data gets there in the right order and without errors.

It is connectionless, meaning it doesn't set up a connection before sending data. It just sends the packets without making sure they are reliable or in order.

It makes sure data arrives properly with tools like acknowledgments for received packets, sending lost packets again, and putting them in order.

It doesn't promise reliability. It doesn't acknowledge or re-send, so data might get lost, be double, or arrive out of order.

Checks for mistakes and manages the flow of data to ensure it's correct and to prevent network clogging. It changes how fast it sends data based on the network.

It doesn't check for mistakes or manage data flow. It leaves the job of detecting and fixing errors to other protocols or applications if needed.

TCP headers are bigger because they have more information for setting up connections, sorting data, acknowledging, and managing flow.

UDP headers are smaller since they don’t have the extra controls that TCP does.

It's used for applications that need reliable, ordered, and checked delivery of data, like web browsing, emails, file transfers, and media streaming.

It's better for when real-time communication and less data overhead are more important than reliability. This includes online games, video calls, VoIP, and DNS queries.

In summary, TCP provides reliable, ordered, and checked delivery of data with more overhead, while UDP offers low-latency, connectionless communication with minimal overhead but no promises of reliability. The choice between TCP and UDP depends on what the application or service needs.

Conclusion

Understanding low-level protocols helps testers effectively find and fix network-related problems. Whether it's spotting packet loss, looking at latency, or figuring out connectivity issues, knowing protocols like TCP and UDP can help testers get to the root cause of performance problems and find solutions. Learning about low-level protocols gives testers insight into how data moves across networks and how different network conditions can affect how an application works.

2 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo