0% found this document useful (0 votes)
69 views

Computer Communication Networks: Midterm Review

The document provides instructions and an overview of topics for a midterm exam on computer communication networks. It includes 3 main sections: exam instructions, foundational topics that will be covered such as the TCP/IP stack and packet switching vs circuit switching, and additional details on specific topics like sockets and quality of service.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Computer Communication Networks: Midterm Review

The document provides instructions and an overview of topics for a midterm exam on computer communication networks. It includes 3 main sections: exam instructions, foundational topics that will be covered such as the TCP/IP stack and packet switching vs circuit switching, and additional details on specific topics like sockets and quality of service.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Computer Communication

Networks

Midterm Review
ICEN/ICSI 416 – Fall 2016
Prof. Dola Saha
1
Instructions
Ø Put your name and student id on each sheet of paper!
Ø The exam is closed book. You cannot use any computer or phone during
the exam. You can use calculator, but not one from your phone or
laptop.
Ø You have 60 minutes to complete the exam. Be a smart exam taker - if
you get stuck on one problem go on to another problem.
Ø The total number of points for each question is given in parenthesis.
There are 100 points total.
Ø Show all your work. Partial credit is possible for an answer, but only if
you show the intermediate steps in obtaining the answer. If you make a
mistake, it will also help the grader show you where you made a
mistake.

2
What is included?
Ø Foundation
Ø Application Layer
Ø Transport Layer

Ø The material covered by Prof. Hany Elgala will NOT be


included in the midterm.

3
Packet Switching vs Circuit Switching
R = 100 Mb/s C
A
D
R = 1.5 Mb/s
B
queue of packets E
waiting for output link

Ø Advantages
Ø Disadvantages

4
Internet Protocol Stack
Ø application: supporting network applications
§ FTP, SMTP, HTTP
application
Ø transport: process-process data transfer
§ TCP, UDP transport
Ø network: routing of datagrams from source
network
to destination
§ IP, routing protocols link
Ø link: data transfer between neighboring
physical
network elements
§ Ethernet, 802.11 (WiFi)
Ø physical: bits “on the wire” / “over the air”
5
Encapsulation
message M application
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical

source link
physical

switch

destination
Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport
physical
Hn Ht M network
Hl Hn Ht M link
router
physical
6
Socket
Ø What is a socket?
§ The point where a local application process attaches to the
network
§ An interface between an application and the network
§ An application creates the socket

Ø The interface defines operations for


§ Creating a socket
§ Attaching a socket to the network
§ Sending and receiving messages through the socket
§ Closing the socket
7
Socket programming
Two socket types for two transport services:
§ UDP: unreliable datagram

§ TCP: reliable, byte stream-oriented

§ Server side:
o DO NOT specify IP Address

o By not specifying an IP Address, the application program is


willing to accept connections on any of local hosts IP
Addresses

8
Performance
Ø Bandwidth
§ Width of the frequency band
§ Number of bits per second that can be transmitted over a
communication link
§ 1 Mbps: 1 x 106 bits/second = 1x220 bits/sec
Ø Delay
§ Time elapsed for a packet to travel from a sender to receiver
§ seconds

9
Four Sources of Packet Delay
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop

dproc: nodal processing dqueue: queueing delay


§ check bit errors § time waiting at output link for
transmission
§ determine output link § depends on congestion level of
§ typically < msec router
10
Four Sources of Packet Delay
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop

dtrans: transmission delay: dprop: propagation delay:


§ L: packet length (bits) § d: length of physical link
§ R: link bandwidth (bps) § s: propagation speed in medium (~2x108
§ dtrans = L/R m/sec)
dtrans and dprop § dprop = d/s
very different
11
Round Trip Time (RTT)
Ø Time:
§ From packet starting to leave a node
§ To response came back to the same node

ßACK

12
Performance
Ø Latency = Propagation + processing + transmit + queue
Ø Propagation = distance/speed of light
Ø Transmit = size/bandwidth
Ø Processing = depends on the node (hardware + software), but
fairly constant
Ø Queue = congestion in the node à changes with time

Ø One bit transmission => propagation is important


Ø Large bytes transmission => bandwidth is important

13
Delay X Bandwidth
Ø We think the channel between a pair of processes as a hollow pipe
Ø Latency (delay) length of the pipe and bandwidth the width of the pipe
Ø Delay of 50 ms and bandwidth of 45 Mbps
§ 50 x 10-3 seconds x 45 x 106 bits/second
§ 2.25 x 106 bits = 280 KB data.
Ø Significance
§ This represents the maximum amount of data the sender can send before it would be
possible to receive a response

