02computer Network Basics
02computer Network Basics
02computer Network Basics
Basics
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
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) b) c) d)
Classification of the networks according
to the connection establishing
Telephone line
Thin Coax
Thick Coax
Unshielded Twisted Pair (UTP)
Shielded Twisted Pair (STP)
Fibre
(Data) Reliability
n. layer n. layer
protocol entity protocol entity
... ...
Physical connection
Physical Layer
(Data) Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
Physical Layer
Establishing/terminating connections
naming/addressing
intra-host addressing (process, ports)
Session Layer
Synchronization
checkpoints/restarts
Presentation Layer
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
Physical medium
Repeater
Hub
“dumb”
level-1 hub
multi-port repeater
Data Link Layer Devices
Bridge
Cascaded vs. Backbone
Single
Multiple
Congestion/Traffic Management
Devices of the Network Connection
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
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)
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
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 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, ...