Skip to content

FZhg/source-routing-INT

Repository files navigation

Source Routing

                 
                   
                   +--+
            +------+s2+------+
            |      +--+      |
+--+      +-++              ++-+       +--+
|h1+------+s1|              |s4+-------+h2|
+--+      +-++              ++-+       +--+
            |                |
            |      +--+      |
            +------+s3+------+
                   +--+

         

Introduction

I modified the Simple INT and Source Routing examples from the P4-Learning Repo.

How to run

To run this implementation, you need to have P4-Util VM.

sudo python network.py

Start the receiver script at h2:

mx h2
python receive.py

Send packets with the source routing header indicating which path the packet has to take. Once you start the script it will ask you which path do you want to take.

You can decide to go to h2 through s2 and s4:

mx h1
python send.py 10.0.4.2 "Hello, h2!"
Type space separated switch_ids nums (example: "2 3 2 2 1") or "q" to quit: 2 4

Or you can use s3 instead:

python send.py 10.0.4.2 "Hello, h2!"
Type space separated switch_ids nums (example: "2 3 2 2 1") or "q" to quit: 3 4

You can also do some loops:

python send.py 10.0.4.2 "Hello, h2!"
Type space separated switch_ids nums (example: "2 3 2 2 1") or "q" to quit: 2 4 3 1 2 4

This implementation supports maximum 9 hops.

About

INT by source routing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published