Translation

English
English French Actions
IPMininet_ simplifies the creation of the network topology by providing a simple API. For this, you simply need to declare a class that extends the ``IPTopo`` class.
Then, you need to extend the build method that creates routers and hosts.
Although IPMininet_ can assign prefixes and addresses automatically, we use manually assigned addresses in this example.
We use five /64 IPv6 prefixes in this network topology:
``2001:db8:1341:1::/64`` on the link between ``a`` and ``r1``
``2001:db8:1341:12::/64`` on the link between ``r1`` and ``r2``
``2001:db8:1341:13::/64`` on the link between ``r1`` and ``r3``
``2001:db8:1341:23::/64`` on the link between ``r2`` and ``r3``
``2001:db8:1341:1::/64`` on the link between ``b`` and ``r3``
We can then manually configure the IPv6 addresses of each host/router on each link. Let us start with the links attached to the two hosts.
The same can be done for the three links between the different routers.
With these IP prefixes and the network topology, we can now use IPMininet_ to create the topology and assign the addresses.
We start by creating the objects that correspond to the static routes on the three routers. The second argument of the ``addDaemon`` method is a list of ``StaticRoute`` objects. Each of these objects is created by specifying an IP prefix and a nexthop.
We can now create the hosts and the routers
With this ``build`` method, we can now launch the network by using the python code below.
The entire script is available from :download:`/exercises/ipmininet_scripts/static-1.py`.
To help students to start using IPMininet, `Mathieu Jadin <https://inl.info.ucl.ac.be/mjadin.html>`_ has created a Vagrant box that launches a Ubuntu virtual machine with all the required software. See https://ipmininet.readthedocs.io/en/latest/install.html for additional information.
Here is a simple example of the utilization of this Vagrant box.
We start the network topology shown above with the ``sudo python script.py`` command. It launches the mininet_ interactive shell that provides several useful commands:
Some of the standard mininet commands assume the utilisation of IPv4 and do not have a direct IPv6 equivalent. Here are some useful commands.
The ``nodes`` command lists the routers and hosts that have been created in the mininet topology.
The ``links`` command lists the links that have been instantiated and shows that mapping between the named interfaces on each node.
It is possible to execute any of the standard Linux commands to configure the network stack on any of the hosts by prefixing the command with the corresponding host. Remember to always specify ``inet6`` as the address family to retrieve the IPv6 information.
Host ``a`` has two interfaces: the standard loopback interface and a network interface named ``a-eth0`` that is attached to router ``r1``. We can also verify how the IPv6 addresses have been configured:
On its ``a-eth0`` interface, host ``a`` uses IPv6 address ``2001:db8:1341:1::a/64``. The link local address (``fe80::c44e:26ff:fed9:de6d/64``) will be described in another chapter. Finally, we can check the forwarding table of host ``a``.
There are three routes in this table. The first two correspond to the two prefixes that are used over the ``a-eth0`` interface. These routes are automatically created when an IPv6 address is configured on an interface. The last route is the default route (``::/0``) which points towards ``2001:db8:1341:1::1``, i.e. router ``r1``.
Another useful command is ``xterm`` 'node' that allows to launch a terminal on the specified node. This gives you a interactive shell on any node. You can use it to capture packets with tcpdump_. As an example, let us use :manpage:`traceroute6(8)` to trace the path followed by packets from host ``a`` towards the IPv6 address of host ``b`` i.e. ``2001:db8:1341:3::b``. The output of this command shows that the path passes through routers ``r1``, ``r2`` and ``r3``.
Another interesting mininet_ command is ``pingall`` it allows to check that any host can reach any other host inside the network. It executes a ping from any host to any other host inside the network topology.
When debugging a network, it can be interesting to capture packets using tcpdump_ on specific links to check that they follow the expect. If you use tcpdump_ without any filter, you will capture the packets generated by xterm. To capture packets, you need to specify precise filters that will match the packets of interest. For traceroute6, you need to match the IPv6 packets that contain UDP segments and some ICMPv6 packets. The script below provides a simple filter that you can reuse. It takes one argument: the name of the interface on which tcpdump_ needs to run.
Starting from the :download:`/exercises/ipmininet_scripts/static-1.py` IPMininet_ script, we can explore classical problems when networks are configured with static routes. A first problem is when a router has an incomplete forwarding table. We configure the static routes as shown below. The entire script is available from :download:`/exercises/ipmininet_scripts/static-1-hole.py`.
We first check with ``pingall`` whether the network works correctly.

Loading…

User avatar None

New source string

cnp3-ebook / exercises/ipv6French

New source string 3 years ago
Browse all component changes

Glossary

English French
No related strings found in the glossary.

String information

Source string location
../../exercises/ipv6.rst:694
String age
3 years ago
Source string age
3 years ago
Translation file
locale/fr/LC_MESSAGES/exercises/ipv6.po, string 75