Commit d8a7048d authored by Pedro Oliveira's avatar Pedro Oliveira

test IGMP and results

parent 8eaa6c2c
Script started on Thu Jul 19 16:31:49 2018
root@switch1:~# tcpdump -i br0 -Q in -w /hosthD ome/Desktop/Test1.[1@I[1@g[1@m[1@pTest1.ca  pcap / &
[1] 1606
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
root@switch1:~# pt ython3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 16:32:44,738 0 eth0 R1 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:34:42,682 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:34:42,689 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:34:42,698 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState DEBUG 2018-07-19 16:36:47,751 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:36:47,754 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:38:52,817 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:38:52,819 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:40:57,872 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:40:57,874 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:43:02,927 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:43:02,925 0 eth0 R2 NonQuerier state: receive_query
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest1.pcap
^C50 packets captured
86 packets received by filter
0 packets dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 16:43:43 2018
Script started on Thu Jul 19 16:46:52 2018
root@switch1:~# exitfgpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest1.pcap &[1@2
[1] 1671
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest2.pcap & root@switch1:~# exitfgpython3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 16:47:17,601 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:47:17,602 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState DEBUG 2018-07-19 16:49:22,620 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:49:22,623 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 16:53:37,686 0 eth0 R2 NonQuerier state: other_querier_present_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:53:37,689 0 eth0 R2 change querier state to -> Querier
protocol.igmp.RouterState DEBUG 2018-07-19 16:55:42,754 0 eth0 R2 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:57:47,799 0 eth0 R2 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 16:59:52,848 0 eth0 R2 Querier state: general_query_timeout
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest2.pcap
^C39 packets captured
68 packets received by filter
0 packets dropped by kernel
root@switch1:~#
root@switch1:~# exit
exit
Script done on Thu Jul 19 17:00:05 2018
Script started on Thu Jul 19 17:02:18 2018
root@switch1:~# exitfgpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest2.pcap &[1@3
[1] 1721
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest3.pcap & root@switch1:~# exitfgpython3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 17:02:53,219 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 17:02:53,220 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState DEBUG 2018-07-19 17:04:58,233 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:04:58,232 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 17:07:03,274 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:09:08,297 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:11:13,316 0 eth0 R1 Querier state: general_query_timeout
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest3.pcap
^C34 packets captured
61 packets received by filter
1 packet dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 17:11:59 2018
Script started on Thu Jul 19 17:13:50 2018
root@switch1:~# exitfgpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest3.pcap &IgmpTest3[1@5.pcap &
[1] 1732
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest5.pcap & root@switch1:~# exitfgpython3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 17:14:12,528 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 17:14:12,529 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:41,721 (*,224.12.12.12) 0 eth0 R2 NonQuerier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:41,726 (*,224.12.12.12) 0 eth0 R1 Querier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:41,732 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:41,739 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:46,199 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:46,195 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:52,261 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:14:52,258 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:16:17,706 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:16:17,709 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:16:20,036 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:16:20,044 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:18:22,803 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:18:22,807 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:18:26,358 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:18:26,353 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:20:27,830 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:20:27,834 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:20:35,933 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:20:35,929 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest5.pcap
^C54 packets captured
95 packets received by filter
0 packets dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 17:20:54 2018
Script started on Thu Jul 19 17:24:09 2018
root@switch1:~# exitfgexitpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest6.pcap &
[1] 1752
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest6.pcap & root@switch1:~# exitfgexitpython3 ServerLog.py root@switch1:~# exitpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest6.pcap & root@switch1:~# python3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 17:24:30,530 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 17:24:30,531 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:40,922 (*,224.12.12.12) 0 eth0 R2 NonQuerier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:40,929 (*,224.12.12.12) 0 eth0 R1 Querier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:40,971 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:40,983 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:47,495 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:47,491 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:51,066 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:24:51,070 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:25:25,557 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:25:25,553 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:25:27,751 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:25:27,747 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:25:36,025 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:25:36,029 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:26:35,601 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:26:35,604 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:26:42,845 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:26:42,849 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:26:44,921 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:26:44,920 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:28:40,632 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:28:40,635 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:28:42,026 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:28:42,023 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:28:50,236 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:28:50,241 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:30:45,668 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:30:45,671 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:30:51,702 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:30:51,698 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:30:54,524 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:30:54,523 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:32:50,722 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:32:50,726 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:32:57,247 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:32:57,251 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:33:00,002 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:32:59,997 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest6.pcap
^C86 packets captured
150 packets received by filter
0 packets dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 17:33:09 2018
Script started on Thu Jul 19 17:39:55 2018
root@switch1:~# exitfgpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest6.pcap &[1@7
[1] 1763
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest7.pcap & root@switch1:~# exitfgpython3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 17:40:15,442 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 17:40:15,444 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:24,593 (*,224.12.12.12) 0 eth0 R2 NonQuerier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:24,598 (*,224.12.12.12) 0 eth0 R1 Querier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:24,605 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:24,610 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:29,104 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:29,109 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:33,065 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:33,062 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:37,688 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:37,692 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:37,962 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:37,966 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:42,967 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:40:42,971 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:42:20,479 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:42:20,490 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:24,065 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:24,069 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:29,671 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:29,667 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:44,732 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_leave_group
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:44,748 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_leave_group
protocol.igmp.RouterState DEBUG 2018-07-19 17:42:44,807 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:44,811 (*,224.12.12.12) 0 eth0 R1 change membership state to: CheckingMembership
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:44,823 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_group_specific_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:44,835 (*,224.12.12.12) 0 eth0 R2 change membership state to: CheckingMembership
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:45,035 (*,224.12.12.12) 0 eth0 R1 Querier CheckingMembership: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:45,032 (*,224.12.12.12) 0 eth0 R2 NonQuerier CheckingMembership: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:45,087 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:45,084 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:42:45,823 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: retransmit_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:44:25,515 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:44:25,520 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:44:26,171 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:44:26,167 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 17:46:30,579 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 17:46:30,582 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:46:36,169 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:46:36,165 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest7.pcap
^C80 packets captured
140 packets received by filter
0 packets dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 17:46:48 2018
Script started on Thu Jul 19 17:58:08 2018
root@switch1:~# exitfgpython3 ServerLog.py root@switch1:~# tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest8.pcap &
[1] 1794
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest8.pcap & root@switch1:~# exitfgpython3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 17:58:35,554 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 17:58:35,555 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:41,038 (*,224.12.12.12) 0 eth0 R2 NonQuerier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:41,046 (*,224.12.12.12) 0 eth0 R1 Querier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:41,073 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:41,080 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:45,424 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:45,428 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:50,398 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:50,394 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:52,370 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:52,367 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:58,642 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:58:58,646 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:59:01,949 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 17:59:01,953 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 18:00:40,578 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:00:40,588 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:00:41,811 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:00:41,809 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:00:42,645 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:00:42,642 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:02,590 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_leave_group
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:02,589 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_leave_group
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:02,682 (*,224.12.12.12) 0 eth0 R1 change membership state to: CheckingMembership
protocol.igmp.RouterState DEBUG 2018-07-19 18:01:02,680 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:02,698 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_group_specific_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:02,710 (*,224.12.12.12) 0 eth0 R2 change membership state to: CheckingMembership
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:03,690 (*,224.12.12.12) 0 eth0 R1 Querier CheckingMembership: retransmit_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:01:03,693 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:03,747 (*,224.12.12.12) 0 eth0 R1 Querier CheckingMembership: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:03,743 (*,224.12.12.12) 0 eth0 R2 NonQuerier CheckingMembership: receive_group_specific_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:03,749 (*,224.12.12.12) 0 eth0 R2 NonQuerier CheckingMembership: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:03,802 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:03,805 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:01:04,813 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: retransmit_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:02:45,646 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:02:45,651 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:02:50,645 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:02:50,650 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:20,849 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_leave_group
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:20,861 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_leave_group
protocol.igmp.RouterState DEBUG 2018-07-19 18:04:20,939 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:20,943 (*,224.12.12.12) 0 eth0 R1 change membership state to: CheckingMembership
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:20,955 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_group_specific_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:20,969 (*,224.12.12.12) 0 eth0 R2 change membership state to: CheckingMembership
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:21,952 (*,224.12.12.12) 0 eth0 R1 Querier CheckingMembership: retransmit_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:04:21,953 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:22,009 (*,224.12.12.12) 0 eth0 R2 NonQuerier CheckingMembership: receive_group_specific_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:22,948 (*,224.12.12.12) 0 eth0 R1 Querier CheckingMembership: group_membership_timeout
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:22,950 (*,224.12.12.12) 0 eth0 R1 change membership state to: NoMembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:22,973 (*,224.12.12.12) 0 eth0 R2 NonQuerier CheckingMembership: group_membership_timeout
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:04:22,975 (*,224.12.12.12) 0 eth0 R2 change membership state to: NoMembersPresent
protocol.igmp.RouterState DEBUG 2018-07-19 18:04:50,709 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:04:50,716 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 18:06:55,776 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:06:55,775 0 eth0 R2 NonQuerier state: receive_query
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest8.pcap
^C103 packets captured
182 packets received by filter
0 packets dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 18:07:20 2018
Script started on Thu Jul 19 18:13:38 2018
root@switch1:~# tcpdump -i br0 -q Q in -w /hosthome/Desktop/IgmpTest9.pcpa  ap &
[1] 1579
root@switch1:~# tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
root@switch1:~# python3 ServerLog.py root@switch1:~# python3 ServerLog.py
About to start TCP server...
protocol.igmp.RouterState DEBUG 2018-07-19 18:14:29,328 0 eth0 R2 Querier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 18:14:29,329 0 eth0 R2 change querier state to -> NonQuerier
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:14:48,366 (*,224.12.12.12) 0 eth0 R2 NonQuerier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:14:48,383 (*,224.12.12.12) 0 eth0 R1 Querier NoMembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:14:48,427 (*,224.12.12.12) 0 eth0 R2 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:14:48,455 (*,224.12.12.12) 0 eth0 R1 change membership state to: MembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:14:58,401 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:14:58,407 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:15:08,087 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:15:08,083 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 18:16:34,357 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:16:34,361 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:16:39,172 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:16:39,168 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 18:18:39,459 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:18:39,458 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:18:44,944 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:18:44,939 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 18:20:44,487 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:20:44,488 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:20:47,660 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:20:47,664 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: receive_v2_membership_report
protocol.igmp.RouterState DEBUG 2018-07-19 18:22:49,554 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:22:49,558 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState DEBUG 2018-07-19 18:24:54,628 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:24:54,632 0 eth0 R2 NonQuerier state: receive_query
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:25:07,687 (*,224.12.12.12) 0 eth0 R1 Querier MembersPresent: group_membership_timeout
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:25:07,691 (*,224.12.12.12) 0 eth0 R1 change membership state to: NoMembersPresent
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:25:07,684 (*,224.12.12.12) 0 eth0 R2 NonQuerier MembersPresent: group_membership_timeout
protocol.igmp.RouterState.GroupState DEBUG 2018-07-19 18:25:07,689 (*,224.12.12.12) 0 eth0 R2 change membership state to: NoMembersPresent
protocol.igmp.RouterState DEBUG 2018-07-19 18:26:59,694 0 eth0 R1 Querier state: general_query_timeout
protocol.igmp.RouterState DEBUG 2018-07-19 18:26:59,697 0 eth0 R2 NonQuerier state: receive_query
^CTraceback (most recent call last):
File "ServerLog.py", line 105, in <module>
main()
File "ServerLog.py", line 101, in main
tcpserver.serve_until_stopped()
File "ServerLog.py", line 83, in serve_until_stopped
self.timeout)
KeyboardInterrupt
^CException KeyboardInterrupt: KeyboardInterrupt() in <module 'threading' from '/usr/lib/python3.2/threading.py'> ignored
root@switch1:~# fg
tcpdump -i br0 -Q in -w /hosthome/Desktop/IgmpTest9.pcap
^C76 packets captured
136 packets received by filter
1 packet dropped by kernel
root@switch1:~# exit
exit
Script done on Thu Jul 19 18:27:20 2018
ip addr add dev eth0 10.1.0.1/24
ip addr add dev eth0 10.0.0.3/24
ip link set dev eth0 up
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.1.0.2
# install python
#apt-get update && apt-get --assume-yes install python3 python3-pip
pip-3.2 install --index-url=https://pypi.python.org/simple/ netifaces
import socket
import struct
import sys
import netifaces
import traceback
import signal
is_running = True
sock = None
def exit(signal, frame):
is_running = False
sock.close()
sys.exit(0)
def chooseInterface():
interfaces = netifaces.interfaces()
def printInterfaces():
print('Indique a interface de captura:')
for i in range(len(interfaces)):
print (i+1, '-', interfaces[i])
if len(interfaces) == 1: #user has just 1 interface and any
return interfaces[0]
else:
printInterfaces()
inputValue = input('Numero da interface: ')
if int(inputValue)-1 not in range(len(interfaces)):
raise Exception('numero de interface invalida')
inputValue = interfaces[int(inputValue)-1]
return inputValue
signal.signal(signal.SIGINT, exit)
signal.signal(signal.SIGTERM, exit)
multicast_group = ('224.12.12.12', 10000)
# Create the datagram socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Set the time-to-live for messages to 1 so they do not go past the
# local network segment.
ttl = struct.pack('b', 12)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl)
interface_name = chooseInterface()
ip_interface = netifaces.ifaddresses(interface_name)[netifaces.AF_INET][0]['addr']
sock.bind((ip_interface, 10000))
try:
# Look for responses from all recipients
while is_running:
input_msg = input('msg --> ')
try:
sock.sendto(input_msg.encode("utf-8"), multicast_group)
except:
traceback.print_exc()
continue
#print >>sys.stderr, 'received "%s" from %s' % (data, server)
finally:
#print >>sys.stderr, 'closing socket'
sock.close()
ip addr add dev eth0 10.0.2.10/24
ip addr add dev eth0 10.0.0.4/24
ip link set dev eth0 up
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.0.2.3
# install python
#apt-get update && apt-get --assume-yes install python3 python3-pip
pip-3.2 install --index-url=https://pypi.python.org/simple/ netifaces
import socket
import struct
import sys
import netifaces
import traceback
import signal
is_running = True
sock = None
def exit(signal, frame):
is_running = False
sock.close()
sys.exit(0)
def chooseInterface():
interfaces = netifaces.interfaces()
def printInterfaces():
print('Indique a interface de captura:')
for i in range(len(interfaces)):
print (i+1, '-', interfaces[i])
if len(interfaces) == 1: #user has just 1 interface and any
return interfaces[0]
else:
printInterfaces()
inputValue = input('Numero da interface: ')
if int(inputValue)-1 not in range(len(interfaces)):
raise Exception('numero de interface invalida')
inputValue = interfaces[int(inputValue)-1]
return inputValue
signal.signal(signal.SIGINT, exit)
signal.signal(signal.SIGTERM, exit)
multicast_group = ('224.12.12.12', 10000)
# Create the datagram socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Set the time-to-live for messages to 1 so they do not go past the
# local network segment.
ttl = struct.pack('b', 12)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl)
interface_name = chooseInterface()
ip_interface = netifaces.ifaddresses(interface_name)[netifaces.AF_INET][0]['addr']
sock.bind((ip_interface, 10000))
try:
# Look for responses from all recipients
while is_running:
input_msg = input('msg --> ')
try:
sock.sendto(input_msg.encode("utf-8"), multicast_group)
except:
traceback.print_exc()
continue
#print >>sys.stderr, 'received "%s" from %s' % (data, server)
finally:
#print >>sys.stderr, 'closing socket'
sock.close()
ip addr add dev eth0 10.0.3.10/24
ip link set dev eth0 up
#default route para obter conectividade internet
ip route add 0.0.0.0/0 via 10.0.3.4
# install python
#apt-get update && apt-get --assume-yes install python3 python3-pip
pip-3.2 install --index-url=https://pypi.python.org/simple/ netifaces
nameserver 8.8.8.8
nameserver 8.8.4.4
import socket
import struct
import sys
import netifaces
import signal
import sys
is_running = True
sock = None
def exit(signal, frame):
is_running = False
sock.close()
sys.exit(0)
def chooseInterface():
interfaces = netifaces.interfaces()
def printInterfaces():
print('Indique a interface de captura:')
for i in range(len(interfaces)):
print (i+1, '-', interfaces[i])
if len(interfaces) == 1: #user has just 1 interface and any
return interfaces[0]
else:
printInterfaces()
inputValue = input('Numero da interface: ')
if int(inputValue)-1 not in range(len(interfaces)):
raise Exception('numero de interface invalida')
inputValue = interfaces[int(inputValue)-1]
return inputValue
if not hasattr(socket, 'SO_BINDTODEVICE'):
socket.SO_BINDTODEVICE = 25
signal.signal(signal.SIGINT, exit)
signal.signal(signal.SIGTERM, exit)
multicast_group = '224.12.12.12'
server_address = ('', 10000)
# Create the socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind to the server address
sock.bind(server_address)
#interface_name = input("interface name: ")
interface_name = chooseInterface()
ip_interface = netifaces.ifaddresses(interface_name)[netifaces.AF_INET][0]['addr']
# Tell the operating system to add the socket to the multicast group
# on all interfaces.
group = socket.inet_aton(multicast_group)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP,
socket.inet_aton(multicast_group) + socket.inet_aton(ip_interface))
#sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, str(interface_name + "\0").encode('utf-8'))
# Receive/respond loop
while is_running:
#print >>sys.stderr, '\nwaiting to receive message'
data, address = sock.recvfrom(10240)
print(data.decode("utf-8"))
#print >>sys.stderr, 'received %s bytes from %s' % (len(data), address)
#print >>sys.stderr, data
#print >>sys.stderr, 'sending acknowledgement to', address
#sock.sendto('ack', address)
import socket
import struct
import sys
import netifaces
import traceback
import signal
is_running = True
sock = None
def exit(signal, frame):
is_running = False
sock.close()
sys.exit(0)
def chooseInterface():
interfaces = netifaces.interfaces()
def printInterfaces():
print('Indique a interface de captura:')
for i in range(len(interfaces)):
print (i+1, '-', interfaces[i])
if len(interfaces) == 1: #user has just 1 interface and any
return interfaces[0]
else:
printInterfaces()
inputValue = input('Numero da interface: ')
if int(inputValue)-1 not in range(len(interfaces)):
raise Exception('numero de interface invalida')
inputValue = interfaces[int(inputValue)-1]
return inputValue
signal.signal(signal.SIGINT, exit)
signal.signal(signal.SIGTERM, exit)
multicast_group = ('224.12.12.12', 10000)
# Create the datagram socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Set the time-to-live for messages to 1 so they do not go past the
# local network segment.
ttl = struct.pack('b', 12)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl)
interface_name = chooseInterface()
ip_interface = netifaces.ifaddresses(interface_name)[netifaces.AF_INET][0]['addr']
sock.bind((ip_interface, 10000))
try:
# Look for responses from all recipients
while is_running:
input_msg = input('msg --> ')
try:
sock.sendto(input_msg.encode("utf-8"), multicast_group)
except:
traceback.print_exc()
continue
#print >>sys.stderr, 'received "%s" from %s' % (data, server)
finally:
#print >>sys.stderr, 'closing socket'
sock.close()
......@@ -2,41 +2,26 @@
# Router setup
#########################################
router1[0]=A
router1[1]=B
router1[2]=tap,192.168.2.1,192.168.2.2
router1[mem]=256
router2[0]=A
router2[1]=C
router2[2]=F
router2[0]=B
router2[mem]=256
router3[0]=B
router3[1]=D
router3[mem]=256
router4[0]=G
router4[1]=H
router4[mem]=256
#########################################
# Switch setup
#########################################
switch1[0]=C
switch1[1]=D
switch1[2]=E
switch1[3]=G
switch1[0]=A
switch1[1]=B
switch1[2]=C
switch1[3]=D
#########################################
# Client setup
#########################################
client1[0]=F
client1[0]=C
client1[mem]=256
client2[0]=E
client2[0]=D
client2[mem]=256
client3[0]=H
client3[mem]=256
router2: router1 switch1
router3: router1
router4: switch1 router2 router3
router1: switch1
router2: switch1
client1: router2
client2: switch1 router2 router3
client3: router4
client1: switch1
client2: switch1
ip addr add dev eth0 10.0.0.1/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.1.1/24
ip link set dev eth1 up
#NAT for private ip's
iptables -t nat -A POSTROUTING -s 0.0.0.0/0 -o eth2 -j MASQUERADE
# Zebra and OSPF
/etc/init.d/quagga restart
#apt-get update && apt-get --assume-yes install python3 python3-pip
rm -rf MulticastRouting/
cp -rf /hosthome/Desktop/pim/ MulticastRouting/
cp -rf /hosthome/Desktop/new_protocol2/ MulticastRouting/
cd MulticastRouting
pip-3.2 install --index-url=https://pypi.python.org/simple/ -r requirements.txt
#pip-3.2 install --index-url=https://pypi.python.org/simple/ -r requirements.txt
python3 Run.py -stop
python3 Run.py -start
python3 Run.py -t R1 10.0.0.5
python3 Run.py -aiigmp eth0
python3 Run.py -aiigmp eth1
python3 Run.py -aiigmp eth2
python3 Run.py -ai eth0
python3 Run.py -ai eth1
python3 Run.py -ai eth2
python3 Run.py -v
ip addr add dev eth0 10.0.0.2/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.2.2/24
ip link set dev eth1 up
ip addr add dev eth2 10.1.0.2/24
ip link set dev eth2 up
#default route para obter conectividade internet
#ip route add 0.0.0.0/0 via 10.0.0.1
#ip route del 0.0.0.0/0
# Zebra and OSPF
/etc/init.d/quagga restart
# wait for default route information from OSPF
while ! $(ip route | grep -q "default")
do
sleep 2
done
# install python
#apt-get update && apt-get --assume-yes install python3 python3-pip
rm -rf MulticastRouting/
cp -rf /hosthome/Desktop/pim/ MulticastRouting/
cp -rf /hosthome/Desktop/new_protocol2/ MulticastRouting/
cd MulticastRouting
pip-3.2 install --index-url=https://pypi.python.org/simple/ -r requirements.txt
#pip-3.2 install --index-url=https://pypi.python.org/simple/ -r requirements.txt
python3 Run.py -stop
python3 Run.py -start
python3 Run.py -t R2 10.0.0.5
python3 Run.py -aiigmp eth0
python3 Run.py -aiigmp eth1
python3 Run.py -aiigmp eth2
python3 Run.py -ai eth0
python3 Run.py -ai eth1
python3 Run.py -ai eth2
python3 Run.py -v
ip addr add dev eth0 10.0.1.3/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.2.3/24
ip link set dev eth1 up
#default route para obter conectividade internet
#ip route add 0.0.0.0/0 via 10.0.1.1
#ip route del 0.0.0.0/0
# Zebra and OSPF
/etc/init.d/quagga restart
# wait for default route information from OSPF
while ! $(ip route | grep -q "default")
do
sleep 2
done
# install python
#apt-get update && apt-get --assume-yes install python3 python3-pip
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
# The watchquagga daemon is always started. Per default in monitoring-only but
# that can be changed via /etc/quagga/debian.conf.
#
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" --daemon -A 127.0.0.1"
bgpd_options=" --daemon -A 127.0.0.1"
ospfd_options=" --daemon -A 127.0.0.1"
ospf6d_options=" --daemon -A ::1"
ripd_options=" --daemon -A 127.0.0.1"
ripngd_options=" --daemon -A ::1"
isisd_options=" --daemon -A 127.0.0.1"
babeld_options=" --daemon -A 127.0.0.1"
#
# Please note that watchquagga_options is an array and not a string so that
# quotes can be used.
#
# The list of daemons to watch is automatically generated by the init script
# from daemons.conf and appended to the watchquagga_options.
# Example:
# watchquagga_options=("-Adz" "-r" '/sbin/service %s restart' -s '/sbin/service %s start' -k '/sbin/service %s stop')
watchquagga_enable=yes
watchquagga_options=(--daemon)
! -*- ospf -*-
!
! OSPFd sample configuration file
!
!
hostname ospfd
password zebra
!enable password please-set-at-here
!
router ospf
network 10.0.1.0/24 area 0
network 10.0.2.0/24 area 0
!
log stdout
!
! Sample configuration file for vtysh.
!
!service integrated-vtysh-config
hostname quagga-router
username root nopassword
!
! -*- zebra -*-
!
! zebra sample configuration file
!
! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
!
hostname Router
password zebra
enable password zebra
!
! Interface's description.
!
!interface lo
! description test of desc.
!
!interface sit0
! multicast
!
! Static default route sample.
!
!ip route 0.0.0.0/0 203.181.89.241
!
!log file /var/log/quagga/zebra.log
nameserver 8.8.8.8
nameserver 8.8.4.4
rm -rf MulticastRouting/
cp -rf /hosthome/Desktop/pim/ MulticastRouting/
cd MulticastRouting
pip-3.2 install --index-url=https://pypi.python.org/simple/ -r requirements.txt
python3 Run.py -stop
python3 Run.py -start
python3 Run.py -aiigmp eth0
python3 Run.py -aiigmp eth1
python3 Run.py -ai eth0
python3 Run.py -ai eth1
python3 Run.py -v
ip addr add dev eth0 10.0.2.4/24
ip link set dev eth0 up
ip addr add dev eth1 10.0.3.4/24
ip link set dev eth1 up
#default route para obter conectividade internet
#ip route add 0.0.0.0/0 via 10.0.1.1
#ip route del 0.0.0.0/0
# Zebra and OSPF
/etc/init.d/quagga restart
# wait for default route information from OSPF
while ! $(ip route | grep -q "default")
do
sleep 2
done
# install python
#apt-get update && apt-get --assume-yes install python3 python3-pip
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, "no" = disabled
# 1, "yes" = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
# The watchquagga daemon is always started. Per default in monitoring-only but
# that can be changed via /etc/quagga/debian.conf.
#
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no
#
# If this option is set the /etc/init.d/quagga script automatically loads
# the config via "vtysh -b" when the servers are started.
# Check /etc/pam.d/quagga if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" --daemon -A 127.0.0.1"
bgpd_options=" --daemon -A 127.0.0.1"
ospfd_options=" --daemon -A 127.0.0.1"
ospf6d_options=" --daemon -A ::1"
ripd_options=" --daemon -A 127.0.0.1"
ripngd_options=" --daemon -A ::1"
isisd_options=" --daemon -A 127.0.0.1"
babeld_options=" --daemon -A 127.0.0.1"
#
# Please note that watchquagga_options is an array and not a string so that
# quotes can be used.
#
# The list of daemons to watch is automatically generated by the init script
# from daemons.conf and appended to the watchquagga_options.
# Example:
# watchquagga_options=("-Adz" "-r" '/sbin/service %s restart' -s '/sbin/service %s start' -k '/sbin/service %s stop')
watchquagga_enable=yes
watchquagga_options=(--daemon)
! -*- ospf -*-
!
! OSPFd sample configuration file
!
!
hostname ospfd
password zebra
!enable password please-set-at-here
!
router ospf
network 10.0.2.0/24 area 0
network 10.0.3.0/24 area 0
!
log stdout
!
! Sample configuration file for vtysh.
!
!service integrated-vtysh-config
hostname quagga-router
username root nopassword
!
! -*- zebra -*-
!
! zebra sample configuration file
!
! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
!
hostname Router
password zebra
enable password zebra
!
! Interface's description.
!
!interface lo
! description test of desc.
!
!interface sit0
! multicast
!
! Static default route sample.
!
!ip route 0.0.0.0/0 203.181.89.241
!
!log file /var/log/quagga/zebra.log
nameserver 8.8.8.8
nameserver 8.8.4.4
rm -rf MulticastRouting/
cp -rf /hosthome/Desktop/pim/ MulticastRouting/
cd MulticastRouting
pip-3.2 install --index-url=https://pypi.python.org/simple/ -r requirements.txt
python3 Run.py -stop
python3 Run.py -start
python3 Run.py -aiigmp eth0
python3 Run.py -aiigmp eth1
python3 Run.py -ai eth0
python3 Run.py -ai eth1
python3 Run.py -v
......@@ -7,10 +7,11 @@ brctl addif br0 eth0
brctl addif br0 eth1
brctl addif br0 eth2
brctl addif br0 eth3
ip addr add dev br0 10.0.0.5/24
ip link set dev br0 up
# identify ports with routers (they need to receive all multicast traffic!)
echo "2" > /sys/devices/virtual/net/br0/brif/eth0/multicast_router
echo "2" > /sys/devices/virtual/net/br0/brif/eth1/multicast_router
echo "2" > /sys/devices/virtual/net/br0/brif/eth3/multicast_router
import pickle
import logging
import logging.handlers
import socketserver
import struct
import sys
import threading
from queue import Queue
q = Queue()
def worker():
while True:
item = q.get()
if item is None:
break
logger = logging.getLogger('my_logger')
logger.handle(item)
q.task_done()
class TestHandler(logging.StreamHandler):
def emit(self, record):
super().emit(record)
class CustomFilter(logging.Filter):
def filter(self, record):
return record.name.startswith("protocol.igmp") and record.routername in ["R1", "R2"]
class LogRecordStreamHandler(socketserver.StreamRequestHandler):
"""Handler for a streaming logging request.
This basically logs the record using whatever logging policy is
configured locally.
"""
def handle(self):
"""
Handle multiple requests - each expected to be a 4-byte length,
followed by the LogRecord in pickle format. Logs the record
according to whatever policy is configured locally.
"""
while True:
chunk = self.connection.recv(4)
if len(chunk) < 4:
break
slen = struct.unpack('>L', chunk)[0]
chunk = self.connection.recv(slen)
while len(chunk) < slen:
chunk = chunk + self.connection.recv(slen - len(chunk))
obj = self.unPickle(chunk)
record = logging.makeLogRecord(obj)
q.put(item=record)
def unPickle(self, data):
return pickle.loads(data)
class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
"""
Simple TCP socket-based logging receiver suitable for testing.
"""
allow_reuse_address = True
def __init__(self, host='localhost',
port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
handler=LogRecordStreamHandler):
TestHandler.main = self
socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
self.abort = 0
self.timeout = 1
self.logname = None
def serve_until_stopped(self):
import select
abort = 0
while not abort:
rd, wr, ex = select.select([self.socket.fileno()],
[], [],
self.timeout)
if rd:
self.handle_request()
abort = self.abort
def main():
handler = TestHandler(sys.stdout)
formatter = logging.Formatter('%(name)-50s %(levelname)-8s %(asctime)-25s %(tree)-35s %(vif)-2s %(interfacename)-5s %(routername)-2s %(message)s')
handler.setFormatter(formatter)
logging.getLogger('my_logger').addHandler(handler)
logging.getLogger('my_logger').addFilter(CustomFilter())
t = threading.Thread(target=worker)
t.start()
tcpserver = LogRecordSocketReceiver(host='10.0.0.5')
print('About to start TCP server...')
tcpserver.serve_until_stopped()
if __name__ == '__main__':
main()
rm /hosthome/Desktop/test_capture.pcap
tcpdump -i br0 -Q in -w /hosthome/Desktop/test_capture.pcap
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment