noxrepo / pox

The POX network software platform
https://noxrepo.github.io/pox-doc/html/
Apache License 2.0
628 stars 473 forks source link

host_tracker can not get ip address #125

Open zyqhi opened 10 years ago

zyqhi commented 10 years ago

I run pox with component host_tracker, and I also print macEntry in host_tracker.py, but I can only get mac address, and ip is none. How can I get ip address.

MurphyMc commented 10 years ago

Please provide more detail. What version of POX are you running? What commandline are you using? What does the log show at debug level?

Perhaps most importantly... what are you doing on the hosts to make them show up in host_tracker at all? Are you, for example, pinging other hosts?

zyqhi commented 10 years ago

Thanks for your reply.

  1. POX version: root@ubuntu:/home/zyqhi/project/pox# ./pox.py --version POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al.
  2. commandline using in POX: ./pox.py --verbose host_tracker openflow.discovery samples.pretty_log pox.forwarding.l2_pairs

3.commandline in mininet: root@ubuntu:/home/zyqhi/project/mininet/bin# ./mn --controller=remote,ip=127.0.0.1,port=6633 --topo tree,depth=2,fanout=2

4.First, I start up pox, and than run mininet, the output of pox is, I have add 'print macEntry' in function _check_timeouts in host_tracker.py, here is the output, what I confused is why the IPAddr is None, I can not get the ip address: root@ubuntu:/home/zyqhi/project/pox# ./pox.py --verbose host_tracker openflow.discovery samples.pretty_log forwarding.l3_learning POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al. INFO:host_tracker:host_tracker ready [core ] POX 0.2.0 (carp) going up... [core ] Running on CPython (2.7.5+/Feb 27 2014 19:39:55) [core ] Platform is Linux-3.11.0-26-generic-i686-with-Ubuntu-13.10-saucy [forwarding.l3_learning ] Up... [core ] POX 0.2.0 (carp) is up. [openflow.of_01 ] Listening on 0.0.0.0:6633 [openflow.of_01 ] [00-00-00-00-00-02 1] connected [openflow.discovery ] Installing flow for 00-00-00-00-00-02 my dpid is: 2 [openflow.of_01 ] [00-00-00-00-00-01 2] connected [openflow.discovery ] Installing flow for 00-00-00-00-00-01 my dpid is: 1 [openflow.of_01 ] [00-00-00-00-00-03 3] connected [openflow.discovery ] Installing flow for 00-00-00-00-00-03 my dpid is: 3 [openflow.discovery ] link detected: 00-00-00-00-00-02.3 -> 00-00-00-00-00-01.1 [openflow.discovery ] link detected: 00-00-00-00-00-01.1 -> 00-00-00-00-00-02.3 [openflow.discovery ] link detected: 00-00-00-00-00-01.2 -> 00-00-00-00-00-03.3 [openflow.discovery ] link detected: 00-00-00-00-00-03.3 -> 00-00-00-00-00-01.2 [openflow.of_01 ] [00-00-00-00-00-03 3] closed [openflow.of_01 ] [00-00-00-00-00-02 1] closed [openflow.of_01 ] [00-00-00-00-00-01 2] closed [openflow.of_01 ] [None 4] closed [openflow.of_01 ] [00-00-00-00-00-01 5] connected [openflow.discovery ] Installing flow for 00-00-00-00-00-01 my dpid is: 1 [host_tracker ] I have learned 1 65534 b2:9d:6a:ec:6b:49 [host_tracker ] I have learned 2 3 5e:62:e2:1c:65:ca [openflow.of_01 ] [00-00-00-00-00-02 6] connected [openflow.discovery ] Installing flow for 00-00-00-00-00-02 my dpid is: 2 [host_tracker ] I have learned 2 65534 c6:16:9f:73:79:44 [host_tracker ] I have learned 1 2 76:c1:94:8d:b1:8f packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated [openflow.of_01 ] [00-00-00-00-00-03 7] connected [openflow.discovery ] Installing flow for 00-00-00-00-00-03 my dpid is: 3 packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated [host_tracker ] I have learned 3 2 3e:61:f9:c4:03:71 [host_tracker ] I have learned 1 1 62:76:25:4b:46:76 packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated [host_tracker ] I have learned 3 3 9a:b7:2d:c2:70:48 packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated [host_tracker ] I have learned 3 65534 5a:5a:08:51:40:44 packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated [openflow.discovery ] link detected: 00-00-00-00-00-01.1 -> 00-00-00-00-00-02.3 packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated [openflow.discovery ] link detected: 00-00-00-00-00-01.2 -> 00-00-00-00-00-03.3 packet warning IP packet data incomplete (114 of 323) packet parsing questions: next_question: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated [openflow.discovery ] link detected: 00-00-00-00-00-02.3 -> 00-00-00-00-00-01.1 packet warning IP packet data incomplete (114 of 168) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated [host_tracker ] I have learned 2 1 16:be:d9:c7:c5:d0 packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated [host_tracker ] I have learned 2 2 b2:d8:04:bc:97:7e [host_tracker ] I have learned 3 1 f2:5f:cb:42:ab:4c packet warning IP packet data incomplete (114 of 269) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 269) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated packet warning IP packet data incomplete (114 of 269) packet parsing answers: next_rr: data truncated packet warning IP packet data incomplete (114 of 269) packet parsing answers: next_rr: data truncated macEntry is: 2 3 5e:62:e2:1c:65:ca macEntry is: 2 2 b2:d8:04:bc:97:7e macEntry is: 3 65534 5a:5a:08:51:40:44 macEntry is: 1 65534 b2:9d:6a:ec:6b:49 macEntry is: 3 3 9a:b7:2d:c2:70:48 macEntry is: 3 2 3e:61:f9:c4:03:71 macEntry is: 1 2 76:c1:94:8d:b1:8f macEntry is: 2 65534 c6:16:9f:73:79:44 macEntry is: 2 1 16:be:d9:c7:c5:d0 macEntry is: 3 1 f2:5f:cb:42:ab:4c macEntry is: 1 1 62:76:25:4b:46:76 packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated [openflow.discovery ] link detected: 00-00-00-00-00-03.3 -> 00-00-00-00-00-01.2 packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated packet warning IP packet data incomplete (114 of 299) packet parsing answers: next_rr: truncated macEntry is: 2 3 5e:62:e2:1c:65:ca macEntry is: 2 2 b2:d8:04:bc:97:7e macEntry is: 3 65534 5a:5a:08:51:40:44 macEntry is: 1 65534 b2:9d:6a:ec:6b:49 macEntry is: 3 3 9a:b7:2d:c2:70:48 macEntry is: 3 2 3e:61:f9:c4:03:71 macEntry is: 1 2 76:c1:94:8d:b1:8f macEntry is: 2 65534 c6:16:9f:73:79:44 macEntry is: 2 1 16:be:d9:c7:c5:d0 macEntry is: 3 1 f2:5f:cb:42:ab:4c macEntry is: 1 1 62:76:25:4b:46:76 macEntry is: 2 3 5e:62:e2:1c:65:ca macEntry is: 2 2 b2:d8:04:bc:97:7e macEntry is: 3 65534 5a:5a:08:51:40:44 macEntry is: 1 65534 b2:9d:6a:ec:6b:49 macEntry is: 3 3 9a:b7:2d:c2:70:48 macEntry is: 3 2 3e:61:f9:c4:03:71 macEntry is: 1 2 76:c1:94:8d:b1:8f macEntry is: 2 65534 c6:16:9f:73:79:44 macEntry is: 2 1 16:be:d9:c7:c5:d0 macEntry is: 3 1 f2:5f:cb:42:ab:4c macEntry is: 1 1 62:76:25:4b:46:76 ^C[core ] Going down... [openflow.of_01 ] [00-00-00-00-00-01 5] disconnected [openflow.of_01 ] [00-00-00-00-00-02 6] disconnected [openflow.of_01 ] [00-00-00-00-00-03 7] disconnected [core ] Down.

MurphyMc commented 10 years ago

I'll start with a few suggestions/notes...

Turn on misc.full_payload to cut down some extraneous log messages.

Again... are you pinging hosts in Mininet or something? host_tracker works by monitoring traffic, so there needs to be traffic containing IP addresses for it to track.

Try starting with a simpler topology. Like a single switch with two hosts, for example.

zyqhi commented 10 years ago

When I pinging hosts in Mininet, I can gain the IP address. Host tracker has learned the MAC, how it works. In which traffic it gains the MAC address, why I can't get the IP address from that traffic?

MurphyMc commented 10 years ago

You'd have to look at the traffic with Wireshark or something to know for sure exactly what's going on. But basically the answer should be that you're picking up the Ethernet addresses from traffic which isn't IP traffic, therefore doesn't contain IP addresses, therefore host_tracker can't learn IP addresses from it. (That's a slight simplification -- if I remember right, host_tracker can also pick up IPs from ARP.)

One possibility is that you're picking up IPv6 discovery stuff, which isn't useful for host_tracker (since it only handles IPv4).