Sie sind auf Seite 1von 88

CS/IS 235

Computer Networks and


Telecommunications
Darija Novi

These slides are adapted from Tanenbaum and Wetherall

Goals of This Course


To learn how the Internet works
Why? - Curiosity: Incredibly rapid growth!
- Societal and Economic Impact

To learn the fundemantals of networks


to understand basic concepts of network architectures, topologies,
protocols, transmission principles
to understand the layered architecture of networks and protocols
and their design issues
to be familiar with most common protocols in a layered network
architecture and their use in todays networks
Why? - Apply to all computer networks
- Intellectual interest
- Change / reinvention

Implement the course concepts in Labs on networked


computers or embedded networked devices

Course Outline

Introduction to computer networks


Physical layer
Data Link layer
Medium Access Control Sublayer (MAC)

Network layer

Transport layer
Application layer

Coursework
In class quizzes: 9%
Lab and homework assignments: 21%
Individual and group assignments

Midterm exam: 20%


Final exam: 50%

Resources
Textbook:
Andrew Tanenbaum & David Wetherall: Computer
Networks, 5th edition, Pearson

Additional Reading:
Kurose and Ross: Computer Networking: A Top-Down
Approach, 6/e, Pearson
Behrouz A. Forouzan: Data Communications and
Networking, McGraw-Hill Science/Engineering/Math; 5th
edition
Barrie Sosinsky: Networking Bible, first edition, Wiley
Articles related to networks and telecommunications in
International Journals (IEEE, Elsevier, ACM, JSCSE)

Chapter 1: Introduction

Uses of Computer Networks


Network Hardware
Network Software
Reference Models
Example Networks
Network Standardization
Metric Units

Uses of Computer Networks


Computer networks are collections of autonomous
computers, e.g., the Internet
They have many uses:
Business Applications
Home Applications
Mobile Users
These uses raise:
Social Issues
This text covers networks for all of these uses

Business Applications
Resource sharing with the client-server model:

request
response

Many users may access the same underlying resource


More cost effective than dedicated resources per user

User communication: email, VoIP, Video conferencing,


Instant messaging
e-commerce

Home Applications
Homes contain many networked devices, e.g., computers,
TVs, connected to the Internet by cable, DSL, wireless, etc.
Home users communicate, e.g., social networks, consume
content, e.g., video, and transact, e.g., auctions
Some application use the peer-to-peer model in which
there are no fixed clients and servers:

Mobile Users
Tablets, laptops, and smart phones are popular devices;
WiFi hotspots and 3G cellular provide wireless connectivity.
Mobile users communicate, e.g., voice and texts, consume
content, e.g., video and Web, and use sensors, e.g., GPS.
Wireless and mobile are related but different:

Social Issues

Network neutrality no network restrictions


Content ownership, e.g., DMCA takedowns
Anonymity and censorship
Privacy, e.g., Web tracking and profiling
Theft, e.g., botnets and phishing

Network Hardware

Parts of a Network
app

app

host
PC
server
wireless
laptop
smartphone

router

link
wireless
links
wired
links

host

Component Names
Component

Function

Example

Application, or app,
user

Uses the
network

Skype, iTunes,
Amazon

Host, or end-system, Runs


edge device, node,
(supports)
source, sink
network apps

Laptop, mobile,
desktop

Router, or switch,
node, hub,
intermediate system

Relays
messages
between links

Access point,
cable/DSL modem

Link, or channel

Connects
nodes

Wires, wireless

Types of Links
Two types of transmission technology:
Point-to-point: connect individual pairs of
machines (unicasting)
Broadcast: communication channel shared by all
machines on the network e.g.wireless network

Network names by scale


Scale

Type

Example

Vicinity

PAN (Personal Area


Network)

Bluetooth (e.g.,
headset)

Building

LAN (Local Area Network)

WiFi, Ethernet

City

MAN (Metropolitan Area


Network)

Cable, DSL

Country

WAN (Wide Area Network)

Large ISP

Planet

The Internet (network of all


networks)

The Internet!

Personal Area Network


Connect devices over the range of a person
Example of a Bluetooth (wireless) PAN:

Local Area Networks


Connect devices in a home or office building
Called enterprise network in a company

Wireless LAN
with 802.11

Wired LAN with


switched Ethernet

Metropolitan Area Networks


