Compare commits
3
Commits
ee4b144929
...
0e43b943c4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e43b943c4 | ||
|
|
46ce29ade7 | ||
|
|
f9721224c9 |
@@ -0,0 +1,91 @@
|
|||||||
|
10:58:29.655251 12:07:f8:bf:6e:ff > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:07:f8:bf:6e:ff, length 300, xid 0xecb5a2e, Flags [none] (0x0000)
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Discover
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Parameter-Request Option 55, length 13:
|
||||||
|
Subnet-Mask, BR, Time-Zone, Default-Gateway
|
||||||
|
Domain-Name, Domain-Name-Server, Option 119, Hostname
|
||||||
|
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
|
||||||
|
NTP
|
||||||
|
10:58:29.655633 82:3b:16:e9:bb:17 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:30.662723 82:3b:16:e9:bb:17 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:31.687064 82:3b:16:e9:bb:17 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:32.214530 12:07:f8:bf:6e:ff > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:07:f8:bf:6e:ff, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Discover
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Parameter-Request Option 55, length 13:
|
||||||
|
Subnet-Mask, BR, Time-Zone, Default-Gateway
|
||||||
|
Domain-Name, Domain-Name-Server, Option 119, Hostname
|
||||||
|
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
|
||||||
|
NTP
|
||||||
|
10:58:32.670822 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 62: (tos 0x0, ttl 64, id 28856, offset 0, flags [DF], proto ICMP (1), length 48)
|
||||||
|
192.168.1.1 > 192.168.1.131: ICMP echo request, id 21591, seq 0, length 28
|
||||||
|
10:58:32.670897 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 52736, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
192.168.1.1.67 > 192.168.1.131.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xecb5a2e, Flags [none] (0x0000)
|
||||||
|
Your-IP 192.168.1.131
|
||||||
|
Server-IP 192.168.1.1
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Offer
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Lease-Time Option 51, length 4: 43200
|
||||||
|
RN Option 58, length 4: 21600
|
||||||
|
RB Option 59, length 4: 37800
|
||||||
|
Subnet-Mask Option 1, length 4: 255.255.255.0
|
||||||
|
BR Option 28, length 4: 192.168.1.255
|
||||||
|
Default-Gateway Option 3, length 4: 192.168.1.1
|
||||||
|
10:58:32.671193 12:07:f8:bf:6e:ff > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:07:f8:bf:6e:ff, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Request
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Requested-IP Option 50, length 4: 192.168.1.131
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Parameter-Request Option 55, length 13:
|
||||||
|
Subnet-Mask, BR, Time-Zone, Default-Gateway
|
||||||
|
Domain-Name, Domain-Name-Server, Option 119, Hostname
|
||||||
|
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
|
||||||
|
NTP
|
||||||
|
10:58:32.673025 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 52738, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
192.168.1.1.67 > 192.168.1.131.68: [bad udp cksum 0x851a -> 0x5896!] BOOTP/DHCP, Reply, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Your-IP 192.168.1.131
|
||||||
|
Server-IP 192.168.1.1
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: ACK
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Lease-Time Option 51, length 4: 43200
|
||||||
|
RN Option 58, length 4: 21600
|
||||||
|
RB Option 59, length 4: 37800
|
||||||
|
Subnet-Mask Option 1, length 4: 255.255.255.0
|
||||||
|
BR Option 28, length 4: 192.168.1.255
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Default-Gateway Option 3, length 4: 192.168.1.1
|
||||||
|
10:58:32.678132 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 52737, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
192.168.1.1.67 > 192.168.1.131.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Your-IP 192.168.1.131
|
||||||
|
Server-IP 192.168.1.1
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Offer
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Lease-Time Option 51, length 4: 43200
|
||||||
|
RN Option 58, length 4: 21600
|
||||||
|
RB Option 59, length 4: 37800
|
||||||
|
Subnet-Mask Option 1, length 4: 255.255.255.0
|
||||||
|
BR Option 28, length 4: 192.168.1.255
|
||||||
|
Default-Gateway Option 3, length 4: 192.168.1.1
|
||||||
|
10:58:37.831406 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:37.831440 12:07:f8:bf:6e:ff > 82:3b:16:e9:bb:17, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.131 is-at 12:07:f8:bf:6e:ff, length 28
|
||||||
Binary file not shown.
@@ -0,0 +1,109 @@
|
|||||||
|
mininet@mininet-vm:~/Networks-II/exercise$ sudo python3 ../source/build_network.py topology.json
|
||||||
|
Generated: topology.generated.py
|
||||||
|
mininet> h1 rm -f /var/lib/dhcp/dhclient.leases
|
||||||
|
mininet> h1 rm -f /tmp/dhcp.pcap
|
||||||
|
mininet> h1 tcpdump -i h1-eth0 -n -w /tmp/dhcp.pcap &
|
||||||
|
mininet> h1 ps aux | grep tcpdump
|
||||||
|
tcpdump: listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
|
||||||
|
tcpdump 4196 0.0 0.1 10904 5920 pts/2 S+ 10:57 0:00 tcpdump -i h1-eth0 -n -w /tmp/dhcp.pcap
|
||||||
|
root 4199 0.0 0.0 9368 2548 pts/2 S+ 10:58 0:00 grep tcpdump
|
||||||
|
mininet> h1 dhclient h1-eth0
|
||||||
|
mininet> h1 pkill -INT tcpdump
|
||||||
|
12 packets captured
|
||||||
|
12 packets received by filter
|
||||||
|
0 packets dropped by kernel
|
||||||
|
mininet> h1 tcpdump -n -e -vv -r /tmp/dhcp.pcap
|
||||||
|
reading from file /tmp/dhcp.pcap, link-type EN10MB (Ethernet)
|
||||||
|
10:58:29.655251 12:07:f8:bf:6e:ff > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:07:f8:bf:6e:ff, length 300, xid 0xecb5a2e, Flags [none] (0x0000)
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Discover
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Parameter-Request Option 55, length 13:
|
||||||
|
Subnet-Mask, BR, Time-Zone, Default-Gateway
|
||||||
|
Domain-Name, Domain-Name-Server, Option 119, Hostname
|
||||||
|
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
|
||||||
|
NTP
|
||||||
|
10:58:29.655633 82:3b:16:e9:bb:17 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:30.662723 82:3b:16:e9:bb:17 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:31.687064 82:3b:16:e9:bb:17 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:32.214530 12:07:f8:bf:6e:ff > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:07:f8:bf:6e:ff, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Discover
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Parameter-Request Option 55, length 13:
|
||||||
|
Subnet-Mask, BR, Time-Zone, Default-Gateway
|
||||||
|
Domain-Name, Domain-Name-Server, Option 119, Hostname
|
||||||
|
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
|
||||||
|
NTP
|
||||||
|
10:58:32.670822 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 62: (tos 0x0, ttl 64, id 28856, offset 0, flags [DF], proto ICMP (1), length 48)
|
||||||
|
192.168.1.1 > 192.168.1.131: ICMP echo request, id 21591, seq 0, length 28
|
||||||
|
10:58:32.670897 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 52736, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
192.168.1.1.67 > 192.168.1.131.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xecb5a2e, Flags [none] (0x0000)
|
||||||
|
Your-IP 192.168.1.131
|
||||||
|
Server-IP 192.168.1.1
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Offer
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Lease-Time Option 51, length 4: 43200
|
||||||
|
RN Option 58, length 4: 21600
|
||||||
|
RB Option 59, length 4: 37800
|
||||||
|
Subnet-Mask Option 1, length 4: 255.255.255.0
|
||||||
|
BR Option 28, length 4: 192.168.1.255
|
||||||
|
Default-Gateway Option 3, length 4: 192.168.1.1
|
||||||
|
10:58:32.671193 12:07:f8:bf:6e:ff > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 12:07:f8:bf:6e:ff, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Request
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Requested-IP Option 50, length 4: 192.168.1.131
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Parameter-Request Option 55, length 13:
|
||||||
|
Subnet-Mask, BR, Time-Zone, Default-Gateway
|
||||||
|
Domain-Name, Domain-Name-Server, Option 119, Hostname
|
||||||
|
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
|
||||||
|
NTP
|
||||||
|
10:58:32.673025 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 52738, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
192.168.1.1.67 > 192.168.1.131.68: [bad udp cksum 0x851a -> 0x5896!] BOOTP/DHCP, Reply, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Your-IP 192.168.1.131
|
||||||
|
Server-IP 192.168.1.1
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: ACK
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Lease-Time Option 51, length 4: 43200
|
||||||
|
RN Option 58, length 4: 21600
|
||||||
|
RB Option 59, length 4: 37800
|
||||||
|
Subnet-Mask Option 1, length 4: 255.255.255.0
|
||||||
|
BR Option 28, length 4: 192.168.1.255
|
||||||
|
Hostname Option 12, length 10: "mininet-vm"
|
||||||
|
Default-Gateway Option 3, length 4: 192.168.1.1
|
||||||
|
10:58:32.678132 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 52737, offset 0, flags [none], proto UDP (17), length 328)
|
||||||
|
192.168.1.1.67 > 192.168.1.131.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xecb5a2e, secs 3, Flags [none] (0x0000)
|
||||||
|
Your-IP 192.168.1.131
|
||||||
|
Server-IP 192.168.1.1
|
||||||
|
Client-Ethernet-Address 12:07:f8:bf:6e:ff
|
||||||
|
Vendor-rfc1048 Extensions
|
||||||
|
Magic Cookie 0x63825363
|
||||||
|
DHCP-Message Option 53, length 1: Offer
|
||||||
|
Server-ID Option 54, length 4: 192.168.1.1
|
||||||
|
Lease-Time Option 51, length 4: 43200
|
||||||
|
RN Option 58, length 4: 21600
|
||||||
|
RB Option 59, length 4: 37800
|
||||||
|
Subnet-Mask Option 1, length 4: 255.255.255.0
|
||||||
|
BR Option 28, length 4: 192.168.1.255
|
||||||
|
Default-Gateway Option 3, length 4: 192.168.1.1
|
||||||
|
10:58:37.831406 82:3b:16:e9:bb:17 > 12:07:f8:bf:6e:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.1, length 28
|
||||||
|
10:58:37.831440 12:07:f8:bf:6e:ff > 82:3b:16:e9:bb:17, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.131 is-at 12:07:f8:bf:6e:ff, length 28
|
||||||
|
mininet> exit
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
11:24:23.554475 4a:6f:2a:18:f4:80 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.164 tell 192.168.1.131, length 28
|
||||||
|
11:24:23.554730 82:c0:6d:ae:3f:56 > 4a:6f:2a:18:f4:80, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.164 is-at 82:c0:6d:ae:3f:56, length 28
|
||||||
|
11:24:28.679054 82:c0:6d:ae:3f:56 > 4a:6f:2a:18:f4:80, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.164, length 28
|
||||||
|
11:24:28.679071 4a:6f:2a:18:f4:80 > 82:c0:6d:ae:3f:56, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.131 is-at 4a:6f:2a:18:f4:80, length 28
|
||||||
Binary file not shown.
@@ -0,0 +1,40 @@
|
|||||||
|
mininet@mininet-vm:~/Networks-II/exercise$ sudo python3 ../source/build_network.py topology.json
|
||||||
|
Generated: topology.generated.py
|
||||||
|
mininet> h1 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
mininet> h2 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
mininet> h1 dhclient h1-eth0
|
||||||
|
mininet> h2 dhclient h2-eth0
|
||||||
|
mininet> h1 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
h1-eth0@if56 UP 192.168.1.131/24
|
||||||
|
mininet> h2 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
h2-eth0@if57 UP 192.168.1.164/24
|
||||||
|
mininet> h1 ip neigh flush all
|
||||||
|
mininet> h1 ip neigh show
|
||||||
|
mininet> h1 rm -f /tmp/arp.pcap
|
||||||
|
mininet> h1 tcpdump -i h1-eth0 -n arp -w /tmp/arp.pcap &
|
||||||
|
mininet> h1 ping -c 1 192.168.1.164
|
||||||
|
tcpdump: listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
|
||||||
|
PING 192.168.1.164 (192.168.1.164) 56(84) bytes of data.
|
||||||
|
64 bytes from 192.168.1.164: icmp_seq=1 ttl=64 time=0.425 ms
|
||||||
|
|
||||||
|
--- 192.168.1.164 ping statistics ---
|
||||||
|
1 packets transmitted, 1 received, 0% packet loss, time 0ms
|
||||||
|
rtt min/avg/max/mdev = 0.425/0.425/0.425/0.000 ms
|
||||||
|
mininet> h1 ip neigh show
|
||||||
|
192.168.1.164 dev h1-eth0 lladdr 82:c0:6d:ae:3f:56 REACHABLE
|
||||||
|
mininet> h1 pkill -INT tcpdump
|
||||||
|
4 packets captured
|
||||||
|
4 packets received by filter
|
||||||
|
0 packets dropped by kernel
|
||||||
|
mininet> h1 tcpdump -n -e -vv -r /tmp/arp.pcap
|
||||||
|
reading from file /tmp/arp.pcap, link-type EN10MB (Ethernet)
|
||||||
|
11:24:23.554475 4a:6f:2a:18:f4:80 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.164 tell 192.168.1.131, length 28
|
||||||
|
11:24:23.554730 82:c0:6d:ae:3f:56 > 4a:6f:2a:18:f4:80, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.164 is-at 82:c0:6d:ae:3f:56, length 28
|
||||||
|
11:24:28.679054 82:c0:6d:ae:3f:56 > 4a:6f:2a:18:f4:80, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.131 tell 192.168.1.164, length 28
|
||||||
|
11:24:28.679071 4a:6f:2a:18:f4:80 > 82:c0:6d:ae:3f:56, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.131 is-at 4a:6f:2a:18:f4:80, length 28
|
||||||
|
mininet>
|
||||||
|
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
mininet>
|
||||||
|
mininet> h1 ip neigh flush all
|
||||||
|
mininet> h3 ip neigh flush all
|
||||||
|
mininet> r0 ip neigh flush all
|
||||||
|
mininet> h1 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
h1-eth0@if56 UP 192.168.1.131/24
|
||||||
|
mininet> h1 ip route
|
||||||
|
default via 192.168.1.1 dev h1-eth0
|
||||||
|
192.168.1.0/24 dev h1-eth0 proto kernel scope link src 192.168.1.131
|
||||||
|
mininet> r0 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
r0-eth0@if59 UP 192.168.1.1/24
|
||||||
|
r0-eth1@if60 UP 192.168.2.1/24
|
||||||
|
mininet> r0 ip route
|
||||||
|
192.168.1.0/24 dev r0-eth0 proto kernel scope link src 192.168.1.1
|
||||||
|
192.168.2.0/24 dev r0-eth1 proto kernel scope link src 192.168.2.1
|
||||||
|
mininet> h3 ip -4 -br addr
|
||||||
|
lo UNKNOWN 127.0.0.1/8
|
||||||
|
h3-eth0@if58 UP 192.168.2.10/24
|
||||||
|
mininet> h3 ip route
|
||||||
|
default via 192.168.2.1 dev h3-eth0
|
||||||
|
192.168.2.0/24 dev h3-eth0 proto kernel scope link src 192.168.2.10
|
||||||
|
mininet> h1 rm -f /tmp/icmp-A.pcap
|
||||||
|
mininet> h3 rm -f /tmp/icmp-B.pcap
|
||||||
|
mininet> h1 tcpdump -i h1-eth0 -n icmp -w /tmp/icmp-A.pcap &
|
||||||
|
mininet> h3 tcpdump -i h3-eth0 -n icmp -w /tmp/icmp-B.pcap &
|
||||||
|
mininet> h1 ps aux | grep tcpdump
|
||||||
|
tcpdump: listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
|
||||||
|
tcpdump 4640 0.0 0.1 10904 5984 pts/2 S+ 11:41 0:00 tcpdump -i h1-eth0 -n icmp -w /tmp/icmp-A.pcap
|
||||||
|
tcpdump 4642 0.0 0.1 10904 6044 pts/4 S+ 11:41 0:00 tcpdump -i h3-eth0 -n icmp -w /tmp/icmp-B.pcap
|
||||||
|
root 4645 0.0 0.0 9368 2272 pts/2 S+ 11:41 0:00 grep tcpdump
|
||||||
|
mininet> h3 ps aux | grep tcpdump
|
||||||
|
tcpdump: listening on h3-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
|
||||||
|
tcpdump 4640 0.0 0.1 10904 5984 pts/2 S+ 11:41 0:00 tcpdump -i h1-eth0 -n icmp -w /tmp/icmp-A.pcap
|
||||||
|
tcpdump 4642 0.0 0.1 10904 6044 pts/4 S+ 11:41 0:00 tcpdump -i h3-eth0 -n icmp -w /tmp/icmp-B.pcap
|
||||||
|
root 4648 0.0 0.0 9368 2304 pts/4 S+ 11:41 0:00 grep tcpdump
|
||||||
|
mininet>
|
||||||
|
mininet> h1 ping -c 1 192.168.2.10
|
||||||
|
PING 192.168.2.10 (192.168.2.10) 56(84) bytes of data.
|
||||||
|
64 bytes from 192.168.2.10: icmp_seq=1 ttl=63 time=1.66 ms
|
||||||
|
|
||||||
|
--- 192.168.2.10 ping statistics ---
|
||||||
|
1 packets transmitted, 1 received, 0% packet loss, time 0ms
|
||||||
|
rtt min/avg/max/mdev = 1.659/1.659/1.659/0.000 ms
|
||||||
|
mininet> h1 pkill -INT tcpdump
|
||||||
|
2 packets captured
|
||||||
|
2 packets received by filter
|
||||||
|
0 packets dropped by kernel
|
||||||
|
mininet> h3 pkill -INT tcpdump
|
||||||
|
2 packets captured
|
||||||
|
2 packets received by filter
|
||||||
|
0 packets dropped by kernel
|
||||||
|
mininet> h1 ip link show h1-eth0
|
||||||
|
2: h1-eth0@if56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
|
||||||
|
link/ether 4a:6f:2a:18:f4:80 brd ff:ff:ff:ff:ff:ff link-netnsid 0
|
||||||
|
mininet> h3 ip link show h3-eth0
|
||||||
|
2: h3-eth0@if58: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
|
||||||
|
link/ether 2e:ef:81:65:2c:c9 brd ff:ff:ff:ff:ff:ff link-netnsid 0
|
||||||
|
mininet> r0 ip link show r0-eth0
|
||||||
|
2: r0-eth0@if59: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
|
||||||
|
link/ether ea:2e:7b:6d:78:82 brd ff:ff:ff:ff:ff:ff link-netnsid 0
|
||||||
|
mininet> r0 ip link show r0-eth1
|
||||||
|
3: r0-eth1@if60: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
|
||||||
|
link/ether 7e:41:8e:cb:65:05 brd ff:ff:ff:ff:ff:ff link-netnsid 0
|
||||||
|
mininet> h1 tcpdump -n -e -vv -r /tmp/icmp-A.pcap
|
||||||
|
reading from file /tmp/icmp-A.pcap, link-type EN10MB (Ethernet)
|
||||||
|
11:42:14.509645 4a:6f:2a:18:f4:80 > ea:2e:7b:6d:78:82, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 33575, offset 0, flags [DF], proto ICMP (1), length 84)
|
||||||
|
192.168.1.131 > 192.168.2.10: ICMP echo request, id 4650, seq 1, length 64
|
||||||
|
11:42:14.510633 ea:2e:7b:6d:78:82 > 4a:6f:2a:18:f4:80, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 63, id 65287, offset 0, flags [none], proto ICMP (1), length 84)
|
||||||
|
192.168.2.10 > 192.168.1.131: ICMP echo reply, id 4650, seq 1, length 64
|
||||||
|
mininet> h3 tcpdump -n -e -vv -r /tmp/icmp-B.pcap
|
||||||
|
reading from file /tmp/icmp-B.pcap, link-type EN10MB (Ethernet)
|
||||||
|
11:42:14.510255 7e:41:8e:cb:65:05 > 2e:ef:81:65:2c:c9, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 63, id 33575, offset 0, flags [DF], proto ICMP (1), length 84)
|
||||||
|
192.168.1.131 > 192.168.2.10: ICMP echo request, id 4650, seq 1, length 64
|
||||||
|
11:42:14.510299 2e:ef:81:65:2c:c9 > 7e:41:8e:cb:65:05, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 65287, offset 0, flags [none], proto ICMP (1), length 84)
|
||||||
|
192.168.2.10 > 192.168.1.131: ICMP echo reply, id 4650, seq 1, length 64
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
11:42:14.509645 4a:6f:2a:18:f4:80 > ea:2e:7b:6d:78:82, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 33575, offset 0, flags [DF], proto ICMP (1), length 84)
|
||||||
|
192.168.1.131 > 192.168.2.10: ICMP echo request, id 4650, seq 1, length 64
|
||||||
|
11:42:14.510633 ea:2e:7b:6d:78:82 > 4a:6f:2a:18:f4:80, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 63, id 65287, offset 0, flags [none], proto ICMP (1), length 84)
|
||||||
|
192.168.2.10 > 192.168.1.131: ICMP echo reply, id 4650, seq 1, length 64
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
11:42:14.510255 7e:41:8e:cb:65:05 > 2e:ef:81:65:2c:c9, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 63, id 33575, offset 0, flags [DF], proto ICMP (1), length 84)
|
||||||
|
192.168.1.131 > 192.168.2.10: ICMP echo request, id 4650, seq 1, length 64
|
||||||
|
11:42:14.510299 2e:ef:81:65:2c:c9 > 7e:41:8e:cb:65:05, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 65287, offset 0, flags [none], proto ICMP (1), length 84)
|
||||||
|
192.168.2.10 > 192.168.1.131: ICMP echo reply, id 4650, seq 1, length 64
|
||||||
Binary file not shown.
@@ -0,0 +1,136 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Generated Mininet topology. Do not edit by hand."""
|
||||||
|
|
||||||
|
import shlex
|
||||||
|
|
||||||
|
from mininet.cli import CLI
|
||||||
|
from mininet.link import TCLink
|
||||||
|
from mininet.net import Mininet
|
||||||
|
|
||||||
|
|
||||||
|
def _shell_join(args):
|
||||||
|
"""Quote command arguments for execution inside a Mininet node."""
|
||||||
|
|
||||||
|
return ' '.join(shlex.quote(str(arg)) for arg in args)
|
||||||
|
|
||||||
|
|
||||||
|
def _node_cmd(node, *args):
|
||||||
|
"""Execute one safely quoted command inside a Mininet node."""
|
||||||
|
|
||||||
|
return node.cmd(_shell_join(args))
|
||||||
|
|
||||||
|
|
||||||
|
def _start_background(node, args, log_path):
|
||||||
|
"""Start one background process and return its shell PID."""
|
||||||
|
|
||||||
|
command = _shell_join(args)
|
||||||
|
shell_command = (
|
||||||
|
command
|
||||||
|
+ ' >'
|
||||||
|
+ shlex.quote(log_path)
|
||||||
|
+ ' 2>&1 & echo $!'
|
||||||
|
)
|
||||||
|
return node.cmd('sh -c ' + shlex.quote(shell_command)).strip()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Build, configure, expose, and clean up the planned network."""
|
||||||
|
|
||||||
|
net = Mininet(controller=None, build=False)
|
||||||
|
nodes = {}
|
||||||
|
service_processes = []
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Create nodes.
|
||||||
|
nodes['h1'] = net.addHost('h1', ip=None)
|
||||||
|
nodes['h2'] = net.addHost('h2', ip=None)
|
||||||
|
nodes['h3'] = net.addHost('h3', ip=None)
|
||||||
|
nodes['s1'] = net.addSwitch('s1', failMode='standalone')
|
||||||
|
nodes['s2'] = net.addSwitch('s2', failMode='standalone')
|
||||||
|
nodes['r0'] = net.addHost('r0', ip=None)
|
||||||
|
|
||||||
|
# Create links.
|
||||||
|
net.addLink(
|
||||||
|
nodes['h1'],
|
||||||
|
nodes['s1'],
|
||||||
|
intfName1='h1-eth0',
|
||||||
|
intfName2='s1-eth0',
|
||||||
|
)
|
||||||
|
net.addLink(
|
||||||
|
nodes['h2'],
|
||||||
|
nodes['s1'],
|
||||||
|
intfName1='h2-eth0',
|
||||||
|
intfName2='s1-eth1',
|
||||||
|
)
|
||||||
|
net.addLink(
|
||||||
|
nodes['h3'],
|
||||||
|
nodes['s2'],
|
||||||
|
intfName1='h3-eth0',
|
||||||
|
intfName2='s2-eth0',
|
||||||
|
)
|
||||||
|
net.addLink(
|
||||||
|
nodes['r0'],
|
||||||
|
nodes['s1'],
|
||||||
|
intfName1='r0-eth0',
|
||||||
|
intfName2='s1-eth2',
|
||||||
|
)
|
||||||
|
net.addLink(
|
||||||
|
nodes['r0'],
|
||||||
|
nodes['s2'],
|
||||||
|
intfName1='r0-eth1',
|
||||||
|
intfName2='s2-eth1',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Materialize the Mininet topology.
|
||||||
|
net.build()
|
||||||
|
net.start()
|
||||||
|
|
||||||
|
# Configure concrete interfaces.
|
||||||
|
_node_cmd(nodes['h1'], 'ip', '-4', 'addr', 'flush', 'dev', 'h1-eth0')
|
||||||
|
_node_cmd(nodes['h1'], 'ip', 'link', 'set', 'dev', 'h1-eth0', 'up')
|
||||||
|
_node_cmd(nodes['h2'], 'ip', '-4', 'addr', 'flush', 'dev', 'h2-eth0')
|
||||||
|
_node_cmd(nodes['h2'], 'ip', 'link', 'set', 'dev', 'h2-eth0', 'up')
|
||||||
|
_node_cmd(nodes['h3'], 'ip', '-4', 'addr', 'flush', 'dev', 'h3-eth0')
|
||||||
|
_node_cmd(nodes['h3'], 'ip', 'addr', 'add', '192.168.2.10/24', 'dev', 'h3-eth0')
|
||||||
|
_node_cmd(nodes['h3'], 'ip', 'link', 'set', 'dev', 'h3-eth0', 'up')
|
||||||
|
_node_cmd(nodes['r0'], 'ip', '-4', 'addr', 'flush', 'dev', 'r0-eth0')
|
||||||
|
_node_cmd(nodes['r0'], 'ip', 'addr', 'add', '192.168.1.1/24', 'dev', 'r0-eth0')
|
||||||
|
_node_cmd(nodes['r0'], 'ip', 'link', 'set', 'dev', 'r0-eth0', 'up')
|
||||||
|
_node_cmd(nodes['r0'], 'ip', '-4', 'addr', 'flush', 'dev', 'r0-eth1')
|
||||||
|
_node_cmd(nodes['r0'], 'ip', 'addr', 'add', '192.168.2.1/24', 'dev', 'r0-eth1')
|
||||||
|
_node_cmd(nodes['r0'], 'ip', 'link', 'set', 'dev', 'r0-eth1', 'up')
|
||||||
|
|
||||||
|
# Configure static default routes.
|
||||||
|
_node_cmd(nodes['h3'], 'ip', 'route', 'replace', 'default', 'via', '192.168.2.1', 'dev', 'h3-eth0')
|
||||||
|
|
||||||
|
# Apply node-level networking settings.
|
||||||
|
_node_cmd(nodes['r0'], 'sysctl', '-w', 'net.ipv4.ip_forward=1')
|
||||||
|
_node_cmd(nodes['r0'], 'sysctl', '-w', 'net.ipv4.conf.all.rp_filter=0')
|
||||||
|
_node_cmd(nodes['r0'], 'sysctl', '-w', 'net.ipv4.conf.default.rp_filter=0')
|
||||||
|
_node_cmd(nodes['r0'], 'sysctl', '-w', 'net.ipv4.conf.r0-eth0.rp_filter=0')
|
||||||
|
_node_cmd(nodes['r0'], 'sysctl', '-w', 'net.ipv4.conf.r0-eth1.rp_filter=0')
|
||||||
|
|
||||||
|
# Start planned services.
|
||||||
|
_node_cmd(nodes['r0'], 'rm', '-f', '/tmp/mininet-dnsmasq-0.leases', '/tmp/mininet-dnsmasq-0.pid')
|
||||||
|
pid = _start_background(
|
||||||
|
nodes['r0'],
|
||||||
|
['dnsmasq', '--no-daemon', '--conf-file=', '--port=0', '--bind-interfaces', '--dhcp-authoritative', '--interface=r0-eth0', '--dhcp-range=192.168.1.100,192.168.1.200,12h', '--dhcp-leasefile=/tmp/mininet-dnsmasq-0.leases', '--pid-file=/tmp/mininet-dnsmasq-0.pid', '--dhcp-option=3,192.168.1.1'],
|
||||||
|
'/tmp/mininet-dnsmasq-0.log',
|
||||||
|
)
|
||||||
|
service_processes.append((nodes['r0'], pid))
|
||||||
|
|
||||||
|
# DHCP clients are intentionally not started here.
|
||||||
|
# The assignment captures DHCP before dhclient is run manually.
|
||||||
|
CLI(net)
|
||||||
|
|
||||||
|
finally:
|
||||||
|
# Stop only the service processes started by this script.
|
||||||
|
for node, pid in reversed(service_processes):
|
||||||
|
if pid:
|
||||||
|
_node_cmd(node, 'kill', pid)
|
||||||
|
|
||||||
|
net.stop()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user