Protocol Testing Implementation Guide: L2 & L3

Tram Ho

Before learning about Protocol Testing, understand:

What is Protocol?

When computers communicate with each other, there is a set of common rules and conditions that each computer must follow. In other words, protocols define how data is transferred between computer devices and networks.

Protocol Testing

Protocol Testing is a method of testing communication protocols in the areas of Switching, Wireless, VoIP, Routing, etc. The main goal of Protocol Testing is to test the structure of packets sent over the network with test tools. Routers and switches are used during the test to form the components of the equipment and the product under test.

Routed and Routing Protocols

Protocols are classified into two types of routed protocols and routing protocols

  • Routed protocols : Routed protocols may be used to send user data from one network to another. It carries user traffic like e-mail, web traffic, file transfer, etc. The routed protocols are IP, IPX and AppleTalk.
  • Routing protocols : Routing protocols is a network protocol that defines 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 transport while routing protocols are signals on the road.

Depending on the communication type, different protocols are used. Companies like CISCO, JUNIPER, ALCATEL manufacture network devices like routers, modems, wireless, etc. that use different protocols for communication, such as Cisco using EIGRP, OSPF, etc. Protocol testing is nothing more than checking if EIGRP (Enhanced Interior Gateway Routing Protocol) or OSPF (Open Shortest Path First) or any other Protocol is working according to the respective standard.

Types of Computer Protocol

TCP / IP – Transmission Control Protocol / Internet Protocol, UDP / ICMP – User Data Protocols / Internet Control Message Protocol, POP3 / SMTP – Post Office Protocol / Simple Mail Transfer Protocol, HTTPHypertext Transfer Protocol Version, FTP – Protocols for file transfer

Different types of network protocols (L2 and L3)

The OSI model has a total of 7 layers of network communication, of which layer 2 and layer 3 are very important.

Layer 2: The data link layer. Mac Address, Ethernet, Token Ring, and Frame Relay are all examples of Data link layers. Layer 2: The network layer defines the best available path in the network to communicate. IP addresses are an example of layer 3.

Protocol Testing

  • For Protocol Testing, you need a simulator and Protocol analysis
  • Protocol Analyzer ensures proper decoding along with call and session analysis. While the emulator performs the emulation of different entities of the network element
  • Typically, Protocol Testing is performed by the DUT (the device under test) for other devices such as the switches routers and configuring the Protocol in it.
  • Then check the Paket structure of the pakets sent by the devices
  • It tests the device’s scalability, performance, Protocol algorithm, etc. using tools like lxNetworks, Scapy, and Wireshark.

Types of tests are used for Protocol Testing

Protocol Testing includes functionality, performance, protocol stack, interoperability, etc. During Protocol Testing basically three elements of testing are performed.

  • Correctness: Are we getting the X package we expected
  • Latency: How long does it take for a packet to be transported within the system
  • Bandwidth: How many packets can we send per second

Protocol Testing can be divided into two categories. Stress and Reliability Tests and Functional Tests. Stress and Reliability Tests cover Load Testing, Stress Testing, Performance Testing, etc.While Functional Tests covers cnegative testing, conformance testing, interoperability testing, etc.

Test Cases used for Protocol Testing of network equipment

This is a sample test case for routers

Protocol Testing Tools

Let’s discuss the most important test tools used to verify Protocols

Scapy for creating Packet

Scapy is a powerful interactive Packet manipulation program. It allows you

  • Create Private Packet
  • Decrypt the Packets on the network
  • Capture Packets and analyze them
  • Put Packets on the network

So, scapy basically does two things: get the answer and send the Packet. You define Packets, it sends them, receives responses, matches requests with responses, and returns a list of Packet pairs and a list of mismatched Packets.

It can also handle other things like trace-routingi, unit tests, network attack or discovery, new protocol development, exploration, etc.

Scapy allows to write a Python script that performs a task such as sending and receiving Packets or sniffing Packets. For example, scapy can sniff out data packets using a Python script. The getdit open command is entered in the editor

It will sniff 10 Packets and as soon as it has sniffed 10 Packets, it will print out a summary. Scapy is like an array of commands to send and receive Packets at the same time

Wireshark tool for ## analysis

Tool used to perform protocol testing – Wireshark. It allows to capture Packets in real time and display them in human readable form. It allows you to dig deep into network traffic and test individual Packets using color coding and filters.

Wireshark captures Packets that help determine when a session is established, when exactly data transmission should start and how much data is sent each time, etc.

Wireshark has a rich feature set included

  • Thoroughly tested hundreds of protocols, more protocols added all the time
  • Live capture and offline analysis
  • Rich VoIP analysis
  • The browser packs three standard compartments
  • Runs on multiple platforms like Windows, Linux, OSX, etc.
  • Captured network data can be browsed via the GUI
  • Decoding supports manyprotocol as IPsec, ISAKMP, SSL / TLS
  • Live data can be read from Ethernet, ATM, Bluetooth, USB, token, etc.
  • Output can be exported to CSV, XML, plain text, etc.

Techmart

TCCN is a standard test language for defining Test Scenario and implementing them to perform protocol testing. TCCN test suite contains many test cases written in TTCN programming language and it is used to perform testing reactive systems or behavioral testing.

For example, a coffee vending machine supplies coffee to you when you put in a dollar but will not respond if you give anything less than a dollar. For programming such machines, the TCCN3 language is used. To make the coffee machine respond when the coin is inserted, we have to write the TCCN-3 ingredient that acts like a coffee machine. It allows us to run our tests before the coffee machine is actually available in product form. Once done, we will connect the TCCN3 tester to an external device.

The test system emits a signal (dollar) and receives feedback (coffee). The signal adapter receives the signals from the test system and transmits them to the system under test. The response adapter waits for the responses of the system being tested and passes them to the test system.

TCCN3 can be used in different fields like

  • Mobile communications (LTE, WiMAX, 3G, etc.)
  • Broadband technology (ATM, DSL)
  • Middleware platform (Web Services, CORBA, etc.)
  • Internet protocol (SIP, IMS, IPv6)
  • Smart Cards
  • Automotive (AutoSAR, MOST, CAN)

In TCCN, we can determine

  • Test Suites
  • Test Cases
  • Test Steps
  • Declare variables
  • Declare timer
  • Create PDU, etc.

TCCN can be integrated with systems of other languages ​​such as ASN.1, XML, C / C ++. TCCN3’s core language exists in text format in addition to other formats such as tables, graphics, and presentations.

The article is translated from source: https://www.guru99.com/protocol-testing.html

Share the news now

Source : Viblo