Network as a pipe
14
Persistent and non-persistent HTTP
non-persistent HTTP issues: persistent HTTP:
Ø requires 2 RTTs per object Ø server leaves connection
Ø OS overhead for each TCP open after sending response
connection Ø subsequent HTTP messages
Ø browsers often open between same client/server
parallel TCP connections to sent over open connection
fetch referenced objects Ø client sends requests as
soon as it encounters a
referenced object
Ø as little as one RTT for all
the referenced objects
15
Digital Audio (1)
Ø ADC (Analog-to-Digital Converter) produces digital audio
from a microphone
§ Telephone: 8000 8-bit samples/second (64 Kbps); computer audio is
usually better quality (e.g., 16 bit)

ADC

Continuous audio Digital audio


(sine wave) (sampled, 4-bit quantized)

16
Digital Video (3)
Ø Step 1: Pixels are mapped to luminance
(brightness)/chrominance (YCbCr) color space
§ Luma signal (Y), Chroma signal: 2 components (Cb and Cr)
§ Chrominance is sub-sampled, the eye is less sensitive to chrominance

Input 24-bit RGB pixels 8-bit luminance 8-bit chrominances for


pixels every 4 pixels 17
Streaming Stored Media (5)
Ø Interleaving spreads nearby media samples over different
transmissions to reduce the impact of loss

Packet
stream

Media
samples

Loss reduces temporal resolution; doesn’t leave a gap


18
DNS name resolution example
Ø host at cis.poly.edu wants IP root DNS server
address for gaia.cs.umass.edu
2
3
TLD DNS server
4

iterated query: 5
§ contacted server replies local DNS server
with name of server to dns.poly.edu
contact 7 6
§ “I don’t know this name, but 1 8
ask this server”
authoritative DNS server
dns.cs.umass.edu
requesting host
cis.poly.edu

gaia.cs.umass.edu 19
Infrastructure Services
Ø Name Resolution

Name resolution in practice, where the numbers 1–10 show the


sequence of steps in the process.

20
BitTorrent: requesting, sending file chunks
requesting chunks: sending chunks: tit-for-tat
§ at any given time, different peers
have different subsets of file § Alice sends chunks to those four peers
currently sending her chunks at
chunks highest rate
§ periodically, Alice asks each peer • other peers are choked by Alice
for list of chunks that they have (do not receive chunks from her)
• re-evaluate top 4 every 10 secs
§ Alice requests missing chunks
from peers, rarest first § every 30 secs: randomly select
another peer, starts sending chunks
• “optimistically unchoke” this
peer
• newly chosen peer may join top 4

21
BitTorrent: tit-for-tat
(1) Alice “optimistically unchokes” Bob
(2) Alice becomes one of Bob’s top-four providers; Bob reciprocates
(3) Bob becomes one of Alice’s top-four providers

higher upload rate: find better trading


partners, get file faster !

22
BitTorrent: another aspect

Peers in a BitTorrent swarm download from other peers that


may not yet have the complete file

23
UDP: User Datagram Protocol [RFC 768]
Ø “no frills,” “bare bones” Ø UDP use:
Internet transport § streaming multimedia apps
protocol (loss tolerant, rate sensitive)
§ DNS
Ø “best effort” service, UDP
§ SNMP
segments may be:
• lost
Ø reliable transfer over
• delivered out-of-order to app UDP:
§ add reliability at application
Ø connectionless:
layer
• no handshaking between UDP § application-specific error
sender, receiver recovery!
• each UDP segment handled
independently of others
24
UDP: segment header
length, in bytes of UDP
32 bits segment, including header
source port # dest port #
length checksum
why is there a UDP?
§ no connection establishment
application
data
(which can add delay)
(payload) § simple: no connection state at
sender, receiver
§ small header size
UDP segment format § no congestion control: UDP can
blast away as fast as desired

25
rdt3.0: stop-and-wait operation
sender receiver
first packet bit transmitted, t = 0
last packet bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK

ACK arrives, send next


packet, t = RTT + L / R

U L/R .008
sender = = = 0.00027
RTT + L / R 30.008

26
Pipelined protocols
pipelining: sender allows multiple, “in-flight”, yet-to-be-
acknowledged pkts
• range of sequence numbers must be increased
• buffering at sender and/or receiver

§two generic forms of pipelined protocols: go-Back-N,


selective repeat
27
Pipelining: increased utilization
sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R

first packet bit arrives


RTT last packet bit arrives, send ACK
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
ACK arrives, send next
packet, t = RTT + L / R
3-packet pipelining increases
utilization by a factor of 3!

U 3L / R .0024
sender = = = 0.00081
RTT + L / R 30.008

28
Pipelined protocols: overview
Go-back-N: Selective Repeat:
§ sender can have up to N § sender can have up to N
unacked packets in unack’ed packets in
pipeline pipeline
§ receiver only sends § rcvr sends individual ack
cumulative ack for each packet
• doesn’t ack packet if there’s a
gap
§ sender has timer for § sender maintains timer for
oldest unacked packet each unacked packet
• when timer expires, retransmit • when timer expires, retransmit
only that unacked packet
all unacked packets

