Instructor: Noura Limam

Time: MW 2:30PM - 3:50PM

.1A * 3 + .25MT + .35FE + .15PJ + .02Q * 5

Week 1. Jan 5

the internet

'nuts and bolts' view: connected computing devices

img

'service' view: infrastructure providing services to apps

definition. protocols define the format, order of messages sent and received among network entities, and actins taken on message transmission and recept

internet standards: RFC, IETF

closer look at network structure

host: sends packets of data

access networks

in cable-based access, frequency division multiplexing (FDM) is used to transmit different channels in different frequency bands over shared cable.

in digital subscriber line (DSL), voice and data are transmitted at different frequencies over dedicated line to central office.

home networks:

| | | WiFi ---- router/firewall/NAT ---- cable/DSL modem --|-- to/from headend/central office |(54,450Mbps) | | | wired ethernet (1Gbps) |

often access point, router and modem are combined in a single box.

wireless access networks: shared wireless access network connects end system to router via base station aka 'access point'

enterprise networks:

data center networks:

twisted pair (TP): two insulated copper wires (wrapped around each other)

coaxial cable: two concentric copper conductors

fiber optic cable: glass fiber carrying light pulses, each pulse a bit

wireless radio: signal carried in various 'band' in EM spectrum

network core

key network-core functions:

store-and-forward switching:

me ----- router ----- destination

eg. assuming propagating in cable and processing take no time. 3 packets, L = 10 Kbits, R = 100 Mbps. then one-hop transmission delay = 0.1 ms. then total = 0.4 ms.

| | |t=0 |////////////| |.1 |++++++++++++|////////////|.2 |============|++++++++++++|.3 | |============|.4 source router dest

if we had one more router, then the total delay would be 0.5 ms.

queueing packet switching:

Week 2. Jan 10

circuit switching:

eg. packet switching vs. circuit switching:

internet structure

how to connect millions of access ISPs together?

we connect each access ISP to one global transit ISP network (interconnected ISPs)

img

performance

sources of packet delays:

  1. transmission delay: L/R
  2. queueing delay (traffic intensity)
  3. nodal processing delay
  4. propagation delay

traceroute: provides delay measurements along end-end internet path.

packet loss:

throughput: rate (bits/time) at which bits are sent from sender to receiver

eg. what is end-end throughput per connection?

S S ... S (10) \ \ / | R | / / ... \ C C C (10)

min(RS, RC, R/10).

security

internet was not originally designed to be much secure.

packet interception:

fake identity:

denial of service (DoS): attackers make resources unavailable to legitimate traffic by overwhelming resources with bogus traffic

  1. select target
  2. break into hosts around the network (botnet)
  3. send packets to target from compromised hosts

lines of defense:

protocol layers

layering:

layered internet protocol stack:

  1. application: supporting applications
  2. transport: process-process data transfer
  3. network: routing of datagrams from source to destination
  4. link: data transfer between neighboring network elements
  5. physical

how to pass a message:

  1. application exchanges message M to implement some app service using services of transport layer
  2. transport layer protocol transfers M (eg reliably) from one process to another, using services of network layer
  3. network layer protocol transfers transport-layer segment [Ht M] from one host to another using link layer services
  4. link layer protocol transfers datagram [Hn Ht M] from host to neighboring hosts using network layer services
  5. we do not cover physical layer
  6. decapsulate the datagram in reverse order on receipt

switching devices do not implement all the layers:

img

Week 3. Jan 17

application layer

web app:

client-server paradigm:

peer-peer architecture:

processes communicating:

sockets:

img

process addressing:

app-layer protocols:

open protocols are defined in RFCs and allows interoperability by giving access of definition to everyone.

what app needs from transport service:

app app layer protocol transport protocol
file transfer FTP TCP
email SMTP TCP
web docs HTTP TCP
internet telephony SIP, RTP or proprietary TCP/UDP
streaming HTTP, DASH TCP
interactive games WOW, FPS (proprietary) UDP/TCP

security in TCP:

HTTP

hypertext transfer protocol (HTTP):

non-persistent HTTP (HTTP1.0):

response time:

img

persistent HTTP (HTTP1.1):

HTTP request message:

GET /index.html HTTP/1.1\r\n Host: www.example.com\r\n User-Agent: Mozilla/5.0\r\n # headers Accept: text/html\r\n Connection: keep-alive\r\n \r\n # carriage return and line feed at line start indicates # end of headers # no body for GET request