Connect devices over a metropolitan area
Example MAN based on cable TV:

Wide Area Networks (1)


Connect devices over a country
Example WAN connecting three branch offices:

Wide Area Networks (2)


An ISP (Internet Service Provider) network is also a WAN.
Customers buy connectivity from the ISP to use it.

Wide Area Networks (3)


A VPN (Virtual Private Network) is a WAN built from
virtual links that run on top of the Internet.

Internetworks
An internetwork or internet: any larger network made up
of smaller component interconnected networks.
The worldwide Internet (with a capital I): the set of all
connected networks - network of all networks
Intranet: a computer network, for example within an
organization, that uses the same technology as the
Internet

Network Boundaries
What part is the network?
What part represents an ISP?

app

host

router

link

Network Boundaries
What part is the network?
What part represents an ISP?

app

host

router

link

Cloud as a generic network

Network Software

Protocol layers
Design issues for the layers
Connection-oriented vs. connectionless service
Service primitives
Relationship of services to protocols

Networks Need Modularity


The network does much for apps:
Make and break connections
Find a path through the network
Transfers information reliably
Transfers arbitrary length information
Send as fast as the network allows
Shares bandwidth among users
Secures information in transit
Lets many new hosts be added

Networks Need Modularity


The network does much for apps:
Make and break connections
Find a path through the network
We need a form of
Transfers information reliably
modularity, to help
Transfers arbitrary length information
manage complexity
Sendand
as fast
as thereuse
network allows
support
Shares bandwidth among users
Secures information in transit
Lets many new hosts be added

Protocol Layers (1)


Protocol layering is the main structuring method used to
divide up network functionality.
Each protocol instance
talks virtually to its peer
Each layer communicates
only by using the one below
Lower layer services are
accessed by an interface
At bottom, messages are
carried by the medium

Protocol Layers (2)


Example: the philosopher-translator-secretary architecture
Each protocol at different layers serves a different purpose

Organization of air travel


ticket (purchase)

ticket (complain)

baggage (check)

baggage (claim)

gates (load)

gates (unload)

runway takeoff

runway landing

airplane routing

airplane routing
airplane routing

a series of steps

Layering of airline functionality


ticket (purchase)

ticket (complain)

ticket

baggage (check)

