English French
With this ``build`` method, we can now launch the network by using the python code below.
With these IP prefixes and the network topology, we can now use IPMininet_ to create the topology and assign the addresses.
With the previous exercises, you have learned how to reason about IPv6 networks "on paper". Given the availability of IPv6 implementations, it is also possible to carry out experiments in real and virtual labs. Several virtual environments are possible. In this section, we focus on mininet_. mininet_ is an emulation framework developed at Stanford University that leverages the namespaces features of recent Linux kernels. With those namespaces, a single Linux kernel can support a variety of routers and hosts interconnected by virtual links. mininet_ has been used by several universities as an educational tool, but unfortunately it was designed without IPv6 support.
When the :manpage:`ping6(8)` is executed, it sends ICMPv6 echo request messages with increasing sequence numbers.
When :manpage:`traceroute6(8)` sends UDP segments, it uses the UDP source port as a way to remember the target hop for this specific UDP segment.
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.
When creating these forwarding tables, try to minimize the number of entries that you install on each router.
When an IPv6 router receives a packet that is larger than the Maximum Transmission Unit (MTU) on its outgoing interface, it drops the packet and returns an ICMPv6 message back to the source. Upon reception of this ICMPv6 message, the source will either adjust the size of the packets that it transmits or use IPv6 packet fragmentation. The exercises below show a few examples of the utilization of IPv6 fragmentation.
When a network is designed, an important element of the design is the IP address allocation plan. A good allocation plan can provide flexibility and help to reduce the size of the forwarding tables.
What do you think about the proposed configuration?
We use five /64 IPv6 prefixes in this network topology:
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:
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 first check with ``pingall`` whether the network works correctly.
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.
We can now create the hosts and the routers
We can analyze this configuration problem in more details by using ``traceroute6``. The loop appears clearly.
Unfortunately, when router ``r1`` sends its ICMP HopLimit exceeded message, the destination of this IP packet is ``2001:db8:1341:3::b``. This packet is forward to router ``r2`` that returns the packet back to router ``r1``. The packet loops between the two routers until their HopLimit reaches zero.
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.
To debug this problem, let us look at the forwarding table of ``r3``. This router forwards the packets sent to host ``a`` to router ``r1`` that is directly connected to host ``a``.