HTTP response message:

HTTP/1.1 200 OK\r\n Date: Mon, 27 Jul 2009 12:28:53 GMT\r\n Server: Apache/2.2.14 (Win32)\r\n Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT\r\n Content-Length: 298\r\n Content-Type: text/html\r\n \r\n # body
$ nc -c -v www.example.com 80 GET /index.html HTTP/1.1 Host: www.example.com

HTTP/2:

HTTP/3:

cookies

websites and client browser use cookies to maintain state between transactions.

four components:

  1. cookie header line of HTTP response message
  2. cookie header line in next HTTP request message
  3. cookie file kept on user's host, managed by user's browser
  4. back-end database at website

img

how to keep state:

privacy:

web caches

goal satisfy client requests without involving origin server

advantage:

eg. RTT from pubic internet router to server is 2 seconds, average web object size is 100 K bits, there are 15 requests on average.

origin servers | public internet router -------------------------------- | | 1.54 Mbps access link -------------------------------- institutional network router | 1 Gbps LAN clients

option 1: but faster access link

option 2: install web cache in institutional network

conditional GET:

Week 4. Jan 24

email

three major components:

SMTP RFC:

img

sample interaction at step 3:

S: 220 example.com C: HELO ecole.fr S: 250 Hello ecole.fr, pleased to meet you C: MAIL FROM: <alice@ecole.fr> S: 250 alice@ecole.fr... Sender OK C: RCPT TO: <bob@example.com> S: 250 bob@example.com... Recipient OK C: DATA # start the email S: 354 Enter mail, end with "." on a line by itself C: FROM: alice@ecole.fr C: TO: bob@example.com C: SUBJECT: Hello! C: C: Do you like Math? C: How about Science? C: . S: 250 Message accepted for delivery C: QUIT S: 221 example.com closing connection

comparison with HTTP:

RFC 2822 define syntax for email message itself (different from commands above).

retrieving email uses different protocol than SMTP:

Show demo code
$ nc -C -v mxer.uwaterloo.ca 25 Connection to mxer.uwaterloo.ca 25 port [tcp/smtp] succeeded! 220 mxer.uwaterloo.ca ESMTP Sendmail 8.14.7/8.14.7 ready on mailchk-m02 at Mon, 24 Jan 2022 15:47:06 -0500 - problems to postmaster@uwaterloo.ca HELO uwaterloo.ca 250 mailchk-m02.uwaterloo.ca Hello ubuntu.student.cs.uwaterloo.ca [127.0.0.1], pleased to meet you MAIL FROM: ksnfanfnn@uwaterloo.ca 250 2.1.0 ksnfanfnn@uwaterloo.ca... Sender ok RCPT TO: y3285wan@uwaterloo.ca 250 2.1.5 y3285wan@uwaterloo.ca... Recipient ok DATA 354 Enter mail, end with "." on a line by itself FROM: ksnfanfnn@uwaterloo.ca TO: y3285wan@uwaterloo.ca SUBJECT: Testing SMTP Hello myself. . 250 2.0.0 20OKl6BZ012876 Message accepted for delivery QUIT 221 2.0.0 mailchk-m02.uwaterloo.ca closing connection exit

domain name system (DNS)

how to map between IP address and name, and vice versa?

DNS services do:

reasons to decentralize:

img

to find IP for www.amazon.com, client first queries root for .com DNS server, which queries amazon.com DNS server, finally resolve full name.

root name servers:

top-level domain (TLD):

authoritative DNS servers:

local DNS name servers:

DNS resolution:

img

caching DNS info:

DNS records:

DNS runs on both TCP and UDP, by default UDP, where query and reply have same format.

< 2bytes >< 2bytes > identification flags (id: 16 bit for query, reply uses same number) (flags: query/reply, recursion desired, recursion avai, reply is authorative) # questions # answer RRs # authority RRs # additional RRs questions (name, type fields) answers (RRs in response) authority (records for authoritative servers) additional info

how to get info into the DNS:

  1. register name example.com at DNS registrar
  2. create authoritative server locally with IP 1.2.3.4

DNS security:

$ dig www.uwaterloo.com A $ dig @a.root-servers.net www.uwaterloo.com A $ dig @any.ca-servers.ca www.uwaterloo.com A $ dig @ext-dns-aws.uwaterloo.ca www.uwaterloo.com A

socket programming

two socket types:

application example:

  1. client reads line of characters from keyboards then sends data to server
  2. server receivers data and converts data to uppercase
  3. servers sends
  4. client receives and displays line

with UDP:

img

from socket import * # server serverPort = 12000 serverSocket = socket(AF_INET, SOCK_DGRAM) serverSocket.bind(('', serverPort)) print('The server is ready to receive') while True: message, clientAddress = serverSocket.recvfrom(2048) modifiedMessage = message.decode().upper() serverSocket.sendto(modifledMessage.encode(), clientAddress) # client serverName = 'hostname' serverPort = 12000 clientSocket = socket(AF_INET, SOCK_DGRAM) message = input('Input lowercase sentence: ') clientSocket.seendto(message.encode(), (serverName, serverPort)) modifiedMessage, serverAddress = clientSocket.recvfrom(2048) print('From server: ', modifiedMessage.decode()) clientSocket.close()

with TCP:

img

from socket import * # server serverPort = 12000 serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.bind(('', serverPort)) serverSocket.listen(1) print('The server is ready to receive') while True: connectionsSocket, address = serverSocket.accept() # new sock created on return sentence = connectionsSocket.recv(1024).decode() capitalizedSentence = sentence.upper() connectionsSocket.send(capitalizedSentence.encode()) connectionsSocket.close() # client serverName = 'hostname' serverPort = 12000 clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket.connect((serverName, serverPort)) message = input('Input lowercase sentence: ') clientSocket.send(message.encode()) modifiedMessage = clientSocket.recv(1024) # no need to attach name:port print('From server: ', modifiedMessage.decode()) clientSocket.close()

Week 5. Jan 31

P2P

desc

KPI: how much time to distribute file of size F from one server to N peers?

img

client-server:

using P2P:

BitTorrent:

video streaming

stream video traffic is major consumer of internet bandwidth.

challenges:

simple scenario: streaming stored video

dynamic, adaptive streaming over HTTP (DASH):

streaming video = encoding + DASH + playout buffering

content distribution networks (CDN)

challenge: how to stream content to hundreds of thousands of simultaneous users?

steps:

CDNs are example of OTT (over the top): internet host-host communication as a service.

OTT challenges:

transport layer

multiplexing:

32 bits src port | dest port -------------+---------------- other headers ------------------------------ payload

connectionless demultiplexing in UDP:

connection-oriented demultiplexing in TCP:

multiplexing happen at all layers.

user datagram protocol (UDP)

advantages:

UDP segment header:

32 bits ---------+---------- src port | dest port ---------+---------- length | checksum # length including header ---------+---------- payload

UDP checksum:

eg.

1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 --------------------------------- 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 --------------------------------- 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 wrap around (carryout added) --------------------------------- 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 checksum

Week 6. Feb 7

f f 304 dns none http/tcp/dns/udp in/the/cache does/not/mean/anything mailserver cache/discard 12997158232 server/to/server copies 4321

principles of reliable data transfer

img

implementation: rdt1.0: reliable transfer over a reliable channel:

img

refinement: rdt2.0: channel with bit errors:

rdt2.0 with no errors:

img

problem: what if ACK/NACK is corrupted?

refinement: rdt2.1:

img

refinement: rdt2.2: NAK-free protocol

refinement: rdt3.0: channel may lose packets

rdt3.0 sender:

img

procedures:

img

performance of rdt3.0:

eg. 1 Gbps link, 15 ms propagation delay, 8000 bit per packet. then Usender=L/RRTT+L/R=.00830+.008=.00027U_\text{sender}=\frac{L/R}{RTT+L/R}=\frac{.008}{30+.008}=.00027 where RTT is round trip time, L/R is transmission delay.

L/R sender ^ \ | \ RTT receiver | / v / sender

solution: use pipelining

go-back-N pipelining:

send_base next_seq_num v v ||||||############[][][][][]------- ^--------------------^ window size N ||: already ACKed ##: sent, not yet ACKed []: usable, not yet sent --: not usable
recv_base v ...|||||-XXX----- ||: received and ACKed --: not received XX: out of order and not ACKed

procedure:

img

selective repeat pipelining:

send_base next_seq_num v v ||||||##||##||####[][][][][]------- ^--------------------^ window size N ||: already ACKed ##: sent, not yet ACKed []: usable, not yet sent --: not usable

does this beat the 'requirement' that one should ack newest correctly received packet?

Week 7. Feb 14

eg. because we allow out-of-order packets, the typical seq # pool = window size + 1 will not work.

