Title: School of Computing Science
1- School of Computing Science
- Simon Fraser University
- CMPT 880 Internet Architectures and Protocols
- Instructor Dr. Mohamed Hefeeda
-
2Course Objectives
- Understand
- principles of designing and operating computer
networks - structure and protocols of the Internet
- services that can/cannot be offered by the
Internet - Know how to
- analytically analyze performance of a
system/protocol - implement network protocols and applications
- And, more importantly,
- Have fun!
3Course Info
- Most of the course will be lectures given by the
instructor - Last three weeks, each student presents at most
one chapter/paper - Course web page
- http//nsl.cs.surrey.sfu.ca/teaching/06/880/
- Or access it from my web page
- http//www.cs.sfu.ca/mhefeeda
4Course Info Textbooks and References
- All are on reserve in SFU Surrey Library
- Kurose and Rose, Computer Networking A top-down
Approach Featuring the Internet, 2005 - Background materials
- Ch 7 Multimedia Networking and QoS
- Hassan and Jain, High Performance TCP/IP
Networking, 2004 - Several chapters on analyzing TCP/IP in different
environments - Stallings, High-speed Networks and Internets
Performance and Quality of Service, 2002 - Three chapters on (basics of) probability and
queuing - Papers will be posted on the course web page
5Course Info Grading
- Homework 20
- 3 4 problem sets
- Projects 30
- 3 projects later two of them are group projects
- Class participation 15
- Ask and answer questions
- Present one chapter/paper
- Final exam 35
- Comprehensive
6Course Info Schedule
- Schedule is posted on the course web page
- Let us quickly review it
7- Review of Basic Networking Concepts
8Review of Basic Networking Concepts
- Internet structure
- Protocol layering and encapsulation
- Internet services and socket programming
- Network Layer
- Network types Circuit switching, Packet
switching - Addressing, Forwarding, Routing
- Transport layer
- Reliability and congestion control
- TCP, UDP
- Link Layer
- Multiple Access Protocols
- Ethernet
9The Internet
- Millions of hosts (end systems)
- Inter-connected, running network apps
- Diverse communication links
- fiber, copper, radio, satellite
- Routers
- forward packets
- Internet network of networks
- loosely hierarchical
- Public, versus private intranet
10Cool Internet appliances
Web-enabled toaster weather forecaster
IP picture frame http//www.ceiva.com/
Worlds smallest web server http//www-ccs.cs.umas
s.edu/shri/iPic.html
Internet phones
11Internet structure network of networks
- roughly hierarchical
- at center tier-1 ISPs (e.g., MCI, Sprint,
ATT, Cable and Wireless), national/international
coverage - treat each other as equals
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
12Tier-1 ISP e.g., Sprint
Sprint US backbone network
13Internet structure Tier-2 ISPs
- Tier-2 ISPs smaller (often regional) ISPs
- Connect to one or more tier-1 ISPs, possibly
other tier-2 ISPs
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
14Internet structure Tier-3 ISPs
- Tier-3 ISPs and local ISPs
- last hop (access) network (closest to end
systems)
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
15Internet structure packet journey
- a packet passes through many networks!
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
16A snapshot of the Internet in 1999 showing major
ISPs
17Review of Basic Networking Concepts
- Internet structure
- Protocol layering and encapsulation
- Internet services and socket programming
- Network Layer
- Network types Circuit switching, Packet
switching - Addressing, Forwarding, Routing
- Transport layer
- Reliability and congestion control
- TCP, UDP
- Link Layer
- Multiple Access Protocols
- Ethernet
18Protocol Layers
- Networks are complex!
- many pieces
- hosts
- routers
- links of various media
- applications
- protocols
- hardware, software
- Question
- Is there any hope of organizing structure of
network? - Or at least our discussion of networks?
19Layering of Airline Functionality
- Layers each layer implements a service
- via its own internal-layer actions
- relying on services provided by layer below
20Why layering?
- Dealing with complex systems
- explicit structure allows identification,
relationship of complex systems pieces - modularization eases maintenance, updating of
system - change of implementation of layers service
transparent to rest of system - e.g., change in gate procedure doesnt affect
rest of system - What is the downside of layering?
21Internet 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
- link data transfer between neighboring network
elements - PPP, Ethernet
- physical bits on the wire
22Encapsulation
datagram
frame
23Review of Basic Networking Concepts
- Internet structure
- Protocol layering and encapsulation
- Internet services and socket programming
- Network Layer
- Network types Circuit switching, Packet
switching - Addressing, Forwarding, Routing
- Transport layer
- Reliability and congestion control
- TCP, UDP
- Link Layer
- Multiple Access Protocols
- Ethernet
24Internet Services
- View the Internet as a communication
infrastructure that provides services to apps - Web, email, games, e-commerce, file sharing,
- Two communication services
- Connectionless unreliable
- Connection-oriented reliable
25Internet Services
- Connectionless
- No connection set up, simply send
- Faster, less overhead
- No reliability, flow control, or congestion
control - UDP User Datagram Protocol
- Connection-oriented
- Prepare for data transfer ahead of time
- establish connection ? set up state in the two
communicating hosts - Usually comes with reliability, flow and
congestion control - TCP Transmission Control Protocol
How can we access these services?
26Network (Socket) Programming
- Process sends/receives messages to/from its
socket - Socket analogous to door
- sending process shoves message out door
- sending process relies on transport
infrastructure on other side of door which brings
message to socket at receiving process
controlled by app developer
Internet
controlled by OS
- Socket is the interface (API) between application
and transport layer
27Addressing Processes
- We use ports
- Process is identified by
- IP address,
- Transport protocol, and
- Port number
- Example port numbers
- HTTP server 80 (TCP)
- Mail server 25 (TCP)
- For a process to receive messages, it must have
an identifier - A host has a unique32-bit IP address
- Q does the IP address of the host on which the
process runs suffice for identifying the process? - A No, many processes can be running on same host
?
28Socket Programming
- Socket API
- introduced in BSD 4.1 UNIX, 1981
- explicitly created, used, released by apps
- client/server paradigm
- provides two services
- reliable, byte stream-oriented
- unreliable datagram
29Socket Programming using TCP
- TCP service reliable transfer of bytes from one
process to another - virtual pipe between sender and receiver
controlled by application developer
controlled by application developer
controlled by operating system
controlled by operating system
internet
host or server
host or server
30Socket Programming using TCP
Server (running on hostid)
Client
read reply from clientSocket
close connectionSocket
close clientSocket
31Socket Programming using TCP
- Server process must first be running, and
- creates a socket (door) that welcomes clients
contact, then wait - Client contacts server by creating local TCP
socket using IP address, port number of server
process - When client creates socket
- client TCP establishes connection to server TCP
- When contacted by client
- server TCP creates new socket for server process
to communicate with client - allows server to talk with multiple clients
- source port numbers and IPs used to distinguish
clients
32Socket programming using UDP
- UDP Service unreliable transfer of groups of
bytes (datagrams) between client and server - no connection between client and server
- no handshaking
- sender explicitly attaches IP address and port of
destination to each packet - server must extract IP address, port of sender
from received packet - transmitted data may be received out of order, or
lost
33Socket Programming using UDP
Server (running on hostid)
Client
34Review of Basic Networking Concepts
- Internet structure
- Protocol layering and encapsulation
- Internet services and socket programming
- Network Layer
- Network types Circuit switching, Packet
switching - Addressing, Forwarding, Routing
- Transport layer
- Reliability and congestion control
- TCP, UDP
- Link Layer
- Multiple Access Protocols
- Ethernet
35The 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
36Network Core Circuit Switching
- Network resources (e.g., bandwidth) divided into
pieces using - Frequency division multiplexing (FDM)
- Time division multiplexing (TDM)
- Pieces allocated to calls (connections)
- ? guaranteed performance
- Resource piece idle if not used by owning call
- no sharing
- Connection setup is required
- Examples
- (Traditional) Telephone network
37Circuit Switching Dedicated Circuits
38Network Core Packet Switching
- each end-end data stream divided into packets
- packets from different users share network
resources - each packet uses full link bandwidth
- resources used as needed
- store and forward packets move one hop at a time
- Node receives complete packet before forwarding
- resource contention
- aggregate resource demand can exceed amount
available - congestion packets queue, wait for link use
39Packet Switching Statistical Multiplexing
10 Mb/s Ethernet
C
A
statistical multiplexing
1.5 Mb/s
B
queue of packets waiting for output link
- Sequence of A B packets does not have fixed
pattern, shared on demand ? statistical
multiplexing - In contrast, in TDM each host gets same slot in
revolving TDM frame
40Packet Switching Efficiency
- Packet switching allows more users to use network!
- 1 Mb/s link
- each user
- 100 kb/s when active
- active 10 of time
- circuit-switching
- 10 users
- packet switching
- with 35 users, probability gt 10 active less than
0 .0004
Q how did we get value 0.0004?
41Packet Switching
- Advantages
- no call setup ? simpler
- resource sharing (statistical multiplexing) ?
- better resource utilization
- more users or faster transfer (a single user can
use entire bw) - Well suited for bursty traffic (typical)
- Disadvantages
- Congestion may occur ?
- packet delay and loss
- need protocols to control congestion and ensure
reliable data transfer
42Packet Switching Two Classes
- Datagram network
- Example The Internet
- Virtual-circuit network
- Examples ATM (Asynchronous Transfer Mode), frame
relay, X.25
43Packet-switched Datagram Networks
- no call setup at network layer
- routers no state about end-to-end connections
- no network-level concept of connection
- packets forwarded using destination host address
- packets between same source-dest pair may take
different paths
44Packet-switched VC Networks
- Source-to-dest path behaves much like telephone
circuit - ? performance-wise
- connection setup, teardown for each call before
data can flow - each packet carries VC identifier (not
destination address) - every router on source-dest path maintains state
for each passing connection - link, router resources (bandwidth, buffers) may
be allocated to VC - Examples
- ATM (Asynchronous Transfer Mode), frame relay,
X.25
45VC Networks Connection Setup
- Signaling protocols are used to
- setup, maintain, and teardown VCs
- Note not used in the current Internet
6. Receive data
5. Data flow begins
4. Call connected
3. Accept call
1. Initiate call
2. incoming call
46VC Networks VC Implementation
- A VC consists of
- Path from source to destination
- VC numbers, one number for each link along path
- Entries in forwarding tables in routers along
path - Packet belonging to VC carries same VC number
- VC number must be changed on each link
- New VC number comes from forwarding table
47VC Networks Forwarding table
Forwarding table in northwest router
Each routers maintains connection state
information!
48ATM vs. Internet QoS
Guarantees ?
Network Architecture Internet ATM ATM ATM ATM
Service Model best effort CBR VBR ABR UBR
Congestion feedback no (inferred via
loss) no congestion no congestion yes no
Bandwidth none constant rate guaranteed rate gua
ranteed minimum none
Loss no yes yes no no
Order no yes yes yes yes
Timing no yes yes no no
49Network Taxonomy
50Review of Basic Networking Concepts
- Internet structure
- Protocol layering and encapsulation
- Internet services and socket programming
- Network Layer
- Network types Circuit switching, Packet
switching - Addressing, Forwarding, Routing
- Transport layer
- Reliability and congestion control
- TCP, UDP
- Link Layer
- Multiple Access Protocols
- Ethernet
51Network Layer
- Network layer protocols in every host and router
- Network layers goal
- transport data from sending host to receiving
host - We focus on datagram networks (Internet)
52Network Layer in the Internet
- Host, router network layer functions
Transport layer TCP, UDP
Network layer
Link layer
physical layer
53Routing vs. Forwarding
- Routing
- determine route taken by packets from source to
destination - Routing algorithms, e.g., RIP, OSPF, BGP
- Forwarding
- move packets from routers input to appropriate
output - use forwarding table populated by routing
algorithm - E.g., IP forwarding function
54IP Datagram Format
IP protocol version number
32 bits
total datagram length (bytes)
header length (bytes)
head. len
type of service
ver
length
for fragmentation/ reassembly
fragment offset
Provides some QoS
flgs
16-bit identifier
max number remaining hops (decremented at each
router)
time to live
upper layer
Internet checksum
32 bit source IP address
32 bit destination IP address
upper layer protocol to deliver payload to
E.g. timestamp, record route taken, specify list
of routers to visit.
Options (if any)
data (variable length, typically a TCP or UDP
segment)
- how much overhead with TCP?
- 20 bytes of TCP
- 20 bytes of IP
- 40 bytes app layer overhead
IP ver 4.0
55IP Addressing Introduction
- IP address
- 32-bit identifier for each host, router network
interface - Represented in Dotted-decimal notation
11011111 00000001 00000001 00000001
223.1.1.1
56IP Addressing
- Network interface
- connection between host/router and physical link
- routers typically have multiple interfaces
- host typically has one interface
- Unique IP addresses associated with each interface
223.1.1.1
How do we assign IPs?
223.1.1.4
223.1.2.9
223.1.1.3
Divide network into subnets, each has a common ID
57Subnets
- Subnet is
- a group of devices that can reach each other
without intervening router - identified by high order bits of IP addresses
11011111 00000001 00000001 00000001
Host ID
Subnet ID
223.1.1.0/24
/24 bits in subnet portion of address, subnet
mask
58Subnets
- How many subnets?
- 6 subnets
- Recipe
- detach each interface from its host or router,
creating isolated networks - Each isolated network is a subnet
59IP Addressing CIDR
- CIDR Classless InterDomain Routing
- subnet portion of address of arbitrary length
- address format a.b.c.d/x, where x is bits in
subnet portion of address - Old Classful Addressing
- Subnet length had to be /8 (class A), /16 (class
B), /24 (class C) - Why CIDR?
- Finer control over address allocation ? reduce
waste of addresses - Ex company with 2000 machines would have to get
class B, wasting 63,000 addresses
60IP Addresses How to Get One?
- Q How does host get IP address?
- hard-coded by system admin in a file
- WIN control-panel-gtnetwork-gtconfiguration-gttcp/ip
-gtproperties - UNIX /etc/rc.config
- DHCP Dynamic Host Configuration Protocol
dynamically get address from as server - plug-and-play
61IP Addresses How to Get One?
- Q How does network get subnet part of IP addr?
- A gets allocated portion of its provider ISPs
address space
ISP's block 11001000 00010111 00010000
00000000 200.23.16.0/20 Organization 0
11001000 00010111 00010000 00000000
200.23.16.0/23 Organization 1 11001000
00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100
00000000 200.23.20.0/23 ...
..
. . Organization 7
11001000 00010111 00011110 00000000
200.23.30.0/23
62Hierarchical Addressing Route Aggregation
Hierarchical addressing allows efficient
advertisement of routing information
Organization 0
Organization 1
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16
ISPs-R-Us
63IP Addressing the last word...
- Q How does an ISP get block of addresses?
- A ICANN Internet Corporation for Assigned Names
and Numbers - allocates addresses
- manages DNS
- assigns domain names, resolves disputes