This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TAP device not created on running "ping_test"


> Hi Mandeep
>
> I would narrow a circle. First, try to bring up and configure any tapN
> device on a host handy (without rawether and eCos app). Test then that
> interface. I found that `tunctl' utility is very useful for that. I'd
> installed it from sources, but, the utility exists in the Ubuntu's
> `uml-utilities' package.
>
> I want to believe that is host-side issue. It's just command to start
>
> man tunctl
>
> Create (tunctl), configure (ifconfig/route) e.g. tap0 device and check
> that works as you could expect (ping). Then go to eCos network tests.

Thanks for pointing out tunctl. But I'm not able to get ping to work...!

I created a device tap0. Assigned it an IP addr: 1.1.1.2/24
Then I setup eth0 with IP 1.1.1.3/24

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1d:09:54:e6:e3
          inet addr:1.1.1.2  Bcast:1.1.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17

$ ifconfig tap0
tap0      Link encap:Ethernet  HWaddr 4e:54:8e:5a:9e:80
          inet addr:1.1.1.3  Bcast:1.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4c54:8eff:fe5a:9e80/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:17 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:2184 (2.1 KB)  TX bytes:0 (0.0 B)

pinging each of these IP's obviously works as the kernel sees these 2
IP addr's as assigned local interfaces, so I guess the packets never go out
of the interface.

$ ping 1.1.1.2
PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data.
64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.044 ms
^C
--- 1.1.1.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.044/0.044/0.044/0.000 ms
$ ping 1.1.1.3
PING 1.1.1.3 (1.1.1.3) 56(84) bytes of data.
64 bytes from 1.1.1.3: icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from 1.1.1.3: icmp_seq=2 ttl=64 time=0.041 ms
^C
--- 1.1.1.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms
$

But, if I ping specifying the interface, then it does not work!

$ ping -I tap0 1.1.1.2
PING 1.1.1.2 (1.1.1.2) from 1.1.1.2 tap0: 56(84) bytes of data.
>From 1.1.1.3 icmp_seq=1 Destination Host Unreachable
>From 1.1.1.3 icmp_seq=2 Destination Host Unreachable
>From 1.1.1.3 icmp_seq=3 Destination Host Unreachable
^C
--- 1.1.1.2 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3015ms
, pipe 3
$

Shouldn't the packet coming out of tap0 be routed to the proper interface by
the kernel?

I also ran the "ping_test" of ecos with the following setup.

My host:
ethernet.tdf : eth0 real eth0
ecos IP: 1.1.1.3/24
server IP: 1.1.1.10

I had connected my PC's eth0 to another PCs eth port. On second PC
eth0's IP was 1.1.1.10

Running the ping test shows that ecos is able to send/rcv packets from 1.1.1.10

Now if I change tdf file to use tap0:
eth0 ethertap tap0 00:FE:42:63:84:A5

And setup eth0 locally on my PC with same IP (1.1.1.10), the test
starts failing.

Any pointers?

I'm trying to create a TAP device from a userspace program to see if I
get a tap0
device when I open /dev/net/tun with the proper IOCTL. The sample snip
shown here does not work though!
http://www.mjmwired.net/kernel/Documentation/networking/tuntap.txt

The program is not even compiling! :( Trying to fix that now!

-mandeep

>
> Sergei
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]