we have sequence numbers 0,1,2,3 and window size 3:

img

solution: window should not be the more than half of the seq # pool.

transport control protocol (TCP)

TCP segment header:

img

procedure:

img

how to handle out-of-order packets? the TCP spec does not restrict.

how to set TCP timeout values?

TCP sender (simplified):

TCP receiver;

img

TCP fast retransmit:

TCP flow control:

TCP connection management:

3-way handshake:

img

SYN flood attack:

close of connection:

img

Week 9. Feb 28

principles of congestion control

too many sources sending too much data too fast for network to handle.

manifestations:

causes of congestion:

img

img

approaches:

TCP congestion control: AIMD (TCP reno)

approach: senders can increase sending rate until packet loss occurs, then decrease rate on loss events.

img

benefits: a distributed, asynchronous algorithm has been shown to

sending bahavior:

TCP slow start:

img

[RFC 5681]

img

explicit congestion notification

example of network-assisted congestion control.

img

fairness of TCP

goal: if k TCP sessions share same bottleneck link of bandwith R, each should have average rate R/K.

consider two competing TCP sessions only in AIMD congestion avoidance mode, with same MSS and RTT, and so same throughput.

img

the red path swings around the max bandwidth line and eventually converges to the equal bandwidth line. so TCP under these assumptions is fair.

is UDP fair?

is parallel TCP connections fair?

TCP CUBIC

intuition:

img

TCP CUBIC is default in linux and is most popular in web servers.

history

TCP and UDP are principal transport protocols for 40 years.

there are different flavors of TCP developed for specific scenerios:

case challenges
long, fat pipes many packets in flight; loss shuts down pipeline
wireless networks loss due to noisy wireless links, mobility; TCP treats this as congestion loss
long-delay links long RTTs
data center networks latency sensitive
background traffic flows low priority; 'background' TCP flows

now: moving transport-layer functions to app layer on top of UDP: HTTP/3: QUIC

QUIC (quick UDP internet connections)

app-layer protocol on UDP

img

moving from network edge to network core...

Week 10. Mar 7

network layer/data plane

planes:

service model for channel transporting datagrams

routers

+-------------+ | routing | routing, management +--------+ processor | control plane (software) | +-------------+ operates in ms time frame - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | forwarding data plane +-------------v-+ +-------------+ +----------------+ (hardware) operates +---|---|-----|-----|---->+ +-----|---|-----|------|-----> in ns timeframe +---------------+ | | +----------------+ | | high-speed | | | switching | | | frabric | | | | +-------------v--+ | | +----------------+ +---|---|-----|------|---->+ +-----|---|-----|------|-----> +----------------+ +-------------+ +----------------+ input ports output ports

input port:

+----------------------------------------------------------------+ | | | +-------------+ +---------------+ +---------------+ | | | line | | link layer | | lookup,forward| | switch +---->+ termination +------> protocol (rcv)+-----> queueing +----> fabric | +-------------+ +---------------+ | |||||||||| | | | +---------------+ | +----------------------------------------------------------------+

longest prefix matching: when looking for forwarding table entry gor given dest address, use longest address prefix that matches dest address

range line interface ----------------------------------------------------- 11001000 00010111 00010*** ******** -> 0 11001000 00010111 00011000 ******** -> 1

switching fabrics:

output port queueing:

+-----------------------------------------------------------------+ | | | +----------------+ +----------------+ +-------------+ | | | lookup,forward | | link layer | | line | | NR --->+ queueing +------> protocol (send)+-----> termination +------> rate R | | --|||||||||| | +----------------+ +-------------+ | | +----------------+ | +-----------------------------------------------------------------+

buffer management:

packet scheduling: decide which packet to send next on link

internet protocol

img

ip fragmentation and reassembly:

addressing

subnets:

subnet: 1101 1111 0000 0001 0000 0001 0000 0000 ------------------------------- subnet mask: 1111 1111 1111 1111 1111 1111 0000 0000

how to get an IP address:

DHCP: host dynamically obtains IP from network server when it joins network

Week 11. Mar 14

hierarchical addressing:

are there enough 32-bit IP addresses?

network address translation (NAT)

NAT: all devices in local network share just one IPv4 address as far as outside world is connected

10.0.0.4 ---- PC (10.0.0.1) ------------------------ |x| ---- ---- PC (10.0.0.2) 138.2.17.66 ---- PC (10.0.0.3) <----------------------> <----------------------------> INETERNET LOCAL NETWORK all datagrams leaving datagrams with src or dest local network have in this network have local same src IP but addresses different ports

