Пакет UDP не достигает приложения, которое слушает на Ubuntu

Я отправляю пакет UDP от Ардуино, пакет достигают моего сервера Ubuntu, потому что возможно видеть его на tcpdump, как Вы видите. Но никогда не передается моему приложению, которое слушает на порте 8888. У кого-то есть идея что не так на пакете?

Моя версия Ubuntu: Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-generic-pae i686)

Это tcpdump:

tcpdump -i 1 udp port 8888 -vv -X
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 byte                                                       s
19:06:20.179117 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 131)
    192.168.1.53.3333 > diskServer.8888: [udp sum ok] UDP, length 103
        0x0000:  4500 0083 0000 4000 4011 b6b1 c0a8 0135  E.....@.@......5
        0x0010:  c0a8 0133 0d05 22b8 006f 87d6 7465 7374  ...3.."..o..test
        0x0020:  2030 3132 3334 3536 3738 3930 2074 6573  .01234567890.tes
        0x0030:  7420 3031 3233 3435 3637 3839 3020 7465  t.01234567890.te
        0x0040:  7374 2030 3132 3334 3536 3738 3930 2074  st.01234567890.t
        0x0050:  6573 7420 3031 3233 3435 3637 3839 3020  est.01234567890.
        0x0060:  7465 7374 2030 3132 3334 3536 3738 3930  test.01234567890
        0x0070:  2074 6573 7420 3031 3233 3435 3637 3839  .test.0123456789
        0x0080:  3020 00                                  0..

Это - Порт прослушивания:

root@diskServer:~# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 diskServer:mysql        *:*                     LISTEN
tcp        0      0 *:netbios-ssn           *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0      0 *:https                 *:*                     LISTEN
tcp        0      0 *:microsoft-ds          *:*                     LISTEN
tcp        0      0 diskServer:ssh          flavix:53077            ESTABLISHED
tcp        0    144 diskServer:ssh          flavix:53028            ESTABLISHED
tcp        0      0 diskServer:ssh          192.168.1.107:54978     ESTABLISHED
tcp        0      0 diskServer:ssh          192.168.1.107:55000     ESTABLISHED
tcp6       0      0 [::]:8009               [::]:*                  LISTEN
tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
tcp6       0      0 [::]:8443               [::]:*                  LISTEN
tcp6       0      0 localhost:8005          [::]:*                  LISTEN
udp        0      0 diskServer:ntp          *:*
udp        0      0 localhost:ntp           *:*
udp        0      0 *:ntp                   *:*
udp        0      0 192.168.1.25:netbios-ns *:*
udp        0      0 diskServer:netbios-ns   *:*
udp        0      0 *:netbios-ns            *:*
udp        0      0 192.168.1.2:netbios-dgm *:*
udp        0      0 diskServer:netbios-dgm  *:*
udp        0      0 *:netbios-dgm           *:*
udp        0      0 diskServer:8888         *:***
udp6       0      0 ip6-localhost:ntp       [::]:*
udp6       0      0 fe80::20e:7bff:feac:ntp [::]:*
udp6       0      0 [::]:ntp                [::]:*

Память UDP:

root@diskServer:~# cat /proc/sys/net/ipv4/udp_mem
18066   24090   36132

root@diskServer:~# netstat -su
IcmpMsg:
    InType3: 10316969
    InType8: 18368
    OutType0: 18368
    OutType3: 10317030
Udp:
    211263 packets received
    10309092 packets to unknown port received.
    0 packet receive errors
    10348446 packets sent
UdpLite:
IpExt:
    InMcastPkts: 24678
    InBcastPkts: 287164
    OutBcastPkts: 12685
    InOctets: -1
    OutOctets: -1
    InMcastOctets: 690984
    InBcastOctets: 48281994
    OutBcastOctets: 3170039

