An agent-based approach for the design and analysis of content delivery networks