Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Router Implementation #129

Merged
merged 22 commits into from
Jul 17, 2019
Merged

Conversation

gabrik
Copy link
Contributor

@gabrik gabrik commented Jul 17, 2019

This is the implementation of virtual routers using Linux network namespaces, iptables, Linux bridges and veth interfaces.

it allows the possibility to router between virtual network and external world and between virtual networks.

In order to create a router a new descriptor format was designed:

type port_kind = [
  | INTERNAL
  | EXTERNAL
]

type r_state = [
  | CREATE
  | DESTROY
]



type router_port = {
  port_type : port_kind;
  ?vnet_id : string option;
  ?ip_address : string option;
}



type descriptor = {
  ?uuid : string option;
  ports : router_port list;
}

type router_port_record = {
  port_type : port_kind;
  faces : string list;
  ?ext_face : string option;
  ip_address : string;
  ?pair_id : string option;
}

type record = {
  uuid : string;
  state : r_state;
  ports : router_port_record list;
  router_ns : string;
  nodeid :  string

}

example of a router descriptor:

{
    "uuid": "f2df1b49-1f96-4bce-a35b-e5a8a82adae2",
    "ports": [
        {
            "port_type": "EXTERNAL"
        },
        {
            "port_type": "INTERNAL",
            "vnet_id": "6cc2aa30-1dcf-4c93-a57e-433fd0bd498e",
            "ip_address": "192.168.234.1/24"
        }
    ]
}

Also 4 new APIs where added in order to manage the lifecycle of a router:

  • FIMAPI.network.add_router(node id, router descriptor)
  • FIMAPI.network.remove_router(node id, router id)
  • FIMAPI.network.add_router_port(node id , router id, port type, virtual network id, default is None, ip address in format IP/NETMASK see example, default is None)
  • FIMAPI.network.remove_router_port( node id , router id , virtual network id )

gabrik added 22 commits July 15, 2019 15:31
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
…rmation

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
…ge, added listener in LinuxBridge for router operations

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
…tor to record for a vrouter

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
… register

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
… register

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
… router

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
…runtime

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
@gabrik gabrik self-assigned this Jul 17, 2019
@gabrik gabrik merged commit 7f59014 into eclipse-fog05:master Jul 17, 2019
gabrik added a commit that referenced this pull request Nov 26, 2020
This is the implementation of virtual routers using Linux network namespaces, iptables, Linux bridges and veth interfaces.

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant