Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » How to know what network interface I'm using is?
How to know what network interface I'm using is? [message #1811293] Fri, 30 August 2019 07:55 Go to next message
Sean Kuo is currently offline Sean KuoFriend
Messages: 28
Registered: August 2019
Junior Member
Hi everyone,

I'm running DHCP test of LANL2_demo,
however, I got a dynamic error:
Dynamic test case error: LANL2asp_PT('LANL2_PCO'): Cannot open socket on interface 'ens33' for reading with pcap. (Operation not permitted)

it was error with eth2 before,
index.php/fa/36194/0/
I thought there is a ens33 on my wireshark, so I changed it, still not working.
So, as topic said, if any one knows how to get available network interface name, that would be really amazing.
BTW, the environment is ubuntu 18.04 on VM.
---update1---
I surfed on internet for a while and I found that I could look up to /etc/network/interface,
and I found my interface name is "lo".
after I change to lo, one error is fixed:
3@ubuntu: LANL2asp__PT_PROVIDER::get_iface_mtu(eth0): ioctl() failed (No such device), assuming MTU 1500

index.php/fa/36196/0/

It was like below before:
index.php/fa/36195/0/

However, the dynamic error still exist :(
Dynamic test case error: LANL2asp_PT('LANL2_PCO'): Cannot open socket on interface 'lo' for reading with pcap. (Operation not permitted)


Any ideas is welcome guys.

Best regards

Sean

[Updated on: Fri, 30 August 2019 08:54]

Report message to a moderator

Re: How to know what network interface I'm using is? [message #1811301 is a reply to message #1811293] Fri, 30 August 2019 10:05 Go to previous messageGo to next message
roland gecse is currently offline roland gecseFriend
Messages: 20
Registered: December 2015
Junior Member
Did you try running it from a privileged account? I believe libpcap/PF_PACKET requires capabilities that are normally assigned to root...
Re: How to know what network interface I'm using is? [message #1811305 is a reply to message #1811301] Fri, 30 August 2019 11:12 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Sean,

Yes, Roland is right, you need an account with root privileges.
As for the interface name, ifconfig should have all the answers....

BR

Elemer
Re: How to know what network interface I'm using is? [message #1811306 is a reply to message #1811305] Fri, 30 August 2019 12:03 Go to previous messageGo to next message
Sean Kuo is currently offline Sean KuoFriend
Messages: 28
Registered: August 2019
Junior Member
Hi everyone,

I did tried to run as root(sudo ttcn3_start LANL2asp_CNL113519 cfg.cfg), but things got weird like this
Error: HC connection from localhost [127.0.0.1] was refused because of incorrect version.

so I thought it was wrong...

index.php/fa/36197/0/
Terminal on the right is the result that I run terminal as root, as same as the sudo one.
Do you guys have any clue about this situation..?

Best regards

Sean
Re: How to know what network interface I'm using is? [message #1811307 is a reply to message #1811306] Fri, 30 August 2019 12:13 Go to previous messageGo to next message
roland gecse is currently offline roland gecseFriend
Messages: 20
Registered: December 2015
Junior Member
You have a TITAN version mismatch. MC is R5A while the HC is R6A.
Make sure to use same TITAN version for MC and HC!
Re: How to know what network interface I'm using is? [message #1811314 is a reply to message #1811307] Fri, 30 August 2019 13:50 Go to previous messageGo to next message
Sean Kuo is currently offline Sean KuoFriend
Messages: 28
Registered: August 2019
Junior Member
Hi Roland,

Thanks for checking my result! :)
Wasn't notice that point at all.
May I ask you how to fix this?
The MC was R6A (on the left) when I executed in unprivileged account,
why it become R5A when I did it in root?
I was installed titan direct from git hub, why would the version become different?
Thanks for your time ans patience again.

Best regards

Sean
Re: How to know what network interface I'm using is? [message #1811327 is a reply to message #1811314] Sat, 31 August 2019 03:01 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Sean,

When you are switching accounts, the environment variables can and usually will change.
If you don't need the R5 installation, delete it to avoid confusion, and then make sure to check the
environment variables as specified during installation for both shells.

Now from the use shell R6 is visible,while from the root , R5.

Be aware that Ubuntu/Debian may already contain a default Titan install,
That is probably the origin of R5.

You can remove it with apt remove xxxx

BR
Elemer

[Updated on: Sat, 31 August 2019 03:06]

Report message to a moderator

Re: How to know what network interface I'm using is? [message #1814027 is a reply to message #1811327] Mon, 02 September 2019 05:34 Go to previous messageGo to next message
Sean Kuo is currently offline Sean KuoFriend
Messages: 28
Registered: August 2019
Junior Member
Hi Elemer,

So sorry to bother you with such a trivial problem, I have already removed eclipse-titan, even reinstall titan.core from github, but no matter how I edit /etc/environment and source it, ttcn3_start still only work in user mode but root mode, "sudo: ttcn3_start: command not found".
Could you please give me a hint about how to fix this titan installation problem?
This is how my /etc/environment looks like right now.
index.php/fa/36201/0/

---update---

This is so relieving when I found out I should delete env reset in /etc/sudoers and add $ttcn3_dir/bin into secure_path, finally can work with sudo!
Well it comes to another problem, how do i test this ?
I executed the program with
sudo ttcn3_start LANL2asp_CNL113519_demo cfg.cfg

, but the program stopped.
I thought it may be waiting for DHCP message, so I reconnect the network, but ttcn give me a big fail like this...
index.php/fa/36207/0/

---update2---

