Difference between revisions of "BSc: Distributed And Network Programming"

From IU
Jump to navigation Jump to search
Line 254: Line 254:
   
 
# You have a list of large numbers, and you need to find if they are prime or not. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice.
 
# You have a list of large numbers, and you need to find if they are prime or not. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice.
# You need to send multiple requests to a server and receive responses. Assume there is some delay for packets to travel between your computer and the server. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice.
+
# You need to send multiple requests to a server and receive responses. Assume there is a few msecs of delay before you receive the response from the server. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice. (Order of the requests/responses doesn't matter)
#
 
 
# Discuss two ways of creating the threads using threading module in Python: 1) passing the worker function as a target, 2) subclassing the Thread class
 
# Discuss two ways of creating the threads using threading module in Python: 1) passing the worker function as a target, 2) subclassing the Thread class
 
# What are the advantages of using RPC over using the low-level socket programming?
 
# What are the advantages of using RPC over using the low-level socket programming?
  +
# Discuss the p2p system
   
 
==== Test questions for final assessment in this section ====
 
==== Test questions for final assessment in this section ====
Line 266: Line 266:
 
# You're given the worker function that just sleeps for a second and quits, implement the same behavior in a subclass of the Thread.
 
# You're given the worker function that just sleeps for a second and quits, implement the same behavior in a subclass of the Thread.
 
# Discuss the RPC and its advantages over using the low-level socket programming?
 
# Discuss the RPC and its advantages over using the low-level socket programming?
  +
# Discuss the decentralized architecture: structured and unstructured p2p systems.
  +
  +
=== Section 3 ===
  +
  +
==== Coordination, consistency, and replication in distributed systems ====
  +
  +
==== Topics covered in this section ====
  +
  +
* Clock synchronization algorithms (NTP, Berkeley)
  +
* Logical clock (Lamport clocks)
  +
* Mutual exclusion algorithms: permission-based, token-based
  +
* Election algorithms: Bully, Ring
  +
* Data consistency models
  +
  +
==== What forms of evaluation were used to test students’ performance in this section? ====
  +
  +
<div id="tab:OSSectionEval1">
  +
  +
{| style="border-spacing: 2px; border: 1px solid darkgray;"
  +
|''' '''
  +
! '''Yes/No'''
  +
|-
  +
| Development of individual parts of software product code
  +
|align="center"| 1
  +
|-
  +
| Homework and group projects
  +
|align="center"| 1
  +
|-
  +
| Midterm evaluation
  +
|align="center"| 0
  +
|-
  +
| Testing (written or computer based)
  +
|align="center"| 1
  +
|-
  +
| Reports
  +
|align="center"| 0
  +
|-
  +
| Essays
  +
|align="center"| 0
  +
|-
  +
| Oral polls
  +
|align="center"| 1
  +
|-
  +
| Discussions
  +
|align="center"| 1
  +
|}
  +
  +
  +
</div>
  +
==== Typical questions for ongoing performance evaluation within this section ====
  +
  +
# How the threads differ from processes?
  +
# What are the I/O and CPU-bound tasks?
  +
# For what kind of tasks, using threads is preferred than using processes?
  +
# What is a remote procedure call?
  +
# What are some well-known distributed system architectures?
  +
# Discuss the structured and unstructured architectures.
  +
  +
==== Typical questions for seminar classes (labs) within this section ====
  +
  +
# You have a list of large numbers, and you need to find if they are prime or not. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice.
  +
# You need to send multiple requests to a server and receive responses. Assume there is a few msecs of delay before you receive the response from the server. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice. (Order of the requests/responses doesn't matter)
  +
# Discuss two ways of creating the threads using threading module in Python: 1) passing the worker function as a target, 2) subclassing the Thread class
  +
# What are the advantages of using RPC over using the low-level socket programming?
  +
# Discuss the p2p system
  +
  +
==== Test questions for final assessment in this section ====
  +
  +
# Discuss the differences between the threads and processes.
  +
# What is the Race condition?
  +
# Discuss the ways to protect the shared data from the race condition
  +
# You're given the worker function that just sleeps for a second and quits, implement the same behavior in a subclass of the Thread.
  +
# Discuss the RPC and its advantages over using the low-level socket programming?
  +
# Discuss the decentralized architecture: structured and unstructured p2p systems.
   
 
== Administrative details ==
 
== Administrative details ==

Revision as of 14:16, 22 September 2021

Distributed and Network Programming

  • Course name: Distributed and Network Programming
  • Course number: XYZ
  • Knowledge area: xxx

Course characteristics

Key concepts of the class

  • Network programming concepts: Layered architecture, TCP and UDP sockets, multithreaded servers
  • Distributed systems concepts: system architecture, inter-process communication, remote procedure calls, peer-to-peer systems, coordination, replication, and fault tolerance.

