Majid Al-RaimiReference sheet

COE 558Lecture 01Reference

Reference sheet

Introduction compressed onto one page: the definitions, formulas and numbers to have in your head before a quiz or exam.

TCP/IP stack

Five layers, bottom-up PL, DLL, NL, TL, AL. Each payload is the PDU of the layer above. Part 03: TCP/IP stack

LayerPDUPayloadProtocolsConnectionAddress
ApplicationMessageApplication bytesHTTP, SMTP, IMAPProcess to process, rides on E2ENone
TransportSegment (TCP) or datagram (UDP)MessageTCP, UDPE2E, virtual, one per pathPort number
NetworkPacket (datagram)Segment or UDP datagramIP, routing protocolsH2H, virtual, one per pathIP address
Data linkFramePacketEthernet, 802.11, PPPP2P, physical, one per hopMAC address
PhysicalBitsFrame, as signalsSignal specs of Ethernet and Wi-FiThe medium itselfNone
Layer, PDU, payload, protocols, connection scope and address

Sockets, TCP and UDP

socket=(IP,port)\text{socket} = (\text{IP}, \text{port}) names one endpoint. A connection is the pair of sockets, and a flow is the 5-tuple (src IP, dst IP, protocol, src port, dst port). Ports: 0 to 1023 system, 1024 to 49151 user, 49152 to 65535 dynamic. Part 05: Sockets and web apps

PropertyTCPUDP
POSIX typeSOCK_STREAMSOCK_DGRAM
SetupThree-way handshake before dataNone, each datagram stands alone
DeliveryLoss detected and retransmittedNo delivery or duplicate guarantee
OrderingIn-order byte streamMay arrive out of order
BoundariesContinuous stream, no boundariesOne datagram is one message
Header20 bytes minimum plus connection state8 bytes, no state
FitsWeb pages, file transfer, APIsLive voice and video, DNS queries, QUIC
TCP socket versus UDP socket

Decentralized versus distributed

Two independent dimensions, not opposites. Bitcoin is both. Part 04: Network applications

AspectDecentralizedDistributed
What is splitThe application, into separate client and server programsThe computation and state, across client, server or many machines
StressesStructure: programs talking through a protocol and socketsResources: where compute and state live
Lecture exampleBitTorrent, BitcoinGoogle Cloud
Design-space axisVertical: which layerHorizontal: which compute or storage resource
The lecture's definitions

Edge-to-cloud layers

Going outward, proximity falls and resources rise. Chain order: device, mist, near edge, far edge, fog, regional cloud, cloud. Part 08: Edge, fog and cloud

LayerProximityResourcesRoleExamples
MistClosestVery limitedImmediate, local decisionsSensor chip, Raspberry Pi Pico
Near edgeVery closeLimited to moderateLocal processingHome router, Raspberry Pi 4
Far edgeCloseModerate to highLow-latency applicationsJetson Orin Nano, AWS Wavelength Zone
Fog or regionalIntermediateHighAggregation and coordinationMetro micro data center, Azure Stack Edge
CloudDistantVery highLarge-scale computation and storageAWS Region and its availability zones
E2C layers

Latency formulas

One-way lower bound from geodesic distance at c ≈ 300,000 km/s: about 3.3 ms per 1,000 km. Fiber runs near 200,000 km/s, so about 1.5× the bound. Part 07: Latency

LatencyLB=dgeodesicc,RTTLB=2dgeodesicc\text{Latency}_{LB} = \dfrac{d_{\text{geodesic}}}{c},\qquad \text{RTT}_{LB} = \dfrac{2\,d_{\text{geodesic}}}{c}
Lower bound, one way and round trip
dprop=dsdtrans=LRd_{\text{prop}} = \dfrac{d}{s}\qquad d_{\text{trans}} = \dfrac{L}{R}
d: link length, s: signal speed, L: bits, R: bits per second
dnodal=dproc+dqueue+dtrans+dpropd_{\text{nodal}} = d_{\text{proc}} + d_{\text{queue}} + d_{\text{trans}} + d_{\text{prop}}
Per node, summed over every hop

Response time and budget. Part 09: Mapping tasks, Part 10: Latency budget

RT=L1+PT+L2τRT = L_1 + PT + L_2 \le \tau
Out, processing, back, within the budget τ
RT=Lce+PT1+Lef+PT2+Lfe+PT3+LecRT = L_{c \to e} + PT_1 + L_{e \to f} + PT_2 + L_{f \to e} + PT_3 + L_{e \to c}
Mapping 4: every hop plus every task

The four delays

