Sunteți pe pagina 1din 36

Spring 2017 COMP4621

Computer Communications and Networks


Final Review
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 Link address and ARP
 MAC protocol
 Link level switches

Review 2
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

 point-to-point:  full duplex data:


 one sender, one receiver  bi-directional data flow

 reliable, in-order byte in same connection


 MSS: maximum segment
steam:
size
 no “message boundaries”
 connection-oriented:
 pipelined:
 handshaking (exchange
 TCP congestion and flow
of control msgs) init’s
control set window size sender, receiver state
 send & receive buffers before data exchange
 flow controlled:
 sender will not
application application
writes data reads data
socket socket

overwhelm receiver
door door
TCP TCP
send buffer receive buffer
segment

Review 3
TCP segment structure
32 bits
URG: urgent data counting
(generally not used) source port # dest port #
by bytes
sequence number of data
ACK: ACK #
valid acknowledgement number (not segments!)
head not
PSH: push data now len used
UA P R S F Receive window
(generally not used) # bytes
checksum Urg data pointer
rcvr willing
RST, SYN, FIN: to accept
Options (variable length)
connection estab
(setup, teardown
commands)
application
Internet data
checksum (variable length)
(as in UDP)

Review 4
TCP reliable data transfer
 TCP creates rdt  retransmissions are
service on top of IP’s triggered by:
unreliable service  timeout events
 pipelined segments  three duplicate ACKs
(fast retransmission)
 cumulative ACKs
 TCP uses single
retransmission timer

Review 5
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 Link address and ARP
 MAC protocol
 Link level switches

Review 6
TCP congestion control: bandwidth probing
 “probing for bandwidth”: increase transmission rate
on receipt of ACK, until eventually loss occurs, then
decrease transmission rate
 continue to increase on ACK, decrease on loss (since available
bandwidth is changing, depending on other connections in
network)
ACKs being received,
X loss, so decrease rate
so increase rate
X
X
X
sending rate

TCP’s
X “sawtooth”
behavior

time

 Q: how fast to increase/decrease?


Review 7
TCP Congestion Control: details

 sender limits rate by limiting number


of unACKed bytes “in pipeline”:
LastByteSent-LastByteAcked cwnd
 cwnd: differs from rwnd (how, why?)
 sender limited by min(cwnd,rwnd)
cwnd
 roughly, bytes

cwnd
rate = bytes/sec
RTT
RTT
 cwnd is dynamic, function of
perceived network congestion ACK(s)

Review 8
TCP: congestion avoidance
 when cwnd > ssthresh AIMD
grow cwnd linearly
 ACKs: increase cwnd
 increase cwnd by 1
by 1 MSS per RTT:
MSS per RTT additive increase
 approach possible
 loss: cut cwnd in half
congestion slower (non-timeout-detected
than in slowstart loss ): multiplicative
 implementation: cwnd decrease
= cwnd + MSS/cwnd
for each ACK received AIMD: Additive Increase
Multiplicative Decrease

Review 9
Summary: TCP Congestion Control

 when cwnd < ssthresh, sender in slow-start phase,


window grows exponentially.

 when cwnd >= ssthresh, sender is in congestion-


avoidance phase, window grows linearly.

 when triple duplicate ACK occurs, ssthresh set to


cwnd/2, cwnd set to ~ ssthresh

 when timeout occurs, ssthresh set to cwnd/2,


cwnd set to 1 MSS.

Review 10
Popular “flavors” of TCP
cwnd window size (in segments)

TCP Reno

ssthresh

ssthresh

TCP Tahoe

Transmission round

Review 11
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 Link address and ARP
 MAC protocol
 Link level switches

Review 12
IP datagram format
IP protocol version
32 bits total datagram
number
length (bytes)
header length head. type of
ver length
(bytes) len service
for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
each router) 32 bit source IP address

32 bit destination IP address


upper layer protocol
to deliver payload to Options (if any) E.g. timestamp,
record route
how much overhead data taken, specify
with TCP? (variable length, list of routers
to visit.
 20 bytes of TCP typically a TCP
or UDP segment)
 20 bytes of IP
 = 40 bytes + app
layer overhead
Review 13
IP Fragmentation & Reassembly
 network links have MTU
(max.transfer size) - largest
possible link-level frame.
 different link types, fragmentation:
different MTUs in: one large datagram
 large IP datagram divided out: 3 smaller datagrams
(“fragmented”) within net
 one datagram becomes
several datagrams
reassembly
 “reassembled” only at final
destination
 IP header bits used to
identify, order related
fragments

Review 14
IP Fragmentation and Reassembly
length ID fragflag offset
=4000 =x =0 =0
Example
 4000 byte
One large datagram becomes
datagram several smaller datagrams
 MTU = 1500 bytes
length ID fragflag offset
=1500 =x =1 =0
1480 bytes in
data field length ID fragflag offset
=1500 =x =1 =185
offset =
1480/8 length ID fragflag offset
=1040 =x =0 =370

Review 15
IP Addressing: introduction
 IP address: 32-bit 223.1.1.1

identifier for host, 223.1.2.1


223.1.1.2
router interface 223.1.1.4 223.1.2.9
 interface: connection
223.1.2.2
between host/router 223.1.1.3 223.1.3.27

and physical link


 router’s typically have
multiple interfaces 223.1.3.1 223.1.3.2
 host typically has one
interface
 IP addresses
associated with each 223.1.1.1 = 11011111 00000001 00000001 00000001
interface
223 1 1 1

Review 16
Subnets
 IP address: 223.1.1.1

 subnet part (high 223.1.2.1


223.1.1.2
order bits) 223.1.1.4 223.1.2.9
 host part (low order
bits) 223.1.1.3
223.1.2.2
223.1.3.27
 What’s a subnet ?
