The Application Layer

Download Report

Transcript The Application Layer

Stephen Kim
[email protected]


Various services and flexibility
Network architectures
 Grouping a set of related function to a layer
 A set of protocols

Advantage of layered architectures
 Simplification
Interface
 Flexibility
Interface
Monolithic
ECE/IUPUI
Intro to Computer Communication Networks
Layered
2-2


Interaction between two peer entities
Server/Client
 Server – a process waiting a request
▪ Listening a specific port in TCP/IP
▪ Httpd (Apache™) , telnetd, ftpd, …
 Client – a process making a request
▪ A request to server address and the port number
▪ Netscape™, telnet, gftp, ws_ftp, …

A connection in a server/client model is a 5-tuple
 Protocol type,
 Source address,
 Destination address
 Source port number,
 destination port number
ECE/IUPUI
Intro to Computer Communication Networks
2-3
Server
Client
Listening on port 80
Request to 134.68.80.4:80
Connection established
Connection established
Send a request
GET/index.html HTTP 1.0
Send a result code
HTTP/1.1 200
Read and send the file
<html> <head> …
Disconnect the connection
ECE/IUPUI
Interpret and display the html
time
Intro to Computer Communication Networks
2-4

What if a request has a failure?
Need a connection-oriented service & a reliable underlying layer
HTTP
Server
Protocol
HTTP
Client
Interface
Interface
80
#n
TCP
ECE/IUPUI
Protocol
Intro to Computer Communication Networks
TCP
2-5

DNS (Domain Name System)

Convert an IP name to an IP address, or vice versa
 netlab.ece.iupui.edu  134.68.80.4
 UDP/IP - Connectionless

SMTP (Simple Mail Transfer Protocol)

TCP connection to local SMTP server
 Work as if connectionless for forwarding the message to remote SMTP server
ECE/IUPUI
Intro to Computer Communication Networks
2-6
International Organization for Standardization /
Open System Interconnection (IOS/OSI)
 Reference model, but not a real implementation
 A process on one machine at layer n




PDU contains a header and a payload called SDU (Service Data Unit)



Communicates with a peer process on the other machine
By exchanging PDU (Protocol Data Unit)
Header – control information
Payload – do not care
Layer n protocol - A set of rules governing the behavior of the layer n
Terminal A
Terminal B
n-PDU
n-SDU
Layer n
Entity
H
Layer n
Entity
H
n-SDU
n-PDU
ECE/IUPUI
Intro to Computer Communication Networks
2-7


Communication between two peer processes is not physical
The layer n+1 uses the services provided by layer n through layer n
interface, called SAP (Service Access Point).
Terminal A
Terminal B
(n+1)-PDU
layer
n+1
layer
n+1
(n+1)-PDU
n-SAP
n-SDU
n-SAP
H
layer
n
layer
n
H
ECE/IUPUI
n-SDU
n-PDU
Intro to Computer Communication Networks
2-8
Maximum PDU size of Ethernet is 1500 bytes
How can we send information larger than the maximum thru Ethernet?
 Segmentation




The layer n in a terminal can segment its payload into small pieces
Reassembly

The layer n in the other terminal put together the small pieces in a payload.
Host A
Host B
(n+1)-PDU
n-SDU H
ECE/IUPUI
n-SDU H
(n+1)-PDU
n-SDU H
Intro to Computer Communication Networks
n-SDU H
n-SDU H
n-SDU H
2-9


International Standard Organization /
Open Systems Interconnection
Principles
 A layer should be created where a different level of abstraction is needed.
 Each layer should perform a well defined function.
 The function of each layer should be chosen with an eye toward defining
internationally standardized protocols.
 The layer boundaries should be chosen to minimize the information flow
across the interfaces.
 The number of layers should be large enough that distinct function need not
be thrown together in the same layer out of necessity.
 The number of layers should be small enough that the architecture does not
become unwieldy.

