Documentation ¶
Overview ¶
Copyright 2017 Politecnico di Torino
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 Politecnico di Torino ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 Politecnico di Torino ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type BufferQueue
- type ByMaskLen
- type RouterModule
- func (r *RouterModule) AddArpEntry(ip net.IP, mac net.HardwareAddr) (err error)
- func (r *RouterModule) AddRoutingTableEntry(network net.IPNet, outputIface string, nexthop net.IP) (err error)
- func (r *RouterModule) AddRoutingTableEntryLocal(network net.IPNet, outputIface string) (err error)
- func (r *RouterModule) AttachExternalInterface(ifaceName string) (err error)
- func (r *RouterModule) AttachToIoModule(ifaceId int, ifaceName string) (err error)
- func (r *RouterModule) Configure(conf interface{}) (err error)
- func (r *RouterModule) ConfigureInterface(ifaceName string, ip net.IP, netmask net.IPMask, mac net.HardwareAddr) (err error)
- func (r *RouterModule) Deploy() (err error)
- func (r *RouterModule) Destroy() (err error)
- func (r *RouterModule) DetachExternalInterface(ifaceName string) (err error)
- func (r *RouterModule) DetachFromIoModule(ifaceName string) (err error)
- func (r *RouterModule) GetModuleId() string
- func (r *RouterModule) ProcessPacket(p *hover.PacketIn) (err error)
- type RouterModuleInterface
- type RoutingTableEntry
Constants ¶
const CLEANUP_EVERY_N_PACKETS = 5
const MAX_ENTRY_AGE = 15 * time.Second
const MAX_QUEUE_LEN = 10
const SLOWPATH_ARP_LOOKUP_MISS = 2
const SLOWPATH_ARP_REPLY = 1
const SLOWPATH_TTL_EXCEEDED = 3
Variables ¶
var RouterCode = `` /* 10395-byte string literal not displayed */
Functions ¶
This section is empty.
Types ¶
type BufferQueue ¶
type BufferQueue struct {
// contains filtered or unexported fields
}
type ByMaskLen ¶
type ByMaskLen []RoutingTableEntry
type RouterModule ¶
type RouterModule struct { ModuleId string RoutingTable []RoutingTableEntry Interfaces map[string]*RouterModuleInterface OutputBuffer map[uint32]*BufferQueue PktCounter int // contains filtered or unexported fields }
func Create ¶
func Create(hc *hover.Client) *RouterModule
func (*RouterModule) AddArpEntry ¶
func (r *RouterModule) AddArpEntry(ip net.IP, mac net.HardwareAddr) (err error)
func (*RouterModule) AddRoutingTableEntry ¶
func (r *RouterModule) AddRoutingTableEntry(network net.IPNet, outputIface string, nexthop net.IP) (err error)
Routes in the routing table have to be ordered according to the netmask length. This is because of a limitation in the eBPF datapath (no way to perform LPM there) next hop is a string indicating the ip address of the nexthop, 0.0.0.0 indicates that the network is directly attached to the router.
func (*RouterModule) AddRoutingTableEntryLocal ¶
func (r *RouterModule) AddRoutingTableEntryLocal(network net.IPNet, outputIface string) (err error)
A local entry of the routing table indicates that the network interface is directly attached, so there is no need of the next hop address. This function force the routing table entry to be local, pushing 0 as nexthop
func (*RouterModule) AttachExternalInterface ¶
func (r *RouterModule) AttachExternalInterface(ifaceName string) (err error)
func (*RouterModule) AttachToIoModule ¶
func (r *RouterModule) AttachToIoModule(ifaceId int, ifaceName string) (err error)
func (*RouterModule) Configure ¶
func (r *RouterModule) Configure(conf interface{}) (err error)
func (*RouterModule) ConfigureInterface ¶
func (r *RouterModule) ConfigureInterface(ifaceName string, ip net.IP, netmask net.IPMask, mac net.HardwareAddr) (err error)
After a interface has been added, it is necessary to configure it before it can be used to route packets TODO I think we have to add next hop parameter here!
func (*RouterModule) Deploy ¶
func (r *RouterModule) Deploy() (err error)
func (*RouterModule) Destroy ¶
func (r *RouterModule) Destroy() (err error)
func (*RouterModule) DetachExternalInterface ¶
func (r *RouterModule) DetachExternalInterface(ifaceName string) (err error)
func (*RouterModule) DetachFromIoModule ¶
func (r *RouterModule) DetachFromIoModule(ifaceName string) (err error)
func (*RouterModule) GetModuleId ¶
func (r *RouterModule) GetModuleId() string
func (*RouterModule) ProcessPacket ¶
func (r *RouterModule) ProcessPacket(p *hover.PacketIn) (err error)
type RouterModuleInterface ¶
type RoutingTableEntry ¶
type RoutingTableEntry struct {
// contains filtered or unexported fields
}