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
HiGot thetime?2:00
TCP connection req.TCP connectionreply.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
service interface
peer interface
Li+1 Li+1
LiLi
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
Application
Presentation
Session
Transport
Network
Datalink
Physical
Application
Transport
Internetwork
Host to Network
FTP
TCP
IP
Ethernet
Telnet HTTP
UDP
PacketRadio
Point-to-Point
TCP/IP ModelOSI Ref Model TCP/IP Protocols
“Bottom-up” approach & “Top-down” approach
Layering: logical and physical communication
applicationtransportnetwork
link
applicationtransportnetwork
link
applicationtransportnetwork
link
applicationtransportnetwork
link
networklink
data
dataMMMM
Ht
HtHn
HtHnHl
MMMM
Ht
HtHn
HtHnHl
The Web: the http protocolhttp: 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 runningExplorer
Server running
Apache Webserver
Mac runningNavigator
http request
http re
quest
http response
http re
sponse
http exampleSuppose 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
1b. http server waits at port 80. “accepts” connection, notifying client
3. http server receives request message, forms response message, sends message into socket
time
http example (cont.)
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.
time
http request message: general format
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)
request line(GET, POST,
HEAD commands)header
linesCarriage return,
line feed indicates end of message
http message format: response
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 ...
status line(protocol
status codestatus phrase)
header lines
data, e.g., requestedhtml file
Web Caches (proxy 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
Goal: satisfy client request without involving origin server
client
Proxyserver
client
http request
http re
quest
http response
http re
sponse
http re
quest
http re
sponse
http requesthttp response
origin server
origin server
ftp: the file transfer protocol
• 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
FTPserver
FTPuser
interface
FTPclient
local filesystem
remote filesystem
user at host
TCP control connection
port 21
TCP data connectionport 20
TCP socketsSocket: a door between application process and end-to-
end-transport protocol (UCP or TCP)TCP service: reliable transfer of bytes from one process
to another
process
TCP withbuffers,
variables
socket
controlled byapplicationdeveloper
controlled byoperating
system
host orserver
process
TCP withbuffers,
variables
socket
controlled byapplicationdeveloper
controlled byoperatingsystem
host orserver
internet
Client/server socket interaction: TCP
wait for incomingconnection requestconnectionSocket =welcomeSocket.accept()
create socket,port=x, forincoming request:
welcomeSocket = ServerSocket()
create socket,connect to hostid, port=x
clientSocket = Socket()
closeconnectionSocket
read reply fromclientSocket
closeclientSocket
Server (running on hostid) Client
send request usingclientSocketread request from
connectionSocket
write reply toconnectionSocket
TCP connection setup
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
D
S
D
Must wait for the updates to be transmitted, processed and
new routing tables be built
Timer Based
Proactive
A new route request is sent and a new route is
found
On Demand
Reactive
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
Destination
Next Hop
Metric Sequence No
Install Time
A B 2 S406_A T001_D
B B 1 S128_B T001_D
C B 2 S564_C T001_D
D D 0 S710_D T001_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
A H
G
F
E
D
C
BD’s Routing Table
D’s Advertised Routing Table
Destination
Metric Sequence No
A 2 S406_A
B 1 S128_B
C 2 S564_C
E 2 S392_E
F 1 S076_F
G 2 S128_G
H 3 S050_H
DSDV Operation – Example (A moves)
A
H
G
F
E
D
C
B
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
A B
G
D
E
H
node discards packets having been seen
s
D
C
F
Source broadcasts a route packet with the address of the source and destination
A neighbor that receives the request looks up its route cache to look for a route to destination. If not found it appends its address into the packet and re-broadcasts it
A-BH
AH
A
H
A H
A-DH
A-C
H
DSR – Route Discovery
A B
G
D
E
H
s
C
F
A-B
-GH
A-B-E H
D
A-B-E
-FH
node discards packets having been seen
DSR – Route maintenance
A B
G
D
E
H
s
C
F
Reply packet follows the reverse path of the route request packet recorded in broadcast packet
A-B-G-H
DA-B-G-H
A-B
-G-H
Route Discovery: at source AA need to send to G
Lookup Cache for route A to G
Route found
?
Start Route Discovery Protocol
Route Discovery finished
Packet in
buffer? Send packet to next-hop
done
Buffer packet
no
Write route in packet header
yes
yes
no
Continue normal
processingwait
Route Discovery: At an intermediate node
Accept route request packet
<src-id> in recently
seen requests
list?
Discard route
request
yes
no
Host address
already in partial route?
Discard route
request
yes
Store <src-id> in list
Broadcast packet
Send route reply packet
done
my-Addr
=target?
noAppendmy-Addr to partial route
no
yes
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
Reference1. [RFC 4728] D. Johnson, Y. Hu and D. Maltz. The Dynamic
Source Routing Protocol (DSR) for Mobile Ad Hoc Networks for IPv4 [Feb. 2007]
2. R. Rajaraman. Topology control and routing in ad hoc networks: a survey. ACM SIGACT News [Volume 33 , Issue 2 (June 2002) ]
3. C. Perkins and P.Bhagwat. Highly Dynamic Destination Sequenced Distance Vector Routing (DSDV) for Mobile Computers. ACM Sigcomm 94
4. D. B. Johnson and D. A. Maltz, “Dynamic Source Routing in Ad-Hoc Wireless Networks,” In Mobile Computing, edited by T. Imielinski and H. Korth, Chapter 5, pages 153-181, Kluwer Academic Publishers, 1996.
5. Andrew S. Tanenbaum. Computer Networks 6. C. Pomalaza-Ráez. Ad Hoc Networks Routing7. R. Chow and T. Johnson. Distributed Operating Systems &
Algorithms. 1997