Protocol Testing Tutorial – L2 & L3


What exactly is the protocol?

When two computers share data among each other or across a network, they must adhere to a pre-defined process of data transfer, which is called 'protocol'

Protocol Testing

Protocol testing tools examine how data packets are sent across a network. The test procedure involves the use of routers and switches to create portions of the equipment and goods tested.

The Value of Protocol Testing

It also allows for the development of dependable and high-performance network connectivity. Devices would be unable to interpret the electronic signals they send when conversing via network connections if protocols were not there.

A network transmits packets containing encrypted binary data. Furthermore, several protocols include a header to hold information about the message's sender. The network protocols provide a description of the sender and recipient of the communication at the beginning of the message. A footer is also included in a few protocols.

As a result, network protocols focus on recognizing headers and footers when transferring data between devices.

Routing Protocols and Routed Protocols

There are two types of protocols − routed protocols and routing protocols.

  • Routed Protocols − Routed protocols help transfer user data between networks. It transports user traffic such as e-mails, web traffic, file transfers, etc. are examples of routed protocols.

  • Routing Protocols − Routing protocols let routers select which routes to take. It's solely used to for router communication. Not able examples are RIP, IGRP, EIGRP, etc.

In basic words, a router acts as a transport vehicle that helps people commute, whereas routing protocols act as traffic lights.

Different protocols are employed depending on the nature of communication. Companies such as CISCO, JUNIPER, and ALCATEL manufacture networking equipment such as routers, modems, wireless access points, Protocol testing consists of determining if EIGRP (Enhanced Interior Gateway Routing Protocol) or OSPF (Open Shortest Path First) or any other protocol is operating in accordance with its relevant standards.

Protocols and How They are Utilized

  • TCP/IP − This protocol is followed while transfering online data in tiny packets.

  • UDP/ ICMP − is followed to transfer tiny amounts of data packets over internet .

  • POP3 and SMTP − These protocols are used to send and receive emails.

  • HTTP − The Hypertext Transfer Protocol (HTTP) is used to transfer HTML pages in encrypted form in order to protect sensitive data.

  • FTP − it helps to transfer data between two nodes of a network. TCP/IP- Transmission Control Protocol/Internet Protocol,

  • UDP / ICMP − User Datagram Protocol/Internet Control Message Protocol, POP3/SMTP- Post Office Protocol / Simple Mail Transfer Protocol

There are Many Network Protocols.

The OSI model contains seven levels of network interaction, with layer 2 and layer 3 being particularly important.

  • Layer 2 − The second layer is the data link layer. Data link layers 2 are best shown by Mac addresses and Ethernet.

  • Layer 3 − Layer 3 identifies the optimal network communication channel. Layer 3 is exemplified by an IP address.

Protocol Testing Procedures

A protocol analyzer and simulator are required for protocol testing.

A protocol analyzer provides correct decoding as well as call and session analysis. The simulator replicates various networking element entities. Protocol testing is conducted by connecting the DUT (device under test) with alternative network components such as switches and routers to examine the data packet structure.

It examines the device's scalability, performance, protocol strategy, and so on using tools such as lxNetworks, Scapy, and Wireshark.

Protocol Testing Methodologies

Protocol testing encompasses functionality, performance, protocol stack, compatibility, and other aspects. The protocol testing conducts 3 tests −

  • Correctness − Did we get packet X on the predicted date?

  • Latency − The amount of time it takes for a packet to get through the system.

  • Bandwidth − Bandwidth is the number of packets transmitted per second

Protocol testing may be divided into two types. Functional tests, as well as stress and reliability tests. Load testing, stress testing, and performance testing are all examples of stress and reliability tests. Negative testing, conformance testing, interoperability testing, and so on are all part of functional testing.

  • Stress Testing (Torture Testing) − Stress testing (Torture testing) is a type of intentionally intense or extensive testing used to assess the stability of a particular system, vital infrastructure, or entity. It entails testing beyond normal operating capacity, frequently beyond the breaking point, to examine the effects.

  • Reliability Testing − Reliability Testing is a software testing procedure that determines if the program can execute a failure-free operation in a certain environment for a given time period. The goal of reliability testing is to ensure that the software product is bug-free and dependable enough to perform its intended function.

  • Conformance Testing − Protocols such as IEEE, RFC, and others are examined for conformance on goods.

  • Interoperability Testing − Different suppliers' interoperability is tested, which then follows conformance testing.

  • Network feature testing − networking devices are evaluated for functionality using the design document as a guide. Port-security on a switch, ACL on a router, and so on are examples of features.

Protocol Testing Tools

