Ouroboros Tutorial 02: Difference between revisions
No edit summary |
No edit summary |
||
Line 38: | Line 38: | ||
After bootstrapping the IPCP, we see that it has no bound names yet. To be able to enroll, the second IPCP will need to ''allocate a flow'' to the first one (over the local Layer), and to be able to allocate the flow, the first IPCP will need to be bound to a name that is registered into the local Layer. | After bootstrapping the IPCP, we see that it has no bound names yet. To be able to enroll, the second IPCP will need to ''allocate a flow'' to the first one (over the local Layer), and to be able to allocate the flow, the first IPCP will need to be bound to a name that is registered into the local Layer. | ||
When creating layers, we will leverage Ouroboros' ''anycast'': instead of binding the IPCP to a single name, we will bind it to ''two'' names: the first name will be unique for each IPCP and can be used to create flows to that specific IPCP, the second name will be common for all IPCPs in the layer. This is useful for enrollment, as the new IPCP can enroll with any IPCP in the network. | When creating layers, we will leverage Ouroboros' ''anycast'': instead of binding the IPCP to a single name, we will bind it to ''two'' names: the first name will be unique for each IPCP and can be used to create flows to that specific IPCP, the second name will be common for all IPCPs in the layer. This is useful for enrollment, as the new IPCP can enroll with any IPCP in the network. Let's bind and register these names now: | ||
$ irm bind ipcp uni-1 name uni-1 | $ irm bind ipcp uni-1 name uni-1 | ||
Line 44: | Line 44: | ||
$ irm name register uni-1 layer local-layer | $ irm name register uni-1 layer local-layer | ||
$ irm name register unicast-layer layer local-layer | $ irm name register unicast-layer layer local-layer | ||
With the first IPCP reachable, let's create and enroll the second one. Just like the bootstrap command, the enroll command will create an IPCP if there is no IPCP with that name yet in the system: | |||
$ irm ipcp enroll name uni-2 layer unicast-layer autobind | |||
This command will do a number of things | |||
# create a unicast IPCP with name uni-2, as there is no IPCP with that name yet. | |||
# allocate a flow from uni-2 to the "unicast-layer". IPCP uni-1 is the only process that accepts these flows. | |||
# over this flow, create a connection with the enrollment component | |||
# enroll uni-2 with uni-1: Uni-1 will send its configuration (default policies), and uni-2 will configure with these policies. | |||
# deallocate the flow used for enrollment | |||
# bind the process to the unique name uni-2 and the layer name unicast-layer | |||
Let's break it down further using the IRMd log output: | |||
==07907== irmd(II): Created IPCP 8139. | |||
==08139== ipcpd/ipcp(II): Enrolling with unicast-layer... | |||
==08139== unicast-ipcp(II): [773fbf64335df4fc] Requesting enrollment. | |||
==07907== irmd(II): Allocating flow for 8139 to unicast-layer. | |||
==07930== ipcpd/ipcp(II): Allocating flow 0 to 23958da5. | |||
==07930== ipcpd-local(DB): Allocating flow to 23958da5 on fd 64. | |||
==07907== irmd(DB): Flow req arrived from IPCP 7930 for 23958da5. | |||
==07907== irmd(II): Flow request arrived for unicast-layer. | |||
==07930== ipcpd-local(II): Pending local allocation request on fd 64. | |||
==07930== ipcpd/ipcp(II): Finished allocating flow 0 to 23958da5: 0. | |||
==07930== ipcpd/ipcp(II): Responding 0 to alloc on flow_id 1. | |||
==07907== irmd(II): Flow on flow_id 0 allocated. | |||
==07930== ipcpd-local(II): Flow allocation completed, fds (64, 65). | |||
==07930== ipcpd/ipcp(II): Finished responding to allocation request: 0 | |||
==07907== irmd(II): Flow on flow_id 1 allocated. | |||
The first part shows the creation of the IPCP and the flow allocation from uni-2 to uni-1. Enrollment requests receive an random 64-bit ID so they can be traced more simply in the logs (we will do the same with flow allocation requests in the future). The explanation for the flow allocation procedure can be found in [[Ouroboros Tutorial 01 | tutorial 01]]. | |||
==08139== connection-manager(DB): Sending cacep info for protocol OEP to fd 64. | |||
==08030== connection-manager(II): Handling incoming flow 64 | |||
==08030== connection-manager(II): Request to connect to Enrollment. | |||
==08030== connection-manager(II): Finished handling incoming flow 64 for Enrollment: 0. | |||
==08030== enrollment(II): Incoming enrollment connection on flow 64. | |||
==08030== enrollment(II): [773fbf64335df4fc] Handling incoming enrollment. | |||
==08030== enrollment(DB): [773fbf64335df4fc] Sending enrollment info (63 bytes). | |||
==08139== enrollment(DB): [773fbf64335df4fc] Received configuration info (63 bytes). | |||
==08139== unicast-ipcp(II): IPCP got address 1978304124. | |||
==08139== ca(DB): Using multi-bit ECN. | |||
==08139== link-state-routing(DB): Using link state routing policy. | |||
==08139== pff(DB): Using simple PFF policy. | |||
==07907== irmd(DB): New instance (8030) of ipcpd-unicast added. | |||
==07907== irmd(DB): This process accepts flows for: | |||
==07907== irmd(DB): unicast-layer | |||
==07907== irmd(DB): uni-1 | |||
==08139== pff(DB): Using simple PFF policy. | |||
==08139== pff(DB): Using simple PFF policy. | |||
==08030== enrollment(II): [773fbf64335df4fc] Enrollment completed. | |||
==07907== irmd(DB): Deallocating flow 0 for process 8139. | |||
==07907== irmd(DB): Partial deallocation of flow_id 0 by process 8139. | |||
==07907== irmd(DB): Deallocating flow 1 for process 8030. | |||
==07907== irmd(DB): Partial deallocation of flow_id 1 by process 8030. | |||
==07930== ipcpd/ipcp(II): Deallocating flow 0. | |||
==07930== ipcpd/ipcp(II): Deallocating flow 1. | |||
==07907== irmd(DB): Deallocating flow 0 for process 7930. | |||
==07907== irmd(DB): Deallocating flow 1 for process 7930. | |||
==07907== irmd(II): Completed deallocation of flow_id 0 by process 7930. | |||
==07930== ipcpd-local(II): Flow with fd 64 deallocated. | |||
==07930== ipcpd/ipcp(II): Finished deallocating flow 0: 0. | |||
==08139== unicast-ipcp(II): [773fbf64335df4fc] Enrolled with unicast-layer. | |||
==08139== ipcpd/ipcp(II): Finished enrolling with unicast-layer: 0. | |||
==07907== irmd(II): Enrolled IPCP 8139 in layer unicast-layer. | |||
==07907== irmd(II): Completed deallocation of flow_id 1 by process 7930. | |||
==07930== ipcpd-local(II): Flow with fd 65 deallocated. | |||
==07930== ipcpd/ipcp(II): Finished deallocating flow 1: 0. | |||
==08030== enrollment(II): Enrollment flow 64 closed. | |||
==07907== irmd(DB): New instance (8139) of ipcpd-unicast added. | |||
==07907== irmd(DB): This process accepts flows for: | |||
==07907== irmd(II): Bound process 8139 to name uni-2. | |||
==07907== irmd(II): Bound process 8139 to name unicast-layer. |
Revision as of 14:01, 5 November 2023
The description of this tutorial uses a debug build.
The objective for this tutorial is to create a 2-layer network. We will add a simple 2-node unicast Layer on top of a local Layer and will ping an oping server from an oping client over this network.
Initially, this will probably sound like gibberish, especially if configuring VLANs and defining IP subnets are your bread and butter, but once the concepts of flow allocation and binding / registering names become familiar, this will all 'click'.
We recommend opening a couple of terminal windows for this tutorial.
First, we will create a local loopback network like in the previous tutorial:
$ irm ipcp bootstrap type local name local-ipcp layer local-layer
Now we will create the 2-node unicast network on top of this Local Layer 'network'.
To create this small unicast network, we bootstrap the first IPCP; and then enroll a second IPCP with that first IPCP.
$ irm ipcp bootstrap type unicast name uni-1 layer unicast-layer
Let's quickly have a look at the IRMd log, which shows the following output:
==07907== irmd(II): Created IPCP 8030. ==08030== ipcpd/ipcp(II): Bootstrapping... ==08030== unicast-ipcp(II): IPCP got address 3241766228. ==08030== ca(DB): Using multi-bit ECN. ==08030== link-state-routing(DB): Using link state routing policy. ==08030== pff(DB): Using simple PFF policy. ==08030== pff(DB): Using simple PFF policy. ==08030== pff(DB): Using simple PFF policy. ==08030== ipcpd/ipcp(II): Finished bootstrapping: 0. ==07907== irmd(II): Bootstrapped IPCP 8030 in layer unicast-layer. ==07907== irmd(DB): New instance (8030) of ipcpd-unicast added. ==07907== irmd(DB): This process accepts flows for:
The IRMd has created our first IPCP, in our case it has pid 8030 and got address 3241766228. It is using the default policies: explicit congestion notification (ECN), flat addressing, and link-state routing with a simple forwarding function. Other forwarding functions currently implemented are loop-free alternates and equal-cost multi-path.
After bootstrapping the IPCP, we see that it has no bound names yet. To be able to enroll, the second IPCP will need to allocate a flow to the first one (over the local Layer), and to be able to allocate the flow, the first IPCP will need to be bound to a name that is registered into the local Layer.
When creating layers, we will leverage Ouroboros' anycast: instead of binding the IPCP to a single name, we will bind it to two names: the first name will be unique for each IPCP and can be used to create flows to that specific IPCP, the second name will be common for all IPCPs in the layer. This is useful for enrollment, as the new IPCP can enroll with any IPCP in the network. Let's bind and register these names now:
$ irm bind ipcp uni-1 name uni-1 $ irm bind ipcp uni-1 name unicast-layer $ irm name register uni-1 layer local-layer $ irm name register unicast-layer layer local-layer
With the first IPCP reachable, let's create and enroll the second one. Just like the bootstrap command, the enroll command will create an IPCP if there is no IPCP with that name yet in the system:
$ irm ipcp enroll name uni-2 layer unicast-layer autobind
This command will do a number of things
- create a unicast IPCP with name uni-2, as there is no IPCP with that name yet.
- allocate a flow from uni-2 to the "unicast-layer". IPCP uni-1 is the only process that accepts these flows.
- over this flow, create a connection with the enrollment component
- enroll uni-2 with uni-1: Uni-1 will send its configuration (default policies), and uni-2 will configure with these policies.
- deallocate the flow used for enrollment
- bind the process to the unique name uni-2 and the layer name unicast-layer
Let's break it down further using the IRMd log output:
==07907== irmd(II): Created IPCP 8139. ==08139== ipcpd/ipcp(II): Enrolling with unicast-layer... ==08139== unicast-ipcp(II): [773fbf64335df4fc] Requesting enrollment. ==07907== irmd(II): Allocating flow for 8139 to unicast-layer. ==07930== ipcpd/ipcp(II): Allocating flow 0 to 23958da5. ==07930== ipcpd-local(DB): Allocating flow to 23958da5 on fd 64. ==07907== irmd(DB): Flow req arrived from IPCP 7930 for 23958da5. ==07907== irmd(II): Flow request arrived for unicast-layer. ==07930== ipcpd-local(II): Pending local allocation request on fd 64. ==07930== ipcpd/ipcp(II): Finished allocating flow 0 to 23958da5: 0. ==07930== ipcpd/ipcp(II): Responding 0 to alloc on flow_id 1. ==07907== irmd(II): Flow on flow_id 0 allocated. ==07930== ipcpd-local(II): Flow allocation completed, fds (64, 65). ==07930== ipcpd/ipcp(II): Finished responding to allocation request: 0 ==07907== irmd(II): Flow on flow_id 1 allocated.
The first part shows the creation of the IPCP and the flow allocation from uni-2 to uni-1. Enrollment requests receive an random 64-bit ID so they can be traced more simply in the logs (we will do the same with flow allocation requests in the future). The explanation for the flow allocation procedure can be found in tutorial 01.
==08139== connection-manager(DB): Sending cacep info for protocol OEP to fd 64. ==08030== connection-manager(II): Handling incoming flow 64 ==08030== connection-manager(II): Request to connect to Enrollment. ==08030== connection-manager(II): Finished handling incoming flow 64 for Enrollment: 0. ==08030== enrollment(II): Incoming enrollment connection on flow 64. ==08030== enrollment(II): [773fbf64335df4fc] Handling incoming enrollment. ==08030== enrollment(DB): [773fbf64335df4fc] Sending enrollment info (63 bytes). ==08139== enrollment(DB): [773fbf64335df4fc] Received configuration info (63 bytes). ==08139== unicast-ipcp(II): IPCP got address 1978304124. ==08139== ca(DB): Using multi-bit ECN. ==08139== link-state-routing(DB): Using link state routing policy. ==08139== pff(DB): Using simple PFF policy. ==07907== irmd(DB): New instance (8030) of ipcpd-unicast added. ==07907== irmd(DB): This process accepts flows for: ==07907== irmd(DB): unicast-layer ==07907== irmd(DB): uni-1 ==08139== pff(DB): Using simple PFF policy. ==08139== pff(DB): Using simple PFF policy. ==08030== enrollment(II): [773fbf64335df4fc] Enrollment completed. ==07907== irmd(DB): Deallocating flow 0 for process 8139. ==07907== irmd(DB): Partial deallocation of flow_id 0 by process 8139. ==07907== irmd(DB): Deallocating flow 1 for process 8030. ==07907== irmd(DB): Partial deallocation of flow_id 1 by process 8030. ==07930== ipcpd/ipcp(II): Deallocating flow 0. ==07930== ipcpd/ipcp(II): Deallocating flow 1. ==07907== irmd(DB): Deallocating flow 0 for process 7930. ==07907== irmd(DB): Deallocating flow 1 for process 7930. ==07907== irmd(II): Completed deallocation of flow_id 0 by process 7930. ==07930== ipcpd-local(II): Flow with fd 64 deallocated. ==07930== ipcpd/ipcp(II): Finished deallocating flow 0: 0. ==08139== unicast-ipcp(II): [773fbf64335df4fc] Enrolled with unicast-layer. ==08139== ipcpd/ipcp(II): Finished enrolling with unicast-layer: 0. ==07907== irmd(II): Enrolled IPCP 8139 in layer unicast-layer. ==07907== irmd(II): Completed deallocation of flow_id 1 by process 7930. ==07930== ipcpd-local(II): Flow with fd 65 deallocated. ==07930== ipcpd/ipcp(II): Finished deallocating flow 1: 0. ==08030== enrollment(II): Enrollment flow 64 closed. ==07907== irmd(DB): New instance (8139) of ipcpd-unicast added. ==07907== irmd(DB): This process accepts flows for:
==07907== irmd(II): Bound process 8139 to name uni-2. ==07907== irmd(II): Bound process 8139 to name unicast-layer.