implementation (transparently):

controversy:

IPv6

motivations:

img

transition from IPv4:

generalized forwarding

flow table:

OpenFlow:

match: - ingress port - link layer: - src MAC - dst MAC - EtherType - VLAN ID - VLAN Pri - network layer: - src IP - dst IP - IP protocol - IP ToS - transport layer: - TCP/UDP src port - TCP/UDP dst port action: - forward to port - drop - modify fields in header - encapsulate and forward to controller stats: - packet counter - byte counter

match+action abstraction unifies different kinds of devices:

many of these tables combined can have network-wide behaviors, which is a simple form of 'network programmability'

network layer/control plane

routing protocols

routing algorithm goal: determine 'good' paths from src to dst.

routing algorithm classifications:

global: all routers have complete topology, link cost info * 'link state' algos ^ | | | static: routers change | "dynamic": routers change slowly over time +-------------------+----------------> more quickly | * periodic updates or how fast routers | in response to link change? | cost change | | + global or decentralized info? decentralized: iterative process of computation, exchange of info with neighbors * routers initially only know link costs to attached neighbors * 'distance vector' algos

graph notations:

Dijkstra's link-state routing algorithm:

auto N' = {u} for v in V: if vu in E: D[v] = c[uv] else: D[v] = infty while N' != V: auto w = such that D[w] = min{D[w] for w in V-N'} N'.add(w) for v in w.neighbors - N': D[v] = min{D[v], D[w] + c[wv]}

the forwarding table is the least cost tree built by Dijkstra's algorithm.

img

osciilation: when a router changes info, since other routers compute path tree as soon as they receive new states, all routers will run the algo...

Week 12. Mar 21

distance vector algorithm:

while True: wait for change in local link cost or message from neighbor recompute DV estimates using DV received from neighbor if DV to any destination has changed, notify neighbours

state information diffusion: at iteration i, x's state influences distance computations up to i hops away

img

eg. 'good news travels fast' when link cost decreases

C[xy] = 4 -> decreased to 1 C[xz] = 50 C[yz] = 1 +----- y -----+ | 4 1 | x ----------- z 50
  1. y detects link-cost change, updates its DV, informs its neighbors
  2. z receives update from y, updates its table, computes new least cost to x , sends its neighbors its DV.
  3. y receives z’s update, updates its distance table. y’s least costs do not change, so y does not send a message to z. (converged)

eg. 'bad news travels slow' when link cost increases

C[xy] = 4 -> increased to 60
  1. y sees direct link to x has new cost 60, but z has said it has a path to x at cost of 5. So y computes “my new cost to x will be 6, via z); then notifies z of new cost of 6 to x
  2. z learns that path to x via y has new cost 6, so z computes “my new cost to x will be 7 via y), notifies y of new cost of 7 to x
  3. y learns that path to x via z has new cost 7, so y computes “my new cost to x will be 8 via y), notifies z of new cost of 8 to x
  4. ...

this is 'count-to-infinity problem'. while the algo does not yet converge, the datagram from y to x may go back and forth between y and z.. (black holing)

reverse poisoning: node y can lie to its neighbour in the message that it has infinity distance so packet will not come back.. but this is not good for all situations as we can have bigger loops.

comparisons

LS DV
message complexity O(n^2) messages sent exchange between neighbours
varies convergence times
speed of convergence O(n^2)
may have oscillations
varies
may have routing loops and
count-to-infty problem
robustness
what if router malfunctions?
router can advertise incorrect cost
each router computes its own tabe
DV router can advertise incorrect path cost or black holing
errors propogates through network

intra-domain routing protocol

however in real world routers are different and they can have different bandwidths and routing algos..

scale: have billions of destinations

2 levels of routing:

common intra-AS routing protocols:

img

inter-domain routing protocol: BGP

img

why 2 levels of routing?

hot potato routing: when receiving multiple advertisements routing to same place, choose local gateway that has least intra-domain cost so that the datagram leaves current AS quickly

img

ISP only wants to route traffic to/from its customer networks (does not want to carry transit traffic between other ISPs – a typical “real world” policy)

img

Week 13. Mar 28

software defined networking (SDN) control plane

network layer is historically implemented via distributed, per-router contrl approach

around 2005, there was renewed interest in rethinking control plane: take control plane off the proprietary switches and have a logically centralized control plane

eg. in traditional routing, what if network operator wants u-to-z traffic to flow along one path instead of another? need to re-define link weights so traffic routing algorithm computes routes accordingly (or even need a new one).

SDN has 4 goals:

  1. generalized 'flow-based' forwarding
  2. control and data plane separation
  3. control plane functions external to data-plane switches
  4. programmable control applications

components:

layers of SDN controller:

img

OpenFlow protocol:

key controller-to-switch messages

key switch-to-controller messages

network operators do not send these directly, but use higher-level abstraction at controller.

internet control message protocol (ICMP)

implementing traceroute:

context:

link layer services:

encapsulate -> add error checking bits, rdt, flow control, etc. -> check errors, etc. -> decapsulate

link layer is implemented in every host, in an 'adapter' (network interface card (NIC)) or on a chip attached into host system's buses.

two types of links:

multiple access protocols

an ideal multiple access protocol:

MAC protocols

three broad classes

  1. channel partitioning: divide channel to time slots, frequencies or codes and allocate pieces to node for exclusive use
    • TD, FD
  2. random access: do not divide channel and allow collisions. try to fix them
    • CSMA/CD (used in ehernet), CSMA/CA (used in 802.11)
  3. 'taking turns': nodes take turns, but nodes with more to send can take longer turns
    • bluetooth, FDDI, token ring

TDMA (time division multiple access):

FDMA (frequency division multiple access):

random access protocols:

CSMA (carrier sense multiple access):

CSMA/CD (with collision detection):

img

a frame has to have at least 512 bits (in order for sender to know collision happened).

eg. we have first collision, then two parties have (ka,kb){0,1}2(k_a,k_b)\in\{0,1\}^2. in which

if second collision happens, then two parties have (ka,kb){0,1,2,3}2(k_a,k_b)\in\{0,1,2,3\}^2

probability of repetitive (m+1)th collision is 2m[2m1]2=2m22m\frac{2^m}{|[2^m-1]^2|}=\frac{2^m}{2^{2^m}}.

efficiency: transDelay / (transDelay + 5*propDelay)

CSMA/CA: try to prevent colliding. before transmit, send a request to transmit message to access point which notifies others. minor collision can happen but is ok.

'taking turns':

LAN addressing

ARP (address resolution protocol): translates IP to MAC address

ARP can also be used for annoucing.

Week 14. Apr 4

ethernet

physical topology:

802.1 frame structure

features:

switch

multiple simultaneous transmissions

img

how does switch know A' is reachable via intf4?

when frame is received at switch:

record incoming link, MAC of sending host index switch table using dest MAC if found: if dest is on segment from which frame arrived: drop else: forward frame to outgoing interface else: forward on all interfaces except arriving interface # flooding

interconnecting switches handle forwarding similarly.

switches vs. routers:

virtual LAN (VLAN)

switches supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure.

features:

img

life of a web request

img

  1. connecting laptop needs to get its own IP of first-hop router and address of the DNS server: use DHCP
    1. DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.3 ethernet
    2. ethernet frame broadcast (with dest ff:ff:ff:ff:ff:ff) on LAN, received at router running DHCP server
    3. ethernet demuxed to IP demuxed, UDP demuxed to DHCP
    4. DHCP server formulates DHCP ACK containing client's IP address, IP address of first-hop router for client, name & IP address of DNS server
    5. encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client
    6. DHCP client receives DHCP ACK reply
  2. before sending HTTP request, need IP of www.google.ca: use DNS
    1. DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. to send frame to router, need MAC address of router interface: ARP
    2. ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface
    3. client now knows MAC address of first hop router, so can now send frame containing DNS query
    4. IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
    5. IP datagram forwarded from campus network into comcast network, routed (tables created by RIP, OSPF, IS-IS and/or BGP routing protocols) to DNS server
    6. demuxed to DNS server
    7. DNS server replies to client with IP address of www.google.ca
  3. to send HTTP request, client first opens TCP socket to web server
    1. TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
    2. web server responds with TCP SYNACK (step 2 in 3-way handshake)
    3. TCP connection established
    4. HTTP request sent into TCP socket
    5. IP datagram containing HTTP request routed to www.google.ca
    6. web server responds with HTTP reply (containing web page)
    7. IP datagram containing HTTP reply routed back to client

CSMA/CD,false,false,1/32/204.8,true,false,doesnotknow,CinterceptA,false,selflearn