What is the purpose of this course?

Distributed and networked systems have become an integral part of our life, we use various applications such as chatting, online transactions, or cloud storage apps. All these popular applications are supported by an infrastructure (of servers) that is organized based on some concepts of distributed systems. The purpose of this course is to provide the students with the necessary concepts, models, and real-world problem-solving techniques of network programming and distributed systems.

Course Objectives Based on Bloom’s Taxonomy

What should a student remember at the end of the course?

By the end of the course, the students should be able to recognize and define

  • Concepts of network programming
  • Different distributed system architectures
  • Various synchronization and coordination techniques
  • Different consistency models and replication methods
  • Approaches to achieve fault tolerance and security in distributed systems

What should a student be able to understand at the end of the course?

By the end of the course, the students should be able to describe and explain (with examples)

  • Difference between different transport protocols, when and why one is preferred over another
  • Difference between different distributed system architectures (centralized, decentralized, and hybrid)
  • How a mutual exclusion is achieved between concurrent servers (centralized, distributed, token-ring, and decentralized)
  • How a new leader is elected in peer-to-peer systems (bully, ring)
  • How to achieve a consistent replicas across distributed systems (consistency models and protocols, content replication and placement)
  • Some methods to achieve the fault tolerance in distributed systems

What should a student be able to apply at the end of the course?

By the end of the course, the students should be able to apply

  • Building a custom application protocols on top of the existing transport protocols
  • Writing multithreaded server and client apps with sockets
  • Using RPC for inter-process communication: command execution, file transfer
  • Building peer-to-peer systems with distributed protocol such as Chord
  • Building fault-tolerant systems with failure detection and leader election

Course evaluation

Course grade breakdown
Component Points
Laboratory assignments 55%
Final exam 35%
Attendance 10%

Important: In order to successfully finish the course, the student is required to score at least 50% in final exam.

Grades range

Course grading range
A. Excellent 90-100
B. Good 75-89
C. Satisfactory 60-74
D. Poor 0-59

Resources and reference material

  • Textbook: Maarten Van Steen, and Andrew S. Tanenbaum. Distributed systems (3rd Edition) Leiden, The Netherlands: Maarten van Steen, 2017. Available online: https://www.distributed-systems.net/
  • Reference: George F. Coulouris, Jean Dollimore, and Tim Kindberg. Distributed systems: concepts and design (5th Edition) Addision Wesley, 2012. Available online: https://www.cdk5.net/wp/
  • Reference: Sukumar Ghosh. Distributed systems: an algorithmic approach (2nd Edition) Chapman&Hall /CRC, Author’s own course material, Spring 2015. Available online: http://homepage.divms.uiowa.edu/~ghosh/16615.html

Course Sections

The course is organized in 8 weeks, with every weeks 4 academics hours of lectures and 4 academic hours of tutorials/labs. The main sections of the course and approximate hour distribution between them is as follows:

Course Sections
Section Section Title Teaching Hours
1 Introduction to subject, computer networks basics, transport layer protocols, and socket programming 12
2 Multithreaded socket programming, remote procedure calls, and distributed system architecture 24
3 Coordination, consistency, and replication in distributed systems 24
4 Fault tolerance and security in distributed systems 30

Section 1

Section title: Introduction to subject, computer networks basics, transport layer protocols, and socket programming

Topics covered in this section

  • General introduction to the course
  • Computer networks basic
  • Socket programming
  • UDP socket programming
  • TCP socket programming

What forms of evaluation were used to test students’ performance in this section?

Yes/No
Development of individual parts of software product code 1
Homework and group projects 1
Midterm evaluation 0
Testing (written or computer based) 1
Reports 0
Essays 0
Oral polls 1
Discussions 1


Typical questions for ongoing performance evaluation within this section

  1. What are the distributed systems?
  2. Give an example of distributed systems.
  3. What are the advantages of layered architecture?
  4. What are the roles of transport protocols?
  5. How the TCP and UDP differ from each other? When one is preferred over the other?
  6. What is socket programming?
  7. How socket programming is different for UDP and TCP?

Typical questions for seminar classes (labs) within this section

  1. Write a simple UDP/TCP client-server echo program
  2. Write a simple chatting program using UDP/TCP sockets
  3. Given the simple echo server program, apply socket timeouts and catch timeout exceptions
  4. Write a UDP-based reliable file transfer protocol
  5. Write a program that parallelly executes the CPU-bound tasks using multiple processes

Test questions for final assessment in this section

  1. Describe an advantage of layered architecture?
  2. Describe the differences between TCP and UDP protocols?
  3. Provide examples when using UDP can be more reasonable than TCP?
  4. Describe how UDP and TCP socket programming differ from each other?

Section 2

Multithreaded socket programming, RPCs, and distributed system architecture