DelayWhereDriven byFormula or factor
ProcessingInside each router, switch or hostHeader and error checks, forwarding lookupDevice speed, usually microseconds
QueueingRouter and server buffersCongestion ahead of your packetTraffic intensity, zero to very large
TransmissionNetwork interface pushing bits outPacket size and bandwidthL / R
PropagationThe physical channelLink length and mediumd / s
Where each delay happens
RegionGeodesicBound one way / RTTMeasured RTTRatio
Frankfurt (eu-central-1)≈4,390 km14.6 ms / 29.3 ms100 ms≈3.4×
Tokyo (ap-northeast-1)≈8,300 km27.7 ms / 55.3 ms163 ms≈2.9×
Oregon (us-west-2)≈11,900 km39.7 ms / 79.4 ms243 ms≈3.1×
From Dammam: measured RTT is about 3× the round-trip bound

The four mappings

Pipeline T1 resize, T2 detect, T3 draw. Part 09: Mapping tasks

MappingWhere T1, T2, T3 runStrengthsWeaknessesExample
1All in the cloudConsistency, simple client, easy scalingLarge L1 and L2, unfit for AR or gamingPhoto tagging in a distant data center
2All on the deviceNo network, privacy, works offlineBattery, limited hardware, long PTSmartwatch activity recognition
3All at the edgeLow latency, data stays localLimited reach, limited scalabilityRetail store analytics
4T1 edge, T2 fog, T3 edgeShared model, more compute, model updatesExtra inter-layer hops and transfer costSmart-city traffic cameras
Strengths and weaknesses

New York client, California cloud

Worked numbers

Terms
L1 = 70 ms, PT = 30 ms, L2 = 70 ms
Response time
70 + 30 + 70 = 170 ms
Computation share
30 / 170 ≈ 17.6%, network 140 / 170 ≈ 82%
Server 2x faster
70 + 15 + 70 = 155 ms, speedup 170 / 155 ≈ 1.097x (about 9%)
Infinitely fast server
70 + 0 + 70 = 140 ms, ceiling 170 / 140 ≈ 1.21x
Amdahl check
f = 30/170, k = 2: 1 / (0.8235 + 0.0882) ≈ 1.097
S=1(1f)+f/kS = \frac{1}{(1 - f) + f/k}
Amdahl: the unimproved network caps the speedup

Design exercise method

Same four steps for smart glasses, warehouse AR and VR. Part 10: Latency budget

Four steps

1. List the tasks
Break the app into its pipeline: capture, compress, detect or recognize, render, store, retrain.
2. Set τ per task
Cite published budgets: 20 ms motion-to-photon for XR (RFC 9699), 370 to 1000 ms face recognition, 150 ms one-way voice (G.114). Storage and training have no deadline.
3. Place each task
Rendering and tracking on the device (mist), heavy inference offloaded to a nearby edge, storage and training in the cloud.
4. Check RT and trade-offs
Write RT = out + PT + back with numbers against τ per task, then weigh battery, heat, privacy, cost and scale.
  • Worked check at τ = 100 ms: fog 20 + 70 + 20 = 110 ms fails, edge 5 + 70 + 5 = 80 ms passes.
  • Check budgets at a percentile, not the mean. A faster CPU only shrinks PT.

Slide errata

Answer with the corrected fact, and name the slide version if a question depends on it. Part 01: Course map

What the slides get wrong

Slide 5
Deployment models (public, private, hybrid, multi-cloud) differ from NIST: private, community, public, hybrid.
Slide 18
100 W x 10 h = 1,000 Wh = 1 kWh, an energy, not 1,000 watts.
Slide 25
Email is an application (SMTP, IMAP), and MAC addresses are an addressing scheme, not protocols.
Slide 26
Point-to-Point means one hop between adjacent interfaces, not PPP or peer-to-peer.
Slide 28
IP plus port names one socket. A connection needs both endpoints plus protocol (the 5-tuple).
Slide 37
The socket is the endpoint. TCP establishes the connection; UDP never does.
Slide 42
TCP data can be lost in the network; TCP detects and retransmits. More than two socket types exist.
Slide 45
"Font-end" means Front-end. server.route is the hapi framework on Node.js.
Slide 48
"Layer 1, 2, 3" are path tiers. Switching is layer 2, routing layer 3.
Slide 49
The 1 / 5 / 15 ns figures are a ranking only; main memory is about 90 ns.
Slide 54
Use geodesic, not planar, distance. Oregon is about 11,900 km, so 39.7 ms, not 37 ms.
Slides 60, 71
The pictured board is a Raspberry Pi 4 single-board computer, not a microcontroller board.
Slide 72
Compare RT, not latency, with τ.
Slide 76
Captions skip the device layer, which must run tracking for a 20 ms XR budget.
Slide 77
RT = f(Latency, PT) means the sum of every hop plus every task's PT.