29
GBN in action
sender window (N=4) sender receiver
0 1 2 3 45678 send pkt0
0 1 2 3 45678 send pkt1
send pkt2 receive pkt0, send ack0
0 1 2 3 45678
send pkt3 X loss receive pkt1, send ack1
0 1 2 3 45678
(wait)
receive pkt3, discard,
0 1 2 3 4 5 678 rcv ack0, send pkt4 (re)send ack1
0 1 2 3 4 5 678 rcv ack1, send pkt5 receive pkt4, discard,
(re)send ack1
ignore duplicate ACK (ack1) receive pkt5, discard,
(re)send ack1
pkt 2 timeout
01 2 3 4 5 678 send pkt2
01 2 3 4 5 678 send pkt3
01 2 3 4 5 678 send pkt4 rcv pkt2, deliver, send ack2
01 2 3 4 5 678 send pkt5 rcv pkt3, deliver, send ack3
rcv pkt4, deliver, send ack4
rcv pkt5, deliver, send ack5

30
Selective repeat in action
sender window (N=4) sender receiver
0 1 2 3 45678 send pkt0
0 1 2 3 45678 send pkt1
send pkt2 receive pkt0, send ack0
0 1 2 3 45678
send pkt3 X loss receive pkt1, send ack1
0 1 2 3 45678
(wait)
receive pkt3, buffer,
0 1 2 3 4 5 678 rcv ack0, send pkt4 send ack3
0 1 2 3 4 5 678 rcv ack1, send pkt5 receive pkt4, buffer,
send ack4
record ack3 arrived receive pkt5, buffer,
send ack5
pkt 2 timeout
0 1 2 3 4 5 678 send pkt2
0 1 2 3 4 5 678 record ack4 arrived
0 1 2 3 4 5 678 rcv pkt2; deliver pkt2,
record ack5 arrived
0 1 2 3 4 5 678 pkt3, pkt4, pkt5; send ack2

Q: what happens when ack2 arrives?

31
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
UAPR S F receive window
(generally not used) # bytes
checksum Urg data pointer rcvr willing
RST, SYN, FIN: options (variable length) to accept
connection estab
(setup, teardown
commands)
application
Internet data
checksum (variable length)
(as in UDP)

32
TCP seq. numbers, ACKs
outgoing segment from sender
sequence numbers: source port # dest port #

• byte stream “number” of first sequence number


acknowledgement number
byte in segment’s data rwnd
checksum urg pointer
acknowledgements: window size
N
• seq # of next byte expected
from other side
sender sequence number space
• cumulative ACK
Q: how receiver handles out-of- sent sent, not-yet usable not
ACKed ACKed but not usable
order segments (“in-flight”) yet sent

• A: TCP spec doesn’t say, - up to incoming segment to sender


implementor source port #
sequence number
dest port #

acknowledgement number
A rwnd
checksum urg pointer

33
TCP round trip time, timeout
Q: how to set TCP timeout Q: how to estimate RTT?
value? § SampleRTT: measured time
from segment transmission until
§ longer than RTT ACK receipt
• but RTT varies
• ignore retransmissions
§ too short: premature § SampleRTT will vary, want
timeout, unnecessary estimated RTT “smoother”
retransmissions • average several recent
§ too long: slow reaction to measurements, not just current
segment loss SampleRTT

34
TCP round trip time, timeout
EstimatedRTT = (1- a)*EstimatedRTT + a*SampleRTT
§ exponential weighted moving average
§ influence of past sample decreases exponentially fast
§ typical value: a = 0.125
RTT: gaia.cs.umass.edu to fantasia.eurecom.fr

350

RTT: gaia.cs.umass.edu to fantasia.eurecom.fr


300
RTT (milliseconds)

250
RTT (milliseconds)

200

150
sampleRTT
EstimatedRTT
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106

time (seconds)
time (seconnds)

Timeout = 2*EstimatedRTT SampleRTT Estimated RTT

35
Jacobson/Karels Algorithm
§ timeout interval: EstimatedRTT plus “safety margin”
• large variation in EstimatedRTT -> larger safety margin
§ estimate SampleRTT deviation from EstimatedRTT:
§ RFC 6298

Measure of variability
DevRTT = (1-b)*DevRTT +
b*(|SampleRTT-EstimatedRTT| )
(typically, b = 0.25)

TimeoutInterval = EstimatedRTT + 4*DevRTT

estimated RTT
“safety margin”
36
TCP Reno
80 Slow Start Congestion Avoidance Congestion Avoidance Slow Start
ssthresh = 64
70
Round: Packet #
1: P1
60 ssthresh = cwnd/2 = 36
2: P2, P3
3: P4-P7
Congestion Window Size

50 4: P8-P15 Triple Duplicate ACK

40 ssthresh =
cwnd/2 = 26
30 Timeout

20 cwnd =
cwnd/2
10

0
1 6 11 16 21 26 31
Transmission Rounds

37
Good Luck!!!

38

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy