Data Communication
Data Communication
Networking
2017-2018 Fall
WINS Lab
2017-2018 Fall
Courseware
Section 1
Courseware
Courseware
Logistics
Lecturer
I Ertan Onur
I Room: Z019 (WINS Lab) or B211 (Dept. of Computer Eng.)
I Tel: +90 (312) 210 5534
I Email: [email protected]
I Office Hours: (Fridays) 09:30-10:30 and by appointment
Teaching Assistants
Communication
Textbook
Textbook
Kurose, J.F. and Ross, K.W., Computer
Networking: A Top-down Approach, 6th
Ed., Pearson, 2013
(http://www.pearsonhighered.com/
kurose-ross/)
Supplemental Book
Tanenbaum, A. S. and Wetherall, D.,
Computer Networks, 5th Ed., Prentice Hall,
2011 (http://computernetworks5e.org)
Intended Audience
Disclaimer
Course Objectives
Course Outline
Rules
Section 2
What is This?
Scope
We are focusing on networking that is in the middle. Networks enable
distributed applications by using and organizing the
communication technologies.
Example:
I millions of connected
computing devices: hosts (end
systems) running network
applications
I communication links (fiber,
copper, radio, satellite) with a
transmission rate (bandwidth)
I Packet switches and routers:
forward packets (chunks of
data)
I Internet: “network of
networks”: Interconnected
Internet Service Providers
(ISP)
I protocols control sending,
receiving of messages; e.g.,
TCP, IP, HTTP, Skype, 802.11
I Internet standards; RFC:
Request for comments, IETF:
Internet Engineering Task
Force
What is a Protocol?
What is a Protocol?
Definition of Protocol
A protocol defines the format and the order of messages exchanged
between two or more communicating entities, as well as the actions
taken on the transmission and/or receipt of a message or other event.
PAIR UP and
DISCUSS
Typical answer
I Collisions, two or more students talking
simultaneously; medium reservation for
avoiding collisions.
PAIR UP and
I Raise the hand, get permission from lecturer,
DISCUSS
ask, listen, ack.
PAIR UP and
DISCUSS
Typical answer
PAIR UP and I Discovering neighbors, learning the topology,
DISCUSS routing decisions, ...
I Routing protocols
Network Edge
End-system Interaction
Network Edge
Access Network
Network Edge
Access Network
Access Network
The network that physically connects an end system to the first router
-also known as the “edge router”- on a path from the end system to
any other distant end system
Examples:
I Home Access: DSL, Cable, FTTH, Dial-Up, and Satellite
I Access in the Enterprise (and the Home): Ethernet and WiFi
I Wide-Area Wireless Access: 3G and LTE
Network Edge
Digital Subscriber Line (DSL) Internet Access
Network Edge
A Hybrid Fiber Coaxial access Network
Network Edge
Fiber to The Home (FTTH)
Network Edge
Ethernet Internet Access
Network Edge
A Typical Home Network
Network Edge
Wireless Access Networks
Network Core
I mesh of interconnected
routers
Network Core
Packet- and Circuit-Switching
Packet switching
Hosts break application-layer Circuit Switching
messages into packets and End-to-end resources are allocated
packets are sent as soon as they to and reserved for the call
are available. No need to setup a between source and destination. A
dedicated path in advance. dedicated (physical) path is setup
Routers use store-and-forward in advance.
transmission.
Network Core
Packet-switching: Store-and-forward
Network Core
Packet-switching: Store-and-forward
Network Core
Packet-switching: Store-and-forward
Hint
There are N − 1 routers.
PAIR UP and
DISCUSS
Hint
There are N − 1 routers.
Answer
PAIR UP and L
NR
DISCUSS
Network Core
Queueing Delays and Packet Loss
I If arrival rate (in bits) to link exceeds transmission rate of link for a
period of time:
I packets will queue, wait to be transmitted on link
I packets can be dropped (lost) if memory (buffer) fills up
Network Core
Two Key Network Core Functions
IN-CLASS ACTIVITY
There are two steps:
1. Assume that you are connected to (i.e., can communicate
with) those friends of yours within 1 meter range.
Determine the shortest route to another random friend of
yours.
2. Send a piece of text message to the selected friend over
the shortest route.
Network Core
Alternative Core: Circuit Switching
THINK PAIR
SHARE
What are the
advantages and
disadvantages of
circuit switching
compared to packet
switching?
Network Core
Packet- and Circuit-Switching
Network Core
Packet- and Circuit-Switching Comparison
Hint
How do you schedule classroom(s) for different
courses?
PAIR UP and
DISCUSS
Hint
How do you schedule classroom(s) for different
courses?
Answer
I Two courses at the same time in different
classrooms.
PAIR UP and I Two courses at different times in the same
DISCUSS classroom.
Network Core
Circuit Switching: FDM versus TDM
Network Core
Internet Structure I
Network Core
Internet Structure II
Network Core
Internet Structure III
Layering
Modularity
Layering
Modularity
Modularity
We need a form of modularity to manage complexity and facilitate
reusability
Layering
An Example: Taking an Airplane Trip
Layering
An Example: Taking an Airplane Trip
Layering
Protocols and Layers
Layering
Protocol Stack
Layering
Internet Protocol Stack and OSI Reference Model
Layering
Internet Protocol Stack
Layering
Internet Protocol Stack
Layering
ISO/OSI reference model
PAIR UP and
DISCUSS
Layering
Encapsulation
Encapsulation
Encapsulation is the mechanism used to effect protocol layering: lower
layer wraps higher layer content, adding its own information to make a
new message for delivery
Layering
Encapsulation
Layering
Encapsulation Example
Layering
Encapsulation Example
PAIR UP and
DISCUSS
Layering
Demultiplexing
Layering
Demultiplexing
Layering
Advantages and Disadvantages
Advantages
Information hiding and reuse
Disadvantages
Information hiding and overhead
Section 3
Physical Layer
Physical Layer
Physical Layer
Where Are We in the Course?
Physical layer
concerns how signals are used to
transfer bits over a link
Physical Layer
Simple Link Model
Physical Layer
Latency in Simple Link Model
Physical Layer
Bandwidth-Delay Product
Performance
How Do Loss and Delay Occur?
Performance
How Do Loss and Delay Occur?
dn = dp + dq + dt + dg : total delay
I dp processing delay (checking bit errors, routing)
I dq queuing delay, time waiting at output links, depends on
congestion
I dt = L/R transmission delay where L is packet length and R is
link bandwidth
I dg = d/s propagation delay where d is length of physical link and s
Dr. is propagation
Ertan Onur (WINS Lab) speed in medium × 108 Fall
(in space it is c = 32017-2018
CENG435 m/s 87 / 487
Physical Layer Performance
Performance
Queueing Delay (Could be a course on its own)
PAIR UP and
DISCUSS
Answer
Queue fills up and packets will be dropped.
PAIR UP and Instable system. Large packet loss.
DISCUSS
Performance
Throughput
Throughput
rate (bits per unit time) at which bits transferred between
sender/receiver.
I instantaneous: rate at a given point in time
I average: rate over longer period of time
Performance
Throughput
Physical Media
I bit: propagates between transmitter-receiver pairs
I physical link: what lies between transmitter & receiver
Guided media
signals propagate in solid media: twisted pair, optical fiber, coaxial
cable
Unguided media
signals propagate freely, e.g., radio (wireless)
Physical Media
Coaxial cable
Fiber optic cable
I two concentric copper
I glass fiber carrying light
conductors
pulses, each pulse a bit
I bidirectional
I high-speed 10’s-100’s Gpbs
I broadband:multiple channels
I low error rate
on cable, HFC
Physical Media
Electromagnetic Spectrum for Telecommunications
Physical Media
Transmission Characteristics of Guided Media
Physical Media
Transmission Characteristics of Guided Media
Physical Media
Radio
Types
Radio I Terrestrial microwave: up to
45 Mbps channels
I signal carried in
electromagnetic spectrum I LAN: (e.g., WiFi) 11Mbps, 54
Mbps
I no physical “wire”
I Wide-area: (e.g., cellular) 3G
I bidirectional
cellular: few Mbps
I propagation environment
I Satellite: Kbps to 45Mbps
effects: reflection, obstruction
channel (or multiple smaller
by objects, interference
channels), 270 msec end-end
delay
Signals
Analog and Digital Waveforms
Signals
Periodic Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(0)
x
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(30)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(45)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(60)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(90)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(135)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(180)
x
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(225)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(270)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(315)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(330)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
sin(360)
x
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 100 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 101 / 487
Physical Layer Signals
Signals
Sinusoid s(t) = A sin (2πf t + θ)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 102 / 487
Physical Layer Signals
Signals
Example: Let’s construct a periodic square wave
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 103 / 487
Physical Layer Signals
Signals
4 1
Example: s(t) = π
sin(2πf t) + 3
sin(2π(3f )t)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 104 / 487
Physical Layer Signals
Signals
4 1
Spectrum - Example: s(t) = π
sin(2πf t) + 3
sin(2π(3f )t)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 105 / 487
Physical Layer Signals
Signals
4 1
Example: s(t) = π
sin(2πf t) + 3
sin(2π(3f )t) + . . .
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 106 / 487
Physical Layer Signals
Signals
Example
4 1 1
s(t) = sin(2πf t) + sin(2π(3f )t) + sin(2π(5f )t)
π 3 5
When the fundamental frequency f = 106 Hz = 1 MHz, what is the
bandwidth?
Answer
Bandwidth = 5f − f = 4f = 4 MHz.
T = 1016 = 1µs. Treat the waveform a sequence of 0s and 1s, one bit
occurs every 0.5µs for a data rate of 2 × 106 bps.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 107 / 487
Physical Layer Signals
Signals
Example
4 1 1
s(t) = sin(2πf t) + sin(2π(3f )t) + sin(2π(5f )t)
π 3 5
When the fundamental frequency f = 2 × 106 Hz = 2 MHz, what is the
bandwidth?
Answer
Bandwidth = 5f − f = 4f = 8 MHz.
1
T = 2×10 6 = 0.5µs. Treat the waveform a sequence of 0s and 1s, one
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 108 / 487
Physical Layer Signals
Signals
Example
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 109 / 487
Physical Layer Signals
Signals
Conclusions of the Example
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 110 / 487
Physical Layer Signals
Signals
Conclusions of the Example
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 111 / 487
Physical Layer Signals
Signals
Acoustic Spectrum
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 112 / 487
Physical Layer Signals
Signals
Noise
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 113 / 487
Physical Layer Fundamental Limits
Signals
Signals over a Wire: What happens to a signal?
Bandwidth
EE: width of frequency band in Hz
CS: information carrying capacity
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 114 / 487
Physical Layer Fundamental Limits
Signals
Channel Capacity
I Data rate: The rate, in bits per second (bps), at which data can be
communicated
I Bandwidth: The bandwidth of the transmitted signal as
constrained by the transmitter and the nature of the transmission
medium, expressed in Hertz
I Noise: The average level of noise over the communications path
I Error rate: The rate at which errors occur, where an error is the
reception of a 1 when a 0 was transmitted or the reception of a 0
when a 1 was transmitted
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 115 / 487
Physical Layer Fundamental Limits
Signals
Channel Capacity
Design Objective
Get as high a data rate as possible at a particular limit of error rate for
a given bandwidth. The main constraint on achieving this efficiency is
noise.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 116 / 487
Physical Layer Fundamental Limits
Signals
Nyquist Bandwidth (Rate)
Nyquist Rate
Given a bandwidth of B Hz, the highest signal rate that can be carried
is 2B bps.
Nyquist Bandwidth
If the rate of signal transmission is 2B bps, then a signal with
frequencies no greater than B Hz is sufficient to carry the signal rate.
C = 2B log2 M,
where M is the number of signalling levels.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 117 / 487
Physical Layer Fundamental Limits
Signals
Shannon Capacity
http://www.youtube.com/watch?v=z7bVw7lMtUg
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 118 / 487
Physical Layer Fundamental Limits
Signals
Shannon Capacity
I The higher the data rate, the more damage that unwanted noise
can do.
I Signal-to-noise ratio (SNR, S/N): the ratio of the power in a signal
to the power contained in the noise that is present at a particular
point in the transmission.
I Let’s consider only thermal noise (white noise)
Shannon Capacity
C = B log2 (1 + SN R)
where C is the capacity of the channel in bps and B is the bandwidth
of the channel in Hz.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 119 / 487
Physical Layer Fundamental Limits
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 120 / 487
Physical Layer Fundamental Limits
Answer
Bandwidth B = 4 − 3 = 1 MHz = 106 Hz
SNR (in linear scale) is 102.4 = 251.
⇒ C = 106 × log2 (1 + 251) = 8 × 106 bits.
PAIR UP and Nyquist says C = 2B log2 M , so
DISCUSS 8 × 106 = 2 × 106 × log2 M ;
⇒ M = 16.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 120 / 487
Physical Layer Fundamental Limits
Signals
Thermal Noise
The amount of thermal noise to be found in a bandwidth of 1 Hz in any
device or conductor is
N0 = kT
in W/Hz where
I N0 is the noise power density in Watts per 1 Hz
I k is the Boltzmann’s constant = 1.38 × 10−23 J/K
I T is the temperature, in Kelvins (absolute temperature)
Example
Room temperature is T = 17o C, or 290 K. At this temperature, the
thermal noise power density is N0 = (1.38 × 10−23 × 290 = 4 × 10−21
W/Hz
= −204 dBW/Hz
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 121 / 487
Physical Layer Fundamental Limits
Signals
Boltzmann’s grave in the Zentralfriedhof, Vienna
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 122 / 487
Physical Layer Fundamental Limits
Signals
Thermal Noise
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 123 / 487
Physical Layer Fundamental Limits
Signals
Eb /N0
Eb /N0 is the ratio of the signal energy per bit to the noise power
density per Hertz.
Eb = STb
where S is the signal power and Tb is the time required to send one bit.
Then, the data rate is R = 1/Tb . This follows,
Eb S/R S
= =
N0 N0 kT R
in linear scale. Or in decibel notation
Eb
= SdBW − 10 log R + 228.6dBW − 10 log T
N0 dB
Signals
Bit Error Rate (BER)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 125 / 487
Physical Layer Fundamental Limits
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 126 / 487
Physical Layer Fundamental Limits
Answer
Eb
= SdBW − 10 log R + 228dBW − 10 log T
PAIR UP and N0 dB
DISCUSS
8.4 = SdBW − 10 log 2400 + 228.6dBW − 10 log 290
Then, S = −161.8 dBW.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 126 / 487
Physical Layer Modulation
Modulation
Definition
Modulation
is the process of encoding source data onto a carrier with frequency fc
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 127 / 487
Physical Layer Modulation
Modulation
Baseband - Passband
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 128 / 487
Physical Layer Modulation
Modulation
Digital Data, Digital Signal
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 129 / 487
Physical Layer Modulation
Modulation
Digital Data, Digital Signal
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 130 / 487
Physical Layer Modulation
Modulation
Modulation Rate: Bit rate versus baud rate
R
D=
log2 M
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 131 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 132 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 133 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 134 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 135 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 136 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 137 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 138 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 139 / 487
Physical Layer Modulation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 140 / 487
Physical Layer Ticket to Retention
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 141 / 487
Application Layer
Section 4
Application Layer
Application Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 142 / 487
Application Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 143 / 487
Application Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 144 / 487
Application Layer Principles of Network Applications
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 145 / 487
Application Layer Principles of Network Applications
Typical answer
e-mail, web, text messaging, remote login, P2P
file sharing, multi-user network games, streaming
stored video (YouTube, Hulu, Netflix), voice over
IP (e.g., Skype), real-time video conferencing,
PAIR UP and social networking, search, ...
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 145 / 487
Application Layer Principles of Network Applications
Network Applications
Communication
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 146 / 487
Application Layer Principles of Network Applications
Network Applications
Communication
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 147 / 487
Application Layer Principles of Network Applications
Network Applications
Client-server and Peer-to-peer Architectures
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 148 / 487
Application Layer Principles of Network Applications
Network Applications
Client-server Architecture
Server
I always-on host
I permanent IP address
I data centers for scaling
Client
I communicate with server
I may be intermittently
connected
I do not communicate directly
with each other
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 149 / 487
Application Layer Principles of Network Applications
Network Applications
Peer-to-peer Architecture
I no always-on server
I arbitrary end systems directly
communicate
I peers request service from
other peers, provide service in
return to other peers
I self scalability: new peers
bring demand and also
capacity
I peers are intermittently
connected and change IP
addresses, complex
management
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 150 / 487
Application Layer Principles of Network Applications
Network Applications
Peer-to-peer Architecture
Process
is the program running within a host. Within same host, two processes
communicate by using inter-process communication and processes
in different hosts communicate by exchanging messages.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 151 / 487
Application Layer Principles of Network Applications
Network Applications
Peer-to-peer Architecture
Process
is the program running within a host. Within same host, two processes
communicate by using inter-process communication and processes
in different hosts communicate by exchanging messages.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 151 / 487
Application Layer Principles of Network Applications
Network Applications
Application Processesç, Sockets and Transport Protocol
Network Applications
Addressing Processes
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 153 / 487
Application Layer Principles of Network Applications
Network Applications
Addressing Processes
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 153 / 487
Application Layer Principles of Network Applications
Network Applications
Application Layer Protocols
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 154 / 487
Application Layer Principles of Network Applications
Network Applications
Requirements from Lower (Transport) Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 155 / 487
Application Layer Principles of Network Applications
Network Applications
Requirements from Lower (Transport) Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 156 / 487
Application Layer Principles of Network Applications
Network Applications
Internet transport protocols services
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 157 / 487
Application Layer Principles of Network Applications
Network Applications
Example Applications and Transport Protocols Thereof
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 158 / 487
Application Layer HTTP
HTTP
Overview
I uses TCP
I stateless
I non-persistent HTTP: at most one object sent over TCP
connection, connection then closed
I persistent HTTP: multiple objects can be sent over single TCP
connection between client, server
http://eonur.eu/academics/index.html
Question
Who is client, who is server?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 159 / 487
Application Layer HTTP
HTTP
Overview
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 160 / 487
Application Layer HTTP
HTTP
Non-persistent HTTP
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 161 / 487
Application Layer HTTP
HTTP
Non-persistent HTTP
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 162 / 487
Application Layer HTTP
Network Applications
Internet transport protocols services
Persistent HTTP
I server leaves connection open
Non-persistent HTTP after sending response
I requires 2 RTTs per object I subsequent HTTP messages
I OS overhead for each TCP between same client/server
connection sent over open connection
I browsers often open I client sends requests as soon
parallel TCP connections as it encounters a referenced
to fetch referenced objects object
I as little as one RTT for all the
referenced objects
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 163 / 487
Application Layer HTTP
HTTP
HTTP Messages
I Two types of HTTP messages: request, response
I HTTP request message: ASCII (human-readable)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 164 / 487
Application Layer HTTP
HTTP
HTTP Request Methods
POST Method
I web page often includes form input
I input is uploaded to server in entity body
GET Method
I input is uploaded in URL field of request line
I www.somesite.com/animalsearch?monkeys&banana
HEAD Method
I asks server to leave requested object out of response
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 165 / 487
Application Layer HTTP
HTTP
HTTP Request Methods
PUT Method
I uploads file in entity body to path specified in URL field
DELETE Method
I deletes file specified in the URL field
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 166 / 487
Application Layer HTTP
HTTP
HTTP Response Message
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 167 / 487
Application Layer HTTP
HTTP
HTTP Response Status Codes
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 168 / 487
Application Layer HTTP
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 169 / 487
Application Layer HTTP
Typical answer
Cookies
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 169 / 487
Application Layer HTTP
HTTP
Cookies
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 170 / 487
Application Layer HTTP
HTTP
Cookies
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 171 / 487
Application Layer HTTP
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 172 / 487
Application Layer HTTP
Typical answer
Caching
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 172 / 487
Application Layer HTTP
HTTP
Caching
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 173 / 487
Application Layer HTTP
HTTP
Caching
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 174 / 487
Application Layer HTTP
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 175 / 487
Application Layer HTTP
Typical answer
The traffic intensity on the LAN is (15 requests/sec) . (1
Mbits/request)/(100 Mbps) = 0.15 << 1. Therefore, LAN delay can
be neglected
PAIR UP and The traffic intensity on the access link is (15 requests/sec) . (1
Mbits/request)/(15 Mbps) = 1. Delay is very large
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 175 / 487
Application Layer HTTP
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 176 / 487
Application Layer HTTP
Typical answer
When cache is used LAN delay + 0.6 × 2 sec.
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 176 / 487
Application Layer HTTP
HTTP
Conditional GET (use cache)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 177 / 487
Application Layer File Transfer Protocol
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 178 / 487
Application Layer File Transfer Protocol
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 179 / 487
Application Layer File Transfer Protocol
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 180 / 487
Application Layer Electronic Mail
Electronic Mail
Simple Mail Transfer Protocol
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 181 / 487
Application Layer Electronic Mail
Electronic Mail
Simple Mail Transfer Protocol
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 182 / 487
Application Layer Electronic Mail
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 183 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 184 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 185 / 487
Application Layer Domain Name Server
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 186 / 487
Application Layer Domain Name Server
Typical answer
I single point of failure
I traffic volume
I distant centralized database
I maintenance
PAIR UP and
I does not scale
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 186 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 188 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 189 / 487
Application Layer Domain Name Server
Authoritative Servers
I organization’s own DNS server(s), providing authoritative
hostname to IP mappings for organization’s named hosts
I can be maintained by organization or service provider
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 190 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 191 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 192 / 487
Application Layer Domain Name Server
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 193 / 487
Application Layer Domain Name Server
Resource Records
RR = (name, value, type, ttl)
I Type=A, name:hostname, value:IP Address
I Type=NS, name:domain, value:hostname of authoritative server
I Type=CNAME, name:alias, value:canonical name
I Type=MX, name:name, value:name of mailserver
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 194 / 487
Application Layer Domain Name Server
Flags:
I query or reply
I recursion
desired
I recursion
available
I reply is
authoritative
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 195 / 487
Application Layer Domain Name Server
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 196 / 487
Application Layer Domain Name Server
Typical answer
I provide names, IP addresses of authoritative name
server
I registrar inserts two RRs into .com TLD server:
I (networkutopia.com, dns1.networkutopia.com, NS)
PAIR UP and I (dns1.networkutopia.com, 212.212.212.1, A)
DISCUSS I type A record for www.networkuptopia.com; type
MX record for networkutopia.com
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 196 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Pure P2P Architecture
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 197 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Pure P2P Architecture
I no always-on server
I arbitrary end systems directly communicate
I peers are intermittently connected and change IP addresses
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 198 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distribution Problem: Client-server Approach
I server
transmission:
must
sequentially
send (upload) N
file copies:
I time to send one
copy: F/us
I time to send N
copies: N F/us
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 199 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distribution Problem: Client-server Approach
I client: each
client must
download file
copy
I dmin = minimum
client download
rate
I min client
download time:
F/dmin
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 200 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distribution Problem: Client-server Approach
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 201 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distribution Problem: P2P Approach
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 202 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distribution Problem: Client-server Approach
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 203 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Client-server versus Peer-to-peer
Peer-to-peer Architecture
Example: Bittorent
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 205 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distributed Hash Tables (DHT)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 206 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distributed Hash Tables (DHT)
Basic idea:
I Convert each key to an integer
I Assign integer to each peer
I Put (key,value) pair in the peer that is closest to the key
For instance:
I assign integer identifier to each peer in range [0, 2n−1 ] for some n.
I each identifier represented by n bits.
I to get integer key, hash the original key
I e.g., key = hash(”Led Zeppelin IV”)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 207 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Distributed Hash Tables (DHT)
I rule: assign key to the peer that has the closest ID.
I convention in lecture: closest is the immediate successor of the
key.
I e.g., n=4; peers: 1,3,4,5,8,10,12,14;
I key = 13, then successor peer = 14
I key = 15, then successor peer = 1
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 208 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Circular DHT
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 209 / 487
Application Layer Peer-to-peer Architecture
Peer-to-peer Architecture
Peer churn
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 210 / 487
Application Layer Socket Programming
Socket Programming
Goals
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 211 / 487
Application Layer Socket Programming
Socket Programming
Socket Types
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 212 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 213 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 214 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 215 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 216 / 487
Application Layer Socket Programming
sockfd=socket(AF_INET,SOCK_DGRAM,0);
bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr=htonl(INADDR_ANY);
servaddr.sin_port=htons(32000);
bind(sockfd,(struct sockaddr *)&servaddr,sizeof(servaddr));
for (;;) {
len = sizeof(cliaddr);
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 217 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 218 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 219 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 220 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 221 / 487
Application Layer Socket Programming
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 222 / 487
Application Layer Socket Programming
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
int main(int argc, char**argv)
{
int sockfd,n;
struct sockaddr_in servaddr,cliaddr;
char sendline[1000];
char recvline[1000];
if (argc != 2)
{
printf("usage: client <IP address>\n");
exit(1);
}
sockfd=socket(AF_INET,SOCK_STREAM,0);
bzero(&servaddr,sizeof(servaddr));
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 223 / 487
Application Layer Socket Programming
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr=inet_addr(argv[1]);
servaddr.sin_port=htons(32000);
connect(sockfd, (struct sockaddr *)&servaddr, sizeof(
servaddr));
while (fgets(sendline, 10000,stdin) != NULL)
{
sendto(sockfd,sendline,strlen(sendline),0,
(struct sockaddr *)&servaddr,sizeof(servaddr));
n=recvfrom(sockfd,recvline,10000,0,NULL,NULL);
recvline[n]=0;
fputs(recvline,stdout);
}
}
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 224 / 487
Application Layer Socket Programming
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
listenfd=socket(AF_INET,SOCK_STREAM,0);
bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr=htonl(INADDR_ANY);
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 225 / 487
Application Layer Socket Programming
listen(listenfd,1024);
for(;;) {
clilen=sizeof(cliaddr);
connfd = accept(listenfd,(struct sockaddr *)&cliaddr,&
clilen);
if ((childpid = fork()) == 0) {
close (listenfd);
for(;;) {
n = recvfrom(connfd,mesg,1000,0,(struct sockaddr *)
&cliaddr,&clilen);
sendto(connfd,mesg,n,0,(struct sockaddr *)&cliaddr,
sizeof(cliaddr));
printf("-----------\n");
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 226 / 487
Application Layer Socket Programming
mesg[n] = 0;
printf("Received the following:\n");
printf("%s",mesg);
printf("-----------\n");
}
}
close(connfd);
}
}
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 227 / 487
Application Layer Ticket to Retention
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 228 / 487
Transport Layer
Section 5
Transport Layer
Transport Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 229 / 487
Transport Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 230 / 487
Transport Layer
1. Reliable data transfer: What are the mechanisms for reliable data
transfer and how do you use them?
2. Flow control: Why and how do you implement flow control?
3. Congestion control: Why and how do you implement congestion
control?
4. UDP versus TCP Describe why an application developer might
choose to run an application over UDP rather than TCP.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 231 / 487
Transport Layer Transport Layer Services
I provide logical
communication
between
application
processes
running on
different hosts
I transport
protocols run in
end systems
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 232 / 487
Transport Layer Transport Layer Services
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 233 / 487
Transport Layer Multiplexing and Demultiplexing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 235 / 487
Transport Layer Multiplexing and Demultiplexing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 236 / 487
Transport Layer Multiplexing and Demultiplexing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 237 / 487
Transport Layer Multiplexing and Demultiplexing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 238 / 487
Transport Layer Multiplexing and Demultiplexing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 239 / 487
Transport Layer Connectionless Transport
Connectionless Transport
User Datagram Protocol [RFC 768]
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 240 / 487
Transport Layer Connectionless Transport
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 241 / 487
Transport Layer Connectionless Transport
Typical answer
I add these features at the application layer
I application-specific error recovery?
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 241 / 487
Transport Layer Connectionless Transport
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 242 / 487
Transport Layer Connectionless Transport
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 243 / 487
Transport Layer Connectionless Transport
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 243 / 487
Transport Layer Connectionless Transport
Goal
detect ”errors” (e.g., flipped bits) in transmitted packet (note: used at
transport layer only)
I Sender
I treat segment contents as sequence of 16-bit integers
I checksum: addition of segment contents and then 1’s complement
of the sum
I sender puts checksum value into UDP checksum field
I Receiver
I treat segment contents as sequence of 16-bit integers
I expected result = addition of segment contents and the checksum
sent in the header
I if expected result = all 1’s then everything is ok
I Otherwise, the segment is corrupt
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 244 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 245 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 246 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 247 / 487
Transport Layer Reliable Data Transfer
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 248 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 248 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 249 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 250 / 487
Transport Layer Reliable Data Transfer
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 251 / 487
Transport Layer Reliable Data Transfer
Typical answer
I Corrupted ACK or NAK!
I Duplicates
I Should not we ACK the ACK or NAK?
I Stop and wait, waste resources!
I Lost packets!
I Infinite re-transmissions?
PAIR UP and I How long would you wait for an ACK?
DISCUSS I Weak checksum: bit errors that cannot be
detected?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 251 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 252 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 253 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 254 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 255 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 256 / 487
Transport Layer Reliable Data Transfer
notcorrupt
AND
seq=0
corrupt corrupt
OR Wait for 0 Wait for 1 OR
seq=1 seq=0
notcorrupt
AND
seq=1
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 257 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 258 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 259 / 487
Transport Layer Reliable Data Transfer
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 260 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 260 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 261 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 262 / 487
Transport Layer Reliable Data Transfer
Pipelining
Rather than operating in a stop-and-wait manner, the sender is allowed
to send multiple packets without waiting for acknowledgments. Many
in-transit sender-to-receiver packets can be visualized as filling a
pipeline.
Consequences:
I sequence numbers
I buffer
I responding to lost, corrupted, and overly delayed packets.
Two basic approaches toward pipelined error recovery can be
identified: Go-Back-N and selective repeat.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 263 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 264 / 487
Transport Layer Reliable Data Transfer
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 265 / 487
Transport Layer Reliable Data Transfer
Typical answer
Utilization of sender,
Us = RT3L/R
T +L/R = 0.0024/30.008 = 0.00081
Increased by a factor of 3.
PAIR UP and
DISCUSS
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 265 / 487
Transport Layer Reliable Data Transfer
Go-back-N
I sender can have up to N unacked packets in pipeline
I receiver only sends cumulative ack: does not ack packet if there is
a gap
I sender has timer for oldest unacked packet: when timer expires,
retransmit all unacked packets
Selective Repeat
I sender can have up to N unacked packets in pipeline
I receiver sends individual ack for each packet
I sender maintains timer for each unacked packet: when timer
expires, retransmit only that unacked packet
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 266 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 267 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 268 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 269 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 270 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 271 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 272 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 273 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 274 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 275 / 487
Transport Layer Reliable Data Transfer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 276 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 277 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 278 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 279 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 280 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 281 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 282 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 283 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 284 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 285 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 286 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 287 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 288 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 289 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 290 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 291 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 292 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 293 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 294 / 487
Transport Layer Transmission Control Protocol (TCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 295 / 487
Transport Layer Congestion Control
Congestion Control
Principles
Congestion (informal)
too many sources sending too much data too fast for network to handle
Manifestations:
I lost packets (buffer overflow at routers)
I long delays (queueing in router buffers)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 296 / 487
Transport Layer Congestion Control
Congestion Control
Causes/costs: Scenario 1
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 297 / 487
Transport Layer Congestion Control
Congestion Control
Causes/costs: Scenario 1
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 298 / 487
Transport Layer Congestion Control
Congestion Control
Causes/costs: Scenario 2
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 299 / 487
Transport Layer Congestion Control
Congestion Control
Causes/costs: Scenario 2
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 300 / 487
Transport Layer Congestion Control
Congestion Control
Causes/costs: Scenario 3
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 301 / 487
Transport Layer Congestion Control
Congestion Control
Causes/costs: Scenario 3
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 302 / 487
Transport Layer Congestion Control
Congestion Control
Approaches Towards Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 303 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 304 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 305 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 306 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 307 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 308 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 309 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 310 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 311 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 312 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 313 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 314 / 487
Transport Layer Congestion Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 315 / 487
Transport Layer Ticket to Retention
1. Reliable data transfer: What are the mechanisms for reliable data
transfer and how do you use them?
2. Flow control: Why and how do you implement flow control?
3. Congestion control: Why and how do you implement congestion
control?
4. UDP versus TCP Describe why an application developer might
choose to run an application over UDP rather than TCP.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 316 / 487
Network Layer
Section 6
Network Layer
Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 317 / 487
Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 318 / 487
Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 319 / 487
Network Layer Introduction to Network Layer
Network Layer
Introduction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 320 / 487
Network Layer Introduction to Network Layer
Network Layer
Two Key Functions: Forwarding and Routing
Forwarding
move packets from router’s input to appropriate router output
Routing
determine route taken by packets from source to destination
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 321 / 487
Network Layer Introduction to Network Layer
Network Layer
Relationship Between Forwarding and Routing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 322 / 487
Network Layer Introduction to Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 323 / 487
Network Layer Introduction to Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 324 / 487
Network Layer Introduction to Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 325 / 487
Network Layer Introduction to Network Layer
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 325 / 487
Network Layer Virtual-circuit and Datagram Networks
Datagram network
provides network-layer connectionless service
Virtual-circuit network
provides network-layer connection service
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 326 / 487
Network Layer Virtual-circuit and Datagram Networks
Virtual-circuit
Implementation
I call setup before data flow
I packets carry VC identifier (not host address)
I routers maintain “state” for each passing connection
I bandwidth, buffers may be allocated to VC
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 327 / 487
Network Layer Virtual-circuit and Datagram Networks
Virtual-circuit
Implementation
A virtual circuit consists of
I Path: e.g., A-R1-R2-B
I VC numbers for each link on path e.g., 12,22,32
I Forwarding table on each router: shown below for R1
Virtual-circuit
Implementation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 329 / 487
Network Layer Virtual-circuit and Datagram Networks
Datagram Networks
Attributes
I no call setup at network layer
I routers have no state about end-to-end connections
I no network-level concept of “connection”
I packets forwarded using destination host address
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 330 / 487
Network Layer Virtual-circuit and Datagram Networks
Datagram Networks
Forwarding Table
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 331 / 487
Network Layer Virtual-circuit and Datagram Networks
Datagram Networks
Forwarding Table
Datagram Networks
Forwarding Table
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 333 / 487
Network Layer Virtual-circuit and Datagram Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 334 / 487
Network Layer Virtual-circuit and Datagram Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 334 / 487
Network Layer What is inside a Router?
Routers
What is inside?
Router Functions
running routing algorithms/protocol (RIP, OSPF, BGP) and forwarding
datagrams from incoming to outgoing link
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 335 / 487
Network Layer What is inside a Router?
Routers
Input Port Processing
Decentralized Switching
I given datagram dest., lookup output port using forwarding table in
input port memory
I goal: complete input port processing at ’line speed’
I queuing: if datagrams arrive faster than forwarding rate into switch
fabric
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 336 / 487
Network Layer What is inside a Router?
Switching Fabrics
Switching via Memory
First generation
I traditional computers with switching under direct control of CPU
I packet copied to system’s memory
I speed limited by memory bandwidth (2 bus crossings per
datagram)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 337 / 487
Network Layer What is inside a Router?
Switching Fabrics
Switching via Bus
Bus contention
I datagram from input port memory to output port memory via a
shared bus
I bus contention: switching speed
Dr. Ertan Onur (WINS Lab)
limited by bus bandwidth
CENG435 2017-2018 Fall 338 / 487
Network Layer What is inside a Router?
Switching Fabrics
Switching via Crossbar (interconnecting network)
Routers
Output Port Processing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 340 / 487
Network Layer What is inside a Router?
Routers
Output Port Queuing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 341 / 487
Network Layer What is inside a Router?
Routers
Input Port Queuing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 342 / 487
Network Layer What is inside a Router?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 343 / 487
Network Layer What is inside a Router?
The minimal number of time slots needed is 3. The scheduling is as follows. Slot 1: send X in top
input queue, send Y in middle input queue. Slot 2: send X in middle input queue, send Y in
bottom input queue Slot 3: send Z in bottom input queue.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 343 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 344 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 345 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 346 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 347 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Interface Addresses and Subnets
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 348 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Subnets
Subnet
is a network where devices can reach each other without an
intervening router. High order bits of IP addresses are the subnet part.
To determine the subnets, detach each interface from its host or router,
creating islands of isolated networks, with interfaces terminating the
end points of the isolated networks. Each of these isolated networks is
called a subnet.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 349 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Subnet Addresses
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 350 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Subnets: Example
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 351 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
CIDR
CIDR
The Internet’s address assignment strategy is known as Classless
Interdomain Routing (CIDR pronounced cider) [RFC 4632]. CIDR
generalizes the notion of subnet addressing. As with subnet
addressing, the 32-bit IP address is divided into two parts and again
has the dotted-decimal form a.b.c.d/x, where x indicates the number of
bits in the first part of the address.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 352 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Dynamic Host Configuration Protocol (DHCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 353 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Dynamic Host Configuration Protocol (DHCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 354 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Dynamic Host Configuration Protocol (DHCP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 355 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
How does an organization get IP address from ISP?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 356 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
How does an ISP get IP addresses?
ICANN
ICANN: Internet Corporation for Assigned Names and Numbers
(http://www.icann.org)
I allocates addresses
I manages DNS
I assigns domain names, resolves disputes
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 357 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Hierarchical Addressing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 358 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Hierarchical Addressing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 359 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Network Address Translation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 360 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Network Address Translation
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 361 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Network Address Translation Problem
I client wants to connect to server with address 10.0.0.1
I server address 10.0.0.1 local to LAN (client cannot use it as
destination addr)
I externally visible address: 138.76.29.7. SOLUTION?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 362 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Network Address Translation
Several Solutions:
I statically configure NAT to forward incoming connection requests
to a server inside
I Universal Plug and Play (UPnP) Internet Gateway Device (IGD)
Protocol: local servers learn public IP address and use IGD to
configure NAT ports
I external relaying (bridging) entity; both parties establish a
connection to the relay
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 363 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Internet Control Message Protocol (ICMP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 364 / 487
Network Layer Internet Protocol (IP)
IPv4 Addressing
Internet Control Message Protocol (ICMP)
Type Code Description
0 0 echo reply (to ping)
3 0 destination network unreachable
3 1 destination host unreachable
3 2 destination protocol unreachable
3 3 destination port unreachable
3 6 destination network unknown
3 7 destination host unknown
4 0 source quench (congestion control)
8 0 echo request
9 0 router advertisement
10 0 router discovery
11 0 TTL expired
12 0 IP header bad
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 365 / 487
Network Layer Internet Protocol (IP)
Traceroute
UDP and ICMP working together
I Source sends series of UDP segments to dest, first set has TTL
=1, second set has TTL=2, etc.
I When nth set of datagrams arrives to nth router:
I Router discards datagrams and sends source ICMP messages
(type 11, code 0, TTL expired)
I ICMP messages includes name of router and IP address
I When ICMP messages arrives, source records RTTs
I When UDP segment reaches destination, destination returns
ICMP message (type 3, code 3, destination port unreachable)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 366 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 367 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 368 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 369 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 370 / 487
Network Layer Internet Protocol (IP)
Tunneling
IPv6 datagram is carried as payload in IPv4 datagram among IPv4
routers
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 371 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 372 / 487
Network Layer Internet Protocol (IP)
Consider the network shown below. Each of the subnets A-D contains
at most 30 hosts; subnet E connects routers R1 and R2.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 373 / 487
Network Layer Internet Protocol (IP)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 374 / 487
Network Layer Routing Algorithms
Routing Algorithms
Interplay between Routing and Forwarding: Revisited
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 375 / 487
Network Layer Routing Algorithms
Routing Algorithms
Abstract Graph Model of Computer Network
Routing Algorithms
Abstract Graph Model of Computer Network
c(x, x0 ) is the cost of the link (x, x0 ) c(x1 , x2 , . . . , xn ) is the cost of the
path and is equal to c(x1 , x2 ) + c(x2 , x3 ), . . . , c(xn−1 , xn ).
What is the least-cost path between u and z?
Algorithm that finds the least-cost path is called as routing algorithm.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 377 / 487
Network Layer Routing Algorithms
Routing Algorithms
Classification
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 378 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 379 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 380 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 381 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 382 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 383 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 384 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 385 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 386 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 387 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 388 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 389 / 487
Network Layer Routing Algorithms
1 2
A B C
Dest. Next Metric … Dest. Next Metric … Dest. Next Metric …
A A 0 A A 1 A B 3
B B 1 B B 0 B B 2
C B 3 C C 2 C C 0
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 390 / 487
Network Layer Routing Algorithms
1 1
A B C
Dest. Next Metric … Dest. Next Metric … Dest. Next Metric …
A A 0 A A 1 A B 3 2
B B 1 B B 0 B B 1
C B 3 2 C C 1 C C 0
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 390 / 487
Network Layer Routing Algorithms
broadcasts to update
tables of C, B, A with new entry for D
(A, 1) (A, 2)
(B, 0) (B, 1)
(C, 1) (C, 0)
(D, 2) (D, 1) (D, 0)
1 1 1
A B C D
Dest. Next Metric … Dest. Next Metric … Dest. Next Metric …
A A 0 A A 1 A B 2
B B 1 B B 0 B B 1
C B 2 C C 1 C C 0
D B 3 D C 2 D D 1
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 390 / 487
Network Layer Routing Algorithms
1 1 1
A B C D
Dest. Next Metric … Dest. Des
Dest. Nex
Next Metr
Metric …
Next Metric …
c
… …
… … … … … … t. … t …
ic
D B 3 D C 2 D …
… D …
D B 1
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 390 / 487
Network Layer Routing Algorithms
(D, 2) (D, 2)
1 1 1
A B C D
Dest. Next Metric … Dest. Next Metric … Dest. Next Metric …
… … … … … … … … …
D B 3 D C 2 D B 3
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 390 / 487
Network Layer Routing Algorithms
(D,5)
(D,4) (D,4)
(D,3)
(D,2) (D,2)
1 1 1
A B C D
Dest. Next Metric … Dest. Dest. Next Metric …
Next Metric …
c
… … … … … … … … …
D B 3, 5, … D C 2,4,6… 3, 5,
D B
…
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 390 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Assumptions up to now
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 391 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Scalability solution
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 392 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Example
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 393 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Inter-AS Tasks
Scenario
Suppose router in AS1 receives datagram destined outside of AS1. It
should forward the packet to the gateway router, but which one?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 394 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Question
Question
Subnet x is in AS3 and not reachable from AS2. How does router 1d
know this?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 395 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Question
Question
Subnet x is in AS3 and not reachable from AS2. How does router 1d
know this?
Solution
Suppose AS1 learns via Inter-AS protocol that subnet x is reachable
via AS3 over gateway 1c but not via AS2. This information is propagate
to all nodes in AS2. Router 1d determines from Intra-AS routing that its
interface connected to 1a is on the least cost path to 1c. Updates its
routing table accordingly.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 395 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Question
Question
Subnet x is in AS3 and also reachable from AS2. How does router 1d
know this?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 396 / 487
Network Layer Routing Algorithms
Hierarchical Routing
Question
Question
Subnet x is in AS3 and also reachable from AS2. How does router 1d
know this?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 396 / 487
Network Layer Routing Algorithms
Inter-AS Routing
The glue that holds the Internet together
I BGP: Border Gateway Protocol
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 397 / 487
Network Layer Routing Algorithms
I inter-AS: admin wants control over how its traffic routed, who
routes through its net.
I intra-AS: single admin, so no policy decisions needed
I hierarchical routing saves table size, reduced update traffic
(scalability)
I intra-AS: can focus on performance
I inter-AS: policy may dominate over performance
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 398 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 399 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 400 / 487
Network Layer Routing Algorithms
Routing table
Dr. Ertan Onur ofLab)
(WINS D before receiving A’s advertisement
CENG435 2017-2018 Fall 401 / 487
Network Layer Routing Algorithms
A’s advertisement
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 402 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 404 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 406 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 407 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 408 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 409 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 410 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 411 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 412 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 413 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 414 / 487
Network Layer Routing Algorithms
A router may learn about more than 1 route to destination AS, selects
route based on:
I local preference value attribute: policy decision
I shortest AS-PATH
I closest NEXT-HOP router: hot potato routing
I additional criteria
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 415 / 487
Network Layer Routing Algorithms
BGP messages:
I OPEN: opens TCP connection to peer and authenticates sender
I UPDATE: advertises new path (or withdraws old)
I KEEPALIVE: keeps connection alive in absence of UPDATES;
also ACKs OPEN request
I NOTIFICATION: reports errors in previous msg; also used to close
connection
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 416 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 417 / 487
Network Layer Routing Algorithms
I A advertises path AW to B
I B advertises path BAW to X
I Should B advertise path BAW to C?
I No way! B gets no “revenue” for routing CBAW since neither W nor
C are B’s customers
I B wants to force C to route to W via A
I B wants to route only to/from its customers!
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 418 / 487
Network Layer Routing Algorithms
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 419 / 487
Data Link Layer
Section 7
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 420 / 487
Data Link Layer
I Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1
I Error detection and correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2
I Multiple access protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3
I Switched local area networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4
I Link virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5
I Data center networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 421 / 487
Data Link Layer Introduction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 422 / 487
Data Link Layer Introduction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 423 / 487
Data Link Layer Introduction
Flow control
pacing between adjacent sending and receiving nodes
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 424 / 487
Data Link Layer Introduction
Error detection
Bit errors caused by signal attenuation, noise, fading etc. Receiver
detects presence of errors and signals sender for retransmission or
drops frame
Error correction
receiver identifies and corrects bit error(s) without resorting to
retransmission
Half- or full-duplex
with half duplex, nodes at both ends of link can transmit, but not at
same time
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 425 / 487
Data Link Layer Introduction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 426 / 487
Data Link Layer Introduction
Sending side
I encapsulates datagram in frame
I adds error checking bits, reliable data transfer, flow control, etc.
Receiving side
I looks for errors, reliable data transfer, flow control, etc
I extracts datagram, passes to upper layer at receiving side
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 427 / 487
Data Link Layer Introduction
1. Reliable data transfer: What are the mechanisms for reliable data
transfer and how do you use them?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 428 / 487
Data Link Layer Error Detection and Correction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 429 / 487
Data Link Layer Error Detection and Correction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 430 / 487
Data Link Layer Error Detection and Correction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 431 / 487
Data Link Layer Error Detection and Correction
Goal
detect ”errors” (e.g., flipped bits) in transmitted packet (note: used at
transport layer only)
I Sender
I treat segment contents as sequence of 16-bit integers
I checksum: addition of segment contents and then 1’s complement
of the sum
I sender puts checksum value into UDP checksum field
I Receiver
I treat segment contents as sequence of 16-bit integers
I expected result = addition of segment contents and the checksum
sent in the header
I if expected result = all 1’s then everything is ok
I Otherwise, the segment is corrupt
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 432 / 487
Data Link Layer Error Detection and Correction
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 433 / 487
Data Link Layer Error Detection and Correction
D × 2r ⊕ R = nG
D × 2r = nG ⊕ R
D × 2r
R = Remainder
G
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 434 / 487
Data Link Layer Medium Access Control
Point-to-point
consists of a single sender at one end of the link and a single receiver
at the other end of the link.
Broadcast link
can have multiple sending and receiving nodes all connected to the
same, single, shared broadcast channel. The term broadcast is used
here because when any one node transmits a frame, the channel
broadcasts the frame and each of the other nodes receives a copy.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 435 / 487
Data Link Layer Medium Access Control
Problem
How to coordinate the access of multiple sending and receiving nodes
to a shared broadcast channel
Collision
Because all nodes are capable of transmitting frames, more than two
nodes can transmit frames at the same time. When this happens, all of
the nodes receive multiple frames at the same time; that is, the
transmitted frames collide at all of the receivers. Typically, when there
is a collision, none of the receiving nodes can make any sense of any
of the frames that were transmitted; in a sense, the signals of the
colliding frames become inextricably tangled together.
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 436 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 437 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 438 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 439 / 487
Data Link Layer Medium Access Control
Channel partitioning
divide channel into smaller pieces (time slots, frequency, code) and
allocate piece to node for exclusive use
Random access
channel is not divided, allow collisions and we have to recover from
collisions
Taking turns
nodes take turns, but nodes with more to send can take longer turns
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 440 / 487
Data Link Layer Medium Access Control
Channel Partitioning
TDMA and FDMA
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 441 / 487
Data Link Layer Medium Access Control
Channel Partitioning
TDMA and FDMA
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 442 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 443 / 487
Data Link Layer Medium Access Control
I Assumptions
I all frames same size
I time divided into equal size slots (time to transmit 1 frame)
I nodes start to transmit only slot beginning
I nodes are synchronized
I if 2 or more nodes transmit in slot, all nodes detect collision
I Operation: when node obtains fresh frame, transmits in next slot
I if no collision: node can send new frame in next slot
I if collision: node retransmits frame in each subsequent slot with
prob. p until success
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 444 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 445 / 487
Data Link Layer Medium Access Control
Pros
I single active node can continuously transmit at full rate of channel
I highly decentralized: only slots in nodes need to be in sync
I simple
Cons
I collisions, wasting slots
I idle slots
I nodes may be able to detect collision in less than time to transmit
packet
I clock synchronization
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 446 / 487
Data Link Layer Medium Access Control
Efficiency
long-run fraction of successful slots (many nodes, all with many frames
to send)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 447 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 448 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 449 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 450 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 451 / 487
Data Link Layer Medium Access Control
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 452 / 487
Data Link Layer Medium Access Control
sensing
I longer back-off interval with more collisions
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 453 / 487
Data Link Layer Medium Access Control
Efficiency
Let dp be maximum propagation delay between two nodes and dt be
the time to transmit maximum size frame. Then, efficiency of
CSMA/CD is
1
ECSMA/CD = d
.
1 + 5 dpt
Check the limits,
lim ECSMA/CD → 1,
dp →0
and
lim ECSMA/CD → 1.
dt →∞
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 454 / 487
Data Link Layer Medium Access Control
Taking-turns Protocols
Polling
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 455 / 487
Data Link Layer Medium Access Control
Taking-turns Protocols
Token Passing
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 456 / 487
Data Link Layer Medium Access Control
Taking-turns Protocols
Example: Cable Access Network (DOCSIS)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 457 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 458 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 459 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 460 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 461 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 462 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 463 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 464 / 487
Data Link Layer Switched Local Area Networks
Star
prevails today; active switch in center; each spoke runs a (separate)
Ethernet protocol (nodes do not collide with each other)
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 465 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 466 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 467 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 468 / 487
Data Link Layer Switched Local Area Networks
Question
How does a switch know A’ is reachable via interface 4?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 470 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 471 / 487
Data Link Layer Switched Local Area Networks
Sending from A to G?
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 472 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 473 / 487
Data Link Layer Switched Local Area Networks
Port-based VLAN
switch ports grouped (by switch management software) so that single
physical switch operates as multiple virtual switches
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 474 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 475 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 476 / 487
Data Link Layer Switched Local Area Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 477 / 487
Data Link Layer Link Virtualization
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 478 / 487
Data Link Layer Link Virtualization
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 479 / 487
Data Link Layer Link Virtualization
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 480 / 487
Data Link Layer Link Virtualization
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 481 / 487
Data Link Layer Data Center Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 482 / 487
Data Link Layer Data Center Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 483 / 487
Data Link Layer Data Center Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 484 / 487
Data Link Layer Data Center Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 485 / 487
Data Link Layer Data Center Networks
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 486 / 487
Data Link Layer Data Center Networks
References I
Dr. Ertan Onur (WINS Lab) CENG435 2017-2018 Fall 487 / 487