Title: Part 0: Networking Review
1Part 0 Networking Review
- Goals
- review key topics from intro networks course
- equalize backgrounds
- identify remedial work
- ease into course
- Overview
- overview
- error control
- flow control
- congestion control
- routing
- LANs
- addressing
- synthesis
- a day in the life
- control timescales
2Error control
- reliable point-point communication
- generic problem app-to-app, over path, over link
- error model?
- bits flipped in packet
- packets lost
- packets delayed or reordered
3Bit level error detection
- EDC Error Detection and Correction bits
(redundancy) - D Data protected by error checking, may
include header fields - Error detection not 100 reliable!
- protocol may miss some errors, but rarely
- larger EDC field yields better detection and
correction
4Parity Checking
Two Dimensional Bit Parity Detect and correct
single bit errors
Single Bit Parity Detect single bit errors
Much more powerful error detection/correction
schemes Cyclic Redundancy Check (CRC)
0
0
Simple form of forward error correction (FEC)
5Internet checksum
- Goal detect errors (e.g., flipped bits) in
transmitted segment (note used at transport
layer only)
- Receiver
- compute checksum of received segment
- check if computed checksum equals checksum field
value - NO - error detected
- YES - no error detected. But maybe errors
nonetheless?
- Sender
- treat segment contents as sequence of 16-bit
integers - checksum addition (1s complement sum) of
segment contents - sender puts checksum value into UDP checksum
field
6Recovering from lost packets
- why are packets lost?
- limited storage, discarded in congestion
- outages eventually reroute around failure (sec
recovery times hopefully) - dropped at end system e.g., on NIC
- ARQ automatic request repeat
- sender puts sequence numbers on packets (why)
- receiver positively or negatively acknowledges
correct receipt of packet - sender starts (logical) timer for each packet,
timeout and retransmits
7rdt3.0 channels with errors and loss
Reference section 3.4 in KR
- Approach sender waits reasonable amount of
time for ACK - retransmits if no ACK received in this time
- if pkt (or ACK) just delayed (not lost)
- retransmission will be duplicate, but use of 0,1
seq. s already handles this - receiver must specify seq of pkt being ACKed
- requires countdown timer
- Assumption underlying channel can corrupt, lose
packets (data or ACKs) - need checksum, seq. , ACKs, retransmissions,
timer - seq s
- detect reordering
- ACK, NAKing
- detect missing packet
- duplicate detection due to retransmissions
8rdt3.0 sender
rdt_send(data)
rdt_rcv(rcvpkt) ( corrupt(rcvpkt)
isACK(rcvpkt,1) )
sndpkt make_pkt(0, data, checksum) udt_send(sndp
kt) start_timer
L
rdt_rcv(rcvpkt)
L
wait for call from above
timeout
0
udt_send(sndpkt) start_timer
rdt_rcv(rcvpkt) notcorrupt(rcvpkt)
isACK(rcvpkt,1)
rdt_rcv(rcvpkt) notcorrupt(rcvpkt)
isACK(rcvpkt,0)
stop_timer
stop_timer
wait for call from above
timeout
1
udt_send(sndpkt) start_timer
rdt_rcv(rcvpkt)
L
rdt_send(data)
rdt_rcv(rcvpkt) ( corrupt(rcvpkt)
isACK(rcvpkt,0) )
sndpkt make_pkt(1, data, checksum) udt_send(sndp
kt) start_timer
L
FSM specification of sender (details not
important)
9rdt3.0 in action
10rdt3.0 in action
11Forward error control
- add redundancy to recover from losses
original file (n blocks)
encoding
infinite number of blocks
lossy channel
receive n(1e) blocks
decoding
recover file
12Forward error control
- rateless codes allow infinite code blocks
- LT/Rapture codes
- e controls computation cost, BW usage
- used for video delivery large file transfers
13Part 0 Networking Review
- Goals
- review key topics from intro networks course
- equalize backgrounds
- identify remedial work
- ease into course
- Overview
- overview
- error control
- flow control
- congestion control
- routing
- LANs
- addressing
- synthesis
- a day in the life
- control timescales
14Flow Control (in TCP)
- receiver explicitly informs sender of
(dynamically changing) amount of free buffer
space - RcvWindow field in TCP segment
- sender keeps the amount of transmitted, unACKed
data less than most recently received RcvWindow
RcvBuffer size of TCP Receive Buffer RcvWindow
amount of spare room in Buffer
receiver buffering
15Principles of Congestion Control
- Congestion
- informally too many sources sending too much
data too fast for network to handle - different from flow control!
- manifestations
- lost packets (buffer overflow at routers)
- long delays (queueing in router buffers)
16Causes/costs of congestion scenario 1
- two senders, two receivers
- one router, infinite buffers
- no retransmission
- large delays when congested
- maximum achievable throughput
17Causes/costs of congestion scenario 2
- one router, finite buffers
- sender retransmission of lost packet
Host A
lout
lin original data
l'in original data, plus retransmitted data
lout original data, duplicates
Host B
finite shared output link buffers
18Causes/costs of congestion scenario 2
- always (goodput)
- perfect retransmission only when loss
- retransmission of delayed (not lost) packet makes
larger (than perfect case) than
- costs of congestion
- more work (retrans) for given goodput
- unneeded retransmissions link carries multiple
copies of pkt
19Causes/costs of congestion scenario 3
- four senders
- multihop paths
- timeout/retransmit
Q what happens as and increase ?
lout
lin original data
l'in original data, plus retransmitted data
finite shared output link buffers
20Causes/costs of congestion scenario 3
lout
- Another cost of congestion
- when packet dropped, any upstream transmission
capacity used for that packet was wasted!
21Approaches towards congestion control
Two broad approaches towards congestion control
- Network-assisted congestion control
- routers provide feedback to end systems
- single bit indicating congestion (SNA, DECbit,
TCP/IP ECN, ATM) - explicit rate sender should send at
- End-end congestion control
- no explicit feedback from network
- congestion inferred from end-system observed
loss, delay - approach taken by TCP
22Case study ATM ABR congestion control
- ABR available bit rate
- elastic service
- if senders path underloaded
- sender should use available bandwidth
- if senders path congested
- sender throttled to minimum guaranteed rate
- RM (resource management) cells
- sent by sender, interspersed with data cells
- bits in RM cell set by switches
(network-assisted) - NI bit no increase in rate (mild congestion)
- CI bit congestion indication
- RM cells returned to sender by receiver, with
bits intact -
23Case study ATM ABR congestion control
- two-byte ER (explicit rate) field in RM cell
- congested switch may lower ER value in cell
- sender send rate thus minimum supportable rate
on path - EFCI bit in data cells set to 1 in congested
switch - if data cell preceding RM cell has EFCI set,
sender sets CI bit in returned RM cell
24TCP Congestion Control
- end-end control (no network assistance)
- transmission rate limited by congestion window
size, Congwin, over segments
Congwin
25TCP congestion control
- two phases
- slow start
- congestion avoidance
- important variables
- Congwin
- threshold defines threshold between two slow
start phase, congestion control phase
- probing for usable bandwidth
- ideally transmit as fast as possible (Congwin as
large as possible) without loss - increase Congwin until loss (congestion)
- loss decrease Congwin, then begin probing
(increasing) again
26TCP Slowstart
Host A
Host B
one segment
RTT
initialize Congwin 1 for (each segment ACKed)
Congwin until (loss event OR
CongWin gt threshold)
two segments
four segments
- exponential increase (per RTT) in window size
(not so slow!) - loss event timeout (Tahoe TCP) and/or or three
duplicate ACKs (Reno TCP)
27TCP Congestion Avoidance Tahoe
TCP Tahoe Congestion avoidance
/ slowstart is over / / Congwin gt
threshold / Until (loss event) every Congwin
segments ACKed Congwin threshold
Congwin/2 Congwin 1 perform slowstart
Numerous improvements TCP Reno, SACK
28Part 0 Networking Review
- Goals
- review key topics from intro networks course
- equalize backgrounds
- identify remedial work
- ease into course
- Overview
- overview
- error control
- flow control
- congestion control
- routing (and network layer services)
- LANs
- addressing
- synthesis
- a day in the life
- control timescales
29Network layer functions
- transport packet from sending to receiving hosts
- network layer protocols in every host, router
- three important functions
- path determination route taken by packets from
source to dest. Routing algorithms - switching move packets from routers input to
appropriate router output - call setup some network architectures require
router call setup along path before data flows
30Network service model
CRUCIAL question!
- Q What service model for channel transporting
packets from sender to receiver? - guaranteed bandwidth?
- preservation of inter-packet timing (no jitter)?
- loss-free delivery?
- in-order delivery?
- congestion feedback to sender?
The most important abstraction provided by
network layer
?
?
virtual circuit or datagram?
?
service abstraction
31Virtual circuits
- source-to-dest path behaves much like telephone
circuit - performance-wise
- network actions along source-to-dest path
- call setup, teardown for each call before data
can flow - each packet carries VC identifier (not
destination host ID) - every router on source-dest path maintains
state for each passing connection - transport-layer connection only involved two end
systems - link, router resources (bandwidth, buffers) may
be allocated to VC - to get circuit-like perf.
32Virtual circuits signaling protocols
- used to set up, maintain teardown VC
- used in ATM, frame-relay, X.25
- not used in todays Internet
6. Receive data
5. Data flow begins
4. Call connected
3. Accept call
1. Initiate call
2. incoming call
33Datagram networks the Internet model
- no call setup at network layer
- routers no state about end-to-end connections
- no network-level concept of connection
- packets typically routed using destination host
ID - packets between same source-dest pair may take
different paths
1. Send data
2. Receive data
34Datagram or VC network why?
- Internet
- data exchange among computers
- elastic service, no strict timing req.
- smart end systems (computers)
- can adapt, perform control, error recovery
- simple inside network, complexity at edge
- many link types
- different characteristics
- uniform service difficult
- ATM
- evolved from telephony
- human conversation
- strict timing, reliability requirements
- need for guaranteed service
- dumb end systems
- telephones
- complexity inside network
35Routing
5
Goal determine good path (sequence of routers)
thru network from source to dest.
3
5
2
2
1
3
- Graph abstraction for routing algorithms
- graph nodes are routers
- graph edges are physical links
- link cost delay, cost, or congestion level
1
2
1
- good path
- typically means minimum cost path
- other defs possible
36Routing only two approaches used in practice
- Global
- all routers have complete topology, link cost
info - link state algorithms use Dijkstras algorithm
to find shortest path from given router to all
destinations - Decentralized
- router knows physically-connected neighbors, link
costs to neighbors - iterative process of computation, exchange of
info with neighbors - distance vector algorithms
- a self-stabilizing algorithm (well see these
later)
37Distance Vector Routing Algorithm
- iterative
- continues until no nodes exchange info.
- self-terminating no signal to stop
- asynchronous
- nodes need not exchange info/iterate in lock
step! - distributed
- each node communicates only with
directly-attached neighbors
Each node
38Hierarchical Routing
- Our routing review thus far - idealization
- all routers identical
- network flat
- not true in practice
- scale with 200 million destinations
- cant store all dests in routing tables!
- routing table exchange would swamp links!
- administrative autonomy
- internet network of networks
- each network admin may want to control routing in
its own network
39Hierarchical Routing
- aggregate routers into regions, autonomous
systems (AS) - routers in same AS run same routing protocol
- intra-AS routing protocol
- routers in different AS can run different
intra-AS routing protocol
- special routers in AS
- run intra-AS routing protocol with all other
routers in AS - also responsible for routing to destinations
outside AS - run inter-AS routing protocol with other gateway
routers
40Intra-AS and Inter-AS routing
- Gateways
- perform inter-AS routing amongst themselves
- perform intra-AS routers with other routers in
their AS
a
B
41Intra-AS and Inter-AS routing
Internet BGP
Host h2
Intra-AS routing within AS B
Intra-AS routing within AS A
Internet OSPF, IS-IS, RIP
42Addressing
- whats an address?
- identifier that differentiates between me and
someone else, and also helps route data to/from
me - real world examples of addressing?
- mailing address
- office , floor, etc
- phone
43Addressing network layer
223.1.1.1
- IP address 32-bit identifier for host, router
interface - interface connection between host, router and
physical link - routers typically have multiple interfaces
- host may have multiple interfaces
- IP addresses associated with interface, not host,
router
223.1.2.9
223.1.1.4
223.1.1.3
223.1.1.1 11011111 00000001 00000001 00000001
223
1
1
1
44IP Addressing
223.1.1.1
- IP address
- network part (high order bits)
- host part (low order bits)
- whats a network ? (from IP address perspective)
- device interfaces with same network part of IP
address - can physically reach each other without
intervening router
223.1.2.1
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
223.1.1.3
223.1.3.27
LAN
223.1.3.2
223.1.3.1
network consisting of 3 IP networks (for IP
addresses starting with 223, first 24 bits are
network address)
45IP addresses how to get one?
- Q How does host get IP address?
- hard-coded by system admin in a file
- Wintel control-panel-gtnetwork-gtconfiguration-gttcp
/ip-gtproperties - UNIX /etc/rc.config
- DHCP Dynamic Host Configuration Protocol
dynamically get address plug-and-play - host broadcasts DHCP discover msg
- DHCP server responds with DHCP offer msg
- host requests IP address DHCP request msg
- DHCP server sends address DHCP ack msg
46Part 0 Networking Review
- Goals
- review key topics from intro networks course
- equalize backgrounds
- identify remedial work
- ease into course
- Overview
- overview
- error control
- flow control
- congestion control
- routing
- LANs
- addressing (cont.)
- synthesis
- a day in the life
- control timescales
47Link Layer setting the context
48Link Layer setting the context
- two physically connected devices
- host-router, router-router, host-host
- unit of data frame
network link physical
data link protocol
M
frame
phys. link
adapter card
49Link Layer Services
- framing, link access
- encapsulate datagram into frame, adding header,
trailer - implement channel access if shared medium (e.g.,
Ethernet) - physical addresses used in frame headers to
identify source, dest - different from IP address!
- reliable delivery between two physically
connected devices - flow control
- error detection/congestion
50LAN Addresses and ARP
- 32-bit IP address
- network-layer address
- used to get datagram to destination network
(recall IP network definition) - LAN (or MAC or physical) address
- used to get frame from one interface to another
physically-connected interface (same network) - 48 bit MAC address (for most LANs) burned in the
adapter ROM - WHY MAC and Internet addresses separate?
- IP addresses depend on network that youre on
- MAC address in hardware makes it faster
- Permanent unique identifier worldwide, forever
- What about networks without IP addresses?
51LAN Addresses
Each adapter on LAN has unique LAN address
- LAN (or MAC or physical) address
- used to get datagram from one interface to
another physically-connected interface (same
network) - 48 bit MAC address (for most LANs) burned in the
adapter ROM
52LAN Address (more)
- MAC address allocation administered by IEEE
- manufacturer buys portion of MAC address space
(to assure uniqueness) - analogy
- (a) MAC address like Social Security
Number - (b) IP address like postal address
- MAC flat address gt portability
- can move LAN card from one LAN to another
- IP hierarchical address NOT portable
- depends on network to which one attaches
53From IP to MAC addresses
- Starting at A, given IP datagram addressed to B
- look up net. address of B, find B on same net. as
A - link layer sends datagram to B inside link-layer
frame
223.1.1.1
223.1.2.1
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
223.1.1.3
223.1.3.27
223.1.3.2
223.1.3.1
frame source, dest address
datagram source, dest address
As IP addr
Bs IP addr
Bs MAC addr
As MAC addr
IP payload
datagram
frame
54ARP protocol
- A knows B's IP address, wants to learn physical
address of B - A broadcasts ARP query pkt, containing B's IP
address - all machines on LAN receive ARP query
- B receives ARP packet, replies to A with its
(B's) physical layer address - A caches (saves) IP-to-physical address pairs
until information becomes old (times out) - soft state information that times out (goes
away) unless refreshed
55Part 0 Networking Review
- Goals
- review key topics from intro networks course
- equalize backgrounds
- identify remedial work
- ease into course
- Overview
- overview
- error control
- flow control
- congestion control
- routing
- LANs
- addressing (cont.)
- synthesis
- a day in the life
- control timescales
56Synthesis which protocols involved?
www browser downloads page
57Protocols involved in http GET
- user types in a URL, what happens?
- DNS translate hostname to IP address
- via DHCP, source has IP address of DNS server
(suppose DNS server on same network segment) - create DNS query, pass to UDP, create UDP segment
containing DNS query, pass to IP on host - look in routing table (DHCP gave me default
router), recognize that DNS server on same
network. - use ARP to determine MAC address of DNS server
- Ethernet used to send frame to DNS server on
physically connected wire (network segment,
ethernet cable) - on DNS machine ethernet-gtIP-gtUDP. UDP looks at
dest port , sees it is DNS, passes DNS query to
DNS application. (assume DNS knows IP addresses
of hostname in original URL - address found!) - DNS server sends UDP reply back to orginating
machine
58Protocols involved in http GET
- browser now has IP address of GET destination
server - need to establish TCP connection to server, send
SYN packet (will get an SYNACK back,
eventuallly.) - SYN packet down to network layer, with IP address
of server. Since server destined off my
network, SYN packet goes through router. - look in routing table, see that destination off
network, need to send to default gateway (to
get off my net) - use ARP to get MAC address of default gateway,
create Ethernet frame with gateway MAC address,
containing IP packet containing TCP segment,
containing SYN - IMPORTANT to realize that while the Ethernet
frame containing the IP datagram that contains
the TCP SYN has as its destination address the
MAC address of the router, the IP datagram
(still) has as destination address the IP address
of the remote www server
59Protocols involved in http GET
- Router receives Ethernet frame (frame addressed
to router), looks at IP datagram, sees that IP
datagram not addressed to itself (IP datagram
addressed to server). Router knows it must
forward IP datagram to next hop router along path
to eventual destination. - Router checks routing tables (table values
populated using intra, possibly inter-, domain
routing protocols like OSPF, RIP, IS-IS, BGP
(inter). Get IP address of next hop router. - Router puts IP packets in Ethernet frame,
Ethernet frame addressed to next hop router. MAC
address of next hop router determined by ARP.
Frame sent to next hop router. - Network management shoehorn arriving packets at
interface cause SNMP MIB variable for arriving
IP datagrams to be incremented - Forwarding continues until IP datagram containing
TCP SYN eventually arrives at destination,
gaia.cs.umass.edu (128.119.30.30) - Up to IP, demultiplex from Ethernet to IP using
Ethernet TYPE field to identify IP as upper layer
protocol - From IP to TCP using protocol field of IP
datagram, - SYN packet arrives at gaia TCP (FINALLY)
60Protocols involved in http GET
- So . SYN has arrived at gaia. Gaia returns
SYNACK to initial sender - Gaia gets synack, ready to send data.
- HTTP GET message now sent to gaia.cs.umass.edu in
TCP segment, in IP datagram, in Ethernet frame,
along hops to gaia.cs.umass.edu - GET arrives! REPLY formulated by http server
and sent
61Next Common network/protocol functions
- Goals
- identify, study common architectural components,
protocol mechanisms - synthesis big picture
- depth important topics not covered in an intro
course
- Overview
- signaling telephone net, Internet, ATM net
- state mangement (signaling)
- randomization
- indirection
- multiplexing
- virtualization
- design for scale