baggage (claim

baggage

gates (load)

gates (unload)

gate

runway (takeoff)

runway (land)

takeoff/landing

airplane routing

airplane routing

airplane routing
departure
airport

airplane routing

airplane routing

intermediate air-traffic
control centers

arrival
airport

layers: each layer implements a service

via its own internal-layer actions


relying on services provided by layer below

Whats a protocol?
A human protocol and a computer network protocol:
Hi

TCP connection
request

Hi

TCP connection
response

Got the
time?

2:00

<file>
time

Protocols define format, order of msgs sent


and received among network entities, and
actions taken on msg transmission, receipt

Protocols and Layers


Protocols youve probably heard
of:

TCP, IP, 802.11, Ethernet, HTTP,


SSL, DNS, and many more

An example protocol stack

Used by a web browser on a host


that is wirelessly connected to the
Internet

Browser

HTTP
TCP
IP
802.11

Protocol Layers (3)


Each lower layer adds its own header (with control information) to the message to transmit and removes it on receive

Layers may also split and join messages, etc.

Encapsulation
Encapsulation is the mechanism used to effect protocol
layering
HTTP
TCP HTTP
IP TCP HTTP

802.3 IP TCP HTTP

HTTP

HTTP

TCP

TCP

IP

IP

802.3

802.3
(wire)

802.3 IP TCP HTTP

HTTP
TCP HTTP
IP TCP HTTP

802.3 IP TCP HTTP

Encapsulation
Normally draw message like this:
Each layer adds its own header
802.11
First bits on the wire

IP

TCP

HTTP
Last bits

More involved in practice


Trailers as well as headers, encrypt/compress contents
Segmentation (divide long message) and reassembly

Demultiplexing
Incoming message must be passed to the
protocols that it uses
SMTP

HTTP
TCP

DNS

UDP
IP

ARP
Ethernet
??

Demultiplexing (2)
Done with demultiplexing keys in the headers
SMTP
TCP port number

HTTP

TCP

DNS

UDP

IP protocol field

IP

Ethertype value

Ethernet

Host

Ethernet

IP

TCP

ARP

Incoming
message
HTTP

Advantage of Layering
Using information hiding to connect different systems

Browser

Server

HTTP

IP TCP

HTTP

TCP

TCP

IP

IP

IP

802.11 Ethernet

802.11

802.11

HTTP

IP TCP

HTTP

Ethernet IP TCP

IP
Ethernet

HTTP

Disadvantage of Layering
Adds overhead
But minor for long messages

Hides information
App might care whether it is running over wired or
wireless!

Design Issues for the Layers


Each layer solves a particular problem but must include
mechanisms to address a set of recurring design issues
Issue

Example mechanisms at different layers

Reliability despite
failures

Codes for error detection/correction (3.2, 3.3)


Routing around failures (5.2)

Network growth
and evolution

Addressing (5.6) and naming (7.1)


Protocol layering (1.3)

Allocation of resources
like bandwidth

Multiple access (4.2)


Congestion control (5.3, 6.3)

Security against
various threats

Confidentiality of messages (8.2, 8.6)


Authentication of communicating parties (8.7)

Connection-Oriented vs. Connectionless


Service provided by a layer may be kinds of either:
Connection-oriented, must be set up for ongoing use
(and torn down after use), e.g., phone call
Connectionless, messages are handled separately,
e.g., postal delivery

Service Primitives (1)


A service is provided to the layer above as primitives
Hypothetical example of service primitives that may provide
a reliable byte stream (connection-oriented) service:

Service Primitives (2)


Hypothetical example of how these primitives may be used
for a client-server interaction
Server

Client

LISTEN (0)
CONNECT (1)

Connect request
Accept response

SEND (3)
RECEIVE

Request for data


Reply

DISCONNECT (5)

ACCEPT (2)
RECEIVE

SEND (4)

Disconnect
Disconnect

DISCONNECT (6)

Relationship of Services to Protocols


Recap:
A layer provides a service to the one above

[vertical]
A layer talks to its peer using a protocol
[horizontal]

Reference Models
What functionality should we implement at which layer?
This is a key design question
Reference models provide frameworks that guide us
Reference models describe the layers in a network
architecture

OSI reference model


TCP/IP reference model
Model used for this text
Critique of OSI and TCP/IP

OSI Reference Model


A principled, international standard, seven layer model to
connect different systems
Provides functions needed by users
Converts different representations
Manages task dialogs
Provides end-to-end delivery
Sends packets over multiple links
Sends frames of information
Sends bits as signals

Influential, but not used in practice

The OSI reference model

TCP/IP Reference Model


A four layer model derived from experimentation; omits
some OSI layers and uses the IP as the network layer.

IP is the
narrow waist
of the Internet

Protocols are shown in their respective layers

Layer-based Names
For units of data:
Layer

Unit of Data

Application

Message

Transport

Segment

Network

Packet

Link

Frame

Physical

Bit

For devices in the network:


Repeater (or hub)

Switch (or bridge)

PhysicalPhysical
Link

Link

Network Network

Router

Proxy or
gateway

Link

Link

App

App

Transport Transport
Network Network

Link

Link

Model Used in the Book


It is based on the TCP/IP model but we call out the
physical layer and look beyond Internet protocols.

Critique of OSI & TCP/IP


OSI:
+ Very influential model with clear concepts
Models, protocols and adoption all bogged down by politics
and complexity

TCP/IP:
+ Very successful protocols that worked well and thrived
Weak model derived after the fact from protocols

Network Standardization
Where all the protocols come from!
Focus is on interoperability
Standards define what is needed for interoperability
Some of the many standards bodies:
Body

Area

Examples

ITU

Telecommunications

G.992, ADSL
H.264, MPEG4

IEEE

Communications

802.3, Ethernet
802.11, WiFi

IETF

Internet

RFC 2616, HTTP/1.1


RFC 1034/1035, DNS

W3C

Web

HTML5 standard
CSS standard

Metric Units
The main prefixes we use:

Prefix Exp.

prefix exp.

K(ilo) 103

m(illi) 10-3

M(ega) 106

(micro) 10-6

G(iga) 109

n(ano) 10-9

Use powers of 10 for rates, powers of 2 for storage


E.g., 1 Mbps = 1,000,000 bps, 1 KB = 1024 bytes

B is for bytes, b is for bits

Example Networks

The Internet
3G mobile phone networks
Wireless LANs
RFID and sensor networks

Rough Internet Timeline


Estimated Hosts
109

3: Modern
Internet & Web

106

2: NSFNET

103

1: ARPANET
1969

1982

1995

2013

Year

Telephone vs. Distributed switching system


Leading up to the ARPANET (1960s):

Packet switching (Kleinrock, Davies), decentralized control (Baran)

(a) Structure of the telephone system. (b) Baran's proposed distributed


switching system.

ARPANET
Before the Internet was the ARPANET, a decentralized, packetswitched network based on Barans ideas; killer app: e-mail

Nodes are
IMPs, or early
routers, linked
to hosts

56 kbps links

Growth of the ARPANET. (a) December 1969. (b) July 1970. (c)
March 1971. (d) April 1972. (e) September 1972.

NSFNET
The early Internet used NSFNET (1985-1995) as its
backbone; universities connected to get on the Internet

56kbps links in 1978


T1 links (1.5 Mbps) in 1988

Early Internet Architecture


Hierarchical, with NSFNET as the backbone
56 kbps links in 85
1.5 Mbps links in 88
45 Mbps links in 91

NSFNET Backbone

Regional
Network

Customer

Customer

Regional
Network

Customer

Customer

Regional
Network

Customer

Customer

Modern Internet
The modern Internet is more complex:
ISP networks serve as the Internet backbone
ISPs connect or peer to exchange traffic at IXPs
Within each network routers switch packets
Between networks, traffic exchange is set by
business agreements
Customers connect at the edge by many means
Cable, DSL, Fiber-to-the-Home, 3G/4G wireless, dialup

Data centers concentrate many servers (the cloud)


Most traffic is content from data centers (esp. video)
The architecture continues to evolve

Modern Internet Architecture

A closer look at network structure:


Network edge:

hosts: clients and servers


servers often in data
centers

Access networks,
physical media:

mobile network
global ISP

home
network

Wired/wireless
communication links

Network core:

Interconnected routers
network of networks

institutional
network

regional ISP

Access networks and physical media


Q: How to connect end
systems to edge router?

residential access nets

institutional access networks


(school, company)

mobile access networks


keep in mind:

bandwidth (bits per second)


of access network?

shared or dedicated?

The network core


mesh of interconnected
routers
packet-switching: hosts
break application-layer
messages into packets
forward packets from one
router to the next, across
links on path from source
to destination
each packet transmitted at
full link capacity

Packet Switching
10 Mbs
Ethernet

statistical multiplexing
1.5 Mbs

queue of packets
waiting for output
link
D

45 Mbs

Each end-end data stream divided into packets


user A, B packets share network resources
each packet uses full link bandwidth
resources used as needed

Circuit Switching
End-end resources
reserved for call
link bandwidth, switch
capacity
dedicated resources: no
sharing
circuit-like (guaranteed)
performance
call setup required

Internet structure: network of networks

End systems connect to Internet via access ISPs


(Internet Service Providers)
Residential, company and university ISPs
Access ISPs in turn must be interconnected.
So that any two hosts can send packets to each other
Resulting network of networks is very complex
Evolution was driven by economics and national
policies
Lets take a stepwise approach to describe current
Internet structure

Internet structure: network of networks


Question: given millions of access ISPs, how to connect
them together?
access
net

access
net

access
net

access
net

access
net

access
net

access
net

access
net

access
net

access
net

access
net
access
net

access
net

access
net

access
net

access
net

Internet structure: network of networks


Option: connect each access ISP to every other access
ISP?
access
net
access
net

access
net

access
net

access
net

access
net

access
net

connecting each access ISP


to each other directly doesnt
scale: O(N2) connections.

access
net

access
net

access
net

access
net
access
net

access
net

access
net

access
net

access
net

Internet structure: network of networks


Option: connect each access ISP to a global transit ISP?
Customer and provider ISPs have economic agreement.
access
net

access
net

access
net

access
net

access
net

access
net

access
net

global
ISP

access
net

access
net

access
net

access
net
access
net

access
net

access
net

access
net

access
net

Internet structure: network of networks


But if one global ISP is viable business, there will be
competitors . which must be interconnected
Internet exchange point
access
access
access
net

net

net

access
net

access
net

IXP

access
net

access
net

ISP A
IXP

access
net

ISP C
access
net

peering link

access
net
access
net

access
net

access
net

access
net

access
net

ISP B

access
net

Internet structure: network of networks


and regional networks may arise to connect access nets
to ISPS
access
net

access
net

access
net

access
net

access
net

IXP

access
net

access
net

ISP A
IXP

access
net

ISP C
access
net

regional net

access
net
access
net

access
net

access
net

access
net

access
net

ISP B

access
net

Internet structure: network of networks


and content provider networks (e.g. Google, Microsoft) may run
their own network, to bring services, content close to end users
access
net

access
net

access
net

access
net

access
net

IXP

access
net

access
net

Content provider network


IXP

access
net

access
net

ISP B

ISP B
access
net

regional net

access
net
access
net

access
net

access
net

access
net

ISP A

access
net

Internet structure: network of networks


Tier 1 ISP

Tier 1 ISP
IXP

IXP

Regional ISP

access
ISP

access
ISP

Google

access
ISP

access
ISP

IXP

Regional ISP

access
ISP

access
ISP

access
ISP

access
ISP

at center: small # of well-connected large networks


tier-1 commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national &
international coverage
content provider network (e.g, Google): private network that connects

3G Mobile Phone Networks (1)


3G network is based on spatial cells; each cell provides
wireless service to mobiles within it via a base station

3G Mobile Phone Networks (2)


Base stations connect to the core network to find other
mobiles and send data to the phone network and Internet

3G Mobile Phone Networks (3)


As mobiles move, base stations hand them off from one
cell to the next, and the network tracks their location

Handover

Wireless LANs (1)


In 802.11, clients communicate via an AP (Access Point)
that is wired to the rest of the network.

Wireless LANs (2)


Signals in the 2.4GHz ISM band vary in strength due to
many effects, such as multipath fading due to reflections

requires complex transmission schemes, e.g., OFDM

Wireless LANs (3)


Radio broadcasts interfere with each other, and radio
ranges may incompletely overlap
CSMA (Carrier Sense Multiple Access) designs are used

RFID and Sensor Networks (1)


Passive UHF RFID networks everyday objects:
Tags (stickers with not even a battery) are placed on objects
Readers send signals that the tags reflect to communicate

RFID and Sensor Networks (2)


Sensor networks spread small devices over an area:
Devices send sensed data to collector via wireless hops

Problems

Problems
1. Imagine that you have trained your St. Bernard, Bernie, to carry a box
of three 8-mm tapes instead of a flask of brandy. (When your disk fills
up, you consider that an emergency.) These tapes each contain 7
gigabytes. The dog can travel to your side, wherever you may be, at 18
km/hour.
For what range of distances does Bernie have a higher data rate than a
transmission line whose data rate (excluding overhead) is 150 Mbps?
How does your answer change if :
(i) Bernies speed is doubled;
(ii) each tape capacity is doubled;
(iii) the data rate of the transmission line is doubled.
2. An image is 1600 1200 pixels with 3 bytes/pixel. Assume the image is
uncompressed. How long does it take to transmit it over a 56-kbps
modem channel? Over a 1-Mbps cable modem? Over a 10-Mbps
Ethernet? Over 100-Mbps Ethernet? Over gigabit Ethernet?

Problems
3. A client-server system uses a satellite network, with the satellite at a height
of 40,000 km. What is the best-case delay in response to a request?
Answer: The request has to go up (form client to satellite) and down (from satellite
to server) and the response has to go up and down (viceversa). The total path
length traversed is thus 4x40,000km=160,000 km.
The speed of light in air and vacuum is 300,000 km/sec, so the propagation delay
alone is160,000/300,000 sec or about 533 msec.
4. A system has an n-layer protocol hierarchy. Applications generate
messages of length M bytes. At each of the layers, an h-byte header is
added. What fraction of the network bandwidth is filled with headers?
Answer: With n layers and h bytes added per layer, the total number of header bytes
per message is hn, so the space wasted on headers is hn. The total message size is
M + nh, so the fraction of bandwidth wasted on headers is hn/(M + hn).
Note: This estimate does not take into account fragmentation (one higher layer
message is sent as multiple lower layer messages) or aggregation (multiple higher
layer messages are carried as one lower layer message) that may be present. If
fragmentation is used, it will raise the overhead. If aggregation is used, it will lower
the overhead.

Problems