Protocol Testing

Protocol Testing comes under software testing, as in this testing the structure of packets which travel through the network is checked and analyzed. Protocol testing is carried out in different layers of the network of different networks model.

Technically speaking, protocols in a network is nothing but a set of rules which govern the flow of packets through the network. And when we speak about the network it means, the different network elements which store and forward the packets such as the router, switch, hubs, etc.

Let us see what are the different protocols used in different layers of network and what is the basic structure of a packet.

A packet is an aggregation of data which can be seen as the smallest group of bits which can travel through the network. Now, this smallest unit has a different name when we address it in different layers of the network also the protocols used are also different.

Network Layer Protocols Used
Application Layer HTTP, FTP, TFPT,SSH, POP/POP3, Telnet
Presentation Layer JPEG, MPEG, TFT,MIDI
Session Layer NetBIOS, NFS, SQL, PAP, SCP, ZIP
Transport Layer TCP, UDP
Network Layer ICMP, IGMP, RIP,IPsec, IPV4, IPV6.
Data Link Layer ARP, ATM, CDP, FDDI, Frame Relay, HDLC, MPLS, Token Ring, STP, PPP.
Physical Layer Bluetooth, Ethernet, DSL,ISDN, Wifi , 802.11

In the above table, it is clearly visible that which layer is using which protocol. Before preparing for the protocol testing one should be clear on which layer the testing is going to be performed and for which protocol.

Note: The same data unit when travels through the network layer, is called Packet. So, we shall confine our study to the network layer only.
Basically, there are two types of protocols, Routed, and Routing. Routed Protocols are the protocols which are used for sending user data like e-mail, files, etc. For example IP, AppleTalk, etc. On the other hand, the Routing protocols are the network protocols which governs the network element such as routers, switches, etc. For example: RIP, EIGRP, etc.

Sanity Testing

Basic Structure of a Packet

Below we shall a basic structure of a TCP packet. As this protocol testing is all about testing the structure of the packet, therefore, its necessary to have the basic idea of how a network packet looks like.

tcp-packet1

As shown in the figure above, this is a TCP packet. Let us see what are the functions of different fields of this TCP packet.

  • Source Port Address and Destination Port Address which are of 16 bits length each, identify the port address of the source and the destination, this is both the end connection point.
  • Sequence Number which is of 32-bit size signifies the number assigned to the first byte of data in the current message or sometimes identify the sequence number which is for the next transmission.
  • Acknowledgment Number, which is 32-bit size, contains the next sequence number that the sender of the TCP segment is expected to receive.
  • Data Offset field's length is variable specified how many 32-bit words are contained in the TCP header.
  • Reserved (6 bits) contains various flag bits.
  • Flags (6 bits) contains various flags.
  • Window (16 bits) specifies the size of the sender's receiving window.
  • Checksum (16 bits) is the field which checks whether the bits transmitted or received has any error or any bit is missing.
  • Urgent Pointer (16 bits) points to the first urgent data byte in the TCP Packet.
  • Options field (variable length) specifies TCP options.
  • Padding means unused data bits.
  • Data (variable length) contains the actual information.

Scalability Testing

Types of Protocols

  • TCP/IP: This is a transmission control protocol and is used to send information in small packets through the network.
  • UPD/ICMP: User Datagram Protocol used to send information in data packet through the network layer.
  • POP3 and SMTP: Post Office Protocol and Simple mail transfer protocol used for sending and receiving mail over the internet.
  • HTTP: Hyper Text Transfer Protocol is used to encrypt the data and send over the network.
  • FTP: This is a file transfer protocol used for sending files from one end into the other.

What is Acceptance Testing?

Carrying Out Protocol Testing

For protocol testing, we need a protocol analyzer and a simulator. The process is to make a virtual environment by creating virtual devices, and then installing certain protocols on them. The devices under test are made to run with suitable protocols.

The protocols are provided with the help of simulators and the test is recorded by the analyzer. The analyzer traces the packet and records the behavior of the packet and see whether there is any change in the behavior of the packet.

There may be changes in the structure of the packet like the alteration of the data bit or the checksum may have an error which may result in mischecking of the data bit.

There are also tools for checking the performance and efficiency of the software.

What is checked during protocol testing?

There are different attributes and properties which are checked during protocol testing. Let us see the most important ones:

  • Correctness: This means whether the data received at the other end is accurate and error free. If there is any error or incorrectness in the data, then the entire data received may be invalid. This may not be true for data, such as a frame in video conferencing, but may be important, when there are small but important data.
  • Algorithm: There are different algorithms which are used for traffic control and the proper routing of the data. When there is an error in the protocol, then the routers are not properly analyzed and thus creates unnecessary traffic into the network.
  • Bandwidth: Bandwidth is nothing, but how many data packets are sent in one second.
  • Latency: The latency of the system means how much time does it takes for the system to transit from one state to another.
  • Flooding and Spooling: This has to be checked whether there is any data flooded in any of the devices. Data or packet flooding occurs when a device receives data which is much more than it can handle. Spooling is a process in which the data is stored in the devices for immediate usages.

Categories of Protocol Testing:

Protocol Testing can be divided into functional and non-functional categories, the same as that of software testing. Now we know that the elements such as performance, efficiency, speed, etc are the non-functional attributes whether the functional testing includes conformance testing, negative testing, etc.

Let us discuss only about the functional testing:

  • Conformance Testing: In this testing, it is checked whether the protocols are following the standards like the IEEE, RFC, etc.
  • Interoperability Testing: In this testing, it is checked whether all the modules which are using the same protocol are able to communicate with each other or whether the data transfer between modules takes place as per the protocol. This testing takes place after the conformance testing.
  • Network Testing: In this testing, the feature or any property of any network devices are tested. For example, a particular port may be using some standard protocol for data transfer or a router may be using a security firewall, etc.

Types of Performance Testing

Test Case for Protocol Testing

There can be different scenarios which may be considered while designing different types of protocol testing test cases. Here, we shall see only some examples of a test case with their descriptions.

Example 1:

Test Case ID: TC01

Test Case Name: Line Operating Speed.

Description: To test the operating speed of a device at a speed of 50 Mbps. Also to check whether, in the process, proper utilization of bandwidth is done and the traffic is handled properly.

Example 2:

Test Case ID: TC02

Test Case Name: Protocol Conversion Rate

Description: To test and check the protocol conversion(in TCP/IP) between devices for verifying their correct operating behavior.

Example 3:

Test Case ID: TC03

Test Case Name: Response Time:

Description: To test the Response Time in a device when a particular protocol is being used in the system.

What is a Software Testing Metric?

Protocol Testing Tools

Scapy:

This is an open source tool available on the internet. This tools can be used to create packets and encode and decode them into the network. Also, packets can be captured through this software can be analyzed from any part of the network.

This tool is also used to inject packets into the network arbitrarily for performing the test.

Wireshark:

This is a powerful protocol testing, in which realtime packets can be captured and analyzed. Also, the property that makes this tool the most powerful is that it can track a packet when the packet is inside the traffic itself and can differentiate them by assigning different color codes to them.

TTCN:

TTCN is more of a programming language than a tool. Using TTCN, different test cases can be written and applied to check and test different behavior of packets.

Python:

This programming language is also used to write automation and performance test scripts for carrying out protocol testing.

Netperf:

This tool is used for testing network performance, which is using a specific protocol.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions