Mathematical models for resource management and allocation in content delivery networks