It doesn't need to reconnect, and I can get two bootp on wireshark.
index.php/fa/36203/0/
Just don't quite understand why discover would fail, currently grinding this part.
---update3---

index.php/fa/36205/0/
Changed cfg to loop, and got this result, seems like my ttcn does't like the offer it received.
Do you guy have any idea to make it accept it?

---update4---

It do need a reconnection in the very first time you execute in a terminal, then you can keep test it without any more reconnection if you are using the same terminal.
BTW sudo apt-get install libpcap-dev may help if pcap.h is missing in make
P.S. Is it legal to update a post so many times?

---update5---

Keep trying to edit demo_DHCP.ttcn to get a different result,
and found a problem that make twice would encounter a pcapclose not able to reference problem.
I don't have much time to dig in to what this is (but any ideas is still welcome) so I came up with a brainless way to avoid it: open another terminal and make in that terminal, voila.

---update6---

If there is anyone interested, the 190902DHCP_1.pcapng.1526.pcapng in file attachment is the DHCP offer packet I received, and the offer template in ttcnfile looks like below:
  template ASP_DHCP  tr_ASP_DHCP_REPLY_offer(OCT4 pl_xid, OCT6 pl_srcMAC) := {
    eth_src_addr := ?,
    eth_dst_addr := 'FFFFFFFFFFFF'O,
    ip_src_addr := ?,
    ip_dst_addr := 'FFFFFFFF'O,
    udp_src_port := 67,
    udp_dst_port := 68,
    pDU_DHCP := {
      bOOT_REPLY := {
        op := 2,
        htype := DHCP_HTYPE_Ethernet_10Mb,
        hlen := 6,
        hops := ?,
        xid := pl_xid,
        secs := 0,
        flags := '8000'O,
        ciaddr := '00000000'O,
        yiaddr := ?,
        siaddr := ?,
        giaddr := ?,
        chaddr := pl_srcMAC & '00000000000000000000'O,
        sname := {
          sname := ""
        },
        file := {
          file := ""
        },
        options := {
          magicCookie := '63825363'O,            // from RFC1497
          options := {
            {
              message_type := {
                code := DHCP_Message_Type_OPTION_TYPE,
                len := 1,
                val := DHCP_Offer
              }
            },
            *,
            {
              end := {
                code := DHCP_END_OPTION_TYPE
              }
            }
          }
        }//options end
      }//boot_reply end
    }//PDU DHCP end
  }//ASP DHCP end


Question about how to make the DHCP offer accepted is still open guys :)

Best regards

Sean

[Updated on: Mon, 02 September 2019 09:44]

Report message to a moderator

Re: How to know what network interface I'm using is? [message #1814066 is a reply to message #1814027] Mon, 02 September 2019 17:45 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Sean,

Your questions should be answered by a careful analysis of the logs generated by Titan.
The most likely cause for rejection of the DHCP message is a mismatch between the message itself
And the receiving template. Please compare them field by field.


By the way you have made quite a progress.

BR
Elemer
Re: How to know what network interface I'm using is? [message #1814074 is a reply to message #1814066] Tue, 03 September 2019 06:30 Go to previous messageGo to next message
Sean Kuo is currently offline Sean KuoFriend
Messages: 28
Registered: August 2019
Junior Member
Hi Elemer,

You are right sir.
Turns out it was the eth dst set in the tr_ASP_DHCP_REPLY_offer template made the fail call.
index.php/fa/36210/0/

I changed the dst to \?, then the mtc accept the offer happily.
Now, the offer is accept, however, it still gave me a fail verdict again and stop at ack.
index.php/fa/36211/0/

So I make the same trick I made in offer again in ack.
Now I got a really nicely pass.
index.php/fa/36212/0/

All of this must credit to you, all project developer, and ttcn course you posted, thanks you again!

---

If I may ask: would there always be a tpd in every testport and protocol module?
I have gone through the ttcn course a couple time though, still not quite understand which makefilegen augment I should use to generated a corrected makefile (Don't know how to edit it or write it my self, got to admit that I don't quite familiar with makefile too).
But thanks god there is a beautiful tpd file lies peacefully in there, so even I didn't quite sure why sometimes somefiles are missing for no reason, I can generate a nicely makefile. (Thanks to Balaskoa who teach me hoe to use this tpd file!)
Thats why I wonder is every official titan project have a tpd file included.
(Precisely, I'm talking about Testports and ProtocolModules on this page: github.com/eclipse/titan.core, especially those 5G_system one.)

---

May I ask how to use these 5g_system project?
I have randomly checked some (not all) of the 5g_system project on the titan.core page, gladly all of checked project have a tpd.
however non of them has any demo information (even in the adoc file).
I don't even saw what test port it is using :(

Best regards

Sean

[Updated on: Tue, 03 September 2019 08:25]

Report message to a moderator

Re: How to know what network interface I'm using is? [message #1814097 is a reply to message #1814074] Tue, 03 September 2019 14:39 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Sean,

Indeed generating the Makefile has a learning curve...

Yes, all test ports etc ought to have a .tpd.


As for the 5G please read first
https://www.eclipse.org/forums/index.php/t/1099372/

These are REST Apis, so familiarize yourself with testing REST Apis in general first.
If you look through this forum, you should find some related posts also.


BR

Elemer

Previous Topic:Need help to run a DNS test for ttcn3
Next Topic:Titan 6.6.0 in Debian testing/unstable
Goto Forum:
  


Current Time: Fri Mar 29 13:38:23 GMT 2024

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

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

Back to the top