Before we learn about protocol testing, let's understand: What is Protocol?When a computer communicates with each other, there is a common set of rules and conditions that each computer has to follow. In other words, protocols determine how data are transmitted between computing devices and over networks. What is Protocol Testing?Protocol testing is defined as a Software Testing type that checks communication protocols in domains of Switching, Wireless, VoIP, Routing, Switching, etc. Routed and Routing ProtocolsProtocols are classified into two categories routed protocols and routing protocols. Routed Protocols: Routed protocols can be used to send the user data from one network to another network.
It carries user traffic like e-mails, web-traffic, file transfers, etc. Routed protocols are IP, IPX, and AppleTalk. Routing Protocols: Routing protocols are network protocols that determine routes for routers. It is only used between routers. For example RIP, IGRP, EIGRP, etc.In simple terms, a router is like a bus used for transportation while routing protocols are signals on the road.Based on the type of communication different protocols are used. Companies like CISCO, JUNIPER, ALCATEL produce networking devices like routers, modems, wireless access points, etc. That use different protocols for communication, for example, Cisco uses EIGRP, OSPF, etc.
Protocol testing is nothing but checking whether EIGRP (Enhanced Interior Gateway Routing Protocol) or OSPF (Open Shortest Path First) or any other protocol is working as per respective standard. Types of Computer Protocols.
Layer 2: It is a data link layer. Mac address, Ethernet, Token Ring, and Frame Relay are all examples of Data link layer. Layer 3: It is a network layer that determines the best available path in the network for communication. An IP address is an example of layer3.How to do Protocol Testing. For protocol testing, you need protocol analyzer and simulator. Protocol analyzer ensures proper decoding along with call and session analysis.
While simulator simulates various entities of networking element. Usually, a protocol testing is carried out by DUT (device under test) to other devices like switches and routers and configuring protocol in it. Thereafter checking the packet structure of the packets sent by the devices. It checks scalability, performance, protocol algorithm etc. Of the device by using tools like lxNetworks, Scapy and WiresharkTesting Types for Protocol TestingProtocol testing includes testing of functionality, performance, protocol stack, interoperability, etc. During protocol testing basically, three checks are done.
Correctness: Do we receive packet X when we expected. Latency: How long does a packet take to transit the system. Bandwidth: How many packets we can send per secondProtocol testing can be segregated into two categories. Stress and Reliability Tests and Functional Tests. Stress and Reliability tests cover, etc.
While includes negative testing, conformance testing, interoperability testing, etc. Conformance Testing: The protocols implemented on products are tested for adherence like IEEE, RFC etc. Interoperability Testing: The interoperability for different vendors are tested. This testing is done after conformance testing is done on the appropriate platform.
Network feature Testing: The features of networking products are tested for functionality with reference to the design document. For example, features can be port-security on a switch, ACL on a router etc.Sample Test Cases for Protocol Testing of Network DevicesHere is the sample test case for routers. Test NameTest Cases. One VLAN on One Switch. Build two different VLANs.
Check the visibility between hosts on different VLANs. Three Symmetric VLANs on One switch. Create three different asymmetric VLANs. Create packets. Decode packets on the network. Capture packets and analyze them.
Inject packets into the networkSo basically, scapy mainly does two things: receiving answers and sending packets. You define the packets, it sends them, receives answers, matches requests with answers and returns a list of packet couples and a list of unmatched packets.It can also handle other things as well like trace-routing, unit tests, attacks or network discovery, developing new protocols, probing, etc.Scapy enables us to write ascript that allows us to perform a task like sending and receiving packets or sniffing packets. For example, scapy can sniff the data packet by using a Python script. The command to open the getdit entered in the editor #gedit scapysniff.py#!/usr/bin/env pythonfrom scapy.all import.a= sniff(count=10)a.nsummarysave, and change the mode of the file into an executable form#chmod+x scapysniff.py#./scaotsbuff.pyIt will sniff 10 packets and soon as it has sniffed 10 packets it will print the summary. Scapy also as an array of command for sending and receiving packets at the same timeWireshark Tools For AnalysisTools used for protocol testing- Wireshark. It allows to capture packets in real time and display them in human-readable form.
TTCNTCCN is a standard testing language for definingand their implementation for protocol testing. A TCCN test suite contains many test cases written in the TTCN programming language and it is used for testing reactive systems or behavioral testing.For example, a coffee vending machine that gives you coffee on inserting a dollar coin but does not respond if anything less than a dollar is inserted into it. To program such machines TCCN3 language is used. In order to make the coffee machine responds when inserting a coin, we have to write TCCN-3 component that behaves as a coffee machine. It allows us to run our test before an actual coffee machine is available as a product. Once it is done we will connect the TCCN3 test suite with the external device.The test system emits stimuli (dollar coin) and receives responses (coffee). The stimuli adapter obtains stimuli from the test system and passes them to the system under test.
The response adapter waits for responses of the system under test and passes them to the test system.TCCN3 can be used in various fields like. Mobile communications (LTE, WiMAX, 3G etc). Broadband technologies (ATM, DSL). Middleware Platforms (Webservices, CORBA etc).
Internet Protocol ( SIP, IMS, IPv6). Smart Cards. Automotive (AutoSAR, MOST, CAN)In TCCN we can define. Test Suites. Test Cases. Test Steps.
Declare Variables. Declare Timers. Create PDUs etc.TCCN can be integrated with types of systems of other languages like ASN.1, XML, C/C. TCCN3 core language exists in text format apart from other formats like tabular, graphical and presentation.