# Lecture 003

Dotted Quad Notation: in 127.0.0.1 we define 127 as first quad, 0 as second, 0 as third, and 1 as fourth quad. Each quad is 8 bits long.

Flat addressing: no structure, could be a random number

• e.g. social security number

• defined by IEEE

• Networks ("LAN") use this: Ethernet, WiFi, Bluetooth

• It assumes network to be small (to avoid collision), but reality is layer 2 network is big. The assumption is incorrect, but it works fine as computing technology improved.

• 48 bits long (very big, but collision do happen)

Switch: look up address and send data to specific port.

• routing table is filled using routing protocols (VGP using Bellman-ford, Dijkstra algorithm)

• the exact protocol depends on type of network
• LANs use different due to historical reason
• Internet use BGP based on Bellman-Ford
• bridge / switch track a table of MAC address with port (and timer)

• so given a MAC address (or, in another word, Ethernet Address), it send packet to port

• initial packets are broadcasted: when a new device join the LAN, the switch does not know its MAC Address associated with port. Therefore when the first packet send to a MAC Address that is not in the current table, the message will be broadcasted. When someone respond, then the switch will associate whoever responded in some port with that MAC Address. (This is extremely insecure, but security is typically handeled at application layer.)

Hierarchical addresses: has a structure, simplify deliver packets

• e.g. postal address, telephone number

Network Functions: (only the first two will impact distributed system)

1. Packet Forwarding: (run at high frequency)
2. Network Control: executing routing protocols, update forwarding table, ... (once every minutes)
3. Network Management: adding new wires, change forward rules by traffic engineers (infrequent)

Network vs Internet:

• ownership

• scale

Money aspect: user -> content provider -> commerce -> ISPs -> ISPs...

IPv4: not flat

• it is hard to know whether an IPv4 address is used (it is too short, can't randomly generate and hope)

• packet forwarding is expensive and slow: table lookup is costly with large table size

• Routing protocol is CPU and bandwidth hungry: constructing large lookup table is costly

When ISPs gives you a network IP, then you can assign up to $2^9$ many IPs to your machines without talking to ISP. When other people outside of network send a packet to your IP, ISP only use network to send packet to your network. You are responsible to use host to the actual machine (or drop it if you want).

So routing protocol only need to identify paths to all networks, not all hosts

8bit network and 24bit host

### Class-based IP

As a solution to original IP Address

• Problem: Everybody is asking for class B (no specific reason, just fact)

• The prefix is used to identify class in routers.

Classless Interdomain Routing (CIDR):

• network predix (network) can be any size

• use a slash /26 to denote howmany network bits (or, formally, 32-bit mask like 255.255.255.192)
• help with space deplition, but hurt forwarding speed

IETF developed

• define IPv6: 128 bits address

• different chunks for geographical addressing in IPv4
• 48-bit chunk per LAN guaranteed (those 48-bit assigned to device is the same as device MAC Address (or Ethernet Address). When packet send into a LAN, LAN will start to read MAC Address, the last 48-bit.
• Chunks for Geographic addressing, with IPv4 address space (help clean up routing tables)
• Network address translation (NAT): hosts share IP address and only translated inside network

Assigning IPv4:

• Internet Corporation for Assigned Names and Numbers (ICANN) assign large chunks to Regional Internet Registries (e.g. American Registry for Internet Names (ARIN)

• Regional Internet Registries assign chunks to ISPs

• ISPs assign to Institutions

• Institutions assign to individuals

## Packet Delay

Delays:

• Propagation delay on links: proportional to the length of the link

• Processing delay on switches: depends on the speed of the router

• Queuing delay on switches: depends on the traffic load and queue size

Roundtrip Time (RTT): measure the time by ping, the fastest delay you can ever get.

• two way delay

• include server processing time

• RTT for in-kernel protocols is a bit shorter: since kernel code is counting the time, not application.

• easy to measure

Efficiency: Fully use the bandwidth on the bottleneck link Fairness: all flows have the same throughput (having same bandwith is not realistic)

Max-min Fairness:

1. Assume each connection need some bandwidth $\{1, 5, 3, 7, 9\}$. And each switch or router has some bandwidth $10$.
2. Evenly all bandwidth among all people. $\{2, 2, 2, 2, 2\}$
3. Notice that we exceed bandwidth for the first connection. Then we divide its bandwidth among others: $\{1, 2\frac{1}{4}, 2\frac{1}{4}, 2\frac{1}{4}, 2\frac{1}{4}\}$

If we put this rule into multiple routers: Longer paths are likely to experience significant congestion.

Flow Completion Time: a metric to measure performance of the network concerning the entire protocol stack - associated with ending and receiving a block of data (image, HTML, video)

Optimizing FCT is possible, e.g. in datacenter where the infrastructure is controlled by only one organization

TCP: reliable, two-way byte stream service

• reliable: bytes received correctly in order

• connection: three way handshake

• flow control: avoid sender outrun receivers and disallow receiver to drop packet due to buffer overflow

• error control: recover from packet loss, corruption, reordering

• congestion control: controls the transmit rate of the sender (too slow increase FCT, too fast result in packet loss)

• $\text{Transmit Rate} = \frac{\text{CC Window}}{\text{RTT}}$
• CC window is initialized to 10 packets and updated every RTT based on packet loss
• TCP with low RTT has higher transmit rate at the start, and it increase faster

TCP is developed during world war. This specific behavior was invented by assuming there is poor connection between US's military after nuclear impact

Edge Computing: move data center closer to the clients

Table of Content