# Foundations

## Layered Protocols

* Due to the absence of shared memory, all communication in distributed systems is based on **sending and receiving (low level) messages**.
* Processes $$P$$ and $$Q$$ have to agree on the meaning of the bits being sent.

## The OSI Reference Model

* **7 layers:**
  1. **Physical**: Data cables, Cat6
  2. **Data Link**: Switching, MAC addresses, Ethernet
  3. **Network**: IP addresses, Routing
  4. **Transport**: TCP/UDP
  5. **Session**: Session management
  6. **Presentation**: WMV, JPEG, MOV
  7. **Application**: HTTP, SMTP
* **Mnemonic:**
  * **P**lease **D**o **N**ot **T**hrow **S**ausage **P**izza **A**way

## Middleware Protocols

* **4 layers:**
  1. **Hardware**
  2. **OS**
  3. **Middleware**
  4. **Application**
* **Example:**
  * DNS

## Types of Communication

* **Persistent communication**
  * A message that has been submitted for transmission is stored by the communication middleware as long as it takes to **deliver** it to the receiver.
  * E.g., electronic mail system
* **Transient communication**
  * A message is stored by the communication system only as long as the sending and receiving application are **executing**.
* **Asynchronous communication**
  * A sender **continues immediately** after it has submitted its message for transmission.
* **Synchronous communication**
  * The sender is **blocked** until its request is known to be accepted.
