YouTube is one of the most popular and volume-dominant services in today’s Internet, and has changed the Web for ever. Consequently, network operators are forced to consider it in the design, deployment, and optimization of their networks. Taming YouTube requires a good understanding of the complete YouTube stack, from the network streaming service to the application itself. Understanding the interplays between individual YouTube functionalities and their implications for traffic and user Quality of Experience (QoE) becomes paramount nowadays. In this paper we characterize and model the YouTube stack at different layers, going from the generated network traffic to the QoE perceived by the users watching YouTube videos. Firstly, we present a network traffic model for the YouTube flow control mechanism, which permits to understand how YouTube provisions video traffic flows to users. Secondly, we investigate how traffic is consumed at the client side, deriving a simple model for the YouTube application. Thirdly, we analyze the implications for the end user, and present a model for the quality as perceived by them. This model is finally integrated into a system for real time QoE-based YouTube monitoring, highly useful to operators to assess the performance of their networks for provisioning YouTube videos. The central parameter for all the presented models is the buffer level at the YouTube application layer. This paper provides an extensive compendium of objective tools and models for network operators to better understand the YouTube traffic in their networks, to predict the playback behavior of the video player, and to assess how well they are doing in practice in delivering YouTube videos to their customers.