Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Example of ping ( ICMP )over a layer 2 test port with Titan(Example of ICMP/IP over a LANL2 test port in dual-faced mode with Titan)
Example of ping ( ICMP )over a layer 2 test port with Titan [message #1701422] Mon, 13 July 2015 11:16 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1063
Registered: January 2015
Senior Member
Hi, it's time for a new episode in our series.

The TTCN-3 program presented is a simple ping application using the ICMP and IP protocol modules and the LANL2 test port. The test port is used as a dual-faced test port, as described earlier in the SNMP/UDP example. Details of the dual-face functionality can be found in the Titan reference guide. ( BTW, the standard, see TTCN-3 Language Extensions: Configuration and Deployment Support ETSI ES 202 781 V1.4.1 (2015-06) calls these ports as ports having translation capability )
The port receives ICMP PDU's at the northern end and connects to Ethernet at the southern end. The ICMP PDU 's are packed in an IP packet after encoding. The IP packet is correspondingly encoded, then an Ethernet frame is assembled. When receiving the response, the payloads are extracted and decoded in inverse order.
Documentation of the IP and ICMP protocol modules, and that of the LANL2 test port can be found in the /doc sections of the relevant github repos.

https://github.com/eclipse/titan.TestPorts.LANL2asp
https://github.com/eclipse/titan.ProtocolModules.ICMP
https://github.com/eclipse/titan.ProtocolModules.IP



This is a good example of layering protocols in TTCN-3 and Titan,in the form of protocol modules stacked on the top of an appropriately chosen test port.
It also highlights the strength of working with Titan: every protocol layer down to the last single bit can be configured to reach the desired result.
Mind you that you will need root privileges to use the LANL2 test port as this will require unrestricted access to Ethernet.
The cfg file will have to be updated with your locally relevant data (Ethernet and IP addresses).

How to build and run:

Unpack the attached file to a directory ICMP

cd ICMP
cd bin
../install.script
make 

./ICMP cfg.cfg


The Makefile was generated as below:

makefilegen -s -e ICMP *.ttcn *.cc *.hh



Best regards

Elemer
  • Attachment: ICMP.tgz
    (Size: 304.31KB, Downloaded 209 times)
Re: Example of ping ( ICMP )over a layer 2 test port with Titan [message #1798494 is a reply to message #1701422] Mon, 19 November 2018 20:21 Go to previous messageGo to next message
David Laurent is currently offline David LaurentFriend
Messages: 68
Registered: September 2018
Member
Hi Elemer,

Would you know where the Cyclic Redundancy Check (CRC) and Frame Check Sequence (FCS) field are defined in ipv4 header template (IP_Type.ttcn & ICMP_Types.ttcn) or in ICMP2ETH.ttcn, as we are now making an educated guess but cannot find any description in correlation with these 2 crucial fields in LANL2asp_CNL113519_1551.doc ?

Regards - David

[Updated on: Mon, 19 November 2018 20:44]

Report message to a moderator

Re: Example of ping ( ICMP )over a layer 2 test port with Titan [message #1798526 is a reply to message #1798494] Tue, 20 November 2018 08:12 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1063
Registered: January 2015
Senior Member
Hi David,

I assume you refer to the CRC or FCS of the Ethernet header.

Certainly they have no place in IP or ICMP definitions;

according to

https://www.wireshark.org/docs/wsug_html_chunked/ChAdvChecksums.html
7.10.2. Checksum offloading

"The checksum calculation might be done by the network driver, protocol driver or even in hardware."

etc.

so that's the reason you don't see it in TTCN-3 (or in Wireshark for that matter) , it's dealt with automatically in the background.

Best regards
Elemer












Re: Example of ping ( ICMP )over a layer 2 test port with Titan [message #1798693 is a reply to message #1798526] Thu, 22 November 2018 21:45 Go to previous messageGo to next message
David Laurent is currently offline David LaurentFriend
Messages: 68
Registered: September 2018
Member
Hi Elemer,

Would you know the meaning of this value in the config ?
[DEFINE]
eth_proto := "0800"

Would it be the FCS of the ethernet header ?

Regards - David
Re: Example of ping ( ICMP )over a layer 2 test port with Titan [message #1798725 is a reply to message #1798693] Fri, 23 November 2018 10:14 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1063
Registered: January 2015
Senior Member
Hi David,

I don't know how to make this any clearer;

index.php/fa/34386/0/


CRC and FCS, although belong to Layer 2 , will be handled by drivers or HW.
They will not appear explicitly on Layer 2.

eth_proto is equivalent with the Ethertype field , and 0x0800 signifies IPV4.

BR

Elemer
  • Attachment: Eth.png
    (Size: 84.20KB, Downloaded 304 times)

[Updated on: Fri, 23 November 2018 10:22]

Report message to a moderator

Previous Topic:Compiler Issues
Next Topic: XML namespace "..." is in the excluded namespace list.
Goto Forum:
  


Current Time: Fri Jul 10 13:24:12 GMT 2020

Powered by FUDForum. Page generated in 0.03415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top