7 Layers
ECE/IUPUI
Intro to Computer Communication Networks
2-10
Application Protocol
Layer 7
Application
Layer 6
Presentation
Layer 5
Session
Presentation Protocol
Session Protocol
Transport Protocol
Application
Presentation
Session
Layer 4
Transport
Layer 3
Network
Network
Network
Network
Layer 2
Data Link
Data Link
Data Link
Data Link
Layer 1
Physical
Physical
Physical
Physical
ECE/IUPUI
Communication network boundary
Network layer host-router protocol
Data link layer host-router protocol
Physical layer host-router protocol
Intro to Computer Communication Networks
Transport
2-11


Deal with the transfer of raw bits over communication channel
Electrical aspects
 Voltage level
 Signal duration

Mechanical aspects
 Socket type
 Number of pines

Examples
 Twisted copper wire – telephone wire, 10/100BaseT, …
 Coaxial cable – CATV, 10Base2, 10Base5, …
 Radio – cellular phone, Wi-Fi, Bluetooth, Zigbee, WiMax, WiBro, …
 Optical fiber – WDM, DWDM,
ECE/IUPUI
Intro to Computer Communication Networks
2-12


Deal with the transfer of frames
Framing information

Boundary of the frame
▪


Control and address information
Check bit for recovering from transmission errors
▪
▪

prevent a fast transmitter from drowning a slow receiver in data
Broadcast networks


control access to the shared channel
LAN
▪
▪

acknowledge frames
handle with damaged, lost, and duplicate frames
Flow controls
▪

attaching special bit patterns to the beginning and end of the frame
Sub-layer: Medium Access Control layer (MAC)
One-to-one communication over broadcast medium
Examples



ECE/IUPUI
HDLC – High-level Data Link Control
PPP – Point-to-Point Protocol
SONET – Synchronous Optical Network
Intro to Computer Communication Networks
2-13


Transfer of data (packet) over networks
Routing
 Select a path from the source to the destination thru many intermediate




network components as switches and routers.
Static routing vs. dynamic routing
Deal with congestion – temporary traffic surges in a network components
forming bottlenecks
Differentiation of packet types
Heterogeneous Network
▪ Different address scheme
▪ Maximum Transfer Unit (MTU)
 Political routing
▪ Inter-office emails between Microsoft branches shouldn’t pass through Netscape’s
routers.

Billing
ECE/IUPUI
Intro to Computer Communication Networks
2-14
Responsible for the end-to-end transfer of message
Segmentation and reassembly
 Error-free transfer



Error detection and recovery
 Sequencing
 Flow control

Establishing and releasing connections

Multiple connections for high throughputs
 Multiplexing a connection among many session layers for reducing the cost

Type of Services

Connection-oriented services – error-free point-to-point channel
 Connectionless services – no guarantee on the correct delivery of the message

Example

ECE/IUPUI
Unix socket interface
Intro to Computer Communication Networks
2-15


Enhance a reliable transfer service
Control how data is exchanged
 manage dialogue control
▪ full duplex
▪ half duplex

Examples
 Log in to a remote system
 Transfer a file between two machine
 Token management
▪ both side do not attempt the same operation at the same time.
 Synchronization
▪ Two-hour file transfer with one-hour mean time crashes
▪ The whole transfer would start over again
▪ Insert checkpoints into the data stream
▪ After a crash, continue after the last checkpoint
ECE/IUPUI
Intro to Computer Communication Networks
2-16
Concern with the syntax and sematic of the information
Overcome the difference in data representation
Resolve machine-dependencies
Character code




 ASCII, EBCDIC, Unicode, …
Big endian or little endian

32-bit word like an integers
SUN Sparc, MIPS
4
3
2
1
Intel x86, Dec Alpha
1
2
3
4
The POWER Processor can be configured as either big endian or little endian
ECE/IUPUI
Intro to Computer Communication Networks
2-17


To provide network services
Example
 HTTP – web browsing application
 FTP – File transfer between two different systems
▪ different file name convention
▪ different ways of representing text lines
 SMTP – Electronic mail
 Virtual terminals – vt100, TN 3270, xterm
ECE/IUPUI
Intro to Computer Communication Networks
2-18
sending
process
data
Application
data
Presentation
data
DT
Session
SH
data
Network
Presentation
PH
data
Transport
Physical
Application
AH
data
Session
Data Link
receivng
process
data
Transport
TH
Network
NH
DH
Bits
Data Link
Physical
actual data transmission path
ECE/IUPUI
Intro to Computer Communication Networks
2-19

