Title: Chapter 2 Protocols and Architecture
1Chapter 2Protocols and Architecture
- William StallingsData and Computer
Communications 7th Edition - Leon-Gacia and W. Jaja
- Communication Networks-Fundamental Concepts and
Key Architecture Chapter 2.1
21. The caller picks up the phone triggering the
flow of current in wires that connect to the
telephone office.
1.
2. The current is detected, and a dial tone is
transmitted by the telephone office to indicate
that it is ready to receive the destination
number.
2.
Connection setup
3. The caller sends this number by pushing the
keys on the telephone set. Each key generates a
pair of tones that specify a number. (In the
older phone sets, the user dials a number that in
turn generates a corresponding number of pulses.)
3.
4. The equipment in the telephone office then
uses the telephone network to attempt a
con-nection. If the destination telephone is
busy, then a busy tone is returned to the caller
otherwise ringing signals are sent to both the
originating and destination telephones. The
ringing signals are discontinued when the
destination phone is picked up and communication
can then proceed.
4.
Information transfer
5.
5. The voice signals travel in both directions.
Connection release
6. Either user terminates the call by putting
down a receiver.
6.
Figure 1.5
3Figure 1.6
4The user clicks on a link to indicate which
document is to be retrieved. The browser must
determine the Internet address of the machine
that contains the document. To do so, the browser
sends a query to its local name server.
Step
1.
Once the address is known, the browser
establishes a connection to the server process in
the specified machine, usually a TCP connection.
For the connection to be successful, the
specified machine must be ready to accept TCP
connections.
2.
3.
The browser runs a client version of HTTP, which
issues a request specifying both the name of the
document and the possible document formats it can
handle.
The machine that contains the requested document
runs a server version of HTTP. It reacts to the
HTTP request by sending an HTTP response which
contains the desired document in the appropriate
format.
4. 6.
7. 8.
The user may start to view the document. The TCP
connection is closed after a certain timeout
period.
Figure 2.1
5Need For Protocol Architecture
- E.g. File transfer
- Source must activate comms. Path or inform
network of destination - Source must check destination is prepared to
receive - File transfer application on source must check
destination file management system will accept
and store file for his user - May need file format translation
- Task broken into subtasks
- Implemented separately in layers in stack
- Functions needed in both systems
- Peer layers communicate
6Key Elements of a Protocol
- Syntax
- Data formats
- Signal levels
- Semantics
- Control information
- Error handling
- Timing
- Speed matching
- Sequencing
7Protocol Architecture
- Task of communication broken up into modules
- For example file transfer could use three modules
- File transfer application
- Communication service module
- Network access module
8Simplified File Transfer Architecture
9A Three Layer Model
- Network Access Layer
- Transport Layer
- Application Layer
10Network Access Layer
- Exchange of data between the computer and the
network - Sending computer provides address of destination
- May invoke levels of service
- Dependent on type of network used (LAN, packet
switched etc.)
11Transport Layer
- Reliable data exchange
- Independent of network being used
- Independent of application
12Application Layer
- Support for different user applications
- e.g. e-mail, file transfer
13Protocol Architectures and Networks
14Addressing Requirements
- Two levels of addressing required
- Each computer needs unique network address
- Each application on a (multi-tasking) computer
needs a unique address within the computer - The service access point or SAP
- The port on TCP/IP stacks
15Protocols in Simplified Architecture
16Protocol Data Units (PDU)
- At each layer, protocols are used to communicate
- Control information is added to user data at each
layer - Transport layer may fragment user data
- Each fragment has a transport header added
- Destination SAP
- Sequence number
- Error detection code
- This gives a transport protocol data unit
17Protocol Data Units
18Network PDU
- Adds network header
- network address for destination computer
- Facilities requests
19Operation of a Protocol Architecture
20Standardized Protocol Architectures
- Required for devices to communicate
- Vendors have more marketable products
- Customers can insist on standards based equipment
- Two standards
- OSI Reference model
- Never lived up to early promises
- TCP/IP protocol suite
- Most widely used
- Also IBM Systems Network Architecture (SNA)
21OSI Unified View Protocols
- Layer n in one machine interacts with layer n in
another machine to provide a service to layer n
1 - The entities comprising the corresponding layers
on different machines are called peer processes. - The machines use a set of rules and conventions
called the layer-n protocol. - Layer-n peer processes communicate by exchanging
Protocol Data Units (PDUs)
n-PDUs
n Entity
n Entity
Layer n peer protocol
22OSI Unified View Services
- Communication between peer processes is virtual
and actually indirect - Layer n1 transfers information by invoking the
services provided by layer n - Services are available at Service Access Points
(SAPs) - Each layer passes data control information to
the layer below it until the physical layer is
reached and transfer occurs - The data passed to the layer below is called a
Service Data Unit (SDU) - SDUs are encapsulated in PDUs
23Layers, Services Protocols
n1 entity
n1 entity
n-SDU
n-SDU
n-SAP
n-SAP
n-SDU
H
n entity
n entity
n-SDU
H
n-PDU
24OSI
- Open Systems Interconnection
- Developed by the International Organization for
Standardization (ISO) - Seven layers
- A theoretical system delivered too late!
- TCP/IP is the de facto standard
25OSI - The Model
- A layer model
- Each layer performs a subset of the required
communication functions - Each layer relies on the next lower layer to
perform more primitive functions - Each layer provides services to the next higher
layer - Changes in one layer should not require changes
in other layers
26OSI Layers
27The OSI Environment
28OSI as Framework for Standardization
29Layer Specific Standards
30Layers, Services Protocols
n1 entity
n1 entity
n-SDU
n-SDU
n-SAP
n-SAP
n-SDU
H
n entity
n entity
n-SDU
H
n-PDU
31Elements of Standardization
- Protocol specification
- Operates between the same layer on two systems
- May involve different operating system
- Protocol specification must be precise
- Format of data units
- Semantics of all fields
- allowable sequence of PCUs
- Service definition
- Functional description of what is provided
- Addressing
- Referenced by SAPs
32OSI Layers (1)
- Physical
- Physical interface between devices
- Mechanical
- Electrical
- Functional
- Procedural
- Data Link
- Means of activating, maintaining and deactivating
a reliable link - Error detection and control
- Higher layers may assume error free transmission
33OSI Layers (2)
- Network
- Transport of information
- Higher layers do not need to know about
underlying technology - Not needed on direct links
- Transport
- Exchange of data between end systems
- Error free
- In sequence
- No losses
- No duplicates
- Quality of service
34OSI Layers (3)
- Session
- Control of dialogues between applications
- Dialogue discipline
- Grouping
- Recovery
- Presentation
- Data formats and coding
- Data compression
- Encryption
- Application
- Means for applications to access OSI environment
35Application Upper Layers
- Application Layer Provides services that are
frequently required by applications DNS, web
acess, file transfer, email - Presentation Layer machine-independent
representation of data - Session Layer dialog management, recovery from
errors,
Incorporated into Application Layer
36Headers 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
Application
APP DATA
Application Layer
Application Layer
Transport Layer
Transport Layer
Network Layer
Network Layer
Data Link Layer
Data Link Layer
Physical Layer
Physical Layer
bits
37Use of a Relay
38Service Primitives and Parameters
- Services between adjacent layers expressed in
terms of primitives and parameters - Primitives specify function to be performed
- Parameters pass data and control info
39Primitive Types
40Interlayer Interaction
layer
N1 user
N provider
N provider
N1 user
System A
System B
41Timing Sequence for Service Primitives
42Connectionless Connection-Oriented Services
- Connection-Oriented
- Three-phases
- Connection setup between two SAPs to initialize
state information - SDU transfer
- Connection release
- E.g. TCP, ATM
- Connectionless
- Immediate SDU transfer
- No connection setup
- E.g. UDP, IP
- Layered services need not be of same type
- TCP operates over IP
- IP operates over ATM
43TCP/IP Protocol Architecture
- Developed by the US Defense Advanced Research
Project Agency (DARPA) for its packet switched
network (ARPANET) - Used by the global Internet
- No official model but a working one.
- Application layer
- Host to host or transport layer
- Internet layer
- Network access layer
- Physical layer
- 3 Layer Model (4 Layer model
44Physical Layer
- Physical interface between data transmission
device (e.g. computer) and transmission medium or
network - Characteristics of transmission medium
- Signal levels
- Data rates
- etc.
45Network Access Layer
- Exchange of data between end system and network
- Destination address provision
- Invoking services like priority
46Internet Layer (IP)
- Systems may be attached to different networks
- Routing functions across multiple networks
- Implemented in end systems and routers
47Transport Layer (TCP,UDP)
- Reliable Stream Service
- Reliable delivery of data
- Ordering of delivery
- Unreliable Block Service
48Application Layer
- Support for user applications
- e.g. http, SMPT
49OSI v TCP/IP
50TCP
- Usual transport layer is Transmission Control
Protocol - Reliable connection
- Connection
- Temporary logical association between entities in
different systems - TCP PDU
- Called TCP segment
- Includes source and destination port (c.f. SAP)
- Identify respective users (applications)
- Connection refers to pair of ports
- TCP tracks segments between entities on each
connection
51UDP
- Alternative to TCP is User Datagram Protocol
- Not guaranteed delivery
- No preservation of sequence
- No protection against duplication
- Minimum overhead
- Adds port addressing to IP
52TCP/IP Concepts
53Internetworking
Ethernet LAN
- Internetworking is part of network layer and
provides transfer of packets across multiple
possibly dissimilar networks - Gateways (routers) direct packets across networks
H
H
G
Net 1
G
G
G
Net 5
Net 2
G
G
H
H
G gateway H host
54Addressing level
- Level in architecture at which entity is named
- Unique address for each end system (computer) and
router - Network level address
- IP or internet address (TCP/IP)
- Network service access point or NSAP (OSI)
- Process within the system
- Port number (TCP/IP)
- Service access point or SAP (OSI)
55Trace of Simple Operation
- Process associated with port 1 in host A sends
message to port 2 in host B - Process at A hands down message to TCP to send to
port 2 - TCP hands down to IP to send to host B
- IP hands down to network layer (e.g. Ethernet) to
send to router J - Generates a set of encapsulated PDUs
56Example HTTP
- HTTP is an application layer protocol
- Retrieves documents on behalf of a browser
application program - HTTP specifies fields in request messages and
response messages - Request types Response codes
- Content type, options, cookies,
- HTTP specifies actions to be taken upon receipt
of certain messages
57HTTP Protocol
GET
HTTP Client
HTTP Server
Response
- HTTP assumes messages can be exchanged directly
between HTTP client and HTTP server - In fact, HTTP client and server are processes
running in two different machines across the
Internet - HTTP uses the reliable stream transfer service
provided by TCP
58Example TCP
- TCP is a transport layer protocol
- Provides reliable byte stream service between two
processes in two computers across the Internet - Sequence numbers keep track of the bytes that
have been transmitted and received - Error detection and retransmission used to
recover from transmission errors and losses - TCP is connection-oriented the sender and
receiver must first establish an association and
set initial sequence numbers before data is
transferred - Connection ID is specified uniquely by
- (send port , send IP address, receive port ,
receiver IP address)
59HTTP uses service of TCP
HTTP server
HTTP client
Response
GET
Port 80
Port 1127
TCP
GET
Response
TCP
60PDUs in TCP/IP
61Example Header Information
- Destination port
- Sequence number
- Checksum
62Some Protocols in TCP/IP Suite
63TCP/IP Protocol Suite
HTTP
DNS
SMTP
RTP
Distributed applications
User datagram service
Reliable stream service
TCP
UDP
Best-effort connectionless packet transfer
(ICMP, ARP)
Diverse network technologies
64Internet Names Addresses
- Internet Names
- Each host a a unique name
- Independent of physical location
- Facilitate memorization by humans
- Domain Name
- Organization under single administrative unit
- Host Name
- Name given to host computer
- User Name
- Name assigned to user
- leongarcia_at_comm.utoronto.ca
- Internet Addresses
- Each host has globally unique logical 32 bit IP
address - Separate address for each physical connection to
a network - Routing decision is done based on destination IP
address - IP address has two parts
- netid and hostid
- netid unique
- netid facilitates routing
- Dotted Decimal Notation
- int1.int2.int3.int4
- (intj jth octet)
- 128.100.10.13
DNS resolves IP name to IP address
65Physical Addresses
- LANs (and other networks) assign physical
addresses to the physical attachment to the
network - The network uses its own address to transfer
packets or frames to the appropriate destination - IP address needs to be resolved to physical
address at each IP network interface - Example Ethernet uses 48-bit addresses
- Each Ethernet network interface card (NIC) has
globally unique Medium Access Control (MAC) or
physical address - First 24 bits identify NIC manufacturer second
24 bits are serial number - 009027966807 12 hex numbers
Intel
66Chapter 2.1 Applications and Layered
Architectures
- Protocols, Services Layering
67Layers, Services Protocols
- The overall communications process between two or
more machines connected across one or more
networks is very complex - Layering partitions related communications
functions into groups that are manageable - Each layer provides a service to the layer above
- Each layer operates according to a protocol
- Lets use examples to show what we mean
68Web Browsing Application
- World Wide Web allows users to access resources
(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 web - The browser displays HTML documents that include
links to other documents - Each link references a Uniform Resource Locator
(URL) that gives the name of the machine and the
location of the given document - Lets see what happens when a user clicks on a
link
69The user clicks on a link to indicate which
document is to be retrieved. The browser must
determine the Internet address of the machine
that contains the document. To do so, the browser
sends a query to its local name server.
Step
1.
Once the address is known, the browser
establishes a connection to the server process in
the specified machine, usually a TCP connection.
For the connection to be successful, the
specified machine must be ready to accept TCP
connections.
2.
3.
The browser runs a client version of HTTP, which
issues a request specifying both the name of the
document and the possible document formats it can
handle.
The machine that contains the requested document
runs a server version of HTTP. It reacts to the
HTTP request by sending an HTTP response which
contains the desired document in the appropriate
format.
4. 6.
7. 8.
The user may start to view the document. The TCP
connection is closed after a certain timeout
period.
Figure 2.1
701. DNS
A. 64.15.247.200
Q. www.nytimes.com?
- User clicks on http//www.nytimes.com/
- URL contains Internet name of machine
(www.nytimes.com), but not Internet address - Internet needs Internet address to send
information to a machine - Browser software uses Domain Name System (DNS)
protocol to send query for Internet address - DNS system responds with Internet address
712. TCP
ACK
ACK, TCP Connection Request From 64.15.247.200
Port 80 To128.100.11.13 Port 1127
TCP Connection Request From 128.100.11.13 Port
1127 To 64.15.247.200 Port 80
- Browser software uses HyperText Transfer Protocol
(HTTP) to send request for document - HTTP server waits for requests by listening to a
well-known port number (80 for HTTP) - HTTP client sends request messages through an
ephemeral port number, e.g. 1127 - HTTP needs a Transmission Control Protocol (TCP)
connection between the HTTP client and the HTTP
server to transfer messages reliably
723. HTTP
Content
200 OK
GET / HTTP/1.1
- HTTP client sends its request message GET
- HTTP server sends a status response 200 OK
- HTTP server sends requested file
- Browser displays document
- Clicking a link sets off a chain of events across
the Internet! - Lets see how protocols layers come into play
73Protocols
- A protocol is a set of rules that governs how two
or more communicating entities in a layer are to
interact - Messages that can be sent and received
- Actions that are to be taken when a certain event
occurs, e.g. sending or receiving messages,
expiry of timers - The purpose of a protocol is to provide a service
to the layer above
74Layers
- A set of related communication functions that can
be managed and grouped together - Application Layer communications functions that
are used by application programs - HTTP, DNS, SMTP (email)
- Transport Layer end-to-end communications
between two processes in two machines - TCP, User Datagram Protocol (UDP)
- Network Layer node-to-node communications
between two machines - Internet Protocol (IP)
75Example HTTP
- HTTP is an application layer protocol
- Retrieves documents on behalf of a browser
application program - HTTP specifies fields in request messages and
response messages - Request types Response codes
- Content type, options, cookies,
- HTTP specifies actions to be taken upon receipt
of certain messages
76HTTP Protocol
GET
HTTP Client
HTTP Server
Response
- HTTP assumes messages can be exchanged directly
between HTTP client and HTTP server - In fact, HTTP client and server are processes
running in two different machines across the
Internet - HTTP uses the reliable stream transfer service
provided by TCP
77Example TCP
- TCP is a transport layer protocol
- Provides reliable byte stream service between two
processes in two computers across the Internet - Sequence numbers keep track of the bytes that
have been transmitted and received - Error detection and retransmission used to
recover from transmission errors and losses - TCP is connection-oriented the sender and
receiver must first establish an association and
set initial sequence numbers before data is
transferred - Connection ID is specified uniquely by
- (send port , send IP address, receive port ,
receiver IP address)
78HTTP uses service of TCP
HTTP server
HTTP client
Response
GET
Port 80
Port 1127
TCP
GET
Response
TCP
79Example DNS Protocol
- DNS protocol is an application layer protocol
- DNS is a distributed database that resides in
multiple machines in the Internet - DNS protocol allows queries of different types
- Name-to-address or Address-to-name
- Mail exchange
- DNS usually involves short messages and so uses
service provided by UDP - Well-known port 53
80Local Name Server
Authoritative Name Server
1
5
4
2
3
6
Root Name Server
- Local Name Server resolve frequently-used names
- University department, ISP
- Contacts Root Name server if it cannot resolve
query - Root Name Servers 13 globally
- Resolves query or refers query to Authoritative
Name Server - Authoritative Name Server last resort
- Every machine must register its address with at
least two authoritative name servers
81Example UDP
- UDP is a transport layer protocol
- Provides best-effort datagram service between two
processes in two computers across the Internet - Port numbers distinguish various processes in the
same machine - UDP is connectionless
- Datagram is sent immediately
- Quick, simple, but not reliable
82Summary
- Layers related communications functions
- Application Layer HTTP, DNS
- Transport Layer TCP, UDP
- Network Layer IP
- Services a protocol provides a communications
service to the layer above - TCP provides connection-oriented reliable byte
transfer service - UDP provides best-effort datagram service
- Each layer builds on services of lower layers
- HTTP builds on top of TCP
- DNS builds on top of UDP
- TCP and UDP build on top of IP
83Utility
- Ping Find the availability of remote device
- Tracert Find the path to remote device
- Route Show routing table
- tcpdump
- Ethereal
- Ipconfig
- Nslookup
- Ethereal
84Required Reading
- Stallings chapter 2
- Leon-Gacia Chapter 2
- Suggest Reading
- Comer,D. Internetworking with TCP/IP volume I
- Comer,D. and Stevens,D. Internetworking with
TCP/IP volume II and volume III, Prentice Hall - Halsall, F. Data Communications, Computer
Networks and Open Systems, Addison Wesley - RFCs