subnet
 device interfaces with
same subnet part of IP 223.1.3.1 223.1.3.2
address
 can physically reach
each other without
network consisting of 3 subnets
intervening router, i.e.,
a broadcast domain

Review 17
Subnets 223.1.1.0/24
223.1.2.0/24

Recipe
 To determine the
subnets, detach each
interface from its
host or router,
creating islands of
isolated networks.
Each isolated network
is called a subnet. 223.1.3.0/24

Subnet mask: /24

Review 18
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 Link address and ARP
 MAC protocol
 Link level switches

Review 19
A Link-State Routing Algorithm

Dijkstra’s algorithm Notation:


 net topology, link costs  c(x,y): link cost from node
known to all nodes x to y; = ∞ if not direct
 accomplished via “link neighbors
state broadcast”
 D(v): current value of cost
 all nodes have same info of path from source to
 computes least cost paths dest. v
from one node (‘source”) to
 p(v): predecessor node
all other nodes
along path from source to v
 gives forwarding table
for that node  N': set of nodes whose
least cost path definitively
 iterative: after k
known
iterations, know least cost
path to k dest.’s
Review 20
Dijsktra’s Algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4 if v adjacent to u
5 then D(v) = c(u,v)
6 else D(v) = ∞
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'

Review 21
Distance vector algorithm
Basic idea:
 From time-to-time, each node sends its own
distance vector estimate to neighbors
 Asynchronous
 When a node x receives new DV estimate from
neighbor, it updates its own DV using B-F equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

 Under minor, natural conditions, the estimate


Dx(y) converge to the actual least cost dx(y)

Review 22
Distance Vector Algorithm
Iterative, asynchronous: Each node:
each local iteration caused
by:
 local link cost change wait for (change in local link
 DV update message from cost or msg from neighbor)
neighbor
Distributed:
recompute estimates
 each node notifies
neighbors only when its DV
changes if DV to any dest has
 neighbors then notify
changed, notify neighbors
their neighbors if
necessary

Review 23
Interconnected ASes

3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1  forwarding table
configured by both
intra- and inter-AS
Intra-AS Inter-AS routing algorithm
Routing Routing
algorithm algorithm  intra-AS sets entries
for internal dests
Forwarding
table  inter-AS & intra-As
sets entries for
external dests
Review 24
Inter-AS tasks AS1 must:
 suppose router in AS1 1. learn which dests are
receives datagram reachable through
destined outside of AS2, which through
AS1: AS3
 router should 2. propagate this
forward packet to reachability info to all
gateway router, but routers in AS1
which one? Job of inter-AS routing!

3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
Review 25
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 Link address and ARP
 MAC protocol
 Link level switches

Review 26
MAC Addresses and ARP

 32-bit IP address:
 network-layer address
 used to get datagram to destination IP subnet

 MAC (or LAN or physical or Ethernet)


address:
 function: get frame from one interface to another
physically-connected interface (same network)
 48 bit MAC address (for most LANs)
• burned in NIC ROM, also sometimes software settable

Review 27
ARP: Address Resolution Protocol

Question: how to determine  Each IP node (host,


MAC address of B router) on LAN has
knowing B’s IP address? ARP table
 ARP table: IP/MAC
137.196.7.78
address mappings for
1A-2F-BB-76-09-AD
some LAN nodes
137.196.7.23
137.196.7.14 < IP address; MAC address; TTL>
 TTL (Time To Live): time
LAN after which address
71-65-F7-2B-08-53 mapping will be forgotten
58-23-D7-FA-20-B0
(typically 20 min)

0C-C4-11-6F-E3-98
137.196.7.88

Review 28
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 RIP, OSPF and BGP
 Link address and ARP
 MAC protocol
 Link level switches

Review 29
MAC Protocols: a taxonomy
Three broad classes:
 Channel Partitioning
 divide channel into smaller “pieces” (time slots,
frequency, code)
 allocate piece to node for exclusive use
 Random Access
 channel not divided, allow collisions
 “recover” from collisions

 “Taking turns”
 nodes take turns, but nodes with more to send can take
longer turns

Review 30
CSMA (Carrier Sense Multiple Access)

CSMA: listen before transmit:


 If channel sensed idle: transmit entire frame
 If channel sensed busy, defer transmission

CD: listen after transmit for collision detection


 collisions detected within short time
 colliding transmissions aborted, reducing channel
wastage

Review 31
CSMA/CD collision detection

Review 32
Outline
 TCP
 TCP congestion control
 IP
 Routing algorithms
 RIP, OSPF and BGP
 Link address and ARP
 MAC protocol
 Link level switches

Review 33
Switch
 link-layer device: smarter than hubs, take
active role
 store, forward Ethernet frames
 examine incoming frame’s MAC address,
selectively forward frame to one-or-more
outgoing links when frame is to be forwarded on
segment, uses CSMA/CD to access segment
 transparent
 hosts are unaware of presence of switches

 plug-and-play, self-learning
 switches do not need to be configured

Review 34
Switch: self-learning Source: A
Dest: A’

A A A’

 switch learns which hosts


C’
can be reached through B

which interfaces
1 2
 when frame received, 6 3
switch “learns” location of 4
5
sender: incoming LAN
segment C
 records sender/location
pair in switch table B’
A’

MAC addr interface TTL

A 1 60 Switch table
(initially empty)

Review 35
Switch: frame filtering/forwarding
When frame received:

1. record link associated with sending host


2. index switch table using MAC dest address
3. if entry found for destination
then {
if dest on segment from which frame arrived
then drop the frame
else forward the frame on interface indicated
}
else flood forward on all but the interface
on which the frame arrived
Review 36

S-ar putea să vă placă și