IPv6 + Flow labels

Recently a teammate and I have come across a frame forwarding issue with ECMP on a hardware ASIC in a device I work on where the use of Flow labels are used in the ECMP hash. This was interesting as we found iperf was not setting the Flow label at all, unless you specify the -L option and due to this we saw TCP traffic taking different paths, contradictory to what we thought we had configured in our FIB and what we actually wanted.

This sparked interest in me then wondering how popular platforms set the IPv6 Flow label for the different protocols; that being, ICMPv6, TCP and UDP. The Flow label being at Layer 3, I would expect it used the same for each protocol, but I could not find literature to back this theory up. So I fired up Wireshark on Mac, Linux and Windows to find out what they do. Here are my results I found.

If you want to know more about what Flow Labels are I would reccomened the following links:

  • Wikipedia: https://en.wikipedia.org/wiki/IPv6_packet#Fixed_header
  • RFC: https://tools.ietf.org/html/rfc6437

Summary

With each protocol the client and the server maintained consistent Flow labels for the ‘session’ as expected, except for Windows with ICMPv6 Requests! Here Windows set the Flow label to 0 (0x00000000).

Tests Performed

To get my results I ran:

  • ping6 -c 2 us.cooperlees.com
    (ICMPv6)
    – ping -6 us.cooperlees.com on Windows
  • ssh -6 us.cooperlees.com
    (TCP)
    – Used putty on Windows
  • Raw NTP UDP Query
    Python 3 Code: https://pastebin.com/RDBRqG0G
    (UDP)

Linux

Test Distro: Ubuntu 18.04
Test Kernel: 4.15.0-23-generic

ICMPv6
– Different Flow label, but consistent for the 2 ping packets on each ICMPv6 Type 128/129 packet from sender and receiver

TCP
– Different Flow label for sender and receiver but consistent across the SSH connection.

UDP
– Different Flow label for sender and receiver for each UDP packet as expected.

Mac OS X

Test Version: 10.13.6 17G65
Test Kernel: Darwin Kernel Version 17.7.0

ICMPv6
– Different Flow label, but consistent for the 2 ping packets on each ICMPv6 Type 128/129 packet from sender and receiver

TCP
– Different Flow label for sender and receiver but consistent across the SSH connection.

UDP
– Different Flow label for sender and receiver for each UDP packet as expected.

Windows

Test Version: Microsoft Windows [Version 10.0.16299.371]

ICMPv6
– Windows sets the ICMPv6 Type 128 (request) IPv6 Flow label to 0x00000000!
(I also noticed different DSCP for traffic class)

TCP
– Different Flow label for sender and receiver but consistent across the SSH connection.

UDP
– Different Flow label for sender and receiver for each UDP packet as expected.

uit.sh Hits over 1000 Downloads !

Just thought I would pass on that my Ubuntu Iphone teathersing Shell Script has passed 1000 downloads.
Feels good to have people all over the world use your script 🙂

Hope everyone that has downloaded it has enjoyed it as much as I have in the car on the way to work.

The iPhone in Tethering Mode
The iPhone in 'Tethering Mode'

To see my super high tech counter visit:
http://us.cooperlees.com/ to see the current count 🙂

Ubuntu iPhone 3.0 Bluetooth Tethering with uit.sh

If you would like to use your iPhone 3.0 with your bluetooth capable Ubuntu 9.04 PC then uit.sh (Ubuntu Iphone Thethering) is for you. This script installs all required conf, allows you to enable and disable your iphone tethering and even uninstall the conf if you no longer need it. I do expect NetworkManager to eventually support this out of the box.

Thanks to http://xn--9bi.net/2009/06/17/tether…o-ubuntu-9-04/ blog post which assisted me in knowning what configuration was needed.

Usage:
— Ubuntu iPhone Tethering (uit) Version 0.1 – Cooper Lees <me@cooperlees.com> —
Usage: ./uit.sh options
– This script will install, uninstall, enable and disable iPhone tethering with iPhone 3.0 Software.
– It has been tested on a upto date (patched) box as of 20090623.
– !! Be careful, this script will ask for your password to get root privledges to your system!

OPTIONS:
-h Show this message
-i Install required configuration
-u Uninstall required configuration
-c Connect Tethering
-d Disconnect Tethering
-m [] Set iPhone’s MAC Address (to /home/USERNAME/.uitrc)
-v Verbose

Install Guide:
Avaliable from: http://us.cooperlees.com/download.php?F=uit.sh.gz

– Inital installation requires an active Internet Connection to get required dependancies through apt-get. Current dependancies = ‘bluez-compat’
– Only the install requires you to sudo the script, other areas apropriately sudo where required.

Install Process:

  1. Open terminal
  2. wget http://us.cooperlees.com/download.php?F=uit.sh.gz
  3. gunzip uit.sh.gz
  4. chmod 755 uit.sh
  5. [OPTIONAL] Move the script into your sbin – ‘sudo mv uit.sh /usr/sbin’ (This will allow it to be in your PATH)
  6. Run ‘sudo uit.sh -i’ (You will need to have your iphone in discoverable mode with Bluetooth on)
  7. You will be notified if it all sucessfully installs.

Connect Process:
– Ensure Bluetooth is on and paired with your system (use the GNOME Bluetooth tool to pair). Also make sure Internet Tethering is on.

  1. uit.sh -c

– Once connected you will see the iPhone come up with a blue bar stating ‘Internet Tethering’ is activated.

Disconnect Process:
One command will disconnect from the iphone tethering – You should see the blue notification text dissapear.

  1. uit.sh -d

Uninstall Process:

  1. uit.sh -u

– This will remove conf from files and also make backup of files modified.

Hope you enjoy it as much as I am. Finding the bluetooth a little slow. But still very handy and good. Thanks Apple.