Computer Network
Basics
An overview of computer networking
which introduces many key concepts
and terminology. Sets the stage for
future topics.
Components of any Computer
Computer Keyboard,
Mouse
Processor Memory Devices
(active) (passive)
Input
Control Disk,
(“brain”) (where
Output Network
programs,
Datapath data live
(“brawn”) when
running) Display,
Printer
Communication Devices
Synchronous communication uses a clock
signal separate from the data signal-
communication can only happen during the
‘tick’ of the timing cycle
Asynchronous communication does not use
a clock signal- rather, it employs a start
and stop bit to begin and end the irregular
transmission of data
Connecting to Networks (and
Other I/O)
Bus - shared medium of communication that
can connect to many devices
Hierarchy of Buses in a PC
Operating systems
Developer or manufacturer Operating system
Apple Computers Inc. Mac OS 8/9/X
AT&T Bell Laboratories Unix
Be Inc. beOS
Berkeley University BSD, FreeBSD
Carnegie-Mellon University Mach 3.0
Cisco Systems Inc. IOS
HP HP-UX
IBM AIX and OS/2
Linus Thorvald Linux
Microsoft Windows XP, Vista
Novell NetWare
Santa Cruz Operation Inc. (SCO) SCO XENIX, SCO UNIX, SCO MPX
Siemens SINIX
Silicon Graphics IRIX
Sun Microsystems Solaris, SunOS, JavaOS
Operating Systems Developed for
Portable Devices
Developer or manufacturer Operating system
Microsoft Windows CE
Microsoft Windows Mobile 6.0
Palm PalmOS
Symbian Symbian OS
RIM (Research In Motion Limited) RIM
A closer look at network structure:
network edge:
applications and
hosts
network core:
routers
network of
networks
General Architecture of Computer
Networks
External
nodes
Cloud
(or stations)
Internal nodes
(swithing devices)
The Network Core
mesh of interconnected
routers
the fundamental
question: how is data
transferred through net?
circuit switching:
dedicated circuit per
call: telephone net
packet-switching:
data sent thru net in
discrete “chunks”
Connection of Networks
router or
gateway
networks or subnetworks
node
(host,
station)
Network Topology
a) bus, b) star, c) ring, d) tree structure
a) b) c) d)
Classification of the networks according
to the connection establishing
Line switched network
Packet switched network
Radiating/data disseminating systems
Point-to-point connected networks
Wired media
Telephone line
Thin Coax
Thick Coax
Unshielded Twisted Pair (UTP)
Shielded Twisted Pair (STP)
Fibre
(Data) Reliability
A network service is (data) reliable
if the sender application can rely on
the error-free and ordered delivery
of the data to the destination
In the Internet the reliability can
obtained mainly by
acknowledgements and
retransmission
In such a way the losses in the
underlying layers can be retrieved
Flow-control and Congestion
Prevention
Flow-control: to protect the
receiver against the overload
I.e.: the sender (source) sends more
data than the receiver can process
it is mainly necessary in link and
transport level
Congestion prevention: to prevent
the intermediate nodes against the
overload
it is mainly necessary in network level
Overload and Congestion
Overload: Too many packets occur in a
subnetwork in the same time, which
prevent each other and in such a way
the throughput decreases
Congestion: the queues in the routers
are too long, the buffers are full.
As a consequence some packages are
dropped if the buffers of the routers are
overloaded
In extreme case: grid-lock, lock-up
Deadlock
Deadlock: the most serious situation of the
congestion, the routers wait for each other
Direct store and forward deadlock: the
buffers of two neighbouring routers are
full with the packets to be sent to the
other router
Indirect store and forward deadlock: the
deadlock occurred not between two
neighbouring routers but in a subnetwork,
where any of the routers has not free
buffer space for accepting packets
Review: Networking Definitions
Network: physical connection that allows two computers to
communicate
Packet: unit of transfer, bits carried over the network
Network carries packets from on CPU to another
Destination gets interrupt when packet arrives
Protocol: agreement between two parties as to how
information is to be transmitted
Broadcast Network: Shared Communication Medium
Delivery: How does a receiver know who packet is for?
Putheader on front of packet: [ Destination | Packet ]
Everyone gets packet, discards if not the target
Arbitration: Act of negotiating use of shared medium
Point-to-point network: a network in which every physical
wire is connected to only two computers
Switch: a bridge that transforms a shared-bus
(broadcast) configuration into a point-to-point network
Router: a device that acts as a junction between two
networks to transfer data packets among them
The Need for a Protocol Architecture
Procedures to exchange data between
devices can be complex
High degree of cooperation required
between communicating systems
destination addressing, path
readiness to receive
file formats, structure of data
how commands are sent/received and
acknowledged
etc.
Layered Protocol Architecture
Modules arranged in a vertical stack
Each layer in stack:
Performs related functions
Relies on lower layer for more primitive
functions
Provides services to next higher layer
Communicates with corresponding peer layer of
neighboring system using a protocol
Network Layering
Layering: building complex services from simpler ones
Each layer provides services needed by higher layers by utilizing services
provided by lower layers
The physical/link layer is pretty limited
Packets are of limited size (called the “Maximum Transfer Unit or MTU:
often 200-1500 bytes in size)
Routing is limited to within a physical link (wire) or perhaps through a
switch
Our goal in the following is to show how to construct a secure, ordered,
message service routed to anywhere:
Physical Reality: Packets Abstraction: Messages
Limited Size Arbitrary Size
Unordered (sometimes) Ordered
Unreliable Reliable
Machine-to-machine Process-to-process
Only on local area net Routed anywhere
Asynchronous Synchronous
Key Features of a Protocol
Set of rules or conventions to exchange
blocks of formatted data
Syntax: data format
Semantics: control information
(coordination, error handling)
Timing: speed matching, sequencing
Actions: what happens when an event
occurs
Operation of Protocols
Host Host
(n-1). layer (n-1). layer
protocol entity protocol entity
n. layer n. layer
protocol entity protocol entity
(n+1). layer (n+1). layer
protocol entity protocol entity
... ...
Physical connection
(interlayer) protocol layerprotocol
The OSI Model
Physical Layer
(Data) Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
Physical Layer
Transmission of energy onto the
medium
Collection of energy from the medium
This layer is concerned with the physical
transmission of raw bits
This bits are transmitted through
mechanical, electrical, and procedural
interfaces which include
• interface card standard
• modem standards
• certain portions of the ISDN and LAN MAN
standards
(Data) Link Layer
Transmission of frames over one link or network
Often subdivided into the MAC and LLC
It receives bits from the physical layer, converting bits
to frames
frame boundaries
Using protocols (e.g. HDLC), this layer corrects errors
that might have occurred during transmission across a link
In addition this layer provides an “error-free”
transmission channel to the next layer known as the
network layer: error control
ARQ
duplicates
Flow control
Network Layer I
The previous two layers were concerned with getting
error-free data across a link
The network layer establishes connections between nodes,
routes data packets through the network, and accounts for
them
End-to-end transmission of packets (possibly over multiple
links)
Controls the operation of the subnet
Routing
static
dynamic
Congestion control
At this stage, there may be congestion due to many packets waiting
to be routed
Some packets may be lost during congestion
Network Layer II
Accounting
packets
bytes
etc.
Internetworking
This layer is also concerned with internetworking
where there is ‘talking’ between technologies, such as
the traditional Internet connected to ATM
segmentation
addressing
sequencing
accounting
Broadcast subnets: thin network layer
Transport Layer I
This layer presumes the ability to pass
through a network and provides additional
services to end-users, such as and-to-and
packet reliability
End-to-end delivery of a complete message
(end-to-end communication path, usually
reliable)
Isolation from “hardware”
Multiplexing/demultiplexing
Divide message into packets
Reassemble (possibly out of order packets)
into the original message of the distant end
Transport Layer II
End-to-end flow control
Acknowledgments
Types of service
error-free, point-to-point, in sequence,
flow controlled
no correctness guarantees
no sequencing
Establishing/terminating connections
naming/addressing
intra-host addressing (process, ports)
Session Layer
This layer enables users to establish sessions across a
network between machines
In addition, it offers session management services
Set up and management of end-to-end conversation
Establish and terminate sessions
superset of connections
Assignment of logical ports
Dialogue control
Token management
for critical operations
Synchronization
checkpoints/restarts
Presentation Layer
This layer is concerned with the syntax and semantics of
messages, code conversions between machines, and other
data conversion services
Some of these services are data compression and data
encryption
Interface between lower layers and application
Formatting
Syntax & semantics of messages
Data encoding (e.g.: ASCII to EBCDIC)
Compression
Encryption/Decryption
Authentication
Application Layer
This layer provides support for the user's network
applications
Some application layer services have been standardized,
e.g.:
File Transfer and Management (FTAM)
Message Handling Services for electronic mail (X.400)
Directory Services (X.500)
Electronic Data Interchange (EDI)
Program you’re running,applications
file transfer, access & management
e-mail
virtual terminals
WWW
The OSI Protocol Stack
Endsystem Intermediate Intermediate Endsystem
Application Application
layer entity layer entity
Presentation Presentation
layer entity layer entity
Operation
Session layer Session layer
entity entity
of the Transport
layer entity
Transport
layer entity
model Network
layer entity
Network
layer entity
Network
layer entity
Network
layer entity
Datalink Datalink Datalink Datalink
layer entity layer entity layer entity layer entity
Physical layer Physical layer Physical layer Physical layer
entity entity entity entity
Physical medium
Virtual Real data
transmission transmission
Names of the Nodes, Connections and
Data Units
Layer name Node Connection Data unit
Application layer application network service e.g. file (ADU)
Presentation layer host session data structure (PPDU)
Session layer host transport connection message (SPDU)
Transport layer host network path message (TPDU)
Network layer host, router line (data)packet (NPDU)
(Data)link layer station (physical) channel (data)frame (LLC PDU)
Physical layer switch physical transmission bit
medium
Communication among the layers
Connection oriented network service
(virtual circuits, eg. ATM)
• Reliable transport service
• Unreliable transport service
Connectionless
network service
(datagram service, eg. IP)
• Reliable transport service (eg. TCP)
• Unreliable transport service (eg. UDP)
Network Tools
Repeater: connects network segments
logically to one network
Hub: multiport repeater
Bridge: datalink level connection of two
networks
Switch: multiport bridge
Router: connects networks that are
compatible in transport level
subnetworks are connected to the interfaces of
the repeater
Gateway (proxy server): router between
two individual network. The “Way Out”
Physical Layer Devices
Repeater
Hub
“dumb”
level-1 hub
multi-port repeater
Data Link Layer Devices
Bridge
Cascaded vs. Backbone
Single
Multiple
Switch (switched hub)
Routers
Provide link between networks
Accommodate network differences:
Addressing schemes
Maximum packet sizes
Hardware and software interfaces
Network reliability
Congestion/Traffic Management
Devices of the Network Connection
Application layer Application layer
Gateway
Presentation layer Presentation layer
or
Session layer Session layer
Proxy server
Transport layer Transport layer
Network layer Router or Gateway Network layer
Datalink layer Bridge or Switch Datalink layer
Physical layer Repeater or Hub Physical layer
Architectural Implementation of the
LANs
Ethernet (IEEE 802.3)
FDDI
GigabitEthernet
Token Bus (IEEE 802.4)
Token Ring (IEEE 802.5)
Characteristics of High-Speed LANs
Fast Ethernet Gigabit Ethernet Fibre Channel Wireless LAN
100 Mbps – 3.2
Data Rate 100 Mbps 1 Gbps, 10 Gbps 1 Mbps – 2 Gbps
Gbps
UTP,STP, Optical UTP, shielded Optical fiber, 2.4 GHz, 5 GHz
Transmission Mode
Fiber cable, optical fiber coaxial cable, STP Microwave
Access Method CSMA/CD CSMA/CD Switched CSMA/CA Polling
Supporting Fibre Channel
IEEE 802.3 IEEE 802.3 IEEE 802.11
Standard Association
Wide Area Network Connections
Solutions for connecting LANs to the
Internet
Ethernet (ring or star topology)
Managed Leased Line Network (MLLN)
ATM (Asynchronous Transfer Mode)
Switched line
ISDN line
Soft and Hard States
State: the data collection, which are necessary for
keeping the connection between two protocol entities
Hard state
If the connection is established once, it is never timed out, even
if it is not in usage
To cancel the connection one of the participants of the connection
must explicitly close it
The history of the state is stored
Soft state
To keep the connection the participants must send occasionally
keep-alive messages, since without keep-alive message the state
information is timed out after a certain period
The state is called as “soft” since in the ordinary operation the
state can change easily
The history of the state is not stored
Packet switching versus circuit switching
Is packet switching best in every case?
Great for bursty data
resource sharing
no call setup (less start-up delay)
However…
Packets can experience delays, so not for “real-time”
applications
excessive congestion leads to packet delay and loss
• protocols (like TCP) are needed for reliable data
transfer, and congestion control
Performance Considerations
Before continue, need some performance metrics
Overhead: CPU time to put packet on wire
Throughput: Maximum number of bytes per second
• Depends on “wire speed”, but also limited by slowest router (routing
delay) or by congestion at routers
Latency: time until first bit of packet arrives at receiver
• Raw transfer time + overhead at each routing hop
Router Router
LW1 LR1 LW2 LR2 Lw3
Contributions to Latency
Wire latency: depends on speed of light on wire
• about 1–1.5 ns/foot
Router latency: depends on internals of router
• Could be < 1 ms (for a good router)
Delay in packet-switched networks
packets experience delay Nodal processing:
check bit errors
on end-to-end path
determine output link
four sources of delay
Queueing:
at each hop
time waiting at output
link for transmission
depends on congestion
level of router
transmission
A propagation
B
nodal
processing queueing
Delay in packet-switched networks
Transmission delay: Propagation delay:
R=link bandwidth (bps) d = length of physical link
L=packet length (bits) s = propagation speed in
time to send bits into medium (~2x108 m/sec)
link = L/R propagation delay = d/s
transmission
A propagation
B
nodal
processing queueing
Queueing delay (revisited)
R=link bandwidth (bps)
L=packet length (bits)
a=average packet
arrival rate
traffic intensity = La/R
La/R ~ 0: average queueing delay small
La/R -> 1: delays become large
La/R > 1: more “work” arriving than can be
serviced, average delay infinite!
Internet protocol stack
Application: supporting network
applications
ftp, smtp, http
Transport: host-host data transfer
tcp, udp
Network: routing of datagrams from
source to destination
ip, routing protocols
Network access: data transfer between
neighboring network elements
ppp, ethernet
Physical: bits “on the wire”
Layering: logical communication
data
E.g.: transport application
transport
transport
take data from app
network
add addressing, link
reliability check physical
info to form ack network
“datagram” application link
send datagram to transport data physical
network
peer
link
wait for peer to data
physical
ack receipt application application
transport transport
transport
analogy: post network network
office link link
physical physical
Layering: physical communication
data
application
transport
network
link
physical
network
application link
transport physical
network
link
physical data
application application
transport transport
network network
link link
physical physical
Protocol layering and data
Each layer takes data from above
adds header information to create new data unit
passes new data unit to layer below
source destination
M application application M message
Ht M transport transport Ht M segment
Hn Ht M network network Hn Ht M datagram
Hl Hn Ht M link link Hl Hn Ht M frame
physical physical
IP over ATM
application
TCP/UDP
ATM Adaptation
IP
Layer (AAL):
AAL5
interface to upper
ATM
layers
physical
end-system
segmentation/rea
application
ssembly ATM
TCP/UDP
ATM Layer: cell IP
physical
switching AAL5
Physical application application
ATM
TCP/UDP TCP/UDP
physical
IP IP
AAL5 AAL5
ATM ATM
physical physical
The Internet Protocol Stack
Application
Application
Presentation
Sockets Session
TCP UDP Transport
IP Network
Data Link
Network Access
Physical
Network Protocols
Protocol: Agreement between two parties as to how
information is to be transmitted
Example: system calls are the protocol between the operating
system and application
Networking examples: many levels
• Physical level: mechanical and electrical network (e.g. how are 0 and 1
represented)
• Link level: packet formats/error control (for instance, the CSMA/CD
protocol)
• Network level: network routing, addressing
• Transport Level: reliable message delivery
Protocols on today’s Internet:
WWW e-mail
NFS ssh
RPC
Transport UDP TCP
Network IP
Physical/Link Ethernet ATM Packet radio
Building a messaging service
Process to process communication
Basic routing gets packets from machinemachine
What we really want is routing from processprocess
• Example: ssh, email, ftp, web browsing
Several IP protocols include notion of a “port”, which is
a 16-bit identifiers used in addition to IP addresses
• A communication channel (connection) defined by 5 items:
[source address, source port, dest address, dest port, protocol]
UDP: The User Datagram Protocol
UDP layered on top of basic IP (IP Protocol 17)
• Unreliable, unordered, user-to-user communication
IP Header
(20 bytes)
16-bit source port 16-bit destination port
16-bit UDP length 16-bit UDP checksum
UDP Data
Building a messaging service (con’t)
UDP: The Unreliable Datagram Protocol
Datagram: an unreliable, unordered, packet sent from
source user dest user (Call it UDP/IP)
Important aspect: low overhead!
• Often used for high-bandwidth video streams
• Many uses of UDP considered “anti-social” – none of the “well-
behaved” aspects of (say) TCP/IP
But we need ordered messages
Create ordered messages on top of unordered ones
• IP can reorder packets! P0,P1 might arrive as P1,P0
How to fix this? Assign sequence numbers to packets
• 0,1,2,3,4…..
• If packets arrive out of order, reorder before delivering to
user application
• For instance, hold onto #3 until #2 arrives, etc.
Sequence numbers are specific to particular connection
TCP/IP packet, Ethernet frame
Application sends message
Ethernet Hdr
TCP breaks into 64KB IP Header
segments, adds 20B header TCP Header
IP adds 20B header, sends EHIP Data
to network TCP data
If Ethernet, broken into Message
1500B frames with headers, Ethernet Hdr
trailers (24B)
All Headers, trailers have
length field, destination, ...