Topics covered in this section

  • Multithreading and multithreaded socket programming
  • Remote procedure calls (RPCs)
  • Distributed system architectures

What forms of evaluation were used to test students’ performance in this section?

Yes/No
Development of individual parts of software product code 1
Homework and group projects 1
Midterm evaluation 0
Testing (written or computer based) 1
Reports 0
Essays 0
Oral polls 1
Discussions 1


Typical questions for ongoing performance evaluation within this section

  1. How the threads differ from processes?
  2. What are the I/O and CPU-bound tasks?
  3. For what kind of tasks, using threads is preferred than using processes?
  4. What is a remote procedure call?
  5. What are some well-known distributed system architectures?
  6. Discuss the structured and unstructured architectures.

Typical questions for seminar classes (labs) within this section

  1. You have a list of large numbers, and you need to find if they are prime or not. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice.
  2. You need to send multiple requests to a server and receive responses. Assume there is a few msecs of delay before you receive the response from the server. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice. (Order of the requests/responses doesn't matter)
  3. Discuss two ways of creating the threads using threading module in Python: 1) passing the worker function as a target, 2) subclassing the Thread class
  4. What are the advantages of using RPC over using the low-level socket programming?
  5. Discuss the p2p system

Test questions for final assessment in this section

  1. Discuss the differences between the threads and processes.
  2. What is the Race condition?
  3. Discuss the ways to protect the shared data from the race condition
  4. You're given the worker function that just sleeps for a second and quits, implement the same behavior in a subclass of the Thread.
  5. Discuss the RPC and its advantages over using the low-level socket programming?
  6. Discuss the decentralized architecture: structured and unstructured p2p systems.

Section 3

Coordination, consistency, and replication in distributed systems

Topics covered in this section

  • Clock synchronization algorithms (NTP, Berkeley)
  • Logical clock (Lamport clocks)
  • Mutual exclusion algorithms: permission-based, token-based
  • Election algorithms: Bully, Ring
  • Data consistency models

What forms of evaluation were used to test students’ performance in this section?

Yes/No
Development of individual parts of software product code 1
Homework and group projects 1
Midterm evaluation 0
Testing (written or computer based) 1
Reports 0
Essays 0
Oral polls 1
Discussions 1


Typical questions for ongoing performance evaluation within this section

  1. How the threads differ from processes?
  2. What are the I/O and CPU-bound tasks?
  3. For what kind of tasks, using threads is preferred than using processes?
  4. What is a remote procedure call?
  5. What are some well-known distributed system architectures?
  6. Discuss the structured and unstructured architectures.

Typical questions for seminar classes (labs) within this section

  1. You have a list of large numbers, and you need to find if they are prime or not. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice.
  2. You need to send multiple requests to a server and receive responses. Assume there is a few msecs of delay before you receive the response from the server. Would you use multithreading, multiprocessing, or sequential programming in order to complete the task asap? Prove it in practice. (Order of the requests/responses doesn't matter)
  3. Discuss two ways of creating the threads using threading module in Python: 1) passing the worker function as a target, 2) subclassing the Thread class
  4. What are the advantages of using RPC over using the low-level socket programming?
  5. Discuss the p2p system

Test questions for final assessment in this section

  1. Discuss the differences between the threads and processes.
  2. What is the Race condition?
  3. Discuss the ways to protect the shared data from the race condition
  4. You're given the worker function that just sleeps for a second and quits, implement the same behavior in a subclass of the Thread.
  5. Discuss the RPC and its advantages over using the low-level socket programming?
  6. Discuss the decentralized architecture: structured and unstructured p2p systems.

Administrative details

  • Faculty: Computer Science and Engineering
  • Year of instruction: 4th year of BS
  • Semester of instruction: 2nd semester
  • No. of Credits: 4 ECTS
  • Total workload on average: 144 hours overall
  • Frontal lecture hours: 2 per week
  • Frontal tutorial hours: 2 per week
  • Lab hours: 2 per week
  • Individual lab hours: 0
  • Frequency: weekly throughout the semester
  • Grading mode: letters: A, B, C, D

Prerequisites

  • Introduction to Programming I
  • Introduction to Programming II
  • Operating Systems
  • Networks

Course outline

This course focuses on the programming aspects of computer networks. Students will understand the current trends in communication protocols, socket programming and interprocess communication. Network programming will be covered for what concerns both wired networks and wireless networks.

Expected learning outcomes

  • Understanding issues in concurrent network applications
  • Understand issues in implementing client/server systems using distributed programming techniques
  • Implementing multithreaded client/server applications

Expected acquired core competences

  • Network programming
  • Socket programming
  • Client/Server applications
  • Peer to peer network programming

Textbook

Reference material

  • Lecturing and lab slides and material will be provided
  • Several resources are available online and will be pointed during the course

Required computer resources

Students should have laptops.