---
# System prepended metadata

title: Intro. to Computer Networks Midterm Note
tags: [Intro. to Computer Networks]

---

---
tags: Intro. to Computer Networks
---

{%hackmd BkVfcTxlQ %}

# Intro. to Computer Networks Midterm Note

## Intro.

### Network Cores

Circuit switching
: TKTK

Packet switching
: Not always reliable (e.g., loss, delay, ...)

### Delay

Processing
: TKTK

Queueing
: TKTK

Transmission $d_t$
: $$\frac{L}{R}$$
: Packet of length $L$ bit
: Link rate $R$ bps

Propagation $d_p$
: $$\frac{d}{s}$$
: Physical distance $d$
: Physical speed $s$ (electric field velocity in the medium)

### Queueing Utilization

\\[\frac{La}{R}\\], where $a$ is average packet arrivial rate.

Also known as _trafic intensity_ (?

### Throughput

Bit received rate at destination. (How fast data could be transferred and _processed_.)

Usually determined by the bottleneck link, i.e., $\min\{R_s, \frac{R}{n}, R_c\}$.

### Bandwidth-Delay Product

\\[R\cdot d_p\\], which is equivalent to $R\frac{d}{s}$, that is, the maximum number of bits in the link.

### Binomial Distro.

\\[E(x)=np\\\sigma_x=\sqrt{np(1-p)}\\]

\\[P(x\leq k)\approx\Phi(\frac{k-E(x)}{\sigma_x})\\], where $\Phi(z)$ is the cummulative distro. function of _standard normal distro._

## Application Layer

### RTT

_Round-Trip Time_, time of a packet traverse from client, to server and then back.

To _GET_ a webpage, it takes a RTT to connect to server and another RTT to send the request.

#### HTTP 1.0: Non-Persistant

\\[2RTT+2RTT\times n\\]

For each object it consumes 2 RTT, where one for creating connection each time while another one for sending request.

#### HTTP 1.1: Persistant

\\[2RTT+RTT\times n\\]

Connects only once in a session.

#### Parallelization

Reduce $x\times n$ to $x\times\left\lceil\frac{n}{p}\right\rceil$, where $p$ denotes the number of parallelized connection.

#### HTTP 2: Pipelining

\\[2RTT+RTT\\]

Sends all objects w/o waiting or delay.

### Proxy

Cache hit rate, access link delay and local delay are denoted by $p$, $D$ and $d$ resp.

Access Link Utilization $I'$
: $$(1-p)I$$

Avg. End-to-End Delay $d'$
: $$p\cdot d+(1-p)\cdot(D+2d)$$

## Transport Layer

### UDP Checksum

1's complement sum of header splitted to 2-byte words (compute summation plus carry out) and then take 1's complement.

> So that it works even if sender and receiver use different endian systems.

### Reliable Data Transfer

1.0
: Assume no bit error or loss

2.0
: Bit flips
: ACK & NAK

2.1
: ACK or NAK might be corrupted
: Marks packets as `0` or `1`

2.2
: NAK-free

3.0
: loss or delay packets
: Add timeout
- Utilization
    - $\frac{\frac{L}{R}}{\frac{L}{R}+RTT}$ is usually poor
    - Pipelined
        - Multiply $n$ time

#### Go-Back-N

Sender maintains a windows of size $N$ containing packets sent but not yet ACKed.

Receiver only ACKs the last in-order packet.

When receiving ACK~n~, sender slides the left of his window to n+1.

#### Slective Repeat

Receiver ACKs all packets, maintains out-of-order ones in buffer and slides his window if in-order.

Sender adds timout for each packet to resend and slides the window when receiving base ACK in the window (the earlist packet not yet ACKed).

{%hackmd @nevikw39/signature %}

