1. Homepage
  2. Programming
  3. CSEE4119 F24 Computer Networks Project 1: Video CDN

CSEE4119 F24 Computer Networks Project 1: Video CDN

Engage in a Conversation
ColumbiaCSEE4119Computer NetworksVideo CDNCSocket ProgrammingContent Delivery Network

CSEE4119 F24 Computer Networks Project 1: Video CDN CourseNana.COM

0. Deadlines and Updates CourseNana.COM

Preliminary Stage Due: October 9th, 11:59pm Updates: CourseNana.COM

0. Deadlines and Updates 1 CourseNana.COM

1. Overview 2 CourseNana.COM

1.1 In the Real World 2 CourseNana.COM

1.2 Your System 2 CourseNana.COM

1.3 Groups and collaboration policy 4 CourseNana.COM

2. Preliminary stage 4 CourseNana.COM

2.1 Requirements 4 CourseNana.COM

2.2 Get your connections right. 5 CourseNana.COM

2.3 Forwarding protocol. 5 CourseNana.COM

2.4 Running the proxy 6 CourseNana.COM

2.5 Test it out! 7 CourseNana.COM

2.6 Final result 7 CourseNana.COM

2.7 What to Submit for preliminary stage 8 CourseNana.COM

2.8 Where to Submit 9 CourseNana.COM

3. Final stage: Video Bitrate Adaptation 9 CourseNana.COM

4. Development Environment 9 CourseNana.COM

4.1 Virtual Machine 9 CourseNana.COM

4.2 Starter Files (for final stage) 11 CourseNana.COM

4.3 Network Simulation (for final stage) 11 CourseNana.COM

4.4 Apache 11 CourseNana.COM

4.5 Programming Language and Packages 11 CourseNana.COM

5. Grading 12 CourseNana.COM

Academic integrity: Zero tolerance on plagiarism 13 CourseNana.COM

1. Overview CourseNana.COM

In this project, you will explore aspects of how streaming video works, as well as socket programming and HTTP. In particular, you will implement adaptive bitrate selection. The programming languages and packages are specified in the development environment section. CourseNana.COM

We will do this in multiple stages:
1. Preliminarystage:buildingasimpleproxy
2. Intermediatestage:requestingandreceivingvideochunks(TBD) 3. Finalstage:implementingadaptivebitratestreaming
CourseNana.COM

1.1 In the Real World CourseNana.COM

Figure 1 depicts (at a high level) what this system looks like in the real world. Clients trying to stream a video first issue a DNS query to resolve the service’s domain name to an IP address for one of the content servers operated by a content delivery network (CDN). The CDN’s authoritative DNS server selects the “best” content server for each particular client based on (1) the client’s IP address (from which it learns the client’s geographic or network location) and (2) current load on the content servers (which the servers periodically report to the DNS server). CourseNana.COM

Once the client has the IP address for one of the content servers, it begins requesting chunks of the video the user requested. The video is encoded at multiple bitrates. As the client player receives video data, it calculates the throughput of the transfer and monitors how much video it has buffered to play, and it requests the highest bitrate the connection can support without running out of video in the playback buffer. CourseNana.COM

1.2 Your System CourseNana.COM

Implementing an entire CDN is clearly a tall order, so let’s simplify things. First, your entire system will run on one host; we’re providing a network simulator netsim CourseNana.COM

(described in Development Environment) that will allow you to run several processes with arbitrary IP addresses on one machine. Our simulator also allows you to assign arbitrary link characteristics (bandwidth and latency) to the path between each pair of “end hosts” (processes). For this project, you will do your development and testing using a virtual machine (VM) we provide. CourseNana.COM

Browser. You’ll use an off-the-shelf web browser (e.g. Firefox) to play videos served by your CDN (via your proxy). CourseNana.COM

Proxy. Rather than modify the video player itself, you will implement adaptive bitrate selection in an HTTP proxy. The player requests chunks with standard HTTP GET requests. Your proxy will intercept these and modify them to retrieve whichever bitrate your algorithm deems appropriate. To simulate multiple clients, you will launch multiple instances of your proxy. CourseNana.COM

Web Server. Video content will be served from an off-the-shelf web server (Apache). More detail is in the Development Environment section. As with the proxy, you can run multiple instances of Apache on different fake IP addresses to simulate a CDN with several content servers. However, in the assignment, rather than using DNS redirection like a CDN would, the proxy will contact a particular server via its IP address (without a DNS lookup). A possible (ungraded) future extension to the project could include implementing a DNS server that decides which server to direct the proxy to, based on distance or network conditions from a proxy to various web servers. CourseNana.COM

The project is broken up into two stages (plus the initial set up to get you ready for the stages): CourseNana.COM

  • ●  In the preliminary stage, you will implement a simple proxy that sequentially CourseNana.COM

    handles clients and passes messages back and forth between client and server CourseNana.COM

    without modifying the messages. CourseNana.COM

  • ●  In the final stage, you will extend the proxy to implement the full functionality CourseNana.COM

    described above, with the proxy modifying HTTP requests to perform bitrate adaptation. CourseNana.COM

    1.3 Groups and collaboration policy CourseNana.COM

    This is an individual project, but you can discuss it at a conceptual level with other students or consult Internet material (excluding implementations of Python proxies), as long as the final code and configuration you submit is completely yours and as long as you do not share code or configuration. Before starting the project, be sure to read the collaboration policy at the end of this document. CourseNana.COM

    2. Preliminary stage CourseNana.COM

    Do not start until you have finished setting up your VM as described in: CSEE4119 F24 Tutorial for Setting Up Project 1 VM CourseNana.COM

    You will be implementing a simple proxy that accepts client connections sequentially (i.e. handles a client, and, once it disconnects, takes care of the next client). In later stages, your proxy will be required to handle client connections concurrently. CourseNana.COM

    In this preliminary stage, the proxy does NOT need to modify any messages it receives, as it will just relay the messages back and forth. In later stages, you will enhance your proxy to modify messages in order to perform adaptive bitrate selection. CourseNana.COM

    2.1 Requirements CourseNana.COM

    Implement a proxy that forwards messages of any length between a client and a server. See ‘Get your connections right’ and ‘Forwarding protocol’ for details. Note CourseNana.COM

that the VM instance is required for the final stage, but not the preliminary stage. You can work on the preliminary stage with your local devices.
CourseNana.COM

2.2 Get your connections right. CourseNana.COM

Your proxy should accept connections from clients and then open up another connection with a server (see How to run the proxy). Once both connections are established, the proxy should forward messages between the client and server. CourseNana.COM

You should implement this in two steps: CourseNana.COM

  1. Establishaconnectionwithaclient: CourseNana.COM

    Your proxy should listen for connections from a client on any IP address on the port specified as a command line argument (see How to run the proxy). Your proxy should accept multiple connections from clients. It is not required to handle them concurrently for now. Simply handling them one by one, sequentially, will be enough. CourseNana.COM

  2. Establishaconnectionwithaserver:
    Once the proxy gets connected to the client, it should then connect to the server. The server IP is provided as a command line argument. As for the port number, use 8080. Make sure to close connections to the client and server when either of them disconnects.
    CourseNana.COM

(Figure 4) Preliminary structure CourseNana.COM

2.3 Forwarding protocol. CourseNana.COM

The “messages” that the proxy forwards follow a particular structure (for example, in HTTP, you know that there is a header and a body). This structure is important, as CourseNana.COM

the recipient of the message can know where to look to get a specific piece of information. For the preliminary stage, we keep our message structure very simple: CourseNana.COM

(Figure 5) Structure of a message CourseNana.COM

The message has a body, and an End Of Message (EOM) symbol that indicates the end of the message. In our case, we define our EOM as the new line character ‘\n’. Please note that detecting ‘\n’ is different from detecting the slash character ‘\’ and the letter ‘n’. CourseNana.COM

A message has to be fully received by the proxy before being forwarded to the other side. CourseNana.COM

Here is how the forwarding protocol works in our case:
1. Theproxygetsamessagefromtheclientandforwardsittotheserver
2. Theproxyexpectsaresponsefromtheserver,getsit,andforwardsittothe
CourseNana.COM

client CourseNana.COM

An important thing to notice here is that there is no asynchronous forwarding (i.e., the proxy doesn’t simply forward any message, it first waits for a message from the client, and then waits for a response from a server). CourseNana.COM

2.4 Running the proxy CourseNana.COM

You should create an executable Python script called proxy inside the proxy directory (see below for a description of the development environment), which should be invoked as follows: CourseNana.COM

cd ~/csee_4119_abr_project/proxy ./proxy <listen-port> <fake-ip> <server-ip> CourseNana.COM

listen-port: The TCP port your proxy should listen on for accepting connections from the client. CourseNana.COM

fake-ip: Your proxy should bind to this IP address for outbound connections to the server. You should not bind your proxy listen socket to this IP address— bind the listen socket to receive traffic to the specified port regardless of the IP address. (i.e. by calling mySocket.bind((“”, <listen-port>)) CourseNana.COM

Important note: The above is a pretty unusual thing to do. You might think “in lecture, we saw that the client socket doesn’t bind, and now, you are telling us to bind the proxy’s outbound socket when connecting to the server”. However, it is necessary for the Final Stage’s network simulator to work properly, and so we will add it in this stage. CourseNana.COM

server-ip: The IP address of the server
See instructions for making your script executable in the section
Hand In. CourseNana.COM

2.5 Test it out! CourseNana.COM

You can test parts “Get your connections right” and “Forwarding protocol” of your proxy implementation by using the netcat tool (nc or netcat, which is installed in the VM) presented in class, using both a netcat client and a netcat server. You should be able to send a message from the  CourseNana.COM

client and see it appear on the server side. Then, any response sent from your server should also appear on the client. For the fake-ip, you can indicate 127.0.0.1 (localhost) when testing with netcat instances that are created on your machine. CourseNana.COM

Remember that seeing a message on the server side does not mean your implementation is 100% correct! Please be sure to come up with your own test cases and make sure that your proxy is as expected as we described in Final Result. CourseNana.COM

2.6 Final result CourseNana.COM

Your proxy should be able to forward a message of any length from a client to the server, and in turn, forward the response from the server back to the client. It should support back-and-forth messages until one side closes the connection. After the connection is closed, it should be able to accept a new connection from a client. You should be able to test the behavior of your application by creating netcat instances. CourseNana.COM

Note that this version simply forwards messages with the structure specified in Figure 2. The next stage will have a different message structure: the HTTP message structure, and you’ll have to adapt your proxy based on your knowledge of HTTP messages. CourseNana.COM

2.7 What to Submit for preliminary stage CourseNana.COM

PLEASE PAY ATTENTION TO THE HANDIN STRUCTURE, AS EVEN A TYPO WILL CAUSE THE GRADER TO BREAK, WHICH CAN MAKE YOU LOSE 10 POINTS. CourseNana.COM

You will submit your project as a zipped file named <yourUNI>.zip. Unzipping this file should give us a directory named handin which should only contain the following: CourseNana.COM

● proxy — A directory named proxy containing only your source code. The code that you want to execute should be an executable named proxy, as described in 2.3 How to run the proxy. To make the code executable, follow these steps: CourseNana.COM

1. Add‘#!/usr/bin/envpython3.10’tothetopofyourproxyPythonfile
2. Run‘chmod755proxy’toensurethatthefilehasthecorrectpermissions
CourseNana.COM

to be executable by us. CourseNana.COM

(Figure 6) Preliminary stage submission file structure. CourseNana.COM

You may organize your code within the proxy directory as you see fit. Part of your grade may be based on how understandable/organized/well-explained your code is, but we do not require any particular organization as well as it is well-organized. CourseNana.COM

2.8 Where to Submit CourseNana.COM

You will submit your code to Gradescope. If you have any questions about it, please let us know ASAP. CourseNana.COM

3. Final stage: Video Bitrate Adaptation Details to be released later. CourseNana.COM

4. Development Environment CourseNana.COM

For the project, we are providing a virtual machine (VM) pre-configured with the software you will need. We strongly recommend that you do all development and testing in this VM; your code must run correctly on this image as we will be using it for grading. For example, some students in previous years decided to write their code on their Windows environment, which changed the control characters to CLRF (Unix uses LF, thus our grader could not run their code). Please make sure your code uses LF. This section describes the VM and the starter code it contains. CourseNana.COM

4.1 Virtual Machine CourseNana.COM

We provide an image on GCP (Google Cloud Platform) and you can create a virtual machine (VM) instance based on it. Please follow the tutorial to set up your VM instance and do all your testing there. CourseNana.COM

In the event you need to move files between the VM and your computer (e.g., for submission), there are a few options. CourseNana.COM

  1. (recommended)Createa(private)Githubrepositorywiththerelevantproject CourseNana.COM

    files. You can push to your repository from the VM and access the files from CourseNana.COM

    anywhere. CourseNana.COM

  2. IfyouSSHintoyourVMinstanceusingtheGCPdefaultoption(theSSHbutton CourseNana.COM

    on the same row of the instance), on the top of your SSH window, there are two arrow buttons which upload and download files. CourseNana.COM

3. Launchyourremotedesktop.Youcanusesidebaroptionstouploadand download files. Alternatively, send the files via the Internet (email, Google Drive). Firefox is installed on the VM.
CourseNana.COM

4.2 Starter Files (for final stage) Details to be released later.
CourseNana.COM

4.3 Network Simulation (for final stage) Details to be released later. CourseNana.COM

4.4 Apache
Details to be released later. CourseNana.COM

4.5 Programming Language and Packages CourseNana.COM

This project must be implemented in Python 3. Your VM instance comes with Python version 3.10.12, which is the version we will use to test your code. If this choice of language poses a significant problem for you (i.e., you have never used Python before), please contact the instructors. CourseNana.COM

To run python 3.10.12 on the VM instance, please use the following command: CourseNana.COM

python3 CourseNana.COM

To install python packages for version 3.10.12 on the VM instance, please use: CourseNana.COM

python3 -m pip CourseNana.COM

For this project, you are allowed to use the following python packages: sys, socket, threading, select, time, re, numpy, subprocess CourseNana.COM

Using an unallowed package in your code may result in no credit being given. Other than the packages listed, you may only use the package if you ask on Ed Discussion and a TA or the professor explicitly responds to your request approving the use. We will maintain a pinned Ed post titled "Project 1 List of Approved (and Disallowed) Packages", so please check that post before posting your request. If you would like to use a package not mentioned here and are unsure if it would be acceptable, please add a new followup discussion under the above mentioned pinned post on Ed at least 3 days in advance of the project deadline. CourseNana.COM

In your followup discussion, you must mention the package name, the package version, and a link to the official repository of the package (e.g. http://pypi.python.org/pypi). TAs will examine your request and determine if the package is allowed and add it to the list of allowed/disallowed packages. CourseNana.COM

5. Grading CourseNana.COM

Your grade will consist of the following components: Proxy (70 points) CourseNana.COM

  • ●  Preliminary stage proxying [15 pts] CourseNana.COM

  • ●  Final stage proxying runs on browser [10 pts] CourseNana.COM

  • ●  Final stage proxy - implementing EWMA throughput estimator & bitrate adaptation [35 pts] CourseNana.COM

  • ●  DNS Server - correct responses and implementation of web server selection [10 pts] CourseNana.COM

  • ●  Code executes as instructed [-10 pts if we have to manually debug things] Writeup (20 points) CourseNana.COM

  • ●  Code thoroughly commented CourseNana.COM

  • ●  Code organized and modular CourseNana.COM

  • ●  README listing your files and what they contain CourseNana.COM

    Please make sure your code runs as an executable and as described in Running the Proxy (Preliminary Stage, Final Stage) before submitting. Code that does not run may receive a zero on the assignment. CourseNana.COM

    We WILL NOT release our grading scripts, nor specifically tell you what we will test for. Be sure to stress test your code in a variety of scenarios using unexpected inputs. Be sure to PRECISELY follow the instructions in this document for proxy development: implement exactly what is asked of you, no more and no less. For example, do not implement command line argument validation, we didn’t ask you to. CourseNana.COM

Academic integrity: Zero tolerance on plagiarism CourseNana.COM

The rules for Columbia University, the CS Department, and the EE Department (via SEAS: 1 and 2) apply. It is your responsibility to carefully read these policies and ask the professor (via Ed) if you have any questions about academic integrity. Please ask the professor before submitting the assignment, with enough time to resolve the issue before the deadline. A misunderstanding of university or class policies is not an excuse for violating a policy. CourseNana.COM

This class requires closely obeying the policy on academic integrity, and has zero tolerance on plagiarism for all assignments, including both projects/programming assignments and written assignments. By zero tolerance, we mean that the minimum punishment for plagiarism/cheating is a 0 for the assignment, and all cases will be referred to the Dean of Students. CourseNana.COM

This assignment must be completed individually. For programming assignments, in particular, you must write all the code you hand in yourself, except for code that we give you as part of the assignments. You are not allowed to look at anyone else's solution (including solutions on the Internet, if there are any), and you are not allowed to look at code from previous years or ask people who took the class in previous years for help. You may discuss the assignments with other students at the conceptual level, but you may not write pseudocode together, or look at or copy each other's code. Helping other students violate the policy (for example, letting them look at your code) is a violation, even if you completed the code yourself. Please do not publish your code or make it available to future students -- for example, please do not make your code visible on Github. Uploading course materials to sites such as CourseHero, Chegg or Github is academic misconduct at Columbia (see pg 10). CourseNana.COM

You may look at documentation from the tools’ websites. However, you may not use external libraries or any online code unless granted explicit permission by the professor or TA. For written (non-programming) answers, if you quote material from textbooks, journal articles, manuals, etc., you must include a citation that gives proper credit to the source to avoid suspicion of plagiarism. If you are unsure how to properly cite, you can use the web to find references on scientific citations, or ask fellow students and TAs on Ed. CourseNana.COM

CourseNana.COM

You are not allowed to use GitHub Copilot, Kite, or similar tools. Using AI-assisted coding tools (such as GitHub Copilot) is considered academic dishonesty. Since "AI-assisted" can be somewhat vague, I will clarify that "AI-assisted tools" includes, but is not limited to, any coding tools that require access to the internet or more than 2MB of data for semantic analysis (we are setting the size bar rather high because the GCC executable is inexplicably large; the intention is that you should not be performing analyses using a sizable dataset). CourseNana.COM

For each programming assignment, we will use software to check for plagiarized code. CourseNana.COM

Note: You must set permissions on any homework assignments so that they are readable only by you. You may get reprimanded for facilitating cheating if you do not follow this rule. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Columbia代写,CSEE4119代写,Computer Networks代写,Video CDN代写,C代写,Socket Programming代写,Content Delivery Network代写,Columbia代编,CSEE4119代编,Computer Networks代编,Video CDN代编,C代编,Socket Programming代编,Content Delivery Network代编,Columbia代考,CSEE4119代考,Computer Networks代考,Video CDN代考,C代考,Socket Programming代考,Content Delivery Network代考,Columbiahelp,CSEE4119help,Computer Networkshelp,Video CDNhelp,Chelp,Socket Programminghelp,Content Delivery Networkhelp,Columbia作业代写,CSEE4119作业代写,Computer Networks作业代写,Video CDN作业代写,C作业代写,Socket Programming作业代写,Content Delivery Network作业代写,Columbia编程代写,CSEE4119编程代写,Computer Networks编程代写,Video CDN编程代写,C编程代写,Socket Programming编程代写,Content Delivery Network编程代写,Columbiaprogramming help,CSEE4119programming help,Computer Networksprogramming help,Video CDNprogramming help,Cprogramming help,Socket Programmingprogramming help,Content Delivery Networkprogramming help,Columbiaassignment help,CSEE4119assignment help,Computer Networksassignment help,Video CDNassignment help,Cassignment help,Socket Programmingassignment help,Content Delivery Networkassignment help,Columbiasolution,CSEE4119solution,Computer Networkssolution,Video CDNsolution,Csolution,Socket Programmingsolution,Content Delivery Networksolution,