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: <bill.cheng@usc.edu>.  (Please do not send HTML-only e-mails. They will not be read.)
Time MW 12:00pm - 1:50pm 
Location THH 102 
TA Bowen Song, E-mail: <bowenson@usc.edu>
Office Hours: Tue 6:00-7:30pm, Thu 8-9:30am (on Zoom) (you can make an appointment for Thu, but Tue is strictly first-come-first-served)
Graders
Rudra Panda, E-mail: <rrpanda@usc.edu>
(If needed, the grader will hold regrade sessions the week after the announcement of each assignment's grades.)
Midterm Exam (NEW) [12:00:00pm-12:40:00pm), Mon, 3/7/2022 (firm).
Final Exam (NEW) [11:00:00am-11:40:00am), Fri, 5/6/2022 (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)
  • 5/2/2022: Below is the link for starting the final exam at [11:00:00am-11:40:00am) on Friday, 5/6/2022, USC time. This link will become active approximately 3 minutes before the exam start time and you can start working on the exam as soon as you have downloaded the exam.

    Plesae make sure you have done the following:

  • 4/27/2022: Please download, fill out, sign, and submit the Final Exam Academic Integrity Honor Code Pledge as soon as possible. Please understand that if I don't get a signed pledge from you, I will not send a final exam to you because I need you to promise me that you won't cheat before I can send you an exam.
  • 4/26/2022: 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 2/28/2022 news item for the basic procedure and replace the date and time with what's appropriate for your final exam). 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 final exam will cover everything from the first slide of Lecture 15 on 3/2/2022 to the last slide of Lecture 28 on 4/27/2022. 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

  • 4/6/2022: (This is a modified procedure regarding what I posted in Piazza yesterday.) Since no student has been coming to THH 201 to participate in the live lectures in person, starting today, by default, I will conduct the live primary lecture on Zoom (so no one should go to THH 201), unless I get an e-mail the day before from a student saying that the student will be participating in person in THH 201. If I get such an e-mail, I will post in the class Google Group and let everyone know that I will be present in THH 201 to conduct a particular live lecture in person.

    So, if you would like to participate in a live lecture in person for a particular lecture, all you need to do is to send me e-mail the day before to say that you will be in THH 201 the next day for the live lecture and I will conduct the next live lecture in person in THH 201.


  • 3/28/2022: Today's primary live lecture will be over Zoom only. Please do not go to THH 102. Sorry about the short notice and inconvenience.

  • 3/23/2022: Today's primary live lecture will be over Zoom only. Please do not go to THH 102. Sorry about the short notice and inconvenience.

  • 3/6/2022: There will be no live lecture tomorrow since we are having a take-home midterm exam during [12:00:00pm-12:40:00pm). I will record a video to go over administrative slides and do a quick recap of Lab 9 and Lecture 16 videos.

  • 3/3/2022: Below is the link for starting the "standard" midterm exam at [12:00:00pm-12:40:00pm) on Monday, 3/7/2022, USC time. This link will become active approximately 3 minutes before the exam start time and you can start working on the exam as soon as you have downloaded the exam.

    Plesae make sure you have done the following:

  • 3/3/2022: The midterm exam will cover everything from the beginning of the semester to the last slide of Lecture 14 on 2/28/2022 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 2/28/2022. 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


  • 2/28/2022: 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 because I need you to promise me that you won't cheat before I can send you an exam.
  • 2/28/2022: Midterm rehearsal will be on Wednesady, 3/2/2022 at 1pm (i.e., start time is 13:00:00) USC time. The starting point of your midterm rehearsal is at:

    Below is the instructions for the midterm rehearsal (this will also be the instructions for your midterm exam, with a different start page of course). I have gone over all the information below during live Lecture 14 on 2/28/2022.

    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 = 13). As mentioned in live Lecture 14 on 2/28/2022, 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 <bill.cheng@usc.edu> (and never have it go into your spam folder).

    • To get ready, please do the following 5 minutes BEFORE X:00:00.
      • Display a clock app and a web browser as shown.
      • Make sure you have downloaded and installed the Panopto Recorder. If you have an offline desktop recorder that can record your desktop into an MP4 file, you can use that instead of the Panopto Recorder.
      • Start the Panopto Recorder just in case you may lose Internet connection later. Make sure Panopto is configured correctly (see the Checklist). Don't start recording your desktop yet.
      • Have your submission PIN handy because you will need it later. (Your submission PIN is the same for all labs, programming assignments, and exams.)
      • Set an alarm for X:39:00 to remind yourself that the exam is about to end soon (and make sure the time on your alarm clock is correct).
      • If your machine is known to crash from time to time, you should reboot your machine and don’t run anything you don’t need for your exam.

    • About 3 minutes before X:00:00, click on the midterm rehearsal start page mentioned above to start your midterm rehearsal.
      • Follow the instruction and enter your USC Net ID and your submission PIN and click on submit. Please remember that your submission PIN is the same as your labs and PAs submission PIN.
      • In the next page, there are 2 links:
        • 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.
      • You will get a backup e-mail with the same content as the web page mentioned above. It's just a backup, so don't wait for it.
      • You can work on your exam as soon as you got the ZIP file
      • If something is not working correctly, 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! You are responsible for making sure that you submit the correct file.

    • 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 before X:43:00.)

    • To make a submission, first 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 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 since 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 (please see slide 29 of the live Lecture 14 on 2/28/2022 slides for instructions). 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.


  • 2/24/2022: Live lecture next Monday (2/28/2022) will be on Zoom only. The primary live lecture will be about an hour long because I need to go over the details of the midterm exam logistics. Please do not go to THH 102 next Monday during lecture time and just join me on Zoom in the primary live lecture (I will be running it remotely). As usual, after the primary live lecture, I will switch to the secondary live lecture to answer questions in a breakout room.

  • 2/15/2022: Live lecture tomorrow (Wed, 2/16/2022) will be on Zoom only. Please do not come to THH 102 tomorrow during lecture time and just join me on Zoom in the primary live lecture (I will be running it remotely). As usual, after the primary live lecture, I will switch to the secondary live lecture to answer questions in a breakout room.

  • 2/6/2022: Office hour on Tuesday, 2/8/2022 is moved to 8pm. Sorry about the inconvenience.

  • 1/30/2022: Due to car trouble, I won't be able to come to campus tomorrow (Monday, 1/31/2022). So, the primary live lecture will be over Zoom only. Sorry about the short notice and inconvenience.

  • 1/26/2022: Office hour tomorrow is moved to 8pm. Sorry about the short notice and inconvenience.

  • 1/20/2022: Office hour today is moved to 8pm again. Sorry about the short notice and inconvenience.

  • 1/19/2022: Office hour today is moved to 8pm. Sorry about the short notice and inconvenience.

  • 1/9/2022:
    • 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!