Francisco Germano Vogt
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Exercises - P4 - In-band Network Telemetry (INT) In-band Network Telemetry (“INT”) is a framework designed to allow the collection and reporting of network state, by the data plane, without requiring intervention or work by the control plane. In the INT architectural model, packets contain header fields that are interpreted as “telemetry instructions” by network devices. These instructions tell an INT--capable device what state to collect and write into the packet as it transits the network. ![](https://i.imgur.com/WWGabRr.png) Complementary information about the P4-based INT lab can be found at [here](https://drive.google.com/file/d/1dnNZ88iMu_xH4WCVVmvTNMkZDBOUtgep/view?usp=sharing) After downloading and importing this ([8GB virtual machine](https://drive.google.com/drive/folders/1z6EpkWXYfPhkDEwfY21gQvzPI3iXs41z?usp=sharing)), we can start the exercises below: :::info VM username: INT VM password: int ::: Tip: Run the lab from the VM, not over SSH, because there are some windows that don't work well over an SSH connection. ## Part 1 - Iperf Test Quick fix: Comment the following lines to disable the iperf clients. ``` cd ~/Desktop/p4factory/mininet gedit ./int_ref_topology.py # h1.cmd("iperf -c 10.2.1.4 -t 3000 > /dev/null &") ........line 104 # h3.cmd("iperf -c 10.2.1.2 -t 3000 > /dev/null &") ........line 105 ``` For running the reference INT application, use: ``` cd ~/Desktop/p4factory/mininet sudo ./int_ref_topology.py --model-dir=$HOME /home/ ``` This script “int_ref_topology.py” add and configure the two spines and leaf switches and start the quagga on switches for exchanging the routing and topology information. The Reference topology is given below (More details can be found at [LINK](https://drive.google.com/file/d/1dnNZ88iMu_xH4WCVVmvTNMkZDBOUtgep/view?usp=sharing)): ![](https://i.imgur.com/V8bVwFB.png) After creating the mininet emulated network, you can see the full mesh of pings between hosts as background traffic. Now , load the visualizer HTML page, opening the file below on google chrome. To do this, open another terminal and run: ``` google-chrome ~/Desktop/p4factory/apps/int/monitor/client/index.html ``` You can visualize the telemetry data generated by mininet topology over Network Dashboard. :::info Network dashboard has 4 components: 1. Reference topology indicates the current path in blue and old path (congested path) in red. 2. Real time hop latencies graph per switch, each bar indicates the time spend by a packet in a switch. 3. Loop detected window. 4. Flow filter, using this you can choose the particular flow to visualize. ::: The script “int_ref_topology.py” starts the two iperf clients on host 1 and host 3, now you can start the iperf traffic manually as follows: In the Mininet CLI use: ``` mininet> xterm h1 ``` and in the h1 CLI use: ``` iperf -c 10.2.1.3 -t 60 ``` Monitor and web client recognize the new connection. We can visualize the latency of this particular flow via flow filter on network dashboard. :::danger In the browser, looking at the topology paths (blue and red) and the latency measurements (of flow 10.2.1.1 -> 10.2.1.3), can you see any changes in per packet latency at leaf1 after starting the iperf traffic between h1 and h3? Explain. ::: ## Part 2 - Routing failover test Exit the current mininet running topology using the command: ``` mininet> quit ``` So, restart the application running: ``` sudo ./int_cleanup.sh ``` (You can ignore the errors: "Cannot find device ...") Now start again the reference application running: ``` sudo ./int_ref_topology.py --model-dir=$HOME /home/ mininet> xterm h1 ``` and in the h1 CLI runing: ``` iperf -t 100 -c 10.2.1.3 ``` Now open a terminal on leaf1 at mininet CLI: ``` mininet> xterm leaf1 ``` :::danger Check which spine switch passses the traffic using the Web Client UI. If the connection is going through spine1 or spine2, shut down the port on leaf1 that is connected to spine1 (leaf1-eth3) or spine1 (leaf1-eth4), respectively. ::: To do this, if spine 1 is active run the command below in the leaf1 xterm ``` ifconfig leaf1-eth3 down ``` However, if spine 2 is active run in the leaf1 xterm the command: ``` ifconfig leaf1-eth4 down ``` :::info Note: When you bring up any particular interface, please wait for some time before bring down any other interface ::: :::danger After disable the particular port at leaf1, (in the browser topology) can you see the changes in the ongoing physical route after 3 sec ? (3 secs is the BGP hold-down time) ::: ## Part 3 - Analyzing INT headers using Tshark test Exit the current mininet running topology using the command: ``` mininet> quit ``` Restart the application: ``` sudo ./int_cleanup.sh ``` (You can ignore the errors: "Cannot find device ...") Comment the following lines to disable the iperf clients and full mesh of pings: ``` gedit ./int_cfg.py # self.startPingMesh() .........line 156 ``` Now run the reference INT Application: ``` sudo ./int_ref_topology.py --model-dir=$HOME /home/ ``` Open two consoles leaf1 running in the mininet CLI: ``` xterm leaf1 xterm leaf1 ``` Start the tshark to capture the packets at interfaces leaf1-eth1 and leaf1-eth2 running in the new xterms (1 per xterm): ``` tshark -i leaf1-eth1 -V -c 5 tshark -i leaf1-eth2 -V -c 5 ``` Now, open a new h1 CLI running: ``` xterm h1 ``` And generate the iperf udp traffic from host 1 to host 2: ``` iperf -c 10.2.1.2 -t 1 -u ``` You can see, the 5 frames have been captured at leaf1-eth1 and leaf1-eth2 interfaces :::danger Compare the 5th frame (identified as “Frame5:”) at both interfaces. Can you see any difference between them ? Explain. ::: :::info Note: tshark, wireshark or tcpdump are not currently able to visualize the INT shim and metadata headers because dissector for INT specification is not defined in the given packet capturing tools. Therefore, these tools read INT headers as MPLS headers. ::: :::warning For analyzing the INT headers and metadata added by every switch, we need to manually read the frames bit by bit and verifying with INT specification. To understand how we can analyze that what types of information added by every switch for telemetry, please download the int.pcap file by the following link: https://intrig.dca.fee.unicamp.br:8840/index.php/s/AEZhzHFTpU4kjaL ::: :::warning Open the int.pcap in wireshark and compare the every bit of 1st frame with different headers format and, for INT shim and metadata headers, follow INT specification (page 8, 9, 10 , 11 , 14 & 15) for verification. Ethernet 00c0 a0a0 0001 0001 0000 0001 0800 IP 4500 009e bb5f 0000 3f11 a8ed 0a00 0202 0a00 0101 UDP dd01 12b6 008a 0000 VXLAN 0c Flags 00 00 Reserved 05 Next Protocol (05 INT Protocol) 0000 0a VNI 00 Reserved INT 00 Type 00 Reserved 06 Length 03 Next Protocol INT Metadata 0003 2001 INT Metadata header 0000 0000 0000 0011 0010 0000 0000 0001 00 Version 00 Replication Requested 0 Copy 0 Max Hop Count exceeded 00000 Reserved 00011 Instruction Count (3) 0010 0000 Max Hop Count (32) 0000 0001 Total Hop Count (1) b000 Intrictions Bitmap 1011 0000 0000 0000 1 bit0 (MSB): Switch ID 0 bit1: Ingress port ID 1 bit2: Hop latency 1 bit3: Queue occupancy 0 bit4: Ingress timestamp 0 bit5: Egress port ID 0 bit6: Queue congestion status 0 bit7: Egress port tx utilization 0000 Reserved 0000 Reserved 0000 Reserved 0000 00a1 1st INT METADATA **Stack Switch ID** 0000 0017 2nd INT METADATA **Stack Hop Latency** 8000 0000 last INT METADATA **Stack Queue occupancy** Note: Here, we analyze 1st frame of int.pcap bit by bit till INT metadata. ::: :::danger In similar way, can you find what type of INT metadata and their values have been added by leaf1 by analyzing the 5th frame at interface leaf1-eth2 ? Explain. ::: ## Congratulations! Now you know a little about In-band Network Telemetry!

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully