Overview
18-345: Introduction to
Telecommunication Networks • Protocols,
Protocols Services & Layering
Lectures 3: Layered Architecture • OSI Reference Model
• TCP/IP Architecture
Peter Steenkiste • How the Layers Work Together
• Network Utilities
Spring 2011
www.cs.cmu.edu/~prs/15-441-F10
1 Reading: Chapter 2, Leon-Garcia 2
DNS
Web Browsing Application A. 64.15.247.200
• World Wide Web allows users to access resources Q. www.nytimes.com?
(i.e. documents) located in computers connected to
the Internet
• Documents are prepared using HyperText Markup
Language (HTML)
• A browser application program is used to access the User clicks on http://www.nytimes.com/
web URL contains Internet name of machine
• The browser displays HTML documents that include (www.nytimes.com), but not Internet address
links to other documents
• Each link references a Uniform Resource Locator Internet needs Internet address to send information to a
(URL) that gives the name of the machine and the machine
location of the given document Browser software uses Domain Name System (DNS)
• Let’s see what happens when a user clicks on a link protocol to send query for Internet address
DNS system responds with Internet address
1
TCP ACK HTTP Content
ACK, TCP Connection Request 200 OK
From: 64.15.247.200 Port 80
To:128.100.11.13 Port 1127
TCP Connection Request HTTP/1 1
GET / HTTP/1.1
From: 128.100.11.13 Port 1127
To: 64.15.247.200 Port 80
Browser software uses HyperText Transfer Protocol (HTTP) to send
HTTP client sends its request message: “GET …”
request for document HTTP server sends a status response: “200 OK”
HTTP server waits for requests by listening to a well-known port HTTP server sends requested file
number (80 for HTTP)
p y
Browser displays document
li t d t
HTTP client sends request messages th h “ephemeral port
through an “ h l t
number,” e.g. 1127
HTTP needs a Transmission Control Protocol (TCP) connection Clicking a link sets off a chain of events across the
between the HTTP client and the HTTP server to transfer messages Internet!
reliably
Let’s see how protocols & layers come into play…
Protocols
How to Design a Network?
• A protocol is a set of rules that governs how
two or more communicating entities in a layer • Has many users • Components built by
are to interact • Offers diverse services many companies
• Messages that can be sent and received • Mixes very diverse • Diverse ownership
• Actions that are to be taken when a certain technologies • Can evolve over time
event occurs, e.g. sending or receiving Operating System Router Software Operating System
messages, expiry of timers Application Links (many protocols) Application
• Protocols are the key to interoperability
• Protocols exist at many levels
• The purpose of a protocol is to provide a Computer
Network Interface
service to the layer above Protocol Software Router Hardware
Bridge HW/SW Computer
8
2
What is a
Solution #1
Communication Network
ec o s and photons
• Electrons a d p o o s as co u ca o
communication
medium.
• Links: fiber, copper, wireless, .. FTP Wireless
• Switches: electronic, optical, crossbar, Banyan, TCP
HTTP UDP Voice
.. Tw. Pair
• Protocols: Ethernet, X.25, SONET, Framerelay, The Network
IP, TCP, HTTP, …
, , ,
Coax
C Optical
• Functionality: routing, error control, flow control, Telnet
congestion control, QoS, security, .. Web
DNS
• Applications: FTP, web, games, telephone,
video streaming, ..
10
Solution #2? Solution #3
Web FTP Telnet Voice Video Web FTP Telnet Voice
Intermediate Layer
Tw. Pair Coax Optical Wireless
Tw. Pair Coax Optical Wireless
11 12
3
Types of Protocols Protocol and
host
host
host
Service Levels
host
host Application
host host
• Core network: responsible for transferring data
between a sending and receiving host. End-to-end
• End-to-end protocols: present a network service to
applications and users. Core
– May add value to the core network protocols Network
• Driven by differences in constraints: scalability, power,
management, speed, etc.
13 14
A Layer Network Model OSI Motivation
The Open Systems Interconnection (OSI) Model
• Standard way of breaking up a system in a
set of components
7 Application Application – Traditional modularity argument
6 Presentation Presentation – Components can be implemented and modified
5 Session Session
in isolation
4 Transport Transport
• Modules are organized as a set of layers
3 k
N t
Network Network
N t k N t k
Network N t
Network
k • Inter-module communication is restricted
Inter module
Data link Data link Data link Data link
– Only horizontal and vertical communication
2
1 Physical Physical Physical Physical
• Clearly this is not the only way of building a
network!
15 16
4
Inter-Module Communication OSI Functions
• “Peer” layers on different systems communicate via • (1) Physical: transmission of a bit stream
a protocol
p • control, framing
(2) Data link: flow control framing, error detection
– TCP modules communication using the TCP protocol
• (3) Network: switching and routing
• Each layer offers a service to the higher layer, using
the services of the lower layer • (4) Transport: reliable end to end delivery
– E.g. TCP offers a reliable data transport service to HTTP • (5) Session: managing logical connections
• Can have a choice of protocols at each layer • (6) Presentation: data transformations
– E.g. TCP and UDP offer transport services • (7) Application: spec c uses, e g mail, file t a s e ,
( ) pp cat o specific e.g. a , e transfer,
– Must have the same or very similar service interface telnet, network management
– Many higher level protocols can run over many lower level
protocols with “order N” implementation effort Multiplexing takes place in multiple layers
17 18
Open Systems Interconnection History
Advantages of Layering?
• By the 1970s every computer vendor had developed
• Layering simplifies design, implementation, and its own proprietary layered network architecture
testing by partitioning overall communications • Problem: computers from different vendors could not
process into parts (modularity) be networked together
– Similar to writing a software program using function calls
• Protocol in each layer can be designed separately • Open Systems Interconnection (OSI) was an effort by
from those in other layers the International Organization for Standardization
• Protocol makes “calls” for services from layer below (ISO) to enable multivendor computer interconnection
– Defined a seven-layer abstract reference model for a network
• Layering provides flexibility for modifying and architecture - a framework for the development of protocols
evolving protocols and services without having to
change layers below • Detailed OSI standards were developed for each
• Monolithic non-layered architectures are costly, layer, but TCP/IP protocols preempted deployment of
inflexible, and soon obsolete OSI protocols
– OSI protocols are not used, but layered framework survived
19 20
5
Physical Layer Data Link Layer
• Transfers bits across link • Transfers frames across direct connections
• Definition & specification of the physical aspects of a • Groups bits into frames
p
communications link
– Mechanical: cable, plugs, pins... • Detection of bit errors; Retransmission of frames
– Electrical/optical: modulation, signal strength, • Activation, maintenance, & deactivation of data link
voltage levels, bit times, … connections
– functional/procedural: how to activate, maintain, • Medium access control for local area networks
and deactivate physical links… • Flow control
• Lots of different physical layers exist: frames
Data Link Data Link
– Ethernet, DSL, cable modem, telephone
Layer Layer
modems…
Physical bits Physical
– Twisted-pair cable, coaxial cable optical fiber, Layer Layer
radio, infrared, …
•21 22
Internetworking
Network Layer • Internetworking is part of network layer and provides
transfer of packets across multiple (possibly dissimilar)
• Transfers packets across multiple links and/or networks
multiple networks Gateways (routers) direct packets across networks
• G ( )
• Addressing (i.e. assignment of addresses to different H
nodes) must scale to large networks
• Nodes jointly execute routing algorithm to determine H
Net 33
•Net
paths across the network Net 11
G
•Net G
• Forwarding transfers packets across a node G
G
• Congestion control to deal with traffic surges Net 5
•Net 5
H •Net22 G Net 4 G
Net H
• Connection setup, maintenance, and teardown when
connection-based G = gateway
H = host
23 24
6
Internetworking Transport Layer
Internetworking is part of network layer and provides
• Ethernet LAN
transfer packets across multiple (possibly dissimilar)
of • Transfers data end-to-end from process in a machine
networks to process in another machine
ATM
• G ( ) across Switch
Gateways (routers) direct packetsNetwork networks
ATM (e.g.
• Reliable stream transfer (e g TCP) or quick and
quick-and-
simple single-block transfer (e.g. UDP)
H ATM ATM
Switch Switch • Port numbers enable multiplexing
H ATM • Message segmentation and reassembly
Net 33
•Net Switch
Net 11
G • Connection setup, maintenance, and release
•Net G
G
G Transport
T t Transport
T t
Net 5
•Net 5 Layer Layer
H •Net22 G Net 4 G
Net H Network Network Network Network
Layer Layer Layer Layer
G = gateway
26
H = host Communication Network
25
Different Sources of Components
Application & Upper Layers
• Application: web
server/browser, mail,
• Application Layer: Provides Application game
distributed game,..
services that are frequently Application • Presentation/session
Application
required by applications: DNS, Application – Often part of application Presentation
web acess, file transfer, email… Application
Layer
Layer
• Transport/network Session
Presentation – Typically part of the operating
• Presentation Layer: machine- Transport
Layer system Transport
independent representation of Layer
• Datalink
Session Network
data… Layer – Often written by vendor of the
• Session Layer: dialog network interface hardware Data link
Transport
management, recovery from Layer • Physical Physical
– Hardware: card and link
errors, …Incorporated into
Application Layer
27 28
7
The Internet Protocol Suite Headers & Trailers
• Each protocol uses a header that carries addresses,
sequence numbers, flag bits, length indicators, etc…
• CRC check bits may be appended for error detection
Application Applications Application APP DATA Application
Presentation Presentation
Session Application Application
AH APP DATA
Session Layer Layer
UDP TCP
Transport Transport Transport
IP Layer TH AH APP DATA Layer
Network
Network Network
Data Link Layer
NH TH AH APP DATA Layer
Data link
Physical Data Link Data Link
Physical DH NH TH AH APP DATA CRC
Layer Layer
Physical Physical
The Hourglass Model bits
Layer Layer
29 30
OSI Unified View: Protocols OSI Unified View: Services
• Layer n in one machine interacts with layer n in • Communication between peer processes is
another machine to provide a service to layer n +1 virtual and actually indirect
The titi i i the di layers on
• Th entities comprising th corresponding l • Layer n+1 transfers information by invoking
different machines are called peer processes the services provided by layer n
• The machines use a set of rules and conventions • Services are available at Service Access
called the layer-n protocol Points (SAP’s)
• Layer-n peer processes communicate by • Each layer passes data & control information
exchanging Protocol Data Units (PDUs) to the layer below it until the physical layer is
n-PDUs h d d transfer occurs
reached and t f
• The data passed to the layer below is called a
n Entity n Entity Service Data Unit (SDU)
• SDU’s are encapsulated in PDU’s
Layer n peer protocol
8
Layers, Services & Protocols Interlayer Interaction
layer
n+1 n+1
n+1 user n provider n provider n+1 user
entity entity
n-SDU n-SDU
n-SAP n-SAP
n SDU
n-SDU H
n entity n entity
H n-SDU
System A System B
n-PDU
Connection-Oriented and Segmentation & Reassembly
Connectionless Services
• A layer may impose a limit on the (a) Segmentation
size of a data block that it can
• Connection Oriented
Connection-Oriented • Connectionless transfer due to implementation or n-SDU
n SDU
– Three-phases: – Immediate SDU transfer other reasons
1. Connection setup – No connection setup – E.g. wireless link is error-
between two SAPs to prone n-PDU n-PDU n-PDU
– E.g. UDP, IP • Thus a layer n SDU may be too
initialize state
information large to be handled as a single
unit by layer n-1
2. SDU transfer • Layered services need (b) Reassembly
• Sender side: SDU is segmented
3. Connection release
3 C ti l tb f t
not be of same type into multiple PDUs n-SDU
– E.g. TCP, ATM – TCP operates over IP • Receiver side: SDU is
– IP operates over ATM reassembled from sequence of
PDUs
n-PDU n-PDU n-PDU
35 36
9
Multiplexing Internet Names & Addresses
• Sharing of layer n service by multiple layer n+1 users
Internet Names Internet Addresses
• Multiplexing tag or ID required in each PDU to • Each host a a unique name • Each host has globally unique
determine which users an SDU belongs to – Independent of physical logical 32 bit IP address
location
• Separate address for each
– Facilitate memorization physical connection to a network
n+1 n+1 by humans
– Domain Name • Routing decision is done based
entity entity
– Organization under on destination IP address
n+1 n+1 single administrative unit • IP address has two parts:
entity entity • Host Name – netid and hostid
g
– Name given to host – netid uniqueq
computer – netid facilitates routing
n-SDU n-SDU • User Name
• Dotted Decimal Notation:
n-SDU H – Name assigned to user
– i.e. kim@ece.cmu.edu int1.int2.int3.int4
n entity n entity
(intj = jth octet)
H n-SDU 128.2.128.29
n-PDU DNS resolves IP name to IP address
Physical Addresses Server
Example: Internet PC
Router
(2,1)
• LANs (and other networks) assign physical (1,1) PPP
s (1,3) r
addresses to the physical attachment to the network Netid=2 (2,2)
w
• The network uses its own address to transfer Ethernet
Eth t *PPP does not use
packets or frames to the appropriate destination (netid=1) Workstation physical addresses
• IP address needs to be resolved to physical address (1,2)
at each IP network interface
netid hostid Physical
• Example: Ethernet uses 48-bit addresses address
– Each Ethernet network interface card (NIC) has globally server 1 1 s
unique Medium Access Control (MAC) or physical address workstation 1 2 w
– First 24 bits identify NIC manufacturer; second 24 bits are router 1 3 r
serial number
– 00:90:27:96:68:07 12 hex numbers router 2 1 -
PC 2 2 -
Intel
•40
10
How the layers work together: IP packet from
Encapsulation by Internet and Ethernet workstation to server
Server PC
Router
(2,1)
(1,1) PPP
IP s (1,3) r (2,2)
header IP Payload
w
Ethernet w, s (1,2), (1,1)
Ethernet IP Workstation
header header IP Payload FCS (1,2)
1. IP packet has (1,2) IP address for source and (1,1) IP address for
FCS = frame check sequence destination
2. IP table at workstation indicates (1,1) connected to same network, so
IP packet is encapsulated in Ethernet frame with addresses w and s
Ethernet header contains: 3. Ethernet frame is broadcast by workstation NIC into the ethernet.
source and destination physical addresses 4. This frame is captured by server NIC since ethernet NIC is always
listening for frames
network protocol type (e.g. IP) 5. NIC examines protocol type field and then delivers packet to its IP
layer
41 42
IP packet from server to PC How the layers work together: HTTP
Server PC over TCP over IP
Router (a) Server PC
(2,1) (1,1), (2,2) Router
(2,1)
(1,1) s (1,3) r (2,2) (1,1) s PPP
(1,3) r ( , )
(2,2)
w Ethernet
s, r (1,1), (2,2) HTTP uses process-to-process
reliable byte stream transfer of
Workstation
TCP connection:
(1,2)
(b) Server Server socket: (IP Address, 80)
1. IP packet has (1,1) and (2,2) as IP source and destination addresses PC
PC socket (IP Address, Eph. #)
2. IP table at server indicates packet should be sent to router, so IP packet is HTTP
encapsulated in Ethernet frame with addresses s and r TCP uses node-to-node HTTP
3. y p y
Ethernet frame is broadcast by server NIC and captured by router NIC TCP unreliable packet transfer of IP TCP
4. Router NIC examines protocol type field and then delivers packet to its IP layer Server IP address & PC IP address
5. IP layer of router examines IP packet destination address and determines IP IP IP IP
packet should be routed to (2,2)
Network interface
6. Router’s table indicates (2,2) is directly connected via PPP link Network interface Network interface
Internet
7. IP packet is encapsulated in PPP frame and delivered to PC
8. PPP at PC examines protocol type field and delivers packet to PC IP layer Router
Ethernet PPP
43 44
11
How the layers work together:
Encapsulation
Network Analyzer Example
TCP Header contains
source & destination HTTP Request
port numbers Internet
IP Header contains
source and destination TCP
IP addresses; header HTTP Request
transport protocol type
User clicks on http://www.nytimes.com/
Ethernet Header contains Ethereal network analyzer captures all frames
IP TCP
source & destination MAC
header header HTTP Request observed by its Ethernet NIC (or Wireshark)
addresses;
network protocol type Sequence of frames and contents of frame can be
examined in detail down to individual bytes
Ethernet IP TCP
header header header HTTP Request FCS
45
Top Pane Middle Pane
shows Ethereal windows
frame/packet
shows Top pane: frame sequence
TCP
encapsulation for DNS Connection
sequence a given frame HTTP
Query Setup
Request &
Response
Bottom Pane shows hex & text
12
Middle pane: Encapsulation Middle pane: Encapsulation
And a lot of
other stuff!
Ethernet Frame
IP Packet
Ethernet
Destination and IP Source and
Protocol Type Destination
Source
Addresses Addresses
Protocol Type
Middle pane: Encapsulation
Network tools
g
TCP Segment • telnet
• ftp
Source and • http
Destination Port • ping
Numbers
• traceroute
GET • ipconfig
HTTP • tcpdump
Request
52
13
ping traceroute
• Find route from local host to a remote host
• Application to determine if host is reachable
• Time-to-Live (TTL)
• Based on Internet Control Message Protocol
– IP packets have TTL field that specifies maximum #
– ICMP informs source host about errors hops traversed before packet discarded
encountered in IP packet processing by routers or
– Each router decrements TTL by 1
by destination host
– When TTL reaches 0 packet is discarded
– ICMP Echo message requests reply from
destination host • Traceroute
• PING sends echo message & sequence # – Send UDP to remote host with TTL=1
• Determines reachability & round-trip delay – First router will reply ICMP Time Exceeded Message
• Sometimes disabled for security reasons – Send UDP to remote host with TTL=2, …
– Each step reveals next router in path to remote host
• tracert (windows), tracepath (linux)
ipconfig netstat
• Queries a host about TCP/IP network
• Utility in Microsoft Windows to display
status
i f ti b t h t
TCP/IP information about a host
• Status of network drivers & their
• Many options
interface cards
– Simplest: IP address, subnet mask, default
gateway for the host – #packets in, #packets out, errored packets,
…
– Information about each IP interface of a host
• DNS hostname, IP addresses of DNS servers, • State of routing table in host
physical address of network card, IP address, … • TCP/IP active server processes
– Renew IP address from DHCP server • TCP active connections
14
tcpdump and Network Protocol
Analyzers
Summary
p p g p
• tcpdump program captures IP p
p packets on a network • Protocols Services & Layering
Protocols,
interface (usually Ethernet NIC)
• Filtering used to select packets of interest • OSI Reference Model
• Packets & higher-layer messages can be displayed • TCP/IP Architecture
and analyzed
• tcpdump basis for many network protocol analyzers
• How the Layers Work Together
for troubleshooting networks • Network Utilities
• We use the open source Ethereal analyzer to
generate examples (or wireshark, etc.)
– www.ethereal.com
58
15