Let's go through the most significant testing tools for protocol verification.

Packet Crafting Scapy

Scapy is a sophisticated packet modification software that can be used interactively. It allows you to −

  • Make packets

  • On the network, decode packets.

  • Capture and analyze packets

  • Packets should be injected into the network.

Scapy receives responses and sends packets. You specify the data packets, it transmits them, receives responses, matches requests with responses, and provides details of packet pairs and unpaired packets.

It also tests trace-routing, unit testing, network discovery, probing, etc.

Scapy allows us to create a Python script that performs a task such as exchanging or sniffing packets. Scapy, for example, can sniff a data packet with Python script.

Command getdit file in the editor

#gedit scapysniff.py
#!/usr/bin/env python
from scapy.all import*

a= sniff(count=5)
a.nsummary()

Save, and change the mode of the file into an executable form

#chmod+x scapysniff.py

# ./scaotsbuff.py

It will sniff 5 packets and then output the report after sniffing 10 packets. Scapy also has a command array for transmitting packets simultaneously.

Wireshark Analysis Tools

Wireshark is a protocol testing tool. It allows you to collect real-time packets and show them in a human-readable format. Wireshark records packets that aid in determining when a session is created, when the specific data transit began, and how much data is transferred each time, among other things.

Wireshark provides a plethora of useful functions, including

  • A detailed examination of multiple procedures, with regular addition.

  • Offline analysis and live capture

  • In-depth VoIP analysis

  • Browser with three panes as standard

  • Runs on a variety of systems, including Windows, Linux, and OS X.

  • A GUI may be used to browse network data.

  • Many protocols, including IPsec, ISAKMP, and SSL/TLS, are supported for decryption.

  • Live data may be read via Ethernet, ATM, Bluetooth, USB, tokens, and other devices.

  • The output may exported as CSV, XML, plain text, and other formats.

TTCN

TCCN helps in designing and implementing Test Scenarios for protocol testing. A TCCN test suite is a collection of test cases developed in the TTCN programming language for reactive systems or behavioral testing.

For example, a coke machine will give you coke if you input a $1 coin but will ignore any other coin. The TCCN3 programming language is used to program similar machines. To have the coke machine respond when a coin is inserted, we must create a TCCN- suite acts as a coke machine. It permits us to conduct our research before a commercially accessible coffee maker is released.

When it is complete, we will link the TCCN3 test suite to the external device.

It generates stimuli ($1 coin) and collects responses (coke). The stimulus adapter collects stimulus from the test system and sends them for response. The response adapter monitors the system for replies and forwards them to the test system.

TCCN3 can be utilized in a variety of applications, including

  • Communications through mobile devices (LTE, WiMAX, 3G, etc)

  • High-speed Internet technologies (ATM, DSL)

  • Platforms for Middleware (Webservices, CORBA, etc)

  • Internet Protocol (IP) is an abbreviation ( SIP, IMS, IPv6)

  • Card Readers

  • The automobile (AutoSAR, MOST, CAN)

We may define in TCCN −

  • Test Suites

  • Test Cases

  • Test Steps

  • Declare Variables

  • Declare Timers

  • Make PDUs, for example.

TCCN can be used with systems written in other languages such as ASN.1, XML, and C/C++. Apart from tabular, graphical, and presentation formats, the TCCN3 core language is available in text format.

Protocol Testing of Network Devices − Example Test Cases

Here is the sample test case for routers −

Test Name

Test Cases

One VLAN on One Switch

Build two different VLANs. verify the visibility between hosts on different VLANs

Three Symmetric VLANs on One switch

make three different asymmetric VLANs. Check the visibility between hosts

Spanning Tree − Root Path Cost Variation

Test how the Root Path Cost is changed after a topology variation

Spanning Tree − Port Blocking

In the presence of VLANs, see how the spanning tree protocol prevents the creation of cycles in the network by blocking redundant links.

Different Root Bridge for Different MSTI

Demonstrate that each MSTI may have a unique Root Bridge.

Visibility between different STP Regions

Examine visibility between various STP areas using the same VLANs.

Telephone switch Performance

Make 1000 phone calls to see if the phone switch is still operational or if its performance has deteriorated.

Negative test for device

Enter the incorrect key and verify the user for authentication. It should not be possible for a user to gain access.

Line speed

Check that the device is running at 10Gbps and using all of the available bandwidth to handle incoming traffic.

Protocol conversation rate

Track a TCP communication between two devices and ensure that each device is behaving correctly.

Response time for session initiation

Calculate the response time of a device to an invite request for session initiation

Updated on: 09-Aug-2023

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements