Title: Layered Protocol
1Layered Protocol
- Simple idea
- Agreements
- 0-bit/1-bit volts
- Last bit of the message
- Message has been damaged or lost
- Numbers, strings, data length
2Layered Protocol
3Layered Protocol
- Why layered structure?
- To reduce complexity and ease to modify
- Once the service is defined, the higher layer is
shielded from implementation details of its lower
layer - Each protocol is independent of the others
- Number of layers, the name, the contents, and
functions of each layer differs for each network
4Layered Protocol
- Protocol
- A set of rules exchanged between peer entities
within a layer tells what a layer works - Connection-Oriented
- Messages are delivered in order
- Connection establishment, Information transfer,
Connection release - Connectionless
- Each message is delivered independent of the
others, and may be out of order
5Layered Protocol
- Typical message as it appears on the network
6Physical Layer
- Concerned with transmitting raw bits over a
channel - Mechanical interface connector type, meaning of
each pin, etc. - Electrical interface voltage level of 0 and 1,
bit interval, etc. - Procedural interface
- Physical transmission medium
7Data Link Layer
- Deals with error-free transmission between sender
and receiver - Framing special bit patters at the beginning of
a frame - Error control for damaged, lost, and duplicate
frames - Flow control
8Data Link Layer
- Discussion between a receiver and a sender
9Network Layer
- Concerned with the operation of subnet
- Routing determines an outgoing link on the best
path to destination - Congestion control to avoid a congestion within
the subnet - IP packet Connectionless protocol
- Virtual channel Connection-oriented protocol
- Virtual path group of virtual channel
10Transport Layer
- Concerned with end-to-end reliable communication
- Multiple network connection to improve throughput
- Multiplexing several transport connection onto
same net connection - type of service (at the time of connection
set-up) - in-order delivery, delivery without guarantee
about the order, broadcasting etc. - Flow control between hosts
11Transport Layer
- TCP (Transmission Control Protocol)
- Connection-oriented protocol
- Provides a reliable end-to-end byte stream
- Dynamically adapting to the unreliable
internetwork and to be robust in the face of many
kinds of failures - UDP (Universal Datagram Protocol)
- Connectionless protocol
- Used for client-server applications
12Client-Server TCP
- Normal operation of TCP Transactional TCP
13Session and Presentation Protocol
- Session Layer concerned with controlling a
session (or a dialogue) - A session service can be an ordinary transport
service, or some enhanced one. - Dialogue control, token management, etc.
- Presentation Layer concerned with
representation of information - Compression
- Encryption
- Encoding the representation used inside a
computer needs to be converted to abstract data
structure (or net standard representation)
14Application Protocols
- Concerned with particular protocols commonly
needed - Virtual terminal
- FTP (File Transfer Protocol)
- HTTP (HyperText Transfer Protocol)
- Electronic mail
- Remote job entry
- Directory look up etc.
15Middleware Protocols
- Support high-level communication services
- Transfer real-time data
- Reliable multicasting services
16Remote Procedure Call
- Exist Problems
- Procedures run on different machines
- Execute in different address spaces
- Parameters and results have to be passed
- ? Both machines can crash
17Conventional Procedure Call
- Count read(fd, buf, nbytes)
18Conventional Procedure Call
- Call by value
- Copy to the stack
- Not affect the original value
- Call by reference
- Pointer to variable
- Modify the calling procedure
- Call by copy/restore
- Copy to the stack
- Overwriting the original value
19Client and Server Stubs
- Principle of RPC between a client and server
program
20Client and Server Stubs
- Client procedure calls client stub in normal way
- Client stub builds message, calls local OS
- Client's OS sends message to remote OS
- Remote OS gives message to server stub
- Server stub unpacks parameters, calls server
- Server does work, returns result to the stub
- Server stub packs it in message, calls local OS
- Server's OS sends message to client's OS
- Client's OS gives message to client stub
- Stub unpacks result, returns to client
21Passing Value Parameters
- Parameter marshaling Packing parameter into a
message
22Passing Value Parameters
- Little endian Big endian Invert
- Original message on the Pentium
- The message after receipt on the SPARC
- The message after being inverted. The little
numbers in boxes indicate the address of each byte
23Passing Reference Parameters
- How are Pointers, or in general, references
passed? - Forbid pointers and reference parameters in
general - Call-by-reference have been replace by
copy/restore - Input Need not be copied back
- Output Need not be sent over in the first place
- We can now handle pointers
24Parameter Specification and Stub Generation
- A procedure
- The corresponding message.
25Parameter Specification and Stub Generation
- Interface Definition Language(IDL)
- An interface specified in such an IDL, is then
subsequently compiled into a client stub and a
server stub, along with the appropriate
compile-time or run-time interfaces.
26Doors
27Asynchronous RPC
- The interconnection between client and server in
a traditional RPC - The interaction using asynchronous RPC
28Asynchronous RPC
- A client and server interacting through two
asynchronous RPCs
29Introduction to DCE
- Distributed File Service
- Provides a transparent way of accessing any file
in the system in the same way - Directory Service
- Keep track of the location of all resources in
the system - Security Service
- Access can be restricted to authorized persons
- Distributed Time Service
- Keep clocks on the different machines globally
synchronized
30Goals of DCE RPC
- The RPC system can automatically handle data type
conversions between the client and the server - Ability to hide the details, clients and servers
are highly independent of one another - Binding Automatically locate the correct
server, Set up the communication
31Writing a Client and a Server
32Binding a Client to a Server
- Performing an RPC
- At-most-once operation
33Distributed Objects
34Compile-time versus Runtime Objects
- Compile-time
- Easier to build distributed application
- ex) Java
- RunTime
- Use an object adapter
- Dynamically bind
35Persistent and Transient Objects
- Persistent object
- Continues to exist
- Not dependent on its current server
- Transient object
- Server exits, the object ceases to exist
36Binding a Client to an Object
Distr_object obj_ref //Declare a systemwide
object referenceobj_ref // Initialize the
reference to a distributed objectobj_ref-gt
do_something() // Implicitly bind and invoke a
method (a) Distr_object objPref //Declare a
systemwide object referenceLocal_object
obj_ptr //Declare a pointer to local
objectsobj_ref //Initialize the reference
to a distributed objectobj_ptr
bind(obj_ref) //Explicitly bind and obtain a
pointer to the local proxyobj_ptr -gt
do_something() //Invoke a method on the local
proxy (b)
- Implicit binding using only global references
- Explicit binding using global and local references
37Implementation of Object References
- Server crashes and assign a different endpoint
after recovery - Location server
- Server may simultaneously support several kind
data coming - Implementation handle
38Static versus Dynamic Remote Method Invocations
- Remote Method Invocations (RMI)
- Similar to RPC
- Support systemwide object reference
- Static Invocation
- If interfaces change then client application must
recompile - Dynamic Invocation
- Invocation at runtime
39Parameter Passing
40The DCE Distributed-Object Model
- Distributed dynamic object Distributed
named object
41DCE Remote Object Invocation
42The Java Distributed-Object Model
43Java Remote Object Invocation