Communication Network Protocols

Download Report

Transcript Communication Network Protocols

Communication Network
Protocols
Qiong Cheng
CSC 8320 (Fall 2007)
Outline
•
•
•
•
Network Protocols
OSI Protocol Suite
TCP/IP Protocol Suite
Protocol Examples in Internet Network and
Ad Hoc Network
• References
Network protocols
• Network protocols are sets of rules :
To regulate the exchange of messages
To provide a reliable communication
• Human protocol vs network protocol:
Hi
Hi
Got the
time?
2:00
TCP connection
req.
TCP connection
reply.
Get http://www.rpi.edu/index.htm
<file>
time
Network protocols are organized into a bunch
of layers!
Protocol Suit & Protocol Implementation
• Layers for a standardized network architecture and the
associated protocols are referred as protocol suite.
• Each protocol object has function specification and two
different interfaces
– service interface: defines operations on this protocol
– peer-to-peer interface: defines messages exchanged
with peer
Li+1
Li+1
service interface
Li
peer interface
Li
Abstraction and transparency are the keys of protocol
design
OSI Protocol Suite
Physical Layer
• Specify the electrical and mechanical characteristics of
physical communication link between a pair of nodes.
– Provide a reliable logical bit pipe
– Bit synchronization
– Coding method, the modulation technique, and wire and
connector specification.
– Interface standards for data link layer.
R. Chow and T. Johnson. Distributed Operating Systems & Algorithms. 1997
Data Link Layer
• Ensure reliable transfer of groups of bits (called
frames)
• Handle configuration setup, error controls,
sequencing and flow control of frames
–
–
–
–
Full duplex vs. Half duplex
Errors
Sequencing
Flow control
Data Link Layer (cont.)
“link”
Network Layer
Send packets across the network through several link
segments
– Routing
• Packet-by-packet / datagram-by-datagram
• Static routing decision / dynamic routing decision
• Centralized routing decision / decentralized one
• Multiple path routing
– Maintain the quality of service requested by the
transport layer
– Error and flow control
Transport Layer
• Only interface between the communication sub network and the
higher network-independent layers
– Reliable end-to-end communication;
– Transparency of network-dependent faults or problems;
– Carry communication sessions;
– Break message into packets;
• The OSI protocol suite implements two types of services at the
transport layer: connection-oriented transport service and
connectionless transport service.
Session Layer
• The session layer adds additional dialog and
synchronization services to transport layer
– Dialog : to facilitate the establishment of sessions
– Synchronization : to allow processes to insert
checkpoints for efficient recovery from system
crashes.
Presentation Layer
• Provide data encryption, compression, and code
conversion for messages that use different coding
schemes.
Application Layer
• The application layer is the OSI layer closest to the end user, which
means that both the OSI application layer and the user interact
directly with the software application.
• Some examples : Telnet, File Transfer Protocol (FTP), and Simple
Mail Transfer Protocol (SMTP), DNS, Web/Http.
Client - Server
Peer-to-peer
Reference Models for Layering
OSI Ref Model
Application
Presentation
Session
Transport
Network
Datalink
Physical
TCP/IP Protocols
TCP/IP Model
FTP Telnet HTTP
Application
TCP
UDP
Transport
IP
Internetwork
EtherPacketPoint-tonet Radio Point
Host to
Network
“Bottom-up” approach & “Top-down” approach
Layering: logical and physical
communication
M
Ht M
Hn Ht M
Hl Hn Ht M
data
application
transport
network
link
application
transport
network
link
network
link
application
transport
network
link
data
application
transport
Ht
network
Hn Ht
link
Hl Hn Ht
M
M
M
M
The Web: the http protocol
http: hypertext transfer
protocol
• Web’s application layer
protocol
• client/server model
– client: browser that
requests, receives,
“displays” Web
objects
– server: Web server
sends objects in
response to requests
• http1.0: RFC 1945
• http1.1: RFC 2068
PC running
Explorer
Server
running
Apache Web
server
Mac running
Navigator
http example
Suppose user enters URL www.gsu.edu/College/index.html
1a. http client initiates
TCP connection.
Port 80.
2. http client sends http
request message into
TCP connection socket
time
1b. http server waits at port 80.
“accepts” connection,
notifying client
3. http server receives request
message, forms response
message, sends message
into socket
http example (cont.)
time
5. http client receives
response message,
displays html.
Parsing html file, finds
10 referenced jpeg
objects
6. Steps 1-5 repeated for
each of 10 jpeg objects
4. http server closes TCP
connection.
http request message: general
format
request line
(GET, POST,
HEAD commands)
header
lines
Carriage return,
line feed
indicates end
of message
GET www.gsu.edu/College/index.htmlHTTP/1.0
User-agent: Mozilla/4.0
Accept: text/html, image/gif, image/jpeg
Accept-language : fr
(extra carriage return, line feed)
http message format: response
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
html file
HTTP/1.0 200 OK
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 1998 …...
Content-Length: 6821
Content-Type: text/html
data data data data data ...
Web Caches (proxy server)
Goal: satisfy client request without involving origin server
Client sends all http
requests to web cache
– if object at web cache,
web cache returns
object
– else requests object
from origin server,
then returns http
response to client
origin
server
client
client
Proxy
server
origin
server
ftp: the file transfer protocol
user
at host
FTP
FTP
user
client
interface
TCP control connection
port 21
local file
system
TCP data connection
port 20
FTP
server
remote file
system
• Two parallel TCP connections opened:
• Control: exchange commands, responses between
client and server.
• Data: file data to/from server
• ftp server maintains “state”: current directory, earlier
authentication
• ftp: RFC 959
• ftp server: port 21
TCP sockets
Socket: a door between application process and end-toend-transport protocol (UCP or TCP)
TCP service: reliable transfer of bytes from one process
to another
controlled by
application
developer
controlled by
operating
system
process
process
socket
TCP with
buffers,
variables
host or
server
internet
socket
TCP with
buffers,
variables
host or
server
controlled by
application
developer
controlled by
operating
system
Client/server socket interaction: TCP
Server (running on hostid)
Client
create socket,
port=x, for
incoming request:
welcomeSocket =
ServerSocket()
wait for incoming
connection request
TCP
connection setup
connectionSocket =
welcomeSocket.accept()
read request from
create socket,
connect to hostid, port=x
clientSocket =
Socket()
send request using
clientSocket
connectionSocket
write reply to
connectionSocket
read reply from
clientSocket
close
connectionSocket
close
clientSocket
Ad Hoc Networks Dynamic Topology
Node mobility in Ad Hoc
networks has had a great effect
in the designing of routing
protocols
Node mobility creates a dynamic
topology, i.e., changes in the
connectivity between the nodes as a
direct function of the distance between
each other
R. Rajaraman. Topology control and routing in ad hoc networks:
a survey. ACM SIGACT News [Volume 33 , Issue 2 (June 2002) ]
Mobility (proactive vs. reactive)
S
S
D
D
Proactive
Reactive
Timer Based
Must wait for the updates to
be transmitted, processed and
new routing tables be built
On Demand
A new route request is
sent and a new route is
found
Destination Sequenced Distance
Vector (DSDV)
• Routing tables define the number of hops for
every network destination
• Nodes communicate their routing table to
their neighbors periodically and when there is
a significant new information available
• Routing information is normally transmitting
using a broadcasting or multicasting mode
C. Perkins and P.Bhagwat. Highly Dynamic Destination
Sequenced Distance Vector Routing (DSDV) for Mobile
Computers. ACM Sigcomm 94
DSDV Operation - Example
D
F
E
B
D’s Routing Table
G
C
H
A
Destinat
ion
Next
Hop
A
B
B
C
Metric Sequence
D’s Advertised Routing Table
No
Install
Time
2
S406_A
T001_D
Destin
ation
B
1
S128_B
T001_D
A
2
S406_A
B
2
S564_C
T001_D
B
1
S128_B
T001_D
C
2
S564_C
E
2
S392_E
F
1
S076_F
G
2
S128_G
H
3
S050_H
D
D
0
S710_D
E
F
2
S392_E
T002_D
F
F
1
S076_F
T001_D
G
F
2
S128_G
T002_D
H
F
3
S050_H
T002_D
Metric Sequenc
e No
DSDV Operation – Example (A
moves)
D
F
E
B
G
C
H
A
A
•
•
•
•
•
When A moves and it is detected by G and H
G and H advertise their updated routing information
All neighbor nodes update routing table
These neighbor nodes advertise to their neighbors
Termination when destination is reached
Dynamic Source Routing (DSR)
• If the sender doesn’t have a route to a
destination it then attempts to find out by using
a routing discovery process
• While waiting for the routing discovery to
complete the sender continues sending and
receiving packets with other hosts
• Each host uses a route maintenance
procedure to monitor the correct operation of a
route
D. Johnson, Y. Hu and D. Maltz. The Dynamic Source Routing Protocol (DSR)
for Mobile Ad Hoc Networks for IPv4 [Feb. 2007]
DSR – Route Discovery
Source broadcasts a
route packet with the
address of the source
and destination
s
A
A
B
H
C
D
node discards packets having
been seen
E
H D
A neighbor that receives
the request looks up its
route cache to look for a
route to destination. If not G
found it appends its
address into the packet and
re-broadcasts it
F
DSR – Route Discovery
s
A
B
H D
C
G
D
E
F
node discards
packets having
been seen
DSR – Route maintenance
Reply packet follows the reverse path of the
route request packet recorded in broadcast
packet
s
A
B
A-B-G-H
H D
C
G
D
E
F
Route Discovery: at source A
A need to send to G
Lookup Cache for route A to G
Start Route
Discovery
Protocol
wait
Route
Discovery
finished
no
Buffer
packet
Continue
normal
processing
Route
found?
yes
yes
Packet
in
buffer?
Write route in
packet header
no
don
e
Send
packet to
next-hop
Route Discovery: At an intermediate node
<src-id> in
recently
seen
requests list?
Accept route
request packet
yes
Discard
route
request
no
Host
address
already in
partial
route?
Append
my-Addr to
partial route
Store <src-id> in
list
Broadcast packet
no
no
myAddr
=target?
yes
Send route
reply packet
done
yes
Discard
route
request
DSR header format
- Route Request Option
DSR header format
- Route Reply Option
DSR header format
- Source Route Option
DSR header format
- Acknowledgement Option
DSR header format
- Acknowledgement Request
Option
DSR header format
- Error Option
Reference
1.
2.
3.
4.
5.
6.
7.
[RFC 4728] D. Johnson, Y. Hu and D. Maltz. The Dynamic Source
Routing Protocol (DSR) for Mobile Ad Hoc Networks for IPv4
[Feb. 2007]
R. Rajaraman. Topology control and routing in ad hoc networks: a
survey. ACM SIGACT News [Volume 33 , Issue 2 (June 2002) ]
C. Perkins and P.Bhagwat. Highly Dynamic Destination
Sequenced Distance Vector Routing (DSDV) for Mobile
Computers. ACM Sigcomm 94
D. B. Johnson and D. A. Maltz, “Dynamic Source Routing in AdHoc Wireless Networks,” In Mobile Computing, edited by T.
Imielinski and H. Korth, Chapter 5, pages 153-181, Kluwer
Academic Publishers, 1996.
Andrew S. Tanenbaum. Computer Networks
C. Pomalaza-Ráez. Ad Hoc Networks Routing
R. Chow and T. Johnson. Distributed Operating Systems &
Algorithms. 1997