Title: Introduction to Networking
1Introduction to Networking
2Announcements
- Homework 4 due today, Thursday, October 30th
- Prelim II will be Thursday, November 20th, in
class - Nazrul will teach next two Tuesdays, November
4th and 11th - Make sure to attend class and to vote Nov 4th
3Goals for today
- Introduction to Networking
- Motivated by distributed systems
- Overview
- Layered Architecture
- ISO and Internet Protocols
- Addressing
- Routing
- Circuit vs Packet Switching
4Centralized vs Distributed Systems
- Centralized System System in which major
functions are performed by a single physical
computer - Originally, everything on single computer
- Later client/server model
- Distributed System physically separate computers
working together on some task - Early model multiple servers working together
- Probably in the same room or building
- Often called a cluster
- Later models peer-to-peer/wide-spread
collaboration
5Distributed Systems
- Definition
- Loosely coupled processors interconnected by
network - Distributed system is a piece of software that
ensures - Independent computers appear as a single coherent
system - Lamport A distributed system is a system where
I cant get my work done because a computer that
Ive never heard of has failed
6Why use distributed systems?
- These are now a requirement
- Economics dictate that we buy small computers
- Cheap way to provide reliability
- We all need to communicate
- It is much easier to share resources
- Allows a whole set of distributed applications
- A whole set of future problems need machine
communication - Collaboration Much easier for users to
collaborate through network resources (such as
network file systems)
7Distributed Systems Issues
- The promise of distributed systems
- Higher availability one machine goes down, use
another - Better durability store data in multiple
locations - More security each piece easier to make secure
- Reality has been disappointing
- Worse availability depend on every machine being
up - Lamport a distributed system is one where I
cant do work because some machine Ive never
heard of isnt working! - Worse reliability can lose data if any machine
crashes - Worse security anyone in world can break into
system - Coordination is more difficult
- Must coordinate multiple copies of shared state
information (using only a network) - What would be easy in a centralized system
becomes a lot more difficult
8Distributed Systems Goals
- Connecting resources and users
- Transparency the ability of the system to mask
its complexity behind a simple interface - Location Cant tell where resources are located
- Migration Resources may move without the user
knowing - Replication Cant tell how many copies of
resource exist - Concurrency Cant tell how many users there are
- Parallelism System may speed up large jobs by
splitting them into smaller pieces - Fault Tolerance System may hide various things
that go wrong in the system - Openness portability, interoperability
- Scalability size, geography, administrative
- Transparency and collaboration require some way
for different processors to communicate with one
another
9Software Concepts
System Description Main Goal
Distributed OS Tightly coupled OS for multiprocessors and homogeneous m/cs Hide and manage hardware resources
Networked OS Loosely coupled OS for heterogeneous computers, LAN/WAN Offer local services to remote clients
Middleware Additional layer atop NOS implementing general-purpose services Provide distribution transparency
10Some Applications
- Air traffic control
- Banking, stock markets
- Military applications
- Health care, hospital automation
- Telecommunications infrastructure
- E-commerce, e-cash
-
11Few Challenges
- No shared clocks
- How to order events
- No shared memory
- Inconsistent system state
- Scalability
- Fault tolerance
- Availability, recoverability
- Consensus
- Self management
- Security
12Networking
- Middleware gives guarantees not provided by
networking - How do you connect computers?
- Local area network (LAN)
- Wide area network (WAN)
- Let us consider the example of the Internet
13Internet Example
- Click -gt get page
- specifies - protocol (http) - location
- (www.cnn.com)
14Internet Locating Resource
- www.cnn.com
- name of a computer
- Implicitly also a file (index.html)
- Map name to internet protocol (IP) address
- Domain name system (DNS)
cnn.com?
cnn.com?
host
local
com
a.b.c.d
a.b.c.d
15Internet Connection
- Http (hyper-text transport protocol) sets up a
connection - TCP connection (transmission control protocol)
- between the host and cnn.com to transfer the page
- The connection transfers page as a byte stream
- without errors flow control error control
Host
www.cnn.com
Connect
OK
Get page
Page close
16Internet End-to-end
- Byte stream flows end to end across many
links/switches - routing ( addressing)
- That stream is regulated and controlled by both
ends - retransmission of erroneous or missing bytes
flow control
17Internet Packets
- The network transports bytes grouped into packets
- Packets are self-contained routers handle them
1 by 1 - The end hosts worry about errors and pacing
- Destination sends ACKs Source checks losses
18Internet Bits
- Equipment in each node sends packets as string of
bits - That equipment is not aware of the meaning of the
bits - Frames (packetizing) vs. streams
19Internet Points to remember
- Separation of tasks
- send bits on a link transmitter/receiver clock,
modulation, - send packet on each hop framing, error
detection, - send packet end to end addressing, routing
- pace transmissions detect congestion
- retransmit erroneous or missing packets acks,
timeout - find destination address from name DNS
- Scalability
- routers dont know full path
- names and addresses are hierarchical
20Internet Challenges
- Addressing ?
- Routing ?
- Reliable transmission ?
- Interoperability ?
- Resource management ?
- Quality of service ?
21Concepts at heart of the Internet
- Protocol
- Layered Architecture
- Packet Switching
- Distributed Control
- Open System
22Protocol
- Two communicating entities must agree on
- Expected order and meaning of messages they
exchange - The action to perform on sending/receiving a
message
23Layered Architectures
- How computers manage complex protocol processing?
- Break-up design problem into smaller problems
- More manageable
- Decompose complicated jobs into layers
- each has a well defined task
- Specify well defined protocols to enact.
- Modular design
- easy to extend/modify.
- Difficult to implement
- careful with interaction of layers for efficiency
24Layered Architecture
users
network
Applications
Web, e-mail, file transfer, ...
Reliable/ordered transmission, QOS, security,
compression, ...
Middleware
End-to-end transmission, resource allocation,
routing, ...
Routing
Point-to-point links, LANs, radios, ...
Physical Links
25The OSI Model
- Open Systems Interconnect (OSI)
- standard way of understanding conceptual layers
of network comm. - This is a model, nobody builds systems like this.
- Each level
- provides certain functions and guarantees
- communicates with the same level on remote notes.
- A message
- generated at the highest level
- is passed down the levels, encapsulated by lower
levels - until it is sent over the wire.
- On the destination
- Encapsulated message makes its way up the layers
- until the high-level message reaches its
high-level destination.
26OSI Levels
Node A
Application
Node B
Application
Presentation
Presentation
Session
Session
Transport
Transport
Network
Network
Data Link
Data Link
Physical
Physical
Network
27OSI Levels
- Physical Layer
- electrical details of bits on the wire
- Data Link Layer
- sending frames of bits and error detection
- Network Layer
- routing packets to the destination
- Transport Layer
- reliable transmission of messages,
disassembly/assembly, ordering, retransmission of
lost packets - Session Layer
- really part of transport, typ. Not impl.
- Presentation Layer
- data representation in the message
- Application
- high-level protocols (mail, ftp, etc.)
28The ISO Network Message
29The Internet Protocol Layers
30Internet protocol stack
users
network
Application
HTTP, SMTP, FTP, TELNET, DNS,
Transport
TCP, UDP.
Network
IP
Point-to-point links, LANs, radios, ...
Physical
31Air travel
Passenger Origin
Passenger Destination
Ticket (purchase)
Ticket (complain)
Baggage (check)
Baggage (claim)
Gates (load)
Gates (unload)
Runway (take off)
Runway (landing)
Airplane routing
32Protocol stack
user X
user Y
English
e-mail client
e-mail server
SMTP
TCP server
TCP server
TCP
IP server
IP
IP server
IEEE 802.3 standard
ethernet driver/card
ethernet driver/card
electric signals
33Protocol interfaces
user X
user Y
e-mail client
e-mail server
TCP server
TCP server
s open_socket() socket_write(s, buffer)
IP server
IP server
ethernet driver/card
ethernet driver/card
34Socket
- A communication end-point unique to a machine
- An Internet socket is composed of the following
- Protocol (TCP, UDP, etc)
- Local IP address
- Address of local machine
- Local port
- Identifier for local process on local machine
- Remote IP address
- Address of remote machine
- Remote port
- Identifier for remote process on remote machine
35Addressing
- Each network interface has a hardware MAC address
- Multiple interfaces ? multiple addresses
- Each application communicates via a port
- Port is a logical connection endpoint
- Allows multiple local applications to use network
resources - Up to 65,535
- lt 1024 used by privileged applications
- 1024 available for use 49151
- 49152 Dynamic ports/private ports 65535
- http ports 80 and 8080
- ssh 20, telnet 23, ftp 21, etc
- Think of a telephone network
36Addressing and Packet Format
- The Data'' segment contains higher level
protocol information. - Which protocol is this packet destined for?
- Which process is the packet destined for?
- Which packet is this in a sequence of packets?
- What kind of packet is this?
- This is the stuff of the OSI reference model.
Start (7 bytes)
Destination (6)
Source (6)
Length (2)
Msg Data (1500)
Checksum (4)
37Ethernet packet dispatching
- An incoming packet comes into the Ethernet
controller. - The Ethernet controller reads it off the network
into a buffer. - It interrupts the CPU.
- A network interrupt handler reads the packet out
of the controller into memory. - A dispatch routine looks at the Data part and
hands it to a higher level protocol - The higher level protocol copies it out into user
space. - A program manipulates the data.
- The output path is similar.
- Consider what happens when you send mail.
38Example Mail
Hi Dad.
Hi Dad.
Mail Composition And Display
SrcAddr 128.95.1.2 DestAddr 128.95.1.3 SrcPort
110, DestPort 110Bytes 1-20
SrcAddr 128.95.1.2 DestAddr 128.95.1.3 SrcPort
110, DestPort 110Bytes 1-20
Mail Transport Layer
User
Kernel
Network Transport Layer
SrcEther 0xdeadbeef DestEther 0xfeedface
SrcEther 0xdeadbeef DestEther 0xfeedface
Link Layer
SrcAddr 128.95.1.2 DestAddr 128.95.1.3 SrcPort
100 DestPort 200Bytes 1-20
SrcAddr 128.95.1.2 DestAddr 128.95.1.3 SrcPort
100 DestPort 200Bytes 1-20
Network
39Protocol encapsulation
user X
user Y
Hello
e-mail client
e-mail server
Hello
TCP server
TCP server
Hello
IP server
IP server
Hello
ethernet driver/card
ethernet driver/card
Hello
40End-to-End Argument
- What function to implement in each layer?
- Saltzer, Reed, Clarke 1984
- A function can be correctly and completely
implemented only with the knowledge and help of
applications standing at the communication
endpoints - Argues for moving function upward in a layered
architecture - Should the network guarantee packet delivery ?
- Think about a file transfer program
- Read file from disk, send it, the receiver reads
packets and writes them to the disk
41End-to-End Argument
- If the network guaranteed packet delivery
- one might think that the applications would be
simpler - No need to worry about retransmits
- But need to check that file was written to the
remote disk intact - A check is necessary if nodes can fail
- Consequently, applications need to perform their
retransmits - No need to burden the internals of the network
with properties that can, and must, be
implemented at the periphery
42End-to-End Argument
- An Occams razor for Internet design
- If there is a problem, the simplest explanation
is probably the correct one - Application-specific properties are best provided
by the applications, not the network - Guaranteed, or ordered, packet delivery,
duplicate suppression, security, etc. - The internet performs the simplest packet routing
and delivery service it can - Packets are sent on a best-effort basis
- Higher-level applications do the rest
43Two ways to handle networking
- Circuit Switching
- What you get when you make a phone call
- Dedicated circuit per call
- Packet Switching
- What you get when you send a bunch of letters
- Network bandwidth consumed only when sending
- Packets are routed independently
- Message Switching
- Its just packet switching, but routers perform
store-and-forward
44Circuit Switching
- End-to-end resources reserved for call
- Link bandwidth, switch capacity
- Dedicated resources no sharing
- Circuit-like (guaranteed) performance
- Call setup required
45Packet Switching
- Each end-to-end data stream divided into packets
- Users packets share network resources
- Compared to dedicated allocation
- Each packet uses full link bandwidth
- Compared to dividing bandwidth into pieces
- Resources are used as needed
- Compared to resource reservation
- Resource contention
- Aggregate demand can exceed amount available
- Congestion packets queue, wait for link use
- Store and forward packets move one hop at a time
- Transmit over link
- Wait turn at next link
46Routing
- Goal move data among routers from source to
dest. - Datagram packet network
- Destination address determines next hop
- Routes may change during session
- Analogy driving, asking directions
- No notion of call state
- Circuit-switched network
- Call allocated time slots of bandwidth at each
link - Fixed path (for call) determined at call setup
- Switches maintain lots of per call state
resource allocation
47Packet vs. Circuit Switching
- Reliability no congestion, in-order data in
circuit-switch - Packet switching better bandwidth use
- State, resources packet switching has less state
- Good less control plane processing resources
along the way - More data plane (address lookup) processing
- Failure modes (routers/links down)
- Packet switch reconfigures sub-second timescale
- Circuit switching more complicated
- Involves all switches in the path
48A small Internet
W
b,e4
w,e5
B
V
Scenario A wants to send data to B.
R
r3
r2,e2
r1,e1
a,e3
A
49Packet forwarding
Host A
Host B
Router R
Router W
HTTP
HTTP
TCP
TCP
IP
IP
IP
IP
eth
link
eth
link
ethernet
ethernet
50Summary (1/2)
- Network physical connection that allows two
computers to communicate - Packet unit of transfer, sequence of bits
carried over the network - Protocol Agreement between two parties as to how
information is to be transmitted - Internet Protocol (IP)
- Used to route messages through routes across
globe - 32-bit addresses, 16-bit ports
- Reliable, Ordered, Arbitrary-sized Messaging
- Built through protocol layering on top of
unreliable,
51Summary(2/2)
- Layering
- building complex services from simpler ones
- End-to-end argument
- Application-specific properties are best provided
by the applications, not the network - Packet vs Circuit Switching
- Post card (packet) vs phone call (circuit)
- Bandwidth and congestion
- Packet - better bandwidth usage, but potentially
congested links - Circuit - no congenstion, but potentially lower
link utilization - Failures and reconfiguration
- Packet - Failed routed detected and routed around
- Circuit - reconfigure entire path if any router
fails