History


Successor of ARPANET (Defense Advanced Research Project Agency)
Principles

Robustness
▪ If failures occurs in the network, the packets are routed around the failure point.
▪ Multiple paths and globally unique address.



Flexibility – No Data link layer or physical layer defined
Packet switching networks
Best-effort connectionless in the Network layer
▪ “I will do my best to transfer your data, though I cannot guarantee their quality and delivery”
▪ IP packets are exchanged between routers without a connection setup.

Two services in the Transport layer
▪ TCP – reliable connection-oriented transfer
▪ UDP – unreliable connectionless transfer

Applications

ECE/IUPUI
remote login, e-mail, file transfer, network management
Intro to Computer Communication Networks
2-20
OSI
TCP/IP
Application
Application
Presentation
Not present
in the model
Session
Transport
TCP,UDP
Network
IP
Data Link
Network
Interface
Layer
Physical
ECE/IUPUI
Intro to Computer Communication Networks
2-21
TELNET
FTP
SMTP
TCP
DNS
RTP
Application
UDP
IP
Transport
ICMP
Network
ARP
X.25
ECE/IUPUI
ATM
FR
ETHER
Intro to Computer Communication Networks
Network
Interface
2-22

Each host (NIC) is assigned by a globally unique IP address (32-bit)

IP address = network address + host address
 A net mask is used to calculate them

Each host (NIC) is also assigned by a machine address, or a physical address

Meaningful in one network by router
 Ethernet uses 6-octect (48-bit).
 ATM uses 16-octect.

Router – consists of two or more network interfaces
APP
TCP
IP
NI
ECE/IUPUI
router
IP
NI
NI
Intro to Computer Communication Networks
APP
TCP
IP
NI
2-23
data
data
IP
(1,2)
IP
(1,3)
data
1,2
data
1,3
NI
3487
1,3
NI
6537
data
ECE/IUPUI
1,2
3487
6537
Intro to Computer Communication Networks
2-24
data
data
Router
Host A
IP
(1,2)
data
IP
(1,1)
1,2
2,5
data
NI
3487
data
ECE/IUPUI
Host B
NI
6543
IP
(2,5)
(2,3)
1,2
data
2,5
NI
1002
3487
6543
Intro to Computer Communication Networks
1,2
2,5
NI
3903
data
1002
3903
2-25
Data
Source Port #,
Destin Port #
Source IP addr,
Destin IP addr,
Protocol type
Source PH addr,
Destin PH addr,
Network protocol type
ECE/IUPUI
Ethernet
Header
TCP
Header
IP
Header
TCP Payload
IP Payload
Ethernet Payload
Intro to Computer Communication Networks
Ethernet
Tail
2-26



A process waiting a packet on a specific port number
Duplicate a connection after establishing
Connection?

5 tuple – (PT, SA, SP, DA, DP)
▪



ECE/IUPUI
protocol type, source address, source port, destin address, destin port.
A server waits on (pt, sa, sp, any-DA, any-DP)
Upon a request from the client, any-DA and any-DP are filled with specific value.
Server Port Number – 0 to 1023 are reserved to well-known services.
Protocol
Reserved Port #
Comments
FTP
21
File Transfer
telnet
23
remote login
SMTP
25
E-mail
DNS
53
Domain name system
HTTP
80
World Wide Web
Intro to Computer Communication Networks
2-27

API – interface available to programmer
 socket(), bind(), listen(), accept(), connect(),
sendto(), recvfrom(), htonl(), htons(), ntohl(),
ntohs()
 Utility function - gethostbyname(), gethostbyaddr()

Support multiple communication protocols





Internet Domain
Unix Domain
Xerox NS Domain (XNS)
ATM Domain (Recent progress in several implementation)
References
 Richard Stevens, “Unix Network Programming”, or
 http://en.wikipedia.org/wiki/Internet_socket
ECE/IUPUI
Intro to Computer Communication Networks
2-28