- Protecting Valuable Resources
- Interfaces: Action-Packed Entities
- Configuring IP Addresses
- Solution Introduction and the Flyweight Pattern
- A Generic Network Link
- A Generic Network Link Context
- A Real Network Link
- The GenericLink Implementation
- The GenericLinkContext Implementation
- The RealLink Implementation
- Bringing the Code Together
- Conclusion
- Additional Reading
Interfaces: Action-Packed Entities
Each of the devices in Figure 1 typically contains a range of interface types, such as IP, ATM, frame relay, optical, and so on. The trend is increasingly for devices to be based on a technology called multiprotocol label switching (MPLS). My previous articles have described this key networking technology, so I’ll just provide a small amount of detail here to show the problem I want to solve. (More information is available in my book Network Management, MIBs and MPLS: Principles, Design and Implementation.)
Figure 1 Links created by connecting interfaces.
The links in Figure 1 join individual interfaces on adjacent devices. Traffic passing between the devices traverses the links. For IP interfaces, the links are logically divided (partitioned) by the use of IP addresses. Telecom devices may have a great many IP addresses configured on a given interface type, as illustrated in Figure 2. Each interface at either end of a link can have an IP address.
Figure 2 Subdivided interfaces between routers.
If each device supports, say, 100 IP addresses, and you have 1,000 such devices in your network, the task of numbering becomes onerous, to say the least. Some network management system products provide for a partial solution by at least discovering the information in Figure 2. However, this assumes that the IP addresses have been magically assigned to the interfaces! What about the case where we have the basic out-of-the-box configuration with no IP addresses?