24
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
Python tool for behavioral studies of
the IP Pools in the BRAS
Elio Ramón Avila Rodríguez, MSc.
1
Abstract
The deployment of postpaid services at interoperable hotel Wi-Fi
sites nationwide—allowing up to three devices per account—alongside
expanded coverage and higher occupancy, has increased IP address
utilization. Consequently, the Telecommunications Company of
Cuba S. A., ETECSA has experienced an increase in terms of requests
for IP address ranges at these sites, currently allocated via empirical
calculations based on estimated guest numbers and service usage. The
absence of tools providing accurate IP address usage statistics hinders
behavioral studies to determine optimal pool sizing. This may cause
service disruption and dissatisfaction for both customers experience
address exhaustion, while ETECSA faces inecient network resource
allocation. To address this, a Python-based utility was developed to
collect data for behavioral analysis. This tool was developed so as
to solve the this problem. This paper describes the work performed
and the results obtained with this tool, contributing to our Company
enhancing tourism-sector service delivery and optimizing network
resource eciency.
Keywords: Python, Netmiko, Network Automation, WiFi.
Received: 12/2023 | Approved: 02/2024 | Published: 08/2024
1 ETECSA. elio.avila@etecsa.cu
RESEARCH
pp. 24 - 33
25
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
Introduction
The service known as Wi-Fi Interoperability constitutes one
of the possible forms of Internet access provided by ETECSA, as
a service provider for hotels, campsites, restaurants, hospitals,
universities, public transport hubs, and many other places. This
service’s network architecture, which uses an IPoE solution with
Web authentication (Figure 1), customer trac is transported by
layer from the Wi-Fi network Access Points (AP) deployed at each
location, to the ME60 devices, operating as Broadband Remote
Access Servers (BRAS) in the IP/MPLS network. To accomplish this,
service VLANs are appropriately routed through the access switches
and transit equipment of the transport/aggregation networks, which
terminate at the corresponding BAS sub-interfaces on such BRAS.
User control is guaranteed in these latter devices through interaction
with the other system elements, such as: Session Control, Captive
Portal, AAA, and DNS. The BRAS also function as the DHCP servers
towards the customers, dynamically assigning IP addresses to their
Stations (STA) or terminal equipment. For this, it is necessary to
congure a private IP address pool, exclusive to each particular
site. ETECSA, as the service provider, manages and controls these
ranges, and their dimensioning is performed based on information
provided by the personnel where the service is installed, which
includes the estimated number of concurrent customers, calculated
from the number of installed APs and the expected occupancy of
the facilities, elements which can vary from time to time.
Figure 1. Summarized diagram of the Wi-Fi Interoperability service
pp. 24 - 33
26
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
In the designation of the above-mentioned Pool IPs may occur the
following cases:
1. Under-dimensioned pool: It is below actual needs. It may
happen that a number of customer devices request IPs and there are
no available addresses left to assign to them (the range congured
on the server is exhausted). This causes service impairment in those
customers who fail to get IP addresses.
2. Over-dimensioned pool: It exceeds the actual needs. It leads
to an inecient use of network resources (IPs) to the detriment of the
provider, which, in an extreme case, may be left without free ranges
for its operation.
3. Correctly dimensioned pool: It matches the actual needs.
There is no negative impact for either the customers or the provider.
As part of the Companys prioritized attention to the tourism sector,
we are continuously working on improving the Wi-Fi service in hotels
and solving their demands. As a result, the Wi-Fi Interoperability
modality called Postpaid Wallet, which has been applied with good
results since 2022; started in Havana and has spread throughout the
country. Here are some new features of this service:
1.- Billing based on total trac processed and not on the credit
consumed from active accounts.
2.- Creation of customer accounts from the hotel itself, with access
to GESNAUTA platform.
3.- Possibility to connect up to 3 devices per account.
4.- Need for accounts to remain connected
as long as possible once authenticated. In order to achieve this,
the disconnection for low trac and inactivity was disabled in the
BRAS. In the particular case of hotels on the Gaviota chain, this last
option was set for disconnection at 15 minutes.
In this postpaid modality, customers’ accounts can remain active
until logout, disconnection that the AAA sends at 12 hours of being
authenticated. This, together with the expansion of WiFi service in
hotel facilities, with coverage in practically all areas and increased
levels of occupation, has brought with it greater use of IP addresses,
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
pp. 24 - 33
27
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
and thus the need to expand the Pool in those places where it is
required. In this context, there has been an increase in demands for the
expansion of the IP Pools by the hotels’ technical and administrative
sta, who make an estimate based on the number of guests according
to housing capacities, multiplied by the 3 possible devices to connect
per account, resulting in a high number of requested IP addresses
(mostly /22 and /21 ranges).
On the other hand, the providers NCE management system
provides indications of IP address exhaustion in the Pools, by
generating usage alarms above 80% of IP addresses (a congurable
value, it comes with a default value), but it does not provide in a
timeline the specic values it reaches, but only when they exceed the
congured threshold value. Therefore, in the cases under analysis,
the required information was obtained on a case-by-case basis, by
manually probing the BRAS where the specic service was set up.
This is an inconvenience for precise monitoring use of IP addresses,
which makes it dicult to carry out behavioral studies, that allow to
choose the optimal Pool and serve as evidence to show in response
to customer demand. This can lead to service impairments and
dissatisfaction, both for customers and our Company, a fact which
constituted the problem to be solved in our case and which motivated
the development of a scheduled utility on Python, with which it was
possible to collect the information needed to conduct the relevant
studies and analyses related to IP Pools.
Python is a trend in the world of data network automation.
(Damien, 2020), given by its simplicity, versatility, modularity,
database processing, file management and graphical interfaces
for viewing information, as well as by the multiple and powerful
libraries available for connection to equipment from various
manufacturers, as is the case with Netmiko (Byers, 2024), used
in this work. Furthermore, it has a large international community
of developers, which is active, participatory and collaborative.
These elements, as well as having previous experience of its use,
were crucial when choosing the programming language used. This
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
pp. 24 - 33
28
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
paper describes the work done and the results obtained with the
developed computer tool.
Materials and methods
This research was developed under an applied engineering and
research approach for development (R+D). The methodology was
structured in three sequential phases to address the core problem
of the lack of accurate data on the use of IP addresses in the Wi-Fi
Interoperability service. Phase I consisted of the analysis of possible
commands to be used on the BRAS ME60, which would allow
gathering the necessary information. Phase II focused on analyzing
the tools available for network automation that would allow remote
management of the BRAS via the SSH protocol. Phase III consisted of
the development and implementation of a utility for automated data
collection, processing and presentation. These phases are described
below.
Study of possible commands to obtain the required
information
As a rst task, a survey of technical information was carried out,
to know the available commands and to choose the one suitable for
dened purposes. Among them was chosen the command disp ip-pool
pool-usage pool-name (pool name), the output of which simply and
explicitly provides the required information, which is: Pool address
range, IPs in use (including those allocated, conicting and blocked)
and the percentage of use they represent.
Network automation with Netmiko Python library
As a second step, the possible tools for collecting the required
information were studied and the Netmiko library of Python was
chosen for this purpose. This library was developed by Kirk Byers
as an improved version of Paramiko and is designed to facilitate
automated interaction with multi-manufacturers’ network devices,
such as: Cisco, Juniper, Arista, and many others (Byers, 2024).
Netmiko uses several communication technologies, the most
important being the SSH (Secure Shell) protocol, which encrypts
the management information transmitted thus achieving safer
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
pp. 24 - 33
29
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
communication. SSH is available on most telecommunication
devices for their remote access, this being the most used method
when applying automation to the field of telecommunications
networks (Damien, 2020). This library helps network operators to
send commands to equipment such as switches, routers, firewalls,
among others, in a scheduled and repeatable way, and offers a simple
and consistent way to automate network device management tasks
(Figure 2). This minimizes the manual intervention by operators
and reduces the margin of human error. This fact, combined with
Python’s multi-area capabilities, were the reasons for deciding on
this tool when choosing an effective network automation method.
Figure 2. Network automation using Netmiko
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
Structure of the Python-based program
Subsequently, a program on Python was developed, consisting
of two modules (Figure 3); the rst one (left) shows a Graphical User
Interface (GUI), which allows to enter the necessary parameters for
its execution. In its development, it was used primarily in the Tkinter
library. The second one (right) has in turn two parts: one for the periodic
connection to the equipment via SSH (using the Netmiko and Schedule
libraries), where the chosen command, described above, is sent to the
BRAS. This allows to query one or several selected IP Pools and properly
process the information it returns. The other part, after nishing the
pp. 24 - 33
30
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
number of dened readings, stores the data obtained in les with .csv,
.txt and .pdf extensions, in the latter case shows them graphically. The
Pandas and Matplotlib libraries were used for this part.
Program execution steps
The program execution consists of four steps (Figure 4):
1. Choosing the desired BRAS from a drop-down list (Figure 4a).
2. Choosing the IP Pool(s) to be analyzed from a drop-down list (it
automatically obtains them by connecting to the selected BRAS)
(Figure 4b).
3. Entering the start time to take readings and the number of
readings to be performed (Figure 4c).
4. Clicking on the ‘Execute Script’ button (Figure 4c).
Once the above is done, module 2 starts running at the time entered;
it takes the number of desired readings and processes the obtained
information.
a) b) c)
Figure 3. Structure of the Python-based program
Figure 4. Program execution steps
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
pp. 24 - 33
31
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
Results and discussion
Once the execution cycle of the program as shown in the previous
section is nished, the information obtained is stored in Excel and
text les, with .csv and .txt extensions (an example of this is shown in
Figures 5 a and b, respectively), as well as graphs with a .pdf extension.
a) b)
The case in Figure 6 is one of those that was monitored based on
the alarms generated in the NCE management system. According to
the information obtained with the Python utility, it was veried that IP
address exhaustion was occurring (in the red circles, moments when
it reaches 100% use) and thereby aecting customers.
Figure 5. Example of Excel and text information files
Figure 6. Under-dimensioned IP Pool Behaivor
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
pp. 24 - 33
32
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
Figure 7 shows a case where the IP pool was increased to /21, in
respond to a hotel demand. It can be seen in the obtained graphs that
does not exceed 20% of the use of IP addresses, being an example of
over-dimensioning, with implications for our Company.
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.
Figure 7. Over-dimensioned IP Pool Behaivor
Figure 8. Correctly-dimensioned IP Pool Behaivor
Figure 8 shows a correctly sized case. This particular one requested
to expand its IP address range, which was not necessary to do at that
time, based on the statistics obtained and shared with the hotel sta.
It should be mentioned that in all the examples shown, there was
a high level of occupancy in the hotels, which in turn suggests high
percentages of IP address use.
pp. 24 - 33
33
ISSN: 2224-6274, RNPS: 0514, Vol. 21, No. 1, january - july, 2025.
Conclusions
The conclusions of this research reect the positive impact of
implementation of a computer tool developed in Python to analyze and
manage the IP Pools within ETECSAs network. First of all, it is shown
that this tool is an eective solution to overcome the lack of accurate
information, allowing for automated collection and processing of
behavior of IP Pools, especially in environments where BRAs act as DHCP
servers. This facilitated early detection of issues, such as exhaustion
of IP addresses in hotels, and allowed timely corrective actions to
be taken, such as expanding the address range, avoiding service
interruptions. In addition, it was found that a correct dimensioning
of the Pools avoids unnecessary costs in the acquisition of new
IP addresses, contributing to a more efficient use of resources.
The statistics generated not only improve service quality Wi-Fi
for users, but also provide valuable evidence for technical and
administrative staff, increasing customer satisfaction. Finally,
although the tool was initially designed for the hotel sector,
its application potential is extended to other network IP Pool
services, demonstrating its flexibility and usefulness in different
ETECSAs network resource management contexts.
References
Garros, Damien (2020). NetDevOps Survey. https://dgarros.github.io/netdevops-
survey/reports/2020
Byers, K. (2024). Biblioteca Netmiko. https://github.com/ktbyers/netmiko
ME60 V800R023C00SPC500 Conguration Guide. Información técnica del
proveedor Huawei (2023). https://support.huawei.com/enterprise/en/doc/
EDOC1100335692/d0a3124b/conguration-management-conguration
pp. 24 - 33
Python tool for behavioral studies of the IP Pools in the BRAS
Elio Ramón Ávila Rodríguez, MSc.