Comments (4)
Have you tried this: https://stackoverflow.com/questions/39362730/how-to-capture-packets-for-single-docker-container
or this https://stackoverflow.com/questions/37860936/find-out-which-network-interface-belongs-to-docker-container ?
Hope it helps :)
from ngsdn-tutorial.
Thanks for the quick reply...
I have looked into the first link. For example, below are two switch interfaces in the mininet VM:
"""
sdn@tutorial-vm:~/ngsdn-tutorial$ docker exec mininet ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.2 netmask 255.255.0.0 broadcast 172.20.255.255
ether 02:42:ac:14:00:02 txqueuelen 0 (Ethernet)
RX packets 57 bytes 7350 (7.1 KiB)
leaf1-eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 8e:52:be:7c:bf:ee txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
leaf1-eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether c2:b3:47:c3:fd:bb txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
....
"""
From my host (as shown below), it appears that veth8f695be is mapped to leaf1-eth1, great! However, my host does not have a mapping for leaf1-eth2. In fact, the host VM only have two such "veth" interfaces.
sdn@tutorial-vm:/ngsdn-tutorial$ docker exec -it mininet cat /sys/class/net/leaf1-eth1/iflink/ngsdn-tutorial$ ip ad | grep 9
9
sdn@tutorial-vm:
link/ether 08:00:27:86:96:bc brd ff:ff:ff:ff:ff:ff
inet6 fe80::a00:27ff:fe86:96bc/64 scope link
link/ether 02:42:0d:c5:fc:9d brd ff:ff:ff:ff:ff:ff
link/ether 02:42:4d:41:09:1d brd ff:ff:ff:ff:ff:ff
inet6 fe80::42:4dff:fe41:91d/64 scope link
20: veth8f695be@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-1c3bcd4640a0 state UP group default
sdn@tutorial-vm:/ngsdn-tutorial$ docker exec -it mininet cat /sys/class/net/leaf1-eth2/iflink/ngsdn-tutorial$ ip ad | grep 13
13
sdn@tutorial-vm:
I did come across the second link in Google. However, from a quick look, it appears that the tool allows the use of perhaps tcpdump to capture the pcap for an interface, and then you can use wireshark to view the pcap log (Perhaps I can do the same using docker exec?).
For some reason, I assumed there were instructions in the tutorial to streamline wireshark such that you can fire it up on the host, and magically access the mininet switch interfaces (leaf1-eth1, leaf1-eth2, etc.)?
Thoughts?
from ngsdn-tutorial.
Ok so let's see. I found this capture in Exercise 7. Could you do something similar?
from ngsdn-tutorial.
That will suffice :)
I'm not a bash expert, but I went ahead and inserted a minor tweak to specify the "host" and "interface" on the command line (e.g. util/mn-pcap leaf1 eth1): perhaps some folks may find this useful. Below is the updated code:
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Require two arguments
if [ -z $2 ]; then
echo "usage: $0 host interface"
exit 1
fi
host=$1
iface=$2
host_iface=$host-$iface
file=${host_iface}.pcap
set -e
echo "*** Starting tcpdump on ${host}... Ctrl-c to stop capture"
echo "*** Pcap file will be written in ngsdn-tutorial/tmp/${file}"
docker exec -it mininet /mininet/host-cmd $host tcpdump -i $host_iface -w /tmp/"${file}"
if [ -x "$(command -v wireshark)" ]; then
echo "*** Opening wireshark... Ctrl-c to quit"
wireshark "${DIR}/../tmp/${file}"
fi
from ngsdn-tutorial.
Related Issues (20)
- How do I link ONOS by using mininet in my VM? HOT 4
- How to continuously change the forwarding flow table of the switch at intervals?
- help!QAQ
- Problem running the onos-cli in Excercise 3 HOT 6
- Ternary Match Issue in Advanced Branch
- Custom Topologies HOT 1
- Iperf UDP in Exercise 7 HOT 2
- New Entry in Table overriding the previous one
- pingall not working but ping works after Exercise 1
- How to create my own Topology? HOT 1
- Error pushing the netcfg to the controller HOT 5
- branch master - mininet container exit issue HOT 1
- [ASK] about to push p4 switch to ELK server HOT 1
- [ASK] how logging packet_in packet_out?
- Can I use the ONOS app in Excersice 5 for IPv4?
- Problem running make netcfg
- Are member variables in ONOS Component Classes thread safe and persistent. (Question)
- The mininet container cannot use xterm and wireshark HOT 5
- pushing netcfg when using IPv4 topology on mininet HOT 1
- Service Function Chaining Implementation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngsdn-tutorial.