Click here to see a PREVIEW of important rules that was posted before the semester started.

This is an undergraduate level course covering the fundamental concepts of networking as embodied in the Internet. Topics covered in this are: design principles, layering, protocol design/analysis of the global Internet; networked applications; the structure/architecture of the Internet; protocols for network transport and congestion control; network layer and routing; link layer/MAC; and network security.

You will also learn to write multi-threaded programs to create a network of communicating servers using "socket programming" (which some would consider as "system programming") in C++. You will learn to make "system calls" to interact with "the system". There will be 5 programming assignments and some of them can be quite time-consuming and challenging to implement and debug. Therefore, the workload of this class can be quite high and it's important to keep up with the pace of the class and try to avoid starting a lab or programming assignment only when the deadline approaches.

Instructor Bill Cheng (click to see office hours)
E-mail: <>.  (Please do not send HTML-only e-mails. They will not be read.)
Time TuTh 12:00pm - 1:50pm 
Location (NEW) GFS 101 
TA Bowen Song, E-mail: <>
Office Hours: Tue 7:30-9pm, Wed 9-10:30am, Fri, 9-10:30am (on Zoom) (you can make an appointment for Wed and Fri, but Tue is strictly first-come-first-served)
Twinkle Lok, E-mail: <>
(If needed, the grader will hold regrade sessions the week after the announcement of each assignment's grades.)
Midterm Exam 12:00-12:40pm, Tue, 10/19/2021 (firm).
Final Exam (NEW) 11am-11:40am, Tue, 12/14/2021 (firm).
Class Resources
Description   :   textbooks, topics covered, grading policies, additional resources, etc.
Lectures   :   information about lectures (and lectures slides in PDF format).
Videos   :   information about D2L lectures and discussion sections videos.
Labs   :   information about discussion sections and labs.
Programming   :   programming assignments (please also see important information about programming assignments at the bottom of this web page.)
Forum   :   Piazza Forum for discussing course materials and assignments. You are required to be a member of this group. (This group is by invitation only.) Please do not send request to join this group until after the first lecture.

(in reversed chronological order)

  • 12/1/2021: The final exam will be a 40-minute long take-home exam (open book and open notes), and it will be conducted in the same manner as the midterm exam (please see the 10/10/2021 news item for the basic procedure and replace the date and time with what's appropriate for your final exam). There will be a couple of noted differences between the midterm and the final exams and that will be mentioned in live Lecture 28 on 12/2/2021. No matter how late you start your exam, your exam must end at the same time as everyone else who is taking the same exam.

    The date and time of the alternate final exam will be from 7pm to 7:40pm on Tuesday, 12/14/2021. As have been discussed in lecture videos, only students who have been pre-approved can take this alternate final exam.

    The final exam will cover everything from the first slide of Lecture 15 on 10/12/2021 to the last slide of Lecture 28 on 12/2/2021. Since the 2nd part of the course depends on stuff covered by the midterm, I cannot say that I will not ask anything covered by the midterm, and you do need to know the material covered by the midterm. Therefore, it would be more appropriate to say that the final exam will focus on the material not covered by the midterm.

    Regarding what types of questions will be on the final, please see the Exams section of the course description web page and the midterm information slides (PDF). Regarding regrade policy, please see the Regrade section of the course description web page.

    Here is a quick summary of the final exam topics (not all topics covered may be listed):

    • Ch 3 - Transport Layer
      • (3.1) introduction and transport-layer services
      • (3.2) ultiplexing and demultiplexing
      • (3.3) connectionless transport: UDP
      • (3.4) principles of reliable data transfer
      • (3.5) connection-oriented transport: TCP
      • (3.6) principles of congestion control
      • (3.7) TCP congestion control

    • Ch 4 - The Network Layer: Data Plane
      • (4.1) overview of network layer
      • (4.2) what's inside a router
      • (4.3) the Internet protocol (IP): IPv4, addressing, IPv6, and more
      • (4.4) generalized forwarding and SDN

    • Ch 5 - The Network Layer: Control Plane
      • (5.1) introduction to the network control plane
      • (5.2) routing algorithms
      • (5.3) intra-AS routing in the Internet: OSPF
      • (5.4) routing among the ISPs: BGP
      • (5.5) the SDN control plane
      • (5.6) ICMP: the Internet control message protocol
      • (5.7) network management and SNMP

    • Ch 6 - The Link Layer and LANs
      • (6.1) introduction to the link layer
      • (6.2) error-detection and correction techniques
      • (6.3) multiple access links and protocols
      • (6.4) switched local area networks
      • (6.5) link virtualization: a network as a link layer
      • (6.6) data center networking
      • (6.7) retrospective: a day in the life of a web page request

    • Ch 7 - Wireless and Mobile Networks
      • (7.1) introduction wireless and mobile networks
      • (7.2) wireless links and network characteristics
      • (7.3) wifi: 802.11 wireless LANs

    • Discussion
      • multithreading part 4 - generalized synchronization with condition variables
      • PA3, PA4, PA5 and Labs 8 through 14
        • specs
        • FAQs
        • various discussions about these assignments

  • 11/27/2021: Office hour on Monday (11/29/2021) is canceled (and moved to 8pm on Tuesday). Sorry about the inconvenience.

  • 11/21/2021: The office hour this Tuesday (11/23/2021) is moved to 8pm. Sorry about the short notice and inconvenience.

  • 11/10/2021: Make-up office hour today will be 9:30pm - 10:30pm tonight (assuming that I will be able to talk). Sorry about the short notice and inconvenience.

  • 11/9/2021: Office hour tomorrow is canceled. Please see my post in the class Piazza today. Sorry about the short notice and inconvenience.

  • 11/4/2021: Office hour today is canceled. Please see my post in the class Piazza yesterday. Sorry about the short notice and inconvenience.

  • 10/28/2021: I won't be able to come to campus for the live lecture today. I will be doing the primary live lecture remotely instead. So there is no need to go to GFS 101 at 12pm today. Please just go to the primary live lecture at 12pm. Sorry about the short notice and inconvenience.

  • 10/18/2021:
    • Since we are having the take-home midterm exam starting at 12pm tomorrow, there will be no primary live lecture tomorrow. In case you will have questions for me regarding labs or PA3, I will start the secondary live lecture at 1:20pm to handle questions in breakout rooms and it will go for 30 minutes.

  • 10/11/2021:
    • Please download, fill out, sign, and submit the Midterm Exam Academic Integrity Honor Code Pledge as soon as possible. (Please remember that submitting a signed pledge doesn't mean that you cannot decide to opt out of the exam later.) Please understand that if I don't get a signed pledge from you, I will not send a midterm exam to you next Tuesday because I need you to promise me that you won't cheat before I can send you an exam.

  • 10/10/2021: Midterm rehearsal will be on Monday, 10/18/2021 at 2pm (i.e., start time is 14:00:00) USC time. Here is the instructions for the midterm rehearsal (this will also be the instructions for your midterm exam). I have gone over all the information below during live Lecture 14 on 10/7/2021.

    For this web page, we will use the notation that the midterm rehearsal starts at X:00:00 and ends at X:40:00 (for the midterm rehearsal, X = 14). As usual for this class, the left side of a time interval is "closed" (i.e., including the left timestamp) and the right side of a time interval is "open" (i.e., up to but not including the right timestamp). If your exam time is different, please make adjustments accordingly.

    • Make sure you have setup an e-mail filter to never miss an e-mail from <> (and never have it go into your spam folder).

    • To get ready, please do the following 5 minutes BEFORE X:00:00.

    • Watch your inbox. You will get an e-mail from me right before X:00:00 and you can start working on the exam as soon you get my e-mail. There will be 2 links in the e-mail.
      • The first link is for downloading a ZIP file which contains the exam questions (PDF file) and an answers text file. Click on it to download the ZIP file and then open it. (With some browsers, you will have to copy the link and paste it into a new browser tab in order for download to be successful.) Save the answers text file on your desktop for easy access (don't make a copy of it, just work on this copy so you won't end up submitting the wrong file).
      • The second link is for submitting your answers text file when you are done. You should click on it immediately to open a new tab in your browser and look at the submission web page. Right above the submission web form, you should see the current time on the submission server. If that time does not correspond to your desktop clock app, you need to figure out how to fix your desktop clock app to sync your desktop clock with a recommended clock server for your computer.

    • If by X:00:00, you have not received my e-mail, please send me an e-mail to as soon as possible. (But please keep in mind that e-mail can take a very very long time to get delivered.)

    • Go to your desktop and click open the answers text file and work on your exam and save your modified answers text file regularly. Feel free to make submissions if you are done early. Again, it's not a good idea to work on a copy of the answers text file because you may end up submitting the wrong answers text file and there's nothing I can do if that happens!

    • When your alarm goes off at X:39:00, you need to wrap things up and get ready to submit your exam answers text file.

    • At X:40:00, you must stop working on your answers. Save your answers text file and go to the submission web page. (Of course, if you have already made a successful submission and have saved a copy of the ticket you got and you haven't changed your answers, you are done and you can stop right here. But if you want to continue to work on your exam, that's fine too as long as you have made at least one submission.)

    • Reload/refresh the submission web page and make sure that you are seeing the current time on the submission server right above the submission web form. If reloading the web page failed, you should check to see if you can reach other websites. If you cannot reach other websites, then you don't have a Internet connection and you must follow the instructions to use Panopto to record your desktop and your exam answers and take photos of your answers and e-mail photos of your exam answers to me. If you can reach other websites, then you should continue to try to access the submission web page.

      If reloading the web page was successful, you must fill out the submission web form and click on the Choose File button and select the answers text file that you have filled out and saved. Click on the Upload button. If you get any popup messages, please read them carefully and follow the suggestions there (there is nothing I can do if you submit the wrong file). If the submission server is busy, you should not be surprised because many students are making submissions simultaneously. So, all you have to do is to keep submitting your answers text file repeatedly until you can make a successful submission (i.e., you are presented with a submission ticket and the ticket looks right). You should save a copy of that ticket by saving the web page you see as a PDF file. It's your responsibility that you have submitted the correct answers text file.

      If you cannot reach the submission server after many tries, but still have Internet connectivity, it is possible (although unlikely) that the server is down or unresponsive. In this case, you should go to the e-mail mentioned above and click Reply, attach your answers text file, check to make sure that the e-mail recipient is either <> or <> and click Send to send a backup copy of your answers text file, just in case the submission sever is actually down. It's best if you also follow the instructions to use Panopto to record your desktop and your exam answers and take photos of your answers and e-mail photos of your exam answers to me. (Of course, for the rehearsal, you probably shouldn't just click Send because the e-mail will go to me. You can change the recipient e-mail address to yourself and then click Send.) Then go back and continue to make a submission using the web form and maybe you will be able to connection to the submission server this time around.

      The current item is summarized in the flowchart below.

    Since this is a rehearsal, I would strongly recommand and everyone try out the procedure to use the Panopto Recorder to record your desktop and your exam answers and take photos of your exam answers (and you can e-mail the photos to yourself as a test) and try it for a few times until you feel comfortable with the procedure just in case you may lose your Internet connection when you are submitting the exam answers during the real exam. Also, try out different scenarios such as disabling wifi on your laptop to simulate the loss of Internet connectivity so you know what to expect.

    Please understand that if you submit late (i.e., any time at or after X:43:00), I have to follow the rules I mentioned in class and deduct 5% for every late minute. For example:

    • If your submission timestamp is ≥ X:43:00 and ≤ X:43:59, 5% will be deducted.
    • If your submission timestamp is ≥ X:44:00 and ≤ X:44:59, 10% will be deducted.
    • If your submission timestamp is ≥ X:45:00 and ≤ X:45:59, 15% will be deducted.
    • If your submission timestamp is ≥ X:46:00 and ≤ X:46:59, 20% will be deducted.
    • ...

    I cannot make an exception. If you are not familiar with all the rules, please watch the recorded live Lecture 14 video.

    VERY IMPORTANT: As mentioned in live Lecture 14, I cannot accept "my machine crashed when I was making a submission" as an excuse for late submission unless you have a video to prove it. If you know that your machine is prone to crashing or random rebooting (only you would know that), you should do a complete shutdown of your machine and reboot your machine into a clean state at least 5 minutes before the start of the exam and don't run anything on your machine other than what's required to take the exam. (It's a good idea to do that even if your machine is not prone to random crashes or reboots.)  And most importantly, when you have finished your first pass through the exam, make a submission right away! Then every time you make a change in your answers, make another submission. Remember, you can make as many submissions as you'd like and by default, we will grade your last submission. If you are still working on your first pass at X:40:00, you must stop working on your exam and make a submission immediately! After you have made an on-time submission, you can continue to work on your exam and if you make changes, make another submission. This way, you can avoid late penalty because you would always have a submission that was on time. If you are not familiar with the procedure of making an exam submission, you should practice by going through the midterm exam rehearsal procedure as many times as you'd like. If you have lost the midterm rehearsal link, please send me e-mail.

    If anything is not clear, please feel free to ask me.

  • 10/7/2021: The midterm exam will cover everything from the beginning of the semester to the last slide of Lecture 14 on 10/7/2021 and Ch 1 & Ch 2 of the Kurose & Ross textbook.

    Regarding what types of questions will be on the midterm, please see the Exams section of the course description web page and the exam slides, which I have gone over during live Lecture 14 on 10/7/2021. Regarding regrade policy, please see the Regrade section of the course description web page.

    Here is a quick summary of the midterm exam topics (not all topics covered may be listed):

    • Ch 1 - Computer Networks and the Internet
      • (1.1) what is the Internet
      • (1.2) the network edge
      • (1.3) the network core
      • (1.4) delay, loss, and throughput in packet-switched networks
      • (1.5) protocol layers and their service models
      • (1.6) network under attack
      • (1.7) history of computer networking and the Internet (excluded from the exam)
    • Ch 2 - Application Layer
      • (2.1) principles of network applications
      • (2.2) the web and HTTP
      • (2.3) electronic mail in the Internet
      • (2.4) DNS - the Internet's directory service
      • (2.5) peer-to-peer applications
      • (2.6) video streaming and conent distribution networks
      • (2.7) socket programming: creating network applications
    • Labs and programming assignments
      • sockets programming
      • multithreading parts 1, 2, & 3
      • PA1, PA2, and Labs 1 through 7
        • specs
        • FAQs
        • various discussions about these assignments

  • 8/28/2021: I will be traveling on Monday, 8/30/2021 and will not be available to hold office hours. Therefore, my office hours on Monday will be canceled.  Sorry about the inconvenience.  If you have questions, please send me e-mail or post to Piazza.

  • 8/23/2021: Something came up and I had to cancel office hour today. Sorry about the short notice and inconvenience. Please send me e-mail if you have questions and I will reply to your e-mail tonight.

  • 8/15/2021:
    • Watch this area for important announcements.

    • Due to security concerns, we cannot post Zoom meeting IDs in public area of the class website. You should watch the first lecture video to get some of the Zoom meeting IDs. The rest of the Zoom meeting IDs will be sent to you either via e-mail or will be posted in the password-protected area of the class website.

    • To get user ID and password for accessing protected area of this web site, please visit the request access page after semester starts and submit the requested information. (You do not have to be registered for the course to get the password. You just need to have an USC e-mail address.)

    • Please do not send request to join the class Piazza Forum until after you have watch the first lecture video.

The prerequisite for this course is CSCI 201 (Principles of Software Development). Please see the CS Course Catalog for information about CSCI 201.

According to the CS Course Catalog, the prerequisite for CSCI 201 is CSCI 104L, and the prerequisite for CSCI 104L is CSCI 103L. Therefore, you will be expected to have had at least two semesters of experience programming in C++ from these courses.

In addition, a corequisite of CSCI 104L is CSCI 170, and graphs and basic graph algorithms are covered in CSCI 170. Therefore, you will be expected to be familiar with graph representations (e.g., nodes and edges for abstract representation, adjacency list data structure, etc.) and basic graph algorithms such as breadth-first-search (BFS).

This is not an introductory class. We will assume that you know how to program because you are supposed to have satisfied all the prerequisites of this course. If you somehow were able to satisfy all the prerequisites of this course without being reasonably proficient in software development, it's not our job to teach you how to program. If you are not reasonably proficient in programming, may be you should consider taking this course at a later time when you are better at it. Or, you should get ready to spend a lot of time doing the labs and the programming assignments and start doing all your assignments as early as possible and seek help from the instructors and the course producers whenever you are stuck.

All programming assignments (include labs) are to be done in standard C++ (i.e., c++11, c++14, etc.). No other programming languages will be accepted. (Sorry, no Java, no Python, and no C++ with Microsoft, Mac, or Google extensions.) Since the standard C++ does not support networking, all networking related programming assignments are required to be done by making system calls (with a C interface) and without using any C++ networking libraries. C is a proper subset of standard C++. If you know standard C++, you already know C. Standard C++ is designed to work with system calls and we will learn about networking system calls in this class.

Your program must compile and run with a Makefile on a standard 32-bit Ubuntu 16.04 machine running inside VirtualBox. Grading for programming assignments can ONLY be done on a standard 32-bit Ubuntu 16.04 machine running inside VirtualBox. Even if you can demonstrate that your code runs perfectly on some other system, it cannot be considered for grading and you won't get any partial credit for it. Please install a 32-bit Ubuntu 16.04 into VirtualBox on your laptop/desktop as soon as possible and start using it with the very first programming assignment.

If the only computer you have access to is the new Mac running on a non-Intel/AMD CPU, then it may not be possible to install VirtualBox into your machine. If that's the case, you must do all your labs and programming assignments on the system specified here.

If you are not familiar with Linux/Unix, please read Unix for the Beginning Mage, a tutorial written by Joe Topjian. (Unfortunately, looks like this book has just disappeared from the web.) You can also visit UNIX Tutorial for Beginners or Learn tcsh in Y Minutes. If you already know how to use Unix/Linux before and just need a refresher, please review my summary of some commonly used Unix commands and my tcsh scripting tutorial. It's a good idea to be familiar with the terminal-based Unix/Linux development environment (vi/pico/emacs, gcc/g++, make, etc.).

If a student registered late for this class or could not be present at the beginning of the semester, the student is still required to turn all the assignments on time or the student will receive a score of 0 for these assignments. No exceptions!