CH 1
CH 1
CH 1
Foundation
1
Building a Network
• What available technologies would be the building blocks ?
• What software architecture would you design to integrate these
building blocks into an effective communication service?
• Which has the potential
– to grow to global proportions,
– to support diverse applications
• such as teleconferencing,
• video-on demand,
• electronic commerce,
• distributed computing and
• digital libraries?
• Answering this question is our goal.
2
What distinguishes a computer
network from other networks?
• At one time a network meant serial lines used
to attach dumb terminals to mainframes.
• To others it is a voice telephone network, or
the cable network used to disseminate video
signals.
• Each of these is specialized to handle one
particular kind of data (keystrokes, voice,
video)
3
What distinguishes a computer
network from other networks?
• Most important characteristic of a computer
network is its generality:
– Built from general-purpose programmable
hardware
– Is able to carry many different types of data
– Supports a wide, every growing range of
applications
4
Understanding How to Build a
Network
Explores:
1. The requirements that different people and
applications place on a network
2. The network architecture that lays the
foundation
3. The key elements in the implementation of
computer networks
4. The key metrics that are used to evaluate the
performance of networks.
5
Applications
• Most people know the Internet through its
applications:
– World Wide Web
– Email
– Streaming Audio and Video
– Chat Rooms
– Music and File Sharing
6
World Wide Web
• The web presents an intuitively simple interface.
• Users view pages of text and graphics, click on objects and
another page appears.
• Each page is bound to an identifier or Uniform Resource
Locator (URL) which uniquely names the page.
( For example, http://www.mkp.com/pd4e )
• Most are unaware that by clicking on the URL as many as 17
messages are sent across the Internet to translate the server
name, set up the TCP connection, get the HTTP request,
respond with the requested page, and to tear down the
connection. ( See p.4)
7
Streaming Audio and Video
• Video files can be fetched like web pages, this
involves waiting.
• Streaming video implies a source that generates a
stream (using a video capture card), sends it across
the Internet in messages, and then the sink
displays it.
• Video is not an application, it is a type of data.
Video-on-demand, which reads from an existing
disk and transmits it over a network. Another
application is videoconferencing, which has tight
time constraints and is bi-directional. 8
Videoconferencing
(a)
(b)
14
Links, Nodes and Clouds
• If computers networks were limited to situations
where all nodes were directly connected to each
other, the networks would be very limited or the
wires would become both unmanageable and very
expensive.
• Connectivity does not always require a direct
physical connection – indirect connectivity may
be achieved among a set of cooperating nodes.
15
Links, Nodes and Clouds
Switch
A Switched Network
16
Links, Nodes and Clouds
• In a switched network, there are nodes that
run software, which forwards data received
on one link, out onto another.
– Circuit switched - used by the phone company
– Packet switched – used by computer networks
• Packet switched networks send discrete
blocks of data (file, email message, image)
and use a store and forward protocol.
17
Links, Nodes and Clouds
21
Multiplexing
L1 R1
L2 R2
Sw itch 1 Sw itch 2
L3 R3
22
Cost-Effective Resource Sharing
• Multiplexing –system resource is shared among
multiple users
– Synchronous Time-Division multiplexing (STDM)
• Divides time into equal size quanta and in round robin order gives
each system a chance to send data
– Frequency-Division Multiplexing (FDM)
• Transmits at different frequencies (like TV channels)
– Statistical Multiplexing – most efficient
• Transmits like STDM, except on demand, without wasted cycles
• Uses a limited size block called a packet
23
Switches
■■■
26
Channels
Host
Host Application
Channel
Host
Application
Host Host
27
Channels
• Network provides logical channels over
which application level processes can
communicate with each other.
• Think of a channel as a “pipe” connecting
applications.
• Determine the functionality that the channel
should provide: guaranteed delivery, correct
sequence, encrypted and secure, etc.
28
Common Communication Patterns
• FTP – File Transfer Protocol
• NFS – Network File System
• Requires a pair of processes
– Client – requests access to a server
– Server process that supports access to the file
• Reading – client sends a request message and the
server responds with a large message containing
data.
• Writing –client sends large data message and server
responds, confirming the write to disk
• A Digital library works in similar manner 29
Common Communication
Patterns
• Types of channels may be used together:
– Request/reply channels for file transfer and digital
library applications – to guarantee that only one copy of
the message was sent and received, and to protect
privacy
– Message /stream channel- used by video-on-demand
and videoconferencing could support one and two way
traffic, and support different delay properties.
– New types of channels will continue to be designed
30
Channel Functionality
• What functionality channel provides
• Where that functionality is implemented
– Often seen as a “bit-pipe with high level
semantics provided at the end hosts ( keeps the
network simple)
– Alternative is to push functionality onto
switches, allowing hosts to be “dumb” devices
31
Reliability
• Reliable message delivery is one of the most
important functions that a network provides.
• Major requirement of a network is to hide
failures and make it appear reliable.
• Classes of failure
– Bit errors, burst errors
– Packet loss
– Node or link level failure (computer crash)
32
Network Architecture
• Networks must provide general, cost-effective, fair,
robust connectivity among a large number of
computers.
• These networks must evolve over time to
accommodate changes in technologies and
applications.
• General blueprints, called a network architecture,
guide the design and implementation of a network.
33
Layering and Protocols
• When system gets complex
– Define unifying model that captures and important
aspect of the system,
– Encapsulates this model in an object that provides an
interface
– And hides the details of how the object is implemented
from the users
• We provide an abstraction for applications that
hide the complexity of the network from
application writers.
34
Layering and Protocols
• Abstractions lead to layering, since you start
with the services offered by the hardware, and
then add layers, each providing a more abstract
(higher) level of services.
• High level services are implemented in terms of
low layers.
• Layering provides two features:
– It decomposes the problem of building a network
into more manageable components.
– It provides a more modular design.
35
Layered Networks
Application programs
Process-to-process channels
Host-to-host connectivity
Hardware
36
Layered Networks
Sometimes there are multiple abstraction provided by a level,
Providing different services and building on the same lower level.
Application programs
Request/reply Message stream
channel channel
Host-to-host connectivity
Hardware
Service
High-level interface High-level
object object
39
Protocols
• In other words, a protocol defines a
communication service that it exports
locally, along with a set of rules governing
the messages that the protocol exchanges
with its peers.
• Simply a protocol is a set of rules,
governing communication on a network.
40
Protocol Graph
• Except at hardware level where peers communicate
directly, peer-to-peer communication is indirect-
peers pass messages to a lower level protocol,
which then delivers it to its peer.
• Represent the suite of protocols that make up a
network system with a protocol graph.
– The nodes correspond to protocols
– The edges represent a depends-on relation
41
Protocol Graph
Host 1 Host 2
43
Protocols and Network
Architecture
• Standardization bodies establish policies for
protocol graphs:
• ISO – International Standards Organization
• IETF –Internet Engineering Task Force
• Set of rules governing the form and content
of a protocol graph is called a Network
Architecture.
44
Encapsulation
• When a message is sent ( such as from the RRP
(Request/Reply Protocol) to the HHP (Host-To-
Host Protocol) it is sent as a string of bytes.
• RRP must communicate to its peer, how to handle
the information. It attaches a header with control
information.
• The data being transmitted is called the body or
payload.
• We say that the data is encapsulated in the new
message.
45
Message Encapsulation
Host Host
Application
Application Application
Application
program
program program
program
Data Data
RRP RRP
HHP HHP
48
OSI Architecture
• A second standards organization, the
International Telecommunications Union
(ITU), publishes a set of protocol
specifications based on the OSI architecture
and called the”X dot” series since the
networks have names like X.25, X.400, etc.
49
OSI Architecture
End host End host
Application Application
Presentation Presentation
Session Session
Transport Transport
http://computer.howstuffworks.com/osi1.htm 54
Functions of the 7 Layers
• Application Set
– Layer 7: Application - This is the layer that actually interacts
with the operating system or application whenever the user
chooses to transfer files, read messages or perform other
network-related activities.
– Layer 6: Presentation - Layer 6 takes the data provided by the
Application layer and converts it into a standard format that the
other layers can understand.
– Layer 5: Session - Layer 5 establishes, maintains and ends
communication with the receiving device.
55
Functions of the 7 Layers
• Transport Set
– Layer 4: Transport - This layer maintains flow control of data and
provides for error checking and recovery of data between the devices.
Flow control means that the Transport layer looks to see if data is
coming from more than one application and integrates each
application's data into a single stream for the physical network. It
provides reliable delivery of the data ( error checking, etc.)
– Layer 3: Network - The way that the data will be sent to the recipient
device is determined in this layer. Logical protocols, routing and
addressing are handled here.
– Layer 2: Data - In this layer, the appropriate physical protocol is
assigned to the data. Also, the type of network and the packet
sequencing is defined.
– Layer 1: Physical - This is the level of the actual hardware. It defines
the physical characteristics of the network such as connections,
56
voltage levels and timing.
OSI Headers
Multiple Nested Headers
Each layer (except the physical) places additional
information in a header before sending data to a lower layer.
The header corresponding to the lowest level protocol occurs
first.
57
Internet Architecture
• Also called the TCP/IP Architecture
• Evolved from the packet switched
ARPANET ( Advanced Research Projects
Agency) of the Department of Defense.
• Influenced the OSI model
• Usually shown as a 4 or 5 layer model
58
Internet Architecture
Special Features
1. Does not imply strict layering
2. Has “hourglass shape” design philosophy- with
IP as its central feature ( See protocol graph)
3. To propose a new protocol, both a protocol
specification and at least one representative
implementations must be provided.
59
Internet Protocol Graph
TCP UDP
IP
■■■
NET 1 NET 2 NET n
60
Internet Architecture
1. At lowest or Network Layer there are many
protocols, called NET1, NET2, NET3, etc.,
implemented by a combination of hardware (Ethernet
or Fiberoptics)
2. Internet Layer - Internet Protocol (IP) supports
connection of multiple networks
3. Transport Layer –reliable Transmission Control
Protocol (TCP) and unreliable User Datagram
Protocol (UDP) –alternative logical channels to
applications.
4. Application Layer – FTP, SMTP, Telnet, HTTP
61
Internet Architecture
5 Layer Internet Model
62
Implementing Network Software
• Number of computers connected to the
Internet has been doubling every year since
1981 and is approaching 350 million
• Number of people who use the Internet is
over 1 billion
• Since 2001, the number of bits transmitted
over the Internet has surpassed the
corresponding data for the phone system.
63
Why Is the Internet so
Successful?
• Good architecture
• So much of its functionality is provided by
software running in general purpose computers,
so new functions can easily be added
• Massive increase in computing power available
• Scalable
64
Application Programming
Interfaces (Sockets)
• To implement a network application, start with the
interface called the Application Programming
Interface (API).
• Nearly all systems implement their network protocols
as part of their Operating System.
• Socket interface, part of Berkeley Unix, is now
supported by all OSs.
• Just because two systems support the same API, does
not mean that their file system, process, or graphic
interfaces are the same. 65
Application Programming
Interfaces (Sockets)
• A Socket is the point where a local
abstraction process attaches to the network.
• The interface defines operations for creating
a socket, attaching the socket to the
network, sending/receiving messages
through the socket, and closing the socket.
66
Using Sockets with TCP
• Create a socket
int socket(int domain, int type, int protocol);
• Next step depends on whether you are a client
or a server;
– Server – passive operation – prepared to accept a
connection
– Client – performs an active open operation
67
Server
• Invokes three operations:
int bind(int socket,struct sockaddr *address, int addr.len)
int listen(int socket,int backlog)
int accept( int socket,struct sockaddr *address,int addr.len)
68
Client
• On the client machine, the application process
performs an active open operation:
int connect(int socket,struct sockaddr *address, int addr.len)
• The operation does not return until TCP has
successfully established a connection
• Then the application process invokes:
int send( int socket, char *message, int msg.len, int flags)
int recv( int socket, char *buffer, int buf.len, int flags)
69
Example Application
• Uses the socket interface to send messages over
a TCP connection ( simplified version of the
Unix talk program, similar to web chat room)
• Client – calls gethostbyname –translates remote
host name to IP address
– Constructs address data structure (sin), and socket,
using the TCP port 5432 (server port)
– Calls socket and connects, then reads text from input
and sends it over the socket
70
Example Application
• Server
– Constructs the address data structure, filling in its port
number
– Does not specify IP address, willing to accept
connection from any local host’s IP address
– Creates the socket, binds it to the local address, and sets
the maximum number of pending connections allowed.
– Finally waits for remote hots to connect, then receives
and prints out characters that arrive on connection.
71
Protocol Implementation Issues
• Tempted to use the API ( eg. Sockets) between
every pair of protocol in the proctol stack, but
that is inefficient.
• Two primary differences between the network
API and the protocol-to-protocol interface:
– Process models
– Message buffers
72
Process Model
• Most OSs provide a process abstraction or a thread.
Each process runs independently of others, allowing
concurrent execution and requiring context
switches.
• Process-per-protocol model each protocol is
implemented by a separate process, passed from one
protocol to another, requiring context switch
• Process-per-message model treats each process as
a static piece of code, associated with the message,
requiring only a procedure call – more efficient than
context switch 73
Alternative Process Models
(a) (b)
a) Process-per-protocol b) Process-per-message
74
Process Model
• Relationship between the service interface and the
process model
• For outgoing message-high level protocol invokes a
send operation with the message, on the lower level
protocol
• For incoming messages, high level protocol invokes the
receive operation and waits for message to arrive,
forcing a context switch.
• Most implementations replace receive with deliver
operation, for efficiency
75
Protocol-to-Protocol Interface
TCP
IP
76
Message Buffers
• Application process provides a buffer into which
messages are copied for send and receive operations.
• Copying is a very expensive operation
• Instead- define an abstract data type that is shared by
all protocols.
• Permits messages to be passed up and down protocol
graph, and permits manipulating them by adding and
removing headers, etc.
• Usually involve a linked list of pointers to message
buffers
77
Buffering
Application process
send()
deliver()
Topmost protocol
79
Performance
• Networks are expected to perform well.
• Old adage “first get it right, then make it fast”
somewhat necessary
• Today it is necessary to “design for performance”.
• Performance is measured in
bandwidth (also called throughput) and
latency (also called delay).
80
Network Performance
Characteristics -Delay
Delay is the time it takes for a bit of data to travel
across the network form one computer to another
Propagation delay - time to travel across medium,
usually proportional to the distance
Switching delay - time for network component (hub,
bridge, packet switch) to forward data ( waits for all
bits in a packet and then chooses the next hop)
Access delay - time to get control of medium
(CSMA/CD, token)
Queuing delay - time enqueued in packet switches on
a store and forward WAN
81
Network Performance
Characteristics -Throughput
Throughput measures rate at which data can be
transmitted in network
300 bps (bits per second) - old modems
1 Gbps (gigabit [109] bits per second = 1000Mbps) -
fastest today
Bandwidth - limit of underlying hardware
• Effective throughput - real data delivery, slightly less
than throughput, upper bound of throughput
• Throughput is sometimes called the "speed" of the
network, but delay and throughput are separate ideas.
82
• Throughput is a measure of capacity NOT speed
Highway Analogy
• Imagine a network is like a road between two cities.
83
Highway Analogy
• A road that can accept one car every 5 seconds
has a throughput of 0.2 cars/sec.
• If a car requires 30 seconds to travel the entire
road, the road has a delay of 30 seconds.
• What happens if you add a second lane? You
double the capacity. Now 2 cars can enter
every 5 seconds, so the throughput has
doubled to 0.4 cars/sec.
• The delay remains the same since it still takes
30 seconds to travel the entire distance.
84
Delay and Throughput
• Remember:
• Network delay is measured in seconds
and specifies how long a bit travels in
the network.
• Network throughput is measured in
bits per second and specifies how many
bits can enter the network per unit time.
(Network capacity)
85
Delay-Throughput Relationship
• In theory delay and throughput are
independent; in practice they can be related.
Think of the highway analogy:
• If cars enter the highway at uniform time
intervals, and travel at uniform speed,
they are spaced uniformly along the road.
• If a car slows down, those behind it slow
down, causing congestion.
86
Calculating Delay
88
Bandwidth and Latency
• Bandwidth or Throughput – number of bits transmitted
in a unit of time (eg. 10 Mbps – 10 million bit per second);
– On a 10 Mbps network, it takes 0.1 microsecond (sec) to
transmit each bit
• Bandwidth is influenced by how often the software has to
handle and transform the data bits
• Can think of bandwidth as how many bits in a distance
• Latency or delay– how long it takes a message to travel
form one end of the network to the other. Measured in term
of time.
• RTT – round trip time –from one end to the other and back
89
Bandwidth
(a)
(b)
93
Perceived Latency
10,000
5000
2000
1000
500
10
1
10 100
RTT (ms) 94
How Big is Mega?
• Use b for bits, B for bytes
• milli (m) = 10-3
• Kilo (K) = 103 or 210
• Mega (M) = 106 or 220
• Giga (G) = 109 or 230
• Some useful approximations
– 100 ms cross country RRT
– 1 ms local area network RTT
95
Delay x Throughput Product
• Another interesting characteristic is the delay-
throughput (or delay-bandwidth) product.
• Again think of the highway analogy:
• When cars enter the highway at a fixed rate of T
cars per second, it takes a car D seconds to travel
the full road distance.
• T x D additional cars will have entered the road by
the time the first car has made a complete trip.
• Thus there can be a total of T x D cars on the road
at any one time. 96
Delay x Throughput Product
The product of delay and throughput measures the
volume of data that can be present on a network.
Computed as delay time multiplied by effective
throughput
• Measures amount of data that can be present in
the network
• In fast networks with long delay times, sending
computer can generate large amounts of data
before destination receives first bit
97
Delay x Bandwidth Product
• Think of a channel also as a hollow pipe where
latency is length and bandwidth is the diameter
and product is the volume
• If latency (in time) is length and width of bits ( in
time) then product is how many bits fit in the
pipe.
• Channel latency 50 ms, bandwidth 45 Mbps can
hold:
50 x 10-3 sec x 45 x 106 bit/sec =2.25 x106 bits
98
Network as a Pipe
Delay
Bandw idth
99
High Speed Networks
• Available bandwidths are increasing dramatically
• Latency does not improve at the same rate
• Latency starts to dominate network design
• Can think about more data being transmitted
during each RTT on a high speed network
100
Relationship Between Bandwidth and
Latency
1-Mbps cross-country link
Source Destination
.1 Mb
.1 Mb
.1 Mb
.
.
.
.1 Mb
(a)
1 MB
(b)
102
Throughput and Latency
• Throughput = TransferSize/TransferTime
• TransferTime = RTT +1/Bandwidth x TransferSize
104
Jitter
• Delay requirements are more complex that “as
little delay as possible”.
• What often matters more than the delay is how
much the delay varies from packet to packet.
• Jitter is the variation in latency and is becoming
more important as networks are used for the
transmission of real time voice and video.
• Often caused by queuing delay in network
• Can smooth out jitter by storing frames in a buffer
105
Network Induced Jitter
Interpacket gap
4 3 2 1 4 3 2 1
Packet Packet
source
Network sink
106
Summary
• Network must provide cost-effective connectivity
among a set of computers.
• Need to define a layered architecture to be a design
blueprint. Central objects are protocols. Most widely
used architectures:
– OSI Architecture
– Internet Architecture
• Protocols and applications need to be implemented and
used an interface, usually a socket
• Networks must offer high performance, measured by
latency and throughput and using the delay x
bandwidth product for network design 107
Additional Resources
• OSI PowerPoint
http://www.cs.rpi.edu/~hollingd/netprog/notes/osi/osi.ppt
• Seven Layer Model
http://networking.ringofsaturn.com/Protocols/sevenlayer.php
http://en.wikipedia.org/wiki/OSI_model
http://www.rhyshaden.com/osi.htm
http://www.techexams.net/technotes/ccna/osimodel.shtml
• Practice Quiz ( from Certification Exam)
http://gocertify.com/quizzes/osi/
108