root@diskServer:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
fail2ban-apache-badbots  tcp  --  anywhere             anywhere             multiport dports http,https
fail2ban-apache-overflows  tcp  --  anywhere             anywhere             multiport dports http,https
fail2ban-apache-noscript  tcp  --  anywhere             anywhere             multiport dports http,https
fail2ban-apache  tcp  --  anywhere             anywhere             multiport dports http,https
fail2ban-ssh  tcp  --  anywhere             anywhere             multiport dports ssh
ufw-before-logging-input  all  --  anywhere             anywhere
ufw-before-input  all  --  anywhere             anywhere
ufw-after-input  all  --  anywhere             anywhere
ufw-after-logging-input  all  --  anywhere             anywhere
ufw-reject-input  all  --  anywhere             anywhere
ufw-track-input  all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ufw-before-logging-forward  all  --  anywhere             anywhere
ufw-before-forward  all  --  anywhere             anywhere
ufw-after-forward  all  --  anywhere             anywhere
ufw-after-logging-forward  all  --  anywhere             anywhere
ufw-reject-forward  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ufw-before-logging-output  all  --  anywhere             anywhere
ufw-before-output  all  --  anywhere             anywhere
ufw-after-output  all  --  anywhere             anywhere
ufw-after-logging-output  all  --  anywhere             anywhere
ufw-reject-output  all  --  anywhere             anywhere
ufw-track-output  all  --  anywhere             anywhere

Chain fail2ban-apache (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain fail2ban-apache-badbots (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain fail2ban-apache-noscript (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain fail2ban-apache-overflows (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain fail2ban-ssh (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain ufw-after-forward (1 references)
target     prot opt source               destination

Chain ufw-after-input (1 references)
target     prot opt source               destination

Chain ufw-after-logging-forward (1 references)
target     prot opt source               destination

Chain ufw-after-logging-input (1 references)
target     prot opt source               destination

Chain ufw-after-logging-output (1 references)
target     prot opt source               destination

Chain ufw-after-output (1 references)
target     prot opt source               destination

Chain ufw-before-forward (1 references)
target     prot opt source               destination

Chain ufw-before-input (1 references)
target     prot opt source               destination

Chain ufw-before-logging-forward (1 references)
target     prot opt source               destination

Chain ufw-before-logging-input (1 references)
target     prot opt source               destination

Chain ufw-before-logging-output (1 references)
target     prot opt source               destination

Chain ufw-before-output (1 references)
target     prot opt source               destination

Chain ufw-reject-forward (1 references)
target     prot opt source               destination

Chain ufw-reject-input (1 references)
target     prot opt source               destination

Chain ufw-reject-output (1 references)
target     prot opt source               destination

Chain ufw-track-input (1 references)
target     prot opt source               destination

Chain ufw-track-output (1 references)
target     prot opt source               destination

ufw отключен.

1
задан 10 February 2016 в 22:37

2 ответа

Проблема была в пакете, который является неправильным, потому что место назначения на уровне Ethernet было установлено на 0, это - вывод wireShark:

Ethernet II, Src: 74:69:69:2d:30:31 (74:69:69:2d:30:31), Dst: 0:00:00 _00:00:00 (00:00:00:00:00:00)

Это происходит из-за аппаратной проблемы на моей плате Ардуино.

Thaks ко всем, Чао.

1
ответ дан 7 December 2019 в 16:02

Фактическая проблема находится, вероятно, в ethercard библиотеке, которой пользовались. Это правильно не обрабатывает поиск ARP для места назначения, вызывание всего обнуляет целевой MAC-адрес (см. https://github.com/jcw/ethercard/issues/181).

дополнительная библиотека, которая действительно работает, является Ethernet_UIP, который может быть найден в https://github.com/ntruchsess/arduino_uip и который имеет пример, который отправляет пакеты UDP; я протестировал тот пример, и он действительно работает.

0
ответ дан 7 December 2019 в 16:02

Другие вопросы по тегам:

Похожие вопросы: