CPS 356: Introduction to Computer Networks
Lecture 2: Network Architectures
Xiaowei Yang
Reference: Chapter 1 of [PD]
Overview
• Updated course administrative stuff– Grading policy, office hours, piazza
• Design requirements of the original Internet
• Concepts of Network Architectures
• An Example of how the Internet works
Updated Grading Policy• Old
– Class participation and pop quizzes: 20%– Assignments: 50%
• In a group assignment, both students get the same grade for the assignment
– Exams: 30%
• New– Class participation and pop quizzes: 10%– Assignments: 60%
• In a group assignment, both students get the same grade for the assignment
– Exams: 30%
Office hours
• Instructor– Fridays: 3-5pm
• TA– Tuesdays 7-9pm
Discussion Forum
• Piazza sign up link– piazza.com/duke/spring2014/compsci356
Overview
• Updated course administrative stuff– Grading policy, office hours, piazza
• Design requirements of the original Internet
• Concepts of Network Architectures
• An Example of how the Internet works
1st Mission of this course
• Understand the concepts and design principles that make the Internet work
• Design paradigm– Identify requirements, brainstorm design choices/mechanisms,
make design decisions– What requirements make sense to you?
• Scalable connectivity• Cost-effective resource sharing• Support for different types of services• Manageability• …
– It remains an open challenge how to incorporate other requirements such as security into the Internet design
Features of computer networks
• Generality
• Carry many different types of data
• Support an unlimited range of applications
What’s the Internet?
• The Internet is a large-scale general-purpose computer network.– Run more than one applications
• The Internet transfers data between computers.
• The Internet is a network of networks.
Design requirements and techniques to meet them
1. Scalable connectivity
2. Cost-effective resource sharing
3. Support for common services
4. Manageability
1. Scalable Connectivity
• A network must provide connectivity among a set of computers– Open vs close: to connect all computers or a subset of them?
– Internet is an open network
• Scalability: A system is designed to grow to an arbitrary large size is said to scale– How to connect an arbitrary large number of computers on a
network?
Connectivity recursively occurs at different levels
• Link-level: connect two or more computers via a physical medium
• Computers are referred to as nodes
• The physical medium is referred to as a link
Point-to-Point
Multiple-Access
Switching
• Switching is a mechanism to achieve connectivity • Nodes that are attached to at least two links forward data from one
link to another link• They are called switches• Computers outside the cloud are called hosts• A question: switch vs router, what can become a switch?
• Circuit switching– Sets up a circuit before nodes can communicate– Switches connect circuits on different links
• Packet switching– Data are split into blocks of data called packets– Store and forward– Nodes send packets and switches forward them
• An internetwork of networks– Each cloud is a network/a multiple-access link
– A node that is connected to two or more networks is commonly called a router• Speaks different protocols than switches
– An internet can be viewed as a “cloud.” We can recursively build larger clouds by connecting smaller ones
– Autonomous system (AS)
Internetworking:Another way to achieveconnectivity
Addressing and routing
• Physical connectivity != connectivity• Addressing and routing are mechanisms to achieve connectivity• Nodes are assigned addresses• Routers compute how to reach them by running routing protocols
– intra-AS: OSPF, RIP, IS-IS– Inter-AS: BGP
2. Cost-effective resource sharing• Question: how do all the hosts share the network when
they want to communicate with each other?– Use at the same time– Fair
• Multiplexing: a system resource is shared among multiple users– Analogy: CPU sharing
• Mechanisms to multiplexing– Time-division multiplexing (TDM)– Frequency-division multiplexing (FDM)– Statistical multiplexing
Multiplex Demultiplex
TDM and FDM
TDM
frequency
time
4 users
Example:
FDM
frequency
time
Problems with FDM and TDM
• What if a user does not have data to send all the time?– Consider web browsing– Inefficient use of resources
• Max # of flows is fixed and known ahead of time– Not practical to change the size of quantum or add
additional quanta for TDM– Nor add more frequencies in FDM
Statistical Multiplexing
• The physical link is shared over time (like TDM)• But does not have fixed pattern statistical
multiplexing– Sequence of A & B packets are sent on demand, not
predetermined slots
A
B
C10 Mb/sEthernet
1.5 Mb/s
D E
statistical multiplexing
queue of packetswaiting for output
link
Pros and Cons
• Assumption: traffic is largely bursty
• Pros: Resources are not wasted when hosts are idle
• Cons: No guarantee flows would have their turns to transmit
• Some possible fixes:– Limit maximum packet size– Scheduling which packets got transmitted, e.g., fair
queuing
Maximum Packet Size
• Divide an application message into blocks of data packets– Segments, frames
• Maximum packet size limit– Flows send on demand– Must give each flow its turn to send– Solution: defines an upper bound on the size of the
block of data
Packet scheduling
• Scheduling: which packet to send
• First come first serve (FIFQ)
• Weighted fair queuing
Switching vs multiplexing
• TDM and FDM are used in circuit switching– Require a setup as max # of flows is fixed
• SM is used in packet switching
Congestion
• Aggregate incoming rate > outgoing rate
• An open question
• A large buffer can help temporary congestion
Packet switching versus circuit switching
• 1 Mb/s link
• each user:
– 100 kb/s when “active”
– active 10% of time
• circuit-switching: fixed capacity
– 10 users
• packet switching:
– with 35 users, probability > 10 active less than .0004
Packet switching allows more users to use network!
N users
1 Mbps link
3. Support for common services• Application developers want a network to provide
services that make application programs communicate with each other, not just sending packets– E.g. reliably delivering an email message from a sender to a
receiver
• Many complicated things need to happen– Can you name a few?
• Design choices– Application developers build all functions they need– Network provides common services a layered network
architecture• Build it once, and shared many times
• Interactive request/reply
• Streaming of data• Bulk data transfer• …
• Key challenges: what services/channels to provide that can satisfy most applications at lowest costs?
• Approach: identify common patterns, then decide– What functions to implement
– Where to implement those functions• We will discuss end-to-end arguments in future class
Ex: how to provide reliability as a common service
• Failures may occur at different scopes– Bit transmission errors– Packet loss– Component failures: link, node
• Design choices– Link layer– Every hop in the router– End systems
• In future classes, we will discuss how to cope with these failures
4. Manageability
• Manage the network as it grows and when things go wrong
• An open research challenge– Datacenter networks
– Backbones
– Home networks• IP cameras, printers, network attached storage
Overview
• Updated course administrative stuff– Grading policy, office hours, piazza
• Design requirements of the original Internet
• Concepts of Network Architectures
• An Example of how the Internet works
Network Architectures
• Many ways to build a network
• Use network architectures to characterize different ways of building a network
• The general blueprints that guide the design and implementation of networks are referred to as network architectures
Central concepts
• Layering
• Protocols
Layering
• An abstraction to handle complexity– A unifying model that capture important aspect of a
system– Encapsulate the model in an object that has an
interface for others to interact with– Hide the details from the users of the object
Not so strict
Advantages of layering
• Simplify the design tasks– Each layer implements simpler functions
• Modular design– Can provide new services by modifying one layer
Protocols
• The abstract objects that make up the layers of a network system are called protocols
• Each protocol defines two different interfaces– Service interface– Peer interface
A protocol graph
• Peer-to-peer communication is indirect– Except at the hardware level
• Potentially multiple protocols at each level
• Show the suite of protocols that make up a network system with a protocol graph
A sample protocol graph
Protocol standardization
• Standard bodies such as IETF govern procedures for introducing, validating, and approving protocols– The Internet protocol suite uses open standard
• Set of rules governing the form and content of a protocol graph are called a network architecture
We reject kings, presidents, and voting. We believe in rough consensus and running code
- David Clark
Encapsulation• Upper layer sends a message using the service
interface
• A header, a small data structure, to add information for peer-to-peer communication, is attached to the front message– Sometimes a trailer is added to the end
• Message is called payload or data
• This process is called encapsulation
Multiplexing & Demultiplexing
• Same ideas apply up and down the protocol graph
Examples of Network Architectures
The protocol graph of Internet
• No strict layering. One can do cross-layer design• Hourglass shaped: IP defines a common method for exchanging packets
among different networks• To propose a new protocol, one must produce both a spec and one/two
implementations
Link layer
Network layer
Transport layer
Applicatoin layer
Functions of the Layers• Link Layer:
– Service: Reliable transfer of frames over a linkMedia Access Control on a LAN
– Functions: Framing, media access control, error checking
• Network Layer:– Service: Move packets from source host to destination
host– Functions: Routing, addressing
• Transport Layer:– Service: Delivery of data between hosts– Functions: Connection establishment/termination, error
control, flow control
• Application Layer:– Service: Application specific (delivery of email, retrieval
of HTML documents, reliable transfer of file)– Functions: Application specific
The Open Systems Interconnection (OSI) architecture
Seven-layer
• International Telecommunications Union (ITU) publishes protocol specs based on the OSI reference model– X dot series
• Physical layer: handles raw bits• Data link layer: aggregate bits to frames. Network adaptors
implement it• Network layer: handles host-to-host packet delivery. Data
units are called packets• Transport: implements process channel. Data units are called
messages• Session layer: handles multiple transport streams belong to the
same applications• Presentation layer: data format, e.g., integer format, ASCII
string or not• Application layer: application specific protocols
Summary of New Terms• Layering is an abstraction that captures important aspects of the
system, provides service interfaces, and hides implementation details
• Protocols are abstract objects that make up the layers of a network system are
• A protocol graph represents protocols that make up a system– Nodes are protocols– Links are depend-on relations
• Set of rules governing the form and content of a protocol graph are called a network architecture
• Attaching a header/trailer to an upper layer data unit is referred to as encapsulation
An Example
• A user on host argon.tcpip-lab.edu (“Argon”) makes web
access to URL
http://neon. tcpip-lab.edu/index.html.
• What actually happens in the network?
A simple TCP/IP Example
argon.tcpip-lab.edu("Argon")
neon.tcpip-lab.edu("Neon")
Web request
Web page
Web client Web server
HTTP Request and HTTP response
• Web server runs an HTTP server program
• HTTP client Web browser runs an HTTP client program
• sends an HTTP request to HTTP server
• HTTP server responds with HTTP response
HTTP client
Argon
HTTP server
Neon
HTTP request
HTTP response
HTTP Request
GET /example.html HTTP/1.1
Accept: image/gif, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: 192.168.123.144
Connection: Keep-Alive
HTTP Response
HTTP/1.1 200 OK
Date: Sat, 25 May 2002 21:10:32 GMT
Server: Apache/1.3.19 (Unix)
Last-Modified: Sat, 25 May 2002 20:51:33 GMT
ETag: "56497-51-3ceff955"
Accept-Ranges: bytes
Content-Length: 81
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
<HTML>
<BODY>
<H1>Internet Lab</H1>
Click <a href="http://www.tcpip-lab.net/index.html">here</a> for the Internet Lab webpage.
</BODY>
</HTML>
• How does the HTTP request get from Argon to Neon ?
From HTTP to TCP
• To send request, HTTP client program establishes an TCP connection to the HTTP server Neon.
• The HTTP server at Neon has a TCP server running
HTTP client
TCP client
Argon
HTTP server
TCP server
Neon
HTTP request / HTTP response
TCP connection
Resolving hostnames and port numbers
• Since TCP does not work with hostnames and also would not know how to find the HTTP server program at Neon, two things must happen:
1. The name “neon.tcpip-lab.edu” must be translated into a 32-bit IP address.
2. The HTTP server at Neon must be identified by a 16-bit port number.
Translating a hostname into an IP address
• The translation of the hostname neon.tcpip-lab.edu into an IP address is done via a database lookup
– gethostbyname(host)
• The distributed database used is called the Domain Name System (DNS)
• All machines on the Internet have an IP address:argon.tcpip-lab.edu 128.143.137.144neon.tcpip-lab.edu 128.143.71.21
HTTP client DNS Server
argon.tcpip-lab.edu 128.143.136.15
neon.tcpip-lab.edu
128.143.71.21
Finding the port number
• Note: Most services on the Internet are reachable via well-known ports. E.g. All HTTP servers on the Internet can be reached at port number “80”.
• So: Argon simply knows the port number of the HTTP server at a remote machine.
• On most Unix systems, the well-known ports are listed in a file with name /etc/services. The well-known port numbers of some of the most popular services are:
ftp 21 finger 79telnet 23 http 80smtp 25 nntp 119
Requesting a TCP Connection
• The HTTP client at argon.tcpip-lab.edu requests the TCP client to establish a connection to port 80 of the machine with address 128.141.71.21
HTTP client
TCP client
argon.tcpip-lab.edu
Establish a TCP connectionto port 80 of 128.143.71.21
connect(s, (struct sockaddr*)&sin, sizeof(sin))
Invoking the IP Protocol
• The TCP client at Argon sends a request to establish a connection to port 80 at Neon
• This is done by asking its local IP module to send an IP datagram to 128.143.71.21
• (The data portion of the IP datagram contains the request to open a connection)
TCP client
argon.tcpip-lab.edu
IP
Send an IP datagram to128.143.71.21
Sending the IP datagram to the default router
• Argon sends the IP datagram to its default router
• The default gateway is an IP router
• The default gateway for Argon is Router137.tcpip-lab.edu (128.143.137.1).
Invoking the device driver
• The IP module at Argon, tells its Ethernet device driver to send an Ethernet frame to address 00:e0:f9:23:a8:20
• Ethernet address of the default router is found out via ARP
argon.tcpip-lab.edu
IP module
Ethernet
Send an Ethernet frameto 00:e0:f9:23:a8:20
The route from Argon to Neon
• Note that the router has a different name for each of its interfaces.
neon.tcpip-lab.edu"Neon"
128.143.71.21
argon.tcpip-lab.edu"Argon"128.143.137.144
router137.tcpip-lab.edu"Router137"
128.143.137.1
router71.tcpip-lab.edu"Router71"128.143.71.1
Ethernet NetworkEthernet Network
Router
Sending an Ethernet frame
• The Ethernet device driver of Argon sends the Ethernet frame to the Ethernet network interface card (NIC)
• The NIC sends the frame onto the wire
argon.tcpip-lab.edu128.143.137.14400:a0:24:71:e4:44
IP Datagram for Neon
router137.tcpip-lab.edu128.143.137.100:e0:f9:23:a8:20
Forwarding the IP datagram
• The IP router receives the Ethernet frame at interface 128.143.137.11. recovers the IP datagram2. determines that the IP datagram should be forwarded to the interface
with name 128.143.71.1• The IP router determines that it can deliver the IP datagram directly
neon.tcpip-lab.edu"Neon"
128.143.71.21
argon.tcpip-lab.edu"Argon"128.143.137.144
router137.tcpip-lab.edu"Router137"
128.143.137.1
router71.tcpip-lab.edu"Router71"128.143.71.1
Ethernet NetworkEthernet Network
Router
• The IP protocol at Router71, tells its Ethernet device driver to send an Ethernet frame to address 00:20:af:03:98:28
router71.tcpip-lab.edu
IP module
Ethernet
Send a frame to00:20:af:03:98:28
Invoking the Device Driver at the Router
Sending another Ethernet frame
• The Ethernet device driver of Router71 sends the Ethernet frame to the Ethernet NIC, which transmits the frame onto the wire.
IP Datagram for Neon
neon.tcpip-lab.edu128.143.71.21
00:20:af:03:98:28
router71.tcpip-lab.edu128.143.71.1
Data has arrived at Neon
• Neon receives the Ethernet frame
• The payload of the Ethernet frame is an IP datagram which is passed to the IP protocol.
• The payload of the IP datagram is a TCP segment, which is passed to the TCP server
HTTP server
neon.tcpip-lab.edu
TCP server
IP module
Ethernet
Summary
• Updated course administrative stuff– Grading policy, office hours, piazza
• Design requirements of the original Internet
• Concepts of Network Architectures
• An Example of• how the Internet works